css variables, change max_guesses behaviour in wordle
Build / Build-image (push) Successful in 1m19s

This commit is contained in:
2026-09-05 13:00:41 +02:00
parent cc892fdebf
commit 5613a95063
4 changed files with 21 additions and 8 deletions
+5
View File
@@ -11,6 +11,11 @@
:root { :root {
--ui-primary: rgb(255, 200, 0); --ui-primary: rgb(255, 200, 0);
--correct-guess: rgb(0, 126, 2);
--partial-correct-guess: rgb(37, 43, 154);
--incorrect-guess: rgb(79, 79, 79);
} }
.main { .main {
+3 -3
View File
@@ -56,7 +56,7 @@
} }
.default { .default {
background-color: rgb(79, 79, 79); background-color: var(--incorrect-guess)
} }
.more { .more {
background-color: rgb(255, 0, 0); background-color: rgb(255, 0, 0);
@@ -65,13 +65,13 @@
background-color: rgb(129, 112, 0); background-color: rgb(129, 112, 0);
} }
.cw-cp { .cw-cp {
background-color: rgb(0, 126, 2); background-color: var(--correct-guess)
} }
.cw-ip { .cw-ip {
background-color: rgb(98, 175, 99); background-color: rgb(98, 175, 99);
} }
.cf-cp { .cf-cp {
background-color: rgb(37, 43, 154); background-color: var(--partial-correct-guess);
border: solid white; border: solid white;
} }
.cf-cp.hover { .cf-cp.hover {
+7 -2
View File
@@ -1,6 +1,6 @@
<template> <template>
<Modal v-model:open="open"> <Modal v-model:open="open">
<h1>Wordle for the tired</h1> <h1>Wordle for word {{ index }}</h1>
<br> <br>
<div class="flex-container-a gap-1.5"> <div class="flex-container-a gap-1.5">
<template v-for="i in max_guesses"> <template v-for="i in max_guesses">
@@ -18,9 +18,13 @@
<WordleRow v-if="guesses.length < i" :length="correct.length"/> <WordleRow v-if="guesses.length < i" :length="correct.length"/>
</template> </template>
<template v-if="guesses[guesses.length-1].toString().replace(/\,/gi, '') == correct">
You guessed word #{{ index }}! It was '{{ correct }}'
</template>
</div> </div>
<UButton @click="onsubmit" class="m-1.5"> <UButton @click="onsubmit" class="m-1.5" v-if="guesses[guesses.length-1].toString().replace(/\,/gi, '') != correct">
Submit Submit
</UButton> </UButton>
</Modal> </Modal>
@@ -54,6 +58,7 @@
}, },
mounted() { mounted() {
this.guesses = JSON.parse(localStorage.getItem('guesses-' + this.index) || '[""]'); this.guesses = JSON.parse(localStorage.getItem('guesses-' + this.index) || '[""]');
this.max_guesses = this.correct.length > 5 ? this.correct.length : 6
}, },
methods: { methods: {
onsubmit () { onsubmit () {
+6 -3
View File
@@ -4,7 +4,7 @@
<template> <template>
<div class="flex-container gap-1.5"> <div class="flex-container gap-1.5">
<div v-for="i in length" class="border border-default wr-div" :class="{'correct' : getCorrectness[i-1]==2, 'wrong-place' : getCorrectness[i-1]==1}"> <div v-for="i in length" class="border border-default wr-div" :class="{'correct' : getCorrectness[i-1]==2, 'wrong-place' : getCorrectness[i-1]==1, 'incorrect' : getCorrectness[i-1]==0}" >
{{ guess[i-1] }} {{ guess[i-1] }}
</div> </div>
</div> </div>
@@ -73,10 +73,13 @@
.correct { .correct {
background-color: rgb(0, 126, 2); background-color: rgb(0, 126, 2);
} }
.incorrect {
background-color: var(--incorrect-guess);
}
.wrong-place { .wrong-place {
background-color: rgb(37, 43, 154); background-color: var(--partial-correct-guess);
} }
.empty { .empty {
background-color: rgb(93, 93, 93); background-color: var(--incorrect-guess);
} }
</style> </style>