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

Open in your IDE?
  1. {% extends 'new/base.html.twig' %}
  2. {% block title %}{{ page.seoTitle }}{% endblock %}
  3. {% block seoDescription %}{{ page.seoDescription  }}{% endblock %}
  4. {% block body %}
  5.     {% for bb in pageBlocks %}
  6.         {% if bb.block.module == false %}
  7.             <div style="margin-bottom: -100px">
  8.             {{ blocks[bb.block.name].content | raw  }}
  9.             </div>
  10.         {% else %}
  11.             {{ include('new\\widgets\\'~bb.block.name~'.html.twig') }}
  12.         {% endif %}
  13.     {% endfor %}
  14. {% endblock %}
  15. {% block javascripts %}
  16.     {{ parent() }}
  17.     <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
  18.     <script>
  19.         $(document).ready(function (){
  20.             var chHome;
  21.             function graphHome(){
  22.                 // var json = [1000,2000,2000,3000,4000];
  23.                 var json = {{ indexPriceHomeElems | json_encode | raw }};
  24.                 var months = ['Январь','Февраль','Март', 'Апрель', 'Май', 'Июнь'];
  25.                 var ctx = document.getElementById('graphHome');
  26.                 if (chHome) {
  27.                     chHome.destroy();
  28.                 }
  29.                 chHome = new Chart(ctx, {
  30.                     type: 'line',
  31.                     data: {
  32.                         labels: months,
  33.                         datasets: [{
  34.                             label: '',
  35.                             data: json,
  36.                             borderColor: '#2E3D56',
  37.                             backgroundColor: '#2E3D56',
  38.                             borderWidth: 1
  39.                         }]
  40.                     },
  41.                     options: {
  42.                         plugins: {
  43.                             legend: {
  44.                                 display: false
  45.                             },
  46.                             // tooltip: false
  47.                         },
  48.                     }
  49.                 });
  50.             }
  51.             graphHome();
  52.             var chArea;
  53.             function graphArea(){
  54.                 // var json = [1000,2000,2000,3000,4000];
  55.                 var json = {{ indexPriceAreaElems | json_encode | raw }};
  56.                 var months = ['Январь','Февраль','Март', 'Апрель', 'Май', 'Июнь'];
  57.                 var ctx2 = document.getElementById('graphArea');
  58.                 if (chArea) {
  59.                     chArea.destroy();
  60.                 }
  61.                 chArea = new Chart(ctx2, {
  62.                     type: 'line',
  63.                     data: {
  64.                         labels: months,
  65.                         datasets: [{
  66.                             label: '',
  67.                             data: json,
  68.                             borderColor: '#2E3D56',
  69.                             backgroundColor: '#2E3D56',
  70.                             borderWidth: 1
  71.                         }]
  72.                     },
  73.                     options: {
  74.                         plugins: {
  75.                             legend: {
  76.                                 display: false
  77.                             },
  78.                             // tooltip: false
  79.                         },
  80.                     }
  81.                 });
  82.             }
  83.             graphArea();
  84.             var cj = false;
  85.             $(window).scroll(function (){
  86.                 var sc = $(window).scrollTop();
  87.                 if (sc > 1600 && cj == false){
  88.                     cj = true;
  89.                     $('.counter_j').each(function () {
  90.                         $(this).prop('Counter',0).animate({
  91.                             Counter: parseFloat($(this).text())
  92.                         }, {
  93.                             duration: 2000,
  94.                             easing: 'swing',
  95.                             step: function (now) {
  96.                                 $(this).text(Math.ceil(now));
  97.                             }
  98.                         });
  99.                     });
  100.                 }
  101.             })
  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.             });
  117.             $('.btn-next').click(function (){
  118.                 owlMain.trigger('next.owl.carousel');
  119.             })
  120.             var owlItog = $('#slider-itog').owlCarousel({
  121.                 loop:false,
  122.                 margin:10,
  123.                 smartSpeed: 500,
  124.                 nav:false,
  125.                 dots:false,
  126.                 rewindNav:false,
  127.                 touchDrag  : false,
  128.                 mouseDrag  : false,
  129.                 animateOut: 'fadeOutDownBig',
  130.                 animateIn: 'fadeInDownBig',
  131.                 responsive: {
  132.                     0: {
  133.                         items: 1
  134.                     },
  135.                 },
  136.             });
  137.             owlItog.on('changed.owl.carousel', function(event) {
  138.                 $('.counter_j').each(function () {
  139.                     $(this).prop('Counter',0).animate({
  140.                         Counter: parseFloat($(this).text())
  141.                     }, {
  142.                         duration: 2000,
  143.                         easing: 'swing',
  144.                         step: function (now) {
  145.                             $(this).text(Math.ceil(now));
  146.                         }
  147.                     });
  148.                 });
  149.                 setTimeout(function (){
  150.                     $('.index-itog .arrows-number').html($('.owl-item.active .itog_year').text());
  151.                 }, 400);
  152.             })
  153.             var owlReviews = $('#reviews-slider').owlCarousel({
  154.                 loop:true,
  155.                 margin:10,
  156.                 smartSpeed: 500,
  157.                 nav:false,
  158.                 dots:false,
  159.                 responsive: {
  160.                     0: {
  161.                         items: 1
  162.                     },
  163.                 }
  164.             });
  165.             $('.btn-itog-preview').click(function (){
  166.                 if ($(this).attr('src') == '/assets/images/new/icon_arr_left_white.svg'){
  167.                     owlItog.trigger('next.owl.carousel');
  168.                     $('.btn-itog-next').attr('src', '/assets/images/new/icon_arr_right_white.svg');
  169.                     setTimeout(function (){
  170.                         if ( $('#slider-itog .owl-item').eq(($('#slider-itog .owl-item').length-1)).hasClass('active') ){
  171.                             $('.btn-itog-preview').attr('src', '/assets/images/new/icon_arr_left_gray.svg');
  172.                         }
  173.                     },300);
  174.                 }
  175.             });
  176.             $('.btn-itog-next').click(function (){
  177.                 if ($(this).attr('src') == '/assets/images/new/icon_arr_right_white.svg'){
  178.                     owlItog.trigger('prev.owl.carousel');
  179.                     $('.btn-itog-preview').attr('src', '/assets/images/new/icon_arr_left_white.svg');
  180.                     setTimeout(function (){
  181.                         if ( $('#slider-itog .owl-item').eq(0).hasClass('active') ){
  182.                             $('.btn-itog-next').attr('src', '/assets/images/new/icon_arr_right_gray.svg');
  183.                         }
  184.                     },300);
  185.                 }
  186.             })
  187.             $('.btn-review-preview').click(function (){
  188.                 owlReviews.trigger('prev.owl.carousel');
  189.             });
  190.             $('.btn-review-next').click(function (){
  191.                 owlReviews.trigger('next.owl.carousel');
  192.             })
  193.             $('.select-circle').click(function (){
  194.                 // $(this).toggleClass('active');
  195.             })
  196.             $('.modal-content form').submit(function (){
  197.                 $(this).find('button[type="submit"]').attr('disabled','disabled');
  198.             })
  199.         })
  200.     </script>
  201. {% endblock %}