feat(achievements): black fade in and out from home and settings screen

This commit is contained in:
2026-01-26 17:54:13 +01:00
parent 944f84944c
commit 28212bdbf3
14 changed files with 161 additions and 72 deletions

View File

@@ -1,5 +1,13 @@
import gsap from "gsap";
export type HomeButton =
| "projects"
| "contact"
| "gallery"
| "theme"
| "settings"
| "achievements";
export const useHomeStore = defineStore("home", {
state: () => ({
intro: {
@@ -14,11 +22,25 @@ export const useHomeStore = defineStore("home", {
animateTop: false,
},
selectedButton: "projects" as HomeButton,
isIntro: true,
isOutro: false,
}),
actions: {
reset() {
const app = useAppStore();
if (app.previousScreen === "achievements") {
return;
}
const selectedButton = this.selectedButton;
this.$reset();
this.selectedButton = selectedButton;
this.animateIntro();
},
animateIntro() {
this.isIntro = true;
@@ -52,12 +74,18 @@ export const useHomeStore = defineStore("home", {
},
animateOutro(to: AppScreen) {
if (to === "achievements") {
const achievementsScreen = useAchievementsScreen();
achievementsScreen.animateFadeToBlackIntro();
return;
}
this.isOutro = true;
this.outro.animateTop = to !== "settings";
const timeline = gsap.timeline({
onComplete: () => {
this.isOutro = true;
this.isOutro = false;
const app = useAppStore();
if (to === "gallery") {