templates/website/page/game-zone.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-game-zone">
  17.         {% block header %}
  18.             {% include '@web/parts/header.html.twig' %}
  19.         {% endblock %}
  20.         {% if gameZoneSlider is not empty %}
  21.             <div class="playground game-zone-slick slider-banner  my-container-fluid">
  22.                 {% for item in gameZoneSlider %}
  23.                     <div class="image-wrapper">
  24.                         <div class="title-wrapper">
  25.                             <span class="standard-title  title-desktop">{{ gameZone.title }}</span>
  26.                             <span class="standard-text ">{{ gameZone.description|raw }}</span>
  27.                         </div>
  28.                         <div class="image-desktop-wrapper">
  29.                             <img class="image-desktop" src="{{ item.image }}" alt="image">
  30.                         </div>
  31.                     </div>
  32.                 {% endfor %}
  33.             </div>
  34.         {% endif %}
  35.         {% if gameZone.body %}
  36.             <div class="header-wrapper section-fragmented full my-container-fluid">
  37.                 <div class="standard-text">
  38.                     {{ gameZone.body|raw }}
  39.                 </div>
  40.             </div>
  41.         {% endif %}
  42.         {% if  gameZone.additionalInfo %}
  43.             <div class="description-wrapper">
  44.                 <div class="item w-100">
  45.                     <span>{{ gameZone.additionalInfo|raw }}</span>
  46.                 </div>
  47.             </div>
  48.         {% endif %}
  49.         <div class="my-container-fluid">
  50.             <div class=" game-zone-images-wrapper">
  51.                 {% if  gameZone.images %}
  52.                     {% for item in gameZone.images %}
  53.                         <div class="game-zone-image">
  54.                             <img src="{{ item }}" width="100%" alt="gameZone">
  55.                         </div>
  56.                     {% endfor %}
  57.                 {% endif %}
  58.             </div>
  59.         </div>
  60.         <div class="my-container-fluid">
  61.         {% if  gameZone.video %}
  62.             <div class="video-wrapper  mt-5 mb-5">
  63.                 <video  muted autoplay loop  id="game-zone-video" >
  64.                     <source src="{{ gameZone.video }}">
  65.                 </video>
  66.                  <button class="play-button"  id="playBtn"
  67.                         onclick="toggleVideoPlay()">{{ svg('public/static_images/svg/play.svg')|raw }}</button>
  68.             </div>
  69.         {% endif %}
  70.         </div>
  71.         {% block footer %}
  72.             {% include '@web/parts/footer.html.twig' %}
  73.         {% endblock %}
  74.     </section>
  75. {% endblock %}
  76. {% block javascripts %}
  77.     {{ parent() }}
  78.     <script>
  79.         function toggleVideoPlay() {
  80.             const video = document.getElementById('game-zone-video');
  81.             const playBtn = document.getElementById('playBtn');
  82.             if (window.innerWidth < 991) {
  83.                 if (playBtn.style.opacity === "0") {
  84.                     playBtn.style.opacity = "1";
  85.                 } else {
  86.                     playBtn.style.opacity = "0";
  87.                 }
  88.             }
  89.             if (video.paused) {
  90.                 video.play();
  91.                 playBtn.classList.add('button-opacity')
  92.             } else {
  93.                 playBtn.classList.remove('button-opacity')
  94.                 video.pause();
  95.             }
  96.         }
  97.     </script>
  98. {% endblock %}