diff --git a/boxes/templates/boxes/thing_detail.html b/boxes/templates/boxes/thing_detail.html index 9a09398..c4faa21 100644 --- a/boxes/templates/boxes/thing_detail.html +++ b/boxes/templates/boxes/thing_detail.html @@ -92,11 +92,24 @@
{% for file in thing.files.all %} + {% if file.filename|lower|slice:"-4:" == '.jpg' or file.filename|lower|slice:"-5:" == '.jpeg' or file.filename|lower|slice:"-4:" == '.png' or file.filename|lower|slice:"-5:" == '.webp' or file.filename|lower|slice:"-4:" == '.gif' or file.filename|lower|slice:"-4:" == '.svg' or file.filename|lower|slice:"-4:" == '.bmp' or file.filename|lower|slice:"-5:" == '.tiff' or file.filename|lower|slice:"-4:" == '.ico' %} + {% thumbnail file.file "200x200" crop="center" as thumb %} +
+ {{ file.title }} +
+ {{ file.title }} + ({{ file.filename }}) +
+ +
+ {% endthumbnail %} + {% else %}
{{ file.title }} ({{ file.filename }})
+ {% endif %} {% endfor %}
@@ -120,6 +133,39 @@ + + +{% endblock %} + +{% block extra_js %} + {% endblock %} {% block extra_css %} @@ -198,5 +244,46 @@ border-top: 2px solid #e0e0e0; margin: 1.5em 0; } + +.lightbox { + display: none; + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: rgba(0, 0, 0, 0.9); + z-index: 9999; + justify-content: center; + align-items: center; + cursor: zoom-out; +} + +.lightbox.active { + display: flex; +} + +.lightbox img { + max-width: 90%; + max-height: 90%; + object-fit: contain; + border-radius: 8px; + box-shadow: 0 0 30px rgba(0, 0, 0, 0.5); +} + +.lightbox-close { + position: absolute; + top: 20px; + right: 30px; + color: white; + font-size: 40px; + cursor: pointer; + z-index: 10000; + transition: opacity 0.2s; +} + +.lightbox-close:hover { + opacity: 0.7; +} {% endblock %}