From 4ab38b7894f725d17012a6fdf6552a5c075e5cd9 Mon Sep 17 00:00:00 2001 From: tamaina Date: Wed, 12 Feb 2020 00:38:29 +0900 Subject: [PATCH] =?UTF-8?q?=E3=82=BF=E3=82=A4=E3=83=A0=E3=83=A9=E3=82=A4?= =?UTF-8?q?=E3=83=B3=E3=82=92=E6=94=BE=E7=BD=AE=E3=81=99=E3=82=8B=E3=81=A8?= =?UTF-8?q?=E5=85=88=E9=A0=AD=E3=81=AE=E6=8A=95=E7=A8=BF=E3=81=8C=E8=A6=8B?= =?UTF-8?q?=E3=81=88=E3=81=AA=E3=81=8F=E3=81=AA=E3=82=8B=E3=81=AE=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=20Fix=20#5903=20(#5913)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * seqent fix * comment * :v: --- src/client/components/sequential-entrance.vue | 25 ++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/src/client/components/sequential-entrance.vue b/src/client/components/sequential-entrance.vue index a09d67f1c..c909b5172 100644 --- a/src/client/components/sequential-entrance.vue +++ b/src/client/components/sequential-entrance.vue @@ -40,22 +40,29 @@ export default Vue.extend({ i: 0, methods: { beforeEnter(el) { + if (document.hidden) return; + el.style.opacity = 0; el.style.transform = this.direction === 'down' ? 'translateY(-64px)' : 'translateY(64px)'; - let index = this.$options.i; - const delay = this.delay * index; + const delay = this.delay * this.$options.i; el.style.transition = [getComputedStyle(el).transition, `transform 0.7s cubic-bezier(0.23, 1, 0.32, 1) ${delay}ms`, `opacity 0.7s cubic-bezier(0.23, 1, 0.32, 1) ${delay}ms`].filter(x => x != '').join(','); this.$options.i++; - }, - enter(el, done) { + setTimeout(() => { + el.style.transition = ''; + this.$options.i--; + }, delay + 710); + }, + enter(el) { + if (document.hidden) { + el.style.opacity = 1; + el.style.transform = 'translateY(0px)'; + return; + }; + + setTimeout(() => { // 必要 el.style.opacity = 1; el.style.transform = 'translateY(0px)'; - el.addEventListener('transitionend', () => { - el.style.transition = ''; - this.$options.i--; - done(); - }, { once: true }); }); }, leave(el) {