From 173ee4bb0eb970b0f619233ee7cec649e90d510f Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 9 Nov 2017 13:33:41 +0900 Subject: [PATCH] =?UTF-8?q?=E3=82=B9=E3=83=A9=E3=82=A4=E3=83=89=E3=82=B7?= =?UTF-8?q?=E3=83=A7=E3=83=BC=E3=82=92=E3=83=A9=E3=83=B3=E3=83=80=E3=83=A0?= =?UTF-8?q?=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/web/app/desktop/tags/home-widgets/slideshow.tag | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/web/app/desktop/tags/home-widgets/slideshow.tag b/src/web/app/desktop/tags/home-widgets/slideshow.tag index f70238860..aa1e45fad 100644 --- a/src/web/app/desktop/tags/home-widgets/slideshow.tag +++ b/src/web/app/desktop/tags/home-widgets/slideshow.tag @@ -100,14 +100,12 @@ this.change = () => { if (this.images.length == 0) return; - if (this.index >= this.images.length) this.index = 0; - const img = `url(${ this.images[this.index].url }?thumbnail&size=1024)`; + const index = Math.floor(Math.random() * this.images.length); + const img = `url(${ this.images[index].url }?thumbnail&size=1024)`; this.refs.slideB.style.backgroundImage = img; - this.index++; - anime({ targets: this.refs.slideB, opacity: 1, @@ -136,8 +134,7 @@ }).then(images => { this.update({ fetching: false, - images: images, - index: 0 + images: images }); this.refs.slideA.style.backgroundImage = ''; this.refs.slideB.style.backgroundImage = '';