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