Back to timeline

<click-to-play> — a still that plays

Simon Willison's Weblog·

Tool: <click-to-play> — a still that plays

A progressive enchantment Web Component that turns this markup:

<click-to-play>
  <a href="URL to GIF">
    <img src="URL to first frame" alt="...">
  </a>
</click-to-play>

Into a still frame with a click to play button which loads the GIF on demand. For when you don't want big GIFs to be loaded unless people want to play them.

Tags: gif, javascript, progressive-enhancement, web-components

This looks like a summary. Want the full article?