feat: new vegetables
This commit is contained in:
@@ -73,6 +73,8 @@
|
|||||||
<td><label for="candidates">Candidates:</label></td>
|
<td><label for="candidates">Candidates:</label></td>
|
||||||
<td><textarea v-model="config.candidates" id="candidates" rows="8"></textarea></td>
|
<td><textarea v-model="config.candidates" id="candidates" rows="8"></textarea></td>
|
||||||
<td>
|
<td>
|
||||||
|
<button @click="newVegetables"><i icon="rotate-ccw"></i></button>
|
||||||
|
<br/>
|
||||||
<span v-if="candidates.length <= 2" title="not enough candidates">
|
<span v-if="candidates.length <= 2" title="not enough candidates">
|
||||||
<i icon="triangle-alert"></i> <i icon="users-round"></i> {{candidates.length}}
|
<i icon="triangle-alert"></i> <i icon="users-round"></i> {{candidates.length}}
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -94,8 +94,7 @@ const app = createApp({
|
|||||||
endTime: "03:00",
|
endTime: "03:00",
|
||||||
duration: 30,
|
duration: 30,
|
||||||
seed: utils.randomSeed(),
|
seed: utils.randomSeed(),
|
||||||
candidates:
|
candidates: "",
|
||||||
"🥦 Broccoli\n🥕 Carrot\n🧅 Onion\n🌶️ Pepper\n🍆 Eggplant\n🥔 Potato",
|
|
||||||
endWithAll: true,
|
endWithAll: true,
|
||||||
mix: 25,
|
mix: 25,
|
||||||
},
|
},
|
||||||
@@ -151,22 +150,25 @@ const app = createApp({
|
|||||||
document.title = `${this.vegetable} Légume`;
|
document.title = `${this.vegetable} Légume`;
|
||||||
setTimeout(this.showApp);
|
setTimeout(this.showApp);
|
||||||
utils.updateIcons();
|
utils.updateIcons();
|
||||||
this.config.candidates = utils
|
this.newVegetables();
|
||||||
.shuffleSeeded(Object.keys(VEGETABLES), this.config.seed)
|
|
||||||
.map((key) => `${key} ${VEGETABLES[key]}`)
|
|
||||||
.slice(0, 6)
|
|
||||||
.join("\n");
|
|
||||||
this.loadConfig();
|
this.loadConfig();
|
||||||
this.generateData();
|
this.generateData();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
showApp() {
|
||||||
|
document.getElementById("app").setAttribute("style", "");
|
||||||
|
},
|
||||||
getTime(minutes) {
|
getTime(minutes) {
|
||||||
return `${Math.floor((minutes / 60) % 24)
|
return `${Math.floor((minutes / 60) % 24)
|
||||||
.toFixed(0)
|
.toFixed(0)
|
||||||
.padStart(2, "0")}:${(minutes % 60).toFixed(0).padStart(2, "0")}`;
|
.padStart(2, "0")}:${(minutes % 60).toFixed(0).padStart(2, "0")}`;
|
||||||
},
|
},
|
||||||
showApp() {
|
newVegetables() {
|
||||||
document.getElementById("app").setAttribute("style", "");
|
this.config.candidates = utils
|
||||||
|
.shuffleSeeded(Object.keys(VEGETABLES), this.config.seed)
|
||||||
|
.map((key) => `${key} ${VEGETABLES[key]}`)
|
||||||
|
.slice(0, 6)
|
||||||
|
.join("\n");
|
||||||
},
|
},
|
||||||
newSeed() {
|
newSeed() {
|
||||||
this.config.seed = utils.randomSeed();
|
this.config.seed = utils.randomSeed();
|
||||||
|
|||||||
Reference in New Issue
Block a user