Skip to content

Commit

Permalink
Merge branch 'staging'
Browse files Browse the repository at this point in the history
  • Loading branch information
Julien Monticolo committed Sep 27, 2024
2 parents f951987 + 6be344a commit bd1342d
Show file tree
Hide file tree
Showing 18 changed files with 4,138 additions and 128 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM harbor.strasbourg.cloud/library/nginx:alpine
FROM harbor.strasbourg.cloud/dockerhub-proxy/nginx:alpine

ENV appDir /app

Expand Down
661 changes: 661 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SL-CNFIG : site vitrine pour le festival internationnal de la géomatique
# SL-CNFIG : site vitrine pour le Festival International de Géographie

## Finalités

Expand Down
224 changes: 146 additions & 78 deletions src/fig2024/config.js

Large diffs are not rendered by default.

Binary file added src/fig2024/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
75 changes: 75 additions & 0 deletions src/fig2024/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
155 changes: 155 additions & 0 deletions src/fig2024/gallery.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
.thumbnails {
display: flex;
flex-wrap: wrap;
justify-content: center;
}

.lightbox {
display: none;
position: fixed;
z-index: 1;
left: 0;
top: 0;
width: 100%;
height: 100%;
overflow: auto;
background-color: #000000aa;
}

.lightbox-content {
position: relative;
align-content: center;
margin: auto;
padding: 0;
max-width: 1200px;
}

.close {
color: white;
text-shadow: 0 0 6px #000000;
position: absolute;
z-index: 1;
top: 10px;
right: 25px;
font-size: 35px;
font-weight: bold;
}

.close:hover,
.close:focus {
color: #999;
text-decoration: none;
cursor: pointer;
}

.cursor {
cursor: pointer;
}

.prev,
.next {
cursor: pointer;
position: absolute;
top: 50%;
width: auto;
padding: 16px;
margin-top: -50px;
color: white;
text-shadow: 0 0 6px #000000;
font-weight: bold;
font-size: 20px;
transition: 0.6s ease;
border-radius: 0 3px 3px 0;
user-select: none;
}

/* Position the "next button" to the right */
.next {
right: 0;
border-radius: 3px 0 0 3px;
}

.prev:hover,
.next:hover {
color: white;
background-color: rgba(0, 0, 0, 0.8);
}

img {
margin-bottom: -4px;
}

.caption-container {
font-family: 'Atkinson Hyperlegible', sans-serif;
font-weight: 400;
font-size: 1.3em;
text-align: center;
background-color: black;
padding: 2px 16px;
border-radius: 4px;
color: white;
}

.gallery {
background-color: white;
height: 10vh;
object-fit: scale-down;
opacity: 0.6;
}

.active,
.gallery:hover {
opacity: 1;
}

img.hover-shadow {
transition: 0.3s;
}

.hover-shadow:hover {
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
}

.step-slides {
display: none;
}

.step-slides figure {
display: inline-grid;
margin-top: 0;
margin-bottom: 0;
}

.step-slides img {
box-sizing: border-box;
background-color: white;
background-clip: content-box;
max-width: 100%;
max-height: 80vh;
display: block;
margin: auto;
padding: 5px;
object-fit: contain;
}

.step-slides figcaption:before {
content: "Crédit: ";
}

.step-slides figcaption {
background-clip: content-box;
background-color: #0000005c;
color: #fff;
font-family: 'Atkinson Hyperlegible', sans-serif;
font: italic smaller sans-serif;
padding: 5px;
text-align: right;
position: relative;
z-index: 1;
margin-top: -25px;
}

.step-slides a {
text-decoration: none;
color: white;
}
97 changes: 97 additions & 0 deletions src/fig2024/gallery.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
// Initialize slide index
var slideIndex = 1;

function openLightbox(imgParams) {
document.getElementById("lightbox").style.display = "flex";
// init slides
var slidesContainer = document.getElementById("slides-container");
var thumbnails = document.getElementById("thumbnails");
var slidesImg = JSON.parse(decodeURIComponent(imgParams))
// empty divs
slidesContainer.innerHTML = "";
thumbnails.innerHTML = "";
var i = 0;
for (const [key, values] of Object.entries(slidesImg)) {
i++;
// slides
var divSlide = document.createElement("div");
divSlide.classList.add("step-slides");
var figure = document.createElement("figure");
var slide = document.createElement("img");
slide.src = key;
slide.alt = values.alt;
var credits = document.createElement("figcaption");
credits.innerHTML = values.credit + " "
figure.appendChild(slide);
figure.appendChild(credits);
divSlide.appendChild(figure);
slidesContainer.appendChild(divSlide);
// thumbnails
var divThumbnail = document.createElement("div");
var thumbnail = document.createElement("img");
thumbnail.src = key;
thumbnail.alt = values.alt;
thumbnail.credit = values.credit;
thumbnail.classList.add("gallery");
thumbnail.classList.add("cursor");
thumbnail.setAttribute("onclick", `currentSlide(${i});`);
divThumbnail.appendChild(thumbnail);
thumbnails.appendChild(divThumbnail);
}
}

