diff --git a/5s.css b/5s.css
index 2056321..e2241b4 100644
--- a/5s.css
+++ b/5s.css
@@ -2,7 +2,8 @@
@plugin "@tailwindcss/typography";
@plugin "daisyui" {
- themes: light --default, dark --prefersdark;
+ /* themes: light --default, dark --prefersdark; */
+ themes: light;
}
*:not(td):not(th) {
@@ -28,3 +29,23 @@ main {
margin: 1rem 1rem 0;
color: var(--color);
}
+
+h1 {
+ margin: 0 0 0.5rem;
+}
+
+.created-at {
+ font-size: 14pt;
+ margin: 0;
+}
+
+.numeric {
+ font-family: 'Cutive Mono', monospace;
+ font-weight: bold;
+}
+article {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ margin: auto;
+}
diff --git a/5s.html b/5s.html
index 625617f..e261da7 100644
--- a/5s.html
+++ b/5s.html
@@ -1,5 +1,5 @@
-
+
@@ -10,7 +10,6 @@
My understanding of how a 5S can help team."
/>
-
diff --git a/src/modules/5s/BoardGameWorkshop.vue b/src/modules/5s/BoardGameWorkshop.vue
index 50a13a5..84858af 100644
--- a/src/modules/5s/BoardGameWorkshop.vue
+++ b/src/modules/5s/BoardGameWorkshop.vue
@@ -1,6 +1,5 @@
-
+
Tools
@@ -38,7 +37,7 @@ const submit = () => {
-
+
{{ tool.name }}
{{ tool.alias }}
@@ -46,9 +45,10 @@ const submit = () => {
-
+
Workshop
@@ -113,10 +113,10 @@ const submit = () => {
@@ -135,7 +135,7 @@ const submit = () => {
Performance
@@ -159,14 +159,13 @@ const submit = () => {
@import url('https://fonts.googleapis.com/css2?family=Google+Sans+Code&display=swap');
.board-game-workshop {
+ flex: 1;
font-family: 'Google Sans Code', monospace;
font-optical-sizing: auto;
font-weight: 400;
font-style: normal;
font-size: 14px;
- min-width: 600px;
display: flex;
- justify-content: space-between;
gap: 4rem;
input {
@@ -186,10 +185,6 @@ form {
color: green;
}
-button {
- color: white;
-}
-
aside {
flex: 1;
}
diff --git a/src/modules/5s/board-game-store.ts b/src/modules/5s/board-game-store.ts
index b918316..07dc652 100644
--- a/src/modules/5s/board-game-store.ts
+++ b/src/modules/5s/board-game-store.ts
@@ -1,9 +1,12 @@
import { boardGames } from '@/modules/5s/types/board-games'
-import { BoardGame, Part, Task } from '@/modules/5s/types/workshop'
+import { tools } from '@/modules/5s/types/tools'
+import { BoardGame, Part, Task, Tool } from '@/modules/5s/types/workshop'
import { toDuration } from '@/modules/5s/utils'
+import { randomAlias } from '@/utils'
import { defineStore } from 'pinia'
type State = {
+ tools: Tool[]
boardGames: BoardGame[]
currentBoardGameIndex: number | null
currentPartIndex: number | null
@@ -16,6 +19,7 @@ type State = {
export const useBoardGameStore = defineStore('board-game', {
state: (): State => ({
+ tools: [],
boardGames: [],
currentBoardGameIndex: null,
currentPartIndex: null,
@@ -28,6 +32,10 @@ export const useBoardGameStore = defineStore('board-game', {
actions: {
initGame() {
// this.boardGames = [boardGames[0], boardGames[1]]
+ this.tools = tools.map((t) => ({
+ ...t,
+ alias: randomAlias()
+ }))
this.boardGames = [boardGames[0]]
this.currentBoardGameIndex = 0
this.currentPartIndex = 0
@@ -35,16 +43,22 @@ export const useBoardGameStore = defineStore('board-game', {
this.start = new Date().toISOString()
this.end = null
},
- craftWithTool(tool: string) {
+ craftWithTool(alias: string) {
if (!this.currentTask) {
return
}
- if (!this.currentTask.tools.some((t) => t.alias === tool)) {
+ const tool = this.tools.find((t) => t.alias === alias)
+
+ if (!tool) {
return
}
- this.usedTools = [...this.usedTools, tool]
+ if (!this.currentTask.tools.some((t) => t.id === tool.id)) {
+ return
+ }
+
+ this.usedTools = [...this.usedTools, tool.id]
if (this.usedTools.length === this.currentTask.tools.length) {
this.usedTools = []
diff --git a/src/modules/5s/types/tools.ts b/src/modules/5s/types/tools.ts
index 5dd3a1f..97baac8 100644
--- a/src/modules/5s/types/tools.ts
+++ b/src/modules/5s/types/tools.ts
@@ -1,19 +1,18 @@
import { Tool } from '@/modules/5s/types/workshop'
export const tools: Tool[] = [
- { name: 'Card Printer', alias: 'card-printer', cooldown: 5 },
- { name: 'Miniature Mold', alias: 'mini-mold', cooldown: 15 },
- { name: 'Dice Engraver', alias: 'dice-engraver', cooldown: 10 },
- { name: 'Board Cutter', alias: 'board-cutter', cooldown: 8 },
- { name: 'Rulebook Designer', alias: 'rulebook-dzn', cooldown: 6 },
- { name: 'Box Assembler', alias: 'box-asm', cooldown: 4 },
- { name: 'Component Painter', alias: 'painter', cooldown: 12 },
- { name: 'Lamination Machine', alias: 'laminator', cooldown: 7 }
+ { name: 'Card Printer', id: 'card-printer', alias: '', cooldown: 5 },
+ { name: 'Miniature Mold', id: 'mini-mold', alias: '', cooldown: 15 },
+ { name: 'Dice Engraver', id: 'dice-engraver', alias: '', cooldown: 10 },
+ { name: 'Board Cutter', id: 'board-cutter', alias: '', cooldown: 8 },
+ { name: 'Rulebook Designer', id: 'rulebook-dzn', alias: '', cooldown: 6 },
+ { name: 'Box Assembler', id: 'box-asm', alias: '', cooldown: 4 },
+ { name: 'Component Painter', id: 'painter', alias: '', cooldown: 12 },
+ { name: 'Lamination Machine', id: 'laminator', alias: '', cooldown: 7 }
]
export type NonEmptyArray = [T, ...T[]]
-export const aliasToTool = (alias: string): Tool =>
- tools.find((t) => t.alias === alias)!
+export const idToTools = (id: string): Tool => tools.find((t) => t.id === id)!
-export const chooseTools = (...aliases: string[]): NonEmptyArray =>
- aliases.map(aliasToTool) as NonEmptyArray
+export const chooseTools = (...ides: string[]): NonEmptyArray =>
+ ides.map(idToTools) as NonEmptyArray
diff --git a/src/modules/5s/types/workshop.ts b/src/modules/5s/types/workshop.ts
index 1a60d09..4473c42 100644
--- a/src/modules/5s/types/workshop.ts
+++ b/src/modules/5s/types/workshop.ts
@@ -2,6 +2,7 @@ import { NonEmptyArray } from '@/modules/5s/types/tools'
export type Tool = {
name: string
+ id: string
alias: string
cooldown: number
}
diff --git a/src/utils.ts b/src/utils.ts
index 161f00e..fad99d8 100644
--- a/src/utils.ts
+++ b/src/utils.ts
@@ -10,6 +10,13 @@ export const randomFloat = (min: number, max: number) => {
return random.real(min, max)
}
+export const randomAlias = () =>
+ Array.from({ length: 5 }, () =>
+ Math.random() < 0.9
+ ? String.fromCharCode(97 + Math.floor(Math.random() * 26))
+ : '-'
+ ).join('')
+
export const getMean = (data: number[]) =>
Math.round(100 * (sumElements(data) / data.length)) / 100