diff --git a/app/components/Home/TopScreen/Calendar.vue b/app/components/Home/TopScreen/Calendar.vue
index 3c2f71d..a4a2768 100644
--- a/app/components/Home/TopScreen/Calendar.vue
+++ b/app/components/Home/TopScreen/Calendar.vue
@@ -24,7 +24,7 @@ onRender((ctx) => {
const daysInMonth = new Date(year, month + 1, 0).getDate();
ctx.globalAlpha = store.isIntro
- ? store.intro.stage1Opacity
+ ? store.intro.topScreenOpacity
: store.isOutro && store.outro.animateTop
? store.outro.stage1Opacity
: 1;
@@ -44,7 +44,7 @@ onRender((ctx) => {
}
ctx.globalAlpha = store.isIntro
- ? store.intro.stage1Opacity
+ ? store.intro.topScreenOpacity
: store.isOutro && store.outro.animateTop
? store.outro.stage2Opacity
: 1;
diff --git a/app/components/Home/TopScreen/Clock.vue b/app/components/Home/TopScreen/Clock.vue
index 606e3cc..3ac3359 100644
--- a/app/components/Home/TopScreen/Clock.vue
+++ b/app/components/Home/TopScreen/Clock.vue
@@ -55,14 +55,14 @@ function drawLine(
onRender((ctx) => {
ctx.globalAlpha = store.isIntro
- ? store.intro.stage1Opacity
+ ? store.intro.topScreenOpacity
: store.isOutro && store.outro.animateTop
? store.outro.stage1Opacity
: 1;
assets.images.home.topScreen.clock.draw(ctx, 13, 45);
ctx.globalAlpha = store.isIntro
- ? store.intro.stage1Opacity
+ ? store.intro.topScreenOpacity
: store.isOutro && store.outro.animateTop
? store.outro.stage2Opacity
: 1;
diff --git a/app/components/Settings/BottomScreen/BottomScreen.vue b/app/components/Settings/BottomScreen/BottomScreen.vue
index 2df3aab..1176c40 100644
--- a/app/components/Settings/BottomScreen/BottomScreen.vue
+++ b/app/components/Settings/BottomScreen/BottomScreen.vue
@@ -1,11 +1,13 @@
-
+
diff --git a/app/components/Settings/BottomScreen/Menus/Menus.vue b/app/components/Settings/BottomScreen/Menus/Menus.vue
index f21f2fd..a555667 100644
--- a/app/components/Settings/BottomScreen/Menus/Menus.vue
+++ b/app/components/Settings/BottomScreen/Menus/Menus.vue
@@ -21,6 +21,10 @@ import Selector from "~/components/Common/ButtonSelector.vue";
const app = useAppStore();
const settingsStore = useSettingsStore();
+if (app.previousScreen === "home") {
+ settingsStore.selectedButton = "options";
+}
+
const isMainMenu = (button: string): button is SettingsMenu =>
SETTINGS_MENUS.includes(button as SettingsMenu);
@@ -195,30 +199,78 @@ const viewComponents: Record = {
touchScreenTapTap: TouchScreenTapTap,
};
+
+const selectorXOffset = computed(() => {
+ const menu = isMainMenu(selected.value)
+ ? selected.value
+ : getParentMenu(selected.value);
+
+ switch (menu) {
+ case "clock":
+ return Math.min(0, settingsStore.menuOffsets[1]);
+ case "user":
+ return Math.min(
+ 0,
+ settingsStore.menuOffsets[1] + settingsStore.menuOffsets[2],
+ );
+ case "touchScreen":
+ return Math.min(
+ 0,
+ settingsStore.menuOffsets[1] +
+ settingsStore.menuOffsets[2] +
+ settingsStore.menuOffsets[3],
+ );
+ default:
+ return 0;
+ }
+});
-
-
-
-
+
+
+
+
-
+
diff --git a/app/components/Settings/TopScreen/Calendar.vue b/app/components/Settings/TopScreen/Calendar.vue
index efab545..d0005f1 100644
--- a/app/components/Settings/TopScreen/Calendar.vue
+++ b/app/components/Settings/TopScreen/Calendar.vue
@@ -1,13 +1,14 @@
diff --git a/app/stores/home.ts b/app/stores/home.ts
index 63b6e87..0eda6d9 100644
--- a/app/stores/home.ts
+++ b/app/stores/home.ts
@@ -13,6 +13,7 @@ export const useHomeStore = defineStore("home", {
intro: {
statusBarY: -20,
stage1Opacity: 0,
+ topScreenOpacity: 0,
},
outro: {
@@ -44,33 +45,51 @@ export const useHomeStore = defineStore("home", {
animateIntro() {
this.isIntro = true;
+ const app = useAppStore();
+
const timeline = gsap.timeline({
onComplete: () => {
this.isIntro = false;
},
});
- timeline
- .fromTo(
- this.intro,
- { stage1Opacity: 0 },
- {
- stage1Opacity: 1,
- duration: 0.5,
- ease: "none",
- },
- 0,
- )
- .fromTo(
- this.intro,
- { statusBarY: -20 },
- {
- statusBarY: 0,
- duration: 0.15,
- ease: "none",
- },
- 0.35,
- );
+ timeline.fromTo(
+ this.intro,
+ { stage1Opacity: 0 },
+ {
+ stage1Opacity: 1,
+ duration: 0.5,
+ ease: "none",
+ },
+ 0,
+ );
+
+ if (app.previousScreen !== "settings") {
+ timeline
+ .fromTo(
+ this.intro,
+ { topScreenOpacity: 0 },
+ {
+ topScreenOpacity: 1,
+ duration: 0.5,
+ ease: "none",
+ },
+ 0,
+ )
+ .fromTo(
+ this.intro,
+ { statusBarY: -20 },
+ {
+ statusBarY: 0,
+ duration: 0.15,
+ ease: "none",
+ },
+ 0.35,
+ );
+ } else {
+ this.intro.topScreenOpacity = 1;
+ this.intro.statusBarY = 0;
+ }
},
animateOutro(to: AppScreen) {
diff --git a/app/stores/settings.ts b/app/stores/settings.ts
index 02789fa..1ff3fa9 100644
--- a/app/stores/settings.ts
+++ b/app/stores/settings.ts
@@ -1,3 +1,5 @@
+import gsap from "gsap";
+
export const SETTINGS_MENUS = [
"options",
"clock",
@@ -31,6 +33,13 @@ export const useSettingsStore = defineStore("settings", {
currentSubMenu: null as SettingsSubMenu | null,
menuExpanded: false,
selectedButton: "options" as SettingsNavigableButton,
+ notificationYOffset: 48,
+ barOffsetY: 24,
+ menuOffsets: [0, -48, -48, -48] as [number, number, number, number],
+ menuYOffset: 72,
+
+ isIntro: true,
+ isOutro: false,
}),
actions: {
@@ -58,5 +67,107 @@ export const useSettingsStore = defineStore("settings", {
closeSubMenu() {
this.currentSubMenu = null;
},
+
+ animateIntro() {
+ this.isIntro = true;
+
+ gsap
+ .timeline()
+ // bars
+ .fromTo(
+ this,
+ { barOffsetY: 24 },
+ { barOffsetY: 0, duration: 0.2, ease: "none" },
+ 0,
+ )
+ // title notification
+ .fromTo(
+ this,
+ { notificationYOffset: 48 },
+ { notificationYOffset: 0, duration: 0.2, ease: "none" },
+ 0.1,
+ )
+ // menus slide up
+ .fromTo(
+ this,
+ { menuYOffset: 72 },
+ { menuYOffset: 0, duration: 0.2, ease: "none" },
+ 0,
+ )
+ // menus accordion
+ .fromTo(
+ this.menuOffsets,
+ { 1: -48 },
+ { 1: 0, duration: 0.1, ease: "none" },
+ 0.2,
+ )
+ .fromTo(
+ this.menuOffsets,
+ { 2: -48 },
+ { 2: 0, duration: 0.1, ease: "none" },
+ 0.3,
+ )
+ .fromTo(
+ this.menuOffsets,
+ { 3: -48 },
+ { 3: 0, duration: 0.1, ease: "none" },
+ 0.4,
+ )
+ .call(() => {
+ this.isIntro = false;
+ });
+ },
+
+ animateOutro() {
+ this.isOutro = true;
+
+ gsap
+ .timeline()
+ // title notification
+ .fromTo(
+ this,
+ { notificationYOffset: 0 },
+ { notificationYOffset: 48, duration: 0.2, ease: "none" },
+ 0,
+ )
+ // bars
+ .fromTo(
+ this,
+ { barOffsetY: 0 },
+ { barOffsetY: 24, duration: 0.2, ease: "none" },
+ 0.1,
+ )
+ // menus accordion
+ .fromTo(
+ this.menuOffsets,
+ { 3: 0 },
+ { 3: -48, duration: 0.1, ease: "none" },
+ 0,
+ )
+ .fromTo(
+ this.menuOffsets,
+ { 2: 0 },
+ { 2: -48, duration: 0.1, ease: "none" },
+ 0.1,
+ )
+ .fromTo(
+ this.menuOffsets,
+ { 1: 0 },
+ { 1: -48, duration: 0.1, ease: "none" },
+ 0.2,
+ )
+ // menus slide down
+ .fromTo(
+ this,
+ { menuYOffset: 0 },
+ { menuYOffset: 72, duration: 0.2, ease: "none" },
+ 0.3,
+ )
+ .call(() => {
+ const app = useAppStore();
+ app.navigateTo("home");
+ this.isOutro = false;
+ });
+ },
},
});