better chapitres hover, js clean
This commit is contained in:
@@ -59,19 +59,22 @@ gsap.registerPlugin(ScrollTrigger, ScrollSmoother);
|
||||
|
||||
function initPartieFrontBackCardSwitch() {
|
||||
let principes_pratique = document.getElementById('partie-principes-pratique');
|
||||
let cards = principes_pratique.getElementsByClassName('field-card');
|
||||
console.log('cards', cards);
|
||||
for (const card of cards) {
|
||||
card.addEventListener('mousemove', function (e) {
|
||||
console.log(this, e);
|
||||
for (const child of this.parentElement.children){
|
||||
child.classList.add('back-card')
|
||||
child.classList.remove('front-card');
|
||||
}
|
||||
this.classList.add('front-card')
|
||||
this.classList.remove('back-card')
|
||||
})
|
||||
if (principes_pratique) {
|
||||
let cards = principes_pratique.getElementsByClassName('field-card');
|
||||
// console.log('cards', cards);
|
||||
for (const card of cards) {
|
||||
card.addEventListener('mousemove', function (e) {
|
||||
// console.log(this, e);
|
||||
for (const child of this.parentElement.children){
|
||||
child.classList.add('back-card')
|
||||
child.classList.remove('front-card');
|
||||
}
|
||||
this.classList.add('front-card')
|
||||
this.classList.remove('back-card')
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function initBgAnime(){
|
||||
|
||||
Reference in New Issue
Block a user