From e0fbca33e8be5f0ea37955737ab5964cfd6b0de7 Mon Sep 17 00:00:00 2001 From: Olivier Legat Date: Thu, 6 Oct 2022 12:26:13 +0200 Subject: [PATCH] variables in blades : home, product, basket, sales/crecap, partials/tunnel-actions, partials/tunnel-stepper, sales/pick-slot, sales/confirm, add to cart buttons --- .../Controllers/OrderTunnelController.php | 6 +- resources/views/front/sable/home.blade.php | 22 +- resources/views/front/sable/js/app.js | 70 ++- .../sable/js/components/BasketButtons.vue | 58 +++ .../front/sable/js/components/BasketPanel.vue | 445 +++--------------- .../sable/js/components/TimeSlotPicker.vue | 109 ++--- resources/views/front/sable/js/fo/app.js | 12 - resources/views/front/sable/js/fo/cart.js | 23 + .../front/sable/js/utilities/bootstrap.js | 1 + .../front/sable/layouts/basket.blade.php | 156 +----- .../front/sable/layouts/layout.blade.php | 17 +- .../front/sable/layouts/navbar.blade.php | 5 +- .../sable/partials/tunnel-actions.blade.php | 14 +- .../sable/partials/tunnel-stepper.blade.php | 8 +- resources/views/front/sable/product.blade.php | 206 ++++---- .../views/front/sable/sales/confirm.blade.php | 30 +- .../front/sable/sales/pick-slot.blade.php | 114 +---- .../views/front/sable/sales/recap.blade.php | 106 ++--- resources/views/front/sable/sass/app.scss | 1 + .../front/sable/sass/fo/base/_utils.scss | 1 + .../sable/sass/fo/partials/_calendar.scss | 172 +++++++ 21 files changed, 660 insertions(+), 916 deletions(-) create mode 100644 resources/views/front/sable/js/components/BasketButtons.vue create mode 100644 resources/views/front/sable/js/fo/cart.js create mode 100644 resources/views/front/sable/sass/fo/partials/_calendar.scss diff --git a/app/Http/Controllers/OrderTunnelController.php b/app/Http/Controllers/OrderTunnelController.php index 63886066..2912209e 100644 --- a/app/Http/Controllers/OrderTunnelController.php +++ b/app/Http/Controllers/OrderTunnelController.php @@ -30,7 +30,7 @@ class OrderTunnelController extends Controller */ public function recapOrder() { - $activestep = 2; + $activestep = 1; Cart::instance('panier'); $cart = Cart::content(); @@ -136,7 +136,7 @@ class OrderTunnelController extends Controller */ public function timeSlotPick(string $reference) { - $activestep = 3; + $activestep = 2; /* * Il faut diriger les salariés vers le bon magasin sans leur @@ -402,7 +402,7 @@ class OrderTunnelController extends Controller */ public function confirmOrder(string $reference) { - $activestep = 4; + $activestep = 3; $idcommande = Session::get('idcommande'); $order = Order::where('reference', '=', $reference)->firstOrFail(); diff --git a/resources/views/front/sable/home.blade.php b/resources/views/front/sable/home.blade.php index 02d7a48e..e15a78c9 100644 --- a/resources/views/front/sable/home.blade.php +++ b/resources/views/front/sable/home.blade.php @@ -20,7 +20,7 @@ -
+
@@ -33,24 +33,22 @@

bientôt disponible

- picture) }}" class="img-fluid" alt="..."> + picture) }}" class="img-fluid" alt="{{$product->name}}">
-
{{ $product->name }}
+
{{$product->name}}

{!! $product->description !!}

@if ($product->promotions->count()) - 5,99€ + @fmt_currency($product->priceTtc) @endif - 3,99€ + @fmt_currency($product->discountedPriceTtc) @fmt_sellunit($product->sell_unit)
-
- - - 1 - + -
+ @can('addToCart', $product) + + @endcan
@@ -80,7 +78,7 @@
{{ $quickorder_range->name }}

{!! $quickorder_range->description !!}

