diff --git a/app/Http/Controllers/Fo/HomeController.php b/app/Http/Controllers/Fo/HomeController.php index b03fe03d..d9fcf82b 100644 --- a/app/Http/Controllers/Fo/HomeController.php +++ b/app/Http/Controllers/Fo/HomeController.php @@ -89,7 +89,8 @@ class HomeController extends Controller */ public function updateHotNewsSatus(): \Illuminate\Http\JsonResponse { - Cache::remember("hotNewsIsDisplayed", 60 * 60 * 24, fn() => true); + // Cache::remember("hotNewsIsDisplayed", 60 * 60 * 24, fn() => true); + Cache::put('hotNewsIsDisplayed', true, now()->addHours(24)); return response()->json(); } } diff --git a/resources/sass/fo/pages/home.scss b/resources/sass/fo/pages/home.scss index c40147f6..727c217a 100644 --- a/resources/sass/fo/pages/home.scss +++ b/resources/sass/fo/pages/home.scss @@ -5,7 +5,7 @@ #hot-news-desktop{ .wood-background{ - height: 22rem; + height: 20rem; background-image: url('@/images/home/hot-news-wood.png'); background-size: cover; } diff --git a/resources/ts/fo/pages/home.ts b/resources/ts/fo/pages/home.ts index 69338fe5..678a476c 100644 --- a/resources/ts/fo/pages/home.ts +++ b/resources/ts/fo/pages/home.ts @@ -64,12 +64,3 @@ function ajaxErrorHandler(e: any): void { } console.log(message); } - -// Définir une fonction pour ajouter une classe à une div si la taille du viewport est inférieure à 600px -// function addClassIfViewportLessThan600() { -// const viewportWidth = window.innerWidth; -// const targetDiv = document.querySelector("#home #hot-news-desktop"); -// if (viewportWidth < 600 && targetDiv) { -// targetDiv.classList.add("wood-background"); -// } -// } diff --git a/resources/views/fo/pages/home.blade.php b/resources/views/fo/pages/home.blade.php index 6beb6e4d..198e4916 100644 --- a/resources/views/fo/pages/home.blade.php +++ b/resources/views/fo/pages/home.blade.php @@ -8,8 +8,8 @@
{{-- HOT NEWS --}}
cache()->get('hotNewsIsDisplayed') + 'top-50 end-0 translate-middle-y position-fixed z-3 bg-white d-none d-xl-block line-border-small py-3', + 'd-none' => cache('hotNewsIsDisplayed'), ]) id="hot-news">
@@ -99,7 +99,7 @@
@endif {{-- HOT NEWS DESKTOP --}} -
+
@include('fo.partials.hot-news') diff --git a/resources/views/fo/partials/hot-news.blade.php b/resources/views/fo/partials/hot-news.blade.php index 4d1f3967..4d63a73d 100644 --- a/resources/views/fo/partials/hot-news.blade.php +++ b/resources/views/fo/partials/hot-news.blade.php @@ -6,7 +6,7 @@
tag actu
-
titre de la news
+
{{ __('titre de la news') }}

@@ -17,7 +17,7 @@
tag actu
-
titre de la news qui risque de prendre de la place alors j'écris un grand texte pour simuler ça
+
{{ str(__('titre de la news qui risque de prendre de la place alors j\'écris un grand texte pour simuler ça'))->words(10, '...') }}