Menu

Christmas lights that hang from your real headings (and swing when you move the mouse)
📰

Christmas lights that hang from your real headings (and swing when you move the mouse)

DEV Community: css·Frantisek Gejdos·about 9 hours ago
#qXyNSZU1
#devtocss#devto#dev#lights#string
Long article (584 words) — no AI summary yet.
Reading 0:00
15s threshold

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 .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.