added captions & lightbox to project page

This commit is contained in:
2026-08-16 15:10:25 +02:00
parent edec95abbf
commit b1ad60e76e
7 changed files with 121 additions and 19 deletions
@@ -14,11 +14,12 @@ dependencies:
- field.field.node.projet.field_portage - field.field.node.projet.field_portage
- field.field.node.projet.field_projet_s_lie_s - field.field.node.projet.field_projet_s_lie_s
- field.field.node.projet.field_type_de_projet - field.field.node.projet.field_type_de_projet
- image.style.large
- node.type.projet - node.type.projet
module: module:
- datetime_range - datetime_range
- file - file
- image - image_field_caption
- layout_builder - layout_builder
- options - options
- text - text
@@ -67,11 +68,11 @@ content:
weight: 7 weight: 7
region: content region: content
field_images: field_images:
type: image type: image_caption
label: hidden label: hidden
settings: settings:
image_link: '' image_style: large
image_style: '' image_link: file
image_loading: image_loading:
attribute: lazy attribute: lazy
third_party_settings: { } third_party_settings: { }
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -8,6 +8,7 @@ import { hyphenateSync } from "hyphen/fr";
import { gsap, Power1 } from 'gsap'; import { gsap, Power1 } from 'gsap';
import { ScrollTrigger } from 'gsap/ScrollTrigger'; import { ScrollTrigger } from 'gsap/ScrollTrigger';
import Lenis from 'lenis'; import Lenis from 'lenis';
import 'fslightbox';
gsap.registerPlugin(ScrollTrigger); gsap.registerPlugin(ScrollTrigger);
@@ -51,6 +52,7 @@ gsap.registerPlugin(ScrollTrigger);
initBurgerMenu(); initBurgerMenu();
initSmoothScroll(); initSmoothScroll();
initColumnScrollSync(); initColumnScrollSync();
initFsLightbox();
// initVues() // initVues()
} }
@@ -304,6 +306,17 @@ gsap.registerPlugin(ScrollTrigger);
window.addEventListener('load', () => ScrollTrigger.refresh()); window.addEventListener('load', () => ScrollTrigger.refresh());
} }
function initFsLightbox(){
console.log('initFsLightbox');
// console.log(window.FsLightbox);
let imgs_links = document.querySelectorAll('.field_images.multiple .field-item a');
for (const link of imgs_links) {
link.setAttribute("data-fslightbox", "gallery")
}
// window.FsLightbox
window.refreshFsLightbox();
}
// function initVues(){ // function initVues(){
// console.log('initVues'); // console.log('initVues');
+57 -6
View File
@@ -265,7 +265,12 @@ div.layout.layout--twocol-section--50-50{
} }
} }
// ____ _ _
// | _ \ _ __ ___ (_) ___| |_
// | |_) | '__/ _ \| |/ _ \ __|
// | __/| | | (_) | | __/ |_
// |_| |_| \___// |\___|\__|
// |__/
article.node-type-projet.view-mode-full{ article.node-type-projet.view-mode-full{
div.cols{ div.cols{
display: flex; display: flex;
@@ -309,21 +314,67 @@ article.node-type-projet.view-mode-full{
display: flex; display: flex;
.field_images{ .field_images{
flex: 1; flex: 1;
// .field-items{
&:after{
display: block;
position: relative;
content: "";
// border: 1px solid red;
width: 100%;
height: 100vh;
} }
img{ // }
max-width: 100%; .field-item{
height: auto; position: relative;
}
// Empilement "cartes" : chaque image se fige au même endroit (haut) et // Empilement "cartes" : chaque image se fige au même endroit (haut) et
// est recouverte par la suivante (l'ordre du DOM fait que la dernière // est recouverte par la suivante (l'ordre du DOM fait que la dernière
// passe au-dessus). La 1re image ne bouge pas. Desktop uniquement. // passe au-dessus). La 1re image ne bouge pas. Desktop uniquement.
@media (min-width: 768px){ @media (min-width: 768px){
.field_images .field-item{
position: sticky; position: sticky;
top: 0; top: 0;
// &:last-child:after{
// content: "";
// // position: relative;
// display:block;
// // blockquote.image-field-caption{
// height: 100vh;
// width:100%;
// border: 1px solid red;
// // }
// }
}
img{
width: 100%;
max-width: 100%;
height: auto;
}
blockquote.image-field-caption{
margin: 0;
position: absolute;
bottom: 0; left: 0;
width: 100%;
background-color: rgba(0,0,0,0.65);
color: #fff;
p{
margin: 0;
padding: 1em;
font-weight: 300;
font-size: 0.8em;
}
opacity: 0;
transition: opacity 0.3s ease-in-out;
}
&:hover{
blockquote.image-field-caption{
opacity: 1;
} }
} }
} }
}
}
} }
} }
+7
View File
@@ -9,6 +9,7 @@
"version": "0.0.0", "version": "0.0.0",
"dependencies": { "dependencies": {
"axios": "^1.7.2", "axios": "^1.7.2",
"fslightbox": "^3.7.5",
"gsap": "^3.14.1", "gsap": "^3.14.1",
"hyphen": "^1.14.1", "hyphen": "^1.14.1",
"lenis": "^1.3.26", "lenis": "^1.3.26",
@@ -1583,6 +1584,12 @@
"node": "^8.16.0 || ^10.6.0 || >=11.0.0" "node": "^8.16.0 || ^10.6.0 || >=11.0.0"
} }
}, },
"node_modules/fslightbox": {
"version": "3.7.5",
"resolved": "https://registry.npmjs.org/fslightbox/-/fslightbox-3.7.5.tgz",
"integrity": "sha512-swEUrwMOyiBhdkPf3GXj4nxARX5d8/9yfVCdxgPLl9+ZMiacUTub9O2wxLI0Y2G2jI85Qxfqpv2I24vlbx0zfg==",
"license": "MIT"
},
"node_modules/function-bind": { "node_modules/function-bind": {
"version": "1.1.2", "version": "1.1.2",
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
+1
View File
@@ -10,6 +10,7 @@
}, },
"dependencies": { "dependencies": {
"axios": "^1.7.2", "axios": "^1.7.2",
"fslightbox": "^3.7.5",
"gsap": "^3.14.1", "gsap": "^3.14.1",
"hyphen": "^1.14.1", "hyphen": "^1.14.1",
"lenis": "^1.3.26", "lenis": "^1.3.26",