diff --git a/app/Http/Controllers/Fo/NewsController.php b/app/Http/Controllers/Fo/NewsController.php new file mode 100644 index 0000000..a296201 --- /dev/null +++ b/app/Http/Controllers/Fo/NewsController.php @@ -0,0 +1,66 @@ +where('type', StaticPageType::news)->firstOrFail(); + + /** @var \App\Models\News $newsModels */ + $newsModels = News::query()->where('published', true)->orderBy('publish_at', 'desc')->get(); + return view('fo.pages.news.index', \compact('staticPageModel', 'newsModels')); + } + + /** + * Display a news articles + * + * @param string $slug + * @return \Illuminate\Contracts\View\View + */ + public function show(string $slug): \Illuminate\Contracts\View\View + { + /** @var \App\Models\News $newsModel */ + $newsModel = News::query() + ->where('published', true) + ->where('slug', $slug) + ->firstOrFail(); + return view('fo.pages.news.show', \compact('newsModel')); + } + + /** + * Get filtered news. + * + * @return \Illuminate\Http\JsonResponse + */ + public function newsFiltered(): \Illuminate\Http\JsonResponse + { + $categoryId = ToolboxHelper::getValidatedEnum( + 0, + 'category', + '\App\Enums\News\CategoryEnum', + ); + $newsModels = News::query() + ->where('published', true) + ->when($categoryId != 0, function (Builder $query) use ($categoryId) { + $query->where('category', $categoryId); + }) + ->orderBy('publish_at', 'desc') + ->get(); + return response()->json($newsModels); + } +} diff --git a/app/Traits/Enums/BaseEnum.php b/app/Traits/Enums/BaseEnum.php index 559b1ee..48962f4 100644 --- a/app/Traits/Enums/BaseEnum.php +++ b/app/Traits/Enums/BaseEnum.php @@ -167,7 +167,6 @@ trait BaseEnum return $this->value; } - // * CACHE /** diff --git a/resources/assets/images/global/bg-grey-desktop.svg b/resources/assets/images/global/bg-grey-desktop.svg new file mode 100644 index 0000000..045b2d7 --- /dev/null +++ b/resources/assets/images/global/bg-grey-desktop.svg @@ -0,0 +1,13 @@ + + + + + + + + + diff --git a/resources/assets/images/socials/facebook-white-logo.svg b/resources/assets/images/socials/facebook-white-logo.svg new file mode 100644 index 0000000..2a0c222 --- /dev/null +++ b/resources/assets/images/socials/facebook-white-logo.svg @@ -0,0 +1,14 @@ + + + + + + + + + diff --git a/resources/assets/images/socials/instagram-white-logo.svg b/resources/assets/images/socials/instagram-white-logo.svg new file mode 100644 index 0000000..2e54aa4 --- /dev/null +++ b/resources/assets/images/socials/instagram-white-logo.svg @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + diff --git a/resources/assets/images/socials/linkedin-white-logo.svg b/resources/assets/images/socials/linkedin-white-logo.svg new file mode 100644 index 0000000..75097ff --- /dev/null +++ b/resources/assets/images/socials/linkedin-white-logo.svg @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + diff --git a/resources/sass/fo/base/_common.scss b/resources/sass/fo/base/_common.scss index 66eb22f..2934c7e 100644 --- a/resources/sass/fo/base/_common.scss +++ b/resources/sass/fo/base/_common.scss @@ -72,7 +72,7 @@ img { max-width: 100%; } } .highlight.yellow { - @include button-shape(#ffcb52); + @include button-shape($color-secondary); } .highlight.maroon { @@ -89,6 +89,20 @@ img { max-width: 100%; } } } +.social-icon { + width: 4rem; + padding: 0 1rem; + + &:hover { + fill: $color-white; + } + + @include media-breakpoint-up(lg) { + width: 2.2rem; + padding:0; + } +} + .rotate-180 { rotate: 180deg; } diff --git a/resources/sass/fo/base/_layout.scss b/resources/sass/fo/base/_layout.scss index f9de59b..80dc056 100644 --- a/resources/sass/fo/base/_layout.scss +++ b/resources/sass/fo/base/_layout.scss @@ -117,20 +117,6 @@ letter-spacing: .1rem; } - .social-icon { - width: 4rem; - padding: 0 1rem; - - &:hover { - fill: $color-white; - } - - @include media-breakpoint-up(lg) { - width: 2.2rem; - padding:0; - } - } - a,span { font-family: 'Readex Pro', sans-serif !important; } diff --git a/resources/sass/fo/fo.scss b/resources/sass/fo/fo.scss index d5d248e..05df477 100644 --- a/resources/sass/fo/fo.scss +++ b/resources/sass/fo/fo.scss @@ -24,3 +24,4 @@ @import './pages/product'; @import './pages/about-us'; @import './pages/convictions'; +@import './pages/news'; diff --git a/resources/sass/fo/pages/_homepage.scss b/resources/sass/fo/pages/_homepage.scss index f084da5..dc93596 100644 --- a/resources/sass/fo/pages/_homepage.scss +++ b/resources/sass/fo/pages/_homepage.scss @@ -205,7 +205,7 @@ } } - .news .swiper-news, + .news .swiper-homepage-news, .ranges .swiper-ranges { .swiper-button { &-prev, @@ -218,7 +218,7 @@ } .news { - .swiper-news { + .swiper-homepage-news { border: 5px solid transparent; .swiper-slide { diff --git a/resources/sass/fo/pages/_news.scss b/resources/sass/fo/pages/_news.scss new file mode 100644 index 0000000..3b10e78 --- /dev/null +++ b/resources/sass/fo/pages/_news.scss @@ -0,0 +1,56 @@ +.news { + .fs-news { + font-size: calc(1.375rem + 3.2vw) + } + + .swiper-button { + &-prev, + &-next { width: 3rem; } + + &-next { rotate: 180deg; } + + &-disabled { opacity: .5; } + } + + .swiper-slide { + &-content { + width: auto; + } + + &-news-container{ + background-image: url('@/images/global/bg-white-desktop.png'); + background-position: center; + background-repeat: no-repeat; + background-size: 100% 100%; + } + } + + &-category-arrow{ + width: 2rem; + height: 2rem; + rotate: 180deg; + } + + &-show-w-85{ + width: 85%; + } +} + +.news-single { + &-img.bg-agis-white { + background-position: bottom; + background-size: 100% 85%; + } + + &-title { + width: 100%; + } +} + +@include media-breakpoint-up(lg) { + .news-single { + &-title { + width: fit-content; + } + } +} diff --git a/resources/ts/fo/base/common.ts b/resources/ts/fo/base/common.ts index f4ca65e..6dcbba1 100644 --- a/resources/ts/fo/base/common.ts +++ b/resources/ts/fo/base/common.ts @@ -72,7 +72,7 @@ document.addEventListener("DOMContentLoaded", function () { } // SWIPER const swiperConfig = { - "swiper-news": { + "swiper-homepage-news": { modules: [Navigation], grabCursor: true, slidesPerView: 1, @@ -87,6 +87,26 @@ document.addEventListener("DOMContentLoaded", function () { }, }, }, + "swiper-news": { + modules: [Navigation], + grabCursor: true, + slidesPerView: 1, + spaceBetween: 60, + keyboard: { + enabled: true + }, + // Navigation arrows + navigation: { + nextEl: ".swiper-button-next", + prevEl: ".swiper-button-prev", + }, + breakpoints: { + // when window width is >= 1200px + 1200: { + slidesPerView: 3, + }, + }, + }, "swiper-ranges": { modules: [Navigation], grabCursor: true, diff --git a/resources/ts/fo/components/NewsListComponent.vue b/resources/ts/fo/components/NewsListComponent.vue new file mode 100644 index 0000000..4762df1 --- /dev/null +++ b/resources/ts/fo/components/NewsListComponent.vue @@ -0,0 +1,323 @@ + + + + + + + + {{ __('nos actualités') }} + + + + + + + + + + {{ __('Toutes catégories') }} + + + {{ categoryEnum.label }} + + + + + + + + + + + + + + + + {{ new Date(news.publish_at as string).toLocaleDateString() }} + + + {{ news.title }} + + + {{ __('> Lire la suite') }} + + + + + + + + + + + + + + + + + + + + + + + + + {{ new Date(news.publish_at as string).toLocaleDateString() }} + + + {{ news.title }} + + + {{ __('> Lire la suite') }} + + + + {{ categoryEnum.label }} + + + + + + + + + + + + diff --git a/resources/ts/fo/components/shims-vue.d.ts b/resources/ts/fo/components/shims-vue.d.ts deleted file mode 100644 index d2833d6..0000000 --- a/resources/ts/fo/components/shims-vue.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -declare module "*.vue" { - import type { DefineComponent } from "vue"; - const component: DefineComponent<{}, {}, any>; - // @ts-ignore - export default component; -} diff --git a/resources/views/fo/layout.blade.php b/resources/views/fo/layout.blade.php index f0988b5..801432d 100644 --- a/resources/views/fo/layout.blade.php +++ b/resources/views/fo/layout.blade.php @@ -23,7 +23,7 @@ @include('fo.layouts.footer') @stack('scripts-constants') @include('vendor.cn-cookies') - @include('modules.script-constants') + @include('modules.script-routes') @vite(['resources/ts/fo/fo.ts']) @stack('scripts')
+ {{ new Date(news.publish_at as string).toLocaleDateString() }} +
+ {{ news.title }} +
+ {{ categoryEnum.label }} +