<?php
use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
use Twig\Extension\SandboxExtension;
use Twig\Markup;
use Twig\Sandbox\SecurityError;
use Twig\Sandbox\SecurityNotAllowedTagError;
use Twig\Sandbox\SecurityNotAllowedFilterError;
use Twig\Sandbox\SecurityNotAllowedFunctionError;
use Twig\Source;
use Twig\Template;
/* project.html.twig */
class __TwigTemplate_13f70910f050a903c91d2cc0b7d3a762f174758d7f6b6d653c908236a1984926 extends Template
{
private $source;
private $macros = [];
public function __construct(Environment $env)
{
parent::__construct($env);
$this->source = $this->getSourceContext();
$this->blocks = [
'title' => [$this, 'block_title'],
'body' => [$this, 'block_body'],
];
}
protected function doGetParent(array $context)
{
// line 1
return "base.html.twig";
}
protected function doDisplay(array $context, array $blocks = [])
{
$macros = $this->macros;
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "project.html.twig"));
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "project.html.twig"));
$this->parent = $this->loadTemplate("base.html.twig", "project.html.twig", 1);
$this->parent->display($context, array_merge($this->blocks, $blocks));
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
}
// line 3
public function block_title($context, array $blocks = [])
{
$macros = $this->macros;
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "title"));
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "title"));
echo "Projets";
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
}
// line 5
public function block_body($context, array $blocks = [])
{
$macros = $this->macros;
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "body"));
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "body"));
// line 6
echo "
";
// line 7
$context["headerContent"] = $this->extensions['App\Twig\ContentExtension']->Content("Projets", "Header");
// line 8
echo "
";
// line 9
if ((twig_get_attribute($this->env, $this->source, ($context["headerContent"] ?? null), "picture", [], "any", true, true, false, 9) && !twig_test_empty(twig_get_attribute($this->env, $this->source, (isset($context["headerContent"]) || array_key_exists("headerContent", $context) ? $context["headerContent"] : (function () { throw new RuntimeError('Variable "headerContent" does not exist.', 9, $this->source); })()), "picture", [], "any", false, false, false, 9)))) {
// line 10
echo " ";
$context["backgroundImage"] = twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["headerContent"]) || array_key_exists("headerContent", $context) ? $context["headerContent"] : (function () { throw new RuntimeError('Variable "headerContent" does not exist.', 10, $this->source); })()), "picture", [], "any", false, false, false, 10), 0, [], "array", false, false, false, 10), "path", [], "any", false, false, false, 10);
// line 11
echo " ";
} else {
// line 12
echo " ";
$context["backgroundImage"] = "empty";
// line 13
echo " ";
}
// line 14
echo " <header class=\"header-tracol col-lg-8 mx-auto\" style=\"background-image: url(";
if ((0 !== twig_compare((isset($context["backgroundImage"]) || array_key_exists("backgroundImage", $context) ? $context["backgroundImage"] : (function () { throw new RuntimeError('Variable "backgroundImage" does not exist.', 14, $this->source); })()), "empty"))) {
echo "'/uploads/images/";
echo twig_escape_filter($this->env, (isset($context["backgroundImage"]) || array_key_exists("backgroundImage", $context) ? $context["backgroundImage"] : (function () { throw new RuntimeError('Variable "backgroundImage" does not exist.', 14, $this->source); })()), "html", null, true);
echo "'";
} else {
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("img/projets_header.jpg"), "html", null, true);
}
echo ");\">
<div class=\"col-lg-8 mx-auto div-svg-header\">
<div id=\"header-project\" class=\"header-habiter-div\">
<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-6\">";
// line 18
if (twig_get_attribute($this->env, $this->source, ($context["headerContent"] ?? null), "name", [], "any", true, true, false, 18)) {
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["headerContent"]) || array_key_exists("headerContent", $context) ? $context["headerContent"] : (function () { throw new RuntimeError('Variable "headerContent" does not exist.', 18, $this->source); })()), "name", [], "any", false, false, false, 18), "html", null, true);
} else {
echo "Nos projets";
}
echo "</h2>
<div class=\"col-lg-8 header-content\">
";
// line 20
if (twig_get_attribute($this->env, $this->source, ($context["headerContent"] ?? null), "content", [], "any", true, true, false, 20)) {
echo twig_get_attribute($this->env, $this->source, (isset($context["headerContent"]) || array_key_exists("headerContent", $context) ? $context["headerContent"] : (function () { throw new RuntimeError('Variable "headerContent" does not exist.', 20, $this->source); })()), "content", [], "any", false, false, false, 20);
echo " ";
} else {
echo "L’immobilier ayant un fort impact, Tracol Immobilier a pour ambition de répondre aux grands enjeux urbains du Luxembourg, tout en développant des projets environnementaux et sociétaux.";
}
// line 21
echo " </div>
</div>
</div>
</header>
<div class=\"container-fluid\">
";
// line 27
$context["sectionContent1"] = $this->extensions['App\Twig\ContentExtension']->Content("Projets", "Section-1");
// line 28
echo " <div class=\"col-lg-8 mx-auto div-svg-header pre-section\">
<div class=\"col-lg-4\" 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>
";
// line 33
if ((0 === twig_compare(twig_length_filter($this->env, (isset($context["projects"]) || array_key_exists("projects", $context) ? $context["projects"] : (function () { throw new RuntimeError('Variable "projects" does not exist.', 33, $this->source); })())), 0))) {
// line 34
echo " <h1 class=\"project-title\">pas de projet</h1>
";
} elseif ((0 === twig_compare(twig_length_filter($this->env, // line 35
(isset($context["projects"]) || array_key_exists("projects", $context) ? $context["projects"] : (function () { throw new RuntimeError('Variable "projects" does not exist.', 35, $this->source); })())), 1))) {
// line 36
echo " <h1 class=\"project-title\">";
echo twig_escape_filter($this->env, twig_length_filter($this->env, (isset($context["projects"]) || array_key_exists("projects", $context) ? $context["projects"] : (function () { throw new RuntimeError('Variable "projects" does not exist.', 36, $this->source); })())), "html", null, true);
echo " projet</h1>
";
} else {
// line 38
echo " <h1 class=\"project-title\">";
echo twig_escape_filter($this->env, twig_length_filter($this->env, (isset($context["projects"]) || array_key_exists("projects", $context) ? $context["projects"] : (function () { throw new RuntimeError('Variable "projects" does not exist.', 38, $this->source); })())), "html", null, true);
echo " projets</h1>
";
}
// line 40
echo " </div>
<div class=\"separator\"></div>
<div id=\"section-1-project\" class=\"col-lg-6 pre-section-content\">
";
// line 43
if (twig_get_attribute($this->env, $this->source, ($context["headerContent"] ?? null), "content", [], "any", true, true, false, 43)) {
echo twig_get_attribute($this->env, $this->source, (isset($context["sectionContent1"]) || array_key_exists("sectionContent1", $context) ? $context["sectionContent1"] : (function () { throw new RuntimeError('Variable "sectionContent1" does not exist.', 43, $this->source); })()), "content", [], "any", false, false, false, 43);
} else {
echo "Développer durable, travailler avec des entreprises locales, maximiser nos impacts positifs (régénération urbaine, emploi local, etc.) et réduire nos impacts négatifs (émissions de CO2, biodiversité, ressources, …) pour apporter du mieux-vivre en ville, voilà comment nous imaginons nos projets !";
}
// line 44
echo " </div>
</div>
<section class=\"project filter mt-5\" style=\"margin-bottom: 120px\">
<div id=\"button-project-page\" class=\"col-lg-8 mx-auto div-svg-header mb-4\" style=\"display: flex; align-items: center; padding-left: 7px\">
<div class=\"input-filter\">
<label for=\"all-projects\">TOUS</label>
<input data-id=\"all\" type=\"radio\" name=\"type\" id=\"all-projects\" class=\"mr-3 projectButton\">
</div>
<div class=\"input-filter\">
<label for=\"futur-projects\">A VENIR</label>
<input data-id=\"futur\" type=\"radio\" name=\"type\" id=\"futur-projects\" class=\"mr-3 projectButton\">
</div>
<div class=\"input-filter\">
<label for=\"construction-projects\">EN COURS</label>
<input data-id=\"construction\" type=\"radio\" name=\"type\" id=\"construction-projects\" class=\" projectButton\">
</div>
";
// line 69
echo " </div>
<div id=\"button-project-page-mobile\" class=\"col-lg-8 mx-auto div-svg-header\" style=\"display: none; align-items: center\">
<div class=\"flicking-viewport\">
<div class=\"flicking-camera\">
<div class=\"input-filter\">
<label for=\"all-projects-mobile\">TOUS</label>
<input data-id=\"all\" type=\"radio\" name=\"type\" id=\"all-projects-mobile\" class=\"mr-3 projectButton\">
</div>
<div class=\"input-filter\">
<label for=\"futur-projects-mobile\">A VENIR</label>
<input data-id=\"futur\" type=\"radio\" name=\"type\" id=\"futur-projects-mobile\" class=\"mr-3 projectButton\">
</div>
<div class=\"input-filter\">
<label for=\"construction-projects-mobile\">EN COURS</label>
<input data-id=\"construction\" type=\"radio\" name=\"type\" id=\"construction-projects-mobile\" class=\" projectButton\">
</div>
";
// line 90
echo "
</div>
</div>
</div>
<div class=\"col-lg-8 mx-auto div-svg-header\" style=\"display: flex; justify-content: center; flex-direction: column;\">
";
// line 117
echo "
";
// line 124
echo "
<div id=\"projects\" class=\"row\">
";
// line 158
echo "
<div class=\"col-lg-12 project-desktop\" style=\"display: flex; flex-wrap: wrap; flex-direction: row\">
";
// line 160
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable(twig_slice($this->env, (isset($context["projects"]) || array_key_exists("projects", $context) ? $context["projects"] : (function () { throw new RuntimeError('Variable "projects" does not exist.', 160, $this->source); })()), 0, 5));
foreach ($context['_seq'] as $context["key"] => $context["property"]) {
// line 161
echo " <div class=\"col-12 col-xl-6 col-lg-6 col-md-12 col-sm-12\" style=\"position:relative;cursor: pointer\">
";
// line 162
if ( !twig_test_empty(twig_get_attribute($this->env, $this->source, $context["property"], "pictures", [], "any", false, false, false, 162))) {
// line 163
echo " <div class=\"position-relative properties-slide\">
<div class=\"img\" style=\"background-image: url('";
// line 164
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["property"], "pictures", [], "any", false, false, false, 164), 0, [], "any", false, false, false, 164), "url", [], "any", false, false, false, 164), "html", null, true);
echo "')\" onclick=\"location.href='";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("project-detail", ["id" => twig_get_attribute($this->env, $this->source, $context["property"], "id", [], "any", false, false, false, 164)]), "html", null, true);
echo "'\">
</div>
</div>
";
} else {
// line 169
echo " <div class=\"img\" style=\"background-image: url('";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("build/Hudson_Ontario2.png"), "html", null, true);
echo "')\"></div>
";
}
// line 171
echo " ";
// line 183
echo "
<p class=\"city\">";
// line 184
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["property"], "city", [], "any", false, false, false, 184), "name", [], "any", false, false, false, 184), "html", null, true);
echo "</p>
<p class=\"project-name\">";
// line 185
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["property"], "reference", [], "any", false, false, false, 185), "html", null, true);
echo "</p>
<div class=\"tag-ref-projet-2\"><span class=\"text-tag-ref\">";
// line 186
echo twig_escape_filter($this->env, $this->extensions['App\Twig\ContentExtension']->typeProject(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["property"], "construction", [], "any", false, false, false, 186), "construction_step", [], "any", false, false, false, 186)), "html", null, true);
echo "</span></div>
</div>
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['key'], $context['property'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 189
echo " </div>
</div>
<div class=\"text-center text-capitalize more-projects\">
<p>AFFICHER PLUS DE PROJETS</p>
</div>
</div>
";
// line 228
echo "
</section>
</div>
<div id=\"img-property-section\" class=\"container-fluid\" style=\"display: none\">
<div class=\"col-lg-6 habiter-img\">
<img style=\"padding: 0px;\" height=\"430px\" class=\"img-100\" ";
// line 233
if (twig_get_attribute($this->env, $this->source, ($context["sectionContent1"] ?? null), "picture", [], "any", true, true, false, 233)) {
echo "src=\"/uploads/images/";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["sectionContent1"]) || array_key_exists("sectionContent1", $context) ? $context["sectionContent1"] : (function () { throw new RuntimeError('Variable "sectionContent1" does not exist.', 233, $this->source); })()), "picture", [], "any", false, false, false, 233), 0, [], "array", false, false, false, 233), "path", [], "any", false, false, false, 233), "html", null, true);
echo "\"";
}
echo ">
</div>
</div>
<script>
const futurProjects = document.getElementById('projects')
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('projects/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;
console.log('click btn');
var id = \$(this).attr('data-id'),
max = 0;
\$('#'+id).toggle();
\$('#'+id).animate({opacity: 1}, 300);
\$('#'+id).find('img').each(function( i ) {
//console.log('h : '+\$(this).height());
//console.log('w : '+\$(this).width());
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() {
console.log('down');
\$(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 ) {
console.log('tap tap');
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) => {
console.error('Error:', error);
});
})
}
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('projects/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')
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('projects/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;
console.log('click btn');
var id = \$(this).attr('data-id'),
max = 0;
\$('#'+id).toggle();
\$('#'+id).animate({opacity: 1}, 300);
\$('#'+id).find('img').each(function( i ) {
//console.log('h : '+\$(this).height());
//console.log('w : '+\$(this).width());
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() {
console.log('down');
\$(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-hover-2').on( \"click\", function( event ) {
console.log('tap tap');
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) => {
console.error('Error:', error);
});
})
}
}
const buttonFilter = document.getElementsByClassName('select-projet')
for (const buttonFilterElement of buttonFilter) {
buttonFilterElement.addEventListener('click', function () {
})
}
if (window.matchMedia(\"(max-width: 768px)\").matches) {
new Flicking(\"#flick4\", {
moveType: \"freeScroll\",
bound: true
});
}
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>
";
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
}
public function getTemplateName()
{
return "project.html.twig";
}
public function isTraitable()
{
return false;
}
public function getDebugInfo()
{
return array ( 315 => 233, 308 => 228, 298 => 189, 289 => 186, 285 => 185, 281 => 184, 278 => 183, 276 => 171, 270 => 169, 260 => 164, 257 => 163, 255 => 162, 252 => 161, 248 => 160, 244 => 158, 240 => 124, 236 => 117, 227 => 90, 209 => 69, 187 => 44, 181 => 43, 176 => 40, 170 => 38, 164 => 36, 162 => 35, 159 => 34, 157 => 33, 150 => 28, 148 => 27, 140 => 21, 133 => 20, 124 => 18, 110 => 14, 107 => 13, 104 => 12, 101 => 11, 98 => 10, 96 => 9, 93 => 8, 91 => 7, 88 => 6, 78 => 5, 59 => 3, 36 => 1,);
}
public function getSourceContext()
{
return new Source("{% extends 'base.html.twig' %}
{% block title %}Projets{% endblock %}
{% block body %}
{% set headerContent = content('Projets', '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 col-lg-8 mx-auto\" style=\"background-image: url({% if backgroundImage != 'empty' %}'/uploads/images/{{ backgroundImage }}'{% else %}{{ asset('img/projets_header.jpg') }}{% endif %});\">
<div class=\"col-lg-8 mx-auto div-svg-header\">
<div id=\"header-project\" class=\"header-habiter-div\">
<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-6\">{% if headerContent.name is defined %}{{ headerContent.name }}{% else %}Nos projets{% endif %}</h2>
<div class=\"col-lg-8 header-content\">
{% if headerContent.content is defined %}{{ headerContent.content|raw }} {% else %}L’immobilier ayant un fort impact, Tracol Immobilier a pour ambition de répondre aux grands enjeux urbains du Luxembourg, tout en développant des projets environnementaux et sociétaux.{% endif %}
</div>
</div>
</div>
</header>
<div class=\"container-fluid\">
{% set sectionContent1 = content('Projets', 'Section-1') %}
<div class=\"col-lg-8 mx-auto div-svg-header pre-section\">
<div class=\"col-lg-4\" 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 projects|length == 0 %}
<h1 class=\"project-title\">pas de projet</h1>
{% elseif projects|length == 1 %}
<h1 class=\"project-title\">{{ projects|length }} projet</h1>
{% else %}
<h1 class=\"project-title\">{{ projects|length }} projets</h1>
{% endif %}
</div>
<div class=\"separator\"></div>
<div id=\"section-1-project\" class=\"col-lg-6 pre-section-content\">
{% if headerContent.content is defined %}{{ sectionContent1.content|raw }}{% else %}Développer durable, travailler avec des entreprises locales, maximiser nos impacts positifs (régénération urbaine, emploi local, etc.) et réduire nos impacts négatifs (émissions de CO2, biodiversité, ressources, …) pour apporter du mieux-vivre en ville, voilà comment nous imaginons nos projets !{% endif %}
</div>
</div>
<section class=\"project filter mt-5\" style=\"margin-bottom: 120px\">
<div id=\"button-project-page\" class=\"col-lg-8 mx-auto div-svg-header mb-4\" style=\"display: flex; align-items: center; padding-left: 7px\">
<div class=\"input-filter\">
<label for=\"all-projects\">TOUS</label>
<input data-id=\"all\" type=\"radio\" name=\"type\" id=\"all-projects\" class=\"mr-3 projectButton\">
</div>
<div class=\"input-filter\">
<label for=\"futur-projects\">A VENIR</label>
<input data-id=\"futur\" type=\"radio\" name=\"type\" id=\"futur-projects\" class=\"mr-3 projectButton\">
</div>
<div class=\"input-filter\">
<label for=\"construction-projects\">EN COURS</label>
<input data-id=\"construction\" type=\"radio\" name=\"type\" id=\"construction-projects\" class=\" projectButton\">
</div>
{#
<button data-id=\"all\" class=\"btn btn-primary all border-radius projectButton\"><span class=\"span-all\">TOUS</span></button>
<button data-id=\"futur\" class=\"btn btn-primary come border-radius projectButton\"><span class=\"span-projects\">A VENIR</span></button>
<button data-id=\"construction\" class=\"btn btn-primary come border-radius projectButton\"><span class=\"span-projects\">EN COURS</span></button>
#}
</div>
<div id=\"button-project-page-mobile\" class=\"col-lg-8 mx-auto div-svg-header\" style=\"display: none; align-items: center\">
<div class=\"flicking-viewport\">
<div class=\"flicking-camera\">
<div class=\"input-filter\">
<label for=\"all-projects-mobile\">TOUS</label>
<input data-id=\"all\" type=\"radio\" name=\"type\" id=\"all-projects-mobile\" class=\"mr-3 projectButton\">
</div>
<div class=\"input-filter\">
<label for=\"futur-projects-mobile\">A VENIR</label>
<input data-id=\"futur\" type=\"radio\" name=\"type\" id=\"futur-projects-mobile\" class=\"mr-3 projectButton\">
</div>
<div class=\"input-filter\">
<label for=\"construction-projects-mobile\">EN COURS</label>
<input data-id=\"construction\" type=\"radio\" name=\"type\" id=\"construction-projects-mobile\" class=\" projectButton\">
</div>
{#
<button data-id=\"all\" class=\"btn btn-primary all border-radius projectButton\"><span class=\"span-all\">TOUS</span></button>
<button data-id=\"futur\" class=\"btn btn-primary come border-radius projectButton\"><span class=\"span-projects\">A VENIR</span></button>
<button data-id=\"construction\" class=\"btn btn-primary come border-radius projectButton\"><span class=\"span-projects\">EN COURS</span></button>
#}
</div>
</div>
</div>
<div class=\"col-lg-8 mx-auto div-svg-header\" style=\"display: flex; justify-content: center; flex-direction: column;\">
{#
<div id=\"filter-project-desktop\">
{% for key, subType in getSubTypeProject() %}
<button data-id=\"{{ key }}\" class=\"select-projet\">{{ subType }} <i class=\"fas fa-times\"></i></button>
{% endfor %}
</div>
<div id=\"filter-project-mobile\" class=\"col-lg-3 div-form selectSubFilter\" 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 getSubTypeProject() %}
<li value=\"{{ key }}\" data-id=\"{{ key }}\" class=\"select-filter\"><i class=\"fas fa-times\"></i>{{ subType }}</li>
{% endfor %}
</ul>
</div>
</div>
#}
{#
<div id=\"loading\">
<h1 id=\"showOutput\"></h1>
</div>
#}
<div id=\"projects\" class=\"row\">
{#
{% for key, project in projects|slice(0,5) %}
<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\">
{% if key == 0 %}
<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\">
<p class=\"city\">{{ project.city.name }}</p>
<p class=\"project-name\">{{ project.reference }}</p>
{% if project.comments[0].comment is not empty %}
<p class=\"project-content\">
{{ project.comments[0].comment|slice(0, 250) }}</p>
<a href=\"{{ path('project-detail', {'id': project.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('project-detail', {'id': project.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=\"tag-ref-projet-2\"><span class=\"text-tag-ref\">{{ typeProject(project.construction.construction_step) }}</span></div>
{% if project.pictures is not empty %}
{% for picture in project.pictures|slice(0,1) %}
<div class=\"img\" style=\"background-image: url('{{ picture.url }}')\"></div>
{% endfor %}
{% else %}
<div class=\"img\" style=\"background-image: url('{{ asset('build/Hudson_Ontario2.png') }}')\"></div>
{% endif %}
{% endif %}
</div>
{% endfor %}
#}
<div class=\"col-lg-12 project-desktop\" style=\"display: flex; flex-wrap: wrap; flex-direction: row\">
{% for key, property in projects|slice(0,5) %}
<div class=\"col-12 col-xl-6 col-lg-6 col-md-12 col-sm-12\" style=\"position:relative;cursor: pointer\">
{% if property.pictures is not empty %}
<div class=\"position-relative properties-slide\">
<div class=\"img\" style=\"background-image: url('{{ property.pictures.0.url }}')\" onclick=\"location.href='{{ path('project-detail', {'id': property.id}) }}'\">
</div>
</div>
{% else %}
<div class=\"img\" style=\"background-image: url('{{ asset('build/Hudson_Ontario2.png') }}')\"></div>
{% endif %}
{#
<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>
</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\">{{ property.reference }}</p>
<div class=\"tag-ref-projet-2\"><span class=\"text-tag-ref\">{{ typeProject(property.construction.construction_step) }}</span></div>
</div>
{% endfor %}
</div>
</div>
<div class=\"text-center text-capitalize more-projects\">
<p>AFFICHER PLUS DE PROJETS</p>
</div>
</div>
{#
<div class=\"col-lg-8 mx-auto div-svg-header content-projet\">
{% set sectionContent1 = content('Projets', 'Section-2') %}
<div id=\"section-2-project\" 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-9\">
<h1 class=\"habiter-title mb-5\">
{% if sectionContent1.name is defined %}{{ sectionContent1.name }}{% else %}INVESTIR À LUXEMBOURG{% endif %}
</h1>
{% 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 %}
</div>
</div>
<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 %}>
</div>
</div>
<div class=\"col-lg-12 div-svg-header last-section-project\">
<div id=\"section-projet-margin\" class=\"offset-lg-2 col-lg-2\" style=\"display: flex; justify-content: flex-start;\">
<a id=\"link-more\" class=\"property-span-arrow\" href=\"{{ path('invest') }}\">EN SAVOIR PLUS
<i class=\"fas fa-arrow-right property-arrow\"></i>
</a>
</div>
<div class=\"col-lg-3\" style=\"display: flex;justify-content: flex-start;margin-left: 0;\">
<a href=\"{{ path('location-management') }}\" class=\"property-span-arrow\">LA GESTION LOCATIVE
<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 class=\"col-lg-6 habiter-img\">
<img style=\"padding: 0px;\" height=\"430px\" class=\"img-100\" {% if sectionContent1.picture is defined %}src=\"/uploads/images/{{ sectionContent1.picture[0].path }}\"{% endif %}>
</div>
</div>
<script>
const futurProjects = document.getElementById('projects')
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('projects/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;
console.log('click btn');
var id = \$(this).attr('data-id'),
max = 0;
\$('#'+id).toggle();
\$('#'+id).animate({opacity: 1}, 300);
\$('#'+id).find('img').each(function( i ) {
//console.log('h : '+\$(this).height());
//console.log('w : '+\$(this).width());
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() {
console.log('down');
\$(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 ) {
console.log('tap tap');
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) => {
console.error('Error:', error);
});
})
}
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('projects/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')
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('projects/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;
console.log('click btn');
var id = \$(this).attr('data-id'),
max = 0;
\$('#'+id).toggle();
\$('#'+id).animate({opacity: 1}, 300);
\$('#'+id).find('img').each(function( i ) {
//console.log('h : '+\$(this).height());
//console.log('w : '+\$(this).width());
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() {
console.log('down');
\$(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-hover-2').on( \"click\", function( event ) {
console.log('tap tap');
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) => {
console.error('Error:', error);
});
})
}
}
const buttonFilter = document.getElementsByClassName('select-projet')
for (const buttonFilterElement of buttonFilter) {
buttonFilterElement.addEventListener('click', function () {
})
}
if (window.matchMedia(\"(max-width: 768px)\").matches) {
new Flicking(\"#flick4\", {
moveType: \"freeScroll\",
bound: true
});
}
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>
{% endblock %}
", "project.html.twig", "/home/juca-stage/sites/sym/tracol/templates/project.html.twig");
}
}