|
//A compoent which would be included, embeded or part of a twig template that would mostly be a reusbale design module throughot the website, this might be driven via a mtrix block or standard content block in the CMS. |
|
//Abridged version of my layout twig file foucussing on the javscaript includes. |
|
|
|
{# ------------------------------------------------------------------- #} |
|
{# CAROUSEL #} |
|
{# ------------------------------------------------------------------- #} |
|
<div class="swiper-container js-swiper-projects w-full h-full relative"> |
|
<div class="swiper-wrapper"> |
|
{% for entry in caseStudies %} |
|
{% set lazyload = loop.first ? 0 : 1 %} |
|
<div class="swiper-slide flex w-full h-auto pb-12"> |
|
<div class="w-full h-auto"> |
|
<div class="bg-black absolute inset-x-0 w-full h-full z-20 opacity-50"></div> |
|
<div class="absolute inset-x-0 w-full h-full z-10"> |
|
{% include '_includes/_partials/image-blurred.twig' with { image: entry.headlineImages[0], lazyLoad: lazyload } %} |
|
</div> |
|
|
|
{% if entry.relatedAwards|length %} |
|
<div class="absolute"> |
|
<div class="mt-6 lg:mt-12 bg-white max-w-md relative z-30 py-2 pr-4 text-right pl-12 //// carousel__award"> |
|
<div class="flex items-center justify-end text-yellow-600"> |
|
{{ svg('@icons/star-full.svg', class="w-5 h-5 flex-shrink-0 fill-current mr-2") }} |
|
<h3 class="mb-0 text-16">Award Winning Project</h3> |
|
</div> |
|
</div> |
|
</div> |
|
{% endif %} |
|
|
|
<div class="block md:hidden relative z-20 // fade-in-top"> |
|
{% include |
|
'_includes/_components/image.twig' with { |
|
image:entry.headlineImages[0], |
|
transform: '16x12', |
|
classes: 'w-full', |
|
widths: [1536, 1200, 1000, 768, 600, 500, 352, 176], |
|
srcWidth: 768, |
|
sizes:'(min-width:1024px) 50vw, 100vw', |
|
lazyLoad: lazyload |
|
} %} |
|
</div> |
|
|
|
|
|
<div class="container // p-6 md:p-12 md:flex md:items-center relative z-20 md:pt-24 lg:pt-12"> |
|
<div class="md:w-1/2 text-white md:pr-12"> |
|
<div class="max-w-xl mb-12 /// carousel__copy"> |
|
<h3 class="uppercase font-black text-white text-21 mb-3 md:hidden">{{ entry.title }}</h3> |
|
{{ entry.teaserBody }} |
|
</div> |
|
|
|
<div class="pl-3"> |
|
{% macro feature(label, handle) %} |
|
{%- if handle|length -%} |
|
<li class="pr-6 mb-6 text-white text-14 //// w-1/2"> |
|
<span class="uppercase text-12 font-black block mb-0"> |
|
{{ label }} |
|
</span> |
|
{{ handle }} |
|
</li> |
|
{%- endif -%} |
|
{% endmacro %} |
|
|
|
<ul class="flex flex-wrap mb-12 // carousel__features"> |
|
{{ _self.feature('Value', entry.projectValue) }} |
|
{{ _self.feature('Duration', entry.projectDuration) }} |
|
{{ _self.feature('Location', entry.projectLocation) }} |
|
</ul> |
|
|
|
<a href="{{ entry.url() }}" class="text-white flex justify-between items-center border-b border-white pb-1 max-w-200 /// carousel__link mb-6 lg:mb-0"> |
|
Read Case Study |
|
{% include '_includes/_partials/link-arrow.twig' %} |
|
</a> |
|
</div> |
|
</div> |
|
|
|
<div class="hidden md:block md:w-1/2 overflow-hidden"> |
|
<article class="border border-white-alpha-50 p-4 max-w-xl /// carousel__card"> |
|
<div class=""> |
|
{% include |
|
'_includes/_components/image.twig' with { |
|
image:entry.headlineImages[0], |
|
transform: '16x12', |
|
classes: 'w-full', |
|
widths: [1536, 1200, 1000, 768, 600, 500, 352, 176], |
|
srcWidth: 600, |
|
sizes:'50vw', |
|
lazyLoad: lazyload |
|
} %} |
|
</div> |
|
<div class="bg-white-alpha-80 text-gray-700 p-6 //"> |
|
<div class="carousel__card__content"> |
|
<h3 class="uppercase font-black text-lime-700 text-21 mb-3">{{ entry.title }}</h3> |
|
<p> |
|
Holland Park Villas is a high end private gated residential development of 68 apartments and 4 penthouses, with two acres of private landscaped grounds… |
|
</p> |
|
|
|
<a href="{{ entry.url() }}" class="text-lime-700 flex justify-between items-center border-b border-lime-700 pb-1 max-w-200"> |
|
View Project |
|
{% include '_includes/_partials/link-arrow.twig' %} |
|
</a> |
|
</div> |
|
</div> |
|
</article> |
|
</div> |
|
</div> |
|
</div> |
|
</div> |
|
{% endfor %} |
|
</div> |
|
<!-- If we need pagination --> |
|
<div class="swiper-pagination"></div> |
|
|
|
<!-- If we need navigation buttons --> |
|
{% set btnClasses %} |
|
text-white // p-1 w-12 h-12 // flex flex-col items-end items-center justify-center // to-lg:top-auto to-lg:bottom-0 to-lg:bg-gray-900 hover:bg-lime-500 |
|
{% endset %} |
|
|
|
<div class="swiper-button-prev {{ btnClasses }} to-lg:-ml-3"> |
|
{{ svg('@icons/arrow-thin-left.svg', class="w-6 h-6 fill-current") }} |
|
</div> |
|
<div class="swiper-button-next {{ btnClasses }} to-lg:-mr-3"> |
|
{{ svg('@icons/arrow-thin-right.svg', class="w-6 h-6 fill-current") }} |
|
</div> |
|
|
|
</div> |
|
|
|
|
|
{% js %} |
|
var swiperProjects = new Swiper('.js-swiper-projects', { |
|
// Optional parameters |
|
loop: true, |
|
autoplay: { |
|
delay: 5000, |
|
stopOnLastSlide: true, |
|
disableOnInteraction: true |
|
}, |
|
centeredSlides: true, |
|
speed: 600, |
|
effect: 'fade', |
|
|
|
// If we need pagination |
|
pagination: { |
|
el: '.swiper-pagination', |
|
// bulletElement: 'li', |
|
clickable: true, |
|
}, |
|
|
|
// Navigation arrows |
|
navigation: { |
|
nextEl: '.swiper-button-next', |
|
prevEl: '.swiper-button-prev', |
|
}, |
|
}); |
|
{% endjs %} |