{#/*
* Role:Header
*
*/#}
{%set codeSejParent = app.session.get('Sejour') %}
{% set pageMenu = app.session.get('pageMenu') %}
<!-- header-start -->
<!-- Navbar-->
<style>
/* Animation pour l'icône du panier */
@keyframes bounce {
0%, 100% {
transform: translateY(0);
}
30% {
transform: translateY(-10px);
}
50% {
transform: translateY(5px);
}
70% {
transform: translateY(-5px);
}
}
.cart-bounce {
animation: bounce 0.6s ease-out;
}
.popover-header {
display: flex;
justify-content: space-between;
align-items: center;
}
.close {
margin: -0.5rem -0.5rem -0.5rem auto;
}
.custom-button {
background-color: #f09e7a;
color: #fff; /* Text color always white */
font-family: 'Montserrat-SemiBold', sans-serif;
border-radius: 22px;
font-size: 11px;
box-shadow: none !important;
border: none !important;
margin-top: 8px;
margin-left: 75px;
transition: background-color 0.3s ease; /* Smooth transition for background color */
}
.custom-button:hover,
.custom-button:focus,
.custom-button:active {
background-color: #41a2aa; /* Background color on hover, focus, and active */
color: #fff; /* Text color on hover, focus, and active */
}
.custom-button:visited {
color: #fff; /* Text color for visited link */
}
.disabled-section {
pointer-events: none; /* Disable all interactions */
opacity: 0.6; /* Reduce opacity */
}
.disabled-element {
pointer-events: none;
color: #999; /* Gray text */
opacity: 0.6;
}
/* Hide the mobile logo by default */
.mobile-only {
display: none !important;
}
/* Show the desktop logo by default */
.desktop-only {
display: block !important;
}
/* Media query for mobile view */
@media (max-width: 767px) {
/* Show the mobile logo */
.mobile-only {
display: block !important;
}
/* Hide the desktop logo */
.desktop-only {
display: none !important;
}
}
@media only screen and (max-width: 768px) {
.help-icon {
display: none;
}
}
.vocal-trigger-btn {
background-color: #3CA9AB;
color: white;
border: none;
padding: 10px 20px;
border-radius: 4px;
font-weight: bold;
cursor: pointer;
display: flex;
align-items: center;
gap: 8px;
}
.vocal-modal-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
display: none;
justify-content: center;
align-items: center;
z-index: 1000;
}
.vocal-modal {
font-family: Arial, sans-serif;
width: 420px;
max-width: 90%;
background-color: white;
border-radius: 8px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
overflow: hidden;
position: relative;
z-index: 1001;
}
.vocal-modal-content {
padding: 15px;
}
.vocal-feature {
display: flex;
margin-bottom: 12px;
align-items: flex-start;
}
.vocal-feature-icon {
margin-right: 10px;
flex-shrink: 0;
width: 20px;
height: 20px;
display: flex;
align-items: center;
justify-content: center;
}
.vocal-feature-text {
flex: 1;
}
.vocal-feature-title {
font-weight: bold;
margin-bottom: 2px;
font-size: 14px;
}
.vocal-feature-desc {
color: #555;
font-size: 12px;
line-height: 1.3;
margin: 0 0 2px 0;
}
.vocal-modal-buttons {
display: flex;
justify-content: flex-end;
padding: 10px 15px;
background-color: #f5f5f5;
border-top: 1px solid #e0e0e0;
}
.vocal-btn {
padding: 8px 16px;
border-radius: 4px;
font-weight: bold;
cursor: pointer;
border: none;
font-size: 13px;
}
.vocal-btn-cancel {
background-color: #f1f1f1;
color: #666;
margin-right: 10px;
}
.vocal-btn-confirm {
background-color: #E9553B;
color: white;
}
/* Animation */
.vocal-fade-in {
animation: vocalFadeIn 0.3s ease-in-out;
}
@keyframes vocalFadeIn {
from { opacity: 0; }
to { opacity: 1; }
}
@media (max-width: 991px) {
/* Mobile adjustments */
.mobile-only {
display: flex !important;
margin-right: 8px;
}
.VMobileBrend {
margin-top: 0 !important;
margin-right: 10px;
}
.mobile-help-btn {
margin-left: 5px;
margin-right: 10px;
}
.mobile-nav-menu {
margin-left: auto;
margin-right: auto;
}
.mobile-nav-item {
text-align: center;
padding: 0 10px;
}
.mobile-nav-item a {
display: flex;
flex-direction: column;
align-items: center;
font-size: 0.8rem;
}
.mobile-nav-item i {
font-size: 1.5rem;
margin-bottom: 3px;
}
/* Custom dropdown for mobile menu */
.mobile-menu-custom-dropdown {
position: absolute;
right: 0;
left: auto;
top: 100%;
width: 280px;
background: white;
border-radius: 8px;
box-shadow: 0 4px 12px rgba(0,0,0,0.15);
z-index: 1000;
padding: 10px 0;
display: none;
list-style: none;
margin: 0;
transform: translateX(0); /* Remove the negative transform to position on right */
}
/* Container for the navbar items in the dropdown */
.mobile-menu-navbar-item {
display: inline-block;
margin: 0 5px;
}
/* Preserve original navbar item styling in the dropdown */
.mobile-menu-navbar-item .gaucheitems {
position: relative;
display: inline-block;
}
/* Container spacing */
.container-fluid {
padding-left: 8px;
padding-right: 8px;
}
}
</style>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/shepherd.js@8.3.1/dist/css/shepherd.css">
<nav class="navbar navbar-expand-lg parents_Nav sticky-top" id="sticky-header">
<div class="container-fluid justify-content-between">
<!-- Left elements -->
<div class="d-flex align-items-center">
<!-- Brand -->
<a class="navbar-brand me-2 mb-1 d-flex align-items-center desktop-only" onclick='location.href = "{{ path('AccueilParent') }}";'>
<img class="logo5sur5Header"
src="{{ asset('Accueil/imagesAccueil/logoHeader.svg') }}"
alt="5sur5sejour"
loading="lazy"
/>
</a>
<!-- Mobile logo repositioned more to the right -->
<a class="navbar-brand VMobileBrend mobile-only" onclick='location.href = "{{ path('AccueilParent') }}";'>
<img class="logo5sur5HeaderMobile"
src="{{ asset('Accueil/imagesAccueil/Picto5sur5.svg') }}"
alt="5sur5sejour"
loading="lazy"
style="height:47px; margin-left:10px; margin-top:-10px"
/>
</a>
<!-- Help button positioned to the right of logo in mobile -->
<a class="navbar-brand me-2 mb-1 d-none d-lg-flex align-items-center" style="cursor: pointer;margin-left: 9%;margin-top: 9%;" onclick="loadAndStartTourBasedOnRoute()">
<i class="bi bi-question-circle" style="color:#41a2aa;font-size:1.5rem"></i>
</a>
</div>
<!-- Left elements -->
<!-- Center elements -->
<ul class="navbar-nav flex-row d-none d-lg-flex">
<li class="list-inline-item btn_mainMenuparent me-3 me-lg-1 Nav-lism">
<a {% if app.session.get("Sejour")!="" %}href="{{path('AccueilParent')}}"{% else %} href="{{path('SejourParent')}}" {% endif %}>
<img class="NewImgHeader" src="/Accueil/imagesAccueil/sejour.png">
<h3 class="textBtnManuLeft txtBtnSnSej">Séjour {{ sejour.codeSejour }}</h3>
</a>
</li>
<li class="list-inline-item btn_mainMenuparent me-3 me-lg-1 infosSejourHeader" style="display:none">
<a style="margin-top: 9px;" {% if app.session.get("Sejour")!="" %}href="{{path('SejourParent')}}"{% else %} href="{{path('SejourParent')}}" {% endif %}>
<h3 class="txtBtnSnSej" style="top: 11%; color: #41a2aa !important;"> Séjour : </h3>
<h5 class="datesejourHeader" style=""> du {{ sejour.dateDebutSejour|date("d/m/Y") }} au {{ sejour.dateFinSejour|date("d/m/Y") }} </h5>
</a>
</li>
<li class="list-inline-item btn_mainMenuparent no-padding me-3 me-lg-1" onclick='location.href = "{{ path('boutique5sur5') }}"'>
<a href = "{{ path('boutique5sur5') }}">
<img class="NewImgHeader" src="/Accueil/imagesAccueil/boutique.png">
<h3 class="textBtnManuLeft txtBtnSnSej"> Nos produits </h3>
</a>
</li>
{% if albumAcc !=null %}
<li class="list-inline-item btn_mainMenuparent no-padding d-none d-lg-flex albumsejour">
<a style="margin-top: -10px;" href = '{{ path('Album_du_Sejour') }}' title="Vous pouvez désormais commander votre album séjour">
<i class="bi bi-book-half" id="selecNav" style="font-size:27px;color:#F09E7A"></i>
<h3 class="textBtnManuLeft txtBtnSnSej"> Album du séjour </h3>
<label class="nbrVocal blink"><i class="bi bi-basket" style="color:white"></i></label>
</a>
</li>
{% endif %}
<li class="list-inline-item btn_mainMenuparent no-padding Nav-lism" onclick='location.href = "{{ path('Besoindaide_5sur5') }}"'>
<a>
<img class="NewImgHeader" style="width: 30px;" src="/Accueil/imagesAccueil/iconcasque.png">
<h3 class="textBtnManuLeft txtBtnSnSej">Besoin d'aide </h3>
</a>
</li>
{% if sejour.codeSejour|slice(0, 2) == "EF" and payment == 1 %}
<input hidden value="{{nbLikes}}">
<div>
<li class="list-inline-item btn_mainMenuparent no-padding d-none d-lg-flex albumsejour" id="packOffertSection">
<a id="offrePack" href="{{ path('PackPhotosNumerique_Offert', {'nbr': 15}) }}">
<i class="bi bi-images" id="selecNav" style="font-size:27px;color:#41a2aa"></i>
<h3 class="textBtnManuLeft txtBtnSnSej">Pack offert</h3>
<label class="nbrVocal blink"><i class="bi bi-gift" style="color:white;"></i></label>
</a>
</li>
</div>
{% endif %}
</ul>
<!-- Center elements -->
<!-- Mobile Navigation Items -->
<ul class="navbar-nav flex-row d-flex d-lg-none mobile-nav-menu">
<!-- Nos produits - Always visible in mobile -->
<li class="list-inline-item btn_mainMenuparent no-padding me-3 me-lg-1" onclick='location.href = "{{ path('boutique5sur5') }}"'>
<a href = "{{ path('boutique5sur5') }}">
<img class="NewImgHeader" src="/Accueil/imagesAccueil/boutique.png">
<h3 class="textBtnManuLeft txtBtnSnSej"> Nos produits </h3>
</a>
</li>
</ul>
<!-- Right elements -->
<ul class="navbar-nav flex-row align-items-center">
<!-- Service client (hidden) -->
<li style="display:none" class="list-inline-item menuGaucheHeaderli helpdesk" title="Service client">
<a style="cursor:pointer" class="gaucheitems" onclick='location.href = "{{path('ServiceClient_Parent')}}";'>
<i class="bi bi-headset"></i>
</a>
</li>
{% if app.user %}{% if app.session.get('Sejour') %}
<!-- Help button (desktop only) -->
<!-- Vocal Messages (desktop only) -->
<li class="list-inline-item menuGaucheHeaderli d-none d-lg-block" title="Messages vocaux" style="margin-right:40px">
{% if code_sejour|slice(0, 2) == 'PF' %}
<a style="cursor:pointer" class="gaucheitems">
<img src="/images/300ppi/ICvocal.png" style="width:30px">
<label class="nbrpanier" style="background-color: #f54240" id="">{{nbvocal}}</label>
</a>
{% elseif code_sejour|slice(0, 2) == 'PP' and payment == 1 %}
<a style="cursor:pointer" class="gaucheitems">
<img src="/images/300ppi/ICvocal.png" style="width:30px">
<label class="nbrpanier" style="background-color: #f54240" id="">{{nbvocal}}</label>
</a>
{% elseif code_sejour|slice(0, 2) == 'EF' and payment == 1 %}
<a style="cursor:pointer" class="gaucheitems">
<img src="/images/300ppi/ICvocal.png" style="width:30px">
<label class="nbrpanier" style="background-color: #f54240" id="">{{nbvocal}}</label>
</a>
{% elseif code_sejour|slice(0, 2) == 'PP' and payment == 0 %}
<span style="cursor:not-allowed;opacity:0.5" class="gaucheitems">
<img src="/images/300ppi/ICvocal.png" style="width:30px;filter:grayscale(100%)">
<label class="nbrpanier" style="background-color: #808080" id="">{{nbvocal}}</label>
</span>
{% elseif code_sejour|slice(0, 2) == 'EF' and payment == 0 %}
<a id="openVocalModalBtn" style="cursor:pointer;opacity:0.5" class="gaucheitems">
<img src="/images/300ppi/ICvocal.png" style="width:30px;filter:grayscale(100%)">
<label class="nbrpanier" style="background-color: #808080" id="">{{nbvocal}}</label>
</a>
{% endif %}
</li>
<!-- Cart (desktop only) -->
<li class="list-inline-item menuGaucheHeaderli d-none d-lg-block" title="Mon panier" style="margin-right:40px">
<a style="cursor:pointer" class="gaucheitems" onclick='location.href = "{{path('MonPanier')}}";'>
<i class="bi bi-cart-fill cart-link" style="font-size: 1.6rem;line-height: 1.1;color:black;"></i>
<label class="nbrpanier" style="background-color: #f54240" id="cart-count">{{Products|length}}</label>
</a>
</li>
<!-- Mobile dropdown for cart and messages -->
<li class="list-inline-item d-lg-none" title="Menu" onclick="toggleMobileMenu(this);">
<a style="cursor:pointer" class="gaucheitems">
<i class="bi bi-three-dots" style="font-size: 1.8rem; margin-top:-5px"></i>
</a>
<ul class="mobile-menu-custom-dropdown">
<!-- This contains the original desktop navbar items -->
<li class="d-flex align-items-center justify-content-around p-2">
<!-- Cart original element -->
<div class="mobile-menu-navbar-item">
<a style="cursor:pointer" class="gaucheitems" onclick='location.href = "{{path('MonPanier')}}";'>
<i class="bi bi-cart-fill cart-link" style="font-size: 1.6rem;line-height: 1.1;color:black;"></i>
<label class="nbrpanier" style="background-color: #f54240" id="cart-count">{{Products|length}}</label>
</a>
</div>
<!-- Vocal Messages original element with all conditions preserved -->
<div class="mobile-menu-navbar-item">
{% if code_sejour|slice(0, 2) == 'PF' %}
<a style="cursor:pointer" class="gaucheitems">
<img src="/images/300ppi/ICvocal.png" style="width:30px">
<label class="nbrpanier" style="background-color: #f54240" id="">{{nbvocal}}</label>
</a>
{% elseif code_sejour|slice(0, 2) == 'PP' and payment == 1 %}
<a style="cursor:pointer" class="gaucheitems">
<img src="/images/300ppi/ICvocal.png" style="width:30px">
<label class="nbrpanier" style="background-color: #f54240" id="">{{nbvocal}}</label>
</a>
{% elseif code_sejour|slice(0, 2) == 'EF' and payment == 1 %}
<a style="cursor:pointer" class="gaucheitems">
<img src="/images/300ppi/ICvocal.png" style="width:30px">
<label class="nbrpanier" style="background-color: #f54240" id="">{{nbvocal}}</label>
</a>
{% elseif code_sejour|slice(0, 2) == 'PP' and payment == 0 %}
<span style="cursor:not-allowed;opacity:0.5" class="gaucheitems">
<img src="/images/300ppi/ICvocal.png" style="width:30px;filter:grayscale(100%)">
<label class="nbrpanier" style="background-color: #808080" id="">{{nbvocal}}</label>
</span>
{% elseif code_sejour|slice(0, 2) == 'EF' and payment == 0 %}
<a id="openVocalModalBtn" style="cursor:pointer;opacity:0.5" class="gaucheitems">
<img src="/images/300ppi/ICvocal.png" style="width:30px;filter:grayscale(100%)">
<label class="nbrpanier" style="background-color: #808080" id="">{{nbvocal}}</label>
</a>
{% endif %}
</div>
</li>
</ul>
</li>
<!-- Profile dropdown (both mobile and desktop) -->
<li class="list-inline-item menuGaucheHeaderli" title="" onclick="displayDD($(this));">
<a style="cursor:pointer" class="gaucheitems">
<i class="bi bi-person-fill" style="color:black; margin-bottom: 10px;line-height: 0.8px;font-size: 1.8rem;"></i>
</a>
<ul class="submenu DD_nosPrd2">
<li class="ligne_compte" style="cursor:pointer">
<a class="link_compte" onclick='location.href = "{{path('ParametresParent')}}";'>
<svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" fill="currentColor" class="bi bi-person-fill-gear" viewBox="0 0 16 16">
<path d="M11 5a3 3 0 1 1-6 0 3 3 0 0 1 6 0m-9 8c0 1 1 1 1 1h5.256A4.493 4.493 0 0 1 8 12.5a4.49 4.49 0 0 1 1.544-3.393C9.077 9.038 8.564 9 8 9c-5 0-6 3-6 4m9.886-3.54c.18-.613 1.048-.613 1.229 0l.043.148a.64.64 0 0 0 .921.382l.136-.074c.561-.306 1.175.308.87.869l-.075.136a.64.64 0 0 0 .382.92l.149.045c.612.18.612 1.048 0 1.229l-.15.043a.64.64 0 0 0-.38.921l.074.136c.305.561-.309 1.175-.87.87l-.136-.075a.64.64 0 0 0-.92.382l-.045.149c-.18.612-1.048.612-1.229 0l-.043-.15a.64.64 0 0 0-.921-.38l-.136.074c-.561.305-1.175-.309-.87-.87l.075-.136a.64.64 0 0 0-.382-.92l-.148-.045c-.613-.18-.613-1.048 0-1.229l.148-.043a.64.64 0 0 0 .382-.921l-.074-.136c-.306-.561.308-1.175.869-.87l.136.075a.64.64 0 0 0 .92-.382l.045-.148ZM14 12.5a1.5 1.5 0 1 0-3 0 1.5 1.5 0 0 0 3 0"></path>
</svg>
Mon compte
</a>
</li>
{% if app.session.get('Sejour') %}
<li class="ligne_compte" style="cursor:pointer">
<a class="link_compte" onclick='location.href = "{{path('projet-Parent')}}";'>
<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" fill="currentColor" class="bi bi-bag-heart" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M10.5 3.5a2.5 2.5 0 0 0-5 0V4h5zm1 0V4H15v10a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V4h3.5v-.5a3.5 3.5 0 1 1 7 0M14 14V5H2v9a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1M8 7.993c1.664-1.711 5.825 1.283 0 5.132-5.825-3.85-1.664-6.843 0-5.132"></path>
</svg>
Mes créations
</a>
</li>
{% endif %}
<li class='ligne_compte' style="cursor:pointer">
<a class="link_compte" onclick='location.href = "{{path('SuiviCommandeparent')}}";'>
<i class="bi bi-bag-check-fill" style="font-size:1.3rem;margin-right:3px"></i>
Mes Commandes
</a>
</li>
<li class="ligne_compte" style="cursor:pointer">
<a class="link_compte" onclick='location.href = "{{path('SejourParent')}}";'>
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" class="bi bi-suitcase-lg" viewBox="0 0 16 16">
<path d="M5 2a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2h3.5A1.5 1.5 0 0 1 16 3.5v9a1.5 1.5 0 0 1-1.5 1.5H14a.5.5 0 0 1-1 0H3a.5.5 0 0 1-1 0h-.5A1.5 1.5 0 0 1 0 12.5v-9A1.5 1.5 0 0 1 1.5 2zm1 0h4a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1M1.5 3a.5.5 0 0 0-.5.5v9a.5.5 0 0 0 .5.5H3V3zM15 12.5v-9a.5.5 0 0 0-.5-.5H13v10h1.5a.5.5 0 0 0 .5-.5m-3 .5V3H4v10z"></path>
</svg>
Mes séjours
</a>
</li>
<li class="ligne_compte" style="cursor:pointer">
<a class="link_compte" onclick='location.href = "{{path('Besoindaide_Parent')}}";'>
<i class="bi bi-question-circle" style="font-size:1.3rem;margin-right:3px"></i>
FAQ
</a>
</li>
<li class="ligne_compte" style="cursor:pointer">
<a class="link_compte" href="/Parent/logout" style="font-weight:700;">
<i class="bi bi-power" style="margin-right: 3px;font-size: 1.5rem;color:red"></i>
Me déconnecter
</a>
</li>
</ul>
</li>
<!-- Partner logo -->
{%if sejour.idPartenaire.logourl != null and sejour.idPartenaire.logourl != "" and sejour.idPartenaire.logourl is not empty%}
<li>
<img class="logopartenaire" alt="Logo partenaire" src="{{sejour.idPartenaire.logourl}}">
</li>
{%endif%}
{% endif %} {% endif %}
</ul>
<!-- Right elements -->
</div>
</nav>
<div class="vocal-modal-overlay" id="vocalModalOverlay">
<div class="vocal-modal">
<div class="vocal-modal-content">
<h2 style="color: #3CA9AB; font-size: 18px; margin-top: 0; margin-bottom: 12px;">Accès à la boîte vocale</h2>
<!-- Image placeholder -->
<div style="text-align: center; margin: 12px 0;">
<img src="/images/callpopover.png" alt="Illustration messages vocaux" style="max-width: 50%; border-radius: 6px;"/>
</div>
<div class="vocal-feature">
<div class="vocal-feature-icon">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="#333">
<path d="M20 15.5c-1.25 0-2.45-.2-3.57-.57-.35-.11-.74-.03-1.02.24l-2.2 2.2c-2.83-1.44-5.15-3.75-6.59-6.59l2.2-2.21c.28-.26.36-.65.25-1C8.7 6.45 8.5 5.25 8.5 4c0-.55-.45-1-1-1H4c-.55 0-1 .45-1 1 0 9.39 7.61 17 17 17 .55 0 1-.45 1-1v-3.5c0-.55-.45-1-1-1zM19 12h2c0-4.97-4.03-9-9-9v2c3.87 0 7 3.13 7 7zm-4 0h2c0-2.76-2.24-5-5-5v2c1.66 0 3 1.34 3 3z"/>
</svg>
</div>
<div class="vocal-feature-text">
<div class="vocal-feature-title">Recevez un appel à chaque nouveau message</div>
<p class="vocal-feature-desc">À chaque enregistrement, vous recevez un appel avec le message vocal.</p>
<p class="vocal-feature-desc" style="color: #E9553B; font-weight: bold;">Coût : 2,90 € par message.</p>
</div>
</div>
<div class="vocal-feature">
<div class="vocal-feature-icon">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="#1D75BB">
<path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 17.93c-3.95-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2v1.93zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39z"/>
</svg>
</div>
<div class="vocal-feature-text">
<div class="vocal-feature-title">Accédez aux messages vocaux en illimité sur le web</div>
<p class="vocal-feature-desc">Consultez tous les messages directement sur la plateforme, sans restriction.</p>
<p class="vocal-feature-desc" style="color: #3CA9AB; font-weight: bold;">Inclus sans frais supplémentaires.</p>
</div>
</div>
<div class="vocal-feature">
<div class="vocal-feature-icon">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="#4CAF50">
<path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/>
</svg>
</div>
<div class="vocal-feature-text">
<div class="vocal-feature-title">Vous bénéficiez des deux options automatiquement.</div>
<p class="vocal-feature-desc">Cliquez sur <strong>"Confirmer"</strong> pour activer votre accès.</p>
</div>
</div>
</div>
<div class="vocal-modal-buttons">
<button class="vocal-btn vocal-btn-cancel" id="vocalCancelBtn">Annuler</button>
<button class="vocal-btn vocal-btn-confirm" id="vocalConfirmBtn">Confirmer</button>
</div>
</div>
</div>
<script src="{{'/Plugins/js/jquery-3.4.1.js'}}"></script>
<script src="{{'/Plugins/js/popper.js'}}"></script>
<script src="{{'/Plugins/js/bootstrap.min.js'}}"></script>
<script src="{{ asset('js/shepherd-tours.js') }}"></script>
<script>
const openVocalModalBtn = document.getElementById('openVocalModalBtn');
const vocalModalOverlay = document.getElementById('vocalModalOverlay');
const vocalCancelBtn = document.getElementById('vocalCancelBtn');
const vocalConfirmBtn = document.getElementById('vocalConfirmBtn');
// Function to open modal
function openVocalModal() {
vocalModalOverlay.style.display = 'flex';
vocalModalOverlay.classList.add('vocal-fade-in');
}
// Function to close modal
function closeVocalModal() {
vocalModalOverlay.style.display = 'none';
}
// Event listeners
openVocalModalBtn.addEventListener('click', openVocalModal);
vocalCancelBtn.addEventListener('click', closeVocalModal);
vocalConfirmBtn.addEventListener('click', () => {
// Redirect to messages page
window.location.href = '/Parent/achatBoiteVocale';
});
// Close when clicking outside the modal
vocalModalOverlay.addEventListener('click', (event) => {
if (event.target === vocalModalOverlay) {
closeVocalModal();
}
});
function toggleMobileMenu(element) {
// Close any other open dropdowns first
const allDropdowns = document.querySelectorAll('.mobile-menu-custom-dropdown');
allDropdowns.forEach(dropdown => {
if (dropdown !== element.querySelector('.mobile-menu-custom-dropdown')) {
dropdown.style.display = 'none';
}
});
// Toggle the clicked dropdown
const dropdown = element.querySelector('.mobile-menu-custom-dropdown');
if (dropdown.style.display === 'block') {
dropdown.style.display = 'none';
} else {
dropdown.style.display = 'block';
}
// Stop propagation for links inside the dropdown
const dropdownLinks = dropdown.querySelectorAll('a, span');
dropdownLinks.forEach(link => {
link.addEventListener('click', function(e) {
e.stopPropagation();
});
});
// Specifically handle the modal button click
const modalBtn = dropdown.querySelector('#openVocalModalBtn');
if (modalBtn) {
modalBtn.onclick = function(e) {
e.stopPropagation();
// If there's an existing click handler on this button, we should preserve it
// This is a placeholder for whatever the original modal opening code is
if (typeof openVocalModal === 'function') {
openVocalModal();
}
// If the modal is opened by a data attribute or other mechanism, we don't need to do anything else
};
}
// Close dropdown when clicking outside
document.addEventListener('click', function closeDropdown(event) {
if (!element.contains(event.target)) {
dropdown.style.display = 'none';
document.removeEventListener('click', closeDropdown);
}
});
// Prevent the click from propagating
event.stopPropagation();
}
function loadAndStartTourBasedOnRoute() {
// Get the current route/path
const currentPath = window.location.pathname;
// Determine which tour to start based on the route
let tourFunction = null;
if (currentPath.includes('/Parent/AccueilParent')) {
tourFunction = 'startSejourTour';
} else if (currentPath.includes('/Parent/AjoutAlbum')) {
tourFunction = 'startAlbumTour';
}
else if (currentPath.includes('/Parent/LivrePhotos')) {
tourFunction = 'startAlbumTour';
}
else if (currentPath.includes('/Parent/AjoutRetroPhotos_Fav/12')) {
tourFunction = 'startRetroPhotosTour';
}
else if (currentPath.includes('/Parent/AjoutRetroPhotos_Fav/24')) {
tourFunction = 'startRetroPhotosTour';
}
else if (currentPath.includes('/Parent/AjoutRetroPhotos_Fav/36')) {
tourFunction = 'startRetroPhotosTour';
}
else if (currentPath.includes('/Parent/AjoutPochettePhotos_Fav/12')) {
tourFunction = 'startTiragePhotosTour';
}
else if (currentPath.includes('/Parent/AjoutPochettePhotos_Fav/24')) {
tourFunction = 'startTiragePhotosTour';
}
else if (currentPath.includes('/Parent/AjoutPochettePhotos_Fav/36')) {
tourFunction = 'startTiragePhotosTour';
}
else if (currentPath.includes('/Parent/PackPhotosNumerique_Favoris/20')) {
tourFunction = 'startPackNumeriqueTour';
}
else if (currentPath.includes('/Parent/PackPhotosNumerique_Favoris/30')) {
tourFunction = 'startPackNumeriqueTour';
}
else if (currentPath.includes('/Parent/PackPhotosNumerique_Favoris/50')) {
tourFunction = 'startPackNumeriqueTour';
} else {
// Default or handle other routes
console.log('No tour available for this route');
return;
}
// Make sure shepherd-tours.js is loaded
const loadTourScript = function() {
var script = document.createElement('script');
script.src = "/js/shepherd-tours.js";
script.onload = function() {
console.log(`Tour script loaded, checking for ${tourFunction}`);
// Check if the tour function is now available
if (typeof window[tourFunction] === 'function') {
console.log(`${tourFunction} function found, starting tour`);
// Make sure Shepherd is loaded
if (typeof Shepherd === 'undefined') {
console.log("Loading Shepherd.js");
var shepherdScript = document.createElement('script');
shepherdScript.src = "https://cdn.jsdelivr.net/npm/shepherd.js@8.3.1/dist/js/shepherd.min.js";
shepherdScript.onload = function() {
console.log("Shepherd.js loaded, starting tour");
window[tourFunction]();
};
document.head.appendChild(shepherdScript);
} else {
console.log("Shepherd.js already loaded, starting tour");
window[tourFunction]();
}
} else {
console.error(`Tour function ${tourFunction} not found after loading script`);
}
};
script.onerror = function() {
console.error("Failed to load tour script");
};
document.head.appendChild(script);
};
// Check if the tour function exists already
if (typeof window[tourFunction] === 'function') {
console.log(`${tourFunction} already available`);
// Make sure Shepherd is loaded
if (typeof Shepherd === 'undefined') {
console.log("Loading Shepherd.js");
var shepherdScript = document.createElement('script');
shepherdScript.src = "https://cdn.jsdelivr.net/npm/shepherd.js@8.3.1/dist/js/shepherd.min.js";
shepherdScript.onload = function() {
console.log("Shepherd.js loaded, starting tour");
window[tourFunction]();
};
document.head.appendChild(shepherdScript);
} else {
console.log("Shepherd.js already loaded, starting tour");
window[tourFunction]();
}
} else {
console.log(`${tourFunction} not found, loading tour script`);
loadTourScript();
}
}
function addToCartAnimation() {
const cartIcon = document.querySelector('.bi-cart-fill');
if (cartIcon) {
cartIcon.classList.add('cart-bounce');
setTimeout(() => {
cartIcon.classList.remove('cart-bounce');
}, 600); // Durée de l'animation (600ms)
}
}
</script>
<script>
$(document).ready(function() {
// Function to check if Panier contains a product with type 20
function checkPanier() {
$.ajax({
url: '{{ path("disablePack") }}',
method: 'GET',
dataType: 'json',
success: function(response) {
if (response.containsProduitType20 || response.idSejour == 0) {
// Disable the section by adding a class
$('#packOffertSection').addClass('disabled-section');
$('#packOffertSection .disabled-element').addClass('disabled-element');
} else {
// Re-enable the section by removing the disabled classes
$('#packOffertSection').removeClass('disabled-section');
$('#packOffertSection .disabled-element').removeClass('disabled-element');
// Initialize popover if needed
initPopover();
}
},
error: function(xhr, status, error) {
console.error('AJAX request failed:', status, error);
}
});
}
// Function to initialize the popover
function initPopover() {
$('#offrePack').popover({
title: 'Pack numérique inclut <a href="#" class="close" data-dismiss="alert">×</a>',
content: '<div>Profitez d\'un pack numérique inclut dans votre connexion Wahou!</div><a href="{{ path('PackPhotosNumerique_Offert', {'nbr': 15}) }}" class="btn custom-button">J\'en profite</a>',
html: true,
placement: 'bottom',
trigger: 'manual'
});
$('#offrePack').on('mouseenter', function() {
$(this).popover('show');
});
$(document).on('modalClosed', function() {
$('#offrePack').popover('show');
});
$(document).on('click', '.popover .close', function() {
$('#offrePack').popover('hide');
});
$(document).on('click', function(e) {
if (!$(e.target).closest('#offrePack').length && !$(e.target).closest('.popover').length) {
$('#offrePack').popover('hide');
}
});
}
// Call the checkPanier function on document ready
checkPanier();
});
</script>
<!-- Navbar -->