fix(settings/clock/achievements): animation errors

This commit is contained in:
2026-03-16 13:25:32 +01:00
parent 085e5f20a9
commit 5c0014ca61
2 changed files with 10 additions and 10 deletions

View File

@@ -33,9 +33,9 @@ const achievements = useAchievementsStore();
const achievementsScreen = useAchievementsScreen();
const confirmationModal = useConfirmationModal();
const isAnimating = ref(true);
const comingFromAchievements = store.returningFromAchievements;
const comingFromAchievements = app.previousScreen === "achievements";
const isAnimating = ref(!comingFromAchievements);
const bLabel = ref(comingFromAchievements ? $t("common.cancel") : $t("common.goBack"));
const aLabel = ref(comingFromAchievements ? $t("common.reset") : $t("common.select"));
@@ -46,9 +46,9 @@ const ARROW_SLIDE_DURATION = 0.167;
const VIEW_ALL_OFFSET = -20;
const animation = reactive({
offsetY: SLIDE_OFFSET,
opacity: 0,
viewAllOffsetY: VIEW_ALL_OFFSET,
offsetY: comingFromAchievements ? 0 : SLIDE_OFFSET,
opacity: comingFromAchievements ? 1 : 0,
viewAllOffsetY: comingFromAchievements ? 0 : VIEW_ALL_OFFSET,
});
const obtainedRef =
@@ -107,13 +107,10 @@ const animateOutro = async () => {
};
onMounted(() => {
store.returningFromAchievements = false;
if (comingFromAchievements) {
obtainedRef.value?.showInstant();
totalRef.value?.showInstant();
animation.offsetY = 0;
animation.opacity = 1;
animation.viewAllOffsetY = 0;
isAnimating.value = false;
return;
}
animateIntro();
@@ -142,6 +139,7 @@ const handleReset = () => {
const handleVisitAll = () => {
if (isAnimating.value) return;
assets.audio.menuOpen.play();
store.returningFromAchievements = true;
achievementsScreen.animateFadeToBlackIntro();
};
@@ -174,7 +172,7 @@ onRender((ctx) => {
? APP_COLOR_TO_FONT_COLOR[app.color.hex]!
: "#fbfbfb";
ctx.fillText("/", 7 * 16 + 3, 4 * 16 + 4 + 39);
});
}, 5);
onRender((ctx) => {
ctx.translate(0, animation.viewAllOffsetY);

View File

@@ -58,6 +58,8 @@ export const useSettingsStore = defineStore("settings", {
isIntro: true,
isOutro: false,
returningFromAchievements: false,
}),
actions: {