flip-flop partie cards

This commit is contained in:
2026-02-02 11:55:45 +01:00
parent 38e2390f12
commit 31f40e9578
5 changed files with 84 additions and 23 deletions

View File

@@ -43,8 +43,9 @@ gsap.registerPlugin(ScrollTrigger, ScrollSmoother);
function init () {
console.log('MathalloTheme init()')
initBurgerMenu();
initPartieFrontBackCardSwitch();
initBgAnime()
initVues()
// initVues()
}
function initBurgerMenu() {
@@ -56,6 +57,23 @@ 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')
})
}
}
function initBgAnime(){
// gsap.to('body', {
// scrollTrigger: 'main[role="main"]', // start animation when ".box" enters the viewport
@@ -70,19 +88,19 @@ gsap.registerPlugin(ScrollTrigger, ScrollSmoother);
// });
}
function initVues(){
console.log('initVues');
// function initVues(){
// console.log('initVues');
// initVueContent();
// // initVueContent();
}
// }
function initVueContent(){
createApp(Content).mount('main[role="main"]');
// function initVueContent(){
// createApp(Content).mount('main[role="main"]');
// processEtapeLinks();
}
// // processEtapeLinks();
// }
// function onClickEtapeLink(e){