premier jet animation header

This commit is contained in:
2024-07-09 14:38:50 +02:00
parent d2fbdb7c3c
commit 2672685243
7 changed files with 26 additions and 29 deletions

View File

@@ -57,9 +57,12 @@
function checkHeaderCollapse() {
if (header.classList.contains('header--collapsed')) {
stopLogoAnimation();
} else {
} else if (header.classList.contains('header--collapsed-already')) {
stopLogoAnimation();
} else {
startLogoAnimation();
}
}
// Appeler la fonction au chargement initial
@@ -75,32 +78,15 @@
});
observer.observe(header, { attributes: true });
// Autres fonctions et initialisations ici
});
document.addEventListener('DOMContentLoaded', function() {
const header = document.querySelector('header');
// const logo = document.querySelector('.qdd-header');
// console.log(logo);
// Fonction pour démarrer l'animation du logo SVG
// function startLogoAnimation() {
// logo.classList.add('animated');
// }
// Fonction pour arrêter l'animation du logo SVG
// function stopLogoAnimation() {
// logo.classList.remove('animated');
// }
// Vérifier si la page a été rechargée ou si c'est une navigation interne
const isFirstLoad = !performance.getEntriesByType("navigation")[0].type.includes('back_forward');
// Vérifier si nous sommes sur la page cible
const isTargetPath = window.location.pathname === '/'; // Remplacez '/votre-chemin-cible' par le chemin réel
const isTargetPath = window.location.pathname === '/';
// Si ce n'est pas la première charge ou si le chemin n'est pas le chemin cible, ajouter la classe immédiatement
if (!isFirstLoad || !isTargetPath) {
@@ -111,7 +97,7 @@
// Sinon, appliquer la transition après un délai
setTimeout(() => {
header.classList.add('header--collapsed');
}, 5000); // Attendre 1 seconde avant de réduire la taille du header
}, 5000);
}

View File

@@ -57,6 +57,7 @@ footer{
}
.footer_left_container{
padding-left: 5%;
.logo-qdd{display: none;}
@media(max-width: 700px){
max-width: 50vw;
}

View File

@@ -24,6 +24,7 @@ header{
flex-direction: row;
transition: height 2s ease-in-out, width 2s ease-in-out; /* Transition pour le changement de taille */
background-color: $white-header;
img{display: none;}
@media(max-width: 660px){
height: inherit;
}