diff options
| author | Dennis Fink | 2026-11-06 20:38:35 +0100 |
|---|---|---|
| committer | Dennis Fink | 2026-11-06 20:38:35 +0100 |
| commit | 8963ed31ce537a736ddba99baf68b31858b319b8 (patch) | |
| tree | 5c617043b0e906bdb38ddb723457eba3911a9f5a /templates | |
| parent | 904b29dfa998ca491590cee2241c9ef92e16355c (diff) | |
| download | dennisfink.me-8963ed31ce537a736ddba99baf68b31858b319b8.tar.gz dennisfink.me-8963ed31ce537a736ddba99baf68b31858b319b8.zip | |
Add click-to-enlarge image viewer
This adds a native dialog for enlarging images throughout the site,
including gallery images with previous and next navigation.
The viewer supports keyboard navigation, image captions, and responsive
layouts, while preserving the existing behaviour of linked images and
interactive maps.
Diffstat (limited to 'templates')
| -rw-r--r-- | templates/base.html | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/templates/base.html b/templates/base.html index df0f76a..ebd3703 100644 --- a/templates/base.html +++ b/templates/base.html @@ -206,6 +206,24 @@ {% block content required %} {% endblock content %} </main> + <dialog id="image-viewer" aria-label="Enlarged image" data-pagefind-ignore> + <button type="button" + data-action="previous" + aria-label="Previous gallery image" + hidden>‹</button> + <figure> + <img alt=""> + <figcaption hidden></figcaption> + </figure> + <button type="button" + data-action="next" + aria-label="Next gallery image" + hidden>›</button> + <button type="button" + data-action="close" + aria-label="Close enlarged image" + autofocus>×</button> + </dialog> <footer> {% block site_footer %} <section aria-label="Follow me"> @@ -239,6 +257,7 @@ </footer> {% endblock body %} {% block scripts %} + <script src="{{ '/static/js/image-viewer.js' | asseturl }}" defer></script> <script src="{{ '/static/vendor/pagefind/pagefind-component-ui.js' | asseturl }}" type="module"></script> {% if needs_trail_assets | default(false) %} |
