templates/website/page/playground.html.twig line 1

  1. {% extends '@web/base.html.twig' %}
  2. {% if page is defined and page is not empty %}
  3.     {% set metaParams = {
  4.         'title': page.metaTitle ? page.metaTitle : page.title,
  5.         'metaDescription': page.metaDescription,
  6.         'metaKeywords': page.metaKeywords,
  7.         'image':(page.metaImage is defined ? page.metaImage : page.image is defined ? page.image : null)
  8.     } %}
  9. {% else %}
  10.     {% set metaParams = {} %}
  11. {% endif %}
  12.     {% block meta %}
  13.         {% include '@web/parts/meta.html.twig' with metaParams %}
  14.     {% endblock meta %}
  15. {% block content %}
  16.     <section class="section-playground">
  17.         {% block header %}
  18.             {% include '@web/parts/header.html.twig' %}
  19.         {% endblock %}
  20.         <div class="playground  my-container-fluid">
  21.             <div class="image-wrapper">
  22.                 <div class="title-wrapper">
  23.                     <span class="standard-title  title-desktop">{{ playground.title }}</span>
  24.                     <span class="standard-text ">{{ playground.description|raw }}</span>
  25.                 </div>
  26.                 <div class="image-desktop-wrapper">
  27.                     <img class="image-desktop" src="{{ playground.image| imagine_filter('thumbnail_view') }}" alt="{{ playground.title }}">
  28.                 </div>
  29.             </div>
  30.         </div>
  31.         {% if playground.body %}
  32.             <div class="header-wrapper section-fragmented full  my-container-fluid">
  33.                 <div class="standard-text">
  34.                     {{ playground.body|raw }}
  35.                 </div>
  36.             </div>
  37.         {% endif %}
  38.         {% if  playground.additionalInfo %}
  39.             <div class="description-wrapper">
  40.                 <div class="item w-100">
  41.                     <span>{{ playground.additionalInfo|raw }}</span>
  42.                 </div>
  43.             </div>
  44.         {% endif %}
  45.         {% if  playground.images %}
  46.             <div class="playground-slick">
  47.                 {% for item in playground.images %}
  48.                     <div class="slick-slide">
  49.                         <div class="playground-item">
  50.                             <div class="img-box"><img src="{{ item }}" width="100%"
  51.                                                       alt="playground"></div>
  52.                         </div>
  53.                     </div>
  54.                 {% endfor %}
  55.             </div>
  56.         {% endif %}
  57.         {% if  playground.video %}
  58.             <div class="video-wrapper  my-container-fluid mt-5 mb-5">
  59.                 <video  muted autoplay loop  id="playground-video">
  60.                     <source src="{{ playground.video }}">
  61.                 </video>
  62.                  <button class="play-button"  id="playBtn" onclick="toggleVideoPlay()">{{ svg('public/static_images/svg/play.svg')|raw }}</button>
  63.             </div>
  64.         {% endif %}
  65.         {% if prohibitedCases is not empty %}
  66.             <div class="advice-wrapper my-container-fluid">
  67.                 <div class="standard-title color-darkblue">
  68.                     {{ 'Մի՛ օգտվեք ատրակցիոններից հետևյալ դեպքերում'|trans }}
  69.                 </div>
  70.                 <div class="advices">
  71.                     {% for item in prohibitedCases %}
  72.                         <div class="advice">
  73.                             <img src="{{ item.image }}" alt="{{ item.title }}">
  74.                             <span>{{ item.title }}</span>
  75.                         </div>
  76.                     {% endfor %}
  77.                 </div>
  78.             </div>
  79.         {% endif %}
  80.         {% block footer %}
  81.             {% include '@web/parts/footer.html.twig' %}
  82.         {% endblock %}
  83.     </section>
  84. {% endblock %}
  85. {% block javascripts %}
  86.     {{ parent() }}
  87.     <script>
  88.         function toggleVideoPlay() {
  89.             const video = document.getElementById('playground-video');
  90.             const playBtn = document.getElementById('playBtn');
  91.             if (window.innerWidth < 991 ){
  92.                 if (playBtn.style.opacity === "0") {
  93.                     playBtn.style.opacity = "1";
  94.                 } else {
  95.                     playBtn.style.opacity = "0";
  96.                 }
  97.             }
  98.             if (video.paused) {
  99.                 video.play();
  100.                 playBtn.classList.add('button-opacity')
  101.             } else {
  102.                 playBtn.classList.remove('button-opacity')
  103.                 video.pause();
  104.             }
  105.         }
  106.     </script>
  107. {% endblock %}