amélioration dropdown collectif et debug (?) la nav au resize

This commit is contained in:
Valentin
2024-06-13 17:47:36 +02:00
parent 3b86f61152
commit c6186a58f4
5 changed files with 25 additions and 5 deletions
@@ -200,6 +200,7 @@ h4 + p em > img.open {
h4 + p + p { h4 + p + p {
margin-bottom: 0 !important; margin-bottom: 0 !important;
line-height: 1.45em;
padding-bottom: 0rem; padding-bottom: 0rem;
font-size: 0.75em; font-size: 0.75em;
max-height: 0px; max-height: 0px;
@@ -360,6 +361,8 @@ body main .content .projet-card .loader {
} }
body main .content .projet-card a { body main .content .projet-card a {
width: 100%; width: 100%;
display: flex;
justify-content: center;
} }
body main .content .projet-card a figcaption { body main .content .projet-card a figcaption {
color: #0e1229; color: #0e1229;
File diff suppressed because one or more lines are too long
+16 -4
View File
@@ -77,6 +77,7 @@ function initBarba() {
} }
}) })
barba.hooks.after((data) => { barba.hooks.after((data) => {
refreshUiOnResize()
let pageTitleComparator, navIndex let pageTitleComparator, navIndex
switch ($('main').children(":first").attr('id')) { switch ($('main').children(":first").attr('id')) {
case 'index-content': case 'index-content':
@@ -175,9 +176,11 @@ function refreshUiOnResize() {
if (result) { if (result) {
currentColor = $('body').css('background-color') currentColor = $('body').css('background-color')
if (isDesktopDevice) { if (isDesktopDevice) {
console.log("is desktop");
$('nav').css('background-color', currentColor) $('nav').css('background-color', currentColor)
$('#nav-container').css('background-color', color_bg) $('#nav-container').css('background-color', color_bg)
} else { } else {
console.log("is NOT desktop");
$('nav').css('background-color', color_main) $('nav').css('background-color', color_main)
$('#nav-container').css('background-color', currentColor) $('#nav-container').css('background-color', currentColor)
} }
@@ -826,11 +829,20 @@ function addToggleBiography() {
} }
function toggleBiographie(el) { function toggleBiographie(el) {
let targetContent;
let targetArrow;
if (el.target.tagName === "H4") { if (el.target.tagName === "H4") {
el.target.nextElementSibling.nextElementSibling.classList.toggle('open'); targetContent = el.target.nextElementSibling.nextElementSibling;
el.target.nextElementSibling.firstElementChild.firstElementChild.classList.toggle('open'); targetArrow = el.target.nextElementSibling.firstElementChild.firstElementChild;
} else { } else {
el.target.firstElementChild.classList.toggle('open'); targetContent = el.target.firstElementChild;
el.target.parentElement.nextElementSibling.classList.toggle('open'); targetArrow = el.target.parentElement.nextElementSibling;
} }
for (let openElement of document.querySelectorAll('h4 + p > em > img, h4 + p + p')) {
if (openElement !== targetContent && openElement !== targetArrow) {
openElement.classList.remove('open');
}
}
targetContent.classList.toggle('open');
targetArrow.classList.toggle('open');
} }
@@ -34,8 +34,10 @@
// typography - general sizes // typography - general sizes
$currentSize: 1.2em; $currentSize: 1.2em;
$smallSize: 0.95em; $smallSize: 0.95em;
$tinySize: 0.75em; $tinySize: 0.75em;
$currentLineHeight: 1.25em; $currentLineHeight: 1.25em;
$smallFontLineHeight: 1.45em;
$titleLineHeight: 1.1em; $titleLineHeight: 1.1em;
// typography - sizes mobile // typography - sizes mobile
$titleFontSizeMobile: 1.8em; $titleFontSizeMobile: 1.8em;
@@ -51,6 +51,7 @@
} }
h4 + p + p { h4 + p + p {
margin-bottom: 0 !important; margin-bottom: 0 !important;
line-height: $smallFontLineHeight;
padding-bottom: 0rem; padding-bottom: 0rem;
font-size: $tinySize; font-size: $tinySize;
max-height: 0px; max-height: 0px;
@@ -203,6 +204,8 @@
} }
a { a {
width: 100%; width: 100%;
display: flex;
justify-content: center;
figcaption { figcaption {
color: $mainColor; color: $mainColor;
background-color: transparent; background-color: transparent;