GLightbox Lightbox
Rasuke uses GLightbox 3 (the only runtime dependency besides GSAP and Three.js) for image and inline-video overlays. Library site: biati-digital.github.io/glightbox
How it is wired
- The npm package is imported by
src/assets/js/lightbox.js(initLightbox(), called frommain.js); its stylesheet is the classic fileassets/css/vendors/glightbox.min.css, linked insrc/layouts/base.njk. In the classic ThemeForest package GLightbox also ships asassets/js/vendors/glightbox.min.js. - Overlay geometry comes from tokens —
layout.lightbox→--layout-lightbox-*: overlay opacity0.82, media maxmin(68rem, 92vw)×80vh, radius20px, frame padding{space.2}, glow opacity0.28, 48px close button.
Inline video behaviour
lightbox.js adds two behaviours on top of the stock library:
- On open: every muted
<video>inside the active slide is explicitly played (playsInlineset first) — browsers block unmuted autoplay, and lightbox clones need an explicit.play(). - On close / slide change: lightbox videos are paused and rewound, so the next open starts clean instead of mid-frame.
Usage
Use GLightbox's standard markup on the trigger (class / data-gallery grouping as configured by the initializer) and point it at the full-size image or video. Keep a normal <a href> / poster fallback in the markup so the media is still reachable with JavaScript off.
Do not
- Do not add a second lightbox library (Magnific Popup etc. are not part of Rasuke).
- Do not style the overlay with hardcoded values — change the
layout.lightboxtokens.