templates/app/shop.html.twig line 1

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% set side_nav = 'carte' %}
  3. {% block body %}
  4.     <!--Page Title-->
  5.     <section class="page-title" style="background-image: url('{{ asset('build/theme/images/main-slider/9.png') }}');">
  6.         <div class="auto-container">
  7.             <h1>Lena chocolat</h1>
  8.             <ul class="page-breadcrumb">
  9.                 <li><a href="index.html">Carte</a></li>
  10.                 <li>Bonheur culinaire</li>
  11.             </ul>
  12.         </div>
  13.     </section>
  14.     <!--End Page Title-->
  15.     <!-- Filter Buttons -->
  16.     
  17.     <!-- Blog Showcase -->
  18.     <section class="blog-section blog-three-column">
  19.     <div class="mixitup-gallery">
  20.         <div class="filters clearfix">
  21.             <ul class="filter-tabs filter-btns clearfix">
  22.                 <li type="button" class="filter active filter-btn" data-role="button" data-filter="all">Tout 
  23.                     {# <div class="filter_shape"><svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" viewBox="0 0 850.4 217"><path d="M820.3,96.5c-33.3-20.8-83.5-4.6-118,7.6c-79.5,28.2-150.5,57.8-236.9,44.3C317.8,125.3,122.3-11.8,0,132 c26.4,33.4,64.5-8.1,92.5-18.4c37.9-14,78-14.8,117-5c85.2,21.6,154.1,81.5,242,99.4c43,8.8,93.1,13.5,135.9,1.4 c40.6-11.5,70-41.1,102.9-65.9c22.9-17.3,44-36.9,71.6-23.7c14.9,7.1,20.7,28.6,34.6,37.8c14.7,9.7,34.7,10.1,51,16 C852.6,138,854.8,118.1,820.3,96.5z M494.7,81.7c34.5,4.3,141.9,1.9,134.9-60.3C626.8-3.2,594.7-4.5,577.9,7 c-20.8,14.4-14.3,27.9-44.8,29c-71.9,2.6-145.4-21.3-218.1-21.3C310.4,53.5,463.4,77.9,494.7,81.7z"></path></svg></div> #}
  24.                 </li>
  25.                 {% for category in categories %}
  26.                  <li type="button" class="filter" data-role="button" data-filter=".category-{{ category.id }}">{{ category.label }}
  27.                     {# <div class="filter_shape"><svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" viewBox="0 0 850.4 217"><path d="M820.3,96.5c-33.3-20.8-83.5-4.6-118,7.6c-79.5,28.2-150.5,57.8-236.9,44.3C317.8,125.3,122.3-11.8,0,132 c26.4,33.4,64.5-8.1,92.5-18.4c37.9-14,78-14.8,117-5c85.2,21.6,154.1,81.5,242,99.4c43,8.8,93.1,13.5,135.9,1.4 c40.6-11.5,70-41.1,102.9-65.9c22.9-17.3,44-36.9,71.6-23.7c14.9,7.1,20.7,28.6,34.6,37.8c14.7,9.7,34.7,10.1,51,16 C852.6,138,854.8,118.1,820.3,96.5z M494.7,81.7c34.5,4.3,141.9,1.9,134.9-60.3C626.8-3.2,594.7-4.5,577.9,7 c-20.8,14.4-14.3,27.9-44.8,29c-71.9,2.6-145.4-21.3-218.1-21.3C310.4,53.5,463.4,77.9,494.7,81.7z"></path></svg></div> #}
  28.                 </li>
  29.                 {% endfor %}
  30.             </ul>
  31.         </div>
  32.     </div>
  33.         <div class="container-fluid mixitup-container">
  34.         {% for category in categories %}
  35.             <div class="sec-title text-center margin-top-50">
  36.                 <div class="divider"><img src="{{asset('build/theme/images/icons/divider_1.png')}}" alt=""></div>
  37.                 <h1>{{ category.label }}</h1>
  38.             </div>
  39.             <div class="row">
  40.                 {% for item in groupedItems[category.id]|default([]) %}
  41.                     <div class="mix category-{{ category.id }} news-block col-lg-3 col-md-6 col-sm-12">
  42.                         <div class="item" data-category="{{ category.id }}">
  43.                             <div class="inner-box">
  44.                                 <div class="image-column">
  45.                                     <div class="inner-column">
  46.                                         <figure class="image"><img src="{{ item.imagemini }}" alt=""></figure>
  47.                                     </div>
  48.                                 </div>
  49.                                 <div class="content-column">
  50.                                     <div class="inner-column">
  51.                                         <h3>{{ item.label }}</h3>
  52.                                         <ul class="post-info">
  53.                                             {% set labelString = '' %}
  54.                                             {% for criterion in item.criterion %}
  55.                                                 {% set labelString = labelString ~ criterion.label %}
  56.                                                 {% if not loop.last %}
  57.                                                     {% set labelString = labelString ~ '-' %}
  58.                                                 {% endif %}
  59.                                             {% endfor %}
  60.                                             {% if labelString is empty %}
  61.                                                 {% set labelString = 'Pas d\'ingrédients' %}
  62.                                             {% endif %}
  63.                                             
  64.                                             {% set remainingLength = totalLength - labelString|length %}
  65.                                             {% set nbspString = '' %}
  66.                                             {% for i in 1..remainingLength %}
  67.                                                 {% set nbspString = nbspString ~ '&nbsp;' %}
  68.                                             {% endfor %}
  69.                                             
  70.                                             <li>
  71.                                                 <span class="icon">{{ labelString }} {{ nbspString|raw }}</span>
  72.                                             </li>
  73.                                         </ul>
  74.                                         <div class="text">{{ item.price|number_format(2, ',', ' ')  }} DZD</div>
  75.                                         <div class="devider"><img src="{{asset('build/theme/images/icons/icon-devider-gray.png')}}" alt=""></div>
  76.                                     </div>
  77.                                 </div>
  78.                             </div>
  79.                         </div>
  80.                     </div>
  81.                 {% endfor %}
  82.             </div>
  83.         {% endfor %}
  84.     </div>
  85. </section>
  86.     <div class="sec-title text-center margin-top-50">
  87.         <div class="divider"><img src="{{asset('build/theme/images/icons/divider_1.png')}}" alt=""></div>
  88.     </div>
  89.     <input type="hidden" id="route" value="{{ route }}">
  90.     <input type="hidden" id="target" value="{{ target }}">
  91.     <!-- End Blog Showcase -->
  92. <script>
  93. document.addEventListener('DOMContentLoaded', function() {
  94.     var filterButtons = document.querySelectorAll('.filter-tabs .filter');
  95.     var containerEl = document.querySelector('.mixitup-container');
  96.     var mixer = mixitup(containerEl, {
  97.         /*
  98.         animation: {
  99.             duration: 900, // Duration in milliseconds
  100.             effects: 'fade scale(0.9) rotateY(180deg) translateY(-100%) stagger(80ms)', // Combined effects
  101.             easing: 'ease-in-out' // Easing function
  102.         }
  103.         */
  104.         animation: {
  105.             duration: 850, // Duration in milliseconds
  106.             effects: 'fade translateX(-100%) rotateX(90deg) stagger(70ms)', // Combined effects
  107.             easing: 'ease-in-out', // Easing function
  108.             animateResizeTargets: true // Resize targets animated to their new size
  109.         }
  110.         /*
  111.        animation: {
  112.             duration: 750, // Duration in milliseconds
  113.             effects: 'fade rotateY(-180deg) translateX(100%) scale(0.5) stagger(100ms)', // Combined effects
  114.             easing: 'ease-in-out', // Easing function
  115.             perspectiveDistance: '3000px', // Perspective distance for 3D transforms
  116.             perspectiveOrigin: '50% 50%' // Perspective origin for 3D transforms
  117.         }
  118.         */
  119.         /*
  120.         animation: {
  121.             duration: 800, // Duration in milliseconds
  122.             effects: 'fade scale(0.8) rotateZ(-180deg) stagger(60ms)', // Combined effects
  123.             easing: 'ease-in-out', // Easing function
  124.         }
  125.         */
  126.     }); // Assuming MixItUp is already initialized
  127.     filterButtons.forEach(function(btn) {
  128.         btn.addEventListener('click', function() {
  129.             // Remove 'active' class from all buttons
  130.             filterButtons.forEach(function(button) {
  131.                 button.classList.remove('active');
  132.             });
  133.             // Add 'active' class to the clicked button
  134.             this.classList.add('active');
  135.             // Proceed with MixItUp filtering
  136.             mixer.filter(this.getAttribute('data-filter'));
  137.         });
  138.     });
  139. });
  140. </script>
  141. {% endblock %}