update howtoplay, add some localstorage functionality
Build / Build-image (push) Successful in 1m30s
Build / Build-image (push) Successful in 1m30s
This commit is contained in:
@@ -35,8 +35,10 @@
|
||||
<GuessWord :correctness="4">Acronym</GuessWord>
|
||||
</div>
|
||||
|
||||
If you manage to figure out a letter in its correct position you unlock a mini wordle for that specific word. Press the word if it has a white outline to launch it!
|
||||
|
||||
If you have any feedback, <a style="text-decoration: underline;" href="mailto:peter@sc0tt.org">
|
||||
let me know in an email</a>, or create a <a style="text-decoration: underline;" href='https://gitea.sc0tt.org/Belupeti/TLA/pulls'>pull request</a>
|
||||
let me know in an email</a>, or create an <a style="text-decoration: underline;" href='https://gitea.sc0tt.org/Belupeti/TLA/pulls'>issue</a>
|
||||
|
||||
</template>
|
||||
</UModal>
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
<br>
|
||||
<div class="flex-container-a gap-1.5">
|
||||
<template v-for="i in max_guesses">
|
||||
|
||||
<WordleRow v-if="guesses.length > i" :guess="guesses[i]" :length="correct.length" :correct="correct"/>
|
||||
|
||||
<UForm @submit="onsubmit" v-if="guesses.length == i">
|
||||
@@ -20,6 +19,10 @@
|
||||
<WordleRow v-if="guesses.length < i" :length="correct.length"/>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
<UButton @click="onsubmit" class="m-1.5">
|
||||
Submit
|
||||
</UButton>
|
||||
</Modal>
|
||||
|
||||
</template>
|
||||
@@ -50,13 +53,7 @@
|
||||
|
||||
},
|
||||
mounted() {
|
||||
if (localStorage.getItem('guesses')) {
|
||||
try {
|
||||
this.guesses = JSON.parse(localStorage.getItem('guesses'));
|
||||
} catch(e) {
|
||||
localStorage.removeItem('guesses');
|
||||
}
|
||||
}
|
||||
this.guesses = JSON.parse(localStorage.getItem('guesses-' + this.index) || '[""]');
|
||||
},
|
||||
methods: {
|
||||
onsubmit () {
|
||||
@@ -64,7 +61,7 @@
|
||||
this.guesses.push(this.guess);
|
||||
this.guess = '';
|
||||
|
||||
localStorage.guesses[this.index] = this.guesses;
|
||||
localStorage.setItem('guesses-' + this.index, JSON.stringify(this.guesses));
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user