templates/project.html.twig line 1

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% block title %}Projets{% endblock %}
  3. {% block metaDescription %}
  4.     {% set headerContent = content('Projets', 'Header') %}
  5.     <meta name="description" content="
  6.     {% if headerContent.content is defined %}
  7.         {{ headerContent.content|striptags }}
  8.     {% else %}
  9.          Tracol Immobilier propose une large offre en immobilier neuf (logements, bureaux, commerces), qui se caractérise par une architecture résolument contemporaine, des matériaux de qualité, et le soin apporté à chaque détail.
  10.     {% endif %}
  11.     ">
  12. {% endblock %}
  13. {% block body %}
  14.     {% set headerContent = content('Projets', 'Header') %}
  15.     {% if headerContent.picture is defined and headerContent.picture is not empty %}
  16.         {% set backgroundImage = '/uploads/images/'~headerContent.picture[0].path %}
  17.     {% else %}
  18.         {% set backgroundImage = 'img/projets_header.jpg' %}
  19.     {% endif %}
  20.     <header class="header-tracol col-lg-8 mx-auto" style="background-image: url({{ backgroundImage }});margin-top: 165px!important;">
  21.         <div class="col-lg-8 mx-auto div-svg-header">
  22.             <div id="header-project" class="header-habiter-div">
  23.                 {% if headerContent.name is defined and headerContent.name %}
  24.                     <svg id="svg-habiter" width="10" height="16" xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:avocode="https://avocode.com/" viewBox="0 0 10 16"><defs></defs><desc>Generated with Avocode.</desc><g><g><title>Tracé 76</title><path d="M9.08929,0.51465v0h-9.08929v0v14.77002v0l9.08929,-1.93109v0z" fill="#f6a400" fill-opacity="1"></path></g></g></svg>
  25.                     <h2 class="header-habiter-title col-lg-6">{% if headerContent.name is defined %}{{ headerContent.name }}{% endif %}</h2>
  26.                     <div class="col-lg-8 header-content">
  27.                         {% if headerContent.content is defined %}
  28.                             {{ headerContent.content|raw }}
  29.                         {% else %}
  30.                             <p>Fort de plusieurs années d’expérience, Tracol Immobilier propose des projets adaptés aux besoins de chacun. Répondant aux plus hautes exigences et s’inscrivant dans le temps, ils se caractérisent par une architecture résolument contemporaine, des matériaux de qualité et le soin apporté à chaque détail.</p>
  31.                         {% endif %}
  32.                     </div>
  33.                 {% endif %}
  34.             </div>
  35.         </div>
  36.     </header>
  37.     <div class="container-fluid project-page">
  38.         {% set sectionContent1 = content('Projets', 'Section-1') %}
  39.         <div class="col-lg-8 mx-auto div-svg-header pre-section">
  40.             <div class="col-lg-4" style="font-size: 2.3em;display: flex;flex-direction: column;margin-left: 10px;">
  41.                 <svg xmlns="http://www.w3.org/2000/svg" width="9.089" height="14.77" viewBox="0 0 9.089 14.77">
  42.                     <path id="Tracé_76" data-name="Tracé 76" d="M682.759,232.441h-9.089v14.77l9.089-1.931Z" transform="translate(-673.669 -232.441)" fill="#f6a400"/>
  43.                 </svg>
  44.                 {% if projects|length == 0 %}
  45.                     <h1 class="project-title">pas de projet</h1>
  46.                 {% elseif projects|length == 1  %}
  47.                     <h1 class="project-title">{{ projects|length }} projet</h1>
  48.                 {% else %}
  49.                     <h1 class="project-title">{{ projects|length }} projets</h1>
  50.                 {% endif %}
  51.             </div>
  52.             <div class="separator"></div>
  53.             <div id="section-1-project" class="col-lg-6 pre-section-content">
  54.                 {% if headerContent.content is defined %}
  55.                     {{ sectionContent1.content|raw }}
  56.                 {% else %}
  57.                     Fort de plusieurs années d’expérience, Tracol Immobilier propose des projets adaptés aux besoins de chacun. Répondant aux plus hautes exigences et s’inscrivant dans le temps, ils se caractérisent par une architecture résolument contemporaine, des matériaux de qualité et le soin apporté à chaque détail.{% endif %}
  58.             </div>
  59.         </div>
  60.         <section class="project filter mt-5" style="margin-bottom: 40px">
  61.             <div id="button-project-page" class="col-lg-4 div-svg-header mb-4" style="display: flex; align-items: center; padding-left:25px">
  62.                 <div class="input-filter col-lg-3 d-flex">
  63.                     <label for="all-projects" style="margin-right:10px">TOUS</label>
  64.                     <input data-id="all" type="radio" name="type" id="all-projects" class="mr-3 projectButton">
  65.                 </div>
  66.                 <div class="input-filter col-lg-3 d-flex">
  67.                     <label for="futur-projects" style="margin-right:10px">À VENIR</label>
  68.                     <input data-id="futur" type="radio" name="type" id="futur-projects" class="mr-3 projectButton">
  69.                 </div>
  70.                 <div class="input-filter col-lg-3 d-flex">
  71.                     <label for="construction-projects" style="margin-right:10px">EN COURS</label>
  72.                     <input data-id="construction" type="radio" name="type" id="construction-projects" class=" projectButton">
  73.                 </div>
  74.                 {#
  75.                 <button data-id="all" class="btn btn-primary all border-radius projectButton"><span class="span-all">TOUS</span></button>
  76.                 <button data-id="futur" class="btn btn-primary come border-radius projectButton"><span class="span-projects">A VENIR</span></button>
  77.                 <button data-id="construction" class="btn btn-primary come border-radius projectButton"><span class="span-projects">EN COURS</span></button>
  78.                 #}
  79.             </div>
  80.             <div id="button-project-page-mobile" class="col-lg-8 mx-auto div-svg-header" style="display: none; align-items: center">
  81.                 <div  class="flicking-viewport">
  82.                     <div class="flicking-camera">
  83.                         <div class="input-filter">
  84.                             <label for="all-projects-mobile">TOUS</label>
  85.                             <input data-id="all" type="radio" name="type" id="all-projects-mobile" class="mr-3 projectButton">
  86.                         </div>
  87.                         <div class="input-filter">
  88.                             <label for="futur-projects-mobile">À VENIR</label>
  89.                             <input data-id="futur" type="radio" name="type" id="futur-projects-mobile" class="mr-3 projectButton">
  90.                         </div>
  91.                         <div class="input-filter">
  92.                             <label for="construction-projects-mobile">EN COURS</label>
  93.                             <input data-id="construction" type="radio" name="type" id="construction-projects-mobile" class=" projectButton">
  94.                         </div>
  95.                         {#
  96.                         <button data-id="all" class="btn btn-primary all border-radius projectButton"><span class="span-all">TOUS</span></button>
  97.                         <button data-id="futur" class="btn btn-primary come border-radius projectButton"><span class="span-projects">A VENIR</span></button>
  98.                         <button data-id="construction" class="btn btn-primary come border-radius projectButton"><span class="span-projects">EN COURS</span></button>
  99.                         #}
  100.                     </div>
  101.                 </div>
  102.             </div>
  103.             <div class="col-lg-8 mx-auto div-svg-header" style="display: flex; justify-content: center; flex-direction: column;">
  104.                 {#
  105.                 <div id="filter-project-desktop">
  106.                     {% for key, subType in getSubTypeProject() %}
  107.                         <button data-id="{{ key }}" class="select-projet">{{ subType }} <i class="fas fa-times"></i></button>
  108.                     {% endfor %}
  109.                 </div>
  110.                 <div id="filter-project-mobile" class="col-lg-3 div-form selectSubFilter" style="display: none">
  111.                     <div class="input-group dropdown show">
  112.                         <label class="label-search-filter" for="location">Filtrer par Type</label>
  113.                         <input style="height: 75px; width: 60px;" type="text" autocomplete="off" name="filters" id="filters"
  114.                                class="form-control" aria-expanded="false">
  115.                         <ul id="form-search-filter-ajax" class="dropdown-menu form-search-filter-ajax" aria-labelledby="">
  116.                             {% for key, subType in getSubTypeProject() %}
  117.                                 <li value="{{ key }}" data-id="{{ key }}" class="select-filter"><i class="fas fa-times"></i>{{ subType }}</li>
  118.                             {% endfor %}
  119.                         </ul>
  120.                     </div>
  121.                 </div>
  122.                 #}
  123.                 {#
  124.                 <div id="loading">
  125.                     <h1 id="showOutput"></h1>
  126.                 </div>
  127.                 #}
  128.                 <div id="projects" class="row">
  129.                     {#
  130.                     {% for key, project in projects|slice(0,5) %}
  131.                         <div onclick="location.href='{{ path('project-detail', {'id': project.id}) }}'" data-id="{{ path('project-detail', {'id': project.id}) }}" class="col-lg-12 div-img-hover-2 project-desktop" style="cursor: pointer">
  132.                             {% if key == 0 %}
  133.                                 <div class="div-hover-2" id="div-hover-2" style="position: absolute; bottom: 8px; left: 8px; background-color: #242424; color: white; width: 291px; height: 85px">
  134.                                     <p class="city">{{ project.city.name }}</p>
  135.                                     <p class="project-name">{{ project.reference }}</p>
  136.                                     {% if project.comments[0].comment is not empty %}
  137.                                         <p class="project-content">
  138.                                             {{ project.comments[0].comment|slice(0, 250) }}</p>
  139.                                         <a  href="{{ path('project-detail', {'id': project.id}) }}" class="project-arrow-2">
  140.                                             <span class="galerry-ref"></span><i class="fas fa-arrow-right project-svg-arrow-2"></i>
  141.                                         </a>
  142.                                     {% else %}
  143.                                         <a style="margin-top: 180px" href="{{ path('project-detail', {'id': project.id}) }}" class="project-arrow-2">
  144.                                             <span class="galerry-ref"></span><i class="fas fa-arrow-right project-svg-arrow-2"></i>
  145.                                         </a>
  146.                                     {% endif %}
  147.                                 </div>
  148.                                 <div class="tag-ref-projet-2"><span class="text-tag-ref">{{ typeProject(project.construction.construction_step) }}</span></div>
  149.                                 {% if project.pictures is not empty %}
  150.                                     {% for picture in project.pictures|slice(0,1) %}
  151.                                         <div class="img" style="background-image: url('{{ picture.url }}')"></div>
  152.                                     {% endfor %}
  153.                                 {% else %}
  154.                                     <div class="img" style="background-image: url('{{ asset('build/Hudson_Ontario2.png') }}')"></div>
  155.                                 {% endif %}
  156.                             {% endif %}
  157.                         </div>
  158.                     {% endfor %}
  159.                     #}
  160.                     <div class="col-lg-12 project-desktop" style="display: flex; flex-wrap: wrap; flex-direction: row">
  161.                         {% for key, property in projects %}
  162.                             <div  class="item2 col-12 col-xl-6 col-lg-6 col-md-12 col-sm-12" style="position:relative;cursor: pointer">
  163.                                 {% if property.pictures is not empty %}
  164.                                     <div class="position-relative properties-slide img-wrapper">
  165.                                             {% set url = 'http' in property.pictures.0.url ? property.pictures.0.url : asset('uploads/images/properties/'~property.id~'/'~property.pictures.0.url) %}
  166.                                             <div class="img" style="background-image: url('{{ url }}')"  onclick="location.href='{{ path('project-detail', {'id': property.id}) }}'">
  167.                                             </div>
  168.                                     </div>
  169.                                 {% else %}
  170.                                 <div class="img-wrapper">
  171.                                     <div class="img" style="background-image: url('{{ asset('build/Maisons_H_R1.jpg') }}')"></div>
  172.                                 </div>
  173.                                 {% endif %}
  174.                                 {#
  175.                                 <div class="row col-md-12 justify-content-between">
  176.                                     <ul class="col-md-4 items">
  177.                                         <li class="item surface">
  178.                                             <img src="{{ asset('img/surface.svg') }}" class="surface-logo"> {{ property.area.value == null ? '' : property.area.value ~ areaConversion(property.area.unit) }}
  179.                                         </li>
  180.                                     </ul>
  181.                                     <div class="col-md-8 properties-price d-flex justify-content-end">
  182.                                         {{ property.price.value == null ? '<span style="font-size: 14px !important;">sur demande</span>' : property.price.value|number_format(2, ',', ' ') ~  property.price.currency|replace({"EUR": " €"})  }}
  183.                                     </div>
  184.                                 </div>
  185.                                 #}
  186.                                 <p class="city">{{ property.city.name }}</p>
  187.                                 <p class="project-name">{{ property.reference }}</p>
  188.                                 <div class="tag-ref-projet-2"><span class="text-tag-ref">{{ typeProject(property.construction.construction_step) }}</span></div>
  189.                             </div>
  190.                         {% endfor %}
  191.                     </div>
  192.                 </div>
  193.                 <div class="text-center text-capitalize more-projects">
  194.                     <p>AFFICHER PLUS DE PROJETS</p>
  195.                 </div>
  196.             </div>
  197.             {#
  198.             <div class="col-lg-8 mx-auto div-svg-header content-projet">
  199.                 {% set sectionContent1 = content('Projets', 'Section-2') %}
  200.                 <div id="section-2-project" class="col-lg-6 habiter-content">
  201.                     <svg xmlns="http://www.w3.org/2000/svg" width="9.089" height="14.77" viewBox="0 0 9.089 14.77">
  202.                         <path id="Tracé_76" data-name="Tracé 76" d="M682.759,232.441h-9.089v14.77l9.089-1.931Z" transform="translate(-673.669 -232.441)" fill="#f6a400"/>
  203.                     </svg>
  204.                     <div class="col-lg-9">
  205.                         <h1 class="habiter-title mb-5">
  206.                             {% if sectionContent1.name is defined %}{{ sectionContent1.name }}{% else %}INVESTIR À LUXEMBOURG{% endif %}
  207.                         </h1>
  208.                         {% if sectionContent1.content is defined %}{{ sectionContent1.content|raw }}{% else %}La demande locative est très importante au Luxembourg. En choisissant d’investir dans nos projets, vous avez l’assurance de louer très vite votre bien immobilier sans souci de devoir partir à la recherche de locataires potentiels. Votre investissement devient rapidement rentable. De plus, notre service de gestion locative peut vous accompagner dans votre démarche de A à Z.{% endif %}
  209.                     </div>
  210.                 </div>
  211.                 <div id="display-none-mobile" class="col-lg-6 habiter-img" {% if sectionContent1.picture is defined %}style="background-image: url('/uploads/images/{{ sectionContent1.picture[0].path }}')"{% endif %}>
  212.                 </div>
  213.             </div>
  214.             <div class="col-lg-12 div-svg-header last-section-project">
  215.                 <div id="section-projet-margin" class="offset-lg-2 col-lg-2" style="display: flex; justify-content: flex-start;">
  216.                     <a id="link-more" class="property-span-arrow" href="{{ path('invest') }}">EN SAVOIR PLUS
  217.                         <i class="fas fa-arrow-right property-arrow"></i>
  218.                     </a>
  219.                 </div>
  220.                 <div class="col-lg-3" style="display: flex;justify-content: flex-start;margin-left: 0;">
  221.                     <a href="{{ path('location-management') }}" class="property-span-arrow">LA GESTION LOCATIVE
  222.                         <i class="fas fa-arrow-right property-arrow"></i>
  223.                     </a>
  224.                 </div>
  225.             </div>
  226.             #}
  227.         </section>
  228.     </div>
  229.     <div id="img-property-section" class="container-fluid" style="display: none">
  230.         <div class="col-lg-6 habiter-img">
  231.             <img style="padding: 0px;" height="430px" class="img-100" {% if sectionContent1.picture is defined and sectionContent1.picture[0] is defined %}src="/uploads/images/{{ sectionContent1.picture[0].path }}"{% endif %}>
  232.         </div>
  233.     </div>
  234.     <script>
  235.         const futurProjects = document.getElementById('projects')
  236.         let buttons = document.getElementsByClassName('projectButton')
  237.         for (const eElement of buttons) {
  238.             eElement.addEventListener('click', function (e) {
  239.                 e.preventDefault()
  240.                 for (let button of buttons) {
  241.                     if (button.classList.contains('all')){
  242.                         button.classList.remove('all')
  243.                         //button.classList.add('come')
  244.                         //button.querySelector('span').classList.replace('span-all', 'span-projects')
  245.                     }
  246.                 }
  247.                 eElement.classList.remove('come')
  248.                 //eElement.classList.add('all')
  249.                 //eElement.querySelector('span').classList.replace('span-projects', 'span-all')
  250.                 fetch('projects/display/'+this.dataset.id, {
  251.                     method: 'GET',
  252.                 })
  253.                     .then(response => response.json())
  254.                     .then(data => {
  255.                         futurProjects.innerHTML = ''
  256.                         futurProjects.innerHTML = data.data
  257.                         _ww = $(window).width();
  258.                         var lightbox = $('.lightbox'),
  259.                             item = 0;
  260.                         $('.lightbox-on').click(function(e){
  261.                             e.stopPropagation();
  262.                             item = 0;
  263.                             var id = $(this).attr('data-id'),
  264.                                 max = 0;
  265.                             $('#'+id).toggle();
  266.                             $('#'+id).animate({opacity: 1}, 300);
  267.                             $('#'+id).find('img').each(function( i ) {
  268.                                 max = i;
  269.                                 item = 1;
  270.                                 counter(item, max+1);
  271.                                 itemWidth($(this));
  272.                             });
  273.                         });
  274.                         lightbox.click(function(e) {
  275.                             e.stopPropagation();
  276.                             $(this).animate({opacity: 0}, 300, function(){
  277.                                 $(this).toggle();
  278.                             });
  279.                         });
  280.                         $('.closer').on('click', function (e) {
  281.                             e.stopPropagation();
  282.                             $(this).parent().animate(
  283.                                 {opacity: 0},
  284.                                 300,
  285.                                 function(){
  286.                                     $(this).toggle();
  287.                                 }
  288.                             );
  289.                         });
  290.                         function itemWidth(img){
  291.                             img.closest('.items').width(img.width());
  292.                         }
  293.                         function counter(item, max){
  294.                             $('.counter').text(item + ' / ' + max);
  295.                         }
  296.                         $('.item', lightbox).on('click, swipeleft', function (e) {
  297.                             var wd = $(this).width(),
  298.                                 last = $(this).parent().find('.item').last(),
  299.                                 img = $(this).find('.img');
  300.                             itemWidth(img);
  301.                             $(this).animate(
  302.                                 {marginLeft: -wd, opacity: 0},
  303.                                 500,
  304.                                 'swing',
  305.                                 function(){
  306.                                     $(this).insertAfter(last);
  307.                                     $(this).css({marginLeft: 0, opacity: 1});
  308.                                 }
  309.                             );
  310.                         });
  311.                         $('.item', lightbox).on('swiperight', function (e) {
  312.                             var wd = $(this).width(),
  313.                                 first = $(this).parent().find('.item').first(),
  314.                                 last = $(this).parent().find('.item').last(),
  315.                                 img = $(this).find('.img');
  316.                             itemWidth(img);
  317.                             $(last).insertBefore($(this));
  318.                             $(last).css({marginLeft: -wd, opacity: 0});
  319.                             $(this).parent().find('.item').eq(0).animate(
  320.                                 {marginLeft: 0, opacity: 1},
  321.                                 500,
  322.                                 'swing'
  323.                             );
  324.                         });
  325.                         $('.arrows', lightbox).on('click', function (e) {
  326.                             e.stopPropagation();
  327.                             var wd = $(this).siblings('.items').find('.item').eq(0).width(),
  328.                                 max = $(this)
  329.                                     .siblings('.items').find('.item').length,
  330.                                 first = $(this).siblings('.items').find('.item').first(),
  331.                                 last = $(this).siblings('.items').find('.item').last(),
  332.                                 isRight = $(this).hasClass('right'),
  333.                                 marginL = isRight ? -wd : 0,
  334.                                 marginL0 = isRight ? 0: -wd,
  335.                                 opacOn = isRight ? 1 : 0,
  336.                                 opacOff = isRight ? 0 : 1;
  337.                             if (!isRight){
  338.                                 $(last).insertBefore(first);
  339.                                 $(last).css({marginLeft: -wd, opacity: 0});
  340.                                 item++;
  341.                                 if (item == max+1) {item = 1};
  342.                             } else {
  343.                                 item--;
  344.                                 if (item == 0) {item = max};
  345.                             };
  346.                             counter(item, max);
  347.                             var img = $(this).siblings('.items').find('.item').eq(0).find('.img');
  348.                             itemWidth(img);
  349.                             $(this).siblings('.items').find('.item').eq(1).animate(
  350.                                 {opacity: opacOn},
  351.                                 500,
  352.                                 'swing');
  353.                             $(this).siblings('.items').find('.item').eq(0).animate(
  354.                                 {marginLeft: marginL, opacity: 1},
  355.                                 500,
  356.                                 'swing',
  357.                                 function(){
  358.                                     if (isRight){
  359.                                         $(this).insertAfter(last);
  360.                                         $(this).css({ marginLeft: 0, opacity: 1});
  361.                                     }
  362.                                 }
  363.                             );
  364.                         });
  365.                         if (_ww > 768){
  366.                             $('.div-img-hover-2').hover(function (e) {
  367.                                 $(this).find('.project-arrow-2').animate({opacity: 1}, 150);
  368.                                 var htext = $(this).find('.project-content').height();
  369.                                 if (htext == undefined){htext = 0};
  370.                                 $(this).find('.div-hover-2').animate({height : htext+180}, 150);
  371.                                 $(this).find('.project-content').css({'visibility': 'visible'});
  372.                                 $(this).find('.project-content').animate({opacity: 1}, 150);
  373.                             }, function() {
  374.                                 $(this).find('.div-hover-2').animate({height : 85}, 150);
  375.                                 $(this).find('.project-arrow-2').animate({opacity: 0}, 150);
  376.                                 $(this).find('.project-content').animate({opacity: 0}, 150, function(){
  377.                                     $(this).find('.project-content').css({'visibility': 'hidden'});
  378.                                 });
  379.                             });
  380.                         } else {
  381.                             $('.div-img-hover-2').on( "tap", function( event ) {
  382.                                 var opened = $(this).find('.div-hover-2').hasClass('open'),
  383.                                     ht = opened ? 85 : '100%',
  384.                                     vis = opened ? 0 : 1;
  385.                                 $(this).find('.div-hover-2').toggleClass('open');
  386.                                 $(this).find('.div-hover-2').animate({height : ht}, 150);
  387.                                 $(this).find('.project-arrow-2').animate({opacity: vis}, 150);
  388.                             });
  389.                         }
  390.                         $('.div-hover').hover(function (e) {
  391.                             $(this).find('.project-arrow-2').animate({opacity: 1}, 150);
  392.                         }, function() {
  393.                             $(this).find('.project-arrow-2').animate({opacity: 0}, 50);
  394.                         });
  395.                     })
  396.                     .catch((error) => {
  397.                         console.error('Error:', error);
  398.                     });
  399.             })
  400.         }
  401.         if (window.matchMedia("(max-width: 768px)").matches) {
  402.             const test = document.getElementsByClassName('select-filter')
  403.             for (const testElement of test) {
  404.                 testElement.addEventListener('click', function (e) {
  405.                     e.preventDefault()
  406.                     testElement.classList.toggle('select-projet-active')
  407.                     const infos = document.querySelector('.projectButton.all')
  408.                     const dataId = []
  409.                     const tests = document.querySelectorAll('.select-filter.select-projet-active')
  410.                     for (const test1 of tests) {
  411.                         dataId.push(parseFloat(test1.dataset.id))
  412.                     }
  413.                     fetch('projects/display/'+infos.dataset.id+'/params/' + JSON.stringify(dataId), {
  414.                         method: 'GET'
  415.                     })
  416.                         .then(response => response.json())
  417.                         .then(data => {
  418.                             futurProjects.innerHTML = data.data
  419.                         })
  420.                         .catch((error) => {
  421.                             console.error('Error:', error);
  422.                         });
  423.                 })
  424.             }
  425.         } else {
  426.             const test = document.getElementsByClassName('select-projet')
  427.             for (const testElement of test) {
  428.                 testElement.addEventListener('click', function (e) {
  429.                     displayLoading()
  430.                     e.preventDefault()
  431.                     testElement.classList.toggle('select-projet-active')
  432.                     const infos = document.querySelector('.projectButton.all')
  433.                     const dataId = []
  434.                     const tests = document.querySelectorAll('.select-projet.select-projet-active')
  435.                     for (const test1 of tests) {
  436.                         dataId.push(parseFloat(test1.dataset.id))
  437.                     }
  438.                     fetch('projects/display/'+infos.dataset.id+'/params/' + JSON.stringify(dataId), {
  439.                         method: 'GET'
  440.                     })
  441.                         .then(response => response.json())
  442.                         .then(data => {
  443.                             hideLoading()
  444.                             futurProjects.innerHTML = data.data
  445.                             _ww = $(window).width();
  446.                             var lightbox = $('.lightbox'),
  447.                                 item = 0;
  448.                             $('.lightbox-on').click(function(e){
  449.                                 e.stopPropagation();
  450.                                 item = 0;
  451.                                 var id = $(this).attr('data-id'),
  452.                                     max = 0;
  453.                                 $('#'+id).toggle();
  454.                                 $('#'+id).animate({opacity: 1}, 300);
  455.                                 $('#'+id).find('img').each(function( i ) {
  456.                                     max = i;
  457.                                     item = 1;
  458.                                     counter(item, max+1);
  459.                                     itemWidth($(this));
  460.                                 });
  461.                             });
  462.                             lightbox.click(function(e) {
  463.                                 e.stopPropagation();
  464.                                 $(this).animate({opacity: 0}, 300, function(){
  465.                                     $(this).toggle();
  466.                                 });
  467.                             });
  468.                             $('.closer').on('click', function (e) {
  469.                                 e.stopPropagation();
  470.                                 $(this).parent().animate(
  471.                                     {opacity: 0},
  472.                                     300,
  473.                                     function(){
  474.                                         $(this).toggle();
  475.                                     }
  476.                                 );
  477.                             });
  478.                             function itemWidth(img){
  479.                                 img.closest('.items').width(img.width());
  480.                             }
  481.                             function counter(item, max){
  482.                                 $('.counter').text(item + ' / ' + max);
  483.                             }
  484.                             $('.item', lightbox).on('click, swipeleft', function (e) {
  485.                                 var wd = $(this).width(),
  486.                                     last = $(this).parent().find('.item').last(),
  487.                                     img = $(this).find('.img');
  488.                                 itemWidth(img);
  489.                                 $(this).animate(
  490.                                     {marginLeft: -wd, opacity: 0},
  491.                                     500,
  492.                                     'swing',
  493.                                     function(){
  494.                                         $(this).insertAfter(last);
  495.                                         $(this).css({marginLeft: 0, opacity: 1});
  496.                                     }
  497.                                 );
  498.                             });
  499.                             $('.item', lightbox).on('swiperight', function (e) {
  500.                                 var wd = $(this).width(),
  501.                                     first = $(this).parent().find('.item').first(),
  502.                                     last = $(this).parent().find('.item').last(),
  503.                                     img = $(this).find('.img');
  504.                                 itemWidth(img);
  505.                                 $(last).insertBefore($(this));
  506.                                 $(last).css({marginLeft: -wd, opacity: 0});
  507.                                 $(this).parent().find('.item').eq(0).animate(
  508.                                     {marginLeft: 0, opacity: 1},
  509.                                     500,
  510.                                     'swing'
  511.                                 );
  512.                             });
  513.                             $('.arrows', lightbox).on('click', function (e) {
  514.                                 e.stopPropagation();
  515.                                 var wd = $(this).siblings('.items').find('.item').eq(0).width(),
  516.                                     max = $(this)
  517.                                         .siblings('.items').find('.item').length,
  518.                                     first = $(this).siblings('.items').find('.item').first(),
  519.                                     last = $(this).siblings('.items').find('.item').last(),
  520.                                     isRight = $(this).hasClass('right'),
  521.                                     marginL = isRight ? -wd : 0,
  522.                                     marginL0 = isRight ? 0: -wd,
  523.                                     opacOn = isRight ? 1 : 0,
  524.                                     opacOff = isRight ? 0 : 1;
  525.                                 if (!isRight){
  526.                                     $(last).insertBefore(first);
  527.                                     $(last).css({marginLeft: -wd, opacity: 0});
  528.                                     item++;
  529.                                     if (item == max+1) {item = 1};
  530.                                 } else {
  531.                                     item--;
  532.                                     if (item == 0) {item = max};
  533.                                 };
  534.                                 counter(item, max);
  535.                                 var img = $(this).siblings('.items').find('.item').eq(0).find('.img');
  536.                                 itemWidth(img);
  537.                                 $(this).siblings('.items').find('.item').eq(1).animate(
  538.                                     {opacity: opacOn},
  539.                                     500,
  540.                                     'swing');
  541.                                 $(this).siblings('.items').find('.item').eq(0).animate(
  542.                                     {marginLeft: marginL, opacity: 1},
  543.                                     500,
  544.                                     'swing',
  545.                                     function(){
  546.                                         if (isRight){
  547.                                             $(this).insertAfter(last);
  548.                                             $(this).css({ marginLeft: 0, opacity: 1});
  549.                                         }
  550.                                     }
  551.                                 );
  552.                             });
  553.                             if (_ww > 768){
  554.                                 $('.div-img-hover-2').hover(function (e) {
  555.                                     $(this).find('.project-arrow-2').animate({opacity: 1}, 150);
  556.                                     var htext = $(this).find('.project-content').height();
  557.                                     if (htext == undefined){htext = 0};
  558.                                     $(this).find('.div-hover-2').animate({height : htext+180}, 150);
  559.                                     $(this).find('.project-content').css({'visibility': 'visible'});
  560.                                     $(this).find('.project-content').animate({opacity: 1}, 150);
  561.                                 }, function() {
  562.                                     $(this).find('.div-hover-2').animate({height : 85}, 150);
  563.                                     $(this).find('.project-arrow-2').animate({opacity: 0}, 150);
  564.                                     $(this).find('.project-content').animate({opacity: 0}, 150, function(){
  565.                                         $(this).find('.project-content').css({'visibility': 'hidden'});
  566.                                     });
  567.                                 });
  568.                             } else {
  569.                                 $('.div-hover-2').on( "click", function( event ) {
  570.                                     var opened = $(this).find('.div-hover-2').hasClass('open'),
  571.                                         ht = opened ? 85 : '100%',
  572.                                         vis = opened ? 0 : 1;
  573.                                     $(this).find('.div-hover-2').toggleClass('open');
  574.                                     $(this).find('.div-hover-2').animate({height : ht}, 150);
  575.                                     $(this).find('.project-arrow-2').animate({opacity: vis}, 150);
  576.                                 });
  577.                             }
  578.                             $('.div-hover').hover(function (e) {
  579.                                 $(this).find('.project-arrow-2').animate({opacity: 1}, 150);
  580.                             }, function() {
  581.                                 $(this).find('.project-arrow-2').animate({opacity: 0}, 50);
  582.                             });
  583.                         })
  584.                         .catch((error) => {
  585.                             console.error('Error:', error);
  586.                         });
  587.                 })
  588.             }
  589.         }
  590.         const buttonFilter = document.getElementsByClassName('select-projet')
  591.         for (const buttonFilterElement of buttonFilter) {
  592.             buttonFilterElement.addEventListener('click', function () {
  593.             })
  594.         }
  595.         if (window.matchMedia("(max-width: 768px)").matches) {
  596.             const flick = document.getElementById("flick4")
  597.             if(flick){
  598.                 new Flicking("#flick4", {
  599.                     moveType: "freeScroll",
  600.                     bound: true
  601.                 })
  602.             }
  603.         }
  604.         const filter = document.getElementById('filters')
  605.         const filterElement = document.getElementById('form-search-filter-ajax')
  606.         filter.addEventListener('click', function (e) {
  607.             e.preventDefault()
  608.             filterElement.classList.toggle('show')
  609.         })
  610.         const loader = document.querySelector("#loading");
  611.         function displayLoading() {
  612.             loader.classList.add("display");
  613.             // to stop loading after some time
  614.             setTimeout(() => {
  615.                 loader.classList.remove("display");
  616.             }, 5000);
  617.         }
  618.         // hiding loading
  619.         function hideLoading() {
  620.             loader.classList.remove("display");
  621.         }
  622.     </script>
  623. {% endblock %}