Initial commit
This commit is contained in:
21
static/js/all.js
Normal file
21
static/js/all.js
Normal file
@@ -0,0 +1,21 @@
|
||||
document.currentScript.insertAdjacentHTML('afterend', Array.from({ length: 48 }, (_, i) => {
|
||||
const greens = ['rgba(25,112,97,.8)', 'rgba(34,145,120,.6)', 'rgba(16,80,65,.9)', 'rgba(45,160,130,.5)'];
|
||||
return `<div class="dm-cell" style="background:${greens[i % 4]}"></div>`;
|
||||
}).join(''));
|
||||
|
||||
/* FAQ toggle */
|
||||
function toggleFaq(btn) {
|
||||
btn.parentElement.classList.toggle('open');
|
||||
}
|
||||
|
||||
/* Scroll reveal */
|
||||
const revealEls = document.querySelectorAll('.reveal');
|
||||
const io = new IntersectionObserver((entries) => {
|
||||
entries.forEach(e => {
|
||||
if (e.isIntersecting) {
|
||||
e.target.classList.add('visible');
|
||||
io.unobserve(e.target);
|
||||
}
|
||||
});
|
||||
}, { threshold: 0.12 });
|
||||
revealEls.forEach(el => io.observe(el));
|
||||
3
static/js/faq_toggle.js
Normal file
3
static/js/faq_toggle.js
Normal file
@@ -0,0 +1,3 @@
|
||||
function toggleFaq(btn) {
|
||||
btn.parentElement.classList.toggle('open');
|
||||
}
|
||||
20
static/js/hamburger.js
Normal file
20
static/js/hamburger.js
Normal file
@@ -0,0 +1,20 @@
|
||||
(function () {
|
||||
var btn = document.getElementById('nav-hamburger');
|
||||
var drawer = document.getElementById('nav-drawer');
|
||||
if (!btn || !drawer) return;
|
||||
|
||||
btn.addEventListener('click', function () {
|
||||
var isOpen = drawer.classList.toggle('open');
|
||||
btn.classList.toggle('open', isOpen);
|
||||
btn.setAttribute('aria-expanded', String(isOpen));
|
||||
});
|
||||
|
||||
// Ferme le drawer quand on clique sur un lien
|
||||
drawer.querySelectorAll('a').forEach(function (a) {
|
||||
a.addEventListener('click', function () {
|
||||
drawer.classList.remove('open');
|
||||
btn.classList.remove('open');
|
||||
btn.setAttribute('aria-expanded', 'false');
|
||||
});
|
||||
});
|
||||
})();
|
||||
10
static/js/scroll_reveal.js
Normal file
10
static/js/scroll_reveal.js
Normal file
@@ -0,0 +1,10 @@
|
||||
const revealEls = document.querySelectorAll('.reveal');
|
||||
const io = new IntersectionObserver((entries) => {
|
||||
entries.forEach(e => {
|
||||
if (e.isIntersecting) {
|
||||
e.target.classList.add('visible');
|
||||
io.unobserve(e.target);
|
||||
}
|
||||
});
|
||||
}, { threshold: 0.12 });
|
||||
revealEls.forEach(el => io.observe(el));
|
||||
Reference in New Issue
Block a user