diff --git a/.gitea/workflows/build-image.yaml b/.gitea/workflows/build-image.yaml index 04fe91a..cf0cd9b 100644 --- a/.gitea/workflows/build-image.yaml +++ b/.gitea/workflows/build-image.yaml @@ -7,7 +7,7 @@ jobs: env: IMAGE_NAME: tladle REGISTRY_NAME: gitea.sc0tt.org - GIT_TAG: 1.3.1 + GIT_TAG: 2.0 runs-on: ubuntu-latest steps: - name: Checkout diff --git a/app/Filament/Resources/Tlas/Tables/TlasTable.php b/app/Filament/Resources/Tlas/Tables/TlasTable.php index f919a80..54d0375 100644 --- a/app/Filament/Resources/Tlas/Tables/TlasTable.php +++ b/app/Filament/Resources/Tlas/Tables/TlasTable.php @@ -31,7 +31,7 @@ class TlasTable ->dateTime() ->sortable() ->toggleable(isToggledHiddenByDefault: true), - ]) + ])->defaultSort('used', direction: 'asc') ->filters([ // ]) diff --git a/app/Filament/Resources/Tlas/TlaResource.php b/app/Filament/Resources/Tlas/TlaResource.php index 4b84973..fc11831 100644 --- a/app/Filament/Resources/Tlas/TlaResource.php +++ b/app/Filament/Resources/Tlas/TlaResource.php @@ -98,6 +98,7 @@ class TlaResource extends Resource DeleteBulkAction::make(), ]), ]); + } public static function getPages(): array diff --git a/app/Http/Controllers/TlaController.php b/app/Http/Controllers/TlaController.php index d3ec374..93a7089 100644 --- a/app/Http/Controllers/TlaController.php +++ b/app/Http/Controllers/TlaController.php @@ -17,6 +17,7 @@ class TlaController extends Controller $session->forget('tla-'.$language); $session->forget('correct-'.$language); $session->forget('review-'.$language); + $session->put('tla-array-'.$language, ['', '', '']); $session->put('date-'.$language, date('Y-m-d')); } } @@ -27,6 +28,9 @@ class TlaController extends Controller if ( !in_array($language, $allowedLanguages) ) $language = 'en'; $tla = Tla::GetCurrentTla($language); + + if ($tla == NULL) return response()->json([ 'no_tla' => true ]); + $this->session_flush($request, $language); $session = $request->session(); @@ -39,6 +43,7 @@ class TlaController extends Controller 'context' => $session->get('tla-'.$language) == $tla->acronym ? $tla->context : NULL, 'submitter' => $tla->submitter, '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); } + $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([ 'guesses' => $guesses, 'date' => $session->get('date'), @@ -103,6 +116,7 @@ class TlaController extends Controller 'context' => $session->get('tla-'.$language) == $tla_object->acronym ? $tla_object->context : NULL, 'score' => $score, 'correct' => $session->get('correct-'.$language), + 'tla_array' => $tla_array, ]); } diff --git a/app/Models/Tla.php b/app/Models/Tla.php index 366c5f4..638b86f 100644 --- a/app/Models/Tla.php +++ b/app/Models/Tla.php @@ -13,7 +13,7 @@ class Tla extends Model 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")) ->where('language', $language) ->first(); @@ -24,6 +24,8 @@ class Tla extends Model ->inRandomOrder() ->first(); + if ($tla == NULL) return NULL; + $tla->used = date("Y-m-d"); $tla->save(); } diff --git a/resources/css/app.css b/resources/css/app.css index 02e77c1..57df7d6 100644 --- a/resources/css/app.css +++ b/resources/css/app.css @@ -11,6 +11,11 @@ :root { --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 { diff --git a/resources/js/components/GuessWord.vue b/resources/js/components/GuessWord.vue index 3a6e999..d91b52b 100644 --- a/resources/js/components/GuessWord.vue +++ b/resources/js/components/GuessWord.vue @@ -1,20 +1,39 @@ @@ -22,8 +41,6 @@ import { Transition } from 'vue'; .v-enter-active { transition: opacity 0.5s ease; } - - .gw-div::first-letter { font-weight: bold; } @@ -35,8 +52,11 @@ import { Transition } from 'vue'; background-color: grey; color: white; } + .gw-button { + } + .default { - background-color: rgb(79, 79, 79); + background-color: var(--incorrect-guess) } .more { background-color: rgb(255, 0, 0); @@ -45,13 +65,20 @@ import { Transition } from 'vue'; background-color: rgb(129, 112, 0); } .cw-cp { - background-color: rgb(0, 126, 2); + background-color: var(--correct-guess) } .cw-ip { background-color: rgb(98, 175, 99); } .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 { background-color: rgb(106, 108, 160); diff --git a/resources/js/components/HowToPlay.vue b/resources/js/components/HowToPlay.vue index 2962f92..4114d2c 100644 --- a/resources/js/components/HowToPlay.vue +++ b/resources/js/components/HowToPlay.vue @@ -35,8 +35,10 @@ Acronym + 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, - let me know in an email, or create a pull request + let me know in an email, or create an issue diff --git a/resources/js/components/Wordle.vue b/resources/js/components/Wordle.vue new file mode 100644 index 0000000..73bb38e --- /dev/null +++ b/resources/js/components/Wordle.vue @@ -0,0 +1,91 @@ + + + + + + \ No newline at end of file diff --git a/resources/js/components/WordleRow.vue b/resources/js/components/WordleRow.vue new file mode 100644 index 0000000..31eb3d3 --- /dev/null +++ b/resources/js/components/WordleRow.vue @@ -0,0 +1,85 @@ + + + + + + + \ No newline at end of file diff --git a/resources/js/pages/HomeView.vue b/resources/js/pages/HomeView.vue index c32c34d..dc88adf 100644 --- a/resources/js/pages/HomeView.vue +++ b/resources/js/pages/HomeView.vue @@ -3,6 +3,7 @@ import GuessWord from '../components/GuessWord.vue'; import Modal from '../components/Modal.vue'; import Review from '../components/Review.vue'; +import Wordle from '../components/Wordle.vue';