- Voir le rayon + Voir le rayon
@@ -88,7 +86,7 @@ @endforeach - voir tous les rayons + voir tous les rayons
diff --git a/resources/views/front/sable/js/app.js b/resources/views/front/sable/js/app.js index 23c800f5..6442a39b 100644 --- a/resources/views/front/sable/js/app.js +++ b/resources/views/front/sable/js/app.js @@ -1,12 +1,15 @@ import Axios from 'axios'; import Vue from 'vue'; +import Vuex from 'vuex'; import VueContentPlaceholders from 'vue-content-placeholders'; +import Toastify from "toastify-js"; import '../../../../../node_modules/@fortawesome/fontawesome-free/js/all.min.js'; import { LdcwebCn } from "./vendor/ldcweb-cookies.js"; import './utilities/bootstrap'; import './utilities/swiper'; import './utilities/simplebar'; import './fo/app'; +import './fo/cart'; // Ldcweb cookies window.LdcwebCn = LdcwebCn; @@ -14,8 +17,73 @@ window.LdcwebCn = LdcwebCn; Vue.use(VueContentPlaceholders) Vue.component('filter-component', require('./components/FilterComponent.vue').default); +Vue.use(Vuex); +Vue.component('timeslot-picker', require('./components/TimeSlotPicker.vue').default); +Vue.component('basket-panel', require('./components/BasketPanel.vue').default); +Vue.component('quick-order', require('./components/QuickOrder.vue').default); +Vue.component('basket-counter', { + computed: { + count() { + return this.$store.state.cartTotals.countItems; + } + }, + mounted: function() { + console.log('Basket Counter Component mounted.'); + }, + template: '{{ count }}' +}); +Vue.component('basket-amount', { + computed: { + amount() { + return this.currencyFormatter(this.$store.state.cartTotals.totalTTC); + } + }, + mounted: function() { + console.log('Basket Amount Component mounted.'); + }, + methods: { + currencyFormatter(num) { + if (isNaN(num)) { + return num; + } + return new Intl.NumberFormat('fr-FR', { style: 'currency', currency: 'EUR' }).format(num); + } + }, + template: '{{ amount }}' +}); +Vue.component('basket-buttons', require('./components/BasketButtons.vue').default); + +const store = new Vuex.Store({ + state: { + panier: {}, + cartTotals: {}, + }, + mutations: { + Reload (state,payload) { + state.reload = payload.reload; + }, + updatePanier (state, payload) { + state.panier = payload.panier; + }, + updateCartTotals (state, payload) { + state.cartTotals = payload.cartTotals; + }, + } +}); + window.axios = Axios; +window.Toastify = Toastify; const app = new Vue({ - el: '.vue-apps' + el: '#app', + store, + data: { + num: 1 //for the numeric stepper on product pages + }, + methods: { + addtocart(product,qtty) { + console.log('root add'); + this.$refs.basketpanel.addtocart(product,qtty); + }, + }, }); diff --git a/resources/views/front/sable/js/components/BasketButtons.vue b/resources/views/front/sable/js/components/BasketButtons.vue new file mode 100644 index 00000000..840a3aff --- /dev/null +++ b/resources/views/front/sable/js/components/BasketButtons.vue @@ -0,0 +1,58 @@ + + + + + diff --git a/resources/views/front/sable/js/components/BasketPanel.vue b/resources/views/front/sable/js/components/BasketPanel.vue index a9782563..ed83f1bf 100644 --- a/resources/views/front/sable/js/components/BasketPanel.vue +++ b/resources/views/front/sable/js/components/BasketPanel.vue @@ -1,371 +1,82 @@ @@ -450,8 +161,6 @@ export default { this.updateStore(result); toast.destination = undefined; Toastify(toast).showToast(); - window.toggleFixingBottomCart(); - window.openCart(); } ) .catch(function (error) { @@ -472,8 +181,6 @@ export default { toast.text = 'Panier mis à jour'; toast.destination = undefined; Toastify(toast).showToast(); - window.toggleFixingBottomCart(); - window.openCart(); } ) .catch(function (error) { @@ -494,7 +201,6 @@ export default { toast.text = 'Produit retiré de votre panier'; toast.destination = undefined; Toastify(toast).showToast(); - window.toggleFixingBottomCart(); } ) .catch(function (error) { @@ -540,26 +246,13 @@ export default { cartTotals: result[1] }); }, - hover(zone,row_id) { - console.log(this.promotion_slide); - eval("this."+zone+"='"+row_id+"';"); - console.log(this.promotion_slide); - }, - //general purpose TODO : globalize - numFormatter(num) { - return new Intl.NumberFormat('fr-FR', { style: 'decimal', minimumFractionDigits: 2}).format(num); - }, + //general purpose currencyFormatter(num) { if (isNaN(num)) { return num; } return new Intl.NumberFormat('fr-FR', { style: 'currency', currency: 'EUR' }).format(num); }, - dateFormatter(str) { - let d=new Date(str); - var options = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' }; - return d.toLocaleDateString("fr-FR",options); - } } } diff --git a/resources/views/front/sable/js/components/TimeSlotPicker.vue b/resources/views/front/sable/js/components/TimeSlotPicker.vue index ba47b661..ebbdd96a 100644 --- a/resources/views/front/sable/js/components/TimeSlotPicker.vue +++ b/resources/views/front/sable/js/components/TimeSlotPicker.vue @@ -1,50 +1,40 @@ @@ -176,7 +161,7 @@ export default { availableCreneaux: [], scrollCounter: 0, interval:false, - magasins: [], + magasin: {}, selectedmagasin: null, } }, @@ -185,9 +170,9 @@ export default { //this.availableCrenaux = this.dbavailablecreneaux; this.selectedDay = this.current.toLocaleDateString(); this.currentmonth = this.month; //this.months.indexOf(this.month); - this.magasins = JSON.parse(this.dbmagasin); + this.magasin = JSON.parse(this.dbmagasin); this.loadAvailableCreneaux(); - this.choosemagasin(1); + this.choosemagasin(this.magasin.id); }, methods: { nextMonth() { @@ -229,7 +214,7 @@ export default { styleCren(creneau) { return { 'dispo' : creneau.dispo, - 'selected' : creneau.selected + 'card-activate' : creneau.selected } }, prepare() { diff --git a/resources/views/front/sable/js/fo/app.js b/resources/views/front/sable/js/fo/app.js index 22f77ec7..c1bc0d8d 100644 --- a/resources/views/front/sable/js/fo/app.js +++ b/resources/views/front/sable/js/fo/app.js @@ -12,16 +12,4 @@ function filtersMenu() { filterMenu.classList.toggle("filters-hidden"); } -/* ----- BASKET ----- */ -var basket = document.getElementById("basket"); -var basketBtn = document.querySelector("#navbar .btn-navbar"); -var basketCross = document.querySelector("#basket .icon-cross"); -if (basketBtn) - basketBtn.addEventListener("click", showBasket); -if (basketCross) - basketCross.addEventListener("click", showBasket); - -function showBasket() { - basket.classList.toggle("basket-hidden"); -} \ No newline at end of file diff --git a/resources/views/front/sable/js/fo/cart.js b/resources/views/front/sable/js/fo/cart.js new file mode 100644 index 00000000..669dc5ad --- /dev/null +++ b/resources/views/front/sable/js/fo/cart.js @@ -0,0 +1,23 @@ +window.showModalClearCart = function() { +$('#empty-basket-modal > div.modal').show(); +} + +window.closeModalClearCart = function() { +$('#empty-basket-modal > div.modal').hide(); +} + +/* ----- BASKET ----- */ +document.addEventListener("DOMContentLoaded", function() { + var basket = document.getElementById("basket"); + var basketBtn = document.querySelector("#navbar .btn-navbar"); + var basketCross = document.querySelector("#basket .icon-cross"); + + if (basketBtn) + basketBtn.addEventListener("click", showBasket); + if (basketCross) + basketCross.addEventListener("click", showBasket); + + function showBasket() { + basket.classList.toggle("basket-hidden"); + } +}); diff --git a/resources/views/front/sable/js/utilities/bootstrap.js b/resources/views/front/sable/js/utilities/bootstrap.js index 91f7955b..f866271d 100644 --- a/resources/views/front/sable/js/utilities/bootstrap.js +++ b/resources/views/front/sable/js/utilities/bootstrap.js @@ -1,3 +1,4 @@ import 'bootstrap'; +window._ = require('lodash'); window.$ = window.jQuery = require('jquery'); diff --git a/resources/views/front/sable/layouts/basket.blade.php b/resources/views/front/sable/layouts/basket.blade.php index 2ae999a7..aa44ef2c 100644 --- a/resources/views/front/sable/layouts/basket.blade.php +++ b/resources/views/front/sable/layouts/basket.blade.php @@ -1,154 +1,2 @@ -
-
-
-

