mirror of
https://github.com/pipipi-pikachu/PPTist.git
synced 2025-04-15 02:20:00 +08:00
Merge branch 'master' of github.com:rewhtie/PPTist into rewhtie-master
This commit is contained in:
commit
61b1752e38
@ -107,6 +107,9 @@
|
||||
</div>
|
||||
</template>
|
||||
</Draggable>
|
||||
<Button class="animation-preview" @click="runAllAnimation" v-if="animationSequence.length >= 2">
|
||||
<IconPlayOne style="margin-right:5px" />{{ animateIn ? '停止' : '预览'}}
|
||||
</Button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -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) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user