{# ------------------------------------------------------------------------ #}
{# ----------------------------- PARAMÉTRAGES ----------------------------- #}
{# ------------------------------------------------------------------------ #}
{% set carouselId = 'hero-section-' ~ random() %}
{# Booléens #}
{% set isArrows = heroSection.isArrows|default(false) %}
{% set isSwitchSlideTime = heroSection.isSwitchSlideTime|default(false) %}
{% set isDynamicButton = heroSection.isDynamicButton|default(false) %}
{% set isDynamicButtonArrow = heroSection.isDynamicButtonArrow|default(true) %}
{% set isDynamicButtonBorder = heroSection.isDynamicButtonBorder|default(false) %}
{# --- Paramètres du carousel --- #}
{% set carouselContainerStyles = {
'border-radius': heroSection.bordersRadius|default(0) ~ heroSection.bordersRadiusUnit|default('px'),
}%}
{% set carouselSlideStyles = {
'height' : heroSection.height|default(400) ~ heroSection.heightUnit|default('px'),
'--content-margin': -(heroSection.bordersRadius|default(0) * 2) ~ heroSection.bordersRadiusUnit|default('px')
} %}
{% set carouselContentStyles = {
'background-size' : heroSection.thumbnailBackgroundSize|default('cover'),
'background-position' : heroSection.thumbnailBackgroundPosition|default('center'),
'margin-right': -(heroSection.bordersRadius|default(0) * 2) ~ heroSection.bordersRadiusUnit|default('px')
} %}
{% set carouselTitleStyles = {
'font-weight' : '700',
'line-height' : 'normal'
} %}
{% set carouselLineStyles = {
'gap': heroSection.gapElements|default(0) ~ heroSection.gapElementsUnit|default('px'),
} %}
{# Flèches #}
{% set carouselArrowsStyles = {
'height' : heroSection.height|default(400) ~ heroSection.heightUnit|default('px'),
} %}
{% set carouselArrowStyles = {
'color' : heroSection.arrowsColor|default('#000000'),
} %}
{# Bouton dynamique #}
{% set carouselDynamicButtonStyles = {
'display' : 'inline-flex',
'align-items': 'center',
'padding' : heroSection.dynamicButtonPaddingTopBottom|default(4) ~ heroSection.dynamicButtonPaddingTopBottomUnit|default('px') ~ ' ' ~ heroSection.dynamicButtonPaddingRightLeft|default(4) ~ heroSection.dynamicButtonPaddingRightLeftUnit|default('px'),
'background' : heroSection.dynamicButtonBackground|default('#FFFFFF'),
'color' : heroSection.dynamicButtonTextColor|default('#005474'),
'border-radius' : heroSection.dynamicButtonBorderRadius|default(8) ~ heroSection.dynamicButtonBorderRadiusUnit|default('px'),
'border' : heroSection.isDynamicButtonBorder == true ? heroSection.dynamicButtonBorderSize|default(1) ~ heroSection.dynamicButtonBorderSizeUnit|default('px') ~ ' solid ' ~ heroSection.dynamicButtonBorderColor|default('#005474') : 'none',
}%}
{% set carouselDynamicButtonHoverStyles = {
'background' : heroSection.dynamicButtonTextColor|default('#005474'),
'color' : heroSection.dynamicButtonBackground|default('#FFFFFF'),
}%}
{% set carouselDynamicButtonPriceStyles = {
'color' : heroSection.dynamicButtonPriceColor|default('#000'),
} %}
{# Dots #}
{% set carouselDotsActiveBeforeStyles = {
'background' : 'linear-gradient(90deg, ' ~ heroSection.dotColor1|default('#004461') ~ ', ' ~ heroSection.dotColor2|default('#00AAD7') ~ ')',
}%}
{# Fond des étiquettes via ::after #}
{% set labelBgColor = heroSection.thumbnailLabelBackground|default('#000000') %}
{% set labelBgOpacity = heroSection.thumbnailLabelBackgroundOpacity|default(70) %}
{% set labelElementOpacity = heroSection.thumbnailLabelOpacity|default(100) %}
{% set labelBorderRadius = heroSection.thumbnailTextBorderRadius|default(20) %}
{# Filtre pour les vignettes non actives #}
{% set inactiveFilter = heroSection.thumbnailInactiveFilter|default('grayscale') %}
{% set filterIntensity = heroSection.thumbnailInactiveFilterIntensity|default(50) %}
{% set overlayColor = heroSection.thumbnailInactiveOverlayColor|default('#000000') %}
{% set mainColorButton = heroSection.mainColorButton|default('#004461') %}
{% set secondaryColorButton = heroSection.secondaryColorButton|default('#fff') %}
{% set bordersRadiusButton = heroSection.bordersRadiusButton|default(8) %}
{% set bordersRadiusButtonUnit = heroSection.bordersRadiusButtonUnit|default('px') %}
{% set paddingSizeLeftRightButton = heroSection.paddingSizeLeftRightButton|default(4) %}
{% set paddingSizeTopBottomButton = heroSection.paddingSizeTopBottomButton|default(4) %}
{% set paddingButtonUnit = heroSection.paddingButtonUnit|default('px') %}
{% set switchSlideTime = (isSwitchSlideTime and heroSection.switchSlideTime is not null and heroSection.switchSlideTime != 0 ? heroSection.switchSlideTime * 1000 : 5000) %}
{# Paramètres des vignettes #}
{% set showThumbnails = heroSection.showThumbnails|default(false) %}
{% set thumbnailWidth = heroSection.thumbnailWidth|default(120) %}
{% set thumbnailHeight = heroSection.thumbnailHeight|default(80) %}
{% set thumbnailGap = heroSection.thumbnailGap|default(10) %}
{% set thumbnailBorderRadius = heroSection.thumbnailBorderRadius|default(8) %}
{% set thumbnailActiveBorderColor = heroSection.thumbnailActiveBorderColor|default('#8B5CF6') %}
{% set thumbnailActiveBorderWidth = heroSection.thumbnailActiveBorderWidth|default(3) %}
{# Paramètres du bouton dynamique #}
{% set dynamicButton = {
'dynamicButtonText': heroSection.dynamicButtonText|default('hero_section.dynamic_button_discover'|trans),
'dynamicButtonTextColor': heroSection.dynamicButtonTextColor|default('#fff'),
'dynamicButtonBackground': heroSection.dynamicButtonBackground|default('#004461'),
'dynamicButtonPriceColor': heroSection.dynamicButtonPriceColor|default('#000'),
'dynamicButtonArrowColor': heroSection.dynamicButtonArrowColor|default('#fff'),
'dynamicButtonBorderRadius': heroSection.dynamicButtonBorderRadius|default(8),
'dynamicButtonBorderRadiusUnit': heroSection.dynamicButtonBorderRadiusUnit|default('px'),
'dynamicButtonPaddingRightLeft': heroSection.dynamicButtonPaddingRightLeft|default(4),
'dynamicButtonPaddingRightLeftUnit': heroSection.dynamicButtonPaddingRightLeftUnit|default('px'),
'dynamicButtonPaddingTopBottom': heroSection.dynamicButtonPaddingTopBottom|default(4),
'dynamicButtonPaddingTopBottomUnit': heroSection.dynamicButtonPaddingTopBottomUnit|default('px'),
'dynamicButtonBorderSize': heroSection.dynamicButtonBorderSize|default(1),
'dynamicButtonBorderSizeUnit': heroSection.dynamicButtonBorderSizeUnit|default('px'),
'dynamicButtonBorderColor': heroSection.dynamicButtonBorderColor|default('#fff')
} %}
{% set carouselContentTagsDivContentTagStyles = {
'color' : heroSection.tagsColor|default('#000'),
'font-weight' : heroSection.tagsFontWeight|default(600),
'text-align' : heroSection.tagsTextAlign|default('left'),
'padding' : heroSection.tagsPaddingTopBottom|default(3) ~ heroSection.tagsPaddingTopBottomUnit|default('px') ~ ' ' ~ heroSection.tagsPaddingRightLeft|default(6) ~ heroSection.tagsPaddingRightLeftUnit|default('px'),
'border-radius' : heroSection.tagsBorderRadius|default(12) ~ heroSection.tagsBorderRadiusUnit|default('px'),
'font-size' : heroSection.tagsFontSize|default(10) ~ heroSection.tagsFontSizeUnit|default('px'),
'background' : heroSection.tagsBackgroundColor|default('rgba(217, 217, 217, 0.20)'),
} %}
{# Paramètres du fond du contenu #}
{% set backgroundBlur = heroSection.backgroundBlur|default(0) %}
{% set isBackgroundFilter = heroSection.isBackgroundFilter|default(false) %}
{% set backgroundFilterColor = isBackgroundFilter == true ? heroSection.backgroundFilterColor|default('#000000') : '#000000' %}
{% set backgroundFilterOpacity = isBackgroundFilter == true ? heroSection.backgroundFilterOpacity|default(0.4) : 0 %}
{% set carouselContentBeforeStyles = {
'background' : backgroundFilterColor | hex_to_rgba(backgroundFilterOpacity),
} %}
{# Paramètres des prix et durées #}
{% set badgesStyles = {
'border-radius' : heroSection.badgesBorderRadius|default(6) ~ heroSection.badgesBorderRadiusUnit|default('px'),
'padding' : heroSection.badgesPaddingTopBottom|default(3) ~ heroSection.badgesPaddingTopBottomUnit|default('px') ~ ' ' ~ heroSection.badgesPaddingRightLeft|default(6) ~ heroSection.badgesPaddingRightLeftUnit|default('px'),
'font-weight' : heroSection.badgesFontWeight|default(600),
'font-size' : heroSection.badgesFontSize|default(1) ~ heroSection.badgesFontSizeUnit|default('rem'),
'background-color' : heroSection.badgesBackgroundColor|default('#FF5C00'),
'color' : heroSection.badgesColor|default('#FFFFFF'),
'margin' : 'auto ' ~ heroSection.badgesMarginRightLeft|default(3) ~ heroSection.badgesMarginRightLeftUnit|default('px'),
}%}
{# Paramètres des logos #}
{% set logosStyles = {
'max-width' : heroSection.logoWidth|default(60) ~ heroSection.logoWidthUnit|default('px'),
'max-height' : heroSection.logoHeight|default(60) ~ heroSection.logoHeightUnit|default('px'),
} %}
{# Durée de l'animation entre deux slides #}
{% set animation = {
'contentDuration' : heroSection.animationContentDuration|default(0),
'contentDelay' : heroSection.animationContentDelay|default(0) ,
'mediaDuration' : heroSection.animationMediaDuration|default(0),
'mediaDelay' : heroSection.animationMediaDelay|default(0),
}%}
{# Collecter les styles mobile pour les carousel-text #}
{% set mobileStyles = [] %}
{% set globalTextIndex = 0 %}
{# Paramètres de la légende #}
{% set legendStyles = {
'color' : heroSection.legendColor|default('#000'),
'font-size' : heroSection.legendFontSize|default(1) ~ heroSection.legendFontSizeUnit|default('rem'),
'font-weight' : heroSection.legendFontWeight|default(600),
'text-align' : heroSection.legendAlign|default('left'),
'padding' : heroSection.legendPaddingTop|default(3) ~ heroSection.legendPaddingTopBottomUnit|default('px') ~ ' 0 ' ~ heroSection.legendPaddingBottom|default(3) ~ heroSection.legendPaddingBottomUnit|default('px') ~ ' 0',
} %}
{# Première slide hero : URL pour <link rel="preload"> (LCP) #}
{% set firstHeroSlideEntity = (slidesByType['hero-section']|default([]))|first %}
{% set heroLcpPreloadHref = null %}
{% if firstHeroSlideEntity %}
{% set se0 = firstHeroSlideEntity.elements ?? [] %}
{% set med0 = null %}
{% if firstHeroSlideEntity.mediaUrl is not empty %}
{% set med0 = {'url': firstHeroSlideEntity.mediaUrl, 'thumbnails': {'800x': firstHeroSlideEntity.mediaUrl, '1200x': firstHeroSlideEntity.mediaUrl}, 'isVideo': firstHeroSlideEntity.isVideo} %}
{% elseif se0.media is defined and se0.media.id is defined %}
{% set med0 = sulu_resolve_media(se0.media.id, app.request.locale) %}
{% endif %}
{% if med0 is not null %}
{% set mUrl0 = med0.url %}
{% set isVid0 = med0.isVideo is defined ? med0.isVideo : (mUrl0 matches '/\.mp4(\\?.*)?$/' or mUrl0 matches '/\.webm(\\?.*)?$/' or mUrl0 matches '/\.ogg(\\?.*)?$/') %}
{% if not isVid0 %}
{% set heroLcpPreloadHref = sulu_media_url(med0, '1200x') %}
{% else %}
{% set poster0 = sulu_media_url(med0, '1200x') %}
{% if poster0 and not (poster0 matches '/\.(mp4|webm|ogg)(\\?.*)?$/i') %}
{% set heroLcpPreloadHref = poster0 %}
{% endif %}
{% endif %}
{% endif %}
{% endif %}
{% if true %}
{% if heroSection.isLegend == true and heroSection.legend is not empty and mode is not defined or mode != 'mobile' %}
<div class="carousel-legend carousel-legend-{{ carouselId }}" carousel-id="{{ carouselId }}">
<h1 class="carousel-legend-content carousel-legend-{{ carouselId }}">
{{ heroSection.legend }}
</h1>
</div>
{% endif %}
<div class="carousel-wrapper"
data-type="heroSection"
id="{{ carouselId }}"
data-carousel-id="{{ carouselId }}"
data-carousel-options='{{ {
"showDots": heroSection.showDots|default(false),
"showThumbnails": showThumbnails,
"isAutoSlide": isSwitchSlideTime,
"animation": animation
}|json_encode|raw }}'
style="--switch-slide-time: {{ switchSlideTime }}ms;">
{% if heroLcpPreloadHref %}
<link rel="preload" as="image" href="{{ heroLcpPreloadHref }}" fetchpriority="high">
{% endif %}
<div class="carousel-container">
<div class="carousel" data-observed>
{% for slideEntity in slidesByType['hero-section'] ?? [] %}
{# ============================================================ #}
{# RECONSTRUCTION DE LA STRUCTURE SLIDE DEPUIS L'ENTITÉ SLIDE #}
{# ============================================================ #}
{# Extraire les données de l'entité Slide #}
{% set slideElements = slideEntity.elements ?? [] %}
{% set slideStyles = slideEntity.styles ?? {} %}
{# Gestion du média : mediaUrl de l'entité ou depuis elements #}
{% set media = null %}
{% if slideEntity.mediaUrl is not empty %}
{% set media = {'url': slideEntity.mediaUrl, 'thumbnails': {'800x': slideEntity.mediaUrl}, 'isVideo': slideEntity.isVideo} %}
{% elseif slideElements.media is defined and slideElements.media.id is defined %}
{% set media = sulu_resolve_media(slideElements.media.id, app.request.locale) %}
{% endif %}
{% if media is not null %}
{% set mediaUrl = sulu_media_original_url(media) %}
{% set mediaPoster = sulu_media_url(media, '1200x') %}
{% set mediaThumb800 = sulu_media_url(media, '800x') %}
{% set mediaThumb1200 = sulu_media_url(media, '1200x') %}
{% set mediaThumb1920 = sulu_media_url(media, '1600x') %}
{# Utiliser isVideo depuis la base de données si disponible, sinon deviner depuis l'extension #}
{% set isVideo = media.isVideo is defined ? media.isVideo : (mediaUrl matches '/\.mp4(\\?.*)?$/' or mediaUrl matches '/\.webm(\\?.*)?$/' or mediaUrl matches '/\.ogg(\\?.*)?$/') %}
{% else %}
{% set mediaUrl = '' %}
{% set mediaPoster = '' %}
{% set mediaThumb800 = null %}
{% set mediaThumb1200 = null %}
{% set mediaThumb1920 = null %}
{% set isVideo = false %}
{% endif %}
{# Reconstruire la structure slide complète #}
{% set slide = {
'media': media,
'title': slideEntity.subtitle ?? '',
'isColorGradient': slideStyles.isColorGradient ?? false,
'isCustomBackgroundFilter': slideStyles.isCustomBackgroundFilter ?? false,
'customBackgroundFilterColor': slideStyles.customBackgroundFilterColor ?? '#000000',
'customBackgroundFilterOpacity': slideStyles.customBackgroundFilterOpacity ?? 40,
'gradientOrientation': slideStyles.gradientOrientation ?? 'leftRight',
'color1': slideStyles.color1 ?? '#fff',
'color1Opacity': slideStyles.color1Opacity ?? 100,
'color2': slideStyles.color2 ?? '#000',
'color2Opacity': slideStyles.color2Opacity ?? 100,
'isCommonCompanySelector': slideEntity.companyId is not empty,
'CommonCompanySelector': slideEntity.companyId ?? '',
'companyCustomLogo': slideElements.companyCustomLogo ?? null,
'isDestinationSelector': false,
'destinationSelector': '',
'destinationCustomName': '',
'contents': slideElements is iterable ? slideElements : [],
'isNoCustom': false,
'isCustomDuration': false,
'customDuration': '',
'isCustomPrice': false,
'customPrice': '',
'advicedDuration': slideEntity.subtitle ?? '',
'advicedPeriod': '',
'bonusTexts': []
} %}
{# Définir le nom de la destination au début du slide #}
{% set destinationName = '' %}
{% if slide.isDestinationSelector and slide.destinationCustomName is not empty %}
{% set destinationName = slide.destinationCustomName %}
{% elseif slide.isDestinationSelector and slide.destinationSelector is not empty %}
{% set destinationName = 'Destination' %}
{% endif %}
{% set isFullSize = slideStyles.fullSize|default(false) %}
{% set slideHref = '' %}
{% set slideOpensNewTab = false %}
{% for element in slide.contents %}
{% if slideHref == '' and element.type is defined and element.type == 'button' %}
{% set candidateUrl = (element.url ?? '')|trim %}
{% if candidateUrl is not empty and candidateUrl != '#' %}
{% set slideHref = candidateUrl %}
{% set slideOpensNewTab = element.hasNewTab|default(false) %}
{% endif %}
{% endif %}
{% endfor %}
<div class="carousel-slide{% if slideHref %} is-linked{% endif %}{% if isFullSize %} is-full-size{% endif %}"
id="slide-{{ carouselId }}-{{ loop.index0 }}"
{% if slideHref %}
data-slide-href="{{ slideHref|e('html_attr') }}"
{% if slideOpensNewTab %}data-slide-target="_blank"{% endif %}
{% endif %}>
{# Media - toujours affiché, même avec gradient #}
{% if isVideo %}
<video class="carousel-media"
autoplay muted loop playsinline
preload="metadata"
poster="{{ mediaPoster }}"
{% if loop.first %}fetchpriority="high"{% endif %}>
<source src="{{ mediaUrl }}" type="video/mp4">
<p>{{ 'carousel.destination.video_not_supported'|trans }}</p>
</video>
{% else %}
{% set isHeroLcpImage = loop.first and mediaPoster is not empty %}
<img class="carousel-media{{ isHeroLcpImage ? ' carousel-media--lcp' : '' }}"
src="{{ mediaPoster }}"
{% if mediaThumb800 and mediaThumb1200 and mediaThumb800 != mediaThumb1200 %}
srcset="{{ mediaThumb800 }} 800w{% if mediaThumb1200 %}, {{ mediaThumb1200 }} 1200w{% endif %}{% if mediaThumb1920 %}, {{ mediaThumb1920 }} 1920w{% endif %}"
sizes="100vw"
{% elseif mediaThumb800 %}
srcset="{{ mediaThumb800 }} 800w"
sizes="100vw"
{% endif %}
alt="{{ slide.title|default('')|striptags|e('html_attr') }}"
decoding="async"
{% if isHeroLcpImage %}
fetchpriority="high"
{% else %}
loading="lazy" fetchpriority="low"
{% endif %}>
{% endif %}
{% if isFullSize and slideHref %}
<a class="carousel-slide-link"
href="{{ slideHref }}"
{% if slideOpensNewTab %}target="_blank" rel="noopener"{% endif %}
aria-label="{{ slide.title|default('')|striptags|e('html_attr') }}"></a>
{% endif %}
{% if not isFullSize %}
<div class="carousel-content {% if slide.isColorGradient %}color-gradient{% endif %}">
{# Image de fond avec filtre blur ou gradient selon la configuration #}
{% if slide.isColorGradient %}
{% set gradientDirections = {
'leftRight': 'to right',
'rightLeft': 'to left',
'topBottom': 'to bottom',
'bottomTop': 'to top',
'topLeftBottomRight': 'to bottom right',
'bottomLeftTopRight': 'to top right',
'topRightBottomLeft': 'to bottom left',
'bottomRightTopLeft': 'to top left'
} %}
{% set gradientDirection = gradientDirections[slide.gradientOrientation] %}
<div class="background-blur" style="
background: linear-gradient({{ gradientDirection }}, {{ slide.color1|hex_to_rgba(slide.color1Opacity) }}, {{ slide.color2|hex_to_rgba(slide.color2Opacity) }});
"></div>
{% else %}
{% if isVideo %}
<div class="background-blur" style="
filter: blur({{ backgroundBlur > 0 ? backgroundBlur : 40 }}px);
">
<canvas class="video-background-canvas"
data-video-url="{{ mediaUrl }}">
</canvas>
</div>
{% else %}
<div class="background-blur" style="
background-image: url('{{ mediaPoster }}');
filter: blur({{ backgroundBlur > 0 ? backgroundBlur : 40 }}px);
"></div>
{% endif %}
{% endif %}
{# Contenu sans filtre blur #}
<div class="line" style="position: relative; z-index: 1;">
{# Affichage du logo de la compagnie si sélectionnée #}
{% if slide.isCommonCompanySelector and slide.CommonCompanySelector is not empty %}
<div class="content-company-logo">
{% if slide.companyCustomLogo is not empty and slide.companyCustomLogo.url is defined %}
<img src="{{ slide.companyCustomLogo.url }}" alt="Logo compagnie">
{% else %}
{% set companyLogo = get_company_logo_by_id(slide.CommonCompanySelector) %}
{% if companyLogo is not empty %}
<img src="{{ companyLogo }}" alt="Logo compagnie">
{% endif %}
{% endif %}
</div>
{% endif %}
{# Parcourir les éléments dans l'ordre selon slide.elements #}
<div class="carousel-title">{{ slide.title|replace_slide_offer_variables(slideEntity.offerId)|raw }}</div>
{% for element in slide.contents %}
{# Type : text - Afficher un texte simple #}
{% if element.type == 'text' %}
<div class="carousel-text">{{ element.content|replace_slide_offer_variables(slideEntity.offerId)|raw }}</div>
{# Type : button - Afficher un bouton avec style comme classe CSS #}
{% elseif element.type == 'button' %}
{% set buttonText = (element.text ?? '')|replace_slide_offer_variables(slideEntity.offerId) %}
{% set buttonUrl = element.url ?? '#' %}
{% set buttonStyle = element.style ?? 'style1' %}
{% set buttonSize = element.size|default('medium') %}
{% set hasArrow = element.hasArrow|default(false) %}
{% set hasNewTab = element.hasNewTab|default(false) %}
<div class="carousel-button-wrapper">
<a href="{{ buttonUrl }}"
class="btn {{ buttonStyle }} {{ buttonSize }} reverse_color"
{% if hasNewTab %}target="_blank" rel="noopener"{% endif %}>
{{ buttonText }}
{% if hasArrow %}{{ getLucidIcon('arrow-right') }}{% endif %}
</a>
</div>
{# Type : image - Afficher une image #}
{% elseif element.type == 'image' %}
<div class="carousel-image">
<img src="{{ sulu_media_url(element.content, '1200x') }}"
alt="{{ element.alt ?? '' }}"
loading="lazy"
style="{% if element.width is defined %}width: {{ element.width }}px;{% endif %}{% if element.height is defined %} height: {{ element.height }}px;{% endif %}">
</div>
{% endif %}
{% endfor %}
</div>
</div>
{% endif %}
</div>
{% endfor %}
</div>
</div>
{# Dots #}
{% if heroSection.showDots|default(false) %}
<div class="carousel-dots">
{% for slideEntity in slidesByType['hero-section'] ?? [] %}
<span class="dot {% if loop.first %}active{% endif %}"
data-index="{{ loop.index0 }}"
data-carousel-id="{{ carouselId }}"></span>
{% endfor %}
</div>
{% endif %}
{# Flèches #}
{% if isArrows %}
<div class="carousel-arrows">
<button class="carousel-arrow left" aria-label="{{ 'common.previous'|trans }}" data-carousel-id="{{ carouselId }}">{{ getLucidIcon('chevron-left') }}</button>
<button class="carousel-arrow right" aria-label="{{ 'common.next'|trans }}" data-carousel-id="{{ carouselId }}">{{ getLucidIcon('chevron-right') }}</button>
</div>
{% endif %}
</div>
{% endif %}
{# Le JavaScript du carousel est maintenant géré par assets/website/js/snippets/hero-section.js #}
<!-- Styles dynamiques -->
<style>
{% if heroSection.isLegend == true and heroSection.legend is not empty and mode is not defined or mode != 'mobile' %}
h1.carousel-legend-{{ carouselId }}, .carousel-legend-{{ carouselId }}{
{{ legendStyles|map((value, key) => key ~ ':' ~ value)|join('; ') }};
}
{% endif %}
#{{ carouselId }} .carousel-container {
{{ carouselContainerStyles|map((value, key) => key ~ ':' ~ value)|join('; ') }};
}
#{{ carouselId }} .carousel-slide {
{{ carouselSlideStyles|map((value, key) => key ~ ':' ~ value)|join('; ') }};
}
#{{ carouselId }} .carousel-title {
{{ carouselTitleStyles|map((value, key) => key ~ ':' ~ value)|join('; ') }};
}
#{{ carouselId }} .dynamic-button {
{{ carouselDynamicButtonStyles|map((value, key) => key ~ ':' ~ value)|join('; ') }};
}
#{{ carouselId }} .dynamic-button svg {
color: {{ heroSection.dynamicButtonArrowColor|default('inherit') }};
}
#{{ carouselId }} .dynamic-button .price {
{{ carouselDynamicButtonPriceStyles|map((value, key) => key ~ ':' ~ value)|join('; ') }};
}
#{{ carouselId }} .carousel-content {
{{ carouselContentStyles|map((value, key) => key ~ ':' ~ value)|join('; ') }};
}
#{{ carouselId }} .carousel-content:not([class*="color-gradient"])::before {
{{ carouselContentBeforeStyles|map((value, key) => key ~ ':' ~ value)|join('; ') }};
}
{# Styles personnalisés pour les slides avec filtre de fond personnalisé #}
{% for slideEntity in slidesByType['hero-section'] ?? [] %}
{% set slideStyles = slideEntity.styles ?? {} %}
{% if slideStyles.isCustomBackgroundFilter ?? false %}
#{{ carouselId }} #slide-{{ carouselId }}-{{ loop.index0 }} .carousel-content::before {
background: {{ (slideStyles.customBackgroundFilterColor ?? '#000000') | hex_to_rgba(slideStyles.customBackgroundFilterOpacity ?? 40) }};
}
{% endif %}
{% endfor %}
#{{ carouselId }} .carousel .line {
{{ carouselLineStyles|map((value, key) => key ~ ':' ~ value)|join('; ') }};
}
#{{ carouselId }} .dot.active::before {
{{ carouselDotsActiveBeforeStyles|map((value, key) => key ~ ':' ~ value)|join('; ') }};
}
#{{ carouselId }} .carousel-arrows {
{{ carouselArrowsStyles|map((value, key) => key ~ ':' ~ value)|join('; ') }};
}
#{{ carouselId }} .carousel-arrow {
{{ carouselArrowStyles|map((value, key) => key ~ ':' ~ value)|join('; ') }};
}
#{{ carouselId }} .carousel-media, #{{ carouselId }} .carousel-content {
border-radius: {{ heroSection.bordersRadius|default(0) ~ heroSection.bordersRadiusUnit|default('px') }};
}
#{{ carouselId }} .duration-badge, #{{ carouselId }} .price-badge {
{{ badgesStyles|map((value, key) => key ~ ':' ~ value)|join('; ') }};
}
#{{ carouselId }} .content-company-logo {
{{ logosStyles|map((value, key) => key ~ ':' ~ value)|join('; ') }};
}
@media (max-width: 768px) {
#{{ carouselId }} .carousel-slide,
#{{ carouselId }} .carousel-content,
#{{ carouselId }} .carousel .line {
height: auto;
}
#{{ carouselId }} .carousel-media, #{{ carouselId }} .carousel-content {
border-radius: 0;
}
#{{ carouselId }} .carousel-button-wrapper .btn {
width: 100%;
}
}
/* Animations */
@keyframes fillGradient {
0% {
width: 0%;
}
100% {
width: 100%;
}
}
/* Responsive mobile - Réduction des font-size */
@media (max-width: 768px) {
{% for mobileStyle in mobileStyles %}
{{ mobileStyle }}
{% endfor %}
}
</style>