templates/home/landing_page.html.twig line 1
{% extends 'base_landing.html.twig' %}{% block title %}{{ 'landing.title'|trans }}{% endblock %}{% block body %}<!-- Section de l'image "sleep" en pleine largeur --><div class="relative w-screen h-[80vh] md:h-[60vh] flex items-center justify-center bg-cover bg-center bg-no-repeat mb-200" style="background-image: url('/images/sleep1.png');"><div class="absolute inset-0 bg-black bg-opacity-25"></div><div class="absolute text-center w-full px-4"><h1 class="text-4xl text-white font-bold mb-4">{{ 'landing.find_accommodation'|trans }}</h1><form id="search-form" method="GET" action="{{ path('advanced_search') }}" class="space-y-4"><div class="flex justify-center mb-5 gap-2 md:gap-6">{% include 'components/selectCountry.html.twig' with {countrySelected: app.request.query.get('selectCountry')} %}</div><div class="relative flex items-center w-full max-w-sm mx-auto rounded-full overflow-hidden"><input type="text" id="address-landing" name="city" placeholder="{{ 'landing.destination'|trans }}" class="w-full px-4 py-2 rounded-full text-black focus:outline-none hidden"><button type="submit" class="absolute right-[-0rem] bg-[#ffcc00] text-black w-10 h-10 rounded-full flex items-center justify-center hover:bg-[#ffcc00] transition border border-2 border-white"><svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"></path></svg></button></div><input type="hidden" name="lat" id="lat"><input type="hidden" name="lng" id="lng"></form><p class="text-xl text-white mt-4">{{ 'landing.thousands_accommodations'|trans }}</p></div></div><div class="container mx-auto px-4 py-8 text-center"><div class="grid grid-cols-1 md:grid-cols-3 gap-8"><div class="bg-transparent p-6 text-center max-lg:p-4"><img src="/images/icons/attestation.png" alt="Attestation Icon" class="mx-auto mb-4 w-28 h-auto"><h3 class="text-xl font-semibold mb-4">{{ 'landing.attestation'|trans }}</h3></div><div class="bg-transparent p-6 text-center max-lg:p-4"><img src="/images/icons/sans-deplacement.png" alt="Sans Déplacement Icon" class="mx-auto mb-4 w-28 h-auto"><h3 class="text-xl font-semibold mb-4">{{ 'landing.no_displacement'|trans }}</h3></div><div class="bg-transparent p-6 text-center max-lg:p-4"><img src="/images/icons/securite.png" alt="Sécurité Icon" class="mx-auto mb-4 w-28 h-auto"><h3 class="text-xl font-semibold mb-4">{{ 'landing.security'|trans }}</h3></div></div></div><div class="bg-gray-200 w-full px-4 py-8 text-left mb-200 max-lg:p-4"><h2 class="text-4xl font-bold text-center mb-6 max-lg:text-3xl">{{ 'landing.selection_accommodations'|trans }} <span id="accommodation-title-country">{{'search.France'|trans}}</span>{{ 'landing.selection_accommodations2'|trans }}</h2> <br/>{% include 'components/sectionAccommodationCountry.html.twig'%} <!-- Section biens récents par pays --></div><div class="container text-center mx-auto px-4 py-8 mb-200"><h2 class="text-4xl font-bold mb-6 text-center">{{ 'landing.roomlers_solution'|trans }}</h2><br/><div class="grid grid-cols-1 md:grid-cols-3 gap-12 md:gap-6"><!-- Section 1 --><div class="bg-gray-200 p-6 rounded-lg shadow-md flex flex-col md:w-11/12 mx-auto max-lg:p-4 min-h-[250px]"><h3 class="text-xl mb-2"><span class="text-2xl font-bold">1.</span><br/><strong>{{ 'landing.create_account'|trans }}</strong></h3><p class="text-gray-700 flex-grow">{{ 'landing.access_catalog'|trans }}</p></div><!-- Section 2 --><div class="bg-gray-200 p-6 rounded-lg shadow-md flex flex-col md:w-11/12 mx-auto max-lg:p-4 min-h-[250px]"><h3 class="text-xl mb-2"><span class="text-2xl font-bold">2.</span><br/><strong>{{ 'landing.generate_attestation'|trans }}</strong><br/>{{ 'landing.step'|trans }}</h3><p class="text-gray-700 flex-grow">{{ 'landing.complete_visa'|trans }}</p></div><!-- Section 3 --><div class="bg-gray-200 p-6 rounded-lg shadow-md flex flex-col md:w-11/12 mx-auto max-lg:p-4 min-h-[250px]"><h3 class="text-xl mb-2"><span class="text-2xl font-bold">3.</span><br/><strong>{{ 'landing.book_accommodation'|trans }}</strong></h3><p class="text-gray-700 flex-grow">{{ 'landing.choose_accommodation'|trans }}</p></div></div><br/><div class="text-center mt-8">{% if app.user %}{% if app.user.asRole('ROLE_TENANT') %}<a href="{{ path('tenant_home') }}" class="bg-[#FFCC00] text-black px-6 py-2 rounded-lg font-semibold hover:bg-[#FFCC00] transition w-full md:w-[calc(33.333%-2rem)]">{{ 'landing.start'|trans }}</a>{% elseif app.user.asRole('ROLE_AGENT') %}<button id="openPopLink1" class="bg-[#FFCC00] text-black px-6 py-2 rounded-lg font-semibold hover:bg-[#FFCC00] transition w-full md:w-[calc(33.333%-2rem)]">{{ 'landing.start'|trans }}</a>{% elseif app.user.asRole('ROLE_SUPER_AGENT') %}<button id="openPopLink1" class="bg-[#FFCC00] text-black px-6 py-2 rounded-lg font-semibold hover:bg-[#FFCC00] transition w-full md:w-[calc(33.333%-2rem)]">{{ 'landing.start'|trans }}</a>{% elseif app.user.asRole('ROLE_LESSOR') or app.user.asRole('ROLE_LESSOR_RESIDENT') %}<button id="openPopLink1" class="inline-block bg-yellow-400 text-black font-semibold px-8 py-4 rounded-lg hover:bg-yellow-500 transition-colors">{{ 'landing.start'|trans }}</button>{% endif %}{% else %}<button id="openConnectModalBtn" class="bg-[#FFCC00] text-black px-6 py-2 rounded-lg font-semibold hover:bg-[#FFCC00] transition w-full md:w-[calc(33.333%-2rem)]">{{ 'landing.start'|trans }}</button>{% endif %}</div></div><div class="bg-gray-200 w-full px-4 py-8 mb-200"><h2 class="text-4xl md:text-3xl font-bold mb-6 text-center">{{ 'landing.things'|trans }}</h2><br/><div class=" text-center grid grid-cols-1 md:grid-cols-3 gap-12"><div class="bg-white p-6 rounded-lg shadow-md md:w-11/12 mx-auto max-lg:p-4 text-center"><img src="/images/icons/citation.png" alt="Icône de citation" class="w-8 h-8 mb-4 mx-auto"><p class="text-gray-700">{{ 'landing.testimonial_alejandro'|trans }} <br/><br/><em>{{ 'landing.alejandro'|trans }}</em></p></div><div class="bg-white p-6 rounded-lg shadow-md md:w-11/12 mx-auto max-lg:p-4 text-center"><img src="/images/icons/citation.png" alt="Icône de citation" class="w-8 h-8 mb-4 mx-auto"><p class="text-gray-700">{{ 'landing.testimonial_mei'|trans }} <br/><br/><em>{{ 'landing.mei'|trans }}</em></p></div><div class="bg-white p-6 rounded-lg shadow-md md:w-11/12 mx-auto max-lg:p-4 text-center"><img src="/images/icons/citation.png" alt="Icône de citation" class="w-8 h-8 mb-4 mx-auto"><p class="text-gray-700">{{ 'landing.testimonial_luca'|trans }} <br/><br/><em>{{ 'landing.luca'|trans }}</em></p></div></div></div><style>.faq-section {display: flex;align-items: center;}.faq-title {display: flex;align-items: center;justify-content: center;}.faq-questions {display: flex;flex-direction: column;}.faq-answer {max-height: 0;overflow: hidden;transition: max-height 0.3s ease-out;}.faq-answer.active {max-height: 200px; /* Ajustez cette valeur selon vos besoins */overflow: visible;}</style><div class="container mx-auto px-4 py-8 mb-24 flex flex-col md:flex-row items-start justify-between faq-section"><div class="w-full md:w-1/3 p-4 faq-title"><h2 class="text-3xl font-bold mb-4">{{ 'landing.weanswer'|trans }}<br/> {{ 'landing.questions'|trans }}</h2></div><div class="w-full md:w-2/3 p-4 space-y-4 faq-questions"><!-- Question 1 --><div class="border border-gray-300 rounded-lg overflow-hidden shadow-md relative faq-item"><button class="faq-question flex justify-between items-center w-full p-4 font-semibold text-left hover:bg-gray-200 transition"><div class="flex-1 text-left pr-4">{{ 'landing.question1'|trans }}</div><div class="flex-shrink-0 w-6 h-6"><svg class="w-6 h-6 text-gray-600 transition-transform transform rotate-0" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"></path></svg></div></button><div class="faq-answer max-h-0 overflow-hidden transition-all duration-300 ease-in-out"><p class="p-4 text-gray-700">{{ 'landing.faq_fees'|trans }}</p></div></div><!-- Question 2 --><div class="border border-gray-300 rounded-lg overflow-hidden shadow-md relative faq-item"><button class="faq-question flex justify-between items-center w-full p-4 font-semibold text-left hover:bg-gray-200 transition"><div class="flex-1 text-left pr-4">{{ 'landing.question2'|trans }}</div><div class="flex-shrink-0 w-6 h-6"><svg class="w-6 h-6 text-gray-600 transition-transform transform rotate-0" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"></path></svg></div></button><div class="faq-answer max-h-0 overflow-hidden transition-all duration-300 ease-in-out"><p class="p-4 text-gray-700">{{ 'landing.faq_refund'|trans }}</p></div></div><!-- Question 3 --><div class="border border-gray-300 rounded-lg overflow-hidden shadow-md relative faq-item"><button class="faq-question flex justify-between items-center w-full p-4 font-semibold text-left hover:bg-gray-200 transition"><div class="flex-1 text-left pr-4">{{ 'landing.question3'|trans }}</div><div class="flex-shrink-0 w-6 h-6"><svg class="w-6 h-6 text-gray-600 transition-transform transform rotate-0" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"></path></svg></div></button><div class="faq-answer max-h-0 overflow-hidden transition-all duration-300 ease-in-out"><p class="p-4 text-gray-700">{{ 'landing.faq_apl'|trans }}</p></div></div><!-- Question 4 --><div class="border border-gray-300 rounded-lg overflow-hidden shadow-md relative faq-item"><button class="faq-question flex justify-between items-center w-full p-4 font-semibold text-left hover:bg-gray-200 transition"><div class="flex-1 text-left pr-4">{{ 'landing.question4'|trans }}</div><div class="flex-shrink-0 w-6 h-6"><svg class="w-6 h-6 text-gray-600 transition-transform transform rotate-0" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"></path></svg></div></button><div class="faq-answer max-h-0 overflow-hidden transition-all duration-300 ease-in-out"><p class="p-4 text-gray-700">{{ 'landing.faq_furnished'|trans }}</p></div></div><!-- Question 5 --><div class="border border-gray-300 rounded-lg overflow-hidden shadow-md relative faq-item"><button class="faq-question flex justify-between items-center w-full p-4 font-semibold text-left hover:bg-gray-200 transition"><div class="flex-1 text-left pr-4">{{ 'landing.question5'|trans }}</div><div class="flex-shrink-0 w-6 h-6"><svg class="w-6 h-6 text-gray-600 transition-transform transform rotate-0" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"></path></svg></div></button><div class="faq-answer max-h-0 overflow-hidden transition-all duration-300 ease-in-out"><p class="p-4 text-gray-700">{{ 'landing.faq_lease_duration'|trans }}</p></div></div><!-- Question 6 --><div class="border border-gray-300 rounded-lg overflow-hidden shadow-md relative faq-item"><button class="faq-question flex justify-between items-center w-full p-4 font-semibold text-left hover:bg-gray-200 transition"><div class="flex-1 text-left pr-4">{{ 'landing.question6'|trans }}</div><div class="flex-shrink-0 w-6 h-6"><svg class="w-6 h-6 text-gray-600 transition-transform transform rotate-0" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"></path></svg></div></button><div class="faq-answer max-h-0 overflow-hidden transition-all duration-300 ease-in-out"><p class="p-4 text-gray-700">{{ 'landing.faq_leave_accommodation'|trans }}</p></div></div><!-- Question 7 --><div class="border border-gray-300 rounded-lg overflow-hidden shadow-md relative faq-item"><button class="faq-question flex justify-between items-center w-full p-4 font-semibold text-left hover:bg-gray-200 transition"><div class="flex-1 text-left pr-4">{{ 'landing.question7'|trans }}</div><div class="flex-shrink-0 w-6 h-6"><svg class="w-6 h-6 text-gray-600 transition-transform transform rotate-0" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"></path></svg></div></button><div class="faq-answer max-h-0 overflow-hidden transition-all duration-300 ease-in-out"><p class="p-4 text-gray-700">{{ 'landing.faq_insurance'|trans }}</p></div></div><!-- Question 8 --><div class="border border-gray-300 rounded-lg overflow-hidden shadow-md relative faq-item"><button class="faq-question flex justify-between items-center w-full p-4 font-semibold text-left hover:bg-gray-200 transition"><div class="flex-1 text-left pr-4">{{ 'landing.question8'|trans }}</div><div class="flex-shrink-0 w-6 h-6"><svg class="w-6 h-6 text-gray-600 transition-transform transform rotate-0" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"></path></svg></div></button><div class="faq-answer max-h-0 overflow-hidden transition-all duration-300 ease-in-out"><p class="p-4 text-gray-700">{{ 'landing.faq_guarantor'|trans }}</p></div></div><!-- Question 9 --><div class="border border-gray-300 rounded-lg overflow-hidden shadow-md relative faq-item"><button class="faq-question flex justify-between items-center w-full p-4 font-semibold text-left hover:bg-gray-200 transition"><div class="flex-1 text-left pr-4">{{ 'landing.question9'|trans }}</div><div class="flex-shrink-0 w-6 h-6"><svg class="w-6 h-6 text-gray-600 transition-transform transform rotate-0" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"></path></svg></div></button><div class="faq-answer max-h-0 overflow-hidden transition-all duration-300 ease-in-out"><p class="p-4 text-gray-700">{{ 'landing.faq_no_guarantor'|trans|raw }}</p></div></div></div></div><div class="bg-gray-200 w-full px-4 py-8 mb-200"><h2 class="text-4xl md:text-3xl font-bold mb-6 text-center">{{ 'landing.popular_destinations'|trans }}</h2> <br/><div class="grid grid-cols-1 md:grid-cols-3 gap-4"><a href="{{ path('advanced_search', {'city': 'Paris', 'lat': 48.8575475, 'lng': 2.3513765}) }}" class="bg-white p-6 rounded-lg shadow-md text-center"><h3 class="text-lg md:text-xl font-semibold mb-2">Paris et sa banlieue</h3></a><a href="{{ path('advanced_search', {'city': 'Lille', 'lat': 50.624378, 'lng': 3.0678588}) }}" class="bg-white p-6 rounded-lg shadow-md text-center"><h3 class="text-lg md:text-xl font-semibold mb-2">Lille</h3></a><a href="{{ path('advanced_search', {'city': 'Lyon', 'lat': 45.764043, 'lng': 4.835659}) }}" class="bg-white p-6 rounded-lg shadow-md text-center"><h3 class="text-lg md:text-xl font-semibold mb-2">Lyon</h3></a><a href="{{ path('advanced_search', {'city': 'Toulouse', 'lat': 43.6048462, 'lng': 1.442848}) }}" class="bg-white p-6 rounded-lg shadow-md text-center"><h3 class="text-lg md:text-xl font-semibold mb-2">Toulouse</h3></a><a href="{{ path('advanced_search', {'city': 'Strasbourg', 'lat': 48.5734053, 'lng': 7.752111299999999}) }}" class="bg-white p-6 rounded-lg shadow-md text-center"><h3 class="text-lg md:text-xl font-semibold mb-2">Strasbourg</h3></a><a href="{{ path('advanced_search', {'city': 'Marseille', 'lat': 43.3025742, 'lng': 5.369074299999999}) }}" class="bg-white p-6 rounded-lg shadow-md text-center"><h3 class="text-lg md:text-xl font-semibold mb-2">Marseille</h3></a><a href="{{ path('advanced_search', {'city': 'Rennes', 'lat': 48.117266, 'lng': 1.6777926}) }}" class="bg-white p-6 rounded-lg shadow-md text-center"><h3 class="text-lg md:text-xl font-semibold mb-2">Rennes</h3></a><a href="{{ path('advanced_search', {'city': 'Bordeaux', 'lat': 44.8416106, 'lng': 0.5810938000000001}) }}" class="bg-white p-6 rounded-lg shadow-md text-center"><h3 class="text-lg md:text-xl font-semibold mb-2">Bordeaux</h3></a><a href="{{ path('advanced_search', {'city': 'Montpellier', 'lat': 43.6108535, 'lng': 3.8761323}) }}" class="bg-white p-6 rounded-lg shadow-md text-center"><h3 class="text-lg md:text-xl font-semibold mb-2">Montpellier</h3></a></div></div> <br/> <br/><!-- Modal de connexion/inscription --><div id="connectModal" class="fixed inset-0 bg-gray-500 bg-opacity-50 flex justify-center items-center hidden z-50"><div class="bg-white p-6 rounded-lg shadow-lg max-w-sm w-full text-center"><p class="text-lg font-semibold mb-4">{{ 'landing.option'|trans }}</p><button onclick="window.location.href='{{ path('app_login_site') }}'" class="bg-[#ffcc00] text-black px-4 py-2 rounded-lg font-semibold hover:bg-[#ffcc00] transition mb-2">{{ 'landing.login'|trans }}</button><button onclick="window.location.href='{{ path('app_register') }}'" class="bg-[#ffcc00] text-black px-4 py-2 rounded-lg font-semibold hover:bg-[#ffcc00] transition">{{ 'landing.register'|trans }}</button></div></div><div id="connectPop" class="fixed inset-0 bg-gray-500 bg-opacity-50 flex justify-center items-center hidden z-50"><div class="bg-white p-6 rounded-lg shadow-lg max-w-sm w-full text-center"><p class="text-lg font-semibold mb-4">{{ 'landing.tenant'|trans }}</p><button onclick="window.location.href='{{ path('app_login_site') }}'" class="bg-yellow-400 text-black px-4 py-2 rounded-lg font-semibold hover:bg-yellow-500 transition mb-2 w-full">{{ 'landing.login'|trans }}</button></div></div><button id="scrollToTopBtn" class="fixed bottom-4 right-4 bg-[#FFCC00] text-black px-4 py-2 rounded-lg font-semibold hover:bg-[#e6b800] transition-all z-[1000] border-2 border-black">{{ 'landing.search'|trans }}</button><script>let autocompleteLanding;var countryTranslations = {'FR': '{{ 'search.InFrance'|trans }}','BE': '{{ 'search.InBelgique'|trans }}','DE': '{{ 'search.InAllemagne'|trans }}','ES': '{{ 'search.InEspagne'|trans }}','IT': '{{ 'search.InItalie'|trans }}','PT': '{{ 'search.InPortugal'|trans }}','CA': '{{ 'search.InCanada'|trans }}','LU': '{{ 'search.InLuxembourg'|trans }}'};function initAutocomplete(inputId) {const input = document.getElementById(inputId);if (!input) {console.error("Input non trouvé :", inputId);return;}const options = {types: ['(cities)'],componentRestrictions: { country: 'FR' }};try {autocompleteLanding = new google.maps.places.Autocomplete(input, options);document.querySelectorAll('select[name=selectCountry]').forEach(inputSelect => {inputSelect.addEventListener('change', async () => {var countryName = inputSelect.value;inputSelect.value ? document.querySelectorAll('input[name=city]')[0].style.display = 'block' : document.querySelectorAll('input[name=city]')[0].style.display = 'none';autocompleteLanding.setComponentRestrictions({ country: inputSelect.value ? inputSelect.value : 'FR' });spanCountryChecked = document.getElementById('accommodation-title-country');spanCountryChecked.textContent = countryTranslations[countryName];const response = await fetch(`/buildings-country?country=${inputSelect.id}&acronym=${inputSelect.value}`);const html = await response.text();document.getElementById('recent-carousel').innerHTML = html;})});autocompleteLanding.addListener('place_changed', function () {const place = autocompleteLanding.getPlace();if (!place.geometry) {console.error("Aucune géométrie trouvée pour ce lieu.");return;}const latInput = document.getElementById('lat');const lngInput = document.getElementById('lng');if (latInput && lngInput) {latInput.value = place.geometry.location.lat();lngInput.value = place.geometry.location.lng();}let city = "";place.address_components.forEach(component => {if (component.types.includes("locality")) {city = component.long_name;}});input.value = city || place.name; // Fallback si le nom de la ville n'est pas trouvéconst form = input.closest('form');if (form) {form.submit();}});} catch (error) {console.error("Erreur lors de l'initialisation de l'autocomplétion :", error);}}// Fonction pour charger l'API Google Maps de manière asynchronefunction loadGoogleMapsAPI() {if (typeof google === 'undefined' || !google.maps) {const script = document.createElement('script');script.src = 'https://maps.googleapis.com/maps/api/js?key={{ google_maps_api_key }}&libraries=places&callback=initializeAutocomplete';script.async = true;script.defer = true;script.onerror = () => {console.error("Erreur lors du chargement de l'API Google Maps.");};document.head.appendChild(script);} else {initializeAutocomplete();}}// Fonction pour initialiser l'autocomplétion après le chargement de l'APIfunction initializeAutocomplete() {if (typeof google !== 'undefined' && google.maps && google.maps.places) {initAutocomplete('address-landing');} else {console.error("Google Maps API non chargée correctement.");}}// Fonction pour configurer un carouselfunction setupCarousel(carousel) {const carouselId = carousel.id.split('-')[1];const slides = carousel.querySelectorAll('a');const indicators = document.querySelectorAll(`#carousel-indicators-${carouselId} button`);const prevButton = document.querySelector(`[data-carousel-prev="${carouselId}"]`);const nextButton = document.querySelector(`[data-carousel-next="${carouselId}"]`);let currentIndex = 0;const totalSlides = slides.length;function updateCarousel() {if (slides.length === 0) return;slides.forEach((slide, index) => {slide.style.transition = 'opacity 0.6s ease-in-out, transform 0.6s ease-in-out';slide.style.position = 'absolute';slide.style.opacity = '0';slide.style.transform = 'translateX(100%)';});const currentSlide = slides[currentIndex];currentSlide.style.opacity = '1';currentSlide.style.transform = 'translateX(0)';indicators.forEach((indicator, index) => {if (index === currentIndex) {indicator.classList.add('bg-[#ffcc00]', 'opacity-100');indicator.classList.remove('bg-gray-300', 'opacity-50');} else {indicator.classList.remove('bg-[#ffcc00]', 'opacity-100');indicator.classList.add('bg-gray-300', 'opacity-50');}});}function goToSlide(index) {currentIndex = (index + totalSlides) % totalSlides;updateCarousel();}function nextSlide() {goToSlide(currentIndex + 1);}function prevSlide() {goToSlide(currentIndex - 1);}// Événementsif (nextButton) nextButton.addEventListener('click', nextSlide);if (prevButton) prevButton.addEventListener('click', prevSlide);indicators.forEach((indicator, index) => {indicator.addEventListener('click', () => goToSlide(index));});}// Initialisation du scriptdocument.addEventListener('DOMContentLoaded', function () {// Charger l'API Google MapsloadGoogleMapsAPI();// Gestion de la modal de connexion/inscriptionconst openModalElements = document.querySelectorAll('#openModalLink1, #openConnectModalBtn');const connectModal = document.getElementById('connectModal');openModalElements.forEach(element => {element.addEventListener('click', function (event) {event.preventDefault();connectModal.classList.remove('hidden');});});connectModal.addEventListener('click', function (event) {if (event.target === connectModal) {connectModal.classList.add('hidden');}});// Gestion du bouton de recherche (défilement vers le haut)const scrollToTopBtn = document.getElementById('scrollToTopBtn');scrollToTopBtn.addEventListener('click', function () {window.scrollTo({top: 0,behavior: 'smooth'});});// Affichage/masquage du bouton de défilementwindow.addEventListener('scroll', function () {if (window.scrollY > 100) {scrollToTopBtn.style.display = 'block';} else {scrollToTopBtn.style.display = 'none';}});// Gestion des carrouselsconst carousels = document.querySelectorAll('[id^="carousel-"]');carousels.forEach(setupCarousel);// Gestion des clics sur les cœurs (affichage de la modal)const likeButtons = document.querySelectorAll('.like-button');likeButtons.forEach(button => {button.addEventListener('click', function () {const connectModal = document.getElementById('connectModal');connectModal.classList.remove('hidden');});});// Gestion du menu de langueconst languageDropdown = document.getElementById('languageDropdown');const languageMenu = document.getElementById('languageMenu');if (languageDropdown && languageMenu) {languageDropdown.addEventListener('click', function () {languageMenu.classList.toggle('hidden');});}// Gestion de l'accordéonconst accordionButtons = document.querySelectorAll('.faq-question');accordionButtons.forEach(button => {button.addEventListener('click', function() {const content = this.nextElementSibling;const isExpanded = content.classList.contains('active');// Fermer tous les autres éléments de l'accordéonaccordionButtons.forEach(btn => {const otherContent = btn.nextElementSibling;if (btn !== this) {otherContent.classList.remove('active');}});// Basculer l'état de l'élément cliquéif (isExpanded) {content.classList.remove('active');} else {content.classList.add('active');}});});// Ajout du gestionnaire d'événements pour la touche "Entrée"const searchInput = document.getElementById('address-landing');if (searchInput) {searchInput.addEventListener('keydown', function (event) {if (event.key === 'Enter') {event.preventDefault();document.getElementById('search-form').submit();}});}const openPopElements = document.querySelectorAll('#openPopLink1, #openPopLink2');const connectPop = document.getElementById('connectPop');if (openPopElements.length > 0 && connectPop) {openPopElements.forEach(element => {element.addEventListener('click', function (event) {event.preventDefault();connectPop.classList.remove('hidden');});});connectPop.addEventListener('click', function (event) {if (event.target === connectPop) {connectPop.classList.add('hidden');}});connectPop.querySelector('.bg-white').addEventListener('click', function (event) {event.stopPropagation();});}});</script>{% endblock %}