feat: new vegetables

This commit is contained in:
2025-11-04 23:02:09 +01:00
parent c0cab3fe19
commit 117eb06d9b
2 changed files with 14 additions and 10 deletions
+3 -1
View File
@@ -73,6 +73,8 @@
<td><label for="candidates">Candidates:</label></td>
<td><textarea v-model="config.candidates" id="candidates" rows="8"></textarea></td>
<td>
<button @click="newVegetables"><i icon="rotate-ccw"></i></button>
<br/>
<span v-if="candidates.length <= 2" title="not enough candidates">
<i icon="triangle-alert"></i> <i icon="users-round"></i> {{candidates.length}}
</span>
@@ -113,4 +115,4 @@
</main>
</body>
</html>
</html>
+11 -9
View File
@@ -94,8 +94,7 @@ const app = createApp({
endTime: "03:00",
duration: 30,
seed: utils.randomSeed(),
candidates:
"🥦 Broccoli\n🥕 Carrot\n🧅 Onion\n🌶️ Pepper\n🍆 Eggplant\n🥔 Potato",
candidates: "",
endWithAll: true,
mix: 25,
},
@@ -151,22 +150,25 @@ const app = createApp({
document.title = `${this.vegetable} Légume`;
setTimeout(this.showApp);
utils.updateIcons();
this.config.candidates = utils
.shuffleSeeded(Object.keys(VEGETABLES), this.config.seed)
.map((key) => `${key} ${VEGETABLES[key]}`)
.slice(0, 6)
.join("\n");
this.newVegetables();
this.loadConfig();
this.generateData();
},
methods: {
showApp() {
document.getElementById("app").setAttribute("style", "");
},
getTime(minutes) {
return `${Math.floor((minutes / 60) % 24)
.toFixed(0)
.padStart(2, "0")}:${(minutes % 60).toFixed(0).padStart(2, "0")}`;
},
showApp() {
document.getElementById("app").setAttribute("style", "");
newVegetables() {
this.config.candidates = utils
.shuffleSeeded(Object.keys(VEGETABLES), this.config.seed)
.map((key) => `${key} ${VEGETABLES[key]}`)
.slice(0, 6)
.join("\n");
},
newSeed() {
this.config.seed = utils.randomSeed();