Aperçu du panier

- -
-
    -
  • - -
    -

    Filet de Poulet

    -

    XXX

    -

    barquette x2

    -
    -
    -

    3,99€

    -
    - - - 1 - + -
    -
    - -
  • -
  • - -
    -

    Filet de Poulet

    -

    XXX

    -

    barquette x2

    -
    -
    -

    3,99€

    -
    - - - 1 - + -
    -
    - -
  • -
  • - -
    -

    Filet de Poulet

    -

    XXX

    -

    barquette x2

    -
    -
    -

    3,99€

    -
    - - - 1 - + -
    -
    - -
  • -
  • - -
    -

    Filet de Poulet

    -

    XXX

    -

    barquette x2

    -
    -
    -

    3,99€

    -
    - - - 1 - + -
    -
    - -
  • -
  • - -
    -

    Filet de Poulet

    -

    XXX

    -

    barquette x2

    -
    -
    -

    3,99€

    -
    - - - 1 - + -
    -
    - -
  • -
  • - -
    -

    Filet de Poulet

    -

    XXX

    -

    barquette x2

    -
    -
    -

    3,99€

    -
    - - - 1 - + -
    -
    - -
  • -
  • - -
    -

    Filet de Poulet

    -

    XXX

    -

    barquette x2

    -
    -
    -

    3,99€

    -
    - - - 1 - + -
    -
    - -
  • -
  • - -
    -

    Filet de Poulet

    -

    XXX

    -

    barquette x2

    -
    -
    -

    3,99€

    -
    - - - 1 - + -
    -
    - -
  • -
