Skip to content

hd-slideshow

Attributes and example

hd-slideshow

Pictures from the web, one after the other, filling the element: each fades over the one before (quickly with less motion, at once without; on e-ink each stays at least five minutes). A picture that doesn’t load is skipped. Colour behind whole pictures: --hd-slideshow-back. E.g. <hd-slideshow src="{{ settings.photos }}" every="10"></hd-slideshow>, with a text setting of addresses one per line.

AttributeWhat it is
srcrequiredThe pictures’ web addresses (http or https), separated by spaces or new lines; at most 50.
everySeconds each picture shows (at least 3).Default 8.
orderIn the order given, or shuffled each round.One of in-order, shuffle. Default in-order.
fitFill the element, cropping, or show each picture whole.One of cover, contain. Default cover.
<hd-slideshow src="{{ settings.photos }}" every="10" order="shuffle"></hd-slideshow>

Styling

Set CSS variables on the component element. Its internal elements live in Shadow DOM; only the exposed named parts can be styled with ::part.

--hd-font-ui
The font of labels and running text.
--hd-slideshow-back
CSS input read by hd-slideshow.
--hd-slideshow-fade
CSS input read by hd-slideshow.
--hd-slideshow-fit
CSS input read by hd-slideshow.
--hd-text-faint
The quietest text: hints, units, times.
--hd-text-sm
CSS input read by hd-slideshow.

Exposed parts

hd-slideshow::part(empty) {  /* Your styles */}

Style the host

hd-slideshow {  --hd-accent: #2563eb;  max-width: 100%;}
Theme variables