{% extends 'base.html.twig' %}
{% block title %}Biens{% endblock %}
{% block metaDescription %}
{% set headerContent = content('Biens', 'Header') %}
<meta name="description" content="
{% if headerContent.content is defined %}
{{ headerContent.content|striptags }}
{% else %}
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.
{% endif %}
">
{% endblock %}
{% block body %}
{% set headerContent = content('Biens', 'Header') %}
{% if headerContent.picture is defined and headerContent.picture is not empty %}
{% set backgroundImage = headerContent.picture[0].path %}
{% else %}
{% set backgroundImage = 'empty' %}
{% endif %}
{#
<header class="header-tracol slider-home slider-not-home who-is bottom-right-border position-relative overflow-hidden to-right" id="sliderHeader" style="background: url({% if backgroundImage == 'empty' %}'https://tracol.lu/uploads/images/residences-61c0b1dd3141b610699350.jpeg'{% else %}'/uploads/images/{{ backgroundImage }}'{% endif %}) center center no-repeat;background-size:cover;">
<div class="container-fluid">
<div id="header-habiter" class="col-lg-8 mx-auto div-svg-header">
<div class="header-habiter-div2">
{% if headerContent.name is defined %}
<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>
<h2 class="header-habiter-title col-lg-8">{{ headerContent.name }}</h2>
{% endif %}
</div>
</div>
</div>
</header>
#}
<div class="container-fluid">
{% set sectionContent1 = content('Biens', 'Section-1') %}
{#
<div class="col-lg-8 mx-auto div-svg-header pre-section">
<div class="col-lg-5 property-title" style="font-size: 2.3em;display: flex;flex-direction: column;margin-left: 10px;">
<svg xmlns="http://www.w3.org/2000/svg" width="9.089" height="14.77" viewBox="0 0 9.089 14.77">
<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"/>
</svg>
{% if properties|length == 0 %}
<h1 class="lowercase-title">Nous n'avons aucun bien correspondant à votre recherche.</h1>
{% elseif properties|length == 1 %}
<h1 class="project-title">{{ properties|length }} bien disponible</h1>
{% else %}
<h1 class="project-title">{{properties|length }} biens disponibles</h1>
{% endif %}
</div>
<div class="separator"></div>
<div class="col-lg-6 pre-section-content">
{% if sectionContent1.content is defined %}
{{ sectionContent1.content|raw }}
{% else %}
Que vous soyez un particulier ou un professionnel, que vous recherchiez un appartement, une maison, un bureau ou un commerce, nos équipes d’experts vous accompagnent tout au long de votre projet immobilier.
{% endif %}
</div>
</div>
#}
<section class="project" style="margin-top: 60px">
<div id="button-property-page" class="col-lg-8 mx-auto div-svg-header" style="display: flex; align-items: center; padding-left: 7px">
<button data-id="all" class="btn btn-primary all border-radius projectButton"><span class="span-all">TOUS</span></button>
<button data-id="sale" class="btn btn-primary come border-radius projectButton"><span class="span-projects">ACHAT</span></button>
<button data-id="rental" class="btn btn-primary come border-radius projectButton"><span class="span-projects">LOCATION</span></button>
</div>
<div id="button-property-page-mobile" class="col-lg-8 mx-auto div-svg-header" style="display: none; align-items: center">
{#<div id="flick3" class="flicking-viewport">
<div class="flicking-camera">
<button data-id="all" class="btn btn-primary all border-radius projectButton"><span class="span-all">TOUS</span></button>
<button data-id="sale" class="btn btn-primary come border-radius projectButton"><span class="span-projects">ACHAT</span></button>
<button data-id="rental" class="btn btn-primary come border-radius projectButton"><span class="span-projects">LOCATION</span></button>
</div>
</div>#}
</div>
<div class="col-xl-8 mx-auto div-svg-header deactive-tablet" style="display: flex; flex-direction: column; justify-content: center">
<div class="col-md-4" style="margin-top: 40px">
<p>Trier par :</p>
<form>
<select name="subfilter" class="form-control with-appearance" id="filterProperties">
<option value="">Sélectionner</option>
<option value="date">Date de publication</option>
<option value="asc">Prix croissant</option>
<option value="desc">Prix décroissant</option>
</select>
</form>
</div>
{#
<div style="display: flex; flex-direction: row; padding-left: 7px; align-items: center; margin-top: 15px;">
<div id="filter-desktop" class="filters-biens">
{% for key, subType in getTypeProperties() %}
<button data-id="{{ key }}" class="select-projet">{{ subType }} <i class="fas fa-times"></i></button>
{% endfor %}
</div>
<div id="filter-mobile" class="col-lg-3 div-form selectSubFilter property" style="display: none">
<div class="input-group dropdown show">
<label class="label-search-filter" for="location">Filtrer par Type</label>
<input style="height: 75px; width: 60px;" type="text" autocomplete="off" name="filters" id="filters"
class="form-control" aria-expanded="false">
<ul id="form-search-filter-ajax" class="dropdown-menu form-search-filter-ajax" aria-labelledby="">
{% for key, subType in getTypeProperties() %}
<li value="{{ key }}" data-id="{{ key }}" class="select-filter"><i class="fas fa-times"></i>{{ subType }}</li>
{% endfor %}
</ul>
</div>
</div>
</div>
#}
<div id="loading">
<h1 id="showOutput"></h1>
</div>
<div id="properties" class="row col-lg-12">
{% for property in properties %}
<div class="property col-xxl-4 col-xl-6 col-lg-6 col-md-6 col-sm-12 div-img-hover-2" data-date="{{ property.created_at }}" data-price="{{ property.price.value }}" style="cursor: pointer">
{#
<div class="div-hover-2" id="div-hover-2" aria-haspopup="true" style="position: absolute; bottom: 8px; left: 9px; background-color: #242424; color: white; width: 291px; height: 70px">
{% if property.comments[0].comment is not empty %}
<p class="project-content">
{{ property.comments[0].comment|slice(0, 350) }}</p>
<a href="{{ path('property-detail', {'id': property.id}) }}" class="project-arrow-2">
<span class="galerry-ref"></span><i class="fas fa-arrow-right project-svg-arrow-2"></i>
</a>
{% else %}
<a style="margin-top: 180px" href="{{ path('property-detail', {'id': property.id}) }}" class="project-arrow-2">
<span class="galerry-ref"></span><i class="fas fa-arrow-right project-svg-arrow-2"></i>
</a>
{% endif %}
</div>
<div class="col-lg-3 properties-price-absolute" style="background-color: #c48300; height: 56px;">
<p style="font-size: 20px;" class="properties-price">
{{ property.price.value == null ? '<span style="font-size: 14px !important;">sur demande</span>' : property.price.value ~ property.price.currency|replace({"EUR": " €"}) }}
</p>
</div>
#}
{# <div class="tag-ref-projet-2"><span class="text-tag-ref">{{ specialPropertyCategory(property.category) }}</span></div> #}
{% if property.pictures is not empty %}
<div class="position-relative properties-slide slick-slide-single-{{ loop.index }} image">
{% for picture in property.pictures|slice(0,3) %}
{% set url = 'http' in picture.url ? picture.url : asset('uploads/images/properties/'~property.id~'/'~picture.url) %}
<div class="img" style="background: url('{{ url }}')no-repeat center;background-size:cover;" onclick="location.href='{{ path('property-detail', {'id': property.id}) }}'">
</div>
{% endfor %}
</div>
{% else %}
<div class="position-relative properties-slide image">
<a href="{{ path('property-detail', {'id': property.id}) }}"><img src="{{ asset('build/Hudson_Ontario2.png') }}" /></a>
</div>
{% endif %}
<a href="{{ path('property-detail', {'id': property.id}) }}">
<div class="row col-md-12 justify-content-between">
<ul class="col-md-4 items">
<li class="item surface">
{#
<img src="{{ asset('img/surface.svg') }}" class="surface-logo">
#}
{{ property.area.value == null ? '' : property.area.value ~ areaConversion(property.area.unit) }}
</li>
{% if property.bedrooms != 0 %}
<li class="item surface">
<img src="{{ asset('img/icons/chambre.svg') }}" alt="Icone chambre" style="width:22px;margin-right:10px;margin-top:5px;"> {{ property.bedrooms }}
</li>
{% endif %}
</ul>
<div class="col-md-8 properties-price d-flex justify-content-end">
{{ property.price.value == null ? '<span style="font-size: 21px !important;">sur demande</span>' : property.price.value|number_format(2, ',', ' ') ~ property.price.currency|replace({"EUR": " €"}) }}
</div>
</div>
<p class="city">{{ property.city.name }}</p>
<p class="project-name">{{ getTypeProperty(property.type) }}</p>
</a>
</div>
{% else %}
<h4>Aucun bien disponible avec ces critères</h4>
{% endfor %}
</div>
{#<div class="text-center text-capitalize more-projects">
<p>AFFICHER PLUS DE BIENS</p>
</div>#}
</div>
</section>
<section class="other-properties pt-5 pb-5" style="background:#F7F7F7">
<div class="col-lg-8 mx-auto div-svg-header" style="display: flex;">
<div class="col-lg-6">
<svg xmlns="http://www.w3.org/2000/svg" width="9.089" height="14.77" viewBox="0 0 9.089 14.77">
<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"></path>
</svg>
<h1 class="project-title">
{% if app.request.attributes.get('_route_params')['keyword'] is defined or idCategory is defined %}
{% if (app.request.attributes.get('_route_params')['keyword'] is defined and app.request.attributes.get('_route_params')['keyword'] == 'location') or (idCategory is defined and idCategory == 1) %}
{% set otherDispo = 'vente' %}
{% else %}
{% set otherDispo = 'location' %}
{% endif %}
{% else %}
{% set otherDispo = null %}
{% endif %}
NOS biens disponibles<br> {% if otherDispo %}À la <span style="color:#F6A400">{{ otherDispo }}</span>{% endif %}
</h1>
</div>
</div>
<div class="col-lg-8 mx-auto">
<div id="propertiesOther" class="col-lg-12 property-other-list" style="display: flex; flex-wrap: wrap; flex-direction: row">
{% for property in otherProperties %}
<div class="property-other other col-xl-4 col-lg-6 col-md-12 col-sm-12 div-img-hover-2" style="cursor: pointer">
{#
<div class="div-hover-2" id="div-hover-2" aria-haspopup="true" style="position: absolute; bottom: 8px; left: 9px; background-color: #242424; color: white; width: 291px; height: 70px">
{% if property.comments[0].comment is not empty %}
<p class="project-content">
{{ property.comments[0].comment|slice(0, 350) }}</p>
<a href="{{ path('property-detail', {'id': property.id}) }}" class="project-arrow-2">
<span class="galerry-ref"></span><i class="fas fa-arrow-right project-svg-arrow-2"></i>
</a>
{% else %}
<a style="margin-top: 180px" href="{{ path('property-detail', {'id': property.id}) }}" class="project-arrow-2">
<span class="galerry-ref"></span><i class="fas fa-arrow-right project-svg-arrow-2"></i>
</a>
{% endif %}
</div>
<div class="col-lg-3 properties-price-absolute" style="background-color: #c48300; height: 56px;">
<p style="font-size: 20px;" class="properties-price">
{{ property.price.value == null ? '<span style="font-size: 14px !important;">sur demande</span>' : property.price.value ~ property.price.currency|replace({"EUR": " €"}) }}
</p>
</div>
#}
{# <div class="tag-ref-projet-2"><span class="text-tag-ref">{{ specialPropertyCategory(property.category) }}</span></div> #}
{% if property.pictures is not empty %}
<div class="position-relative properties-slide slick-slide-single-{{ loop.index }}">
{% for picture in property.pictures|slice(0,3) %}
{# <img class="img-100" src="{{ picture.url }}">#}
{% set url = 'http' in picture.url ? picture.url : asset('uploads/images/properties/'~property.id~'/'~picture.url) %}
<div class="img" style="background-image: url('{{ url }}')" onclick="location.href='{{ path('property-detail', {'id': property.id}) }}'">
</div>
{% endfor %}
</div>
{% else %}
<div class="position-relative properties-slide">
<a href="{{ path('property-detail', {'id': property.id}) }}"><img src="{{ asset('build/Hudson_Ontario2.png') }}" /></a>
</div>
{% endif %}
<a href="{{ path('property-detail', {'id': property.id}) }}">
<div class="row col-md-12 justify-content-between infos-list">
<ul class="col-md-4 items">
<li class="item surface">
{# <img src="{{ asset('img/surface.svg') }}" alt="icon surface" class="surface-logo"> #}
{{ property.area.value == null ? '' : property.area.value ~ areaConversion(property.area.unit) }}
</li>
</ul>
<div class="col-md-8 properties-price d-flex justify-content-end">
{{ property.price.value == null ? '<span style="font-size: 14px !important;">sur demande</span>' : property.price.value|number_format(2, ',', ' ') ~ property.price.currency|replace({"EUR": " €"}) }}
</div>
</div>
<p class="city">{{ property.city.name }}</p>
<p class="project-name">{{ getTypeProperty(property.type) }}</p>
</a>
</div>
{% endfor %}
</div>
{% set paramUrl = app.request.get('keyword') %}
{% if app.request.get('keyword') == 'location' %}
{% set paramUrl = 'vente' %}
{% elseif app.request.get('keyword') == 'vente' %}
{% set paramUrl = 'location' %}
{% endif %}
<div id="link-none" class="col-lg-12 mx-auto other-property-link div-svg-header d-flex justify-content-end">
<div>
<a id="link-none-a d-flex" class="property-span-arrow" href="{{ path('properties', {'keyword': paramUrl}) }}">Découvrir plus
<svg class="svg-inline--fa fa-arrow-right fa-w-14 property-arrow" aria-hidden="true" focusable="false" data-prefix="fas" data-icon="arrow-right" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" data-fa-i2svg=""><path fill="currentColor" d="M190.5 66.9l22.2-22.2c9.4-9.4 24.6-9.4 33.9 0L441 239c9.4 9.4 9.4 24.6 0 33.9L246.6 467.3c-9.4 9.4-24.6 9.4-33.9 0l-22.2-22.2c-9.5-9.5-9.3-25 .4-34.3L311.4 296H24c-13.3 0-24-10.7-24-24v-32c0-13.3 10.7-24 24-24h287.4L190.9 101.2c-9.8-9.3-10-24.8-.4-34.3z"></path></svg><!-- <i class="fas fa-arrow-right property-arrow"></i> Font Awesome fontawesome.com -->
</a>
</div>
</div>
</div>
</section>
{#
<section style="margin-bottom: 80px; margin-top: 150px;">
<div class="col-lg-8 mx-auto div-svg-header">
{% set sectionContent1 = content('Biens', 'Section-2') %}
<div id="habiter-content-id" class="col-lg-6 habiter-content">
<svg xmlns="http://www.w3.org/2000/svg" width="9.089" height="14.77" viewBox="0 0 9.089 14.77">
<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"/>
</svg>
<div class="col-lg-7">
<h1 class="habiter-title mb-5">
{% if sectionContent1.name is defined %}
{{ sectionContent1.name }}
{% else %}
HABITER AU LUXEMBOURG
{% endif %}
</h1>
{% if sectionContent1.content is defined %}
{{ sectionContent1.content|raw }}
{% else %}
Vous avez découvert l’appartement ou la maison de vos rêves ? Parfait ! En achetant au Luxembourg vous pouvez bénéficier de plusieurs avantages fiscaux.
{% endif %}
</div>
</div>
<div id="display-none-mobile" class="col-lg-6 habiter-img">
{% if sectionContent1.picture is defined %}
<img id="img-property-section" class="img-100" src="/uploads/images/{{ sectionContent1.picture[0].path }}">
{% else %}
<img id="img-property-section" class="img-100" src="https://tracol.lu/uploads/images/millebierg-6194cb6331d44212004123.png">
{% endif %}
</div>
</div>
<div id="link-none" class="col-lg-8 mx-auto div-svg-header">
<div style="display: flex; align-content: center">
<a id="link-none-a" class="property-span-arrow" href="{{ path('habiter') }}">Découvrir les avantages
<i class="fas fa-arrow-right property-arrow"></i>
</a>
</div>
</div>
</section>
#}
</div>
<div id="img-property-section" class="container-fluid" style="display: none">
<div id="link-ok" class="col-lg-3" style="display: flex; align-content: center">
<a class="property-span-arrow" href="{{ path('habiter') }}">Découvrir les avantages
<i class="fas fa-arrow-right property-arrow"></i>
</a>
</div>
<div class="col-lg-6 habiter-img">
{% if sectionContent1.picture is defined and sectionContent1.picture[0] is defined %}
<img style="padding: 0px;" class="img-100" src="/uploads/images/{{ sectionContent1.picture[0].path }}">
{% else %}
<img style="padding: 0px;" class="img-100" src="https://tracol.lu/uploads/images/millebierg-6194cb6331d44212004123.png">
{% endif %}
</div>
</div>
<script>
{#const slideNextHeader = document.getElementById('slideNextHeader');#}
{#const slidePreviousHeader = document.getElementById('slidePreviousHeader');#}
{#const propertiesCity = document.getElementsByClassName('properties-city')#}
{#const propertiesArea = document.getElementsByClassName('properties-area')#}
{#const propertiesReference = document.getElementsByClassName('properties-reference')#}
{#const propertiesPrice = document.getElementsByClassName('properties-price')#}
{#const propertiesLink = document.getElementsByClassName('properties-link')#}
{#const currentFigure = document.getElementsByClassName('current-figure')#}
{#const lastFigure = document.getElementsByClassName('last-figure')#}
{#let slideHeader = document.getElementById('sliderHeader');#}
{#let positionHeader = 0;#}
{#let positionThumbHeader = 1;#}
{#arraySlidesHeader = [#}
{# {#}
{# 'position': 1,#}
{# 'img': '{{ saleProperties[0].pictures[0].url }}',#}
{# 'city': '{{ saleProperties[0].city.name }}',#}
{# 'area': '{{ saleProperties[0].area.value == null ? '' : saleProperties[0].area.value ~ areaConversion(saleProperties[0].area.unit) }}',#}
{# 'reference': '{{ saleProperties[0].reference }}',#}
{# 'price': '{{ saleProperties[0].price.value == null ? '<span style="font-size: 14px !important;">sur demande</span>' : saleProperties[0].price.value ~ saleProperties[0].price.currency|replace({"EUR": " €"}) }}',#}
{# 'link': '{{ path('property-detail', {'id': saleProperties[0].id}) }}',#}
{# 'dot': 'dot1'#}
{# },#}
{# {#}
{# 'position': 2,#}
{# 'img': '{{ saleProperties[1].pictures[0].url }}',#}
{# 'city': '{{ saleProperties[1].city.name }}',#}
{# 'area': '{{ saleProperties[1].area.value == null ? '' : saleProperties[1].area.value ~ areaConversion(saleProperties[1].area.unit) }}',#}
{# 'reference': '{{ saleProperties[1].reference }}',#}
{# 'price': '{{ saleProperties[1].price.value == null ? '<span style="font-size: 14px !important;">sur demande</span>' : saleProperties[1].price.value ~ saleProperties[1].price.currency|replace({"EUR": " €"}) }}',#}
{# 'link': '{{ path('property-detail', {'id': saleProperties[1].id}) }}',#}
{# 'dot': 'dot2'#}
{# },#}
{# {#}
{# 'position': 3,#}
{# 'img': '{{ saleProperties[2].pictures[0].url }}',#}
{# 'city': '{{ saleProperties[2].city.name }}',#}
{# 'area': '{{ saleProperties[2].area.value == null ? '' : saleProperties[2].area.value ~ areaConversion(saleProperties[2].area.unit) }}',#}
{# 'reference': '{{ saleProperties[2].reference }}',#}
{# 'price': '{{ saleProperties[2].price.value == null ? '<span style="font-size: 14px !important;">sur demande</span>' : saleProperties[2].price.value ~ saleProperties[2].price.currency|replace({"EUR": " €"}) }}',#}
{# 'link': '{{ path('property-detail', {'id': saleProperties[2].id}) }}',#}
{# 'dot': 'dot3'#}
{# },#}
{#];#}
{#slidePreviousHeader.addEventListener('click', () => {#}
{# if (arraySlidesHeader.length < (positionThumbHeader + 1)) {#}
{# positionHeader = 0;#}
{# positionThumbHeader = 1;#}
{# } else {#}
{# positionHeader++;#}
{# positionThumbHeader++;#}
{# }#}
{# slideHeader.style.background = `url(${arraySlidesHeader[positionHeader].img})no-repeat center`;#}
{# propertiesCity[0].innerHTML = arraySlidesHeader[positionHeader].city#}
{# propertiesArea[0].innerHTML = arraySlidesHeader[positionHeader].area#}
{# propertiesReference[0].innerHTML = arraySlidesHeader[positionHeader].reference#}
{# propertiesPrice[0].innerHTML = arraySlidesHeader[positionHeader].price#}
{# propertiesLink[0].setAttribute('href', arraySlidesHeader[positionHeader].link)#}
{# currentFigure[0].innerHTML = '0'+positionThumbHeader#}
{# slideHeader.style.backgroundSize = `cover`;#}
{#});#}
{#slideNextHeader.addEventListener('click', () => {#}
{# if (positionThumbHeader === 1) {#}
{# positionHeader = (arraySlidesHeader.length - 1);#}
{# positionThumbHeader = arraySlidesHeader.length;#}
{# } else {#}
{# positionHeader = positionHeader - 1;#}
{# positionThumbHeader = positionThumbHeader - 1;#}
{# }#}
{# slideHeader.style.background = `url(${arraySlidesHeader[positionHeader].img})no-repeat center`;#}
{# propertiesCity[0].innerHTML = arraySlidesHeader[positionHeader].city#}
{# propertiesArea[0].innerHTML = arraySlidesHeader[positionHeader].area#}
{# propertiesReference[0].innerHTML = arraySlidesHeader[positionHeader].reference#}
{# propertiesPrice[0].innerHTML = arraySlidesHeader[positionHeader].price#}
{# currentFigure[0].innerHTML = '0'+positionThumbHeader#}
{# slideHeader.style.backgroundSize = `cover`;#}
{#});#}
const futurProjects = document.getElementById('properties')
let buttons = document.getElementsByClassName('projectButton')
for (const eElement of buttons) {
eElement.addEventListener('click', function (e) {
e.preventDefault()
for (let button of buttons) {
if (button.classList.contains('all')){
button.classList.remove('all')
button.classList.add('come')
button.querySelector('span').classList.replace('span-all', 'span-projects')
}
}
eElement.classList.remove('come')
eElement.classList.add('all')
eElement.querySelector('span').classList.replace('span-projects', 'span-all')
fetch('properties/display/'+this.dataset.id, {
method: 'GET',
})
.then(response => response.json())
.then(data => {
futurProjects.innerHTML = ''
futurProjects.innerHTML = data.data
_ww = $(window).width();
var lightbox = $('.lightbox'),
item = 0;
$('.lightbox-on').click(function(e){
e.stopPropagation();
item = 0;
var id = $(this).attr('data-id'),
max = 0;
$('#'+id).toggle();
$('#'+id).animate({opacity: 1}, 300);
$('#'+id).find('img').each(function( i ) {
max = i;
item = 1;
counter(item, max+1);
itemWidth($(this));
});
});
lightbox.click(function(e) {
e.stopPropagation();
$(this).animate({opacity: 0}, 300, function(){
$(this).toggle();
});
});
$('.closer').on('click', function (e) {
e.stopPropagation();
$(this).parent().animate(
{opacity: 0},
300,
function(){
$(this).toggle();
}
);
});
function itemWidth(img){
img.closest('.items').width(img.width());
}
function counter(item, max){
$('.counter').text(item + ' / ' + max);
}
$('.item', lightbox).on('click, swipeleft', function (e) {
var wd = $(this).width(),
last = $(this).parent().find('.item').last(),
img = $(this).find('.img');
itemWidth(img);
$(this).animate(
{marginLeft: -wd, opacity: 0},
500,
'swing',
function(){
$(this).insertAfter(last);
$(this).css({marginLeft: 0, opacity: 1});
}
);
});
$('.item', lightbox).on('swiperight', function (e) {
var wd = $(this).width(),
first = $(this).parent().find('.item').first(),
last = $(this).parent().find('.item').last(),
img = $(this).find('.img');
itemWidth(img);
$(last).insertBefore($(this));
$(last).css({marginLeft: -wd, opacity: 0});
$(this).parent().find('.item').eq(0).animate(
{marginLeft: 0, opacity: 1},
500,
'swing'
);
});
$('.arrows', lightbox).on('click', function (e) {
e.stopPropagation();
var wd = $(this).siblings('.items').find('.item').eq(0).width(),
max = $(this)
.siblings('.items').find('.item').length,
first = $(this).siblings('.items').find('.item').first(),
last = $(this).siblings('.items').find('.item').last(),
isRight = $(this).hasClass('right'),
marginL = isRight ? -wd : 0,
marginL0 = isRight ? 0: -wd,
opacOn = isRight ? 1 : 0,
opacOff = isRight ? 0 : 1;
if (!isRight){
$(last).insertBefore(first);
$(last).css({marginLeft: -wd, opacity: 0});
item++;
if (item == max+1) {item = 1};
} else {
item--;
if (item == 0) {item = max};
};
counter(item, max);
var img = $(this).siblings('.items').find('.item').eq(0).find('.img');
itemWidth(img);
$(this).siblings('.items').find('.item').eq(1).animate(
{opacity: opacOn},
500,
'swing');
$(this).siblings('.items').find('.item').eq(0).animate(
{marginLeft: marginL, opacity: 1},
500,
'swing',
function(){
if (isRight){
$(this).insertAfter(last);
$(this).css({ marginLeft: 0, opacity: 1});
}
}
);
});
if (_ww > 768){
$('.div-img-hover-2').hover(function (e) {
$(this).find('.project-arrow-2').animate({opacity: 1}, 150);
var htext = $(this).find('.project-content').height();
if (htext == undefined){htext = 0};
$(this).find('.div-hover-2').animate({height : htext+180}, 150);
$(this).find('.project-content').css({'visibility': 'visible'});
$(this).find('.project-content').animate({opacity: 1}, 150);
}, function() {
$(this).find('.div-hover-2').animate({height : 85}, 150);
$(this).find('.project-arrow-2').animate({opacity: 0}, 150);
$(this).find('.project-content').animate({opacity: 0}, 150, function(){
$(this).find('.project-content').css({'visibility': 'hidden'});
});
});
} else {
$('.div-img-hover-2').on( "tap", function( event ) {
var opened = $(this).find('.div-hover-2').hasClass('open'),
ht = opened ? 85 : '100%',
vis = opened ? 0 : 1;
$(this).find('.div-hover-2').toggleClass('open');
$(this).find('.div-hover-2').animate({height : ht}, 150);
$(this).find('.project-arrow-2').animate({opacity: vis}, 150);
});
}
})
.catch((error) => {
console.error('Error:', error);
});
})
}
if (window.matchMedia("(max-width: 768px)").matches) {
new Flicking("#flick3", {
moveType: "freeScroll",
bound: true
});
}
if (window.matchMedia("(max-width: 768px)").matches) {
const test = document.getElementsByClassName('select-filter')
for (const testElement of test) {
testElement.addEventListener('click', function (e) {
e.preventDefault()
testElement.classList.toggle('select-projet-active')
const infos = document.querySelector('.projectButton.all')
const dataId = []
const tests = document.querySelectorAll('.select-filter.select-projet-active')
for (const test1 of tests) {
dataId.push(parseFloat(test1.dataset.id))
}
fetch('properties/display/'+infos.dataset.id+'/params/' + JSON.stringify(dataId), {
method: 'GET',
})
.then(response => response.json())
.then(data => {
futurProjects.innerHTML = data.data
})
.catch((error) => {
console.error('Error:', error);
});
})
}
} else {
const test = document.getElementsByClassName('select-projet')
const textOutput = document.querySelector("#showOutput");
for (const testElement of test) {
testElement.addEventListener('click', function (e) {
displayLoading()
e.preventDefault()
testElement.classList.toggle('select-projet-active')
const infos = document.querySelector('.projectButton.all')
const dataId = []
const tests = document.querySelectorAll('.select-projet.select-projet-active')
for (const test1 of tests) {
dataId.push(parseFloat(test1.dataset.id))
}
fetch('properties/display/'+infos.dataset.id+'/params/' + JSON.stringify(dataId), {
method: 'GET'
})
.then(response => response.json())
.then(data => {
hideLoading()
futurProjects.innerHTML = data.data
_ww = $(window).width();
var lightbox = $('.lightbox'),
item = 0;
$('.lightbox-on').click(function(e){
e.stopPropagation();
item = 0;
var id = $(this).attr('data-id'),
max = 0;
$('#'+id).toggle();
$('#'+id).animate({opacity: 1}, 300);
$('#'+id).find('img').each(function( i ) {
max = i;
item = 1;
counter(item, max+1);
itemWidth($(this));
});
});
lightbox.click(function(e) {
e.stopPropagation();
$(this).animate({opacity: 0}, 300, function(){
$(this).toggle();
});
});
$('.closer').on('click', function (e) {
e.stopPropagation();
$(this).parent().animate(
{opacity: 0},
300,
function(){
$(this).toggle();
}
);
});
function itemWidth(img){
img.closest('.items').width(img.width());
}
function counter(item, max){
$('.counter').text(item + ' / ' + max);
}
$('.item', lightbox).on('click, swipeleft', function (e) {
var wd = $(this).width(),
last = $(this).parent().find('.item').last(),
img = $(this).find('.img');
itemWidth(img);
$(this).animate(
{marginLeft: -wd, opacity: 0},
500,
'swing',
function(){
$(this).insertAfter(last);
$(this).css({marginLeft: 0, opacity: 1});
}
);
});
$('.item', lightbox).on('swiperight', function (e) {
var wd = $(this).width(),
first = $(this).parent().find('.item').first(),
last = $(this).parent().find('.item').last(),
img = $(this).find('.img');
itemWidth(img);
$(last).insertBefore($(this));
$(last).css({marginLeft: -wd, opacity: 0});
$(this).parent().find('.item').eq(0).animate(
{marginLeft: 0, opacity: 1},
500,
'swing'
);
});
$('.arrows', lightbox).on('click', function (e) {
e.stopPropagation();
var wd = $(this).siblings('.items').find('.item').eq(0).width(),
max = $(this)
.siblings('.items').find('.item').length,
first = $(this).siblings('.items').find('.item').first(),
last = $(this).siblings('.items').find('.item').last(),
isRight = $(this).hasClass('right'),
marginL = isRight ? -wd : 0,
marginL0 = isRight ? 0: -wd,
opacOn = isRight ? 1 : 0,
opacOff = isRight ? 0 : 1;
if (!isRight){
$(last).insertBefore(first);
$(last).css({marginLeft: -wd, opacity: 0});
item++;
if (item == max+1) {item = 1};
} else {
item--;
if (item == 0) {item = max};
};
counter(item, max);
var img = $(this).siblings('.items').find('.item').eq(0).find('.img');
itemWidth(img);
$(this).siblings('.items').find('.item').eq(1).animate(
{opacity: opacOn},
500,
'swing');
$(this).siblings('.items').find('.item').eq(0).animate(
{marginLeft: marginL, opacity: 1},
500,
'swing',
function(){
if (isRight){
$(this).insertAfter(last);
$(this).css({ marginLeft: 0, opacity: 1});
}
}
);
});
if (_ww > 768){
$('.div-img-hover-2').hover(function (e) {
$(this).find('.project-arrow-2').animate({opacity: 1}, 150);
var htext = $(this).find('.project-content').height();
if (htext == undefined){htext = 0};
$(this).find('.div-hover-2').animate({height : htext+180}, 150);
$(this).find('.project-content').css({'visibility': 'visible'});
$(this).find('.project-content').animate({opacity: 1}, 150);
}, function() {
$(this).find('.div-hover-2').animate({height : 85}, 150);
$(this).find('.project-arrow-2').animate({opacity: 0}, 150);
$(this).find('.project-content').animate({opacity: 0}, 150, function(){
$(this).find('.project-content').css({'visibility': 'hidden'});
});
});
} else {
$('.div-img-hover-2').on( "tap", function( event ) {
var opened = $(this).find('.div-hover-2').hasClass('open'),
ht = opened ? 85 : '100%',
vis = opened ? 0 : 1;
$(this).find('.div-hover-2').toggleClass('open');
$(this).find('.div-hover-2').animate({height : ht}, 150);
$(this).find('.project-arrow-2').animate({opacity: vis}, 150);
});
}
$('.div-hover').hover(function (e) {
$(this).find('.project-arrow-2').animate({opacity: 1}, 150);
}, function() {
$(this).find('.project-arrow-2').animate({opacity: 0}, 50);
});
})
.catch((error) => {
});
})
}
}
const filter = document.getElementById('filters')
const filterElement = document.getElementById('form-search-filter-ajax')
filter.addEventListener('click', function (e) {
e.preventDefault()
filterElement.classList.toggle('show')
})
const loader = document.querySelector("#loading");
function displayLoading() {
loader.classList.add("display");
// to stop loading after some time
setTimeout(() => {
loader.classList.remove("display");
}, 5000);
}
// hiding loading
function hideLoading() {
loader.classList.remove("display");
}
</script>
<script>
const arrowPrev = `<svg xmlns="http://www.w3.org/2000/svg" width="7.985" height="13.211" viewBox="0 0 7.985 13.211">
<path id="np_arrow-up_888648_000000" d="M13.211,1.381l-6.606,6.6L0,1.381,1.381,0,6.606,5.022h0L11.83,0Z" transform="translate(7.985) rotate(90)" fill="#fff"/>
</svg>`;
const arrowNext= `<svg xmlns="http://www.w3.org/2000/svg" width="7.985" height="13.211" viewBox="0 0 7.985 13.211">
<path id="np_arrow-up_888648_000000" d="M13.211,1.381l-6.606,6.6L0,1.381,1.381,0,6.606,5.022h0L11.83,0Z" transform="translate(7.985) rotate(90)" fill="#fff"/>
</svg>`;
var countProperties = '{{ properties|length }}';
var loopProp = 1;
while (loopProp <= countProperties+3) {
$('.slick-slide-single-'+loopProp).slick({
'slidesToShow': 1,
'prevArrow': `<div class="arrow-left square-black d-flex justify-content-center align-items-center position-absolute">${arrowPrev}</div>`,
'nextArrow': `<div class="arrow-right square-black d-flex justify-content-center align-items-center position-absolute">${arrowNext}</div>`
});
{#
if (window.innerWidth > 768) {
$('.slick-slide-single-'+loopProp).slick({
'slidesToShow': 1,
'prevArrow': `<div class="arrow-left square-black d-flex justify-content-center align-items-center position-absolute">${arrowPrev}</div>`,
'nextArrow': `<div class="arrow-right square-black d-flex justify-content-center align-items-center position-absolute">${arrowNext}</div>`
});
}
#}
loopProp++;
}
</script>
{% endblock %}