-
-

Total

-

16,48€

-
-
- - -
-
-
+ + diff --git a/resources/views/front/sable/layouts/layout.blade.php b/resources/views/front/sable/layouts/layout.blade.php index f5d9c195..63a57595 100644 --- a/resources/views/front/sable/layouts/layout.blade.php +++ b/resources/views/front/sable/layouts/layout.blade.php @@ -1,17 +1,18 @@ @include('layouts.head') -@include('layouts.navbar') - - @include('layouts.basket') +
+ @include('layouts.navbar') - @yield('content') + @include('layouts.basket') - @include('layouts.footer') + @yield('content') - - @yield('scripts') + @include('layouts.footer') +
+ + @yield('scripts') - @include('partials.cookie') + @include('partials.cookie') diff --git a/resources/views/front/sable/layouts/navbar.blade.php b/resources/views/front/sable/layouts/navbar.blade.php index ca56345b..a91487b6 100644 --- a/resources/views/front/sable/layouts/navbar.blade.php +++ b/resources/views/front/sable/layouts/navbar.blade.php @@ -31,13 +31,12 @@
- diff --git a/resources/views/front/sable/partials/tunnel-actions.blade.php b/resources/views/front/sable/partials/tunnel-actions.blade.php index acfceba6..755f82e6 100644 --- a/resources/views/front/sable/partials/tunnel-actions.blade.php +++ b/resources/views/front/sable/partials/tunnel-actions.blade.php @@ -1,18 +1,18 @@ -
+
@if ( $activestep < 3 ) - Continuer mes achats + ⟵ Continuer mes achats @else - + @endif - @if ( $activestep == 2 ) + @if ( $activestep == 1 )
@csrf - +
- @elseif ( $activestep == 3 ) + @elseif ( $activestep == 2 )
@csrf - +
@endif
diff --git a/resources/views/front/sable/partials/tunnel-stepper.blade.php b/resources/views/front/sable/partials/tunnel-stepper.blade.php index e9298f22..0d666595 100644 --- a/resources/views/front/sable/partials/tunnel-stepper.blade.php +++ b/resources/views/front/sable/partials/tunnel-stepper.blade.php @@ -3,24 +3,24 @@
-
+
1 ? "step-done" : "") }}">
1-

Récapitulatif

-
+
2 ? "step-done" : "") }}">
2-

Réservation

-
+
3 ? "step-done" : "") }}">
3-

Confirmation

