{% extends '@nucleus/partials/particle.html.twig' %}

{% block stylesheets %}
{% if particle.particle_title_color or particle.particle_title_fontsize or particle.title_color or particle.title_fontsize or particle.customize_content_color or particle.customize_content_fontsize or particle.meta_color or particle.meta_fontsize or (particle.navigation == 'thumbnav' and particle.thumbnav_border_width and particle.thumbnav_border_color and particle.thumbnav_border_color_hover) or particle.slide_color or particle.slide_background or particle.padding_vertical or particle.padding_horizontal or particle.slide_hover_color or particle.slide_hover_background %}
<style>
{% if particle.particle_title_color or particle.particle_title_fontsize %}
#{{ id }}.g5-particle-title { {% if particle.particle_title_color %}color: {{ particle.particle_title_color }};{% endif %}{% if particle.particle_title_fontsize %}font-size: {{particle.particle_title_fontsize}}px;{% endif %} }
{% endif %}
{% if particle.title_color or particle.title_fontsize %}
#{{ id }} .tm-title { {% if particle.title_color %}color: {{particle.title_color}}; {% endif %}{% if particle.title_fontsize %}font-size: {{particle.title_fontsize}}px;{% endif %} }
{% endif %}
{% if particle.customize_content_color or particle.customize_content_fontsize %}
#{{ id }} .tm-content { {% if particle.customize_content_color %}color: {{particle.customize_content_color}};{% endif %}{% if particle.customize_content_fontsize %} font-size: {{particle.customize_content_fontsize}}px;{% endif %} }
{% endif %}
{% if particle.meta_color or particle.meta_fontsize %}
#{{ id }} .tm-meta { {% if particle.meta_color %}color: {{particle.meta_color}};{% endif %}{% if particle.meta_fontsize %} font-size: {{particle.meta_fontsize}}px;{% endif %} }
{% endif %}
{% if particle.navigation == 'thumbnav' and particle.thumbnav_border_width and particle.thumbnav_border_color and particle.thumbnav_border_color_hover %}
#{{ id }} .jl-thumbnav>.jl-active>::after {
    border-color: {{ particle.thumbnav_border_color|e }};
}
#{{ id }} .jl-thumbnav>.jl-active>::after {
    background-color: transparent;
}
#{{ id }} .jl-thumbnav>*>:focus::after, #{{ id }} .jl-thumbnav>*>:hover::after {
    border-color: {{ particle.thumbnav_border_color_hover|e }};
}
#{{ id }} .jl-thumbnav>*>:focus::after, #{{ id }} .jl-thumbnav>*>:hover::after {
    background-color: transparent;
}
#{{ id }} .jl-thumbnav>*>::after {
    border: {{ particle.thumbnav_border_width|e }}px solid transparent;
}
#{{ id }} .jl-thumbnav>*>::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255,255,255,.4);
    transition: .1s ease-in-out;
    transition-property: background-color,border-color,box-shadow;
}
{% endif %}
{% if particle.slide_color or particle.slide_background or particle.padding_vertical or particle.padding_horizontal %}
#{{ id }} .jl-slidenav {
    padding: {{ particle.padding_vertical }}px {{ particle.padding_horizontal }}px;
    {% if particle.slide_color %}
    color: {{ particle.slide_color }};
    {% endif %}
    {% if particle.slide_background %}
    background: {{ particle.slide_background }};
    {% endif %}
    transition: .1s ease-in-out;
    transition-property: color,background-color,border-color,box-shadow;
}
{% endif %}
{% if particle.slide_hover_color or particle.slide_hover_background %}
#{{ id }} .jl-slidenav:active,#{{ id }} .jl-slidenav:focus,#{{ id }} .jl-slidenav:hover{
    {% if particle.slide_hover_color %}
    color: {{ particle.slide_hover_color }};
    {% endif %}  
    {% if particle.slide_hover_background %}
    background: {{ particle.slide_hover_background }};
    {% endif %}
}
{% endif %}
</style>
{% endif %}
{% endblock %}

