From 630b3990883a4bc500704605c3e66874292c5599 Mon Sep 17 00:00:00 2001 From: Pihkaal Date: Sat, 31 Jan 2026 00:52:56 +0100 Subject: [PATCH] refactor: relocate constants in screen stores --- .../Contact/BottomScreen/BottomScreen.vue | 5 ++- app/components/NDS.vue | 1 - app/components/Screen.vue | 2 - app/pages/gallery.vue | 4 +- app/stores/achievementsScreen.ts | 9 +++++ app/stores/app.ts | 15 +++++++ app/stores/settings.ts | 39 +++++++++++-------- app/utils/achievements.ts | 30 -------------- app/utils/app.ts | 6 --- app/utils/async.ts | 2 - app/utils/canvas.ts | 22 +++++++++++ app/utils/screen.ts | 7 ---- app/utils/settings.ts | 22 ----------- 13 files changed, 74 insertions(+), 90 deletions(-) delete mode 100644 app/utils/achievements.ts delete mode 100644 app/utils/app.ts delete mode 100644 app/utils/async.ts delete mode 100644 app/utils/screen.ts delete mode 100644 app/utils/settings.ts diff --git a/app/components/Contact/BottomScreen/BottomScreen.vue b/app/components/Contact/BottomScreen/BottomScreen.vue index 2865ea4..63c3386 100644 --- a/app/components/Contact/BottomScreen/BottomScreen.vue +++ b/app/components/Contact/BottomScreen/BottomScreen.vue @@ -2,6 +2,7 @@ import Background from "./Background.vue"; import Buttons from "./Buttons.vue"; import ButtonSelector from "~/components/Common/ButtonSelector.vue"; +import { promiseTimeout } from "@vueuse/core"; const store = useContactStore(); const achievements = useAchievementsStore(); @@ -71,10 +72,10 @@ const actionateButton = async (button: (typeof selected)["value"]) => { text: $t("contact.openUrl", { url }), onConfirm: async () => { store.pushNotification($t("contact.opened", { item: verb })); - await sleep(100); + await promiseTimeout(100); await navigateTo(content, { open: { target: "_blank " } }); - await sleep(500); + await promiseTimeout(500); if (button === "github") { achievements.unlock("contact_git_visit"); diff --git a/app/components/NDS.vue b/app/components/NDS.vue index f09647f..8a7440b 100644 --- a/app/components/NDS.vue +++ b/app/components/NDS.vue @@ -2,7 +2,6 @@ import { useLoop, useTresContext } from "@tresjs/core"; import * as THREE from "three"; import gsap from "gsap"; -import { LOGICAL_WIDTH, LOGICAL_HEIGHT } from "~/utils/screen"; const INTRO_ANIMATION = { MODEL_SPIN_DURATION: 3, diff --git a/app/components/Screen.vue b/app/components/Screen.vue index 2202e31..7510ac5 100644 --- a/app/components/Screen.vue +++ b/app/components/Screen.vue @@ -1,6 +1,4 @@