- 1/3 + {{ $activestep }}/3
diff --git a/resources/views/front/sable/product.blade.php b/resources/views/front/sable/product.blade.php index 2753965f..291ef34d 100644 --- a/resources/views/front/sable/product.blade.php +++ b/resources/views/front/sable/product.blade.php @@ -9,119 +9,150 @@
- + @if (isset($product->picture_large)) + + @elseif(isset($product->picture)) + + @else + + @endif
-

Filet de poulet X2

-

Lorem ipsum dolor sit amet consectetur adipisicing elit. Sint esse molestias omnis et, doloremque laborum!

-

Conseil de préparation :

-

Lorem ipsum dolor sit amet consectetur adipisicing elit. Optio tenetur nisi suscipit ?

+

{{ $product->name }}

+

{!! $product->description !!}

+ @if (!empty($product->foodProduct->preparation)) +

Conseil de préparation :

+

{!! $product->foodProduct->preparation ?? '' !!}

+ @endif
-

Poids moyen du produit : XX

-

Produit poids variable : XX

+

Poids moyen du produit : {{ $product->weight }} {{ $product->weight_unit }}

+

Produit poids variable : ??

- - - + + +
- 5,99€ - 3,99€ -
-
- - - 1 - + + @if ($product->promotions->count()) + @fmt_currency($product->priceTtc) @fmt_sellunit($product->sell_unit) + @endif + @fmt_currency($product->discountedPriceTtc) @fmt_sellunit($product->sell_unit)
+ @can('addToCart', $product) + + @endcan
-
- +
+

{!! $product->foodProduct->ingredients ?? '' !!}

+ @if (!empty($product->foodProduct->allergens)) +

{!! $product->foodProduct->allergens !!}

+ @endif
-
- -
- -
-

Du saucisson, de la matière grasse hmmm.

-
-
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Pour 2g
Énergie2g
2g
Matières Grasses
dont Acides Gras Saturés
2g
2g
Glucides
dont sucres
2g
2g
Fibres alimentaires2g
Protéines2g
Sel1g
-

*Apports Quotidien de référence pour un adulte (8400kj/2000kcal).

+ @endif + @if (!empty($product->foodProduct->allergens)) +
+
+ Allergenes + +
+
+
+ {!! $product->foodProduct->allergens !!}
+ @endif + @if (!empty($product->foodProduct->nv_kj )) +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Pour {{ $product->foodProduct->nv_ref_weight_g }}g
Énergie + {{ $product->foodProduct->nv_kj }} Kj
+ {{ $product->foodProduct->nv_kcal }} Kcal
Matières Grasses
dont Acides Gras Saturés
{{ $product->foodProduct->nv_fat_g }} g
{{ $product->foodProduct->nv_sat_fat_g }} g
Glucides
dont sucres
{{ $product->foodProduct->nv_carb_g }} g
{{ $product->foodProduct->nv_sugar_g }} g
Fibres alimentaires{{ $product->foodProduct->nv_fiber_g }} g
Protéines{{ $product->foodProduct->nv_protein_g }} g
Sel{{ $product->foodProduct->nv_salt_g }} g
+

*Apports Quotidien de référence pour un adulte (8400kj/2000kcal).

+
+
+
+ @endif + {{-- aucune fonctionnalité de recettes associées
@@ -131,6 +162,13 @@
+ --}} + {{-- + en revanche il existe une fonctionnalité de produits associés + @if ($product->products->count()) + @include('partials.products-related') + @endif + --}}
diff --git a/resources/views/front/sable/sales/confirm.blade.php b/resources/views/front/sable/sales/confirm.blade.php index 51430fa0..d66ad772 100644 --- a/resources/views/front/sable/sales/confirm.blade.php +++ b/resources/views/front/sable/sales/confirm.blade.php @@ -14,36 +14,34 @@

Confirmation

Votre commande est enregistrée !

Merci pour cette commande !

-

Une confirmation vient de vous être envoyée sur l'adresse mail xxxx.xxxx@xxxx.xx.

+

Une confirmation vient de vous être envoyée sur l'adresse mail {{ $order->customer->email }}

