hero page background
This commit is contained in:
@@ -1,40 +1,5 @@
|
||||
<script setup>
|
||||
import { ref, onMounted, onUnmounted } from "vue"
|
||||
import gsap from "gsap"
|
||||
import ScrollTrigger from "gsap/ScrollTrigger"
|
||||
|
||||
gsap.registerPlugin(ScrollTrigger)
|
||||
|
||||
const section = ref(null)
|
||||
let ctx
|
||||
|
||||
onMounted(() => {
|
||||
ctx = gsap.context(() => {
|
||||
|
||||
gsap.from(".fade-text", {
|
||||
opacity: 0,
|
||||
y: 50,
|
||||
duration: 1,
|
||||
scrollTrigger: {
|
||||
trigger: section.value,
|
||||
start: "top 70%"
|
||||
}
|
||||
})
|
||||
|
||||
gsap.to(".highlight", {
|
||||
backgroundSize: "100% 100%",
|
||||
scrollTrigger: {
|
||||
trigger: ".highlight",
|
||||
start: "top 80%",
|
||||
end: "top 50%",
|
||||
scrub: true
|
||||
}
|
||||
})
|
||||
|
||||
}, section)
|
||||
})
|
||||
|
||||
onUnmounted(() => ctx.revert())
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
Reference in New Issue
Block a user