feat: install DaisyUI and add perfs

This commit is contained in:
Julien Calixte
2025-08-06 19:14:30 +02:00
parent 6bf6031940
commit 35432ff44c
5 changed files with 160 additions and 42 deletions

View File

@@ -11,6 +11,7 @@ type State = {
usedTools: string[]
start: string | null
end: string | null
perfs: Array<[string, string]>
}
export const useBoardGameStore = defineStore('board-game', {
@@ -21,15 +22,18 @@ export const useBoardGameStore = defineStore('board-game', {
currentTaskIndex: null,
usedTools: [],
start: null,
end: null
end: null,
perfs: []
}),
actions: {
initGame() {
this.boardGames = [boardGames[0], boardGames[1]]
// this.boardGames = [boardGames[0], boardGames[1]]
this.boardGames = [boardGames[0]]
this.currentBoardGameIndex = 0
this.currentPartIndex = 0
this.currentTaskIndex = 0
this.start = new Date().toISOString()
this.end = null
},
craftWithTool(tool: string) {
if (!this.currentTask) {
@@ -49,6 +53,7 @@ export const useBoardGameStore = defineStore('board-game', {
},
increment() {
if (
!this.start ||
!this.currentTask ||
!this.currentPart ||
!this.currentBoardGame ||
@@ -81,6 +86,7 @@ export const useBoardGameStore = defineStore('board-game', {
// All board games complete
this.end = new Date().toISOString()
this.perfs = [...this.perfs, [this.start, this.end]]
this.currentBoardGameIndex = null
this.currentPartIndex = null
this.currentTaskIndex = null