- + - - - - - - - - + @foreach ($order->lines as $line) + + + + + @endforeach - +
Rrappel de votre commande ref: xxxxxxxxxx :Rappel de votre commande ref: {{ $order->reference }} :
1 x Poulet blanc fermier Le Gaulois x2 - 300g :15,25€
1 x Cuisse de poulet Le Gaulois x2 - 300g :15,25€
{{ $line->quantity }} x {{ $line->product->name }} :{{ $line->formattedTotalTtc }}
Total estimé : 30,50€Total estimé : {{ $order->formattedTotalTtc }}
-

À retirer le 11/06/2022 à 09:15, à l'adresse suivante :

-

LDC Sablé

-

Siège Social de Sablé

-

72800 Sable sur Sarthe

+

À retirer le {{ $order->timeslot->day }} à {{ $order->timeslot->time }}, à l'adresse suivante :

+

{{ $magasin->name }}

+

{{ $magasin->address }}

+

{{ $magasin->postcode }} {{ $magasin->city }}

diff --git a/resources/views/front/sable/sales/pick-slot.blade.php b/resources/views/front/sable/sales/pick-slot.blade.php index 27e41773..66d599d2 100644 --- a/resources/views/front/sable/sales/pick-slot.blade.php +++ b/resources/views/front/sable/sales/pick-slot.blade.php @@ -10,109 +10,31 @@
@include('partials.tunnel-stepper') -
-

Choisissez où et quand retirer votre commande

-

- 1. - Votre point de retrait -

-
-
-
-
-
- ... -
-
-
-
LDC Cavol
-

Les épinettes

-

72540 Loué

-

02.43.88.26.88

-
-
+ + @csrf + @if ($errors->any()) +
+ @foreach ($errors->all() as $error) +
{{ $error }}
+ @endforeach
+ @elseif (session('success')) +
+ {{ session('success') }}
-
-
-
-
-
- ... -
-
-
-
LDC Sablé
-

Siège Social de Sablé

-

72800 Sable sur Sarthe

-
-
-
-
-
-
-
-
-
- ... -
-
-
-
LDC Cavol
-

Les épinettes

-

72540 Loué

-

02.43.88.26.88

-
-
-
-
-
-
- -

- 2. - Choisissez le jour du retrait de votre commande -

- - -

- 3. - Choisissez l'heure du retrait de votre commande -

-
-
-
-
-
-
-
11h00 - 11h30
-
-
-
-
-
-
-
-
-
-
-
12h15 - 14h00
-
-
-
-
-
-
- + @endif + +
-
- +
diff --git a/resources/views/front/sable/sales/recap.blade.php b/resources/views/front/sable/sales/recap.blade.php index 00408e7a..ea36fa2a 100644 --- a/resources/views/front/sable/sales/recap.blade.php +++ b/resources/views/front/sable/sales/recap.blade.php @@ -21,23 +21,40 @@ + @foreach ($cart as $cartItem)
-
Saucisseries
-

En boucherie ou pas ?

+ +
+ {{ $cartItem->name }} +
+
+

{!! $cartItem->model->description !!}

- 5,99€ - 3,99€ + @if ($cartItem->model->promotions->count()) + @fmt_currency($cartItem->model->priceTtc) + @endif + @fmt_currency($cartItem->model->discountedPriceTtc)
@@ -46,77 +63,14 @@
- 1 - 3.99€ - 3.99€ - - - - - - - -
-
-

bientôt disponible

- ... -
-
-
-
Saucisseries
-

En boucherie ou pas ?

-
-
-
- 5,99€ - 3,99€ -
- -
-
-
-
- - - 1 - 3.99€ - 3.99€ - - - - - - - -
-
-

bientôt disponible

- ... -
-
-
-
Saucisseries
-

En boucherie ou pas ?

