Experiments

Gallery of few advanced examples achieved with DPiCSS with a bit of JavaScript

Olivier 3lanc

Table of content
  1. AVIF is the new GIF
  2. Play once and still

AVIF is the new GIF

DPiCSS is an interesting option when you have small pieces of videos an you don't need audio. Using AVIF image format is a relevant option to get high quality short animated sequences with fewer kilobytes. With this modern format, it becomes possible to display high definition media without losing page performance, bandwidth and user patience. This page uses some examples of still and animated AVIF files in combination with DPiCSS.

The following example uses DPiCSS integrated into Eleventy LibDoc:

The thumbnail Large sized image
<details data-dpicss="play pause box_shadow button_shadow">
    <summary>
        <picture>
            <img src="https://assets.olivewhite.com/dpicss/mmfrteaser-opening_360-thumbnail.avif"
                srcset="https://assets.olivewhite.com/dpicss/mmfrteaser-opening_720-thumbnail.avif 2x"
                alt="The thumbnail"
                width="1728"
                height="720"
                loading="lazy">
        </picture>
    </summary>
    <picture>
        <img src="https://assets.olivewhite.com/dpicss/mmfrteaser-opening_360.avif"
            srcset="https://assets.olivewhite.com/dpicss/mmfrteaser-opening_720.avif 2x"
            alt="Large sized image"
            width="1728"
            height="720"
            loading="lazy">
    </picture>
</details>

Play once and still

The following example uses an AVIF encoded with -loop 1 that play only once. A bit of JavaScript is added only to add a class name on the large sized image loaded. This allows to block the natural behavior of the details summary tag when you want to keep the last frame visible. A reload button allows to reset the scene.