templates/website/page/special-offers.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-special-offers">
  17.         {% block header %}
  18.             {% include '@web/parts/header.html.twig' %}
  19.         {% endblock %}
  20.         <div class="special-offers-wrapper my-container-fluid">
  21.             <div class="image-wrapper">
  22.                 <img src="{{ specialOffers.image| imagine_filter('thumbnail_view') }}" alt="{{ specialOffers.title }}">
  23.             </div>
  24.         </div>
  25.         <div class="body-wrapper">
  26.             <div class="info-wrapper">
  27.                 <div class="title color-darkblue m-0">{{ specialOffers.title }}</div>
  28.                 <div class="text color-darkblue">{{ specialOffers.body|raw }} </div>
  29.                 {% if specialOffers.buttonText and specialOffers.buttonSlug %}
  30.                     <a href="/{{ app.request.locale }}/{{ specialOffers.buttonSlug }}" class="btn-red">
  31.                         {{ specialOffers.buttonText }}
  32.                     </a>
  33.                 {% endif %}
  34.                 {#                <a href="" class="btn-red buy-ticket">Գնե՛ք տոմսը հիմա</a> #}
  35.             </div>
  36.             {% if  specialOffers.additionalInfo is not empty and specialOffers.slug == 'charity' %}
  37.             <div class="attention-message border-0 section-fragmented w-100 text-white p-4">
  38.                 <div>{{ 'BenefactorsFromRussia'|trans }}
  39.                     {% if specialOffers.file is not empty %}
  40.                         <a class="btn-red" href="{{ specialOffers.file }}" target="_blank">
  41.                             {{ 'հաշվեհամար'|trans }}
  42.                         </a>
  43.                     {% endif %}
  44.                 </div>
  45.                 {% endif %}
  46.                 {% if  specialOffers.additionalInfo and specialOffers.slug != 'charity'  %}
  47.                 <div class="attention-message border-0 section-fragmented w-100 text-white p-4">
  48.                     {{ specialOffers.additionalInfo|raw }}
  49.                 </div>
  50.                 {% endif %}
  51.                 {% if  specialOffers.video is not empty %}
  52.                     <div class="video-wrapper">
  53.                         <video muted autoplay loop id="specialOffers-video">
  54.                             <source src="{{ specialOffers.video }}">
  55.                         </video>
  56.                         <button class="play-button" id="playBtn"
  57.                                 onclick="toggleVideoPlay()">{{ svg('public/static_images/svg/play.svg')|raw }}</button>
  58.                     </div>
  59.                 {% endif %}
  60.             </div>
  61.             {% block footer %}
  62.                 {% include '@web/parts/footer.html.twig' %}
  63.             {% endblock %}
  64.     </section>
  65.     <script>
  66.         function toggleVideoPlay() {
  67.             const video = document.getElementById('specialOffers-video');
  68.             const playBtn = document.getElementById('playBtn');
  69.             if (window.innerWidth < 991) {
  70.                 if (playBtn.style.opacity === "0") {
  71.                     playBtn.style.opacity = "1";
  72.                 } else {
  73.                     playBtn.style.opacity = "0";
  74.                 }
  75.             }
  76.             if (video.paused) {
  77.                 video.play();
  78.                 playBtn.classList.add('button-opacity')
  79.             } else {
  80.                 playBtn.classList.remove('button-opacity')
  81.                 video.pause();
  82.             }
  83.         }
  84.     </script>
  85. {% endblock %}