feat(achievements): implement unlocking, saving and notification

This commit is contained in:
2026-01-18 22:50:35 +01:00
parent d61a60132a
commit d7e626397a
13 changed files with 269 additions and 2 deletions

View File

@@ -61,7 +61,11 @@ export const useProjectsStore = defineStore("projects", {
visitProject() {
const link = this.projects[this.currentProject]?.link;
if (link) navigateTo(link, { open: { target: "_blank" } });
if (link) {
navigateTo(link, { open: { target: "_blank" } });
const achievements = useAchievementsStore();
achievements.unlock("projects_open_link");
}
},
scrollProjects(direction: "left" | "right") {
@@ -89,6 +93,13 @@ export const useProjectsStore = defineStore("projects", {
},
);
}
if (this.currentProject >= 4) {
setTimeout(() => {
const achievements = useAchievementsStore();
achievements.unlock("projects_view_5");
}, 500);
}
},
// TODO: not used anymore