function closeLightbox() {
document.getElementById("lightbox").style.display = "none";
}

// Function to navigate to a specific slide
function currentSlide(n) {
showSlides(slideIndex = n);
}

// Function to navigate to the next/previous slide
function plusSlides(n) {
showSlides(slideIndex += n);
}

// Function to display the current slide
function showSlides(n) {
var i;
var slides = document.getElementsByClassName("step-slides");
var gallery = document.getElementsByClassName("gallery");
var captionText = document.getElementById("caption");

// Wrap around if index is out of bounds
if (n > slides.length) { slideIndex = 1 }
if (n < 1) { slideIndex = slides.length }

// Hide all slides
for (i = 0; i < slides.length; i++) {
slides[i].style.display = "none";
}

// Remove active class from all thumbails of the gallery
for (i = 0; i < gallery.length; i++) {
gallery[i].className = gallery[i].className.replace(" active", "");
}

// Show the current slide and add active class to the current dot
slides[slideIndex - 1].style.display = "block";
gallery[slideIndex - 1].className += " active";
captionText.innerHTML = gallery[slideIndex - 1].alt;
}

// Attach event listener to the lightbox
var lightbox = document.getElementById("lightbox");
lightbox.addEventListener("click", function (event) {
// Check if the click target is the lightbox itself
if (event.target === lightbox) {
closeLightbox();
}
});

// Prevent closing on content click
var lightboxContent = document.querySelector(".lightbox-content");
lightboxContent.addEventListener("click", function (event) {
event.stopPropagation();
});
40 changes: 29 additions & 11 deletions src/fig2024/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,40 @@
<meta property="og:description"
content="Faites défiler l'histoire vers le bas et la carte montrera l'emplacement de l'étape." />
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="vendor/pmtiles.2.11.0.js"></script>
<script src="vendor/maplibre-gl.3.6.2.js"></script>
<link href="vendor/maplibre-gl.3.6.2.css" rel="stylesheet" />
<script src="vendor/maplibre-gl-legend.2.0.5.js"></script>
<link href="vendor/maplibre-gl-legend.2.0.5.css" rel="stylesheet" />
<link rel="icon" type="image/png" href="favicon.png" />
<script src="../vendor/pmtiles.2.11.0.js"></script>
<script src="../vendor/maplibre-gl.3.6.2.js"></script>
<link href="../vendor/maplibre-gl.3.6.2.css" rel="stylesheet" />
<script src="../vendor/intersection-observer.0.5.1.js"></script>
<script src="../vendor/scrollama.3.2.0.js"></script>
<script src="https://tholman.com/elevator.js/elevator.js"></script>
<script defer src="gallery.js"></script>
<link
href="https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible:ital,wght@0,400;0,700;1,400;1,700&display=swap"
rel="stylesheet">
<link rel="stylesheet" href="styles.css">
<script src="vendor/intersection-observer.0.5.1.js"></script>
<script src="vendor/scrollama.3.2.0.js"></script>
<link href="https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible:ital,wght@0,400;0,700;1,400;1,700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="gallery.css">
<link rel="stylesheet" href="tickets.css">
</head>

<body>
<div id='map'></div>
<div id='story'></div>
<script src='config.js'></script>
<script type='text/javascript' src="map.js"></script>
<div id='story'>
<script src='config.js'></script>
<script type='text/javascript' src="map.js"></script>
<div id="lightbox" class="lightbox">
<span class="close cursor" onclick="closeLightbox()">&times;</span>
<div class="lightbox-content">
<div id="slides-container"></div>
<a class="prev" onclick="plusSlides(-1)">&#10094;</a>
<a class="next" onclick="plusSlides(1)">&#10095;</a>
<div class="caption-container">
<p id="caption"></p>
</div>
<div id="thumbnails" class="thumbnails"></div>
</div>
</div>
</div>
</body>

</html>
Loading

0 comments on commit bd1342d

Please sign in to comment.