words break for the news title for hot news

This commit is contained in:
Nicolas Demangeat 2024-04-24 16:23:56 +02:00
parent b8a24136e8
commit 2844fe1811
5 changed files with 8 additions and 16 deletions

View file

@ -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();
}
}

View file

@ -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;
}

View file

@ -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");
// }
// }

View file

@ -8,8 +8,8 @@
<section id="home">
{{-- HOT NEWS --}}
<div @class([
'top-50 end-0 translate-middle-y position-fixed z-3 bg-white d-none d-xl-block line-border-medium py-3',
'd-none' => 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">
<div id="hot-news-loader" class="bg-primary bg-opacity-50 position-absolute w-100 h-100 top-0 start-0 z-2">
<div class="position-absolute start-50 top-50 translate-middle">
@ -99,7 +99,7 @@
</section>
@endif
{{-- HOT NEWS DESKTOP --}}
<div id="hot-news-desktop" class="position-relative">
<div id="hot-news-desktop" class="position-relative d-block d-xl-none">
<div class="wood-background w-100"></div>
<div class="w-75 mx-auto d-block d-xl-none bg-white hot-news-position line-border-medium">
@include('fo.partials.hot-news')

View file

@ -6,7 +6,7 @@
</div>
<div class="col-8">
<div class="mb-1"><span class="text-bg-quad px-1">tag actu</span></div>
<div>titre de la news</div>
<div>{{ __('titre de la news') }}</div>
</div>
</div>
<hr>
@ -17,7 +17,7 @@
</div>
<div class="col-8">
<div class="mb-1"><span class="text-bg-quad px-1">tag actu</span></div>
<div>titre de la news qui risque de prendre de la place alors j'écris un grand texte pour simuler ça</div>
<div>{{ str(__('titre de la news qui risque de prendre de la place alors j\'écris un grand texte pour simuler ça'))->words(10, '...') }}</div>
</div>
</div>
<hr>