Skip to content

Click-to-load video gallery

YouTube videos shown as thumbnails: the player only loads on click, to respect privacy and keep the page light.

  • Tailwind
  • React
  • CSS
  • WordPress
Open in a new tab

Description

Embedding a YouTube video usually loads the player, its scripts and cookies as soon as the page opens, before any consent. This gallery shows local thumbnails instead, with no call to YouTube: each thumbnail is a “Play the video … (loads the YouTube player)” button. Only on click is it replaced by the youtube-nocookie.com player with autoplay, an iframe title and focus moved onto it. A note explains what happens on click, in line with the French CNIL guidance on third-party content, and the page stays light (no third-party script on load). Just change the video id in data-gvv-id and the thumbnail. One to three column grid, 56 px play button, visible focus, AA contrast in light and dark mode, no horizontal scrolling from 360 px. Example: a film club showing the Blender Foundation's open short films (Sintel, Tears of Steel, Big Buck Bunny, Spring).

Code

Loading the code…

The code of this component in

Archive contents

galerie-video-vignettes-html-tailwind.zip3 files · 5 Ko

  • index.html8 Ko
  • README.md4 Ko
  • LICENSE.md1 Ko

Tags

Updated on December 2, 2026.

Reviews

No reviews yet.

In the same spirit

  • A product photo that zooms in under the pointer, and from the keyboard with Enter and the arrow keys, to inspect the details.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • Building site photos sorted by dated step on a vertical timeline, with the current step highlighted.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component