{# Set Min/Max Height #}
{% set slideshow_min_height = particle.slideshow_min_height ? 'minHeight: ' ~ particle.slideshow_min_height ~ ';' %}
{% set slideshow_max_height = particle.slideshow_max_height ? 'maxHeight: ' ~ particle.slideshow_max_height ~ ';' %}

{# Set Viewport Slideshow #}
{% if particle.slideshow_height == 'full' %}
    {% set slideshow_height = 'jl-height-viewport="offset-top: true; minHeight:' ~ particle.slideshow_min_height|default('300')|e ~ '"' %}
{% elseif particle.slideshow_height == 'percent' %}
    {% set slideshow_height = 'jl-height-viewport="offset-top: true; offset-bottom: 20; minHeight:' ~ particle.slideshow_min_height|default('300')|e ~ '"' %}
{% elseif particle.slideshow_height == 'section' %}
    {% set slideshow_height = 'jl-height-viewport="offset-top: true;offset-bottom: !section +; minHeight:' ~ particle.slideshow_min_height|default('300')|e ~ '"' %}
{% endif %}

{# Set Ratio #}
{% set slideshow_ratio = particle.slideshow_ratio ? 'ratio: ' ~ particle.slideshow_ratio ~ ';' %}

{# Set Slideshow Color #}
{% set slideshow_text_color = (particle.overlay_style == 'none' and particle.slideshow_text_color != 'default') ? ' jl-' ~ particle.slideshow_text_color ~ '' %}
{% set slidenav_text_color = particle.slideshow_text_color != 'default' ? ' jl-' ~ particle.slideshow_text_color ~ '' %}

{# Set Title/Meta/Content Text Transform #}
{% set title_text_transform = particle.title_text_transform ? ' jl-text-' ~ particle.title_text_transform|e ~ '' %}
{% set meta_text_transform = particle.meta_text_transform ? ' jl-text-' ~ particle.meta_text_transform|e ~ '' %}
{% set content_text_transform = particle.content_text_transform ? ' jl-text-' ~ particle.content_text_transform|e ~ '' %}

{# Set Global Animation #}
{% set pahorizontal %}
{% if particle.pa_horizontal_start or particle.pa_horizontal_end %}x: {% if particle.pa_horizontal_start == '' %}0{% else %}{{particle.pa_horizontal_start }}{% endif %},{% if particle.pa_horizontal_end == '' %}0{% else %}{{particle.pa_horizontal_end }}{% endif %};{% endif %}
{% endset %}

{# Set Vertical #}
{% set pavertical %}
{% if particle.pa_vertical_start or particle.pa_vertical_end %}y: {% if particle.pa_vertical_start == '' %}0{% else %}{{particle.pa_vertical_start }}{% endif %},{% if particle.pa_vertical_end == '' %}0{% else %}{{particle.pa_vertical_end }}{% endif %};{% endif %}
{% endset %}

{# Set Scale #}
{% set scale %}
{% if particle.scale_start or particle.scale_end %}scale: {% if particle.scale_start == '' %}1{% else %}{{particle.scale_start / 100 }}{% endif %},{% if particle.scale_end == '' %}1{% else %} {{particle.scale_end / 100 }}{% endif %};{% endif %}
{% endset %}

{# Set Rotate #}
{% set rotate %}{% if particle.rotate_start or particle.rotate_end %}
rotate: {% if particle.rotate_start == '' %}0{% else %}{{particle.rotate_start}}{% endif %},{% if particle.rotate_end == '' %}0{% else %}{{particle.rotate_end}}{% endif %};{% endif %}
{% endset %}

{# Set Opacity #}
{% set opacity %}
{% if particle.opacity_start or particle.opacity_end %}opacity: {% if particle.opacity_start == '' %}1{% else %}{{particle.opacity_start / 100 }}{% endif %},{% if particle.opacity_end == '' %}1{% else %}{{particle.opacity_end / 100 }}{% endif %};{% endif %}
{% endset %}

{# Set Animation #}
{% set animation %}
{% if particle.animation != 'inherit' and particle.animation != 'parallax' %} jl-scrollspy="cls: jl-animation-{{particle.animation|e}};{% if particle.animation_repeat == 'enabled' %} repeat: true;{% endif %}{% if particle.animation_delay %} delay: {{particle.animation_delay|e}};{% endif %}"
{% elseif particle.animation == 'parallax' %}
{% if particle.pa_horizontal_start or particle.pa_horizontal_end or particle.pa_vertical_start or particle.pa_vertical_end or particle.scale_start or particle.scale_end or particle.rotate_start or particle.rotate_end or particle.opacity_start or particle.opacity_end or particle.easing or particle.pa_viewport or particle.pa_breakpoint %} jl-parallax="{{pahorizontal}}{{pavertical}}{{scale}}{{rotate}}{{opacity}}{% if particle.easing == '' %}{% else %}easing: {{ particle.easing / 100 }};{% endif %}{% if particle.pa_viewport != '' %}viewport:{{ particle.pa_viewport / 100 }};{% endif %}{% if particle.pa_breakpoint != 'always' %}media: @{{particle.pa_breakpoint|e}}{% endif %}"{% endif %}
{% endif %}
{% endset %}

{# Set Max-Width Content #}
{% set content_maxwidth %}
{% if particle.g_maxwidth != 'inherit' %} jl-width-{{particle.g_maxwidth}}{% if particle.g_maxwidth_breakpoint != 'always' %}@{{particle.g_maxwidth_breakpoint}}{% endif %}{% if particle.g_maxwidth_alignment == 'left' %}{% elseif particle.g_maxwidth_alignment == 'center' %} jl-margin-auto{% else %} jl-margin-auto-left{% endif %}{% endif %}
{% endset %}

{# Set Particle Alignment #}
{% set particle_alignment %}
{% if particle.align != 'inherit' %} jl-text-{{particle.align|e}}{% if particle.breakpoint != 'always' %}@{{particle.breakpoint|e}}{% endif %}{% endif %}{% if particle.align != 'inherit' and particle.breakpoint != 'always' %}{% if particle.fallback != 'inherit' %} jl-text-{{particle.fallback|e}}{% endif %}{% endif %}
{% endset %}

{# set Particle Title Style #}
{% set particle_title_style %}
{% if particle.particle_title %}
<{{particle.particle_title_element|e}} id="{{ id }}" class="g5-particle-title{% if particle.particle_title_align != 'inherit' %} jl-text-{{particle.particle_title_align|e}}{% endif %}{% if particle.particle_predefined_color != 'default' %} jl-text-{{particle.particle_predefined_color|e}}{% endif %}{% if particle.particle_title_style != 'default' %} jl-{{particle.particle_title_style|e}}{% endif %}{% if particle.particle_title_decoration != 'none' %} jl-heading-{{particle.particle_title_decoration|e}}{% endif %}">
{% if particle.particle_title_decoration == 'line' %} <span>{{ particle.particle_title|raw }}</span>
{% else %} {{ particle.particle_title|raw }}
{% endif %}
</{{particle.particle_title_element|e}}>
{% endif %}
{% endset %}

{# Set Horizontal #}
{% set pa_overlay_horizontal %}
{% if particle.pa_overlay_horizontal_start or particle.pa_overlay_horizontal_end %}x: {% if particle.pa_overlay_horizontal_start == '' %}0{% else %}{{particle.pa_overlay_horizontal_start|e }}{% endif %},0,{% if particle.pa_overlay_horizontal_end is empty %}0{% else %}{{particle.pa_overlay_horizontal_end|e }}{% endif %};{% endif %}
{% endset %}

{# Set Vertical #}
{% set pa_overlay_vertical %}
{% if particle.pa_overlay_vertical_start or particle.pa_overlay_vertical_end %}y: {% if particle.pa_overlay_vertical_start == '' %}0{% else %}{{particle.pa_overlay_vertical_start|e }}{% endif %},0,{% if particle.pa_overlay_vertical_end == '' %}0{% else %}{{particle.pa_overlay_vertical_end|e }}{% endif %};{% endif %}
{% endset %}

{# Set Scale #}
{% set pa_overlay_scale %}
{% if particle.pa_overlay_scale_start or particle.pa_overlay_scale_end %}scale: {% if particle.pa_overlay_scale_start == '' %}1{% else %}{{particle.pa_overlay_scale_start|e / 100 }}{% endif %},1,{% if particle.pa_overlay_scale_end == '' %}1{% else %}{{particle.pa_overlay_scale_end|e / 100 }}{% endif %};{% endif %}
{% endset %}

{# Set Rotate #}
{% set pa_overlay_rotate %}{% if particle.pa_overlay_rotate_start or particle.pa_overlay_rotate_end %}
rotate: {% if particle.pa_overlay_rotate_start == '' %}0{% else %}{{particle.pa_overlay_rotate_start|e}}{% endif %},0,{% if particle.pa_overlay_rotate_end == '' %}0{% else %}{{particle.pa_overlay_rotate_end|e}}{% endif %};{% endif %}
{% endset %}

{# Set Opacity #}
{% set overlay_opacity %}
{% if particle.pa_overlay_opacity_start or particle.pa_overlay_opacity_end %}opacity: {% if particle.pa_overlay_opacity_start == '' %}1{% else %}{{particle.pa_overlay_opacity_start|e / 100 }}{% endif %},1,{% if particle.pa_overlay_opacity_end == '' %}1{% else %}{{particle.pa_overlay_opacity_end|e / 100 }}{% endif %};{% endif %}
{% endset %}

{# set Overlay Parallax Animation #}
{% set overlay_parallax_animation %}
{% if particle.overlay_transition == 'parallax' %}
{% if particle.pa_overlay_horizontal_start or particle.pa_overlay_horizontal_end or particle.pa_overlay_vertical_start or particle.pa_overlay_vertical_end or particle.pa_overlay_scale_start or particle.pa_overlay_scale_end or particle.pa_overlay_rotate_start or particle.pa_overlay_rotate_end or particle.pa_overlay_opacity_start or particle.pa_overlay_opacity_end %} jl-slideshow-parallax="{{pa_overlay_horizontal}}{{pa_overlay_vertical}}{{pa_overlay_scale}}{{pa_overlay_rotate}}{{overlay_opacity}}" {% endif %}
{% endif %}
{% endset %}

{# Set Overlay Animation #}
{% set overlay_animation = particle.overlay_transition != 'parallax' ? ' jl-transition-' ~ particle.overlay_transition ~ ';' %}

{# Set Title Animation #}
{% set pa_title_horizontal %}
{% if particle.pa_title_horizontal_start or particle.pa_title_horizontal_end %}x: {% if particle.pa_title_horizontal_start == '' %}0{% else %}{{particle.pa_title_horizontal_start|e }}{% endif %},0,{% if particle.pa_title_horizontal_end == '' %}0{% else %}{{particle.pa_title_horizontal_end|e }}{% endif %};{% endif %}
{% endset %}

{# Set Vertical #}
{% set pa_title_vertical %}
{% if particle.pa_title_vertical_start or particle.pa_title_vertical_end %}y: {% if particle.pa_title_vertical_start == '' %}0{% else %}{{particle.pa_title_vertical_start|e }}{% endif %},0,{% if particle.pa_title_vertical_end == '' %}0{% else %}{{particle.pa_title_vertical_end|e }}{% endif %};{% endif %}
{% endset %}

{# Set Scale #}
{% set pa_title_scale %}
{% if particle.pa_title_scale_start or particle.pa_title_scale_end %}scale: {% if particle.pa_title_scale_start == '' %}1{% else %}{{particle.pa_title_scale_start|e / 100 }}{% endif %},1,{% if particle.pa_title_scale_end == '' %}1{% else %}{{particle.pa_title_scale_end|e / 100 }}{% endif %};{% endif %}
{% endset %}

{# Set Rotate #}
{% set pa_title_rotate %}{% if particle.pa_title_rotate_start or particle.pa_title_rotate_end %}
rotate: {% if particle.pa_title_rotate_start == '' %}0{% else %}{{particle.pa_title_rotate_start|e}}{% endif %},0,{% if particle.pa_title_rotate_end == '' %}0{% else %}{{particle.pa_title_rotate_end|e}}{% endif %};{% endif %}
{% endset %}

{# Set Opacity #}
{% set title_opacity %}
{% if particle.pa_title_opacity_start or particle.pa_title_opacity_end %}opacity: {% if particle.pa_title_opacity_start == '' %}1{% else %}{{particle.pa_title_opacity_start|e / 100 }}{% endif %},1,{% if particle.pa_title_opacity_end == '' %}1{% else %}{{particle.pa_title_opacity_end|e / 100 }}{% endif %};{% endif %}
{% endset %}

{# set Title Animation #}
{% set title_animation %}
{% if particle.title_parallax == '1' and particle.overlay_transition == 'parallax' %}
{% if particle.pa_title_horizontal_start or particle.pa_title_horizontal_end or particle.pa_title_vertical_start or particle.pa_title_vertical_end or particle.pa_title_scale_start or particle.pa_title_scale_end or particle.pa_title_rotate_start or particle.pa_title_rotate_end or particle.pa_title_opacity_start or particle.pa_title_opacity_end %} jl-slideshow-parallax="{{pa_title_horizontal}}{{pa_title_vertical}}{{pa_title_scale}}{{pa_title_rotate}}{{title_opacity}}" {% endif %}{% endif %}
{% endset %}

{# Set Horizontal #}
{% set pa_meta_horizontal %}
{% if particle.pa_meta_horizontal_start or particle.pa_meta_horizontal_end %}x: {% if particle.pa_meta_horizontal_start == '' %}0{% else %}{{particle.pa_meta_horizontal_start|e }}{% endif %},0,{% if particle.pa_meta_horizontal_end == '' %}0{% else %}{{particle.pa_meta_horizontal_end|e }}{% endif %};{% endif %}
{% endset %}

{# Set Vertical #}
{% set pa_meta_vertical %}
{% if particle.pa_meta_vertical_start or particle.pa_meta_vertical_end %}y: {% if particle.pa_meta_vertical_start == '' %}0{% else %}{{particle.pa_meta_vertical_start|e }}{% endif %},0,{% if particle.pa_meta_vertical_end == '' %}0{% else %}{{particle.pa_meta_vertical_end|e }}{% endif %};{% endif %}
{% endset %}

{# Set Scale #}
{% set pa_meta_scale %}
{% if particle.pa_meta_scale_start or particle.pa_meta_scale_end %}scale: {% if particle.pa_meta_scale_start == '' %}1{% else %}{{particle.pa_meta_scale_start|e / 100 }}{% endif %},1,{% if particle.pa_meta_scale_end == '' %}1{% else %}{{particle.pa_meta_scale_end|e / 100 }}{% endif %};{% endif %}
{% endset %}

{# Set Rotate #}
{% set pa_meta_rotate %}{% if particle.pa_meta_rotate_start or particle.pa_meta_rotate_end %}
rotate: {% if particle.pa_meta_rotate_start == '' %}0{% else %}{{particle.pa_meta_rotate_start|e}}{% endif %},0,{% if particle.pa_meta_rotate_end == '' %}0{% else %}{{particle.pa_meta_rotate_end|e}}{% endif %};{% endif %}
{% endset %}

{# Set Opacity #}
{% set meta_opacity %}
{% if particle.pa_meta_opacity_start or particle.pa_meta_opacity_end %}opacity: {% if particle.pa_meta_opacity_start == '' %}1{% else %}{{particle.pa_meta_opacity_start|e / 100 }}{% endif %},1,{% if particle.pa_meta_opacity_end == '' %}1{% else %}{{particle.pa_meta_opacity_end|e / 100 }}{% endif %};{% endif %}
{% endset %}

{# set Meta Animation #}
{% set meta_animation %}
{% if particle.meta_parallax == '1' and particle.overlay_transition == 'parallax' %}
{% if particle.pa_meta_horizontal_start or particle.pa_meta_horizontal_end or particle.pa_meta_vertical_start or particle.pa_meta_vertical_end or particle.pa_meta_scale_start or particle.pa_meta_scale_end or particle.pa_meta_rotate_start or particle.pa_meta_rotate_end or particle.pa_meta_opacity_start or particle.pa_meta_opacity_end %} jl-slideshow-parallax="{{pa_meta_horizontal}}{{pa_meta_vertical}}{{pa_meta_scale}}{{pa_meta_rotate}}{{meta_opacity}}" {% endif %}{% endif %}
{% endset %}

{# Set Horizontal #}
{% set pa_content_horizontal %}
{% if particle.pa_content_horizontal_start or particle.pa_content_horizontal_end %}x: {% if particle.pa_content_horizontal_start == '' %}0{% else %}{{particle.pa_content_horizontal_start|e }}{% endif %},0,{% if particle.pa_content_horizontal_end == '' %}0{% else %}{{particle.pa_content_horizontal_end|e }}{% endif %};{% endif %}
{% endset %}

{# Set Vertical #}
{% set pa_content_vertical %}
{% if particle.pa_content_vertical_start or particle.pa_content_vertical_end %}y: {% if particle.pa_content_vertical_start == '' %}0{% else %}{{particle.pa_content_vertical_start|e }}{% endif %},0,{% if particle.pa_content_vertical_end == '' %}0{% else %}{{particle.pa_content_vertical_end|e }}{% endif %};{% endif %}
{% endset %}

{# Set Scale #}
{% set pa_content_scale %}
{% if particle.pa_content_scale_start or particle.pa_content_scale_end %}scale: {% if particle.pa_content_scale_start == '' %}1{% else %}{{particle.pa_content_scale_start|e / 100 }}{% endif %},1,{% if particle.pa_content_scale_end == '' %}1{% else %}{{particle.pa_content_scale_end|e / 100 }}{% endif %};{% endif %}
{% endset %}

{# Set Rotate #}
{% set pa_content_rotate %}{% if particle.pa_content_rotate_start or particle.pa_content_rotate_end %}
rotate: {% if particle.pa_content_rotate_start == '' %}0{% else %}{{particle.pa_content_rotate_start|e}}{% endif %},0,{% if particle.pa_content_rotate_end == '' %}0{% else %}{{particle.pa_content_rotate_end|e}}{% endif %};{% endif %}
{% endset %}

{# Set Opacity #}
{% set content_opacity %}
{% if particle.pa_content_opacity_start or particle.pa_content_opacity_end %}opacity: {% if particle.pa_content_opacity_start == '' %}1{% else %}{{particle.pa_content_opacity_start|e / 100 }}{% endif %},1,{% if particle.pa_content_opacity_end == '' %}1{% else %}{{particle.pa_content_opacity_end|e / 100 }}{% endif %};{% endif %}
{% endset %}

{# set Content Animation #}
{% set content_animation %}
{% if particle.content_parallax == '1' and particle.overlay_transition == 'parallax' %}
{% if particle.pa_content_horizontal_start or particle.pa_content_horizontal_end or particle.pa_content_vertical_start or particle.pa_content_vertical_end or particle.pa_content_scale_start or particle.pa_content_scale_end or particle.pa_content_rotate_start or particle.pa_content_rotate_end or particle.pa_content_opacity_start or particle.pa_content_opacity_end %} jl-slideshow-parallax="{{pa_content_horizontal}}{{pa_content_vertical}}{{pa_content_scale}}{{pa_content_rotate}}{{content_opacity}}" {% endif %}{% endif %}
{% endset %}

{# Set Horizontal #}
{% set pa_link_horizontal %}
{% if particle.pa_link_horizontal_start or particle.pa_link_horizontal_end %}x: {% if particle.pa_link_horizontal_start == '' %}0{% else %}{{particle.pa_link_horizontal_start|e }}{% endif %},0,{% if particle.pa_link_horizontal_end == '' %}0{% else %}{{particle.pa_link_horizontal_end|e }}{% endif %};{% endif %}
{% endset %}

{# Set Vertical #}
{% set pa_link_vertical %}
{% if particle.pa_link_vertical_start or particle.pa_link_vertical_end %}y: {% if particle.pa_link_vertical_start == '' %}0{% else %}{{particle.pa_link_vertical_start|e }}{% endif %},0,{% if particle.pa_link_vertical_end == '' %}0{% else %}{{particle.pa_link_vertical_end|e }}{% endif %};{% endif %}
{% endset %}

{# Set Scale #}
{% set pa_link_scale %}
{% if particle.pa_link_scale_start or particle.pa_link_scale_end %}scale: {% if particle.pa_link_scale_start == '' %}1{% else %}{{particle.pa_link_scale_start|e / 100 }}{% endif %},1,{% if particle.pa_link_scale_end == '' %}1{% else %}{{particle.pa_link_scale_end|e / 100 }}{% endif %};{% endif %}
{% endset %}

{# Set Rotate #}
{% set pa_link_rotate %}{% if particle.pa_link_rotate_start or particle.pa_link_rotate_end %}
rotate: {% if particle.pa_link_rotate_start == '' %}0{% else %}{{particle.pa_link_rotate_start|e}}{% endif %},0,{% if particle.pa_link_rotate_end == '' %}0{% else %}{{particle.pa_link_rotate_end|e}}{% endif %};{% endif %}
{% endset %}

{# Set Opacity #}
{% set link_opacity %}
{% if particle.pa_link_opacity_start or particle.pa_link_opacity_end %}opacity: {% if particle.pa_link_opacity_start == '' %}1{% else %}{{particle.pa_link_opacity_start|e / 100 }}{% endif %},1,{% if particle.pa_link_opacity_end == '' %}1{% else %}{{particle.pa_link_opacity_end|e / 100 }}{% endif %};{% endif %}
{% endset %}

{# set Button Animation #}
{% set link_animation %}
{% if particle.link_parallax == '1' and particle.overlay_transition == 'parallax' %}
{% if particle.pa_link_horizontal_start or particle.pa_link_horizontal_end or particle.pa_link_vertical_start or particle.pa_link_vertical_end or particle.pa_link_scale_start or particle.pa_link_scale_end or particle.pa_link_rotate_start or particle.pa_link_rotate_end or particle.pa_link_opacity_start or particle.pa_link_opacity_end %} jl-slideshow-parallax="{{pa_link_horizontal}}{{pa_link_vertical}}{{pa_link_scale}}{{pa_link_rotate}}{{link_opacity}}" {% endif %}{% endif %}
{% endset %}

{% set thumbnail_width = particle.thumbnail_width ? ' width="' ~ particle.thumbnail_width ~ '"' %}
{% set thumbnail_height = particle.thumbnail_height ? ' height="' ~ particle.thumbnail_height ~ '"' %}
{% set image_transition = particle.image_transition != 'default' ? 'animation:' ~ particle.image_transition ~ ';' %}
{% set velocity = particle.velocity ? 'velocity:' ~ particle.velocity / 100 ~ ';' %}
{% set slideshow_autoplay = particle.slideshow_autoplay ? 'autoplay: true;' %}
{% set slideshow_interval = (particle.slideshow_autoplay and particle.slideshow_interval) ? 'autoplay-interval:' ~ particle.slideshow_interval * 1000 ~ ';' %}
{% set slideshow_pause_onhover = particle.slideshow_pause_onhover == 'disabled' ? 'pauseOnHover: false;' %}
{% set image_kenburns_duration = particle.image_kenburns_duration ? 'style="-webkit-animation-duration: ' ~ particle.image_kenburns_duration ~ 's; animation-duration: ' ~ particle.image_kenburns_duration ~ 's;"' %}

{# Set Overlay Container/Padding/Margin #}
{% if particle.overlay_container_width != 'none' %}
{% set overlay_container_cls = particle.overlay_container_width != 'default' ? ' jl-container jl-container-' ~ particle.overlay_container_width|e ~ '' : ' jl-container' %}
{% set overlay_container_padding_cls = particle.overlay_container_padding != 'default' ? ' jl-section-' ~ particle.overlay_container_padding|e ~ '' : ' jl-section' %}
{% else %}
{% if particle.overlay_margin != 'none' %}
{% set overlay_margin_cls = particle.overlay_margin != 'default' ? ' jl-padding-' ~ particle.overlay_margin|e ~ '' : ' jl-padding' %}
{% endif %}
{% endif %}

{# Set Navigation #}
{% set navigation %}
  {% if particle.navigation != 'none' %}
    {% for item in particle.items %}
    <li jl-slideshow-item="{{loop.index0}}">
    <a href="#">
    {% if particle.navigation == 'thumbnav' and (item.slideshow_navigation_image or item.image) %}
      {% if item.slideshow_navigation_image %}
      <img class="tm-thumb" src="{{ url(item.slideshow_navigation_image)|e }}"{{ thumbnail_width|raw }}{{ thumbnail_height|raw }}>
      {% else %}
      <img class="tm-thumb" src="{{ url(item.image)|e }}"{{ thumbnail_width|raw }}{{ thumbnail_height|raw }}>
      {% endif %}
    {% else %}
      {{ item.slideshow_title|raw }}
    {% endif %}
    </a>
    </li>
    {% endfor %}
  {% endif %}
{% endset %}

{# Set Thumbnav #}
{% if particle.navigation != 'none' %}
{% set thumbnav = 'jl-' ~ particle.navigation|e ~ '' %}
{% endif %}

{# Set Viewport Height #}
{% if particle.viewport_height == 'full' %}
    {% set viewport_height = 'jl-height-viewport="offset-top: true;"' %}
{% elseif particle.viewport_height == 'percent' %}
    {% set viewport_height = 'jl-height-viewport="offset-top: true; offset-bottom: 20;"' %}
{% elseif particle.viewport_height == 'section' %}
    {% set viewport_height = 'jl-height-viewport="offset-top: true; offset-bottom: 50;"' %}
{% elseif particle.viewport_height == 'expand' %}
    {% set viewport_height = 'jl-height-viewport="expand: true;"' %}
{% endif %}

{# Set overlay_position #}
{% if particle.overlay_position == 'top' or particle.overlay_position == 'bottom' or particle.overlay_position == 'left' or particle.overlay_position == 'right' %}
    {% set overlay_position = 'jl-flex jl-flex-' ~ particle.overlay_position|e ~ '' %}
{% elseif particle.overlay_position == 'top-left' %}
    {% set overlay_position = 'jl-flex jl-flex-top jl-flex-left' %}
{% elseif particle.overlay_position == 'top-center' %}
    {% set overlay_position = 'jl-flex jl-flex-top jl-flex-center' %}
{% elseif particle.overlay_position == 'top-right' %}
    {% set overlay_position = 'jl-flex jl-flex-top jl-flex-right' %}
{% elseif particle.overlay_position == 'bottom-left' %}
    {% set overlay_position = 'jl-flex jl-flex-bottom jl-flex-left' %}
{% elseif particle.overlay_position == 'bottom-center' %}
    {% set overlay_position = 'jl-flex jl-flex-bottom jl-flex-center' %}
{% elseif particle.overlay_position == 'bottom-right' %}
    {% set overlay_position = 'jl-flex jl-flex-bottom jl-flex-right' %}  
{% elseif particle.overlay_position == 'center' %}
    {% set overlay_position = 'jl-flex jl-flex-center jl-flex-middle' %}
{% elseif particle.overlay_position == 'center-left' %}
    {% set overlay_position = 'jl-flex jl-flex-left jl-flex-middle' %}
{% elseif particle.overlay_position == 'center-right' %}
    {% set overlay_position = 'jl-flex jl-flex-right jl-flex-middle' %}  
{% endif %}

{% if particle.slidenav_icon_left and particle.slidenav_icon_right %}
{% set slidenav_icon_left = '<i class="' ~ particle.slidenav_icon_left ~ '" aria-hidden="true"></i>' %}
{% set slidenav_icon_right = '<i class="' ~ particle.slidenav_icon_right ~ '" aria-hidden="true"></i>' %}
{% else %}
{% set slidenav_large_style = particle.slidenav_large_style ? ' jl-slidenav-large' %}
{% set slidenav_next = 'jl-slidenav-next' %}
{% set slidenav_prev = 'jl-slidenav-previous' %}
{% endif %}

{# Set Slidenav #}
{% if particle.slidenav_position != 'none' %}
{% set slidenav %}
{% if particle.slidenav_position == 'default' %}
<div class="{% if particle.slidenav_breakpoint != 'always' %}jl-visible@{{particle.slidenav_breakpoint|e}}{% endif %}{{ particle.slidenav_hover ? ' jl-hidden-hover jl-hidden-touch' : '' }}{{slidenav_text_color}}">
<a class="tm-slidenav{{ slidenav_large_style }}{% if particle.slidenav_margin != 'none' %} jl-position-{{ particle.slidenav_margin|e }}{% endif %} jl-position-center-left" href="#" {{slidenav_prev}} jl-slideshow-item="previous">{{ slidenav_icon_left|raw }}</a>
<a class="tm-slidenav{{ slidenav_large_style }}{% if particle.slidenav_margin != 'none' %} jl-position-{{ particle.slidenav_margin|e }}{% endif %} jl-position-center-right" href="#" {{slidenav_next}} jl-slideshow-item="next">{{ slidenav_icon_right|raw }}</a>
</div>
{% elseif particle.slidenav_position == 'outside' %}
<div class="{% if particle.slidenav_breakpoint != 'always' %}jl-visible@{{particle.slidenav_breakpoint|e}}{% endif %}{% if particle.slidenav_outside_color != 'default' %} jl-{{particle.slidenav_outside_color|e}}{% endif %}">
<a class="tm-slidenav{{ slidenav_large_style }}{% if particle.slidenav_margin != 'none' %} jl-position-{{ particle.slidenav_margin|e }}{% endif %} jl-position-center-left" href="#" {{slidenav_prev}} jl-slideshow-item="previous" jl-toggle="cls: jl-position-center-left-out jl-position-center-left; mode: media; media:{% if particle.slidenav_outside_breakpoint != 'always' %} @{{particle.slidenav_outside_breakpoint|e}}{% endif %}">{{ slidenav_icon_left|raw }}</a>
<a class="tm-slidenav{{ slidenav_large_style }}{% if particle.slidenav_margin != 'none' %} jl-position-{{ particle.slidenav_margin|e }}{% endif %} jl-position-center-right" href="#" {{slidenav_next}} jl-slideshow-item="next" jl-toggle="cls: jl-position-center-right-out jl-position-center-right; mode: media; media:{% if particle.slidenav_outside_breakpoint != 'always' %} @{{particle.slidenav_outside_breakpoint|e}}{% endif %}">{{ slidenav_icon_right|raw }}</a>
</div>
{% else %}
<div class="jl-slidenav-container{% if particle.slidenav_margin != 'none' %} jl-position-{{ particle.slidenav_margin|e }}{% endif %} jl-position-{{ particle.slidenav_position|e }}{% if particle.slidenav_breakpoint != 'always' %} jl-visible@{{particle.slidenav_breakpoint|e}}{% endif %}{{ particle.slidenav_hover ? ' jl-hidden-hover jl-hidden-touch' : '' }}{{slidenav_text_color}}">
<a class="tm-slidenav{{ slidenav_large_style }}" href="#" {{slidenav_prev}} jl-slideshow-item="previous">{{ slidenav_icon_left|raw }}</a>
<a class="tm-slidenav{{ slidenav_large_style }}" href="#" {{slidenav_next}} jl-slideshow-item="next">{{ slidenav_icon_right|raw }}</a>
</div>
{% endif %}
{% endset %}
{% endif %}

{# Set Button Class #}
{% set button_cls %}
{% if particle.link_style == 'link' %}jl-link{% elseif particle.link_style == 'link-muted' or particle.link_style == 'link-text' %}jl-{{particle.link_style|e}}{% else %}jl-button jl-button-{{particle.link_style|e}}{% endif %}
{% endset %}

{# Set Button Size #}
{% set button_size %}
{% if particle.link_style == 'link' or particle.link_style == 'link-muted' or particle.link_style == 'link-text' or particle.link_style == 'text' %}{% else %}{% if particle.link_button_size != 'default' %} jl-button-{{particle.link_button_size|e}}{% endif %}{% endif %}
{% endset %}

{# Set Item Content #}
{% set itemcontent %}
{% for item in particle.items %}

{% set item_bg_color = item.bg_color ? ' style="background-color: ' ~ item.bg_color ~ ';"' %}

{# Set Meta Content #}
{% set item_meta %}
{% if item.slideshow_meta %}
<div class="tm-meta{{meta_text_transform}}{% if particle.meta_margin_top == 'default' %} jl-margin-top{% else %} jl-margin-{{ particle.meta_margin_top|e }}-top{% endif %}{% if particle.pre_meta_color == 'default' %}{% else %} jl-text-{{ particle.pre_meta_color|e }}{% endif %}{% if particle.meta_style != 'default' %} jl-{{ particle.meta_style|e }}{% endif %}"{{meta_animation}}>
{{ item.slideshow_meta|raw }}
</div>
{% endif %}
{% endset %}

<li class="tm-item{% if item.item_class %} {{ item.item_class }}{% endif %}"{{item_bg_color|default('')|raw}}>
{% if particle.image_kenburns != 'none' %}
<div class="jl-position-cover jl-animation-kenburns jl-animation-reverse jl-transform-origin-{{particle.image_kenburns}}"{{ image_kenburns_duration|raw }}>
{% endif %}
{% if item.image %}<img class="tm-image{% if item.blend_mode != 'inherit' and item.bg_color %} jl-blend-{{item.blend_mode|e}}{% endif %}" src="{{ url(item.image)|e }}"{% if item.image_alt %} alt="{{item.image_alt|e}}"{% endif %} jl-cover>{% endif %}
{% if particle.image_kenburns != 'none' %}
</div>
{% endif %}

{% if item.bg_overlay %}
<div class="jl-position-cover" style="background-color:{{ item.bg_overlay }}"></div>
{% endif %}

{# Load Overlay Style #}

{% if particle.overlay_style == 'none' %}
<div class="jl-position-cover {{overlay_position}}{{overlay_container_cls}}{{overlay_container_padding_cls}}{{overlay_margin_cls}}">
<div class="jl-panel{% if item.slideshow_item_text_color != 'default' %} jl-{{ item.slideshow_item_text_color|e }}{% endif %}{% if particle.overlay_width != 'none' %} jl-width-{{ particle.overlay_width|e }}{% endif %}{{overlay_animation}}{{slideshow_text_color}} jl-margin-remove-first-child" {{overlay_parallax_animation}}>
{% else %}
<div class="jl-position-cover {{overlay_position}}{{overlay_container_cls}}{{overlay_container_padding_cls}}{{overlay_margin_cls}}">
<div class="jl-overlay{% if particle.overlay_padding != 'default' %} jl-padding-{{ particle.overlay_padding|e }}{% endif %}{% if particle.overlay_style %} {{ particle.overlay_style|e }}{% endif %}{% if particle.overlay_width != 'none' %} jl-width-{{ particle.overlay_width|e }}{% endif %}{{overlay_animation}}{{slideshow_text_color}} jl-margin-remove-first-child" {{overlay_parallax_animation}}>
{% endif %}

{% if particle.meta_alignment == 'top' %}
  {{item_meta}}
{% endif %}

{% if item.slideshow_title %}
<{{particle.title_element|e}} class="tm-title jl-margin-remove-bottom{{title_text_transform}}{% if particle.title_margin_top == 'default' %} jl-margin-top{% else %} jl-margin-{{ particle.title_margin_top|e }}-top{% endif %}{% if particle.title_style != 'default' %} jl-{{ particle.title_style|e }}{% endif %}{% if particle.pre_title_color != 'default' %} jl-text-{{ particle.pre_title_color|e }}{% endif %}{% if particle.title_decoration != 'none' %} jl-heading-{{particle.title_decoration|e}}{% endif %}"{{title_animation}}>
{% if particle.title_decoration == 'line' %} <span>{{ item.slideshow_title|raw }}</span>
{% else %}
{{ item.slideshow_title|raw }}
{% endif %}
</{{particle.title_element|e}}>
{% endif %}

{% if particle.meta_alignment == 'bottom' %}
  {{item_meta}}
{% endif %}

{% if item.slideshow_content %}
  <div class="tm-content jl-panel{{content_text_transform}}{% if particle.content_margin_top == 'default' %} jl-margin-top{% else %} jl-margin-{{ particle.content_margin_top|e }}-top{% endif %}{% if particle.content_style != 'default' %} jl-text-{{ particle.content_style|e }}{% endif %}{% if particle.content_text_color != 'default' %} jl-text-{{ particle.content_text_color|e }}{% endif %}"{{content_animation}}>
    {{ item.slideshow_content|raw }}
  </div>
{% endif %}

{% if particle.meta_alignment == 'content' %}
  {{item_meta}}
{% endif %}

{# Set Link Scroll #}
{% set linkscroll = item.slideshow_link|e matches '/#/' ? ' jl-scroll' %}

{% if item.slideshow_link_text %}
<div class="{% if particle.link_margin_top == 'default' %}jl-margin-top{% else %}jl-margin-{{ particle.link_margin_top|e }}-top{% endif %}"><a target="{{ particle.buttontarget|e }}" href="{{ item.slideshow_link|e }}" title="{{ item.slideshow_link_text|e }}" class="{{button_cls}}{{button_size}}"{{link_animation}}{{linkscroll}}>{{ item.slideshow_link_text|e }}</a></div>
{% endif %}

</div>
</div>

{# End Overlay Style #}

</li>
{% endfor %}
{% endset %}

{# Set Flex Nav #}
{% if particle.vertical_navigation == false %}
{% if particle.navigation_position == 'top-right' or particle.navigation_position == 'center-right' or particle.navigation_position == 'bottom-right' %}
{% set flex_nav = ' jl-flex-right' %}
{% elseif particle.navigation_position == 'bottom-center' %}
{% set flex_nav = ' jl-flex-center' %}
{% endif %}
{% endif %}

{% block particle %}
{% if particle.enabled %}
{{particle_title_style}}

<div id="{{ id }}" class="tm-slideshow-wrapper{{content_maxwidth}}{% if particle.class %} {{ particle.class }}{% endif %}{{particle_alignment}}{% if particle.margin == 'inherit' %}{% elseif particle.margin == 'default' %} jl-margin{% else %} jl-margin-{{particle.margin|e}}{% endif %}{% if particle.visibility != 'inherit' %} jl-visible@{{particle.visibility|e}}{% endif %}"{{animation}}jl-slideshow="{{slideshow_ratio}}{{slideshow_min_height}}{{slideshow_max_height}}{{image_transition}}{{velocity}}{{slideshow_autoplay}}{{slideshow_interval}}{{slideshow_pause_onhover}}">
  <div class="jl-position-relative{{ particle.slidenav_hover ? ' jl-visible-toggle' : '' }}">

    {{ particle.extra_shadow ? '<div class="jl-box-shadow-bottom jl-display-block">' : '' }}
      <ul class="jl-slideshow-items{% if particle.box_shadow != 'none' %} jl-box-shadow-{{particle.box_shadow}}{% endif %}"{{ slideshow_height|raw }}>
        {{itemcontent}}
      </ul>
    {{ particle.extra_shadow ? '</div>' : '' }}
  
    {{slidenav}}
    
    {% if particle.navigation != 'none' and particle.navigation_below == false %}
    <div class="jl-position-{{particle.navigation_position|e}}{% if particle.navigation_margin != 'none' %} jl-position-{{particle.navigation_margin|e}}{% endif %}{% if particle.navigation_breakpoint != 'always' %} jl-visible@{{particle.navigation_breakpoint|e}}{% endif %}{{slidenav_text_color}}">
      <ul class="tm-nav {{thumbnav}}{{flex_nav}}{{ particle.vertical_navigation ? ' jl-dotnav-vertical' : '' }}" jl-margin>
        {{navigation}}
      </ul>
    </div>
    {% endif %}
  </div>

  {% if particle.navigation != 'none' and particle.navigation_below %}
  {% if particle.navigation_color == 'default' %}
  <ul class="tm-nav {{thumbnav}}{% if particle.navigation_breakpoint != 'always' %} jl-visible@{{particle.navigation_breakpoint|e}}{% endif %} jl-flex-{{particle.navigation_position_below|e}}{% if particle.navigation_margin_below == 'default' %} jl-margin-top{% else %} jl-margin-{{particle.navigation_margin_below|e}}-top{% endif %}">
    {{navigation}}
  </ul>
  {% else %}
  <div class="jl-{{particle.navigation_color|e}}{% if particle.navigation_breakpoint != 'always' %} jl-visible@{{particle.navigation_breakpoint|e}}{% endif %}{% if particle.navigation_margin_below == 'default' %} jl-margin-top{% else %} jl-margin-{{particle.navigation_margin_below|e}}-top{% endif %}{{slideshow_text_color}}">
    <ul class="tm-nav {{thumbnav}} jl-flex-{{particle.navigation_position_below|e}}">
      {{navigation}}
    </ul>
  </div>
  {% endif %}
  {% endif %}
  
</div>
{% endif %}
{% endblock %}
