{% set hasImage = editmode || (overrideImage ?? null) || not pimcore_image('image').isEmpty() %}
{% set showReadmoreMobile = pimcore_checkbox("showReadmoreMobile").getData() %}
{% set showReadmore = pimcore_checkbox("showReadmore").getData() %}
{% set hideMediaOnMobile = pimcore_checkbox("hideMediaOnMobile").getData() %}
{% set showRentalFormButton = pimcore_checkbox('showRentalFormButton').getData() %}
{% set showRentalFormButtonColor = pimcore_select('showRentalFormButtonColor').getData() %}
{% set showCustomButtonComment = pimcore_checkbox('showCustomButtonComment').getData() %}
{% set customButtonComment = pimcore_input('customButtonComment').getData() %}
<div class="container grid justify-center grid-cols-1 gap-6 mx-auto text-base md:text-lg md:grid-cols-2">
<div class="
md:flex md:items-center
{% if hasImage %}
{{ pimcore_select('inverted').data ? 'md:order-2 lg:pl-16' : 'md:order-1 lg:pr-16' }}
{% else %}
col-span-1 md:col-span-2
{% endif %}
{{ hideMediaOnMobile ? 'pt-4 md:pt-0' : '' }}
"
x-data="{ contentOpen: false }"
>
<div>
{% include 'areas/content-brick/partials/_headline.html.twig' %}
{% include 'areas/content-brick/partials/_title.html.twig' %}
<div
class="relative overflow-hidden"
{% if showReadMore is defined and showReadMore %}
:class="{'max-h-36 {{ showReadmoreMobile ? 'md:max-h-fit' : ''}}': !contentOpen }"
{% endif %}
>
{% include 'areas/content-brick/partials/_wysiwyg.html.twig' %}
{% if showReadmore %}
<div
class=" flex flex-col justify-end bottom-0 w-full min-h-[100px]
{{ showReadmoreMobile ? 'md:hidden' : ''}}"
:class="!contentOpen ? 'absolute bg-gradient-to-t from-white via-white' : ''"
>
<button
class="button button__secondary group"
@click="contentOpen = !contentOpen"
>
<span x-show="!contentOpen">{{ 'Lees meer' | trans }}</span>
<span x-show="contentOpen">{{ 'Lees minder' | trans }}</span>
<span class="flex items-center justify-center w-6 h-6 ml-3 bg-white rounded-full shadow-md text-blue group-hover:bg-blue group-hover:text-white">
<svg
x-show="!contentOpen"
class="w-3.5 shrink-0"
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 14"><path fill="currentColor" fill-rule="nonzero" d="M6.68 0h.024a.929.929 0 0 1 .916.915l.07 4.994 4.994.07a.93.93 0 0 1 .916.916.878.878 0 0 1-.866.89h-.024l-4.995-.07.07 4.995a.878.878 0 0 1-.89.89.93.93 0 0 1-.915-.916L5.91 7.69.914 7.62A.93.93 0 0 1 0 6.704a.878.878 0 0 1 .89-.89l4.994.07L5.814.89A.878.878 0 0 1 6.68 0Z"/>
</svg>
<svg
x-show="contentOpen"
class="w-3.5 shrink-0"
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 3"><path fill="currentColor" fill-rule="nonzero" d="M12.684.979a.929.929 0 0 1 .916.916.878.878 0 0 1-.866.89h-.024L.915 2.62A.929.929 0 0 1 0 1.704a.878.878 0 0 1 .89-.89l11.794.165Z"/>
</svg>
</span>
</button>
</div>
{% endif %}
</div>
{% if editmode %}
<div class="mt-8">
<label class="block">
{{ pimcore_checkbox('showReadmore', { reload: true }) }}
<span>Toon 'Lees meer' button voor bovenstaande tekst.</span>
</label>
<label class="block">
{{ pimcore_checkbox('showReadmoreMobile', { reload: true }) }}
<span>Toon 'Lees meer' button alleen op mobiele devices.</span>
</label>
</div>
{% endif %}
{% include 'areas/content-brick/partials/_usps.html.twig' %}
{% include 'areas/content-brick/partials/_form-builder.html.twig' with {
'fieldName' : 'formbuilder-select_text-image' }
%}
{% include 'areas/content-brick/partials/_buttons.html.twig' with {
product: product ?? null,
productCategory: productCategory ?? null,
showRentalFormButton: showRentalFormButton ?? null,
showRentalFormButtonColor: showRentalFormButtonColor ?? null,
greenButton: true,
showCustomButtonComment: showCustomButtonComment ?? null,
buttonComment: customButtonComment !== '' ? customButtonComment : 'Binnen één dag vrijblijvend een offerte'|trans
} %}
</div>
</div>
{% if hasImage %}
<div class="md:flex md:items-center
{{ pimcore_select('inverted').data ? 'md:order-1' : 'md:order-2' }}
{{ hideMediaOnMobile ? 'hidden md:block' : '' }}
">
{% if overrideImage is defined and overrideImage and pimcore_image('image').isEmpty() %}
{% include('areas/content-brick/partials/override-image.html.twig') %}
{% else %}
{{ pimcore_image('image', {
class: 'block overflow-hidden rounded-md',
thumbnail: 'content',
pictureAttributes: {class: 'block overflow-hidden rounded-md'}
}) | raw }}
{% endif %}
</div>
{% endif %}
</div>