templates/new/index/project.html.twig line 1

Open in your IDE?
  1. {% extends 'new/base.html.twig' %}
  2. {% block title %}{{ page.seoTitle | raw }}{% endblock %}
  3. {% block seoDescription %}{{ page.seoDescription | raw }}{% endblock %}
  4. {% block opengraph %}
  5.     <meta property="og:type" content="website">
  6.     <meta property="og:url" content="https://mosregco.ru{{ app.request.pathInfo }}">
  7.     <meta property="og:title" content="{{ page.seoTitle | raw }}">
  8.     <meta property="og:description" content="{{ page.seoDescription | raw }}">
  9. {% endblock %}
  10. {% block body %}
  11.     <div style="margin-top: 63px">
  12.         {% for bb in pageBlocks %}
  13.                 <div id="bl{{ bb.block.id }}" dada-name="{{bb.block.name}}">
  14.                     {% if bb.block.name == "project_abou_svg" %}
  15.                         {{ include('new/widgets/project_abou_svg.html.twig') }}
  16.                     {% else %}
  17.                         {% if bb.block.module == false %}
  18.                             {{ blocks[bb.block.name].content | raw  }}
  19.                         {% else %}
  20.                             {{ include('new\\widgets\\'~bb.block.name~'.html.twig') }}
  21.                         {% endif %}
  22.                     {% endif %}
  23.                 </div>
  24.         {% endfor %}
  25.         {% if 1==2 %}
  26.             {{ include('new/widgets/project_residents.html.twig') }}
  27.             {{ blocks['project_slider'].content | raw  }}
  28.             {{ blocks['project_about'].content | raw  }}
  29.             {{ blocks['project_place'].content | raw  }}
  30.             {#        {{ include('new/widgets/project_place.html.twig') }}#}
  31.             {{ blocks['project_advantages'].content | raw  }}
  32.             {#        {{ include('new/widgets/project_slider.html.twig') }}#}
  33.             {#        {{ include('new/widgets/project_about.html.twig') }}#}
  34.             {#        {{ include('new/widgets/project_advantages.html.twig') }}#}
  35.             {{ blocks['project_svg'].content | raw  }}
  36.             {#        {{ include('new/widgets/project_svg.html.twig') }}#}
  37.             {{ blocks['project_abou_svg'].content | raw  }}
  38.             {{ blocks['project_influence'].content | raw  }}
  39.             {{ blocks['project_ideal'].content | raw  }}
  40.             {#        {{ blocks['project_gallery'].content | raw  }}#}
  41.             {#        {{ include('new/widgets/project_abou_svg.html.twig') }}#}
  42.             {#        {{ include('new/widgets/project_influence.html.twig') }}#}
  43.             {#        {{ include('new/widgets/project_ideal.html.twig') }}#}
  44.             {{ include('new/widgets/project_gallery.html.twig') }}
  45.             {{ include('new/widgets/project_content.html.twig') }}
  46.             {{ include('new/widgets/project_map.html.twig') }}
  47.         {% endif %}
  48.         {{ include('new\\modals\\project_item.html.twig') }}
  49.     </div>
  50. {% endblock %}
  51. {% block javascripts %}
  52.     {{ parent() }}
  53.     <script>
  54.         $(document).ready(function (){
  55.             {% if blocks['project_abou_svg'] is defined %}
  56.                 {% for e in project.items  %}
  57.                     {% if e.status == 1 %}
  58.                         $('.map-sector[data-id="{{ e.id }}"]').attr('fill', '#7C8993');
  59.                     {% else %}
  60.                         $('.map-sector[data-id="{{ e.id }}"]').attr('fill', '#D1E4E9');
  61.                         $('.map-sector[data-id="{{ e.id }}"]').removeClass('map-sector');
  62.                     {% endif %}
  63.                 {% endfor %}
  64.             {% endif %}
  65.             var rotate = 0;
  66.             setInterval(function (){
  67.                 rotate += 1;
  68.                 $('.play-btn-circle').css('transform', 'rotate('+rotate+'deg)');
  69.             }, 30);
  70.             var cj = false;
  71.             cj = true;
  72.             var sc = false;
  73.             $(document).scroll(function (){
  74.                 console.log('1')
  75.                 if ($('html').scrollTop() >= 530 && sc == false){
  76.                     sc = true;
  77.                     $('.counter_j').each(function () {
  78.                         $(this).prop('Counter',0).animate({
  79.                             Counter: parseFloat($(this).text())
  80.                         }, {
  81.                             duration: 2000,
  82.                             easing: 'swing',
  83.                             step: function (now) {
  84.                                 $(this).text(Math.ceil(now));
  85.                             }
  86.                         });
  87.                     });
  88.                 }
  89.             })
  90.             var t = 1;
  91.             setInterval(function (){
  92.                 if (t === 0  ){
  93.                     var r = parseInt($('.radar').attr('r'));
  94.                     $('.radar').attr('r', r+1)
  95.                 }else{
  96.                     var r = parseInt($('.radar').attr('r'));
  97.                     $('.radar').attr('r', r-1)
  98.                 }
  99.                 if (r <= 15 ){ t = 0 }
  100.                 if (r >= 30 ){ t = 1 }
  101.             },50);
  102.             var owlMain = $('#slider-main').owlCarousel({
  103.                 loop:true,
  104.                 margin:10,
  105.                 smartSpeed: 500,
  106.                 nav:false,
  107.                 dots:false,
  108.                 responsive: {
  109.                     0: {
  110.                         items: 1
  111.                     },
  112.                 }
  113.             });
  114.             $('.btn-preview').click(function (){
  115.                 owlMain.trigger('prev.owl.carousel');
  116.                 var max = parseInt($('.maxItem').html());
  117.                 var cur = parseInt($('.curItem').html());
  118.                 console.log(cur);
  119.                 console.log(max);
  120.                 cur -- ;
  121.                 if (cur < 1){
  122.                     cur = max;
  123.                 }
  124.                 $('.curItem').html(cur);
  125.             });
  126.             $('.btn-next').click(function (){
  127.                 owlMain.trigger('next.owl.carousel');
  128.                 var max = parseInt($('.maxItem').html());
  129.                 var cur = parseInt($('.curItem').html());
  130.                 console.log(cur);
  131.                 console.log(max);
  132.                 cur ++ ;
  133.                 if (cur > max){
  134.                     cur = 1;
  135.                 }
  136.                 $('.curItem').html(cur);
  137.             })
  138.         });
  139.         ymaps.ready(function () {
  140.             var myMap = new ymaps.Map('mapapi', {
  141.                     center: [56.082014, 37.091618],
  142.                     zoom: 11
  143.                 }, {
  144.                     searchControlProvider: false
  145.                 }),
  146.                 // Создаём макет содержимого.
  147.                 MyIconContentLayout = ymaps.templateLayoutFactory.createClass(
  148.                     '<div style="color: #FFFFFF; font-weight: bold;">111</div>'
  149.                 ),
  150.                 myPlacemark = new ymaps.Placemark([56.082014, 37.091618], {
  151.                     hintContent: 'Корпорация развития Московской области',
  152.                     balloonContent: 'Московская область, Солнечногорский район, поселок Есипово Ленинградское шоссе, трасса М10, 33 км до МКАД'
  153.                 }, {
  154.                     // Опции.
  155.                     // Необходимо указать данный тип макета.
  156.                     iconLayout: 'default#image',
  157.                     // Своё изображение иконки метки.
  158.                     iconImageHref: '/assets/images/new/icon_map.png',
  159.                     // Размеры метки.
  160.                     iconImageSize: [60, 60],
  161.                     // Смещение левого верхнего угла иконки относительно
  162.                     // её "ножки" (точки привязки).
  163.                     iconImageOffset: [-30, -70]
  164.                 })
  165.             myMap.geoObjects
  166.                 .add(myPlacemark);
  167.         });
  168.         $(document).ready(function (){
  169.             var hash = window.location.hash;
  170.             var  item = null;
  171.             if (hash.indexOf('#item') !== false){
  172.                 item = hash.replace('#item','');
  173.                 if ($('path[data-id="'+item+'"]').hasClass('map-sector')){
  174.                     $('path[data-id="'+item+'"]').trigger('click');
  175.                 }
  176.             }
  177.             if (hash == '#panorama'){
  178.                 $('a[data-type="iframe"]').click();
  179.             }
  180.             $('body').on("click", '.link-panorama', function (){
  181.                 $('a[data-type="iframe"]').click();
  182.             })
  183.             $('.owl-carousel-gallery').owlCarousel({
  184.                 loop:true,
  185.                 margin:10,
  186.                 nav:true,
  187.                 responsive:{
  188.                     0:{
  189.                         items:1
  190.                     },
  191.                     600:{
  192.                         items:3
  193.                     },
  194.                     1000:{
  195.                         items:4
  196.                     }
  197.                 }
  198.             });
  199.         })
  200.     </script>
  201. {% endblock %}
  202. {% block stylesheets %}
  203.     {{ parent() }}
  204.     <style>
  205.         .fancybox__content{
  206.             padding: 0 !important;
  207.         }
  208.         .owl-next{
  209.             top: 48%;
  210.         }
  211.         .owl-prev{
  212.             top: 48%;
  213.         }
  214.     </style>
  215. {% endblock %}