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

Open in your IDE?
  1. {% set types = ['All projects', 'Ongoing', 'Coming', 'Completed']
  2. %}
  3. {% import "./macros_typography.html.twig" as macrosTypography %}
  4. {% import "./macros_button.html.twig" as macrosButton %}
  5. <section class="projects-section py-12"
  6.   section-shade="dark">
  7.   <div class="big-container">
  8.     <nav>
  9.       <ul class="projects-type-wrapp flex flex-wrap gap-x-4 gap-y-5">
  10.         {% for type in types %}
  11.         <li fade
  12.           fade-trigger="none">
  13.           <button class="project-type-btn {{loop.first ? 'active'}}"
  14.             type="{{loop.first ? '' : type|lower|replace({' ': '_'}) }}">
  15.             <svg>
  16.               <use xlink:href="#icon-check"></use>
  17.             </svg>
  18.             {{type}}
  19.           </button>
  20.         </li>
  21.         {% endfor %}
  22.       </ul>
  23.     </nav>
  24.     <div class="grid md:grid-cols-2 2xl:grid-cols-3 gap-x-8 gap-y-10 md:gap-y-28 mt-12">
  25.       {% for project in content.projects %}
  26.       <div class="project-item grid grid-rows-[auto_1fr]"
  27.         type="{{ project.projectType|lower|replace({' ': '_'}) }}"
  28.         fade
  29.         fade-trigger="none">
  30.         <div class="relative overflow-hidden">
  31.           {% if project.projectType %}
  32.           <div class="absolute top-4 left-4 bg-white rounded-full py-2 px-6 text-blue text-sm z-10">
  33.             {{project.projectType}}
  34.           </div>
  35.           {% endif %}
  36.           <div
  37.             class="project-item__img h-[50vh] min-h-[310px] max-h-[310px] lg:max-h-[450px] scale-110 img-clip select-none">
  38.             {# image size 720x840 #}
  39.             {% if project.image|length > 0 %}
  40.             {% set image = project.image.thumbnails['720x840'] %}
  41.             <img src="{{ image }}"
  42.               width="100"
  43.               height="450px"
  44.               alt="{{project.title}}"
  45.               loading="lazy">
  46.             {% endif %}
  47.             {% if project.image|length > 0 %}
  48.             {% set image = project.image.thumbnails['720x840'] %}
  49.             <img src="{{ image }}"
  50.               width="100"
  51.               height="450px"
  52.               alt="{{project.title}}"
  53.               loading="lazy">
  54.             {% endif %}
  55.           </div>
  56.         </div>
  57.         <div class="project-item__content relative flex flex-col pt-4 md:pt-10 bg-blue text-white group">
  58.           <a class="absolute inset-0 text-[0px] z-10"
  59.             href="{{ sulu_content_path(project.url) }}">{{project.title}}</a>
  60.           {% if project.location %}
  61.           <div class="project-item__eyebrow text-sm w-10/12"
  62.             split-directon="bottom"
  63.             split-trigger="none">
  64.             <span>{{project.location}}</span>
  65.             {% if project.area %}
  66.             <span class="inline-block px-2 opacity-50">•</span>
  67.             <span>{{project.area}}m<sup>2</sup>
  68.             </span>
  69.             {% endif %}
  70.             {% if project.rooms %}
  71.             <span class="inline-block px-2 opacity-50">•</span>
  72.             <span>{{project.rooms}}
  73.             </span>
  74.             {% endif %}
  75.           </div>
  76.           {% endif %}
  77.           <h2 class="project-item__title h3 w-10/12 mt-3 group-hover:underline duration-300"
  78.             split-diretion="bottom"
  79.             split-trigger="none">{{project.title}}</h2>
  80.           {{macrosButton.arrowDiagonal({
  81.           'class': 'project-item__arrow !absolute bottom-0 right-0',
  82.           'withoutAnimate': true
  83.           })
  84.           }}
  85.         </div>
  86.       </div>
  87.       {% endfor %}
  88.     </div>
  89.     
  90.     {% include "./partials/layout/pagination.html.twig" with {
  91.     'class' : 'white mt-14 md:mt-24'
  92.     } %}
  93.   </div>
  94. </section>