Product header change on ranges select

This commit is contained in:
Jérémy Munsch 2021-03-31 15:51:02 +02:00
parent 3a2b747543
commit 577e9b1f7d
5 changed files with 15 additions and 60 deletions

View file

@ -42,13 +42,12 @@ class ProductsController extends Controller
switch ($type) {
case 'gamme':
$range = Ranges::where([['slug', $slug], ['status', 1]])->first();
if (!$range) {
$gamme = Ranges::where([['slug', $slug], ['status', 1]])->first();
if (!$gamme) {
abort(404);
}
$productsList = $range->products;
$title = $range->name;
$gamme = true;
$productsList = $gamme->products;
$title = $gamme->name;
break;
case 'type-viande':
$meatType = MeatTypes::where([['slug', $slug], ['status', 1]])->first();

View file

@ -141,30 +141,6 @@
}
&.entete-white {
.color-1 {
background-color: rgba(142, 184, 233, 1);
}
.color-2 {
background-color: rgba(255, 180, 0, 1);
}
.color-3 {
background-color: rgba(172, 40, 61, 1);
}
.color-4 {
background-color: rgba(231, 145, 14, 1);
}
.color-5 {
background-color: rgba(250, 183, 216, 1);
}
.color-6 {
background-color: rgba(238, 124, 40, 1);
}
.color-7 {
background-color: rgba(214, 177, 127, 1);
}
.color-8 {
background-color: rgba(163, 202, 177, 1);
}
&:after {
content: "";
@ -539,12 +515,17 @@
margin: 210px 0 0;
width: 100%;
z-index: 1;
display: flex;
justify-content: center;
align-items: center;
& h1 {
color: white;
text-align: center;
font-size: 7em;
font-family: "Veneer";
display: inline-block;
padding: 0 0.3em;
}
}

View file

@ -4,8 +4,8 @@
}
@mixin background-opacity($color, $opacity: 0.8) {
background: $color; /* The Fallback */
background: rgba($color, $opacity);
background-color: $color; /* The Fallback */
background-color: rgba($color, $opacity);
}
/* Pattern */

View file

@ -5,31 +5,6 @@
max-width: inherit !important;
width: 100%;
.color-1 {
background-color: rgba(142,184,233,1);
}
.color-2 {
background-color: rgba(255,180,0,1);
}
.color-3 {
background-color: rgba(172,40,61,1);
}
.color-4 {
background-color: rgba(231,145,14,1);
}
.color-5 {
background-color: rgba(250,183,216,1);
}
.color-6 {
background-color: rgba(238,124,40,1);
}
.color-7 {
background-color: rgba(214, 177, 127, 1);
}
.color-8 {
background-color: rgba(163, 202, 177, 1);
}
& .img-moment {
position: absolute;
top: -20rem;

View file

@ -8,7 +8,7 @@ if($routeName != 'products.index' && $routeName != 'products.departaimants') {
}
@endphp
@extends('layouts.app', compact('brParam'))
@section('title', __('Nos produits'))
@section('title', isset($title) ? $title : __('Nos produits'))
@section('description', __('Découvrez Le Gaulois, des produits de volailles françaises. Et aussi nos recettes, nos éleveurs et le Club des Gaulois, les Départ\'aimants et des réductions.'))
@section('breadcrumb', $routeName)
@ -16,13 +16,13 @@ if($routeName != 'products.index' && $routeName != 'products.departaimants') {
@section('sub_header')
<div class="sub_header sub_header_products">
<div class="title">
<h1 class="color-11 pattern">{{ __('Nos produits') }}</h1>
<h1 class="@if(isset($gamme) and $gamme){{$gamme->color}}@else color-11 @endif pattern">{{ isset($title) ? $title : __('Nos produits') }}</h1>
</div>
@if(count($productsSlides) > 1)
<products-slider slides='@json($productsSlides)'></products-slider>
@else
<a href="{{ $productsSlides->first()->link ?? '' }}" target="{{ ($productsSlides->first()->new_tab ?? '') === 1 ? '_blank' : '_self' }}">
<img src="{{ asset($productsSlides->first()->picture ?? '') }}" alt="Image - Le Gaulois">
<img src="{{ (isset($gamme) and $gamme->picture_r) ? $gamme->picture_r : (asset($productsSlides->first()->picture ?? '')) }}" alt="Image - Le Gaulois">
</a>
@endif
</div>
@ -84,7 +84,7 @@ if($routeName != 'products.index' && $routeName != 'products.departaimants') {
</div>
@if (isset($gamme) or isset($departaimants))
<div class="list">
<h2 class="description">{{ $title }}</h2>
{{-- <h2 class="description">{{ $title }}</h2> --}}
<div class="items">
@foreach($productsList as $p)
<div class="item">