diff --git a/app/Http/Controllers/Club/GoldenCrushController.php b/app/Http/Controllers/Club/GoldenCrushController.php index 1a11fda5..268766db 100644 --- a/app/Http/Controllers/Club/GoldenCrushController.php +++ b/app/Http/Controllers/Club/GoldenCrushController.php @@ -3,6 +3,7 @@ namespace App\Http\Controllers\Club; use App\Http\Controllers\Controller; +use App\Lib\Helpers\GamePeriodHelper; use App\Models\GoldenCrushGame; use Illuminate\Http\RedirectResponse; use Illuminate\Http\Request; @@ -54,11 +55,26 @@ class GoldenCrushController extends Controller 'ip_address' => $request->ip(), ]); - return redirect()->route('club.golden-crush.end-of-participation'); + return redirect()->route('club.golden-crush.thanks-for-participation'); + } + + /** + * View to thanks if customer has participated. + * @return \Illuminate\Contracts\View\View + */ + public function thanksForParticipation(): \Illuminate\Contracts\View\View + { + $customerId = auth('club')->id(); + $alreadyParticipated = GoldenCrushGame::hasCustomerParticipated($customerId); + if (!$alreadyParticipated) { + abort(404); + } + return view('club.pages.games.thanks-for-participation'); } /** * View for end of participation if customer has participated. + * * @return \Illuminate\Contracts\View\View */ public function endOfParticipation(): \Illuminate\Contracts\View\View @@ -70,4 +86,17 @@ class GoldenCrushController extends Controller } return view('club.pages.games.end-of-participation'); } + + /** + * View for end of game. + * + * @return \Illuminate\Contracts\View\View + */ + public function endOfGame(): \Illuminate\Contracts\View\View + { + if (! GamePeriodHelper::endAt()) { + abort(404); + } + return view('club.pages.games.end-of-game'); + } } diff --git a/app/Http/Middleware/RedirectToGoldenIfVoteOpen.php b/app/Http/Middleware/RedirectToGoldenIfVoteOpen.php index 4acefce2..1bf6ae41 100644 --- a/app/Http/Middleware/RedirectToGoldenIfVoteOpen.php +++ b/app/Http/Middleware/RedirectToGoldenIfVoteOpen.php @@ -4,7 +4,6 @@ namespace App\Http\Middleware; use App\Lib\Helpers\GamePeriodHelper; use Closure; -use Carbon\Carbon; use Illuminate\Http\Request; use Symfony\Component\HttpFoundation\Response; @@ -14,10 +13,10 @@ class RedirectToGoldenIfVoteOpen { if (! GamePeriodHelper::isOpen()) { return redirect() - ->route('club.home') - ->with('error', 'La période daccès à cette page est terminée ou non commencée.'); + ->route('club.home.show') + ->with('error', 'La période d \'accès à cette page est terminée ou non commencée.'); } - + return $next($request); } } diff --git a/app/Http/Middleware/SecureHeaders.php b/app/Http/Middleware/SecureHeaders.php index 7bad928d..dabab4b5 100644 --- a/app/Http/Middleware/SecureHeaders.php +++ b/app/Http/Middleware/SecureHeaders.php @@ -108,19 +108,6 @@ class SecureHeaders implode(' ', $cspPolicies) . $reportUri ); $response->headers->set('Feature-Policy', 'fullscreen=(self \'https://www.youtube.com\');'); - - $end = GamePeriodHelper::endAt(); - - if (! $end || ! GamePeriodHelper::isOpen()) { - $response->headers->set('Cache-Control', 'no-store'); - return $response; - } - - $maxAge = max(0, $end->timestamp - now()->timestamp); - - if (str_contains($request->path(), 'storage/videos')) { - $response->headers->set('Cache-Control', 'public, max-age=' . $maxAge); - } return $response; } diff --git a/app/Lib/Helpers/GamePeriodHelper.php b/app/Lib/Helpers/GamePeriodHelper.php index 368cc519..be23ae0e 100644 --- a/app/Lib/Helpers/GamePeriodHelper.php +++ b/app/Lib/Helpers/GamePeriodHelper.php @@ -33,7 +33,7 @@ class GamePeriodHelper */ public static function endAt(): ?Carbon { - $endAt = config('vote.end_at'); + $endAt = config('vote.end-of-participation'); return $endAt ? Carbon::parse($endAt) : null; } diff --git a/config/vote.php b/config/vote.php index b266aeaf..aa92e202 100644 --- a/config/vote.php +++ b/config/vote.php @@ -3,4 +3,5 @@ return [ 'start_at' => env('VOTE_START_AT'), 'end_at' => env('VOTE_END_AT'), + 'end-of-participation' => env('DATE_END_PARTICIPATE'), ]; diff --git a/resources/sass/club/components/info-section.scss b/resources/sass/club/components/info-section.scss index 9a0f3dbf..15cdb652 100644 --- a/resources/sass/club/components/info-section.scss +++ b/resources/sass/club/components/info-section.scss @@ -1,6 +1,5 @@ .gc-info-section { position: relative; - overflow: hidden; padding: 55px 0 65px; } @@ -19,7 +18,7 @@ } .gc-info-underline { - width: --underline-width; + width: var(--underline-width); height: 57px; margin-top: 20px; margin-bottom: 40px; @@ -27,8 +26,7 @@ } .gc-info-description { - max-width: 820px; - margin: 0 auto 105px; + margin: 70px auto 105px; color: #fff; font-family: BourtonBase, sans-serif; font-size: 24px; @@ -39,6 +37,10 @@ .gc-info-button-wrap { padding-bottom: 80px; +} + +.gc-info-btn-shadow, .badge-wrap { + display: inline-block; filter: drop-shadow(0 6px 12px rgb(0 0 0 / 45%)); } @@ -78,7 +80,7 @@ .gc-info-deco--left { top: 345px; - left: -270px; + left: -265px; width: 230px; height: 150px; } @@ -98,90 +100,143 @@ transform: rotate(7deg); } -.gc-info-date-badge, -.gc-info-winner-badge { +.gc-info-date-badge { display: inline-flex; align-items: center; justify-content: center; + padding: 6px 16px; + margin: 0 6px; background: #fff; + clip-path: polygon(0 0, -0.78% -0.25%, 45.41% 6px, 100% 8%, 95.08% 52.28%, 100% 100%, 49.87% 90.69%, 1px 100%, 5.93% 62.2%); color: #0F437E; font-family: BourtonBase, sans-serif; - transform: rotate(-4deg); -} - -.gc-info-date-badge { - padding: 6px 16px; - font-size: 16px; + font-size: 22px; + font-weight: normal; + transform: rotate(-6deg) translateY(-4px); + vertical-align: super; } .gc-info-winner-badge { + display: inline-flex; + width: 312px; min-width: 180px; + height: 80px; + align-items: center; + justify-content: center; padding: 14px 32px; - margin: 12px auto 28px; + margin: 20px auto 28px; background: #efa82b; + clip-path: polygon(31% 7%,73% 1%,100% 10%,100% 100%,44% 97%,0% 100%,0% 0%); color: #0F437E; - font-size: 24px; + filter: drop-shadow(0 4px 4px rgb(0 0 0 / 25%)); + font-family: BourtonBase, sans-serif; + font-size: 34px; + transform: rotate(2deg); } .gc-info-subtitle { color: #fff; font-family: BourtonBase, sans-serif; - font-size: 24px; - letter-spacing: .08em; + font-size: 44px; + letter-spacing: .01em; text-transform: uppercase; } .gc-info-underlined-title { - margin-bottom: 22px; + margin-top: -40px; + margin-bottom: 55px; color: #fff; font-family: BourtonBase, sans-serif; - font-size: 26px; + font-size: 44px; letter-spacing: .08em; text-decoration: underline; text-transform: uppercase; text-underline-offset: 6px; } +@media (width >= 768px) { + .gc-info-title br { + display: none; + } +} + @media (width <= 767.98px) { .gc-info-section { - padding: 42px 0 50px; + padding: 38px 0 42px; } .gc-info-title { - font-size: 24px; + max-width: 330px; + margin: 0 auto; + font-size: 44px; + line-height: 1.35; + text-align: center; + } + + .gc-info-title br, .thanks-for { + display: block !important; + } + + .gc-info-description .desc-no-br br { + display: none; } .gc-info-underline { - height: 28px; - margin-bottom: 28px; + width: 305px !important; + height: 58px; + margin-bottom: 1.5rem; + background: url("/resources/assets/images/club/game-golden-crush/underline-mobile.png") center no-repeat; + background-size: contain; } .gc-info-description { - max-width: 320px; - font-size: 12px; - line-height: 1.55; + margin: 60px 5px 68px; + font-size: 24px; + letter-spacing: .01em; + line-height: 31px; + text-align: center; + } + + .gc-info-button-wrap { + padding-bottom: 0; } .gc-info-btn { - width: min(300px, 90vw); min-width: 0; - padding: 14px 18px; - font-size: 16px; + padding: 46px 14px; + font-size: 34px; + letter-spacing: .01em; + line-height: 44px; } - .gc-info-deco--left { - bottom: 80px; - left: -10px; - width: 85px; + + .gc-info-deco { + display: none; } - .gc-info-deco--right { - top: 95px; - right: -20px; + .gc-info-date-badge { width: 110px; + height: 54px; + padding: 4px 10px; + font-size: 24px; + transform: rotate(-6deg) translateY(-2px); + } + + .gc-info-winner-badge { + width: min(210px, 80vw); + height: 58px; + font-size: 22px; + } + + .gc-info-subtitle { + font-size: 24px; + line-height: 1.3; } .gc-info-underlined-title { - font-size: 18px; + margin-top: 0; + margin-bottom: 30px; + font-size: 22px; + line-height: 1.3; } } diff --git a/resources/sass/fo/components/page-golden-crush/cards.scss b/resources/sass/fo/components/page-golden-crush/cards.scss index 4ac246ef..e30c0c5d 100644 --- a/resources/sass/fo/components/page-golden-crush/cards.scss +++ b/resources/sass/fo/components/page-golden-crush/cards.scss @@ -8,10 +8,19 @@ background-size: cover; } -.promo-cards-section .row { - column-gap: 20px; +.promo-cards-section { + padding-top: 70px; + padding-bottom: 100px; } +.promo-cards-grid { + display: flex; + flex-wrap: wrap; + justify-content: center; + gap: 84px; +} + + .promo-card-wrap { position: relative; width: 100%; @@ -32,7 +41,7 @@ flex-direction: column; padding: 60px 40px 30px; background: #fff; - clip-path: polygon(-0.15% 0.58%, 39.4% 18px, 76.88% 2.00%, 99.02% 5.38%, 100% 96%, 56% 100%, 22.3% 97.32%, 0 98%, 0 10%); + clip-path: polygon(-0.15% 1.78%, 39.4% 18px, 76.88% 2%, 99.02% 5.38%, 100% 96%, 56% 100%, 22.3% 97.32%, 0 98%, 0 10%); text-align: center; transition: filter .3s ease, transform .3s ease; } @@ -40,6 +49,7 @@ @media (hover: hover) and (pointer: fine) { .promo-card-wrap:hover { filter: drop-shadow(0 12px 32px rgb(0 0 0 / 25%)); + transform: scale(1.01); } } @@ -117,7 +127,6 @@ .promo-card-desc { width: 344px; padding-bottom: 20px; - margin-top: 15px; color: #4E3238; font-family: BourtonBase, sans-serif; font-size: 16px; @@ -133,7 +142,7 @@ height: 50px; align-items: center; justify-content: center; - padding: 10px; + padding: 10px 15px; margin: auto auto 60px; background: #4E3238; color: #fff; @@ -158,6 +167,14 @@ background-size: 300% 250%; } + .promo-cards-grid { + gap: 18px; + } + + .promo-card-wrap { + width: 320px; + } + .promo-card { height: 360px; padding: 50px 30px 25px; @@ -195,16 +212,29 @@ background-size: 400% 250%; } + + + .promo-cards-grid { + align-items: center; + gap: 90px; + } + + .promo-card-wrap { + width: 100%; + max-width: 360px; + height: 400px; + } + .promo-card { max-width: 380px; - height: 380px; - padding: 40px 40px 20px; + padding: 40px 20px 20px; } .promo-card-img { - top: -20px; + top: -38px; right: 20px; - width: 120px; + width: 140px; + height: 93px; } .promo-card-body { @@ -213,18 +243,30 @@ .promo-card-title { margin-top: 0; - font-size: 30px; - line-height: 1.15; + font-size: 28px; + line-height: 36px; } .promo-card-desc { + width: 285px !important; + padding-bottom: 0; font-size: 16px; - line-height: 1.4; + line-height: 21px; } .promo-card-btn { - padding: 10px 20px; - font-size: 14px; + padding: 10px; + font-size: 16px; gap: 6px; } + + .cta-paper-card__corner--br-gold { + right: 28px; + bottom: -10px; + } + + .cta-paper-card__corner--br-blue { + right: 22px; + bottom: 31px; + } } \ No newline at end of file diff --git a/resources/views/club/pages/games/end-of-game.blade.php b/resources/views/club/pages/games/end-of-game.blade.php new file mode 100644 index 00000000..07d3f95b --- /dev/null +++ b/resources/views/club/pages/games/end-of-game.blade.php @@ -0,0 +1,110 @@ +@extends('club.layout') + +@section('title', __('Golden crush | fin de participation')) +@section('description', __('jeu Golden crush')) +@section('breadcrumb', request()->route()->getName()) + +@section('container-fluid', true) +@section('no-bottom-space', true) +@section('page-class', 'home') + +@section('content') + + +
+ +la recette gagnante est
+ +
+ On s'occupe de transformer votre vote en une recette vraiment
+ irrésistible.
+ Ça mijote… et ce sera gourmand et croustillant, promis !
+
- Vous faites partie de notre tirage au sort
- pour tenter de gagner
un Air Fryer Ninja,
- parmi les 10 mis en jeu pour vous régaler
- avec la gamme Panés Le Gaulois !
-
+ Merci pour votre participation.
+ Nous comptabilisons actuellement toutes les participations...
+ Nous annoncerons le
+ 28 MAI
+ quelle recette a remporté votre préférence !
+
+ Merci pour votre participation.
+ Nous comptabilisons actuellement toutes les participations...
+ Nous annoncerons
le
+ 28 MAI
+
recette a remporté votre préférence ! + +
+ Vous faites partie de notre tirage au sort
+ pour tenter de gagner
un Air Fryer Ninja,
+ parmi les 10 mis en jeu pour vous régaler
+ avec la gamme Panés Le Gaulois !
+