script pour établir une bdd Ãà partir d'un tsv avec différent format - retour accueil
git clone git://bebou.netlib.re/laradb
Log | Files | Refs |
commit c0ec34306b1aadfc8c6ae92400571409103d5022 parent 453e61f4f895c9b13466bc027784762abfad652f Auteurice: martlem <contact@martinlemaire.fr> Date: Tue, 12 Nov 2024 18:48:54 +0100 nav a#active Diffstat:
M | src/static/script.js | | | 19 | +++++++++++++++++++ |
M | src/static/style.css | | | 11 | +++++++---- |
2 files changed, 26 insertions(+), 4 deletions(-)
diff --git a/src/static/script.js b/src/static/script.js @@ -202,6 +202,25 @@ const formatDate = () => { const path = window.location.pathname; +function findCurrentNavLinks() { + const links = document.querySelectorAll("nav a"); + let activeLinks = [] + + for (let link of links) { + console.log("/" + link.href.split('/').splice(-1)[0] == path) + if ("/" + link.href.split('/').splice(-1)[0] == path) { + activeLinks = [...activeLinks, link] + } + } + return activeLinks +} + +const currentLinks = findCurrentNavLinks(); +currentLinks.forEach((e) => { +e.setAttribute("id","active"); +}) + + switch (path) { case '/table.html': onClickTable() diff --git a/src/static/style.css b/src/static/style.css @@ -135,9 +135,8 @@ padding:var(--corps); sup{line-height:var(--interligne)} sup::before{content:' '} .unsure, sup {opacity:var(--incertitude)} -nav {width:100%;background:var(--fond-A); +nav {width:100%;background:var(--fond-A);padding:0 var(--indent); position:relative; -padding:0; z-index:1000} #map {display:block;height:100vh; background: var(--fond-A); @@ -228,10 +227,11 @@ a{color:var(--accent) !important} .nav-main a:nth-of-type(2), .nav-sub a:nth-of-type(1) {grid-column:2} .nav-main a:nth-of-type(3), .nav-sub a:nth-of-type(2) {grid-column:3} .nav-main a:nth-of-type(4), .nav-sub a:nth-of-type(3) {grid-column:4} -.nav-sub a {opacity:var(--incertitude)} -nav a {color:var(--accent); width:fit-content} +nav a {color:var(--accent); width:fit-content;} nav a:hover{opacity:1;} +.nav-sub #active {color:var(--fond-A);background:var(--noir)} +.nav-main a:not(:first-of-type), .nav-sub a {color:var(--noir)} nav:first-of-type{ padding-top:calc(var(--interligne) / 2); @@ -261,3 +261,6 @@ footer p {margin:0} background: var(--noir); } +.large, #TABLEAU, #TIMELINE { + margin:0 var(--indent) +}