From 254bb0c7c30d772584ab6fab82afcbe0e6789eab Mon Sep 17 00:00:00 2001 From: linmingqi <2320447654@qq.com> Date: Thu, 30 Nov 2023 10:38:19 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat:=E6=B7=BB=E5=8A=A0=E5=8F=AF=E9=A2=84?= =?UTF-8?q?=E8=A7=88=E5=85=A8=E9=83=A8=E5=85=83=E7=B4=A0=E5=8A=A8=E7=94=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Editor/Toolbar/ElementAnimationPanel.vue | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/views/Editor/Toolbar/ElementAnimationPanel.vue b/src/views/Editor/Toolbar/ElementAnimationPanel.vue index 69220c53..4de5cabd 100644 --- a/src/views/Editor/Toolbar/ElementAnimationPanel.vue +++ b/src/views/Editor/Toolbar/ElementAnimationPanel.vue @@ -107,6 +107,9 @@ + @@ -171,7 +174,7 @@ const tabs: TabItem[] = [ { key: 'attention', label: '强调', color: '#e8b76a' }, ] const activeTab = ref('in') - +const animateIn = ref(false) watch(() => handleElementId.value, () => { animationPoolVisible.value = false }) @@ -247,6 +250,17 @@ const runAnimation = (elId: string, effect: string, duration: number) => { elRef.addEventListener('animationend', handleAnimationEnd, { once: true }) } } +// 执行所有动画预览 +const runAllAnimation = async () => { + animateIn.value = !animateIn.value + for (let i = 0; i < animationSequence.value.length; i++) { + if (!animateIn.value) break + const item = animationSequence.value[i] + if (item.index !== 1 && item.trigger !== 'meantime') await new Promise(resolve => setTimeout(resolve, item.duration + 100)) + runAnimation(item.elId, item.effect, item.duration) + if (i === animationSequence.value.length - 1) animateIn.value = false + } +} // 修改元素动画持续时间 const updateElementAnimationDuration = (id: string, duration: number) => { From d955509972691ceaeb13bea2ae1be15cec4cbce9 Mon Sep 17 00:00:00 2001 From: pipipi-pikachu Date: Tue, 5 Dec 2023 21:12:21 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=E6=89=A7=E8=A1=8C=E5=85=A8=E9=83=A8?= =?UTF-8?q?=E5=85=83=E7=B4=A0=E5=8A=A8=E7=94=BB=E9=A2=84=E8=A7=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/Editor/Toolbar/ElementAnimationPanel.vue | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/views/Editor/Toolbar/ElementAnimationPanel.vue b/src/views/Editor/Toolbar/ElementAnimationPanel.vue index 4de5cabd..ff42b55f 100644 --- a/src/views/Editor/Toolbar/ElementAnimationPanel.vue +++ b/src/views/Editor/Toolbar/ElementAnimationPanel.vue @@ -107,9 +107,13 @@ - + + @@ -250,6 +254,7 @@ const runAnimation = (elId: string, effect: string, duration: number) => { elRef.addEventListener('animationend', handleAnimationEnd, { once: true }) } } + // 执行所有动画预览 const runAllAnimation = async () => { animateIn.value = !animateIn.value @@ -258,7 +263,7 @@ const runAllAnimation = async () => { const item = animationSequence.value[i] if (item.index !== 1 && item.trigger !== 'meantime') await new Promise(resolve => setTimeout(resolve, item.duration + 100)) runAnimation(item.elId, item.effect, item.duration) - if (i === animationSequence.value.length - 1) animateIn.value = false + if (i >= animationSequence.value.length - 1) animateIn.value = false } }