feat(achievements): black fade in and out from home and settings screen
This commit is contained in:
@@ -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") {
|
||||
|
||||
Reference in New Issue
Block a user