Most "Christmas lights" website effects are a PNG strip glued to the top of the page. I wanted the lights to belong to the page: strings that hang from your actual headings and cards, glow warmly, twinkle, and swing a little when the cursor brushes past. Click a string to switch it off.
Fairy Lights is free (MIT), about 6 KB minified, and everything is drawn on one canvas.
Install
<script src = "https://cdn.jsdelivr.net/npm/@fluritheme/fairy-lights@1/dist/fairy-lights.global.js" data-auto ></script>
Enter fullscreen mode
Exit fullscreen mode
import { createFairyLights } from "@fluritheme/fairy-lights" ;
const lights = createFairyLights ( { palette : "warm" , // "multicolor" | "candy" | "icy" surfaces : "h1, .card" , // what the strings hang on } ) ; lights .…