namespace App\Http\Controllers;
+use App\Models\Publication;
use App\Models\Resource;
use Cubist\Backpack\Magic\PageData;
use Cubist\Util\Files\Files;
-class FrontController extends Controller {
- public function splash() {
+class FrontController extends Controller
+{
+ public function splash()
+ {
return view('front.splash', $this->_getDataFromCMS());
}
- public function home() {
+ public function home()
+ {
return view('front.home', $this->_getDataFromCMS());
}
- public function resources() {
+ public function resources()
+ {
return view('front.resources', $this->_getDataFromCMS());
}
- public function medialibrary() {
+ public function medialibrary()
+ {
return view('front.media-library', $this->_getDataFromCMS());
}
- public function fluidbook($args = '') {
+ public function fluidbook($args = '')
+ {
if (!$args) {
$args = [];
} else {
}
- protected function _getDataFromCMS() {
- return ['resources' => $this->_getResourcesFromCMS()];
+ protected function _getDataFromCMS()
+ {
+ return ['resources' => $this->_getResourcesFromCMS(), 'home' => $this->_getHomeFromCMS(), 'medialibrary' => $this->_getMediaLibraryFromCMS()];
}
- protected function _getResourcesFromCMS() {
- $res= Resource::find('1')->getPageData();
+ protected function _getHomeFromCMS()
+ {
+ return Publication::find('1')->getPageData();
+ }
+
+ protected function _getMediaLibraryFromCMS()
+ {
+ return [];
+ }
+
+ protected function _getResourcesFromCMS()
+ {
+ $res = Resource::find('1')->getPageData();
return $res;
}
}
@php
// TEMPORARY DATA MOCKUP
- $logo = '/storage/102/groupe-84.svg';
- $subtitle = "Découvrez le coeur de l'offre sous forme de feuilleteur interactif";
- $button = "Découvrir l'offre";
- $button_link = '/front/coeur/index.html';
- $illustration = '/storage/137/home-magazine.jpg';
+ $illustration = $home->getImageURLbyCollection($home->get('illustration'));
$shortcuts = [
[
'title' => 'Ressources',
{{-- Left Column: logo + text + CTA --}}
<div class="home-left flex flex-1 flex-col justify-center items-center p-6 max-w-[360px]">
- @if($logo)
- <img class="mb-10" src="{{ $logo }}" alt="Logo"
- x-show="shown" x-transition.opacity.scale.80.origin.bottom.duration.800ms>
- @endif
- @if($subtitle)
- <p class="text-center mb-5 max-w-[280px]"
- x-show="shown" x-transition.opacity.scale.80.origin.bottom.duration.500ms.delay.100ms>
- {{ $subtitle }}
- </p>
- @endif
- @if($button)
- <a class="bg-blue text-white py-4 px-10 rounded-full transition transform hover:scale-105"
- href="{{ $button_link }}"
- x-show="shown" x-transition.opacity.scale.80.origin.bottom.duration.500ms.delay.100ms>
- {{ $button }}
- </a>
- @endif
+ <img class="mb-10" src="{{ $home->getImageURLbyCollection($home->get('logo')) }}" alt="Logo"
+ x-show="shown" x-transition.opacity.scale.80.origin.bottom.duration.800ms>
+
+ <p class="text-center mb-5 max-w-[280px]"
+ x-show="shown" x-transition.opacity.scale.80.origin.bottom.duration.500ms.delay.100ms>
+ {{ $home->get('subtitle') }}
+ </p>
+ <a class="bg-blue text-white py-4 px-10 rounded-full transition transform hover:scale-105"
+ href="/front/coeur/index.html"
+ x-show="shown" x-transition.opacity.scale.80.origin.bottom.duration.500ms.delay.100ms>
+ {{ $home->get('button') }}
+ </a>
</div>
{{-- Right Column: Illustration image --}}
</div>
{{-- Link blocks --}}
- <div class="grid grid-cols-3 gap-6 text-center lg:text-left" x-data="{ shown: false }" x-intersect="shown = true">
- @foreach($shortcuts as $shortcut)
+ <div class="grid grid-cols-3 gap-6 text-center lg:text-left" x-data="{ shown: false }"
+ x-intersect="shown = true">
+ @foreach($home->get('raccourcis') as $shortcut)
<x-link :href="$shortcut['link']"
class="group relative
flex flex-col lg:flex-row items-center
bg-blue text-white p-6 rounded-lg overflow-hidden">
- <img class="flex-shrink lg:mr-8 max-h-30 lg:max-h-none lg:w-[40%]" src="{{ $shortcut['image'] }}" alt="">
+ <img class="flex-shrink lg:mr-8 max-h-30 lg:max-h-none lg:w-[40%]" src="{{ $home->getImageURLbyCollection($shortcut['image']) }}"
+ alt="">
<div class="lg:flex-1 lg:flex-shrink-0 space-y-2">
<h3 class="font-semibold uppercase">{{ $shortcut['title'] }}</h3>
<p>{{ $shortcut['content'] }}</p>
<div class="circle-arrow transition transform group-hover:scale-110"></div>
</div>
{{-- Initial Mask --}}
- <div class="absolute top-0 left-0 w-full h-full bg-white z-1 transition-transform transform origin-top ease-out duration-500"
- :class="{ 'scale-y-0': shown }"
- style="transition-delay: {{ 300 + $loop->index * 100 }}ms"
+ <div
+ class="absolute top-0 left-0 w-full h-full bg-white z-1 transition-transform transform origin-top ease-out duration-500"
+ :class="{ 'scale-y-0': shown }"
+ style="transition-delay: {{ 300 + $loop->index * 100 }}ms"
>
</div>
</x-link>