v2.0 #7
@@ -8,7 +8,7 @@
|
||||
<WordleRow v-if="guesses.length > i" :guess="guesses[i]" :length="correct.length" :correct="correct"/>
|
||||
|
||||
<UForm @submit="onsubmit" v-if="guesses.length == i">
|
||||
<UPinInput v-if="guesses[guesses.length-1].toString().replace(/\,/gi, '') != correct" default class="mb-2" autofocus v-model="guess" color="neutral" :length="correct.length" size="lg" :correct="correct" />
|
||||
<UPinInput v-if="guesses[guesses.length-1].toString().replace(/\,/gi, '') != correct" default class="mb-2" autofocus v-model="guess" color="neutral" :length="correct.length" size="md" :correct="correct" />
|
||||
|
||||
<WordleRow v-else :length="correct.length"/>
|
||||
|
||||
@@ -54,11 +54,18 @@
|
||||
index: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
}
|
||||
},
|
||||
date: {
|
||||
type: String,
|
||||
default: '1970-01-01',
|
||||
}
|
||||
|
||||
},
|
||||
mounted() {
|
||||
this.guesses = JSON.parse(localStorage.getItem('guesses-' + this.index) || '[""]');
|
||||
if (localStorage.date) {
|
||||
if (localStorage.date === this.date) this.guesses = JSON.parse(localStorage.getItem('guesses-' + this.index) || '[""]'); console.log(this.guesses);
|
||||
} else localStorage.date = this.date;
|
||||
|
||||
this.max_guesses = this.correct.length > 5 ? this.correct.length : 6
|
||||
},
|
||||
methods: {
|
||||
|
||||
@@ -63,9 +63,9 @@
|
||||
.wr-div {
|
||||
justify-content: center;
|
||||
border-radius: 6px;
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
line-height: 36px;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
line-height: 32px;
|
||||
background-color: transparent;
|
||||
text-transform: uppercase;
|
||||
font-weight: bold;
|
||||
|
||||
@@ -18,6 +18,7 @@ import Wordle from '../components/Wordle.vue';
|
||||
tla: '',
|
||||
context: '',
|
||||
submitter: '',
|
||||
date: '',
|
||||
victory: false,
|
||||
loss: false,
|
||||
maxGuesses: 10,
|
||||
@@ -42,6 +43,7 @@ import Wordle from '../components/Wordle.vue';
|
||||
this.context = response.data.context;
|
||||
this.correct = response.data.correct;
|
||||
this.correct_words = response.data.tla_array;
|
||||
this.date = response.data.date;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -109,7 +111,7 @@ import Wordle from '../components/Wordle.vue';
|
||||
<GuessWord @pressed_wordle="wordle_open[i-1] = true" :correctness="Number(guess[i+2])" :index="i-1">
|
||||
{{ guess[i-1] }}
|
||||
</GuessWord>
|
||||
<Wordle v-model:open="wordle_open[i-1]" :correct="correct_words[i-1]" :index="i"/>
|
||||
<Wordle v-model:open="wordle_open[i-1]" :correct="correct_words[i-1]" :index="i" :date="date"/>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user