Simon Willison introduces <click-to-play>, a progressive enhancement Web Component that displays a static image frame until clicked, at which point it loads the associated GIF on demand. This tool is designed to improve web performance by avoiding the immediate download of large animated files, particularly useful for complex demos like those in Datasette.
Background
Web Components allow developers to create reusable custom elements, while progressive enhancement ensures basic functionality works without JavaScript. Optimizing media loading is a common challenge in modern web development to reduce bandwidth usage and improve initial page load times.
- Source
- Simon Willison
- Published
- Jun 17, 2026 at 11:56 AM
- Score
- 5.0 / 10