feat(projects): intro and outro animations

This commit is contained in:
2025-12-17 20:06:46 +01:00
parent e190636544
commit 4aac82a97c
5 changed files with 77 additions and 13 deletions

View File

@@ -13,6 +13,17 @@ export const useProjectsStore = defineStore("projects", {
currentProject: 0,
loading: true,
offsetX: 0,
intro: {
fadeOpacity: 1,
},
outro: {
fadeOpacity: 0,
},
isIntro: true,
isOutro: false,
}),
actions: {
@@ -97,5 +108,44 @@ export const useProjectsStore = defineStore("projects", {
},
);
},
animateIntro() {
this.isIntro = true;
gsap.fromTo(
this.intro,
{ fadeOpacity: 1 },
{
delay: 3,
fadeOpacity: 0,
duration: 0.35,
ease: "none",
onComplete: () => {
this.isIntro = false;
},
},
);
},
animateOutro() {
this.isOutro = true;
gsap.fromTo(
this.outro,
{ fadeOpacity: 0 },
{
delay: 0.5,
fadeOpacity: 1,
duration: 0.35,
ease: "none",
onComplete: () => {
setTimeout(() => {
const router = useRouter();
router.push({ query: {} });
}, 3000);
},
},
);
},
},
});