Skip to content

Commit

Permalink
Merge branch 'staging' into 'main'
Browse files Browse the repository at this point in the history
Staging > Main

See merge request sgct/sl-cnfig!13
  • Loading branch information
MONTICOLO Julien (Eurométropole) committed Oct 3, 2024
2 parents 9e9a003 + f810421 commit 070233e
Show file tree
Hide file tree
Showing 15 changed files with 152 additions and 2,847 deletions.
74 changes: 37 additions & 37 deletions src/fig2024/config.js

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion src/fig2024/gallery.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ function openLightbox(imgParams) {
// thumbnails
var divThumbnail = document.createElement("div");
var thumbnail = document.createElement("img");
thumbnail.src = key;
if ("mini" in values) {
thumbnail.src = values.mini;
} else {
thumbnail.src = key;
};
thumbnail.alt = values.alt;
thumbnail.credit = values.credit;
thumbnail.classList.add("gallery");
Expand Down
50 changes: 50 additions & 0 deletions src/fig2024/hand_click.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/fig2024/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

<body>
<div id='map'>
<div class="legend">
<div class="legend open">
<div class="legend__button">+</div>
<div class="legend__content">
<h3 class="legend__title">Légende</h4>
Expand Down
2 changes: 1 addition & 1 deletion src/fig2024/legend.css
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
}

.legend-train div::before {
background: black;
background: rgba(107, 95, 95, 1);
}

.legend-bike div::before {
Expand Down
20 changes: 17 additions & 3 deletions src/fig2024/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,20 +158,34 @@ config.chapters.forEach((record, idx) => {
}
// Creates the image for the vignette
if (record.images) {
firstImageParams = Object.values(record.images)[0]
record_alt = firstImageParams.alt;
var imageDiv = document.createElement('div');
imageDiv.classList.add("imageDiv");
var image = new Image();
image.src = Object.keys(record.images)[0];
image.alt = `Illustration : ${Object.values(record.images)[0].alt}`;
image.alt = `Illustration : ${record_alt}`;
if ("width" in firstImageParams) {
image.style.width = firstImageParams.width;
};
image.setAttribute(
"onclick",
`openLightbox('${encodeURIComponent(JSON.stringify(record.images))}');currentSlide(1)`
);
image.classList.add("hover-shadow");
image.classList.add("cursor");
chapter.appendChild(image);
var handClickIcon = new Image();
handClickIcon.src = "./hand_click.svg"
handClickIcon.classList.add("handclick");
imageDiv.appendChild(image);
if (Object.keys(record.images).length > 1) {
imageDiv.appendChild(handClickIcon);
};
chapter.appendChild(imageDiv);
// Creates the image credit for the vignette
var imageCredit = document.createElement('p');
imageCredit.classList.add('imageCredit');
imageCredit.innerHTML = 'Crédit: ' + Object.values(record.images)[0].credit;
imageCredit.innerHTML = `${record_alt} | Crédit: ${firstImageParams.credit}`;
chapter.appendChild(imageCredit);
}
// Creates the description for the vignette
Expand Down
11 changes: 7 additions & 4 deletions src/fig2024/style.json
Original file line number Diff line number Diff line change
Expand Up @@ -2280,17 +2280,20 @@
"type": "line",
"source": "voieferree",
"paint": {
"line-color": "rgba(0, 0, 0, 1)",
"line-dasharray": [0.2, 8],
"line-width": {"base": 1.4, "stops": [[14.5, 0], [15, 3], [20, 8]]}
"line-color": "rgba(107, 95, 95, 1)",
"line-dasharray": [0.2, 3],
"line-width": {"base": 1.4, "stops": [[14.5, 0], [15, 12], [20, 20]]}
}
},
{
"id": "voieferree",
"type": "line",
"source": "voieferree",
"layout": {"visibility": "visible"},
"paint": {"line-width": 3, "line-color": "rgba(107, 95, 95, 1)"}
"paint": {
"line-width": {"stops": [[8, 2], [12, 4], [15, 8], [18, 10]]},
"line-color": "rgba(107, 95, 95, 1)"
}
},
{
"id": "03_Holtzheim",
Expand Down
44 changes: 34 additions & 10 deletions src/fig2024/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,23 @@ body {
max-width: 50vw;
}

#features .imageDiv {
position: relative;
padding: 0 0;
}

#features .handclick {
position: absolute;
bottom: -5px;
right: -18px;
width: 25px;
opacity: 75%;
}

#features .imageCredit {
font-size: 0.9em;
margin-top: -5px;
margin-top: -3px;
line-height: normal;
}

/* Remove the default triangle */
Expand All @@ -113,7 +127,7 @@ body {
transition: 0.2s;
}

#features details[open] > summary::after {
#features details[open]>summary::after {
transform: rotate(90deg);
}

Expand Down Expand Up @@ -166,6 +180,8 @@ a:visited {
}

.step div {
display: inline-block;
text-align: center;
padding: 25px 50px;
line-height: 25px;
font-size: 13px;
Expand All @@ -174,6 +190,7 @@ a:visited {
.step img {
width: 100%;
}

/* flèche animée invitant à défiler vers le bas */
.arrow-down {
width: 60px;
Expand Down Expand Up @@ -225,24 +242,31 @@ a:visited {
transform: rotate(-45deg);
}
}

/* --- */
/* pointe de la boussole colorée */
.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon {
background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23ec1d25' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8h-8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8h-8z'/%3E%3C/svg%3E");
}

/* --- */

.logo-container {
display: flex;
justify-content: center; /* Align logos horizontally in the center */
align-items: center; /* Align logos vertically in the center */
gap: 10px; /* Add space between logos */
flex-wrap: nowrap; /* Ensure logos stay on one line */
justify-content: center;
/* Align logos horizontally in the center */
align-items: center;
/* Align logos vertically in the center */
gap: 10px;
/* Add space between logos */
flex-wrap: nowrap;
/* Ensure logos stay on one line */
}

.logo-container img {
display: inline-block;
width: auto; /* Keep aspect ratio */
vertical-align: middle; /* Align logos vertically */
}

width: auto;
/* Keep aspect ratio */
vertical-align: middle;
/* Align logos vertically */
}
Loading

0 comments on commit 070233e

Please sign in to comment.