Skip to content

Commit 3e06831

Browse files
committed
refactor: remove outdated animation examples for confetti and keyframe animations; streamline code in Vue components for improved performance and maintainability
1 parent a1a1237 commit 3e06831

File tree

4 files changed

+3
-170
lines changed

4 files changed

+3
-170
lines changed

docs/examples/gsap/demo/animation_confetti.ts

Lines changed: 0 additions & 102 deletions
This file was deleted.

docs/examples/gsap/demo/animation_confetti.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ interface Dot {
2121
2222
const dots = ref<Dot[]>([])
2323
let dotIdCounter = 0
24+
let timeline: gsap.core.Timeline | null = null
2425
2526
const textFilter = new DropShadowFilter({
2627
color: 'black',
@@ -57,7 +58,7 @@ function animateDot(dotRef: GraphicsElement, dot: Dot) {
5758
scale: 0,
5859
})
5960
60-
gsap
61+
timeline = gsap
6162
.timeline({
6263
onComplete: () => {
6364
const index = dots.value.findIndex(d => d.id === dot.id)
@@ -97,6 +98,7 @@ useEventListener(stage, 'click', (event) => {
9798
9899
onUnmounted(() => {
99100
dots.value = []
101+
timeline?.kill()
100102
})
101103
</script>
102104

docs/examples/gsap/demo/animation_keyframe.ts

Lines changed: 0 additions & 66 deletions
This file was deleted.

docs/examples/gsap/demo/animation_keyframe.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ onUnmounted(() => animation?.kill())
5454
container.y = screen.height / 2 - container.height / 2 + size / 2
5555
}">
5656
<graphics v-for="i in 4" :key="i" ref="boxes" :x="(i - 1) * 120" @effect="graphics => {
57-
const size = 75
5857
graphics
5958
.roundRect(-size / 2, -size / 2, size, size, 8)
6059
.fill(0xED427C)

0 commit comments

Comments
 (0)