Add full-image zoom overlay to single post pages
A "View full image" button appears in the single-post hero alongside the return link. Clicking the lightbox main image also opens the same overlay from any page. The overlay is pure image on a near-black backdrop; click backdrop, close button, or Escape to dismiss. Escape is layered: closes zoom first, then lightbox if zoom is not open. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -59,6 +59,23 @@
|
||||
{{- $posts | jsonify | safeJS }}
|
||||
</script>
|
||||
|
||||
{{/* Pure image zoom — opened by hero button or clicking the lightbox main image */}}
|
||||
<div id="imgZoom" class="img-zoom" role="dialog" aria-modal="true" aria-label="Full size image">
|
||||
<button id="imgZoomClose"
|
||||
class="absolute top-4 right-4 z-10
|
||||
w-10 h-10 grid place-items-center
|
||||
border border-white/20 rounded-full
|
||||
text-white/60 hover:text-white hover:bg-white/10
|
||||
transition-colors duration-200"
|
||||
aria-label="Close full image">
|
||||
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor"
|
||||
stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
||||
<path d="M18 6 6 18"/><path d="m6 6 12 12"/>
|
||||
</svg>
|
||||
</button>
|
||||
<img id="imgZoomImg" src="" alt="" class="max-w-[96vw] max-h-[96vh] object-contain select-none" />
|
||||
</div>
|
||||
|
||||
<script src="/js/app.js" defer></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user