flip-flop partie cards
This commit is contained in:
@@ -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){
|
||||
|
||||
Reference in New Issue
Block a user