diff --git a/src/views/Editor/Toolbar/ElementAnimationPanel.vue b/src/views/Editor/Toolbar/ElementAnimationPanel.vue index 69220c53..ff42b55f 100644 --- a/src/views/Editor/Toolbar/ElementAnimationPanel.vue +++ b/src/views/Editor/Toolbar/ElementAnimationPanel.vue @@ -107,6 +107,13 @@ + + @@ -171,7 +178,7 @@ const tabs: TabItem[] = [ { key: 'attention', label: '强调', color: '#e8b76a' }, ] const activeTab = ref('in') - +const animateIn = ref(false) watch(() => handleElementId.value, () => { animationPoolVisible.value = false }) @@ -248,6 +255,18 @@ const runAnimation = (elId: string, effect: string, duration: number) => { } } +// 执行所有动画预览 +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) => { if (duration < 100 || duration > 5000) return