{% block element_page_listing %}
{% set elongated = element.config.background.value %}
{% set title = element.config.title.value %}
{% set text = element.config.text.value %}
{% set button = element.config.button.value %}
{% set imageSize = ' h-full' %}
{% if element.config.borders.value.left and element.config.borders.value.right %}
{% set corners = ' rounded-t-[272px] ' %}
{% elseif element.config.borders.value.left %}
{% set corners = ' rounded-tl-[272px] ' %}
{% elseif element.config.borders.value.right %}
{% set corners = ' rounded-tr-[272px] ' %}
{% endif %}
<article data-element="{{ element.type }}" class="listing-area listing-area-{{ element.slot }} relative {% if not elongated %}lg:flex lg:flex-col{% endif %}">
{% if elongated %}
{% block element_page_listing_elongated_image_content %}
{% sw_thumbnails 'cms-image-thumbnails' with {
media: element.data.images.image_1_desktop,
attributes: {
'class': 'page-listing-img-desktop object-cover hidden lg:block' ~ corners ~ imageSize,
'alt': (element.data.images.image_1_desktop.alt ?: ''),
'title': (element.data.images.image_1_desktop.title ?: '')
}
} %}
<div class="ratio ratio_1x1 lg:hidden">
{% sw_thumbnails 'cms-image-thumbnails' with {
media: element.data.images.image_2_mobile,
attributes: {
'class': 'page-listing-img-mobile',
'alt': (element.data.images.image_2_mobile.alt ?: ''),
'title': (element.data.images.image_2_mobile.title ?: '')
}
} %}
</div>
{% endblock %}
{% elseif not elongated %}
{% block element_page_listing_default_image_content %}
<div class="ratio {% if block.type == 'triple-page-listing' %}ratio_1x1{% else %}ratio_3x4{% endif %}">
{% sw_thumbnails 'cms-image-thumbnails' with {
media: element.data.images.image_1_desktop,
attributes: {
'class': 'page-listing-img w-auto object-cover' ~ corners ~ imageSize,
'alt': (element.data.images.image_1_desktop.alt ?: ''),
'title': (element.data.images.image_1_desktop.title ?: '')
}
} %}
</div>
{% endblock %}
{% endif %}
{% block element_page_listing_text_content %}
<div class="{% if elongated %}-translate-y-full px-3 pb-3 w-full lg:absolute lg:left-1/2 lg:-translate-x-1/2 lg:bottom-10 lg:pb-0 lg:px-10 lg:translate-y-0 {% else %}mt-10 lg:flex lg:flex-col lg:flex-grow{% endif %}">
{% if title %}
<h2 class="h2 font-light {% if elongated %}text-white{% else %}text-black{% endif %}">
{{ title }}
</h2>
{% endif %}
{% if text %}
<div class="font-light text-base {% if elongated %}text-white{% else %}text-black mt-4 lg:mb-10{% endif %}">
{{ text }}
</div>
{% endif %}
{% if button.active %}
<a role="button"
class="{% if elongated %} btn-link mt-4 text-white text-xs md:text-base{% else %}btn mt-10 lg:mt-auto {{ button.type }}{% endif %}"
href="{{ button.url }}"
{% if button.newtab %}target="_blank"{% endif %}>
{{ button.text }}
</a>
{% endif %}
</div>
{% endblock %}
</article>
{% endblock %}