popup fiche id site pilotes

This commit is contained in:
2025-10-03 15:32:29 +02:00
parent 65b7d93827
commit 57425b9f1f
6 changed files with 119 additions and 1 deletions
+30
View File
@@ -1656,6 +1656,36 @@ aside.layout-sidebar-second footer.view-footer p {
padding: 0;
}
}
#popup-overlay {
display: none;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.7);
justify-content: center;
align-items: center;
z-index: 9999;
}
#popup-overlay img {
max-width: 90%;
max-height: 90%;
border-radius: 8px;
box-shadow: 0 0 20px #000;
}
#popup-overlay .popup-close {
position: absolute;
top: 20px;
right: 30px;
color: white;
font-size: 40px;
font-weight: bold;
cursor: pointer;
}
/*pages*/
.home-page-layout-content {
width: 100%;
+27
View File
@@ -0,0 +1,27 @@
document.addEventListener("DOMContentLoaded", function() {
const imageLinks = document.querySelectorAll(".file--image a");
const popupOverlay = document.getElementById("popup-overlay");
const popupImage = document.getElementById("popup-image");
const closeBtn = document.querySelector("#popup-overlay .popup-close");
imageLinks.forEach(function(link) {
link.addEventListener("click", function(e) {
e.preventDefault();
popupImage.src = this.href;
popupOverlay.style.display = "flex";
});
});
closeBtn.addEventListener("click", function() {
popupOverlay.style.display = "none";
popupImage.src = "";
});
popupOverlay.addEventListener("click", function(e) {
if (e.target === popupOverlay) {
popupOverlay.style.display = "none";
popupImage.src = "";
}
});
});
@@ -3,6 +3,7 @@ global:
js:
dist/bundle.js: {}
dist/menu-burger-auto.js: {}
dist/popup-file-sitepilote.js: {}
# js/reha.js: {}
librairies/slick-1.8.1/slick/slick.min.js: {}
@@ -0,0 +1,28 @@
#popup-overlay {
display: none;
position: fixed;
top: 0; left: 0;
width: 100%; height: 100%;
background: rgba(0,0,0,0.7);
justify-content: center;
align-items: center;
z-index: 9999;
}
#popup-overlay img {
max-width: 90%;
max-height: 90%;
border-radius: 8px;
box-shadow: 0 0 20px #000;
}
#popup-overlay .popup-close {
position: absolute;
top: 20px;
right: 30px;
color: white;
font-size: 40px;
font-weight: bold;
cursor: pointer;
}
+1 -1
View File
@@ -26,7 +26,7 @@
@import "partials/infos_content_actus.scss";
@import "partials/links_content";
@import "partials/_menu-burger-auto";
@import "partials/_pop-up_file_sitepilotes.scss";
/*pages*/
@import "pages/home";
@@ -0,0 +1,32 @@
{#
/**
* @file
* Default theme implementation for a link to a file.
*
* Available variables:
* - attributes: The HTML attributes for the containing element.
* - link: A link to the file.
* - file_size: The size of the file.
* - file: L'objet fichier (si fourni).
*
* @see template_preprocess_file_link()
*
* @ingroup themeable
*/
#}
<span{{ attributes }}>
{# Si cest une image PNG ou JPG → ajouter la classe popup-link #}
{% if file.mime == 'image/png' or file.mime == 'image/jpeg' %}
{{ link|replace({'<a ': '<a class="popup-link" '})|raw }}
{% else %}
{{ link }}
{% endif %}
</span>
{% if file_size %}
<span>({{ file_size }})</span>
{% endif %}
<div id="popup-overlay">
<span class="popup-close">&times;</span>
<img id="popup-image" src="" alt="Aperçu"/>
</div>