starting to animate imagesection

This commit is contained in:
T-A-H-prog
2026-03-08 14:00:52 +01:00
parent 57927e4419
commit 8c8568a4b5
3 changed files with 59 additions and 5 deletions

View File

@@ -3,6 +3,8 @@ import { onMounted, onUnmounted, ref } from "vue"
import gsap from "gsap"
import ScrollTrigger from "gsap/ScrollTrigger"
gsap.registerPlugin(ScrollTrigger)
@@ -51,15 +53,16 @@ function startNextAnimation() {
tl = gsap.timeline({
scrollTrigger: {
trigger: ".scroll-trigger-ready__worm-wrap",
start: "top 00%",
start: "top top",
end: "bottom 35%",
scrub: 2
scrub: 2,
pin: true
}
})
tl.to(boxes, {
y: () => gsap.utils.random(-400, -150),
duration : 3.5,
rotate: () => gsap.utils.random(-180, 180),
ease: "none",
stagger: 0.05
@@ -79,6 +82,7 @@ onMounted(() => {
onUnmounted(() => {
ctx?.revert()
scrollTrigger.getAll().forEach(t => t.kill())
})