Compare commits

...
14 Commits
Author SHA1 Message Date
Belupeti ee9a1f2e13 fix no tla
Build / Build-image (push) Successful in 1m22s
2026-09-05 20:25:17 +02:00
Belupeti dada5855ab change some admin stuff
Build / Build-image (push) Successful in 1m18s
2026-09-05 15:07:14 +02:00
Belupeti 890bb53ef6 change some local storage stuff and css for wordle
Build / Build-image (push) Successful in 1m19s
2026-09-05 13:51:59 +02:00
Belupeti 2bce3f9a71 some css changes
Build / Build-image (push) Successful in 1m26s
2026-09-05 13:31:32 +02:00
Belupeti 5613a95063 css variables, change max_guesses behaviour in wordle
Build / Build-image (push) Successful in 1m19s
2026-09-05 13:00:41 +02:00
Belupeti cc892fdebf update howtoplay, add some localstorage functionality
Build / Build-image (push) Successful in 1m30s
2026-09-05 12:11:09 +02:00
Belupeti c1fcb34ee5 fix something on frontend
Build / Build-image (push) Successful in 1m13s
2026-08-28 01:02:47 +02:00
Belupeti 836c83b473 wordle frontend almost done
Build / Build-image (push) Successful in 1m11s
2026-08-28 00:55:22 +02:00
Belupeti 5d5250287d wordle backend and some frontend changes
Build / Build-image (push) Successful in 1m13s
2026-08-27 22:33:19 +02:00
Belupeti 865ac153b2 wordle part kind of working
Build / Build-image (push) Successful in 1m8s
2026-08-25 00:56:08 +02:00
Belupeti a79363b4da add some fixes
Build / Build-image (push) Successful in 1m10s
2026-08-24 20:39:55 +02:00
Belupeti cab6a3e7f1 some stuff on wordle
Build / Build-image (push) Successful in 1m10s
2026-08-24 00:35:00 +02:00
Belupeti 0395c01cdf start writing Eti update
Build / Build-image (push) Successful in 1m13s
2026-08-23 23:18:55 +02:00
Belupeti 0a605fce7c fix empty submitter text
Build / Build-image (push) Successful in 1m11s
2026-08-22 15:09:00 +02:00
13 changed files with 318 additions and 45 deletions
+1 -1
View File
@@ -7,7 +7,7 @@ jobs:
env: env:
IMAGE_NAME: tladle IMAGE_NAME: tladle
REGISTRY_NAME: gitea.sc0tt.org REGISTRY_NAME: gitea.sc0tt.org
GIT_TAG: 1.3 GIT_TAG: 2.0
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
@@ -75,7 +75,7 @@ class TlaSuggestionResource extends Resource
EditAction::make(), EditAction::make(),
DeleteAction::make(), DeleteAction::make(),
Action::make('Approve') Action::make('Approve')
->action(fn (TlaSuggestion $record) => $record->ApproveTla($record)) ->action(fn (TlaSuggestion $record) => TlaSuggestion::ApproveTla($record))
->requiresConfirmation() ->requiresConfirmation()
->modalHeading('Approve TLA') ->modalHeading('Approve TLA')
->modalDescription('Are you sure you want to approve this TLA?') ->modalDescription('Are you sure you want to approve this TLA?')
@@ -31,7 +31,7 @@ class TlasTable
->dateTime() ->dateTime()
->sortable() ->sortable()
->toggleable(isToggledHiddenByDefault: true), ->toggleable(isToggledHiddenByDefault: true),
]) ])->defaultSort('used', direction: 'asc')
->filters([ ->filters([
// //
]) ])
@@ -98,6 +98,7 @@ class TlaResource extends Resource
DeleteBulkAction::make(), DeleteBulkAction::make(),
]), ]),
]); ]);
} }
public static function getPages(): array public static function getPages(): array
+14
View File
@@ -17,6 +17,7 @@ class TlaController extends Controller
$session->forget('tla-'.$language); $session->forget('tla-'.$language);
$session->forget('correct-'.$language); $session->forget('correct-'.$language);
$session->forget('review-'.$language); $session->forget('review-'.$language);
$session->put('tla-array-'.$language, ['', '', '']);
$session->put('date-'.$language, date('Y-m-d')); $session->put('date-'.$language, date('Y-m-d'));
} }
} }
@@ -27,6 +28,9 @@ class TlaController extends Controller
if ( !in_array($language, $allowedLanguages) ) $language = 'en'; if ( !in_array($language, $allowedLanguages) ) $language = 'en';
$tla = Tla::GetCurrentTla($language); $tla = Tla::GetCurrentTla($language);
if ($tla == NULL) return response()->json([ 'no_tla' => true ]);
$this->session_flush($request, $language); $this->session_flush($request, $language);
$session = $request->session(); $session = $request->session();
@@ -39,6 +43,7 @@ class TlaController extends Controller
'context' => $session->get('tla-'.$language) == $tla->acronym ? $tla->context : NULL, 'context' => $session->get('tla-'.$language) == $tla->acronym ? $tla->context : NULL,
'submitter' => $tla->submitter, 'submitter' => $tla->submitter,
'correct' => $session->get('correct-'.$language), 'correct' => $session->get('correct-'.$language),
'tla_array' => $session->get('tla-array-'.$language),
]); ]);
} }
@@ -96,6 +101,14 @@ class TlaController extends Controller
if ($score == 12) $session->put('correct-'.$language, true); if ($score == 12) $session->put('correct-'.$language, true);
} }
$tla_array = $session->get('tla-array-'.$language);
for ($i = 0; $i < 3; $i++) {
if ($tla_array[$i] == "" && $guess_array[$i + 3] == 2) $tla_array[$i] = $tla[$i];
}
$session->put('tla-array-'.$language, $tla_array);
return response()->json([ return response()->json([
'guesses' => $guesses, 'guesses' => $guesses,
'date' => $session->get('date'), 'date' => $session->get('date'),
@@ -103,6 +116,7 @@ class TlaController extends Controller
'context' => $session->get('tla-'.$language) == $tla_object->acronym ? $tla_object->context : NULL, 'context' => $session->get('tla-'.$language) == $tla_object->acronym ? $tla_object->context : NULL,
'score' => $score, 'score' => $score,
'correct' => $session->get('correct-'.$language), 'correct' => $session->get('correct-'.$language),
'tla_array' => $tla_array,
]); ]);
} }
+3 -1
View File
@@ -13,7 +13,7 @@ class Tla extends Model
protected $fillable = ['acronym', 'hint', 'language', 'used', 'context', 'submitter', 'likes', 'dislikes']; protected $fillable = ['acronym', 'hint', 'language', 'used', 'context', 'submitter', 'likes', 'dislikes'];
public static function GetCurrentTla( string $language ) : Tla { public static function GetCurrentTla( string $language ) {
$tla = Tla::where('used', date("Y-m-d")) $tla = Tla::where('used', date("Y-m-d"))
->where('language', $language) ->where('language', $language)
->first(); ->first();
@@ -24,6 +24,8 @@ class Tla extends Model
->inRandomOrder() ->inRandomOrder()
->first(); ->first();
if ($tla == NULL) return NULL;
$tla->used = date("Y-m-d"); $tla->used = date("Y-m-d");
$tla->save(); $tla->save();
} }
+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 {
+37 -10
View File
@@ -1,20 +1,39 @@
<template> <template>
<Transition appear> <button v-if="true"
<div v-if="true" class="gw-div" :class="{ 'less': correctness==-3, 'more': correctness==-2, 'default': correctness==0, 'cw-cp': correctness==4, 'cw-ip': correctness==3, 'cf-cp': correctness==2, 'cf-ip': correctness==1 }"> @click="onclick"
class="gw-div"
:class="{
'less': correctness==-3,
'more': correctness==-2,
'default': correctness==0,
'cw-cp': correctness==4,
'cw-ip': correctness==3,
'cf-cp': correctness==2,
'cf-ip': correctness==1
}">
<slot></slot> <slot></slot>
</div> </button>
</Transition>
</template> </template>
<script lang="ts"> <script lang="ts">
import { Transition } from 'vue';
export default { export default {
data() {
return {
modal_open: false,
}
},
props: { props: {
correctness: { correctness: {
type: Number, type: Number,
default: 0, default: 0,
}, },
},
methods: {
onclick () {
if (this.correctness == 2) this.$emit('pressed_wordle');
} }
},
} }
</script> </script>
@@ -22,8 +41,6 @@ import { Transition } from 'vue';
.v-enter-active { .v-enter-active {
transition: opacity 0.5s ease; transition: opacity 0.5s ease;
} }
.gw-div::first-letter { .gw-div::first-letter {
font-weight: bold; font-weight: bold;
} }
@@ -35,8 +52,11 @@ import { Transition } from 'vue';
background-color: grey; background-color: grey;
color: white; color: white;
} }
.gw-button {
}
.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);
@@ -45,13 +65,20 @@ import { Transition } from 'vue';
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;
}
.cf-cp.hover {
background-color: #4CAF50; /* Green */
}
.cf-cp.focus {
background-color: red;
} }
.cf-ip { .cf-ip {
background-color: rgb(106, 108, 160); background-color: rgb(106, 108, 160);
+3 -1
View File
@@ -35,8 +35,10 @@
<GuessWord :correctness="4">Acronym</GuessWord> <GuessWord :correctness="4">Acronym</GuessWord>
</div> </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"> 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> </template>
</UModal> </UModal>
+91
View File
@@ -0,0 +1,91 @@
<template>
<Modal v-model:open="open">
<h1>Wordle for word {{ index }}</h1>
<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">
<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"/>
<UButton type="submit" style="display: none;">
Submit
</UButton>
</UForm>
<WordleRow v-if="guesses.length < i" :length="correct.length"/>
</template>
<template v-if="guesses[guesses.length-1].toString().replace(/\,/gi, '') == correct">
You guessed word #{{ index }}! It was '{{ correct }}'
</template>
</div>
<UButton @click="onsubmit" class="m-3" v-if="guesses[guesses.length-1].toString().replace(/\,/gi, '') != correct">
Submit
</UButton>
</Modal>
</template>
<script setup lang="ts">
import Modal from './Modal.vue';
import WordleRow from './WordleRow.vue';
</script>
<script lang="ts">
export default {
data() {
return {
max_guesses: 10,
open: true,
guess: '',
guesses: [''],
}
},
props: {
correct: {
type: String,
default: 'nagyonhosszezugyselesz'
},
index: {
type: Number,
default: 0,
},
date: {
type: String,
default: '1970-01-01',
}
},
mounted() {
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: {
onsubmit () {
if (this.guess.length == this.correct.length) {
this.guesses.push(this.guess);
this.guess = '';
localStorage.setItem('guesses-' + this.index, JSON.stringify(this.guesses));
}
},
},
}
</script>
<style scoped>
.flex-container-a {
display: flex;
flex-direction: column;
flex-wrap: wrap;
justify-content: center;
}
</style>
+85
View File
@@ -0,0 +1,85 @@
<script setup lang="ts">
</script>
<template>
<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, 'incorrect' : getCorrectness[i-1]==0}" >
{{ guess[i-1] }}
</div>
</div>
</template>
<script lang="ts">
export default {
data() {
return {
}
},
props: {
correct: {
type: String,
default: 'testword',
},
guess: {
type: String,
default: '',
},
index: Number,
empty: {
type: Boolean,
default: false,
},
length: Number,
},
computed: {
getCorrectness() : number[] {
let correctness_alt = [];
let correctness = [];
for (let i = 0; i < this.guess.length; i++) {
if (this.guess[i] == this.correct[i]) {
correctness.push(2);
} else correctness.push(0);
}
correctness_alt = correctness.slice();
for (let i = 0; i < this.guess.length; i++) {
for (let j = 0; j < this.correct.length; j++) {
if (this.guess[i] == this.correct[j] && correctness[i] == 0 && correctness_alt[j] == 0) {
correctness[i] = 1;
correctness_alt[j] = 1;
}
}
}
return correctness;
}
},
}
</script>
<style scoped>
.wr-div {
justify-content: center;
border-radius: 6px;
width: 32px;
height: 32px;
line-height: 32px;
background-color: transparent;
text-transform: uppercase;
font-weight: bold;
}
.correct {
background-color: rgb(0, 126, 2);
}
.incorrect {
background-color: var(--incorrect-guess);
}
.wrong-place {
background-color: var(--partial-correct-guess);
}
.empty {
background-color: var(--incorrect-guess);
}
</style>
+51 -7
View File
@@ -3,6 +3,7 @@
import GuessWord from '../components/GuessWord.vue'; import GuessWord from '../components/GuessWord.vue';
import Modal from '../components/Modal.vue'; import Modal from '../components/Modal.vue';
import Review from '../components/Review.vue'; import Review from '../components/Review.vue';
import Wordle from '../components/Wordle.vue';
</script> </script>
<script lang="ts"> <script lang="ts">
@@ -12,14 +13,20 @@
hint: ' ', hint: ' ',
guesses: [''], guesses: [''],
words: [''], words: [''],
correct_words: [''],
guess: '', guess: '',
tla: '', tla: '',
context: '', context: '',
submitter: '', submitter: '',
date: '',
victory: false, victory: false,
loss: false, loss: false,
maxGuesses: 10, maxGuesses: 10,
correct: false, correct: false,
no_tla: false,
wordle_open: [false, false, false],
wordle_dontshow: false,
wordle_hint: false,
}; };
}, },
@@ -27,13 +34,22 @@
axios axios
.get('/api/fetch_tla/en') .get('/api/fetch_tla/en')
.then(response => { .then(response => {
if (response.data.no_tla) this.no_tla = true;
else {
this.hint = response.data.hint; this.hint = response.data.hint;
this.submitter = response.data.submitter; this.submitter = response.data.submitter;
this.guesses = response.data.guesses; this.guesses = response.data.guesses;
this.tla = response.data.tla; this.tla = response.data.tla;
this.context = response.data.context; this.context = response.data.context;
this.correct = response.data.correct; this.correct = response.data.correct;
this.correct_words = response.data.tla_array;
this.date = response.data.date;
}
}); });
if (localStorage.wordle_dontshow) {
this.wordle_dontshow = localStorage.wordle_dontshow;
}
}, },
methods: { methods: {
@@ -48,6 +64,7 @@
this.guesses = response.data.guesses; this.guesses = response.data.guesses;
this.guess = ''; this.guess = '';
this.words = []; this.words = [];
this.correct_words = response.data.tla_array;
let current_guess = response.data.guesses[response.data.guesses.length-1] let current_guess = response.data.guesses[response.data.guesses.length-1]
if (Number(current_guess[3]) + Number(current_guess[4]) + Number(current_guess[5]) == 12) { if (Number(current_guess[3]) + Number(current_guess[4]) + Number(current_guess[5]) == 12) {
@@ -67,6 +84,10 @@
}, },
onkeyup() { onkeyup() {
this.words = this.guess.trim().split(/\s+/); this.words = this.guess.trim().split(/\s+/);
},
wordle_disable() {
this.wordle_dontshow = true;
localStorage.wordle_dontshow = true;
} }
} }
} }
@@ -84,19 +105,18 @@
</template> </template>
<template v-for="guess in guesses"> <template v-for="guess in guesses" v-if="guesses.length>0">
<div class="flex-container"> <div class="flex-container">
<template v-for="i in 3"> <template v-for="i in 3">
<GuessWord :correctness="Number(guess[i+2])"> <GuessWord @pressed_wordle="wordle_open[i-1] = true" :correctness="Number(guess[i+2])" :index="i-1">
{{ guess[i-1] }} {{ guess[i-1] }}
</GuessWord> </GuessWord>
<Wordle v-model:open="wordle_open[i-1]" :correct="correct_words[i-1]" :index="i" :date="date"/>
</template> </template>
</div> </div>
</template> </template>
<template v-if="guesses.length < maxGuesses && !correct && !no_tla">
<template v-if="guesses.length < maxGuesses && !correct">
<div class="flex-container" v-if="guess.length > 0"> <div class="flex-container" v-if="guess.length > 0">
<template v-for="word in words"> <template v-for="word in words">
<GuessWord :correctness="words.length == 3 ? -1 : (words.length > 3 ? -2 : -3)"> <GuessWord :correctness="words.length == 3 ? -1 : (words.length > 3 ? -2 : -3)">
@@ -114,6 +134,10 @@
</UButton> </UButton>
</UForm> </UForm>
</template> </template>
<template v-if="no_tla">
<h2>No TLA for today, please shoot me an email to <a style="text-decoration: underline;" href="mailto:peter@sc0tt.org">
peter@sc0tt.org</a></h2>
</template>
<template v-if="!correct && guesses.length >= maxGuesses"> <template v-if="!correct && guesses.length >= maxGuesses">
You ran out of guesses. Todays TLA was <b>{{ tla }}</b> You ran out of guesses. Todays TLA was <b>{{ tla }}</b>
<Review/> <Review/>
@@ -122,10 +146,10 @@
You completed todays TLAdle! Todays TLA was <b>{{ tla }}</b> You completed todays TLAdle! Todays TLA was <b>{{ tla }}</b>
<Review/> <Review/>
</template> </template>
<h3>Guesses left: {{ maxGuesses - guesses.length }}</h3> <h3 v-if="!no_tla">Guesses left: {{ maxGuesses - guesses.length }}</h3>
</UCard> </UCard>
<br> <br>
<template v-if="submitter != ''"> <template v-if="submitter != null">
Todays TLA was submitted by <b>{{ submitter }}</b> Todays TLA was submitted by <b>{{ submitter }}</b>
<br><br> <br><br>
</template> </template>
@@ -146,6 +170,26 @@
{{ context }} {{ context }}
</Modal> </Modal>
<br>
<UForm @submit="wordle_disable" v-if="!wordle_dontshow">
<UAlert
title="Press the word if the starting letter is correct to launch a mini wordle!"
color="success"
style="text-align: left; margin-top: 10px;"
variant="subtle"
orientation="horizontal"
:actions="[
{
label: 'Don\'t show again',
color: 'warning',
type: 'submit',
variant: 'subtle'
}
]"
/>
</UForm>
</template> </template>
+4 -2
View File
@@ -36,6 +36,9 @@ import Modal from '../components/Modal.vue';
If you wish, you can submit adnother TLA by exiting this alert. <br><br> If you wish, you can submit adnother TLA by exiting this alert. <br><br>
<UButton to="/">Main page</UButton> <UButton to="/">Main page</UButton>
</Modal> </Modal>
<Modal v-model:open="missing_fields">
<b>Please fill out all required fields (marked with *)</b>
</Modal>
</template> </template>
@@ -50,8 +53,6 @@ import Modal from '../components/Modal.vue';
<script lang="ts"> <script lang="ts">
import axios from 'axios'; import axios from 'axios';
export default { export default {
data() { data() {
return { return {
@@ -62,6 +63,7 @@ import axios from 'axios';
language: '', language: '',
submitter: '', submitter: '',
}, },
missing_fields: false,
submited: false, submited: false,
}; };