var/cache/dev/twig/f4/f4b35eb2a5beea8a2f9500ebc80ea9c6.php line 46

Open in your IDE?
  1. <?php
  2. use Twig\Environment;
  3. use Twig\Error\LoaderError;
  4. use Twig\Error\RuntimeError;
  5. use Twig\Extension\CoreExtension;
  6. use Twig\Extension\SandboxExtension;
  7. use Twig\Markup;
  8. use Twig\Sandbox\SecurityError;
  9. use Twig\Sandbox\SecurityNotAllowedTagError;
  10. use Twig\Sandbox\SecurityNotAllowedFilterError;
  11. use Twig\Sandbox\SecurityNotAllowedFunctionError;
  12. use Twig\Source;
  13. use Twig\Template;
  14. use Twig\TemplateWrapper;
  15. /* front/home.html.twig */
  16. class __TwigTemplate_58ed0a0bdedcd81bf5c143bfd7fe8eb0 extends Template
  17. {
  18.     private Source $source;
  19.     /**
  20.      * @var array<string, Template>
  21.      */
  22.     private array $macros = [];
  23.     public function __construct(Environment $env)
  24.     {
  25.         parent::__construct($env);
  26.         $this->source $this->getSourceContext();
  27.         $this->blocks = [
  28.             'meta' => [$this'block_meta'],
  29.             'stylesheets' => [$this'block_stylesheets'],
  30.             'body' => [$this'block_body'],
  31.             'javascripts' => [$this'block_javascripts'],
  32.         ];
  33.     }
  34.     protected function doGetParent(array $context): bool|string|Template|TemplateWrapper
  35.     {
  36.         // line 1
  37.         return "front/base.html.twig";
  38.     }
  39.     protected function doDisplay(array $context, array $blocks = []): iterable
  40.     {
  41.         $macros $this->macros;
  42.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  43.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""front/home.html.twig"));
  44.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  45.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""front/home.html.twig"));
  46.         $this->parent $this->loadTemplate("front/base.html.twig""front/home.html.twig"1);
  47.         yield from $this->parent->unwrap()->yield($contextarray_merge($this->blocks$blocks));
  48.         
  49.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  50.         
  51.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  52.     }
  53.     // line 3
  54.     /**
  55.      * @return iterable<null|scalar|\Stringable>
  56.      */
  57.     public function block_meta(array $context, array $blocks = []): iterable
  58.     {
  59.         $macros $this->macros;
  60.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  61.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""meta"));
  62.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  63.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""meta"));
  64.         // line 4
  65.         yield "    ";
  66.         yield from $this->yieldParentBlock("meta"$context$blocks);
  67.         yield "
  68. ";
  69.         
  70.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  71.         
  72.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  73.         yield from [];
  74.     }
  75.     // line 7
  76.     /**
  77.      * @return iterable<null|scalar|\Stringable>
  78.      */
  79.     public function block_stylesheets(array $context, array $blocks = []): iterable
  80.     {
  81.         $macros $this->macros;
  82.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  83.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""stylesheets"));
  84.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  85.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""stylesheets"));
  86.         // line 8
  87.         yield "    ";
  88.         yield from $this->yieldParentBlock("stylesheets"$context$blocks);
  89.         yield "
  90.     <style>
  91.         .see-more-link {
  92.             font-size: 0.875rem;
  93.             color: #222121;
  94.             border: 1px solid #222121;
  95.             border-radius: 20px;
  96.             padding: 6px 12px;
  97.             transition: all 0.3s ease-in-out;
  98.         }
  99.         .see-more-link:hover {
  100.             background-color: #222121;
  101.             color: #fff;
  102.         }
  103.     </style>
  104. ";
  105.         
  106.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  107.         
  108.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  109.         yield from [];
  110.     }
  111.     // line 25
  112.     /**
  113.      * @return iterable<null|scalar|\Stringable>
  114.      */
  115.     public function block_body(array $context, array $blocks = []): iterable
  116.     {
  117.         $macros $this->macros;
  118.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  119.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""body"));
  120.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  121.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""body"));
  122.         // line 26
  123.         yield "<main class=\"main pt-4 pb-5\" style=\"background-color: #ffffff; color: #222121;\">
  124.     ";
  125.         // line 28
  126.         if ((isset($context["sliders"]) || array_key_exists("sliders"$context) ? $context["sliders"] : (function () { throw new RuntimeError('Variable "sliders" does not exist.'28$this->source); })())) {
  127.             // line 29
  128.             yield "        <div class=\"container\">
  129.             <section class=\"custom-slider-section\">
  130.                 
  131.                 <div class=\"custom-slider-wrapper\">
  132.                     ";
  133.             // line 33
  134.             $context['_parent'] = $context;
  135.             $context['_seq'] = CoreExtension::ensureTraversable((isset($context["sliders"]) || array_key_exists("sliders"$context) ? $context["sliders"] : (function () { throw new RuntimeError('Variable "sliders" does not exist.'33$this->source); })()));
  136.             foreach ($context['_seq'] as $context["_key"] => $context["slider"]) {
  137.                 // line 34
  138.                 yield "                    <div class=\"custom-slide\" style=\"background-image: url('";
  139.                 yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl(CoreExtension::getAttribute($this->env$this->source$context["slider"], "image", [], "any"falsefalsefalse34)), "html"nulltrue);
  140.                 yield "');\">
  141.                        
  142.                             <div class=\"slide-content\">
  143.                                 ";
  144.                 // line 37
  145.                 if (CoreExtension::getAttribute($this->env$this->source$context["slider"], "title", [], "any"falsefalsefalse37)) {
  146.                     // line 38
  147.                     yield "                                    <h2 class=\"slide-title\">";
  148.                     yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->source$context["slider"], "title", [], "any"falsefalsefalse38), "html"nulltrue);
  149.                     yield "</h2>
  150.                                 ";
  151.                 }
  152.                 // line 40
  153.                 yield "                                ";
  154.                 if (CoreExtension::getAttribute($this->env$this->source$context["slider"], "description", [], "any"falsefalsefalse40)) {
  155.                     // line 41
  156.                     yield "                                    <div class=\"slide-description\">";
  157.                     yield CoreExtension::getAttribute($this->env$this->source$context["slider"], "description", [], "any"falsefalsefalse41);
  158.                     yield "</div>
  159.                                 ";
  160.                 }
  161.                 // line 42
  162.                 yield "    
  163.                             </div>
  164.                             ";
  165.                 // line 44
  166.                 if (CoreExtension::getAttribute($this->env$this->source$context["slider"], "description", [], "any"falsefalsefalse44)) {
  167.                     // line 45
  168.                     yield "                                <a href=\"";
  169.                     yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->source$context["slider"], "url", [], "any"falsefalsefalse45), "html"nulltrue);
  170.                     yield "\" ></a>
  171.                             ";
  172.                 }
  173.                 // line 47
  174.                 yield "                       
  175.                     </div>
  176.                     ";
  177.             }
  178.             $_parent $context['_parent'];
  179.             unset($context['_seq'], $context['_key'], $context['slider'], $context['_parent']);
  180.             $context array_intersect_key($context$_parent) + $_parent;
  181.             // line 50
  182.             yield "                </div>
  183.                 <button class=\"slider-arrow left\">&#10094;</button>
  184.                 <button class=\"slider-arrow right\">&#10095;</button>
  185.             </section>
  186.         </div>
  187.     ";
  188.         }
  189.         // line 57
  190.         yield "
  191.     
  192.     
  193.         
  194.     <div id=\"app\">
  195.         <section v-if=\"categories.length\" v-for=\"(entry, index) in categories\" class=\"pt-5 mb-5 border-top\">
  196.             <div class=\"container\">
  197.                 <div class=\"d-flex justify-content-between align-items-end mb-4 mt-3 flex-wrap gap-3\">
  198.                     <h2 class=\"section-title d-flex align-items-center mb-0\">
  199.                         <i v-if=\"entry.category.name.includes('Robe')\" class=\"me-2 bi bi-person-lines-fill\"></i>
  200.                         <i v-else-if=\"entry.category.name.includes('Jean')\" class=\"me-2 bi bi-pants\"></i>
  201.                         <i v-else-if=\"entry.category.name.includes('Veste')\" class=\"me-2 bi bi-journal\"></i>
  202.                         <i v-else class=\"me-2 bi bi-bag\"></i>
  203.                         \${ entry.category.name }
  204.                     </h2>
  205.                     <a href=\"#&\" class=\"see-more-link text-decoration-none d-flex align-items-center fw-medium px-3 py-1 rounded-pill\" @click=\"openCategory(entry.category.id, entry.category.name)\">
  206.                         Voir plus <i class=\"fi-rs-angle-double-small-right ms-1\"></i>
  207.                     </a>
  208.                 </div>
  209.                 <div class=\"row g-4\">
  210.                     <div class=\"col-6 col-md-6 col-lg-6\" v-for=\"prod in entry.products.slice(0, 6)\" :key=\"prod.id\">
  211.                         
  212.                         <div class=\"card h-100 border-0\">
  213.                             <div class=\"product-img-container\" @click=\"openProduct(prod.id, prod.name)\">
  214.                                 <div class=\"badges-wrapper\">
  215.                                     <span v-if=\"!prod.stock\" class=\"badge badge-stockout\">Rupture</span>
  216.                                     <span v-if=\"prod.isNew\" class=\"badge badge-new\">Nouveau</span>
  217.                                     <span v-if=\"prod.promo && prod.promo.isValid\" class=\"badge badge-promo\">
  218.                                         \${ prod.promo.discountType === 'amount' 
  219.                                             ? '-' + prod.promo.discountValue.toFixed(3) + ' TND' 
  220.                                             : '-' + prod.promo.discountValue + '%' }
  221.                                     </span>
  222.                                 </div>
  223.                                 <img :src=\"'images/300-400/' + prod.image\" :alt=\"prod.name\" class=\"img-fluid product-img-fixed\">
  224.                             </div>
  225.                             <div class=\"card-body p-2 d-flex flex-column\">
  226.                                 <h6 class=\"card-title\">
  227.                                     <a href=\"#&\" class=\"text-decoration-none\" @click=\"openProduct(prod.id, prod.name)\">
  228.                                         \${ prod.name }
  229.                                     </a>
  230.                                 </h6>
  231.                                 <div class=\"product-price mb-2\">
  232.                                     <span v-if=\"!prod.promo || (prod.promo && !prod.promo.isValid)\">
  233.                                         \${ prod.priceTTC.toFixed(3) } TND
  234.                                     </span>
  235.                                     <span v-else>
  236.                                         <strong class=\"old-price\">
  237.                                             \${ prod.promo.discountType === 'amount' 
  238.                                                 ? (prod.priceTTC - prod.promo.discountValue).toFixed(3) 
  239.                                                 : (prod.priceTTC - (prod.priceTTC * prod.promo.discountValue / 100)).toFixed(3) } TND
  240.                                         </strong>
  241.                                         <del class=\"ms-1\">\${ prod.priceTTC.toFixed(3) } TND</del>
  242.                                     </span>
  243.                                 </div>
  244.                                 <button class=\"btn btn-sm mt-auto\" @click=\"getProduit(prod.id)\" :disabled=\"!prod.stock\">
  245.                                     <i class=\"fi-rs-shopping-bag-add me-1\"></i> Ajouter
  246.                                 </button>
  247.                             </div>
  248.                         </div>
  249.                     </div>
  250.                 </div>
  251.             </div>
  252.         </section>
  253.     </div>
  254.         
  255.     
  256.         
  257.           
  258. </main>
  259. ";
  260.         
  261.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  262.         
  263.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  264.         yield from [];
  265.     }
  266.     // line 132
  267.     /**
  268.      * @return iterable<null|scalar|\Stringable>
  269.      */
  270.     public function block_javascripts(array $context, array $blocks = []): iterable
  271.     {
  272.         $macros $this->macros;
  273.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  274.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""javascripts"));
  275.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  276.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""javascripts"));
  277.         // line 133
  278.         yield "
  279.     ";
  280.         // line 134
  281.         yield from $this->yieldParentBlock("javascripts"$context$blocks);
  282.         yield "
  283.     
  284.       
  285.     <script src=\"";
  286.         // line 138
  287.         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("front/assets/scripts/home/home.js"), "html"nulltrue);
  288.         yield "\"></script>
  289.     <script>
  290.         
  291.         \$(document).ready(function () {
  292.             \$(\"#preloader-active-loading\").hide();
  293.         });
  294.        
  295.         document.addEventListener('DOMContentLoaded', function () {
  296.             const wrapper = document.querySelector('.custom-slider-wrapper');
  297.             const slides = document.querySelectorAll('.custom-slide');
  298.             const totalSlides = slides.length;
  299.             let currentIndex = 0;
  300.         
  301.             // Définir la largeur dynamique
  302.             wrapper.style.width = `\${100 * totalSlides}%`;
  303.             slides.forEach(slide => {
  304.               slide.style.flex = `0 0 \${100 / totalSlides}%`;
  305.             });
  306.         
  307.             function showSlide(index) {
  308.               wrapper.style.transform = `translateX(-\${index * (100 / totalSlides)}%)`;
  309.             }
  310.         
  311.             document.querySelector('.slider-arrow.left').addEventListener('click', () => {
  312.               currentIndex = (currentIndex - 1 + totalSlides) % totalSlides;
  313.               showSlide(currentIndex);
  314.             });
  315.         
  316.             document.querySelector('.slider-arrow.right').addEventListener('click', () => {
  317.               currentIndex = (currentIndex + 1) % totalSlides;
  318.               showSlide(currentIndex);
  319.             });
  320.         
  321.             showSlide(currentIndex);
  322.             
  323.           });
  324.                 
  325.                 
  326.          
  327.                 
  328.     </script>
  329.       
  330.       
  331. ";
  332.         
  333.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  334.         
  335.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  336.         yield from [];
  337.     }
  338.     /**
  339.      * @codeCoverageIgnore
  340.      */
  341.     public function getTemplateName(): string
  342.     {
  343.         return "front/home.html.twig";
  344.     }
  345.     /**
  346.      * @codeCoverageIgnore
  347.      */
  348.     public function isTraitable(): bool
  349.     {
  350.         return false;
  351.     }
  352.     /**
  353.      * @codeCoverageIgnore
  354.      */
  355.     public function getDebugInfo(): array
  356.     {
  357.         return array (  323 => 138,  316 => 134,  313 => 133,  300 => 132,  216 => 57,  207 => 50,  199 => 47,  193 => 45,  191 => 44,  187 => 42,  181 => 41,  178 => 40,  172 => 38,  170 => 37,  163 => 34,  159 => 33,  153 => 29,  151 => 28,  147 => 26,  134 => 25,  106 => 8,  93 => 7,  79 => 4,  66 => 3,  43 => 1,);
  358.     }
  359.     public function getSourceContext(): Source
  360.     {
  361.         return new Source("{% extends 'front/base.html.twig' %}
  362. {% block meta %}
  363.     {{ parent() }}
  364. {% endblock %}
  365. {% block stylesheets %}
  366.     {{ parent() }}
  367.     <style>
  368.         .see-more-link {
  369.             font-size: 0.875rem;
  370.             color: #222121;
  371.             border: 1px solid #222121;
  372.             border-radius: 20px;
  373.             padding: 6px 12px;
  374.             transition: all 0.3s ease-in-out;
  375.         }
  376.         .see-more-link:hover {
  377.             background-color: #222121;
  378.             color: #fff;
  379.         }
  380.     </style>
  381. {% endblock %}
  382. {% block body %}
  383. <main class=\"main pt-4 pb-5\" style=\"background-color: #ffffff; color: #222121;\">
  384.     {% if sliders %}
  385.         <div class=\"container\">
  386.             <section class=\"custom-slider-section\">
  387.                 
  388.                 <div class=\"custom-slider-wrapper\">
  389.                     {% for slider in sliders %}
  390.                     <div class=\"custom-slide\" style=\"background-image: url('{{ asset(slider.image) }}');\">
  391.                        
  392.                             <div class=\"slide-content\">
  393.                                 {% if slider.title %}
  394.                                     <h2 class=\"slide-title\">{{ slider.title }}</h2>
  395.                                 {% endif %}
  396.                                 {% if slider.description %}
  397.                                     <div class=\"slide-description\">{{ slider.description|raw }}</div>
  398.                                 {% endif %}    
  399.                             </div>
  400.                             {% if slider.description %}
  401.                                 <a href=\"{{ slider.url }}\" ></a>
  402.                             {% endif %}
  403.                        
  404.                     </div>
  405.                     {% endfor %}
  406.                 </div>
  407.                 <button class=\"slider-arrow left\">&#10094;</button>
  408.                 <button class=\"slider-arrow right\">&#10095;</button>
  409.             </section>
  410.         </div>
  411.     {% endif %}
  412.     
  413.     
  414.         
  415.     <div id=\"app\">
  416.         <section v-if=\"categories.length\" v-for=\"(entry, index) in categories\" class=\"pt-5 mb-5 border-top\">
  417.             <div class=\"container\">
  418.                 <div class=\"d-flex justify-content-between align-items-end mb-4 mt-3 flex-wrap gap-3\">
  419.                     <h2 class=\"section-title d-flex align-items-center mb-0\">
  420.                         <i v-if=\"entry.category.name.includes('Robe')\" class=\"me-2 bi bi-person-lines-fill\"></i>
  421.                         <i v-else-if=\"entry.category.name.includes('Jean')\" class=\"me-2 bi bi-pants\"></i>
  422.                         <i v-else-if=\"entry.category.name.includes('Veste')\" class=\"me-2 bi bi-journal\"></i>
  423.                         <i v-else class=\"me-2 bi bi-bag\"></i>
  424.                         \${ entry.category.name }
  425.                     </h2>
  426.                     <a href=\"#&\" class=\"see-more-link text-decoration-none d-flex align-items-center fw-medium px-3 py-1 rounded-pill\" @click=\"openCategory(entry.category.id, entry.category.name)\">
  427.                         Voir plus <i class=\"fi-rs-angle-double-small-right ms-1\"></i>
  428.                     </a>
  429.                 </div>
  430.                 <div class=\"row g-4\">
  431.                     <div class=\"col-6 col-md-6 col-lg-6\" v-for=\"prod in entry.products.slice(0, 6)\" :key=\"prod.id\">
  432.                         
  433.                         <div class=\"card h-100 border-0\">
  434.                             <div class=\"product-img-container\" @click=\"openProduct(prod.id, prod.name)\">
  435.                                 <div class=\"badges-wrapper\">
  436.                                     <span v-if=\"!prod.stock\" class=\"badge badge-stockout\">Rupture</span>
  437.                                     <span v-if=\"prod.isNew\" class=\"badge badge-new\">Nouveau</span>
  438.                                     <span v-if=\"prod.promo && prod.promo.isValid\" class=\"badge badge-promo\">
  439.                                         \${ prod.promo.discountType === 'amount' 
  440.                                             ? '-' + prod.promo.discountValue.toFixed(3) + ' TND' 
  441.                                             : '-' + prod.promo.discountValue + '%' }
  442.                                     </span>
  443.                                 </div>
  444.                                 <img :src=\"'images/300-400/' + prod.image\" :alt=\"prod.name\" class=\"img-fluid product-img-fixed\">
  445.                             </div>
  446.                             <div class=\"card-body p-2 d-flex flex-column\">
  447.                                 <h6 class=\"card-title\">
  448.                                     <a href=\"#&\" class=\"text-decoration-none\" @click=\"openProduct(prod.id, prod.name)\">
  449.                                         \${ prod.name }
  450.                                     </a>
  451.                                 </h6>
  452.                                 <div class=\"product-price mb-2\">
  453.                                     <span v-if=\"!prod.promo || (prod.promo && !prod.promo.isValid)\">
  454.                                         \${ prod.priceTTC.toFixed(3) } TND
  455.                                     </span>
  456.                                     <span v-else>
  457.                                         <strong class=\"old-price\">
  458.                                             \${ prod.promo.discountType === 'amount' 
  459.                                                 ? (prod.priceTTC - prod.promo.discountValue).toFixed(3) 
  460.                                                 : (prod.priceTTC - (prod.priceTTC * prod.promo.discountValue / 100)).toFixed(3) } TND
  461.                                         </strong>
  462.                                         <del class=\"ms-1\">\${ prod.priceTTC.toFixed(3) } TND</del>
  463.                                     </span>
  464.                                 </div>
  465.                                 <button class=\"btn btn-sm mt-auto\" @click=\"getProduit(prod.id)\" :disabled=\"!prod.stock\">
  466.                                     <i class=\"fi-rs-shopping-bag-add me-1\"></i> Ajouter
  467.                                 </button>
  468.                             </div>
  469.                         </div>
  470.                     </div>
  471.                 </div>
  472.             </div>
  473.         </section>
  474.     </div>
  475.         
  476.     
  477.         
  478.           
  479. </main>
  480. {% endblock %}
  481. {% block javascripts %}
  482.     {{ parent() }}
  483.     
  484.       
  485.     <script src=\"{{ asset('front/assets/scripts/home/home.js') }}\"></script>
  486.     <script>
  487.         
  488.         \$(document).ready(function () {
  489.             \$(\"#preloader-active-loading\").hide();
  490.         });
  491.        
  492.         document.addEventListener('DOMContentLoaded', function () {
  493.             const wrapper = document.querySelector('.custom-slider-wrapper');
  494.             const slides = document.querySelectorAll('.custom-slide');
  495.             const totalSlides = slides.length;
  496.             let currentIndex = 0;
  497.         
  498.             // Définir la largeur dynamique
  499.             wrapper.style.width = `\${100 * totalSlides}%`;
  500.             slides.forEach(slide => {
  501.               slide.style.flex = `0 0 \${100 / totalSlides}%`;
  502.             });
  503.         
  504.             function showSlide(index) {
  505.               wrapper.style.transform = `translateX(-\${index * (100 / totalSlides)}%)`;
  506.             }
  507.         
  508.             document.querySelector('.slider-arrow.left').addEventListener('click', () => {
  509.               currentIndex = (currentIndex - 1 + totalSlides) % totalSlides;
  510.               showSlide(currentIndex);
  511.             });
  512.         
  513.             document.querySelector('.slider-arrow.right').addEventListener('click', () => {
  514.               currentIndex = (currentIndex + 1) % totalSlides;
  515.               showSlide(currentIndex);
  516.             });
  517.         
  518.             showSlide(currentIndex);
  519.             
  520.           });
  521.                 
  522.                 
  523.          
  524.                 
  525.     </script>
  526.       
  527.       
  528. {% endblock %}""front/home.html.twig""/home/sunshil/www/sunshine-elegance/templates/front/home.html.twig");
  529.     }
  530. }