{% extends 'base.html.twig' %}
{% block title %}Accueil{% endblock %}
{% block body %}
{# offre du jour #}
{# <div class="d-flex justify-content-center offre-title mt-3">
<span>
Offre <span style="color: #BEB623;">du jour</span>
</span>
</div> #}
{# SECTION OFFRE DU JOUR #}
{# <section class="first-section mb-3" id="slideshow-section" style="background-image: url({{ asset('uploads/slide/slide1.jpg')}}); background-size: cover; background-repeat: no-repeat; background-position: top; position: relative; min-height: 50vh;
width: 100%;">
{# conteneur fluid }
<div class="container-fluid d-none">
{# two card }
<div class="row p-5" style="padding-top:200px !important;">
{% if productsDay|length == 6 %}
<div class="col-md-6">
<div class="p-5 text-center deal-jour" style="background-color: white;">
<span class="span">Produits <span style="color: #BEB623;">du jour</span></span>
<div class="d-flex justify-content-center mt-3">
<div class="col-md-6 px-2 p-1 time-end">
Finit dans <span id="clock">{{ "now"|date("H:i:s") }}</span>
</div>
</div>
<div class="row mt-4 product-list">
{% for item in productsDayLeft %}
<div class="col-md-4 mb-2">
<img src="{{ asset('uploads/products/' ~ item.imageName)}}" alt=""
title="{{ item.description }}" class="img-fluid">
<p class="mt-2">
{{ (item.description|slice(0, 10)|raw)|nl2br }}...
</p>
<p><span>{{ item.priceDealer }}<s class="ms-1">{{ item.priceCust }}</s></span></p>
</div>
{% endfor %}
</div>
</div>
</div>
<div class="col-md-6">
<div class="p-5 text-center big-save" style="background-color: white;">
<span>Produits <span style="color: #BEB623;">du jour</span></span>
<div class="d-flex justify-content-center mt-3">
<div class="col-md-6 px-2 p-1 plus-marque">
+ plus de 500 marques
</div>
</div>
<div class="row mt-4 product-list">
{% for item in productsDayRight %}
<div class="col-md-4 mb-2">
<img src="{{ asset('uploads/products/' ~ item.imageName)}}" alt=""
title="{{ item.description }}" class="img-fluid">
<p class="mt-2">
{{ (item.description|slice(0, 10)|raw)|nl2br }}...
</p>
<p><span>{{ item.priceDealer }}<s class="ms-1">{{ item.priceCust }}</s></span></p>
</div>
{% endfor %}
</div>
</div>
</div>
{% else %}
<div class="col-md-12">
<div class="p-5 text-center offre-jour">
<span class="span">Produits du jour</span>
<div class="row mt-4 product-list">
{% for item in productsDayAll %}
<div class="col mb-2">
<img src="{{ asset('uploads/products/' ~ item.imageName)}}" alt=""
title="{{ item.description }}" class="img-fluid">
<p class="mt-2">
{{ (item.description|slice(0, 10)|raw)|nl2br }}...
</p>
<p><span>{{ item.priceDealer }}<s class="ms-1">{{ item.priceCust }}</s></span></p>
</div>
{% endfor %}
</div>
</div>
</div>
{% endif %}
</div>
</div>
{# produit du jour responsive }
<div class="container-fluid p-5 productDay-responsive" style="padding-top:200px !important;">
<div class="card p-3" style="color: #3B4C4E !important;">
<div class="mb-3 achat-title">
<span>
Produit <span style="color: #BEB623;">du jour</span>
</span>
</div>
{# les produits }
<div class="d-flex" style="overflow-x: auto;">
{% for item in productsDayAll %}
<div class="col">
<img src="{{ asset('uploads/products/' ~ item.imageName)}}" alt="" title="{{ item.description }}"
class="img-fluid">
<p class="mt-2">
{{ (item.description|slice(0, 10)|raw)|nl2br }}...
</p>
<p><span>{{ item.priceDealer }}<s class="ms-1">{{ item.priceCust }}</s></span></p>
</div>
{% endfor %}
</div>
</div>
</div>
<!-- Flèche gauche -->
<div id="prev" class="arrow left-arrow">❮</div>
<!-- Flèche droite -->
<div id="next" class="arrow right-arrow">❯</div>
</section> #}
{# SECTION SLIDE IMAGES #}
<div class="image-slider" style="position: relative;">
<img src="{{ asset('uploads/slide/slide1.jpg')}}" class="img-fluid slider-image" alt="" id="sliderImage">
<div class="pt-5 container-fluid align-items-center d-flex productDay-lg"
style="position: absolute; height:100% !important; top:0px;">
{# two card #}
<div class="row">
{% if productsDay|length == 6 %}
<div class="col-6 mt-5">
<div class="p-3 text-center deal-jour" style="background-color: rgba(255,255,255,0.8);">
<span class="span">Produits <span style="color: #BEB623;">du jour</span></span>
<div class="d-flex justify-content-center mt-3">
<div class="col-md-6 px-2 p-1 time-end">
Finit dans <span id="clock">{{ "now"|date("H:i:s") }}</span>
</div>
</div>
<div class="row mt-4 product-list">
{% for item in productsDayLeft %}
<div class="col-md-4 mb-2">
<img src="{{ asset('uploads/products/' ~ item.imageName)}}" alt=""
title="{{ item.description }}" class="img-fluid">
<p class="mt-2">
{{ (item.description|slice(0, 10)|raw)|nl2br }}...
</p>
<p><span>{{ item.priceDealer|number_format('2',',',' ') }} MGA</span></p>
</div>
{% endfor %}
</div>
</div>
</div>
<div class="col-6 mt-5">
<div class="p-3 text-center big-save" style="background-color: rgba(255,255,255,0.8);">
<span>Produits <span style="color: #BEB623;">du jour</span></span>
<div class="d-flex justify-content-center mt-3">
<div class="col-md-6 px-2 p-1 plus-marque">
+ plus de 500 marques
</div>
</div>
<div class="row mt-4 product-list">
{% for item in productsDayRight %}
<div class="col-md-4 mb-2">
<img src="{{ asset('uploads/products/' ~ item.imageName)}}" alt=""
title="{{ item.description }}" class="img-fluid">
<p class="mt-2">
{{ (item.description|slice(0, 10)|raw)|nl2br }}...
</p>
<p><span>{{ item.priceDealer|number_format('2',',',' ') }} MGA</s></span></p>
</div>
{% endfor %}
</div>
</div>
</div>
{% else %}
<div class="col-md-12">
<div class="p-5 text-center offre-jour">
<span class="span">Produits du jour</span>
<div class="row mt-4 product-list">
{% for item in productsDayAll %}
<div class="col mb-2">
<img src="{{ asset('uploads/products/' ~ item.imageName)}}" alt=""
title="{{ item.description }}" class="img-fluid">
<p class="mt-2">
{{ (item.description|slice(0, 10)|raw)|nl2br }}...
</p>
<p><span>{{ item.priceDealer|number_format('2',',',' ') }} MGA</span></p>
</div>
{% endfor %}
</div>
</div>
</div>
{% endif %}
</div>
</div>
{# PRODUIT DU JOUR RESPONSIVE #}
<div class=" pb-5 pt-5 container-fluid d-none" style="position: absolute; height:100% !important; top:0px;">
<div class="d-flex justify-content-center achat-title mt-3">
<span>
Produits <span style="color: #BEB623;">du jour</span>
</span>
</div>
<div class="swiper mySwiper mt-3">
<div class="swiper-wrapper">
{% for item in productsDayAll %}
<div class="swiper-slide">
<img src="{{ asset('uploads/products/' ~ item.imageName)}}" alt="{{ item.description }}"
class="img-fluid rounded w-100">
</div>
{% endfor %}
</div>
<!-- Flèches -->
<div class="swiper-button-next"></div>
<div class="swiper-button-prev"></div>
</div>
{# <div class="d-flex mt-3 gap-3" style="overflow-x: auto; white-space: nowrap;">
{% for item in productsDayAll %}
<div class="flex-shrink-0" style="min-width: 200px;">
<div class="p-2" style="background-color: white;">
<img src="{{ asset('uploads/products/' ~ item.imageName)}}" alt="" title="{{ item.description }}"
class="img-fluid rounded" width="200" height="200">
</div>
</div>
{% endfor %}
</div> #}
{# <div class="slider-container mt-3">
{% for item in productsDayAll %}
<div style="min-width: 200px; flex-shrink: 0; scroll-snap-align: start;">
<div class="p-2" style="background-color: white;">
<img src="{{ asset('uploads/products/' ~ item.imageName)}}" alt="" title="{{ item.description }}"
class="img-fluid rounded w-100">
</div>
</div>
{% endfor %}
</div> #}
{#<div class="d-flex mt-3" style="overflow-x: auto;">
{% for item in productsDayAll %}
<div class="col-md-3">
<div class="p-3" style="background-color: white; border-radius:20px;">
<img src="{{ asset('uploads/products/' ~ item.imageName)}}" alt="" title="{{ item.description }}"
class="img-fluid" width="200" height="200">
<p class="mt-2">
{{ (item.description|slice(0, 10)|raw)|nl2br }}...
</p>
<p><span>{{ item.priceDealer }}</p>
</div>
</div>
{% endfor %}
</div>#}
</div>
</div>
<div class="container-fluid">
{# SWIPER SLIDER #}
{# PRODUIT DU JOUR RESPONSIVE #}
<div class="productDay-md d-none">
<div class="d-flex justify-content-center achat-title mt-3">
<span class="text-center">
Produits <span style="color: #BEB623;">du jour</span>
</span>
</div>
<div class="">
<div class="swiper mySwiper mt-3">
<div class="swiper-wrapper">
{% for item in productsDayAll %}
<div class="swiper-slide">
<img src="{{ asset('uploads/products/' ~ item.imageName)}}" alt="{{ item.description }}"
class="uniform-img">
</div>
{% endfor %}
</div>
<!-- Flèches -->
{# <div class="swiper-button-next"></div>
<div class="swiper-button-prev"></div> #}
</div>
</div>
</div>
{# SECTION ACHETER PAR CATEGORIE #}
<section class="second-section mb-3">
{# achat par categorie #}
<div class="d-flex justify-content-center achat-title">
<span class="text-center">
Acheter <span style="color: #BEB623;">par catégorie</span>
</span>
</div>
{# two card #}
<div class="row mt-3 mb-3 card-achat">
<div class="col-md-6">
<div class="p-4 card-achat-one" style="background-color: #badfc2;">
{# viva et image femme #}
{# <div class="d-flex ">
<div class="col-md-8">
<h1><i>Viva</i></h1>
<span>Votre sélection de mode</span>
<div class="btn-profitez mt-2">
<div class="p-2 col-md-10">
<b>Profitez-en maintenant</b>
</div>
</div>
</div>
<div class="col-md-4">
<div class="img-femme">
<img src="{{ asset('img/femme.png')}}" alt="" class="img-fluid">
</div>
</div>
</div> #}
<div class="row mb-4">
<h1><i>Sélection de mode</i></h1>
{# <span>Votre sélection de mode</span> #}
<div class="btn-profitez mt-2">
<div class="p-2 col-md-10">
<b>Profitez-en maintenant</b>
</div>
</div>
</div>
{# produits femme #}
<div class="row viva-product align-items-center justify-content-center">
{% for item in priceMode %}
<div class="col mb-2">
<div class="p-2">
<img src="{{ asset('uploads/products/' ~ item.productImage)}}" alt=""
class="img-fluid ">
<span>{{ item.prix|number_format(0, ',', ' ') }} MGA</span>
<p style="white-space:nowrap;">{{ item.productTitle|slice(0, 16) ~
(item.productTitle|length > 16 ? '...' : '') }}</p>
</div>
</div>
{% endfor %}
{# <div class="col-md-4 mx-3 p-2">
<img src="{{ asset('img/viva-2.png')}}" alt="" class="img-fluid">
<span>US $13.94</span><s>US $35.75</s>
</div>
<div class="col-md-4 p-2">
<img src="{{ asset('img/viva-3.png')}}" alt="" class="img-fluid">
<span>US $13.94</span><s>US $35.75</s>
</div> #}
</div>
</div>
</div>
<div class="col-md-6">
<div class="row cat-produit" style="position: relative;">
{# liste des catégories #}
{% for item in catTable %}
<div class="col-md-6 mb-3 produit-item" style="display: none;">
<a onclick="window.location='{{ path('app_cat_search', {'query': item.title }) }}'"
style="cursor:pointer;">
<img src="{{ asset('uploads/categories/' ~ item.image )}}" alt="" class="img-fluid"
style="height: 100% !important;">
<span
style="color: rgb(255, 255, 255); font-weight: 700; background-color: rgba(0, 0, 0, 0.6); display: inline-block; white-space: nowrap; padding: 5px 10px;">
{{ item.title }}
</span>
</a>
</div>
{% endfor %}
{# boutton de navigation pour les catégories #}
<div class="d-flex justify-content-between align-items-center btn-cat-nav">
<button id="prevBtn" class="btn" disabled style="background-color: #4597A4;">
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="white"
class="bi bi-chevron-left" viewBox="0 0 16 16">
<path fill-rule="evenodd"
d="M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0" />
</svg>
</button>
<button id="nextBtn" class="btn" style="background-color: #4597A4;">
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="white"
class="bi bi-chevron-right" viewBox="0 0 16 16">
<path fill-rule="evenodd"
d="M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708" />
</svg>
</button>
</div>
</div>
</div>
</div>
<div class="cat-md d-none">
<div class="swiper mySwiper mt-3">
<div class="swiper-wrapper">
{% for item in catTable %}
<div class="swiper-slide">
<a href="" style="cursor:pointer;">
<img src="{{ asset('uploads/categories/' ~ item.image )}}" alt="" class="uniform-img">
<span
style="color: rgb(255, 255, 255); font-weight: 700; background-color: rgba(0, 0, 0, 0.6); display: inline-block; white-space: nowrap; padding: 5px 10px;">
{{ item.title }}
</span>
</a>
</div>
{% endfor %}
</div>
<!-- Flèches -->
{# <div class="swiper-button-next"></div>
<div class="swiper-button-prev"></div> #}
</div>
</div>
</section>
<section class="produitDeMarque">
<div class="d-flex justify-content-center other-title mb-3">
<span class="text-center">
Produits <span style="color: #BEB623;">de marque</span>
</span>
</div>
<hr>
<h5>Chaussures de marque.</h5>
<hr>
<div class="row">
{% for product in chaussures %}
<div class="col-md-2 p-2 other-product mb-2"
onclick="window.location='{{ path('app_fiche_produit', {'id': product.num_iid})}}'">
<img src="{{product.pic_url}}" alt="" title="{{ product.title }}" class="img-fluid mb-3">
<span style="font-size: 18px; font-weight:700;">{{product.price|number_format('2', ',', ' ')}} <span
style="font-size: 13px;">MGA</span></span>
<p>
{{ (product.title|slice(0,30)|raw)|nl2br }}...
</p>
<div class="d-flex flex-column justify-content-center align-items-center overlay">
<div class="col-md-12 mb-2">
<div class="article-simi p-2 px-4">
<span style="font-size: 15px;">Fiche produit</span>
</div>
</div>
</div>
<div class="overlay-panier">
<a href="{{ path('app_fiche_produit', {'id': product.num_iid})}}"
style="text-decoration: none; color:white;">
<i class="bi bi-cart fs-2"></i>
</a>
</div>
</div>
{% endfor %}
</div>
<hr>
<h5>Montres de marque.</h5>
<hr>
<div class="row">
{% for product in montres %}
<div class="col-md-2 p-2 other-product mb-2"
onclick="window.location='{{ path('app_fiche_produit', {'id': product.num_iid})}}'">
<img src="{{product.pic_url}}" alt="" title="{{ product.title }}" class="img-fluid mb-3">
<span style="font-size: 18px; font-weight:700;">{{product.price|number_format('2', ',', ' ')}} <span
style="font-size: 13px;">MGA</span></span>
<p>
{{ (product.title|slice(0,30)|raw)|nl2br }}...
</p>
<div class="d-flex flex-column justify-content-center align-items-center overlay">
<div class="col-md-12 mb-2">
<div class="article-simi p-2 px-4">
<span style="font-size: 15px;">Fiche produit</span>
</div>
</div>
</div>
<div class="overlay-panier">
<a href="{{ path('app_fiche_produit', {'id': product.num_iid})}}"
style="text-decoration: none; color:white;">
<i class="bi bi-cart fs-2"></i>
</a>
</div>
</div>
{% endfor %}
</div>
<hr>
<h5>Pour femme</h5>
<hr>
<div class="row">
{% for product in femmes %}
<div class="col-md-2 p-2 other-product mb-2"
onclick="window.location='{{ path('app_fiche_produit', {'id': product.num_iid})}}'">
<img src="{{product.pic_url}}" alt="" title="{{ product.title }}" class="img-fluid mb-3">
<span style="font-size: 18px; font-weight:700;">{{product.price|number_format('2', ',', ' ')}} <span
style="font-size: 13px;">MGA</span></span>
<p>
{{ (product.title|slice(0,30)|raw)|nl2br }}...
</p>
<div class="d-flex flex-column justify-content-center align-items-center overlay">
<div class="col-md-12 mb-2">
<div class="article-simi p-2 px-4">
<span style="font-size: 15px;">Fiche produit</span>
</div>
</div>
</div>
<div class="overlay-panier">
<a href="{{ path('app_fiche_produit', {'id': product.num_iid})}}"
style="text-decoration: none; color:white;">
<i class="bi bi-cart fs-2"></i>
</a>
</div>
</div>
{% endfor %}
</div>
<hr>
<h5>Timberland</h5>
<hr>
<div class="row">
{% for product in timberlands %}
<div class="col-md-2 p-2 other-product mb-2"
onclick="window.location='{{ path('app_fiche_produit', {'id': product.num_iid})}}'">
<img src="{{product.pic_url}}" alt="" title="{{ product.title }}" class="img-fluid mb-3">
<span style="font-size: 18px; font-weight:700;">{{product.price|number_format('2', ',', ' ')}} <span
style="font-size: 13px;">MGA</span></span>
<p>
{{ (product.title|slice(0,30)|raw)|nl2br }}...
</p>
<div class="d-flex flex-column justify-content-center align-items-center overlay">
<div class="col-md-12 mb-2">
<div class="article-simi p-2 px-4">
<span style="font-size: 15px;">Fiche produit</span>
</div>
</div>
</div>
<div class="overlay-panier">
<a href="{{ path('app_fiche_produit', {'id': product.num_iid})}}"
style="text-decoration: none; color:white;">
<i class="bi bi-cart fs-2"></i>
</a>
</div>
</div>
{% endfor %}
</div>
<hr>
<h5>Air Jord</h5>
<hr>
<div class="row">
{% for product in airs %}
<div class="col-md-2 p-2 other-product mb-2"
onclick="window.location='{{ path('app_fiche_produit', {'id': product.num_iid})}}'">
<img src="{{product.pic_url}}" alt="" title="{{ product.title }}" class="img-fluid mb-3">
<span style="font-size: 18px; font-weight:700;">{{product.price|number_format('2', ',', ' ')}} <span
style="font-size: 13px;">MGA</span></span>
<p>
{{ (product.title|slice(0,30)|raw)|nl2br }}...
</p>
<div class="d-flex flex-column justify-content-center align-items-center overlay">
<div class="col-md-12 mb-2">
<div class="article-simi p-2 px-4">
<span style="font-size: 15px;">Fiche produit</span>
</div>
</div>
</div>
<div class="overlay-panier">
<a href="{{ path('app_fiche_produit', {'id': product.num_iid})}}"
style="text-decoration: none; color:white;">
<i class="bi bi-cart fs-2"></i>
</a>
</div>
</div>
{% endfor %}
</div>
<hr>
<h5>Gucci</h5>
<hr>
<div class="row">
{% for product in guccis %}
<div class="col-md-2 p-2 other-product mb-2"
onclick="window.location='{{ path('app_fiche_produit', {'id': product.num_iid})}}'">
<img src="{{product.pic_url}}" alt="" title="{{ product.title }}" class="img-fluid mb-3">
<span style="font-size: 18px; font-weight:700;">{{product.price|number_format('2', ',', ' ')}} <span
style="font-size: 13px;">MGA</span></span>
<p>
{{ (product.title|slice(0,30)|raw)|nl2br }}...
</p>
<div class="d-flex flex-column justify-content-center align-items-center overlay">
<div class="col-md-12 mb-2">
<div class="article-simi p-2 px-4">
<span style="font-size: 15px;">Fiche produit</span>
</div>
</div>
</div>
<div class="overlay-panier">
<a href="{{ path('app_fiche_produit', {'id': product.num_iid})}}"
style="text-decoration: none; color:white;">
<i class="bi bi-cart fs-2"></i>
</a>
</div>
</div>
{% endfor %}
</div>
<hr>
<h5>Alo</h5>
<hr>
<div class="row">
{% for product in alos %}
<div class="col-md-2 p-2 other-product mb-2"
onclick="window.location='{{ path('app_fiche_produit', {'id': product.num_iid})}}'">
<img src="{{product.pic_url}}" alt="" title="{{ product.title }}" class="img-fluid mb-3">
<span style="font-size: 18px; font-weight:700;">{{product.price|number_format('2', ',', ' ')}} <span
style="font-size: 13px;">MGA</span></span>
<p>
{{ (product.title|slice(0,30)|raw)|nl2br }}...
</p>
<div class="d-flex flex-column justify-content-center align-items-center overlay">
<div class="col-md-12 mb-2">
<div class="article-simi p-2 px-4">
<span style="font-size: 15px;">Fiche produit</span>
</div>
</div>
</div>
<div class="overlay-panier">
<a href="{{ path('app_fiche_produit', {'id': product.num_iid})}}"
style="text-decoration: none; color:white;">
<i class="bi bi-cart fs-2"></i>
</a>
</div>
</div>
{% endfor %}
</div>
<hr>
<h5>Louis Vuitton</h5>
<hr>
<div class="row">
{% for product in louis %}
<div class="col-md-2 p-2 other-product mb-2"
onclick="window.location='{{ path('app_fiche_produit', {'id': product.num_iid})}}'">
<img src="{{product.pic_url}}" alt="" title="{{ product.title }}" class="img-fluid mb-3">
<span style="font-size: 18px; font-weight:700;">{{product.price|number_format('2', ',', ' ')}} <span
style="font-size: 13px;">MGA</span></span>
<p>
{{ (product.title|slice(0,30)|raw)|nl2br }}...
</p>
<div class="d-flex flex-column justify-content-center align-items-center overlay">
<div class="col-md-12 mb-2">
<div class="article-simi p-2 px-4">
<span style="font-size: 15px;">Fiche produit</span>
</div>
</div>
</div>
<div class="overlay-panier">
<a href="{{ path('app_fiche_produit', {'id': product.num_iid})}}"
style="text-decoration: none; color:white;">
<i class="bi bi-cart fs-2"></i>
</a>
</div>
</div>
{% endfor %}
</div>
<hr>
<h5>Christian Dior</h5>
<hr>
<div class="row">
{% for product in diors %}
<div class="col-md-2 p-2 other-product mb-2"
onclick="window.location='{{ path('app_fiche_produit', {'id': product.num_iid})}}'">
<img src="{{product.pic_url}}" alt="" title="{{ product.title }}" class="img-fluid mb-3">
<span style="font-size: 18px; font-weight:700;">{{product.price|number_format('2', ',', ' ')}} <span
style="font-size: 13px;">MGA</span></span>
<p>
{{ (product.title|slice(0,30)|raw)|nl2br }}...
</p>
<div class="d-flex flex-column justify-content-center align-items-center overlay">
<div class="col-md-12 mb-2">
<div class="article-simi p-2 px-4">
<span style="font-size: 15px;">Fiche produit</span>
</div>
</div>
</div>
<div class="overlay-panier">
<a href="{{ path('app_fiche_produit', {'id': product.num_iid})}}"
style="text-decoration: none; color:white;">
<i class="bi bi-cart fs-2"></i>
</a>
</div>
</div>
{% endfor %}
</div>
</section>
{# SECTION VOUS AIMEREZ AUSSI #}
{# <section class="second-section">
{# vous aimerez aussi }
<div class="d-flex justify-content-center other-title mb-3">
<span class="text-center">
Vous <span style="color: #BEB623;">aimerez aussi</span>
</span>
</div>
{# liste produits }
{% if taobaoProducts['error'] is defined %}
<div class="row">
<center>
<div class="card col-6 p-3" style="color: #858796 !important;">
<h4 class="mb-3"><strong>Erreur {{taobaoProducts.codeError}} </strong></h4>
<h5>Des produits doivent s'afficher ici.</h5>
<span>Si ce n'est pas le cas, veuillez actualiser la page ou nous contacter.</span>
<a href="" class="btn mt-2"
style="background-color: #4597A4 !important; color:white;">Actualiser</a>
</div>
</center>
</div>
{% else %}
<div class="row">
{% set lastProduct = null %}
{% if taobaoProducts is not empty %}
{% for product in taobaoProducts %}
<div class="col-md-2 p-2 other-product mb-2"
onclick="window.location='{{ path('app_fiche_produit', {'id': product.num_iid})}}'">
<img src="{{product.pic_url}}" alt="" title="{{ product.title }}" class="img-fluid mb-3">
<span style="font-size: 18px; font-weight:700;">{{product.price|number_format('2', ',', ' ')}} <span
style="font-size: 13px;">MGA</span></span>
<p>
{{ (product.title|slice(0,30)|raw)|nl2br }}...
</p>
{# <div class="d-flex flex-column justify-content-center align-items-center overlay">
<div class="col-md-12 mb-2">
<div class="article-simi p-2 px-4">
<span style="font-size: 15px;">Articles similaires</span>
</div>
</div>
</div> }
<div class="overlay-panier">
<a href="{{ path('app_fiche_produit', {'id': product.num_iid})}}"
style="text-decoration: none; color:white;">
<i class="bi bi-cart fs-2"></i>
</a>
</div>
</div>
{% endfor %}
{% else %}
<p>Aucun produit trouvé.</p>
{% endif %}
</div>
{# boutton voir plus }
<div class="mt-4 d-flex justify-content-center">
<div class="col-md-2 p-2 text-center btn-voir-plus">
<i class="bi bi-arrow-repeat"></i> Charger plus...
</div>
</div>
{% endif %}
</div> #}
</div>
{# script pour le date #}
<script>
function updateClock() {
let now = new Date();
let timeString = now.toLocaleTimeString('fr-FR'); // Format HH:MM:SS
document.getElementById('clock').textContent = timeString;
}
setInterval(updateClock, 1000); // Mise à jour chaque seconde
updateClock(); // Appel initial
</script>
{# image slide produit du jour #}
{# //
<script>
// // Liste des images pour le diaporama
// const images = [
// "{{ asset('uploads/slide/slide1.jpg') }}",
// "{{ asset('uploads/slide/slide2.jpg') }}",
// "{{ asset('uploads/slide/slide3.jpg') }}",
// "{{ asset('uploads/slide/slide6.jpg') }}",
// "{{ asset('uploads/slide/slide9.avif') }}"
// ];
// let currentIndex = 0; // Index de l'image actuelle
// const section = document.getElementById('slideshow-section');
// // Fonction pour changer l'image de fond
// function changeBackground() {
// section.style.transition = 'background-image 1s ease-in-out'; // Animation de transition
// section.style.backgroundImage = `url('${images[currentIndex]}')`;
// }
// // Slide automatique toutes les 5 secondes
// setInterval(function() {
// currentIndex = (currentIndex + 1) % images.length;
// changeBackground();
// }, 10000);
// // Navigation manuelle avec les flèches
// document.getElementById('prev').addEventListener('click', function() {
// currentIndex = (currentIndex - 1 + images.length) % images.length;
// changeBackground();
// });
// document.getElementById('next').addEventListener('click', function() {
// currentIndex = (currentIndex + 1) % images.length;
// changeBackground();
// });
// // Initial image
// changeBackground();
// </script> #}
<script>
const images = [
"{{ asset('uploads/slide/slide1.jpg') }}",
"{{ asset('uploads/slide/slide2.jpg') }}",
"{{ asset('uploads/slide/slide3.jpg') }}",
"{{ asset('uploads/slide/slide6.jpg') }}",
];
let index = 0;
const imageElement = document.getElementById('sliderImage');
setInterval(() => {
index = (index + 1) % images.length;
// Ajoute la classe d'animation de transition
imageElement.classList.add('fade-out');
// Attends la fin de l'animation avant de changer l'image
setTimeout(() => {
imageElement.src = images[index];
imageElement.classList.remove('fade-out');
}, 500); // Durée de l'animation (500ms)
}, 5000); // Change d’image toutes les 5 secondes
</script>
{% endblock %}