<?php
use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
use Twig\Extension\CoreExtension;
use Twig\Extension\SandboxExtension;
use Twig\Markup;
use Twig\Sandbox\SecurityError;
use Twig\Sandbox\SecurityNotAllowedTagError;
use Twig\Sandbox\SecurityNotAllowedFilterError;
use Twig\Sandbox\SecurityNotAllowedFunctionError;
use Twig\Source;
use Twig\Template;
use Twig\TemplateWrapper;
/* front/home.html.twig */
class __TwigTemplate_58ed0a0bdedcd81bf5c143bfd7fe8eb0 extends Template
{
private Source $source;
/**
* @var array<string, Template>
*/
private array $macros = [];
public function __construct(Environment $env)
{
parent::__construct($env);
$this->source = $this->getSourceContext();
$this->blocks = [
'meta' => [$this, 'block_meta'],
'stylesheets' => [$this, 'block_stylesheets'],
'body' => [$this, 'block_body'],
'javascripts' => [$this, 'block_javascripts'],
];
}
protected function doGetParent(array $context): bool|string|Template|TemplateWrapper
{
// line 1
return "front/base.html.twig";
}
protected function doDisplay(array $context, array $blocks = []): iterable
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "front/home.html.twig"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "front/home.html.twig"));
$this->parent = $this->loadTemplate("front/base.html.twig", "front/home.html.twig", 1);
yield from $this->parent->unwrap()->yield($context, array_merge($this->blocks, $blocks));
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
}
// line 3
/**
* @return iterable<null|scalar|\Stringable>
*/
public function block_meta(array $context, array $blocks = []): iterable
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "meta"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "meta"));
// line 4
yield " ";
yield from $this->yieldParentBlock("meta", $context, $blocks);
yield "
";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
yield from [];
}
// line 7
/**
* @return iterable<null|scalar|\Stringable>
*/
public function block_stylesheets(array $context, array $blocks = []): iterable
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "stylesheets"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "stylesheets"));
// line 8
yield " ";
yield from $this->yieldParentBlock("stylesheets", $context, $blocks);
yield "
<style>
.see-more-link {
font-size: 0.875rem;
color: #222121;
border: 1px solid #222121;
border-radius: 20px;
padding: 6px 12px;
transition: all 0.3s ease-in-out;
}
.see-more-link:hover {
background-color: #222121;
color: #fff;
}
</style>
";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
yield from [];
}
// line 25
/**
* @return iterable<null|scalar|\Stringable>
*/
public function block_body(array $context, array $blocks = []): iterable
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "body"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "body"));
// line 26
yield "<main class=\"main pt-4 pb-5\" style=\"background-color: #ffffff; color: #222121;\">
";
// line 28
if ((isset($context["sliders"]) || array_key_exists("sliders", $context) ? $context["sliders"] : (function () { throw new RuntimeError('Variable "sliders" does not exist.', 28, $this->source); })())) {
// line 29
yield " <div class=\"container\">
<section class=\"custom-slider-section\">
<div class=\"custom-slider-wrapper\">
";
// line 33
$context['_parent'] = $context;
$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); })()));
foreach ($context['_seq'] as $context["_key"] => $context["slider"]) {
// line 34
yield " <div class=\"custom-slide\" style=\"background-image: url('";
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", false, false, false, 34)), "html", null, true);
yield "');\">
<div class=\"slide-content\">
";
// line 37
if (CoreExtension::getAttribute($this->env, $this->source, $context["slider"], "title", [], "any", false, false, false, 37)) {
// line 38
yield " <h2 class=\"slide-title\">";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["slider"], "title", [], "any", false, false, false, 38), "html", null, true);
yield "</h2>
";
}
// line 40
yield " ";
if (CoreExtension::getAttribute($this->env, $this->source, $context["slider"], "description", [], "any", false, false, false, 40)) {
// line 41
yield " <div class=\"slide-description\">";
yield CoreExtension::getAttribute($this->env, $this->source, $context["slider"], "description", [], "any", false, false, false, 41);
yield "</div>
";
}
// line 42
yield "
</div>
";
// line 44
if (CoreExtension::getAttribute($this->env, $this->source, $context["slider"], "description", [], "any", false, false, false, 44)) {
// line 45
yield " <a href=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["slider"], "url", [], "any", false, false, false, 45), "html", null, true);
yield "\" ></a>
";
}
// line 47
yield "
</div>
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_key'], $context['slider'], $context['_parent']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 50
yield " </div>
<button class=\"slider-arrow left\">❮</button>
<button class=\"slider-arrow right\">❯</button>
</section>
</div>
";
}
// line 57
yield "
<div id=\"app\">
<section v-if=\"categories.length\" v-for=\"(entry, index) in categories\" class=\"pt-5 mb-5 border-top\">
<div class=\"container\">
<div class=\"d-flex justify-content-between align-items-end mb-4 mt-3 flex-wrap gap-3\">
<h2 class=\"section-title d-flex align-items-center mb-0\">
<i v-if=\"entry.category.name.includes('Robe')\" class=\"me-2 bi bi-person-lines-fill\"></i>
<i v-else-if=\"entry.category.name.includes('Jean')\" class=\"me-2 bi bi-pants\"></i>
<i v-else-if=\"entry.category.name.includes('Veste')\" class=\"me-2 bi bi-journal\"></i>
<i v-else class=\"me-2 bi bi-bag\"></i>
\${ entry.category.name }
</h2>
<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)\">
Voir plus <i class=\"fi-rs-angle-double-small-right ms-1\"></i>
</a>
</div>
<div class=\"row g-4\">
<div class=\"col-6 col-md-6 col-lg-6\" v-for=\"prod in entry.products.slice(0, 6)\" :key=\"prod.id\">
<div class=\"card h-100 border-0\">
<div class=\"product-img-container\" @click=\"openProduct(prod.id, prod.name)\">
<div class=\"badges-wrapper\">
<span v-if=\"!prod.stock\" class=\"badge badge-stockout\">Rupture</span>
<span v-if=\"prod.isNew\" class=\"badge badge-new\">Nouveau</span>
<span v-if=\"prod.promo && prod.promo.isValid\" class=\"badge badge-promo\">
\${ prod.promo.discountType === 'amount'
? '-' + prod.promo.discountValue.toFixed(3) + ' TND'
: '-' + prod.promo.discountValue + '%' }
</span>
</div>
<img :src=\"'images/300-400/' + prod.image\" :alt=\"prod.name\" class=\"img-fluid product-img-fixed\">
</div>
<div class=\"card-body p-2 d-flex flex-column\">
<h6 class=\"card-title\">
<a href=\"#&\" class=\"text-decoration-none\" @click=\"openProduct(prod.id, prod.name)\">
\${ prod.name }
</a>
</h6>
<div class=\"product-price mb-2\">
<span v-if=\"!prod.promo || (prod.promo && !prod.promo.isValid)\">
\${ prod.priceTTC.toFixed(3) } TND
</span>
<span v-else>
<strong class=\"old-price\">
\${ prod.promo.discountType === 'amount'
? (prod.priceTTC - prod.promo.discountValue).toFixed(3)
: (prod.priceTTC - (prod.priceTTC * prod.promo.discountValue / 100)).toFixed(3) } TND
</strong>
<del class=\"ms-1\">\${ prod.priceTTC.toFixed(3) } TND</del>
</span>
</div>
<button class=\"btn btn-sm mt-auto\" @click=\"getProduit(prod.id)\" :disabled=\"!prod.stock\">
<i class=\"fi-rs-shopping-bag-add me-1\"></i> Ajouter
</button>
</div>
</div>
</div>
</div>
</div>
</section>
</div>
</main>
";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
yield from [];
}
// line 132
/**
* @return iterable<null|scalar|\Stringable>
*/
public function block_javascripts(array $context, array $blocks = []): iterable
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "javascripts"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "javascripts"));
// line 133
yield "
";
// line 134
yield from $this->yieldParentBlock("javascripts", $context, $blocks);
yield "
<script src=\"";
// line 138
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("front/assets/scripts/home/home.js"), "html", null, true);
yield "\"></script>
<script>
\$(document).ready(function () {
\$(\"#preloader-active-loading\").hide();
});
document.addEventListener('DOMContentLoaded', function () {
const wrapper = document.querySelector('.custom-slider-wrapper');
const slides = document.querySelectorAll('.custom-slide');
const totalSlides = slides.length;
let currentIndex = 0;
// Définir la largeur dynamique
wrapper.style.width = `\${100 * totalSlides}%`;
slides.forEach(slide => {
slide.style.flex = `0 0 \${100 / totalSlides}%`;
});
function showSlide(index) {
wrapper.style.transform = `translateX(-\${index * (100 / totalSlides)}%)`;
}
document.querySelector('.slider-arrow.left').addEventListener('click', () => {
currentIndex = (currentIndex - 1 + totalSlides) % totalSlides;
showSlide(currentIndex);
});
document.querySelector('.slider-arrow.right').addEventListener('click', () => {
currentIndex = (currentIndex + 1) % totalSlides;
showSlide(currentIndex);
});
showSlide(currentIndex);
});
</script>
";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
yield from [];
}
/**
* @codeCoverageIgnore
*/
public function getTemplateName(): string
{
return "front/home.html.twig";
}
/**
* @codeCoverageIgnore
*/
public function isTraitable(): bool
{
return false;
}
/**
* @codeCoverageIgnore
*/
public function getDebugInfo(): array
{
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,);
}
public function getSourceContext(): Source
{
return new Source("{% extends 'front/base.html.twig' %}
{% block meta %}
{{ parent() }}
{% endblock %}
{% block stylesheets %}
{{ parent() }}
<style>
.see-more-link {
font-size: 0.875rem;
color: #222121;
border: 1px solid #222121;
border-radius: 20px;
padding: 6px 12px;
transition: all 0.3s ease-in-out;
}
.see-more-link:hover {
background-color: #222121;
color: #fff;
}
</style>
{% endblock %}
{% block body %}
<main class=\"main pt-4 pb-5\" style=\"background-color: #ffffff; color: #222121;\">
{% if sliders %}
<div class=\"container\">
<section class=\"custom-slider-section\">
<div class=\"custom-slider-wrapper\">
{% for slider in sliders %}
<div class=\"custom-slide\" style=\"background-image: url('{{ asset(slider.image) }}');\">
<div class=\"slide-content\">
{% if slider.title %}
<h2 class=\"slide-title\">{{ slider.title }}</h2>
{% endif %}
{% if slider.description %}
<div class=\"slide-description\">{{ slider.description|raw }}</div>
{% endif %}
</div>
{% if slider.description %}
<a href=\"{{ slider.url }}\" ></a>
{% endif %}
</div>
{% endfor %}
</div>
<button class=\"slider-arrow left\">❮</button>
<button class=\"slider-arrow right\">❯</button>
</section>
</div>
{% endif %}
<div id=\"app\">
<section v-if=\"categories.length\" v-for=\"(entry, index) in categories\" class=\"pt-5 mb-5 border-top\">
<div class=\"container\">
<div class=\"d-flex justify-content-between align-items-end mb-4 mt-3 flex-wrap gap-3\">
<h2 class=\"section-title d-flex align-items-center mb-0\">
<i v-if=\"entry.category.name.includes('Robe')\" class=\"me-2 bi bi-person-lines-fill\"></i>
<i v-else-if=\"entry.category.name.includes('Jean')\" class=\"me-2 bi bi-pants\"></i>
<i v-else-if=\"entry.category.name.includes('Veste')\" class=\"me-2 bi bi-journal\"></i>
<i v-else class=\"me-2 bi bi-bag\"></i>
\${ entry.category.name }
</h2>
<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)\">
Voir plus <i class=\"fi-rs-angle-double-small-right ms-1\"></i>
</a>
</div>
<div class=\"row g-4\">
<div class=\"col-6 col-md-6 col-lg-6\" v-for=\"prod in entry.products.slice(0, 6)\" :key=\"prod.id\">
<div class=\"card h-100 border-0\">
<div class=\"product-img-container\" @click=\"openProduct(prod.id, prod.name)\">
<div class=\"badges-wrapper\">
<span v-if=\"!prod.stock\" class=\"badge badge-stockout\">Rupture</span>
<span v-if=\"prod.isNew\" class=\"badge badge-new\">Nouveau</span>
<span v-if=\"prod.promo && prod.promo.isValid\" class=\"badge badge-promo\">
\${ prod.promo.discountType === 'amount'
? '-' + prod.promo.discountValue.toFixed(3) + ' TND'
: '-' + prod.promo.discountValue + '%' }
</span>
</div>
<img :src=\"'images/300-400/' + prod.image\" :alt=\"prod.name\" class=\"img-fluid product-img-fixed\">
</div>
<div class=\"card-body p-2 d-flex flex-column\">
<h6 class=\"card-title\">
<a href=\"#&\" class=\"text-decoration-none\" @click=\"openProduct(prod.id, prod.name)\">
\${ prod.name }
</a>
</h6>
<div class=\"product-price mb-2\">
<span v-if=\"!prod.promo || (prod.promo && !prod.promo.isValid)\">
\${ prod.priceTTC.toFixed(3) } TND
</span>
<span v-else>
<strong class=\"old-price\">
\${ prod.promo.discountType === 'amount'
? (prod.priceTTC - prod.promo.discountValue).toFixed(3)
: (prod.priceTTC - (prod.priceTTC * prod.promo.discountValue / 100)).toFixed(3) } TND
</strong>
<del class=\"ms-1\">\${ prod.priceTTC.toFixed(3) } TND</del>
</span>
</div>
<button class=\"btn btn-sm mt-auto\" @click=\"getProduit(prod.id)\" :disabled=\"!prod.stock\">
<i class=\"fi-rs-shopping-bag-add me-1\"></i> Ajouter
</button>
</div>
</div>
</div>
</div>
</div>
</section>
</div>
</main>
{% endblock %}
{% block javascripts %}
{{ parent() }}
<script src=\"{{ asset('front/assets/scripts/home/home.js') }}\"></script>
<script>
\$(document).ready(function () {
\$(\"#preloader-active-loading\").hide();
});
document.addEventListener('DOMContentLoaded', function () {
const wrapper = document.querySelector('.custom-slider-wrapper');
const slides = document.querySelectorAll('.custom-slide');
const totalSlides = slides.length;
let currentIndex = 0;
// Définir la largeur dynamique
wrapper.style.width = `\${100 * totalSlides}%`;
slides.forEach(slide => {
slide.style.flex = `0 0 \${100 / totalSlides}%`;
});
function showSlide(index) {
wrapper.style.transform = `translateX(-\${index * (100 / totalSlides)}%)`;
}
document.querySelector('.slider-arrow.left').addEventListener('click', () => {
currentIndex = (currentIndex - 1 + totalSlides) % totalSlides;
showSlide(currentIndex);
});
document.querySelector('.slider-arrow.right').addEventListener('click', () => {
currentIndex = (currentIndex + 1) % totalSlides;
showSlide(currentIndex);
});
showSlide(currentIndex);
});
</script>
{% endblock %}", "front/home.html.twig", "/home/sunshil/www/sunshine-elegance/templates/front/home.html.twig");
}
}