lunaDOM Docs
lunaDOM Docs

lunaDOM is a collection of lightweight, accessible shadowdom based web components built with JavaScript.

v0.0.25

The <luna-animation> component displays animations using lightweight video formats (WebM, MP4) or GIF images with automatic looping and playback.

Paths

/lunadom/components/animation/animation.js REQUIRED

WebM Video (Recommended)

Best compression and quality. Supported by modern browsers.

Custom Sizing

Small (200px)

Medium (400px)

Large (600px)

Custom Border Radius

Customization

Slots
default - Animation content

Attributes
src-webm - WebM video source (recommended for best compression)
src-mp4 - MP4 video source (fallback)
src-gif - GIF image source (fallback)
width - Width of animation (default: "100%")
height - Height of animation (default: "auto")

CSS Variables
--luna-radius - Border radius

Example Code

<!-- WebM only (recommended) --> <luna-animation src-webm="animation.webm" width="400" ></luna-animation> <!-- Multiple sources for compatibility --> <luna-animation src-webm="animation.webm" src-mp4="animation.mp4" width="400" ></luna-animation> <!-- GIF fallback --> <luna-animation src-gif="animation.gif" width="400" ></luna-animation> <!-- Custom styling --> <luna-animation src-webm="animation.webm" width="600" style="--luna-radius: 1.5rem;" ></luna-animation> <!-- Responsive width --> <luna-animation src-webm="animation.webm" width="100%" ></luna-animation>