templates/includes/blocks/swipeSection.html.twig line 1

Open in your IDE?
  1. {% import "./macros_typography.html.twig" as macrosTypography %}
  2. {% import "./macros_button.html.twig" as macrosButton %}
  3. {% set background = content.bagroundSection %}
  4. <section
  5.   class="swipe-section relative {{ background == 'white' ? 'bg-gray text-blue' : 'bg-blue text-white'}} cursor-section"
  6.   section-shade="{{background == 'white' ? 'light' : 'dark'}}">
  7.   {% if content.swipeSectionTitle %}
  8.   <div class="container pt-10 md:pt-[90px]">
  9.     <h2 class="h2 md:text-center max-w-2xl mx-auto mb-10 md:mb-20"
  10.       split-direction="top"
  11.       split-trigger="scroll">{{content.swipeSectionTitle}}</h2>
  12.   </div>
  13.   {% endif %}
  14.  
  15.   {# swipe Slider #}
  16.   <div class="swipe-slider swiper-container w-full">
  17.     <div class="swiper-wrapper divide-x {{ background == 'white' ? 'divide-blue/10' : 'divide-white/10'}}">
  18.       {% for slide in content.similarProjects %}
  19.       {% set item = sulu_content_load(slide.similarProject,{'id': 'id'}) %}
  20.       {% set projet = sulu_content_load(item.id,{'title': 'title', 'image' : 'image', 'price' : 'price', 'location' : 'location', 'url' : 'url', 'surface' : 'surface', 'area' : 'area'}) %}
  21.       <div class="swipe-slide swiper-slide grid grid-rows-[auto_1fr] w-3/4 lg:w-2/5 xl:w-1/3 group">
  22.         <div class="swipe-slide__img-fade trigger-cursor translate-y-12 opacity-0 overflow-hidden">
  23.           <div
  24.             class="swipe-slide__img h-[60vh] min-h-[310px] max-h-[310px] md:max-h-[560px] scale-110 img-clip select-none">
  25.             {# image size 720x840 #}
  26.             {% if projet.content.image|length > 0 %}
  27.             {% set image = projet.content.image.thumbnails['720x840'] %}
  28.             <img src="{{ image }}"
  29.               width="100"
  30.               height="560"
  31.               alt="{{projet.content.title}}"
  32.               loading="lazy">
  33.             {% endif %}
  34.             {% if projet.content.image|length > 0 %}
  35.             {% set image = projet.content.image.thumbnails['720x840'] %}
  36.             <img src="{{ image }}"
  37.               width="100"
  38.               height="560"
  39.               alt="{{projet.content.title}}"
  40.               loading="lazy">
  41.             {% endif %}
  42.           </div>
  43.         </div>
  44.         <div
  45.           class="swipe-slide__content relative flex flex-col p-4 md:p-10 {{ background == 'white' ? 'text-blue' : 'bg-blue text-white'}} duration-500 {{ background == 'white' ? 'group-hover:bg-blue group-hover:text-white' : 'group-hover:bg-white group-hover:text-blue'}} group">
  46.           <a class="absolute inset-0 text-[0px] z-10"
  47.             href="{{ sulu_content_path(projet.content.url) }}">{{projet.content.title}}</a>
  48.           {% if slideNumbers %}
  49.           <div class="swipe-slide__num swipe-num text-sm text-siver-light {{ background == 'white' ? 'group-hover:text-white' : 'group-hover:text-blue'}} duration-500"
  50.             split-direction="bottom"
  51.             split-trigger="none">
  52.             Project <span class="number ml-1"></span>
  53.           </div>
  54.           {% endif %}
  55.           {% if projet.content.location %}
  56.           <div class="swipe-slide__eyebrow text-sm"
  57.             split-direction="bottom"
  58.             split-trigger="none">
  59.             <span>{{projet.content.location}}</span>
  60.             {% if projet.content.area %}
  61.             <span class="inline-block px-2 opacity-50">•</span>
  62.             <span>{{projet.content.area}}m<sup>2</sup>
  63.             </span>
  64.             {% endif %}
  65.           </div>
  66.           {% endif %}
  67.           {% if projet.content.title %}
  68.           <h3 class="swipe-slide__title h4 pr-6 mt-3 mb-5"
  69.             split-direction="bottom"
  70.             split-trigger="none">{{projet.content.title}}</h3>
  71.           {% else %}
  72.           <h2 class="swipe-slide__title h4 pr-6 mt-3 mb-5"
  73.             split-direction="bottom"
  74.             split-trigger="none">{{projet.content.title}}</h2>
  75.           {% endif %}
  76.           {% if projet.content.price %}
  77.           <div class="swipe-slide__price text-sm"
  78.             split-direction="bottom"
  79.             split-trigger="none">
  80.             <span>{{projet.content.price}}</span>
  81.           </div>
  82.           {% endif %}
  83.           {{macrosButton.arrowDiagonal({
  84.           'class': 'swipe-slide__arrow mt-auto ml-auto'
  85.           })
  86.           }}
  87.         </div>
  88.       </div>
  89.       {% endfor %}
  90.     </div>
  91.   </div>
  92.   {% if content.swipeSectionMoreLink %}
  93.   <div
  94.     class="flex justify-center py-9 md:py-12 border-y {{ background == 'white' ? 'border-blue/10' : 'border-white/10'}}">
  95.     <a class="text-xl md:text-2xl flex items-center gap-6 group"
  96.       href="{{content.swipeSectionMoreLink}}"
  97.       fade
  98.       fade-trigger="scroll">
  99.       <span>
  100.         {{content.swipeSectionMoreLinkText}}
  101.       </span>
  102.       <svg class="w-6 md:w-9 group-hover:translate-x-3 duration-300 ease-basic-ease"
  103.         viewBox="0 0 37 14">
  104.         <use xlink:href="#arrow-next"></use>
  105.       </svg>
  106.     </a>
  107.   </div>
  108.   {% endif %}
  109. </section>