Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions themes/puma/assets/vendor/tiger-lightbox/tiger-lightbox.css
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,18 @@ html.tlb-open { overflow: hidden; }
}
.tlb-caption[hidden] { display: none; }

/* Watermark stamp overlaid on the media (e.g. "PAID" on an invoice PDF). Presentational only. */
.tlb-stamp {
position: absolute; top: 9%; right: 8%; z-index: 3; pointer-events: none;
font: 800 clamp(1.5rem, 3.6vw, 3rem)/1 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
letter-spacing: .12em; text-transform: uppercase; white-space: nowrap;
color: #198754; border: .16em solid #198754; border-radius: .18em;
padding: .12em .42em; transform: rotate(-14deg); opacity: .88;
background: rgba(255, 255, 255, .35);
}
.tlb-stamp--danger { color: #dc3545; border-color: #dc3545; }
.tlb-stamp--warning { color: #b8860b; border-color: #b8860b; }

.tlb-counter {
position: absolute; top: 1rem; left: 1.1rem; z-index: 2;
color: var(--tlb-fg); opacity: .78; font: 13px system-ui, sans-serif;
Expand Down
26 changes: 21 additions & 5 deletions themes/puma/assets/vendor/tiger-lightbox/tiger-lightbox.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* TigerLightbox v1.0.0 — a tiny, dependency-free lightbox & media viewer.
* TigerLightbox v1.1.0 — a tiny, dependency-free lightbox & media viewer.
* https://github.com/WebTigers/TigerLightbox · MIT License
*
* Zero dependencies, ~5KB. Handles images, video, PDFs/iframes, and embeds, with gallery
Expand All @@ -8,11 +8,16 @@
* Attribute API (auto-wired, works with dynamically-added elements):
* <a href="big.jpg" data-tiger-lightbox="gallery" data-caption="A view">…</a>
* items sharing the same group value form one gallery.
* optional: data-src (overrides href), data-type (image|video|pdf|iframe), data-title.
* optional: data-src (overrides href), data-type (image|video|pdf|iframe), data-title,
* data-stamp (a watermark, e.g. "PAID"), data-stamp-variant (success|danger|warning).
*
* JS API:
* TigerLightbox.open([{type,src,caption,title}], startIndex)
* TigerLightbox.open([{type,src,caption,title,stamp,stampVariant}], startIndex)
* TigerLightbox.close()
*
* `stamp` overlays a rotated watermark on the media (e.g. "PAID" on an invoice PDF); `stampVariant`
* tints it (default green/success). Purely presentational + pointer-events:none, so it never blocks
* interacting with the media beneath.
*/
(function (global, document) {
'use strict';
Expand Down Expand Up @@ -85,6 +90,15 @@
}
media.appendChild(node);

// Optional watermark stamp overlaid on the media (e.g. "PAID" on an invoice PDF). Presentational
// only (pointer-events:none) so it never blocks scrolling/interacting with the media beneath.
if (item.stamp) {
var variant = (item.stampVariant || '').replace(/[^a-z]/g, '');
var stamp = elem('div', 'tlb-stamp' + (variant ? ' tlb-stamp--' + variant : ''));
stamp.textContent = item.stamp;
media.appendChild(stamp);
}

cap.textContent = item.caption || item.title || '';
cap.hidden = !cap.textContent;

Expand Down Expand Up @@ -168,7 +182,9 @@
type: el.getAttribute('data-type') || guessType(src),
src: src,
caption: el.getAttribute('data-caption') || '',
title: el.getAttribute('data-title') || ''
title: el.getAttribute('data-title') || '',
stamp: el.getAttribute('data-stamp') || '',
stampVariant: el.getAttribute('data-stamp-variant') || ''
};
}

Expand All @@ -184,5 +200,5 @@
open(nodes.map(nodeToItem), nodes.indexOf(t));
});

global.TigerLightbox = { open: open, close: close, version: '1.0.0' };
global.TigerLightbox = { open: open, close: close, version: '1.1.0' };
})(window, document);
Loading