templates/FrontBundle/Page/spectacles-speciaux2.html.twig line 1

Open in your IDE?
  1. {% extends 'FrontBundle/layout.html.twig' %}
  2. {% block title %}{{ app_sitename }} - {{ page.metaTitle }}{% endblock %}
  3. {% block description %}{{ page.metaDescription }}{% endblock %}
  4. {% block extra_class %}stack{% endblock %}
  5. {% block sub_header %}
  6.     <div class="sub-header anchor">
  7.         <ul>
  8.             <li><a href="#concerts">{{ 'menu_concerts'|tr(tr)|raw }}</a></li>
  9.             <li><a href="#noel">{{ 'menu_noel'|tr(tr)|raw }}</a></li>
  10.             <li><a href="#evenements">{{ 'menu_evenements'|tr(tr)|raw }}</a></li>
  11.         </ul>
  12.     </div>
  13. {% endblock %}
  14. {% block stylesheets %}
  15.     <link href="/front/css/owl.carousel.min.css" rel="stylesheet">
  16.     <link href="/front/css/owl.theme.default.min.css" rel="stylesheet">
  17.     <link href="/plugins/photoswipe/photoswipe.css" rel="stylesheet">
  18.     <link href="/plugins/photoswipe/default-skin/default-skin.css" rel="stylesheet" type="text/css"/>
  19.     <link href="/front/css/carousel.css" rel="stylesheet">
  20.     <style>
  21.         .espace-content h2 {
  22.             font-size: 28px;
  23.         }
  24.         .pointer-event-none{
  25.             pointer-events: none !important;
  26.             font-size: 15px;
  27.             text-transform: uppercase;
  28.             border-radius: 20px;
  29.             transition: 0.3s ease;
  30.             color: var(--purple);
  31.             border: 1px solid var(--purple);
  32.             text-decoration: none;
  33.             padding: 8px 16px;
  34.             width: max-content;
  35.             opacity: 0.5;
  36.             float: left;
  37.         }
  38.         span.name-title{
  39.             font-size: 17px;
  40.             letter-spacing: 3px;
  41.             width: 80%;
  42.             text-align: left;
  43.             display: block;
  44.             text-transform: uppercase;
  45.             color: #1A1A1A;
  46.             font-weight: 600;
  47.         }
  48.         .page_spectacles-speciaux .concerts .description .desc {
  49.             font-size: 14px;
  50.         }
  51.         strong.head {
  52.             font-size: 18px;
  53.             font-style: italic;
  54.         }
  55.         @media screen and (min-width: 1200px) {
  56.             .page_spectacles-speciaux .evenements .description {
  57.                 font-size: 15px;
  58.                 line-height: 20px;
  59.                 color: #707070;
  60.                 padding-left: calc(var(--bs-gutter-x)* .5* 2);
  61.                 display: flex;
  62.                 flex-direction: column;
  63.                 justify-content: center;
  64.                 height: 100%;
  65.                 align-items: center;
  66.             }
  67.             /**
  68.            Ppur la gestion de la modale du menu
  69.             */
  70.             .span-custom {
  71.                 display: flex !important;
  72.                 justify-content: center !important;
  73.             }
  74.             li.custom-liste {
  75.                 text-align: center !important;
  76.                 font-size: 13px;
  77.             }
  78.             li.custom-liste .boisson{
  79.                 font-style: italic;
  80.                 color: var(--gold);
  81.             }
  82.             .space-modale {
  83.                 margin-left: 5.5rem !important;
  84.             }
  85.             .space-modale2 {
  86.                 margin-left: 7.3rem !important;
  87.             }
  88.             @media screen and (max-width: 450px) {
  89.                 li.custom-liste {
  90.                     font-size: 0.85rem !important;
  91.                     text-align: center;
  92.                 }
  93.                 .space-modale h1 {
  94.                     font-size: 1rem !important;
  95.                 }
  96.                 .space-modale {
  97.                     margin-left: 3.5rem !important;
  98.                 }
  99.                 .space-modale2 {
  100.                     margin-left: 2.5rem !important;
  101.                 }
  102.             }
  103.         /**
  104.         fin
  105.          */
  106.     </style>
  107. {% endblock %}
  108. {% block body %}
  109.     {% include 'FrontBundle/Partial/calendar.html.twig' %}
  110.     <section class="espace-content full" id="concerts" style="margin-top: 160px;">
  111.         <div class="content">
  112.             <h1>{{ 'spectacle_h1'|tr(tr)|upper|raw }}</h1>
  113.             <h2 class="mb-5 mt-5">{{ 'menu_concerts'|tr(tr)|upper|raw }}</h2>
  114.             <p class="p-0">{{ 'concert_title'|tr(tr)|raw }}</p>
  115.         </div>
  116.     </section>
  117.     <section class="concerts slider p-0 mt-5 mb-5">
  118.         <div class="content">
  119.             <div class="p-0 row">
  120.                 {% set deadline = "2030-10-31 21:00:00" %}
  121.                 {% set current = "now" | date("Y-m-d H:i:s") %}
  122.                 {% set oktoberfest_added = false %}
  123.                 {% for concert in concerts %}
  124.                     {% if concert.concert is not null and concert.start.timestamp > date().timestamp %}
  125.                         <div class="item col-md-6" concert-id="{{ concert.id }}">
  126.                             <div class="row mb-5">
  127.                                 <div class="col-6 auto">
  128.                                     <img alt="concert" class="cover" src="{{ concert.concert.thumbnail }}" />
  129.                                     <a href="#" class="order red load-event {{ (concert.isfull) ? 'btn-isfull' : '' }}" data-id="{{ concert.id }}">
  130.                                         {{ (concert.isfull) ? 'general_full'|tr(tr)|upper|raw : 'general_reserver'|tr(tr)|upper|raw }}
  131.                                     </a>
  132.                                 </div>
  133.                                 <div class="col-6">
  134.                                     <div class="description">
  135.                                         <span class="name-title"><span>{{ concert.concert.titleLocale(app.request.locale) }}</span></span>
  136.                                         {% if app.request.locale == 'de' %}
  137.                                             <p>{{ concert.strStartDe }}</p>
  138.                                         {% elseif app.request.locale == 'en' %}
  139.                                             <p>{{ concert.strStartEn }}</p>
  140.                                         {% else %}
  141.                                             <p>{{ concert.strStart }}</p>
  142.                                         {% endif %}
  143.                                         <hr>
  144.                                         <p class="desc mb-3">{{ concert.concert.description(app.request.locale)|replace({'Animation:':'<br><br>Animation:','Entertainment:':'<br><br>Entertainment:'})|raw }}</p>
  145.                                         <span class="price">{{ 'menus_tarifs_spectacle_pn'|tr(tr)|ucfirst|raw }} : {{ concert.concert.info('pn') }} €*</span>
  146.                                         <span class="price premium">{{ 'menus_tarifs_spectacle_ph'|tr(tr)|ucfirst|raw }} : {{ concert.concert.info('ph') }} €*</span>
  147.                                         <span class="price purple">{{ 'menus_tarifs_spectacle_vip'|tr(tr)|ucfirst|raw }} : {{ concert.concert.info('vip') }} €*</span>
  148.                                         <p class="desc mt-3">*{{ 'menus_tarifs_horsrepas'|tr(tr)|raw }}</p>
  149.                                         {% if concert.start|date('H') > 16 %}
  150.                                             <p class="desc mb-3">{{ 'concert_food3'|tr(tr)|raw }}</p>
  151.                                         {% else %}
  152.                                             {% set food_str = (concert.venueType.food) ? 'concert_food'|tr(tr)|raw : 'concert_nofood'|tr(tr)|raw  %}
  153.                                             {% if concert.id in [1814, 1850] %}
  154.                                                 {% if app.request.locale == 'de' %}
  155.                                                     {% set food_str = 'Mittagessen möglich um 11:30 Uhr' %}
  156.                                                 {% elseif app.request.locale == 'en' %}
  157.                                                     {% set food_str = 'Lunch available at 11:30 AM' %}
  158.                                                 {% else %}
  159.                                                     {% set food_str = 'Possibilité de déjeuner à 11h30' %}
  160.                                                 {% endif %}
  161.                                             {% endif %}
  162.                                             <p class="desc mb-3">{{ food_str }}</p>
  163.                                         {% endif %}
  164.                                     </div>
  165.                                 </div>
  166.                             </div>
  167.                         </div>
  168.                         {% if loop.index == 8 and current <= deadline %}
  169.                             <!-- Pour Oktoberfest -->
  170.                             <div class="item col-md-6">
  171.                                 <div class="row mb-5">
  172.                                     <div class="col-6 auto">
  173.                                         <img alt="concert" class="cover" src="{{ asset('front/img/evenements-2024/oktoberfest-min.jpg') }}" />
  174.                                         <a href="#" class="order red load-event" data-id="1439">
  175.                                             {{ 'general_reserver'|tr(tr)|upper|raw }}
  176.                                         </a>
  177.                                     </div>
  178.                                     <div class="col-6">
  179.                                         <div class="description">
  180.                                             <span class="name-title"><span>OKTOBERFEST</span></span>
  181.                                             {% if app.request.locale == 'de' %}
  182.                                                 <p>Donnerstag, 31. Oktober 2024 / 21h </p>
  183.                                             {% elseif app.request.locale == 'en' %}
  184.                                                 <p>Thursday 31 October 2024 / 21h</p>
  185.                                             {% else %}
  186.                                                 <p>Jeudi 31 Octobre 2024 / 21h</p>
  187.                                             {% endif %}
  188.                                             <hr>
  189.                                             <p class="desc mb-3">{{ 'events_2024_spe'|tr(tr)|raw }}</p>
  190.                                             <p class="desc mt-3">*{{ 'menus_tarifs_horsrepas'|tr(tr)|raw }}</p>
  191.                                             <p class="desc mb-3">{{ 'concert_food2'|tr(tr)|raw }}</p>
  192.                                         </div>
  193.                                     </div>
  194.                                 </div>
  195.                             </div>
  196.                             {% set oktoberfest_added = true %}
  197.                         {% endif %}
  198.                     {% endif %}
  199.                 {% endfor %}
  200.                 <div class="item row">
  201.                     <div class="col-6 auto">
  202.                         &nbsp;
  203.                     </div>
  204.                     <div class="col-6">
  205.                         <div class="description">
  206.                             &nbsp;
  207.                         </div>
  208.                     </div>
  209.                 </div>
  210.             </div>
  211.         </div>
  212.     </section>
  213.     <section class="noel slider pt-5 mt-5" id="noel" style="padding-bottom: 110px;">
  214.         <div class="content pt-5 mt-5 pb-5">
  215.             <div class="row">
  216.                 <div class="col-md-4">{#
  217.                     {% if app.request.locale == 'de' %}
  218.                       <img src="/front/img/spectacle-noel-2023-de.jpg" width="100%"  alt="noel" />
  219.                     {% else %}
  220.                       <img src="/front/img/spectacle-noel-2023.jpg" width="100%"  alt="noel" />
  221.                     {% endif %} #}
  222.                     <img src="{{ asset('/front/img/2025/spectacle-enfants.jpg') }}" width="100%"  alt="spectacle enfants" />
  223.                 </div>
  224.                 <div class="col-md-7 offset-md-1">
  225.                     <p class="title">{{ 'spectacle_enfant'|tr(tr)|raw }}</p>
  226.                     <p class="subtitle pt-5">{{ 'spectacle_enfant_subtitle'|tr(tr)|raw }}</p>
  227.                     <p class="description">{{ 'spectacle_enfant_desc'|tr(tr)|raw }}</p>
  228.                     <div class="d-flex flex-column justify-content-between gap-1 w-125px flex-md-row">
  229.                         {#  <a href="/{{app.request.locale}}/housh-ma-housh" class="pointer-event-none">{{ 'reser_event_home'|tr(tr)|upper|raw }}</a> #}
  230.                         <a href="#" class="cal open-cal" data-date="{{ 'now'|date('Y') }}-{{ ('now'|date('m')|number_format == 12) ? '12' : '11' }}-01">{{ 'general_reserver2'|tr(tr)|upper|raw }}</a>
  231.                         {# <button class="cal rounded-5" data-bs-toggle="modal" data-bs-target="#menu-child">{{ 'voir_le_menu'|tr(tr)|upper|raw }}</button> #}
  232.                     </div>
  233.                 </div>
  234.             </div>
  235.         </div>
  236.     </section>
  237.     <section class="espace-content full mt-5 pt-5" id="evenements">
  238.         <div class="content">
  239.             <h2 class="mb-5">{{ 'menu_evenements'|tr(tr)|upper|raw }}</h2>
  240.             <p class="p-0">{{ 'events_title'|tr(tr)|raw }}</p>
  241.         </div>
  242.     </section>
  243.     <section class="evenements slider p-0 mt-5 mb-5">
  244.         <div class="content">
  245.             <div class="row p-0">
  246.                 {#             <div class="item col-md-6 mb-5">
  247.             <div class="row">
  248.               <div class="col-6 auto">
  249.                 <span class="name">{{ 'events_e1_title'|tr(tr)|upper|raw }}</span>
  250.                 <img alt="event" class="cover" src="/front/img/spectacle-event2.jpg" />
  251.                 <a href="#" class="order purple open-cal" data-date="{{ 'now'|date('Y') }}-12-01">{{ 'general_reserver'|tr(tr)|upper|raw }}</a>
  252.               </div>
  253.               <div class="col-6">
  254.                 <div class="description">
  255.                 {{ 'events_e1'|tr(tr)|raw }}
  256.                 </div>
  257.               </div>
  258.             </div>
  259.             </div> #}
  260.                 <div class="item col-md-6 mb-5">
  261.                     <div class="row">
  262.                         <div class="col-6 auto">
  263.                             <span class="name">{{ 'events_2024_e2_title'|tr(tr)|upper|raw }}</span>
  264.                             <img alt="event" class="cover" src="{{ asset('front/img/2025/oktoberfest.png') }}" />
  265.                             <a href="#" class="order purple link load-event" data-id="1946">
  266.                                 {{ 'general_reserver'|tr(tr)|raw }}
  267.                             </a>
  268.                         </div>
  269.                         <div class="col-6">
  270.                             <div class="description">
  271.                                 {{ 'events_2024_e2'|tr(tr)|raw }}
  272.                             </div>
  273.                         </div>
  274.                     </div>
  275.                 </div>
  276.                 <div class="item col-md-6 mb-5">
  277.                     <div class="row">
  278.                         <div class="col-6 auto">
  279.                             <span class="name">Noël D'or</span>
  280.                             <img alt="event" class="cover" src="{{ asset('front/img/2025/noel-or.jpg') }}" />
  281.                             <a href="#" class="order purple open-cal" data-date="2025-11-01">{{ 'general_reserver'|tr(tr)|upper|raw }}</a>
  282.                         </div>
  283.                         <div class="col-6">
  284.                             <div class="description">
  285.                                 {{ 'events_noel'|tr(tr)|raw }}
  286.                             </div>
  287.                         </div>
  288.                     </div>
  289.                 </div>
  290.                                   <div class="item col-md-12 mb-5 py-5">
  291.                     <div class="row">
  292.                         <div class="col-md-3 auto">
  293.                             <span class="name">{{ 'events_e1_title'|tr(tr)|upper|raw }}</span>
  294.                             <img alt="event" class="cover" src="{{ asset('front/img/evenements-2024/st-sylvestre.jpg') }}" />
  295.                             <a href="#" class="order purple open-cal" data-date="2025-12-31">{{ 'general_reserver'|tr(tr)|upper|raw }}</a>
  296.                         </div>
  297.                         <div class="col-md-9 row">
  298.                             <div class=" col-md-6">
  299.                                 <div class="description">
  300.                                     {{ 'events_2024_e3_gala'|tr(tr)|raw }}
  301.                                 </div>
  302.                             </div>
  303.                             <div class=" col-md-6">
  304.                                 <div class="description">
  305.                                     {{ 'events_2024_e3_loung'|tr(tr)|raw }}
  306.                                 </div>
  307.                             </div>
  308.                         </div>
  309.                     </div>
  310.                 </div>
  311.                 <div class="item col-md-6 mb-5">
  312.                     <div class="row">
  313.                         <div class="col-6 auto">
  314.                             <span class="name">{{ 'events_2024_e1_title'|tr(tr)|upper|raw }}</span>
  315.                             <img alt="event" class="cover" src="{{ asset('front/img/evenements-2024/st-valentin.jpg') }}" />
  316.                             <a href="#" class="order purple open-cal" data-date="2026-02-13">{{ 'general_reserver'|tr(tr)|upper|raw }}</a>
  317.                         </div>
  318.                         <div class="col-6">
  319.                             <div class="description">
  320.                                 {{ 'events_2024_e1'|tr(tr)|raw }}
  321.                             </div>
  322.                         </div>
  323.                     </div>
  324.                 </div>
  325.             </div>
  326.         </div>
  327.     </section>
  328.     <!-- Modale pour le menu père noel -->
  329.     <div class="modal fade" id="menu-child" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="MenuChildLabel" aria-hidden="true">
  330.         <div class="modal-dialog modal-dialog-centered">
  331.             <div class="modal-content border-3">
  332.                 <div class="modal-header border-bottom-0">
  333.                     <div class="d-flex justify-content-end space-modale">
  334.                         <h1 class="modal-title fs-5 " id="MenuChildLabel">  {{ 'menu_noel_enfant_title'|tr(tr)|raw }}</h1>
  335.                     </div>
  336.                     <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
  337.                 </div>
  338.                 <div class="modal-body">
  339.                     <div class="d-flex justify-content-center mt-2">
  340.                         {{ 'menu_noel_enfant_content'|tr(tr)|raw }}
  341.                     </div>
  342.                 </div>
  343.             </div>
  344.         </div>
  345.     </div>
  346.     <!-- fin de la modale -->
  347.     <!-- Modale pour le menu saint-sylvestre --->
  348.     <div class="modal fade" id="menu-saint-sylvestre" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="MenuSaintSylvestreLabel" aria-hidden="true">
  349.         <div class="modal-dialog modal-dialog-centered modal-dialog-scrollable">
  350.             <div class="modal-content border-3">
  351.                 <div class="modal-header border-bottom-0">
  352.                     <div class="d-flex justify-content-end space-modale2">
  353.                         <h1 class="modal-title fs-5 " id="MenuSaintSylvestreLabel">  {{ 'menus_tarifs_ss_title'|tr(tr)|raw }}</h1>
  354.                     </div>
  355.                     <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
  356.                 </div>
  357.                 <div class="modal-body">
  358.                     <div class="d-flex justify-content-center mt-2">
  359.                         {{ 'menu_tarif_ss_home'|tr(tr)|raw }}
  360.                     </div>
  361.                 </div>
  362.             </div>
  363.         </div>
  364.     </div>
  365.     <!-- fin de la modale --->
  366.     {% include 'FrontBundle/Partial/footer.html.twig' %}
  367.     <!-- Root element of PhotoSwipe. Must have class pswp. -->
  368.     <div class="pswp" tabindex="-1" role="dialog" aria-hidden="true">
  369.         <!-- Background of PhotoSwipe.
  370.           It's a separate element as animating opacity is faster than rgba(). -->
  371.         <div class="pswp__bg"></div>
  372.         <!-- Slides wrapper with overflow:hidden. -->
  373.         <div class="pswp__scroll-wrap">
  374.             <!-- Container that holds slides.
  375.               PhotoSwipe keeps only 3 of them in the DOM to save memory.
  376.               Don't modify these 3 pswp__item elements, data is added later on. -->
  377.             <div class="pswp__container">
  378.                 <div class="pswp__item"></div>
  379.                 <div class="pswp__item"></div>
  380.                 <div class="pswp__item"></div>
  381.             </div>
  382.             <!-- Default (PhotoSwipeUI_Default) interface on top of sliding area. Can be changed. -->
  383.             <div class="pswp__ui pswp__ui--hidden">
  384.                 <div class="pswp__top-bar">
  385.                     <!--  Controls are self-explanatory. Order can be changed. -->
  386.                     <div class="pswp__counter"></div>
  387.                     <button class="pswp__button pswp__button--close" title="Close (Esc)"></button>
  388.                     <button class="pswp__button pswp__button--share" title="Share"></button>
  389.                     <button class="pswp__button pswp__button--fs" title="Toggle fullscreen"></button>
  390.                     <button class="pswp__button pswp__button--zoom" title="Zoom in/out"></button>
  391.                     <!-- Preloader demo https://codepen.io/dimsemenov/pen/yyBWoR -->
  392.                     <!-- element will get class pswp__preloader--active when preloader is running -->
  393.                     <div class="pswp__preloader">
  394.                         <div class="pswp__preloader__icn">
  395.                             <div class="pswp__preloader__cut">
  396.                                 <div class="pswp__preloader__donut"></div>
  397.                             </div>
  398.                         </div>
  399.                     </div>
  400.                 </div>
  401.                 <div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap">
  402.                     <div class="pswp__share-tooltip"></div>
  403.                 </div>
  404.                 <button class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)">
  405.                 </button>
  406.                 <button class="pswp__button pswp__button--arrow--right" title="Next (arrow right)">
  407.                 </button>
  408.                 <div class="pswp__caption">
  409.                     <div class="pswp__caption__center"></div>
  410.                 </div>
  411.             </div>
  412.         </div>
  413.     </div>
  414. {% endblock %}
  415. {% block javascripts %}
  416.     <script src="/front/js/owl.carousel.min.js"></script>
  417.     <script src="/plugins/photoswipe/photoswipe.min.js"></script>
  418.     <script src="/plugins/photoswipe/photoswipe-ui-default.min.js"></script>
  419.     <script type="text/javascript">
  420.         $( document ).ready(function() {
  421.             $('.open-date').on('click', function(e){
  422.                 e.preventDefault();
  423.                 loadEvent($(this).data('id'));
  424.             });
  425.             var url_anchor = $(location).attr('href');
  426.             url_anchor_arr = url_anchor.split("#");
  427.             if(url_anchor_arr.length > 1){
  428.                 console.log(url_anchor_arr[1]);
  429.                 setTimeout(function(){ $('.anchor a[href="#'+url_anchor_arr[1]+'"]').click(); }, 1000);
  430.             }
  431.             var owl2 = $('.noel .owl-carousel');
  432.             owl2.owlCarousel({
  433.                 loop: false,
  434.                 mouseDrag: false,
  435.                 touchDrag: false,
  436.                 pullDrag: false,
  437.                 // rewind: true,
  438.                 itemElement: 'figure',
  439.                 autoplay: false,
  440.                 margin:0,
  441.                 nav:true,
  442.                 dots:false,
  443.                 responsive:{
  444.                     0:{
  445.                         items:3
  446.                     },
  447.                     600:{
  448.                         items:3
  449.                     },
  450.                     1920:{
  451.                         items:3
  452.                     }
  453.                 }
  454.             });
  455.             owl.on('changed.owl.carousel', function(event) {
  456.                 var itemsNbr = owl.data()['owl.carousel'].settings.items;
  457.                 var itemsTotal = event.item.count;
  458.                 var itemsIndex = event.item.index;
  459.                 var pagesNbr = itemsTotal - itemsNbr;
  460.                 var horizontalBar = $('.horizontal-bar').outerWidth();
  461.                 var horizontalBarCtrl = $('.horizontal-bar-ctrl').outerWidth();
  462.                 var courseLength = $('.horizontal-bar').outerWidth() - $('.horizontal-bar-ctrl').outerWidth();
  463.                 var left = itemsIndex * 100 / pagesNbr; // percent
  464.                 left = left * courseLength / 100;
  465.                 $('.horizontal-bar-ctrl').css('left', left+'px');
  466.             });
  467.             owl2.on('changed.owl.carousel', function(event) {
  468.                 var itemsNbr = owl2.data()['owl.carousel'].settings.items;
  469.                 var itemsTotal = event.item.count;
  470.                 var itemsIndex = event.item.index;
  471.                 var pagesNbr = itemsTotal - itemsNbr;
  472.                 var horizontalBar = $('.noel .horizontal-bar').outerWidth();
  473.                 var horizontalBarCtrl = $('.noel .horizontal-bar-ctrl').outerWidth();
  474.                 var courseLength = $('.noel .horizontal-bar').outerWidth() - $('.noel .horizontal-bar-ctrl').outerWidth();
  475.                 var left = itemsIndex * 100 / pagesNbr; // percent
  476.                 left = left * courseLength / 100;
  477.                 $('.noel .horizontal-bar-ctrl').css('left', left+'px');
  478.             });
  479.             $('.owl-carousel.images a').each(function(index, value) {
  480.                 img = new Image();
  481.                 size = 0;
  482.                 const ident = $(this).attr('id').toString();
  483.                 img.onload = function() {
  484.                     $('#'+ident).attr('data-size', this.width + 'x' + this.height);
  485.                 }
  486.                 img.src = $(this).attr('source');
  487.             }).promise().done( function(){
  488.                 setTimeout( function(){
  489.                     initPhotoSwipeFromDOM('.my-gallery');
  490.                 }, 1000);
  491.             } );
  492.             $('.owl-carousel.images .owl-stage').addClass('my-gallery');
  493.             $('.owl-carousel.images .owl-stage').attr('itemscope');
  494.             $('.owl-carousel.images .owl-stage').attr('itemtype', 'http://schema.org/ImageGallery');
  495.             $('.owl-carousel.images .owl-item ').attr('itemscope');
  496.             $('.owl-carousel.images .owl-item ').attr('itemprop', 'associatedMedia');
  497.             $('.owl-carousel.images .owl-item ').attr('itemtype', 'http://schema.org/ImageObject');
  498.         });
  499.     </script>
  500.     <script type="text/javascript">
  501.         var initPhotoSwipeFromDOM = function(gallerySelector) {
  502.             // parse slide data (url, title, size ...) from DOM elements
  503.             // (children of gallerySelector)
  504.             var parseThumbnailElements = function(el) {
  505.                 console.log(el.childNodes);
  506.                 var thumbElements = el.childNodes,
  507.                     numNodes = thumbElements.length,
  508.                     items = [
  509.                         // {
  510.                         //   src: 'https://dummyimage.com/1000x1000/ccc/5cac22',
  511.                         //   w: '1024',
  512.                         //   h: '1024'
  513.                         // },
  514.                         // {
  515.                         //   src: 'https://dummyimage.com/1000x1000/5cac22/fff',
  516.                         //   w: '1024',
  517.                         //   h: '1024'
  518.                         // }
  519.                     ],
  520.                     figureEl,
  521.                     linkEl,
  522.                     size,
  523.                     item;
  524.                 for(var i = 0; i < numNodes; i++) {
  525.                     figureEl = thumbElements[i]; // <figure> element
  526.                     // include only element nodes
  527.                     if(figureEl.nodeType !== 1) {
  528.                         continue;
  529.                     }
  530.                     linkEl = figureEl.children[0]; // <a> element
  531.                     size = linkEl.getAttribute('data-size').split('x');
  532.                     // create slide object
  533.                     item = {
  534.                         src: linkEl.getAttribute('href'),
  535.                         w: parseInt(size[0], 10),
  536.                         h: parseInt(size[1], 10)
  537.                     };
  538.                     if(figureEl.children.length > 1) {
  539.                         // <figcaption> content
  540.                         item.title = figureEl.children[1].innerHTML;
  541.                     }
  542.                     if(linkEl.children.length > 0) {
  543.                         // <img> thumbnail element, retrieving thumbnail url
  544.                         item.msrc = linkEl.children[0].getAttribute('src');
  545.                     }
  546.                     item.el = figureEl; // save link to element for getThumbBoundsFn
  547.                     items.push(item);
  548.                 }
  549.                 return items;
  550.             };
  551.             // find nearest parent element
  552.             var closest = function closest(el, fn) {
  553.                 return el && ( fn(el) ? el : closest(el.parentNode, fn) );
  554.             };
  555.             // triggers when user clicks on thumbnail
  556.             var onThumbnailsClick = function(e) {
  557.                 e = e || window.event;
  558.                 e.preventDefault ? e.preventDefault() : e.returnValue = false;
  559.                 var eTarget = e.target || e.srcElement;
  560.                 // find root element of slide
  561.                 var clickedListItem = closest(eTarget, function(el) {
  562.                     return (el.tagName && el.tagName.toUpperCase() === 'FIGURE');
  563.                 });
  564.                 if(!clickedListItem) {
  565.                     return;
  566.                 }
  567.                 // find index of clicked item by looping through all child nodes
  568.                 // alternatively, you may define index via data- attribute
  569.                 var clickedGallery = clickedListItem.parentNode,
  570.                     childNodes = clickedListItem.parentNode.childNodes,
  571.                     numChildNodes = childNodes.length,
  572.                     nodeIndex = 0,
  573.                     index;
  574.                 for (var i = 0; i < numChildNodes; i++) {
  575.                     if(childNodes[i].nodeType !== 1) {
  576.                         continue;
  577.                     }
  578.                     if(childNodes[i] === clickedListItem) {
  579.                         index = nodeIndex;
  580.                         break;
  581.                     }
  582.                     nodeIndex++;
  583.                 }
  584.                 if(index >= 0) {
  585.                     // open PhotoSwipe if valid index found
  586.                     openPhotoSwipe( index, clickedGallery );
  587.                 }
  588.                 return false;
  589.             };
  590.             // parse picture index and gallery index from URL (#&pid=1&gid=2)
  591.             var photoswipeParseHash = function() {
  592.                 var hash = window.location.hash.substring(1),
  593.                     params = {};
  594.                 if(hash.length < 5) {
  595.                     return params;
  596.                 }
  597.                 var vars = hash.split('&');
  598.                 for (var i = 0; i < vars.length; i++) {
  599.                     if(!vars[i]) {
  600.                         continue;
  601.                     }
  602.                     var pair = vars[i].split('=');
  603.                     if(pair.length < 2) {
  604.                         continue;
  605.                     }
  606.                     params[pair[0]] = pair[1];
  607.                 }
  608.                 if(params.gid) {
  609.                     params.gid = parseInt(params.gid, 10);
  610.                 }
  611.                 return params;
  612.             };
  613.             var openPhotoSwipe = function(index, galleryElement, disableAnimation, fromURL) {
  614.                 var pswpElement = document.querySelectorAll('.pswp')[0],
  615.                     gallery,
  616.                     options,
  617.                     items;
  618.                 items = parseThumbnailElements(galleryElement);
  619.                 // define options (if needed)
  620.                 options = {
  621.                     // define gallery index (for URL)
  622.                     galleryUID: galleryElement.getAttribute('data-pswp-uid'),
  623.                     getThumbBoundsFn: function(index) {
  624.                         // See Options -> getThumbBoundsFn section of documentation for more info
  625.                         var thumbnail = items[index].el.getElementsByTagName('img')[0], // find thumbnail
  626.                             pageYScroll = window.pageYOffset || document.documentElement.scrollTop,
  627.                             rect = thumbnail.getBoundingClientRect();
  628.                         return {x:rect.left, y:rect.top + pageYScroll, w:rect.width};
  629.                     }
  630.                 };
  631.                 // PhotoSwipe opened from URL
  632.                 if(fromURL) {
  633.                     if(options.galleryPIDs) {
  634.                         // parse real index when custom PIDs are used
  635.                         // http://photoswipe.com/documentation/faq.html#custom-pid-in-url
  636.                         for(var j = 0; j < items.length; j++) {
  637.                             if(items[j].pid == index) {
  638.                                 options.index = j;
  639.                                 break;
  640.                             }
  641.                         }
  642.                     } else {
  643.                         // in URL indexes start from 1
  644.                         options.index = parseInt(index, 10) - 1;
  645.                     }
  646.                 } else {
  647.                     options.index = parseInt(index, 10);
  648.                 }
  649.                 // exit if index not found
  650.                 if( isNaN(options.index) ) {
  651.                     return;
  652.                 }
  653.                 if(disableAnimation) {
  654.                     options.showAnimationDuration = 0;
  655.                 }
  656.                 // Pass data to PhotoSwipe and initialize it
  657.                 gallery = new PhotoSwipe( pswpElement, PhotoSwipeUI_Default, items, options);
  658.                 gallery.init();
  659.             };
  660.             // loop through all gallery elements and bind events
  661.             var galleryElements = document.querySelectorAll( gallerySelector );
  662.             for(var i = 0, l = galleryElements.length; i < l; i++) {
  663.                 galleryElements[i].setAttribute('data-pswp-uid', i+1);
  664.                 galleryElements[i].onclick = onThumbnailsClick;
  665.             }
  666.             // Parse URL and open gallery if it contains #&pid=3&gid=1
  667.             var hashData = photoswipeParseHash();
  668.             if(hashData.pid && hashData.gid) {
  669.                 openPhotoSwipe( hashData.pid ,  galleryElements[ hashData.gid - 1 ], true, true );
  670.             }
  671.         };
  672.     </script>
  673. {% endblock %}