better chapitres hover, js clean
This commit is contained in:
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -59,19 +59,22 @@ gsap.registerPlugin(ScrollTrigger, ScrollSmoother);
|
|||||||
|
|
||||||
function initPartieFrontBackCardSwitch() {
|
function initPartieFrontBackCardSwitch() {
|
||||||
let principes_pratique = document.getElementById('partie-principes-pratique');
|
let principes_pratique = document.getElementById('partie-principes-pratique');
|
||||||
let cards = principes_pratique.getElementsByClassName('field-card');
|
if (principes_pratique) {
|
||||||
console.log('cards', cards);
|
let cards = principes_pratique.getElementsByClassName('field-card');
|
||||||
for (const card of cards) {
|
// console.log('cards', cards);
|
||||||
card.addEventListener('mousemove', function (e) {
|
for (const card of cards) {
|
||||||
console.log(this, e);
|
card.addEventListener('mousemove', function (e) {
|
||||||
for (const child of this.parentElement.children){
|
// console.log(this, e);
|
||||||
child.classList.add('back-card')
|
for (const child of this.parentElement.children){
|
||||||
child.classList.remove('front-card');
|
child.classList.add('back-card')
|
||||||
}
|
child.classList.remove('front-card');
|
||||||
this.classList.add('front-card')
|
}
|
||||||
this.classList.remove('back-card')
|
this.classList.add('front-card')
|
||||||
})
|
this.classList.remove('back-card')
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function initBgAnime(){
|
function initBgAnime(){
|
||||||
|
|||||||
@@ -10,12 +10,17 @@
|
|||||||
display: block;
|
display: block;
|
||||||
font-size: 0.756em;
|
font-size: 0.756em;
|
||||||
padding:0 0 0.25em 0;
|
padding:0 0 0.25em 0;
|
||||||
|
transition: color 0.25s ease-out;
|
||||||
&:has(+ a:hover){
|
&:has(+ a:hover){
|
||||||
color: $rose;
|
color: $rose;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
a{
|
a{
|
||||||
font-size: 1.13em;
|
font-size: 1.13em;
|
||||||
|
transition: color 0.15s ease-out;
|
||||||
|
&:hover{
|
||||||
|
color: $bleu_site;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user