adding overview gallery

This commit is contained in:
hugogogo
2026-11-19 18:02:45 +01:00
parent 4b1253b1ad
commit 779033e4ca
+272 -64
View File
@@ -1,4 +1,9 @@
<style>
/* lock the page scroll while the lightbox overlay is open */
body:has(.lightbox_list :target) {
overflow: hidden;
}
#portfolio_section {
/* vertical spacing is done by the grid (like #cv_section),
children have no vertical margins */
@@ -39,6 +44,84 @@
width: 100%;
}
}
.thumb {
display: block;
}
/* pure-css lightbox : fixed full-page overlay, hidden by default,
shown when one of its images is the url target (:has(:target));
the browser then scrolls the overlay to that image */
.lightbox {
display: none;
position: fixed;
inset: 0;
z-index: 10;
overflow-y: auto;
/* dark translucent background behind the images */
background: rgba(30, 30, 30, 0.85);
}
.lightbox:has(:target) {
display: block;
}
/* white rounded square with a gray cross (pure css, the fr/en
labels stay in the html, visually hidden but read by screen readers) */
.lightbox_close {
position: fixed;
top: 20px;
right: 20px;
z-index: 11;
width: 40px;
height: 40px;
background: white;
border: none;
border-radius: 8px;
cursor: pointer;
&::before,
&::after {
content: "";
position: absolute;
top: 50%;
left: 50%;
width: 20px;
height: 3px;
background: gray;
transform: translate(-50%, -50%) rotate(45deg);
}
&::after {
transform: translate(-50%, -50%) rotate(-45deg);
}
span {
position: absolute;
width: 1px;
height: 1px;
overflow: hidden;
clip: rect(0 0 0 0);
white-space: nowrap;
}
}
/* the overlay gallery : one single full-width column of images */
.lightbox_list {
display: grid;
grid-template-columns: 1fr;
gap: 30px;
width: min(1100px, calc(100vw - 20px));
margin: 60px auto;
img {
width: 100%;
}
img:target {
scroll-margin-top: 20px;
}
}
}
</style>
@@ -121,70 +204,195 @@
</div>
<div class="images_grid">
<img
src="./src/docs/images/crafts/banane_1-banane_kisskissbankbank_1_1_square.jpg"
alt="portfolio preview"
/>
<img
src="./src/docs/images/crafts/banane_2-IMG_banane_1_4_square.jpg"
alt="portfolio preview"
/>
<img
src="./src/docs/images/crafts/banane_3-IMG_banane_4_7_square.jpg"
alt="portfolio preview"
/>
<img
src="./src/docs/images/crafts/banane_4-2-IMG_banane_3_15.jpg"
alt="portfolio preview"
/>
<img
src="./src/docs/images/crafts/manteau_1-manteau24_planche_1_3_square.jpg"
alt="portfolio preview"
/>
<img
src="./src/docs/images/crafts/manteau_2-IMG_manteau_4_8_square.jpg"
alt="portfolio preview"
/>
<img
src="./src/docs/images/crafts/manteau_3-planche_3_1.jpg"
alt="portfolio preview"
/>
<img
src="./src/docs/images/crafts/manteau_4-IMG_manteau_2_8_square.jpg"
alt="portfolio preview"
/>
<img
src="./src/docs/images/crafts/sacoche_1-planche_5_2_square.jpg"
alt="portfolio preview"
/>
<img
src="./src/docs/images/crafts/sacoche_2-planche_3_2_square.jpg"
alt="portfolio preview"
/>
<img
src="./src/docs/images/crafts/sacoche_3-photos3_sacoche_2_square.jpg"
alt="portfolio preview"
/>
<img
src="./src/docs/images/crafts/sacoche_4-planche_4_2_square.jpg"
alt="portfolio preview"
/>
<img
src="./src/docs/images/crafts/velo_1-IMG_velo_1_11_square.jpg"
alt="portfolio preview"
/>
<img
src="./src/docs/images/crafts/velo_2-IMG_velo_3_12_square.jpg"
alt="portfolio preview"
/>
<img
src="./src/docs/images/crafts/velo_3-velo_1_6_square.jpg"
alt="portfolio preview"
/>
<img
src="./src/docs/images/crafts/velo_4-velo_2_9_square.jpg"
alt="portfolio preview"
/>
<a class="thumb" href="#p1">
<img
src="./src/docs/images/crafts/banane_1-banane_kisskissbankbank_1_1_square.jpg"
alt="banane 1"
/>
</a>
<a class="thumb" href="#p2">
<img
src="./src/docs/images/crafts/banane_2-IMG_banane_1_4_square.jpg"
alt="banane 2"
/>
</a>
<a class="thumb" href="#p3">
<img
src="./src/docs/images/crafts/banane_3-IMG_banane_4_7_square.jpg"
alt="banane 3"
/>
</a>
<a class="thumb" href="#p4">
<img
src="./src/docs/images/crafts/banane_4-2-IMG_banane_3_15.jpg"
alt="banane 4"
/>
</a>
<a class="thumb" href="#p5">
<img
src="./src/docs/images/crafts/manteau_1-manteau24_planche_1_3_square.jpg"
alt="manteau 1"
/>
</a>
<a class="thumb" href="#p6">
<img
src="./src/docs/images/crafts/manteau_2-IMG_manteau_4_8_square.jpg"
alt="manteau 2"
/>
</a>
<a class="thumb" href="#p7">
<img
src="./src/docs/images/crafts/manteau_3-planche_3_1.jpg"
alt="manteau 3"
/>
</a>
<a class="thumb" href="#p8">
<img
src="./src/docs/images/crafts/manteau_4-IMG_manteau_2_8_square.jpg"
alt="manteau 4"
/>
</a>
<a class="thumb" href="#p9">
<img
src="./src/docs/images/crafts/sacoche_1-planche_5_2_square.jpg"
alt="sacoche 1"
/>
</a>
<a class="thumb" href="#p10">
<img
src="./src/docs/images/crafts/sacoche_2-planche_3_2_square.jpg"
alt="sacoche 2"
/>
</a>
<a class="thumb" href="#p11">
<img
src="./src/docs/images/crafts/sacoche_3-photos3_sacoche_2_square.jpg"
alt="sacoche 3"
/>
</a>
<a class="thumb" href="#p12">
<img
src="./src/docs/images/crafts/sacoche_4-planche_4_2_square.jpg"
alt="sacoche 4"
/>
</a>
<a class="thumb" href="#p13">
<img
src="./src/docs/images/crafts/velo_1-IMG_velo_1_11_square.jpg"
alt="velo 1"
/>
</a>
<a class="thumb" href="#p14">
<img
src="./src/docs/images/crafts/velo_2-IMG_velo_3_12_square.jpg"
alt="velo 2"
/>
</a>
<a class="thumb" href="#p15">
<img
src="./src/docs/images/crafts/velo_3-velo_1_6_square.jpg"
alt="velo 3"
/>
</a>
<a class="thumb" href="#p16">
<img
src="./src/docs/images/crafts/velo_4-velo_2_9_square.jpg"
alt="velo 4"
/>
</a>
</div>
<!-- pure-css lightbox : clicking a thumbnail targets #pN inside this
overlay, which makes it visible (:has(:target)) and scrolls to
the right image. The close link targets the section, which hides
the overlay again -->
<div class="lightbox">
<a class="lightbox_close" href="#portfolio_section">
<span class="fr">fermer</span>
<span class="en" lang="en">close</span>
</a>
<div class="lightbox_list">
<img
id="p1"
src="./src/docs/images/crafts/banane_1-banane_kisskissbankbank_1_1_square.jpg"
alt="banane 1"
/>
<img
id="p2"
src="./src/docs/images/crafts/banane_2-IMG_banane_1_4_square.jpg"
alt="banane 2"
/>
<img
id="p3"
src="./src/docs/images/crafts/banane_3-IMG_banane_4_7_square.jpg"
alt="banane 3"
/>
<img
id="p4"
src="./src/docs/images/crafts/banane_4-2-IMG_banane_3_15.jpg"
alt="banane 4"
/>
<img
id="p5"
src="./src/docs/images/crafts/manteau_1-manteau24_planche_1_3_square.jpg"
alt="manteau 1"
/>
<img
id="p6"
src="./src/docs/images/crafts/manteau_2-IMG_manteau_4_8_square.jpg"
alt="manteau 2"
/>
<img
id="p7"
src="./src/docs/images/crafts/manteau_3-planche_3_1.jpg"
alt="manteau 3"
/>
<img
id="p8"
src="./src/docs/images/crafts/manteau_4-IMG_manteau_2_8_square.jpg"
alt="manteau 4"
/>
<img
id="p9"
src="./src/docs/images/crafts/sacoche_1-planche_5_2_square.jpg"
alt="sacoche 1"
/>
<img
id="p10"
src="./src/docs/images/crafts/sacoche_2-planche_3_2_square.jpg"
alt="sacoche 2"
/>
<img
id="p11"
src="./src/docs/images/crafts/sacoche_3-photos3_sacoche_2_square.jpg"
alt="sacoche 3"
/>
<img
id="p12"
src="./src/docs/images/crafts/sacoche_4-planche_4_2_square.jpg"
alt="sacoche 4"
/>
<img
id="p13"
src="./src/docs/images/crafts/velo_1-IMG_velo_1_11_square.jpg"
alt="velo 1"
/>
<img
id="p14"
src="./src/docs/images/crafts/velo_2-IMG_velo_3_12_square.jpg"
alt="velo 2"
/>
<img
id="p15"
src="./src/docs/images/crafts/velo_3-velo_1_6_square.jpg"
alt="velo 3"
/>
<img
id="p16"
src="./src/docs/images/crafts/velo_4-velo_2_9_square.jpg"
alt="velo 4"
/>
</div>
</div>
<div class="mouse_container">