diff --git a/src/modules/portfolio.html b/src/modules/portfolio.html index 46b4156..a177ad7 100644 --- a/src/modules/portfolio.html +++ b/src/modules/portfolio.html @@ -66,6 +66,24 @@ display: block; } + /* invisible full-screen link behind the images : clicking the dark + backdrop closes the overlay (targets the section => no :target + inside the overlay anymore) */ + .lightbox_bg { + position: fixed; + inset: 0; + z-index: 1; + + span { + position: absolute; + width: 1px; + height: 1px; + overflow: hidden; + clip: rect(0 0 0 0); + white-space: nowrap; + } + } + /* 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 { @@ -108,11 +126,20 @@ /* the overlay gallery : one single full-width column of images */ .lightbox_list { + position: relative; + z-index: 2; display: grid; grid-template-columns: 1fr; gap: 30px; width: min(1100px, calc(100vw - 20px)); margin: 60px auto; + /* scrolling must work over the whole list, so pointer-events stay + on ; instead each image is wrapped in a link to the section, so + clicking an image closes the overlay (and the border/gutters + still close via the backdrop link) */ + a { + display: block; + } img { width: 100%; @@ -307,91 +334,127 @@ the right image. The close link targets the section, which hides the overlay again -->