css & js galerie photo
This commit is contained in:
@@ -575,11 +575,14 @@ function showImage(index) {
|
|||||||
|
|
||||||
// Clic sur une image
|
// Clic sur une image
|
||||||
images.forEach((image, index) => {
|
images.forEach((image, index) => {
|
||||||
image.addEventListener('click', () => {
|
image.addEventListener('click', (e) => {
|
||||||
|
e.preventDefault(); // empêche le <a> de naviguer
|
||||||
|
e.stopPropagation(); // (optionnel) empêche d'autres handlers de se déclencher
|
||||||
showImage(index);
|
showImage(index);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
// Navigation & fermeture
|
// Navigation & fermeture
|
||||||
closeBtn.addEventListener('click', () => lightbox.style.display = 'none');
|
closeBtn.addEventListener('click', () => lightbox.style.display = 'none');
|
||||||
prevBtn.addEventListener('click', (e) => {
|
prevBtn.addEventListener('click', (e) => {
|
||||||
@@ -640,12 +643,8 @@ if (container) {
|
|||||||
|
|
||||||
//////////////////// start div infos site ////////////////////////
|
//////////////////// start div infos site ////////////////////////
|
||||||
|
|
||||||
// Vérifie si la page a la classe 'node-type-site' dans le <body>
|
|
||||||
if (document.body.classList.contains('node-type-site')) {
|
if (document.body.classList.contains('node-type-site')) {
|
||||||
// Sélectionne le conteneur principal
|
|
||||||
const blockRegion = document.querySelector('.block-region-second');
|
const blockRegion = document.querySelector('.block-region-second');
|
||||||
|
|
||||||
// Liste des classes spécifiques à cibler
|
|
||||||
const fieldClasses = [
|
const fieldClasses = [
|
||||||
'.field_field_region',
|
'.field_field_region',
|
||||||
'.field_field_nom_du_qpv_nb_d_hab',
|
'.field_field_nom_du_qpv_nb_d_hab',
|
||||||
@@ -665,9 +664,7 @@ fieldClasses.forEach(className => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Vérifie que des éléments ont été trouvés
|
|
||||||
if (elementsToWrap.length > 0) {
|
if (elementsToWrap.length > 0) {
|
||||||
// Crée le conteneur avec la classe 'infos'
|
|
||||||
const infosContainer = document.createElement('div');
|
const infosContainer = document.createElement('div');
|
||||||
infosContainer.className = 'infos';
|
infosContainer.className = 'infos';
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -4591,10 +4591,23 @@ body {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.node-type-ressource .layout--threecol-25-50-25 .layout__region--first .block-region-first #sites-map-container {
|
||||||
|
width: 100% !important;
|
||||||
|
padding-left: 1rem;
|
||||||
|
margin-top: 4rem;
|
||||||
|
}
|
||||||
|
.node-type-ressource .layout--threecol-25-50-25 .layout__region--first .block-region-first #sites-map-container h2 {
|
||||||
|
font-family: "gilroy-light";
|
||||||
|
text-transform: uppercase;
|
||||||
|
font-size: 0.6rem;
|
||||||
|
}
|
||||||
|
.node-type-ressource .layout--threecol-25-50-25 .layout__region--first .block-region-first #sites-map-container h2::after {
|
||||||
|
content: " :";
|
||||||
|
}
|
||||||
.node-type-ressource .layout--threecol-25-50-25 .layout__region--second {
|
.node-type-ressource .layout--threecol-25-50-25 .layout__region--second {
|
||||||
margin: auto;
|
margin: auto;
|
||||||
flex: 0 1 70% !important;
|
flex: 0 1 70% !important;
|
||||||
margin-top: 1rem;
|
margin-top: 4rem;
|
||||||
margin-right: 2rem;
|
margin-right: 2rem;
|
||||||
}
|
}
|
||||||
.node-type-ressource .layout--threecol-25-50-25 .layout__region--second .block-region-second {
|
.node-type-ressource .layout--threecol-25-50-25 .layout__region--second .block-region-second {
|
||||||
|
|||||||
@@ -517,11 +517,14 @@ function showImage(index) {
|
|||||||
|
|
||||||
// Clic sur une image
|
// Clic sur une image
|
||||||
images.forEach((image, index) => {
|
images.forEach((image, index) => {
|
||||||
image.addEventListener('click', () => {
|
image.addEventListener('click', (e) => {
|
||||||
|
e.preventDefault(); // empêche le <a> de naviguer
|
||||||
|
e.stopPropagation(); // (optionnel) empêche d'autres handlers de se déclencher
|
||||||
showImage(index);
|
showImage(index);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
// Navigation & fermeture
|
// Navigation & fermeture
|
||||||
closeBtn.addEventListener('click', () => lightbox.style.display = 'none');
|
closeBtn.addEventListener('click', () => lightbox.style.display = 'none');
|
||||||
prevBtn.addEventListener('click', (e) => {
|
prevBtn.addEventListener('click', (e) => {
|
||||||
@@ -582,12 +585,8 @@ if (container) {
|
|||||||
|
|
||||||
//////////////////// start div infos site ////////////////////////
|
//////////////////// start div infos site ////////////////////////
|
||||||
|
|
||||||
// Vérifie si la page a la classe 'node-type-site' dans le <body>
|
|
||||||
if (document.body.classList.contains('node-type-site')) {
|
if (document.body.classList.contains('node-type-site')) {
|
||||||
// Sélectionne le conteneur principal
|
|
||||||
const blockRegion = document.querySelector('.block-region-second');
|
const blockRegion = document.querySelector('.block-region-second');
|
||||||
|
|
||||||
// Liste des classes spécifiques à cibler
|
|
||||||
const fieldClasses = [
|
const fieldClasses = [
|
||||||
'.field_field_region',
|
'.field_field_region',
|
||||||
'.field_field_nom_du_qpv_nb_d_hab',
|
'.field_field_nom_du_qpv_nb_d_hab',
|
||||||
@@ -607,9 +606,7 @@ fieldClasses.forEach(className => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Vérifie que des éléments ont été trouvés
|
|
||||||
if (elementsToWrap.length > 0) {
|
if (elementsToWrap.length > 0) {
|
||||||
// Crée le conteneur avec la classe 'infos'
|
|
||||||
const infosContainer = document.createElement('div');
|
const infosContainer = document.createElement('div');
|
||||||
infosContainer.className = 'infos';
|
infosContainer.className = 'infos';
|
||||||
|
|
||||||
|
|||||||
@@ -14,11 +14,28 @@
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
.layout__region--first{
|
||||||
|
.block-region-first{
|
||||||
|
#sites-map-container{
|
||||||
|
width: 100% !important;
|
||||||
|
padding-left: 1rem;
|
||||||
|
margin-top: 4rem;
|
||||||
|
h2{
|
||||||
|
font-family: "gilroy-light";
|
||||||
|
text-transform: uppercase;
|
||||||
|
font-size: 0.6rem;
|
||||||
|
&::after{
|
||||||
|
content: " :";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.layout__region--second{
|
.layout__region--second{
|
||||||
margin: auto;
|
margin: auto;
|
||||||
flex: 0 1 70% !important;
|
flex: 0 1 70% !important;
|
||||||
margin-top: 1rem;
|
margin-top: 4rem;
|
||||||
margin-right: 2rem;
|
margin-right: 2rem;
|
||||||
// width: 60%;
|
// width: 60%;
|
||||||
.block-region-second{
|
.block-region-second{
|
||||||
|
|||||||
Reference in New Issue
Block a user