diff --git a/resources/js/components/Wordle.vue b/resources/js/components/Wordle.vue index 408ee71..73bb38e 100644 --- a/resources/js/components/Wordle.vue +++ b/resources/js/components/Wordle.vue @@ -8,7 +8,7 @@ - + @@ -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: { diff --git a/resources/js/components/WordleRow.vue b/resources/js/components/WordleRow.vue index 0d17100..31eb3d3 100644 --- a/resources/js/components/WordleRow.vue +++ b/resources/js/components/WordleRow.vue @@ -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; diff --git a/resources/js/pages/HomeView.vue b/resources/js/pages/HomeView.vue index d0c31c5..6563e2a 100644 --- a/resources/js/pages/HomeView.vue +++ b/resources/js/pages/HomeView.vue @@ -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'; {{ guess[i-1] }} - +