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 = headerContent.picture[0].path %}
  17.     {% else %}
  18.         {% set backgroundImage = 'empty' %}
  19.     {% endif %}
  20.     <header class="header-tracol col-lg-8 mx-auto" style="background-image: url({% if backgroundImage != 'empty' %}'/uploads/images/{{ backgroundImage }}'{% else %}{{ asset('img/projets_header.jpg') }}{% endif %});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 %}
  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: 120px">
  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="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">
  165.                                             <div class="img" style="background-image: url('{{ property.pictures.0.url }}')"  onclick="location.href='{{ path('project-detail', {'id': property.id}) }}'">
  166.                                             </div>
  167.                                     </div>
  168.                                 {% else %}
  169.                                     <div class="img" style="background-image: url('{{ asset('build/Maisons_H_R1.jpg') }}')"></div>
  170.                                 {% endif %}
  171.                                 {#
  172.                                 <div class="row col-md-12 justify-content-between">
  173.                                     <ul class="col-md-4 items">
  174.                                         <li class="item surface">
  175.                                             <img src="{{ asset('img/surface.svg') }}" class="surface-logo"> {{ property.area.value == null ? '' : property.area.value ~ areaConversion(property.area.unit) }}
  176.                                         </li>
  177.                                     </ul>
  178.                                     <div class="col-md-8 properties-price d-flex justify-content-end">
  179.                                         {{ property.price.value == null ? '<span style="font-size: 14px !important;">sur demande</span>' : property.price.value|number_format(2, ',', ' ') ~  property.price.currency|replace({"EUR": " €"})  }}
  180.                                     </div>
  181.                                 </div>
  182.                                 #}
  183.                                 <p class="city">{{ property.city.name }}</p>
  184.                                 <p class="project-name">{{ property.reference }}</p>
  185.                                 <div class="tag-ref-projet-2"><span class="text-tag-ref">{{ typeProject(property.construction.construction_step) }}</span></div>
  186.                             </div>
  187.                         {% endfor %}
  188.                     </div>
  189.                 </div>
  190.                 <div class="text-center text-capitalize more-projects">
  191.                     <p>AFFICHER PLUS DE PROJETS</p>
  192.                 </div>
  193.             </div>
  194.             {#
  195.             <div class="col-lg-8 mx-auto div-svg-header content-projet">
  196.                 {% set sectionContent1 = content('Projets', 'Section-2') %}
  197.                 <div id="section-2-project" class="col-lg-6 habiter-content">
  198.                     <svg xmlns="http://www.w3.org/2000/svg" width="9.089" height="14.77" viewBox="0 0 9.089 14.77">
  199.                         <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"/>
  200.                     </svg>
  201.                     <div class="col-lg-9">
  202.                         <h1 class="habiter-title mb-5">
  203.                             {% if sectionContent1.name is defined %}{{ sectionContent1.name }}{% else %}INVESTIR À LUXEMBOURG{% endif %}
  204.                         </h1>
  205.                         {% 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 %}
  206.                     </div>
  207.                 </div>
  208.                 <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 %}>
  209.                 </div>
  210.             </div>
  211.             <div class="col-lg-12 div-svg-header last-section-project">
  212.                 <div id="section-projet-margin" class="offset-lg-2 col-lg-2" style="display: flex; justify-content: flex-start;">
  213.                     <a id="link-more" class="property-span-arrow" href="{{ path('invest') }}">EN SAVOIR PLUS
  214.                         <i class="fas fa-arrow-right property-arrow"></i>
  215.                     </a>
  216.                 </div>
  217.                 <div class="col-lg-3" style="display: flex;justify-content: flex-start;margin-left: 0;">
  218.                     <a href="{{ path('location-management') }}" class="property-span-arrow">LA GESTION LOCATIVE
  219.                         <i class="fas fa-arrow-right property-arrow"></i>
  220.                     </a>
  221.                 </div>
  222.             </div>
  223.             #}
  224.         </section>
  225.     </div>
  226.     <div id="img-property-section" class="container-fluid" style="display: none">
  227.         <div class="col-lg-6 habiter-img">
  228.             <img style="padding: 0px;" height="430px" class="img-100" {% if sectionContent1.picture is defined %}src="/uploads/images/{{ sectionContent1.picture[0].path }}"{% endif %}>
  229.         </div>
  230.     </div>
  231.     <script>
  232.         const futurProjects = document.getElementById('projects')
  233.         let buttons = document.getElementsByClassName('projectButton')
  234.         for (const eElement of buttons) {
  235.             eElement.addEventListener('click', function (e) {
  236.                 e.preventDefault()
  237.                 for (let button of buttons) {
  238.                     if (button.classList.contains('all')){
  239.                         button.classList.remove('all')
  240.                         //button.classList.add('come')
  241.                         //button.querySelector('span').classList.replace('span-all', 'span-projects')
  242.                     }
  243.                 }
  244.                 eElement.classList.remove('come')
  245.                 //eElement.classList.add('all')
  246.                 //eElement.querySelector('span').classList.replace('span-projects', 'span-all')
  247.                 fetch('projects/display/'+this.dataset.id, {
  248.                     method: 'GET',
  249.                 })
  250.                     .then(response => response.json())
  251.                     .then(data => {
  252.                         futurProjects.innerHTML = ''
  253.                         futurProjects.innerHTML = data.data
  254.                         _ww = $(window).width();
  255.                         var lightbox = $('.lightbox'),
  256.                             item = 0;
  257.                         $('.lightbox-on').click(function(e){
  258.                             e.stopPropagation();
  259.                             item = 0;
  260.                             console.log('click btn');
  261.                             var id = $(this).attr('data-id'),
  262.                                 max = 0;
  263.                             $('#'+id).toggle();
  264.                             $('#'+id).animate({opacity: 1}, 300);
  265.                             $('#'+id).find('img').each(function( i ) {
  266.                                 //console.log('h : '+$(this).height());
  267.                                 //console.log('w : '+$(this).width());
  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.                                 console.log('down');
  375.                                 $(this).find('.div-hover-2').animate({height : 85}, 150);
  376.                                 $(this).find('.project-arrow-2').animate({opacity: 0}, 150);
  377.                                 $(this).find('.project-content').animate({opacity: 0}, 150, function(){
  378.                                     $(this).find('.project-content').css({'visibility': 'hidden'});
  379.                                 });
  380.                             });
  381.                         } else {
  382.                             $('.div-img-hover-2').on( "tap", function( event ) {
  383.                                 console.log('tap tap');
  384.                                 var opened = $(this).find('.div-hover-2').hasClass('open'),
  385.                                     ht = opened ? 85 : '100%',
  386.                                     vis = opened ? 0 : 1;
  387.                                 $(this).find('.div-hover-2').toggleClass('open');
  388.                                 $(this).find('.div-hover-2').animate({height : ht}, 150);
  389.                                 $(this).find('.project-arrow-2').animate({opacity: vis}, 150);
  390.                             });
  391.                         }
  392.                         $('.div-hover').hover(function (e) {
  393.                             $(this).find('.project-arrow-2').animate({opacity: 1}, 150);
  394.                         }, function() {
  395.                             $(this).find('.project-arrow-2').animate({opacity: 0}, 50);
  396.                         });
  397.                     })
  398.                     .catch((error) => {
  399.                         console.error('Error:', error);
  400.                     });
  401.             })
  402.         }
  403.         if (window.matchMedia("(max-width: 768px)").matches) {
  404.             const test = document.getElementsByClassName('select-filter')
  405.             for (const testElement of test) {
  406.                 testElement.addEventListener('click', function (e) {
  407.                     e.preventDefault()
  408.                     testElement.classList.toggle('select-projet-active')
  409.                     const infos = document.querySelector('.projectButton.all')
  410.                     const dataId = []
  411.                     const tests = document.querySelectorAll('.select-filter.select-projet-active')
  412.                     for (const test1 of tests) {
  413.                         dataId.push(parseFloat(test1.dataset.id))
  414.                     }
  415.                     fetch('projects/display/'+infos.dataset.id+'/params/' + JSON.stringify(dataId), {
  416.                         method: 'GET'
  417.                     })
  418.                         .then(response => response.json())
  419.                         .then(data => {
  420.                             futurProjects.innerHTML = data.data
  421.                         })
  422.                         .catch((error) => {
  423.                             console.error('Error:', error);
  424.                         });
  425.                 })
  426.             }
  427.         } else {
  428.             const test = document.getElementsByClassName('select-projet')
  429.             for (const testElement of test) {
  430.                 testElement.addEventListener('click', function (e) {
  431.                     displayLoading()
  432.                     e.preventDefault()
  433.                     testElement.classList.toggle('select-projet-active')
  434.                     const infos = document.querySelector('.projectButton.all')
  435.                     const dataId = []
  436.                     const tests = document.querySelectorAll('.select-projet.select-projet-active')
  437.                     for (const test1 of tests) {
  438.                         dataId.push(parseFloat(test1.dataset.id))
  439.                     }
  440.                     fetch('projects/display/'+infos.dataset.id+'/params/' + JSON.stringify(dataId), {
  441.                         method: 'GET'
  442.                     })
  443.                         .then(response => response.json())
  444.                         .then(data => {
  445.                             hideLoading()
  446.                             futurProjects.innerHTML = data.data
  447.                             _ww = $(window).width();
  448.                             var lightbox = $('.lightbox'),
  449.                                 item = 0;
  450.                             $('.lightbox-on').click(function(e){
  451.                                 e.stopPropagation();
  452.                                 item = 0;
  453.                                 console.log('click btn');
  454.                                 var id = $(this).attr('data-id'),
  455.                                     max = 0;
  456.                                 $('#'+id).toggle();
  457.                                 $('#'+id).animate({opacity: 1}, 300);
  458.                                 $('#'+id).find('img').each(function( i ) {
  459.                                     //console.log('h : '+$(this).height());
  460.                                     //console.log('w : '+$(this).width());
  461.                                     max = i;
  462.                                     item = 1;
  463.                                     counter(item, max+1);
  464.                                     itemWidth($(this));
  465.                                 });
  466.                             });
  467.                             lightbox.click(function(e) {
  468.                                 e.stopPropagation();
  469.                                 $(this).animate({opacity: 0}, 300, function(){
  470.                                     $(this).toggle();
  471.                                 });
  472.                             });
  473.                             $('.closer').on('click', function (e) {
  474.                                 e.stopPropagation();
  475.                                 $(this).parent().animate(
  476.                                     {opacity: 0},
  477.                                     300,
  478.                                     function(){
  479.                                         $(this).toggle();
  480.                                     }
  481.                                 );
  482.                             });
  483.                             function itemWidth(img){
  484.                                 img.closest('.items').width(img.width());
  485.                             }
  486.                             function counter(item, max){
  487.                                 $('.counter').text(item + ' / ' + max);
  488.                             }
  489.                             $('.item', lightbox).on('click, swipeleft', function (e) {
  490.                                 var wd = $(this).width(),
  491.                                     last = $(this).parent().find('.item').last(),
  492.                                     img = $(this).find('.img');
  493.                                 itemWidth(img);
  494.                                 $(this).animate(
  495.                                     {marginLeft: -wd, opacity: 0},
  496.                                     500,
  497.                                     'swing',
  498.                                     function(){
  499.                                         $(this).insertAfter(last);
  500.                                         $(this).css({marginLeft: 0, opacity: 1});
  501.                                     }
  502.                                 );
  503.                             });
  504.                             $('.item', lightbox).on('swiperight', function (e) {
  505.                                 var wd = $(this).width(),
  506.                                     first = $(this).parent().find('.item').first(),
  507.                                     last = $(this).parent().find('.item').last(),
  508.                                     img = $(this).find('.img');
  509.                                 itemWidth(img);
  510.                                 $(last).insertBefore($(this));
  511.                                 $(last).css({marginLeft: -wd, opacity: 0});
  512.                                 $(this).parent().find('.item').eq(0).animate(
  513.                                     {marginLeft: 0, opacity: 1},
  514.                                     500,
  515.                                     'swing'
  516.                                 );
  517.                             });
  518.                             $('.arrows', lightbox).on('click', function (e) {
  519.                                 e.stopPropagation();
  520.                                 var wd = $(this).siblings('.items').find('.item').eq(0).width(),
  521.                                     max = $(this)
  522.                                         .siblings('.items').find('.item').length,
  523.                                     first = $(this).siblings('.items').find('.item').first(),
  524.                                     last = $(this).siblings('.items').find('.item').last(),
  525.                                     isRight = $(this).hasClass('right'),
  526.                                     marginL = isRight ? -wd : 0,
  527.                                     marginL0 = isRight ? 0: -wd,
  528.                                     opacOn = isRight ? 1 : 0,
  529.                                     opacOff = isRight ? 0 : 1;
  530.                                 if (!isRight){
  531.                                     $(last).insertBefore(first);
  532.                                     $(last).css({marginLeft: -wd, opacity: 0});
  533.                                     item++;
  534.                                     if (item == max+1) {item = 1};
  535.                                 } else {
  536.                                     item--;
  537.                                     if (item == 0) {item = max};
  538.                                 };
  539.                                 counter(item, max);
  540.                                 var img = $(this).siblings('.items').find('.item').eq(0).find('.img');
  541.                                 itemWidth(img);
  542.                                 $(this).siblings('.items').find('.item').eq(1).animate(
  543.                                     {opacity: opacOn},
  544.                                     500,
  545.                                     'swing');
  546.                                 $(this).siblings('.items').find('.item').eq(0).animate(
  547.                                     {marginLeft: marginL, opacity: 1},
  548.                                     500,
  549.                                     'swing',
  550.                                     function(){
  551.                                         if (isRight){
  552.                                             $(this).insertAfter(last);
  553.                                             $(this).css({ marginLeft: 0, opacity: 1});
  554.                                         }
  555.                                     }
  556.                                 );
  557.                             });
  558.                             if (_ww > 768){
  559.                                 $('.div-img-hover-2').hover(function (e) {
  560.                                     $(this).find('.project-arrow-2').animate({opacity: 1}, 150);
  561.                                     var htext = $(this).find('.project-content').height();
  562.                                     if (htext == undefined){htext = 0};
  563.                                     $(this).find('.div-hover-2').animate({height : htext+180}, 150);
  564.                                     $(this).find('.project-content').css({'visibility': 'visible'});
  565.                                     $(this).find('.project-content').animate({opacity: 1}, 150);
  566.                                 }, function() {
  567.                                     console.log('down');
  568.                                     $(this).find('.div-hover-2').animate({height : 85}, 150);
  569.                                     $(this).find('.project-arrow-2').animate({opacity: 0}, 150);
  570.                                     $(this).find('.project-content').animate({opacity: 0}, 150, function(){
  571.                                         $(this).find('.project-content').css({'visibility': 'hidden'});
  572.                                     });
  573.                                 });
  574.                             } else {
  575.                                 $('.div-hover-2').on( "click", function( event ) {
  576.                                     console.log('tap tap');
  577.                                     var opened = $(this).find('.div-hover-2').hasClass('open'),
  578.                                         ht = opened ? 85 : '100%',
  579.                                         vis = opened ? 0 : 1;
  580.                                     $(this).find('.div-hover-2').toggleClass('open');
  581.                                     $(this).find('.div-hover-2').animate({height : ht}, 150);
  582.                                     $(this).find('.project-arrow-2').animate({opacity: vis}, 150);
  583.                                 });
  584.                             }
  585.                             $('.div-hover').hover(function (e) {
  586.                                 $(this).find('.project-arrow-2').animate({opacity: 1}, 150);
  587.                             }, function() {
  588.                                 $(this).find('.project-arrow-2').animate({opacity: 0}, 50);
  589.                             });
  590.                         })
  591.                         .catch((error) => {
  592.                             console.error('Error:', error);
  593.                         });
  594.                 })
  595.             }
  596.         }
  597.         const buttonFilter = document.getElementsByClassName('select-projet')
  598.         for (const buttonFilterElement of buttonFilter) {
  599.             buttonFilterElement.addEventListener('click', function () {
  600.             })
  601.         }
  602.         if (window.matchMedia("(max-width: 768px)").matches) {
  603.             new Flicking("#flick4", {
  604.                 moveType: "freeScroll",
  605.                 bound: true
  606.             });
  607.         }
  608.         const filter = document.getElementById('filters')
  609.         const filterElement = document.getElementById('form-search-filter-ajax')
  610.         filter.addEventListener('click', function (e) {
  611.             e.preventDefault()
  612.             filterElement.classList.toggle('show')
  613.         })
  614.         const loader = document.querySelector("#loading");
  615.         function displayLoading() {
  616.             loader.classList.add("display");
  617.             // to stop loading after some time
  618.             setTimeout(() => {
  619.                 loader.classList.remove("display");
  620.             }, 5000);
  621.         }
  622.         // hiding loading
  623.         function hideLoading() {
  624.             loader.classList.remove("display");
  625.         }
  626.     </script>
  627. {% endblock %}