intégration du design il manque que les images de fond
This commit is contained in:
@@ -9,10 +9,12 @@
|
||||
Drupal.behaviors.erabletheme = {
|
||||
attach: function (context, settings) {
|
||||
|
||||
//
|
||||
// Carrousel
|
||||
//
|
||||
(function($, window) {
|
||||
let slickEl = $('.slick-container').children().first().children().first().children().first().children().first();
|
||||
$(slickEl).slick({
|
||||
arrows: false,
|
||||
dots: true,
|
||||
appendDots: $('#carousel_dots')
|
||||
});
|
||||
@@ -40,7 +42,7 @@
|
||||
delay += opacityDelay;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Toggle menu visibility on hamburger click
|
||||
hamburgerBtn.addEventListener("click", function(event) {
|
||||
event.stopPropagation();
|
||||
@@ -51,7 +53,7 @@
|
||||
}, 700);
|
||||
toggleMenuItems('hide');
|
||||
} else {
|
||||
menu.style.display = "block";
|
||||
menu.style.display = "flex";
|
||||
toggleMenuItems('show');
|
||||
}
|
||||
setTimeout(() => {
|
||||
@@ -68,8 +70,54 @@
|
||||
hamburgerIcon.classList.remove('open');
|
||||
menu.classList.remove("active");
|
||||
toggleMenuItems('hide');
|
||||
setTimeout(() => {
|
||||
menu.style.display = "none";
|
||||
}, 700);
|
||||
}
|
||||
});
|
||||
|
||||
//
|
||||
// Fixed links
|
||||
//
|
||||
let fluoButtons;
|
||||
if (document.querySelector('.actu_full')) {
|
||||
fluoButtons = document.querySelectorAll('.liens_fixed > div > div:nth-of-type(2):not(.visually-hidden), .file_fixed > div > .visually-hidden + div > div');
|
||||
} else {
|
||||
fluoButtons = document.querySelectorAll('.liens_fixed > div > div:not(.visually-hidden), .file_fixed > div > div');
|
||||
}
|
||||
|
||||
let footer = document.querySelector('#footer_top');
|
||||
function positionFluoLinks() {
|
||||
for (let i = fluoButtons.length; i > 0 ; i--) {
|
||||
let prevButtonBottom = fluoButtons[i] ? parseInt(fluoButtons[i].style.bottom) : 0;
|
||||
let prevButtonHeight = fluoButtons[i] ? fluoButtons[i].offsetHeight : 0;
|
||||
if (footer.offsetTop < window.innerHeight + window.scrollY && i === fluoButtons.length) {
|
||||
fluoButtons[i - 1].style.bottom = `${window.innerHeight - footer.offsetTop + window.scrollY + 30}px`;
|
||||
} else {
|
||||
fluoButtons[i - 1].style.bottom = i === fluoButtons.length ? '30px' : `${prevButtonBottom + prevButtonHeight + 15}px`;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (document.querySelector('.fullpage')) {
|
||||
positionFluoLinks();
|
||||
document.addEventListener('scroll', () => {
|
||||
positionFluoLinks();
|
||||
});
|
||||
window.addEventListener('resize', () => {
|
||||
positionFluoLinks();
|
||||
});
|
||||
}
|
||||
|
||||
//
|
||||
// Ajouter les logos réseaux sociaux dans le menu togglable
|
||||
//
|
||||
let socials = document.querySelector('.social-media-links--platforms');
|
||||
let socialsClone = socials.cloneNode(true);
|
||||
socialsClone.id = 'socials-in-menu-wrapper';
|
||||
let menuContainer = document.querySelector('#hamburger + ul');
|
||||
let socialsContainer = document.createElement('li');
|
||||
socialsContainer.append(socialsClone);
|
||||
menuContainer.append(socialsContainer);
|
||||
}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user