-
-
-
- 5,99€ - 3,99€ -
- -
-
-
-
- - - 1 - 3.99€ - 3.99€ + {{ $cartItem->qty }} + @fmt_currency($cartItem->model->discountedPriceTtc) + {{ sprintf('%s €', number_format($cartItem->model->discountedPriceTtc * $cartItem->qty, 2, ',', ' ')) }} + @endforeach @@ -124,15 +78,11 @@ - +
Total estimé TTC16.48€{{ sprintf('%s €', number_format($cartInfos['totalTTC'], 2, ',', ' ')) }}
- -
- - -
+ @include('partials.tunnel-actions')
diff --git a/resources/views/front/sable/sass/app.scss b/resources/views/front/sable/sass/app.scss index 54c1f10c..58c44176 100644 --- a/resources/views/front/sable/sass/app.scss +++ b/resources/views/front/sable/sass/app.scss @@ -19,6 +19,7 @@ @import './fo/partials/navbar'; @import './fo/partials/footer'; @import './fo/partials/basket'; +@import './fo/partials/calendar'; // PAGES @import './fo/pages/home'; diff --git a/resources/views/front/sable/sass/fo/base/_utils.scss b/resources/views/front/sable/sass/fo/base/_utils.scss index f881d8d2..b0f8d46d 100644 --- a/resources/views/front/sable/sass/fo/base/_utils.scss +++ b/resources/views/front/sable/sass/fo/base/_utils.scss @@ -87,6 +87,7 @@ .btn-basket { width: 4rem; height: 2.5rem; + z-index: 50; } // Icons. diff --git a/resources/views/front/sable/sass/fo/partials/_calendar.scss b/resources/views/front/sable/sass/fo/partials/_calendar.scss new file mode 100644 index 00000000..ebccbf8b --- /dev/null +++ b/resources/views/front/sable/sass/fo/partials/_calendar.scss @@ -0,0 +1,172 @@ +//couleurs +$main-bg: $white; +$calendar-bg: $light-grey; +$light-text: $white; +$dark-section-bg: $light-grey; + +//timeslot picker + +.timeslot-container { + margin: 1em 0; +} + +.timeslot-container + .cgv { + flex-direction: row-reverse; +} + +.calendar { + background-color: $main-bg; + h2 { + text-align: center; + font-weight: 500; + background-color: $main-bg; + line-height: 40px; + span { + color: #fff; + background-color: $primary; + vertical-align: middle; + text-align: center; + border-radius: 15px; + line-height: 0; + width:30px; + display: inline-block; + margin: 0 1em; + cursor: pointer; + &:hover { + background-color: $secondary; + } + } + } + .content { + .current>span { + border-radius: 20px; + width: 40px; + margin: auto; + display: inline-block; + background-color: #ccc; + } + .grey { + background-color: #ebebeb; + } + .selected>span { + border-radius: 20px; + width: 40px; + margin: auto; + color: $light-text; + background-color: $secondary; + display: inline-block; + } + .last, .next { + color: #999; + } + .unavailable{ + color: #999; + color: rgba(153,153,153,0.6); + cursor: initial; + } + } +} + + .calendar .content, + .calendar header { + background-color: $calendar-bg; + } + + .calendar .content, + .calendar header { + display: flex; + flex-wrap: wrap; + } + + .calendar .content>div, + .calendar header>div, + .creneaux__list div { + box-sizing: border-box; + line-height: 40px; + height: 40px; + width: 14.28571427%; + text-align: center; + } + + .calendar .content>div, + .calendar header>div, + .creneaux__list div.dispo { + cursor: pointer; + } + + .creneaux { + background-color: $dark-section-bg; + header { + font-weight: 500; + text-align: center; + line-height: 40px; + background-color: $light-grey; + } + + } + + .creneaux__list { + background-color: $white; + height: 240px; + position: relative; + .creneaux__slots { + scroll-behavior: smooth; + height: 240px; + overflow-y: hidden; + position: inherit; + top: initial; + &.hasDown { + height: 200px; + top: initial; + } + &.hasUp.hasDown { + height: 160px; + top: 40px; + } + &.hasUp { + height: 200px; + top: 40px; + } + } + div { + color: #999; + background-color: $dark-section-bg; + width:90%; + margin: 0.5em auto; + border-radius: 24px; + &.scroll-up, &.scroll-down{ + display:none; + color: #fff; + background-color: $grey; + border-radius: 15px; + width:30px; + height: 30px; + position: absolute; + bottom: 0; + left: 0; + right: 0; + z-index: 1; + margin: 5px auto; + &:hover { + background-color: $secondary; + } + &.active { + display:block; + } + } + &.scroll-up{ + top: 0; + } + &.dispo { + color : initial; + &:hover { + color: #fff; + background-color: $primary; + } + } + &.selected { + color: #fff; + background-color: $secondary; + } + } + }