better home pres paragraph with formes
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user