feat(achievements): spawn confetti when all achievements are obtained

This commit is contained in:
2026-01-31 20:37:02 +01:00
parent f6591b9081
commit 8d467c48b0
2 changed files with 13 additions and 0 deletions

View File

@@ -51,12 +51,19 @@ export const useAchievementsStore = defineStore("achievements", () => {
storage.value.advancement.languages.push(locale.value);
}
const confetti = useConfetti();
const unlock = (name: Achievement) => {
if (storage.value.unlocked.includes(name)) {
return false;
}
storage.value.unlocked.push(name);
if (storage.value.unlocked.length === ACHIEVEMENTS.length) {
confetti.spawn();
}
return true;
};