better home pres paragraph with formes

This commit is contained in:
2026-07-06 16:08:18 +02:00
parent 2bc69be75f
commit db25fcf531
4 changed files with 84 additions and 9 deletions

View File

@@ -66,6 +66,7 @@ gsap.registerPlugin(ScrollTrigger, ScrollSmoother);
console.log('MathalloTheme init()')
initBurgerMenu();
initPartieFrontBackCardSwitch();
initHome();
initBgFormes();
initBgAnime();
initFootnotes();
@@ -109,6 +110,19 @@ gsap.registerPlugin(ScrollTrigger, ScrollSmoother);
})
}
function initHome(){
let ps = document.querySelectorAll('article[role="home-presentation"] p');
let used_n = [];
for (const p of ps) {
let n = Math.round(Math.random() * (_formesclasses.length -1));
while (used_n.includes(n)) {
n = Math.round(Math.random() * (_formesclasses.length -1));
}
used_n.push(n);
p.classList.add(`forme-${_formesclasses[n]}`);
}
}
async function initBgFormes(){
const container = document.querySelector('main[role="main"] > .layout-content > .wrapper');
// console.log('container', container);