From: Stephen Cameron Date: Wed, 27 Oct 2021 19:02:58 +0000 (+0200) Subject: WIP #4781 @5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=756466dbb778aa587aabfd20795e971ee31227ff;p=odl.git WIP #4781 @5 --- diff --git a/package-lock.json b/package-lock.json index b92bef2..2f3f4de 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,6 +5,7 @@ "packages": { "": { "devDependencies": { + "@alpinejs/intersect": "^3.4.2", "alpinejs": "^3.4.2", "autoprefixer": "^10.3.7", "axios": "^0.21", @@ -15,6 +16,12 @@ "tailwindcss": "^2.2.17" } }, + "node_modules/@alpinejs/intersect": { + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/@alpinejs/intersect/-/intersect-3.4.2.tgz", + "integrity": "sha512-n9B9JcqRiQ8b+ozWdU+x8e0AWXfaIljmrRlnkvPnUXsM3dGdeB5PCelaLEr98YyXGUW2YeugKEtPMsezwAMRUA==", + "dev": true + }, "node_modules/@babel/code-frame": { "version": "7.15.8", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.15.8.tgz", @@ -9604,6 +9611,12 @@ } }, "dependencies": { + "@alpinejs/intersect": { + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/@alpinejs/intersect/-/intersect-3.4.2.tgz", + "integrity": "sha512-n9B9JcqRiQ8b+ozWdU+x8e0AWXfaIljmrRlnkvPnUXsM3dGdeB5PCelaLEr98YyXGUW2YeugKEtPMsezwAMRUA==", + "dev": true + }, "@babel/code-frame": { "version": "7.15.8", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.15.8.tgz", diff --git a/package.json b/package.json index df0a457..d0ffd1f 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "production": "mix --production" }, "devDependencies": { + "@alpinejs/intersect": "^3.4.2", "alpinejs": "^3.4.2", "autoprefixer": "^10.3.7", "axios": "^0.21", diff --git a/resources/css/common/menu.css b/resources/css/common/menu.css index f63c347..aa9d510 100644 --- a/resources/css/common/menu.css +++ b/resources/css/common/menu.css @@ -1,7 +1,16 @@ -.menu-open .menu-overlay { - @apply opacity-100 pointer-events-auto; +body.menu-open { + /* Prevent scrollbars and scrolling when menu is open */ + max-height: 100vh; + overflow: hidden; } -.menu-open .header-logo, .menu-open .site-header { +.menu-open .site-header { + /* Header becomes fixed so that all elements are positioned at top, regardless of scroll position */ + @apply text-white; + position: fixed; + width: calc(100% - 4rem); /* Full width minus 2rem padding on each side */ +} + +.menu-open .header-logo { @apply text-white; } diff --git a/resources/js/bootstrap.js b/resources/js/bootstrap.js index ee2ac34..f20f4b2 100644 --- a/resources/js/bootstrap.js +++ b/resources/js/bootstrap.js @@ -1,6 +1,10 @@ // Add AlpineJS - https://alpinejs.dev/ import Alpine from 'alpinejs'; window.Alpine = Alpine; + +import intersect from '@alpinejs/intersect'; +Alpine.plugin(intersect) + Alpine.start(); diff --git a/resources/views/front/home.blade.php b/resources/views/front/home.blade.php index e733c0e..8deba39 100644 --- a/resources/views/front/home.blade.php +++ b/resources/views/front/home.blade.php @@ -7,7 +7,7 @@ $logo = 'https://odl.paris.cubedesigners.com/storage/102/groupe-84.svg'; $subtitle = "Découvrez le coeur de l'offre sous forme de feuilleteur interactif"; $button = "Découvrir l'offre"; - $illustration = 'https://odl.paris.cubedesigners.com/storage/103/magazine-mockup-presentation-vol9-at-2x.png'; + $illustration = 'https://odl.paris.cubedesigners.com/storage/137/home-magazine.jpg'; $shortcuts = [ [ 'title' => 'Ressources', @@ -33,26 +33,55 @@
{{-- Main home content --}} -
{{-- negative margin so image shadow sits under shortcuts --}} +
{{-- negative margin so image shadow sits under shortcuts --}} {{-- Left Column: logo + text + CTA --}}
- @if($logo)Logo@endif - @if($subtitle)

{{ $subtitle }}

@endif - @if($button){{ $button }}@endif + @if($logo) + Logo + @endif + @if($subtitle) +

+ {{ $subtitle }} +

+ @endif + @if($button) + + {{ $button }} + + @endif
{{-- Right Column: Illustration image --}} -
+
+
+
+
{{-- Link blocks --}} -
+
@foreach($shortcuts as $shortcut) -
+

{{ $shortcut['title'] }}

{{ $shortcut['content'] }}

- + +
+ {{-- Initial Mask --}} +
@endforeach diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php index 0eecbe1..bd7d457 100644 --- a/resources/views/layouts/app.blade.php +++ b/resources/views/layouts/app.blade.php @@ -7,16 +7,28 @@ {{ config('app.name') }} -