Skip to content

Stickers

Stickers for the web: die-cut from any picture, peeled, picked up and stuck down, lit by the pointer.

v0.2.0MITGitHubnpm
npm install @cesarvenzac/stickers
Lights off
Six stickers: gloss, glitter, holographic, holographic dots, glow in the dark and paper. Peel one from an edge, or pick it up by its middle, and stick it down anywhere. Then turn the lights off.

Stickers makes any picture a sticker: die-cut with a border round its outline, lit by the pointer in its finish, a shadow under it. Peel it from an edge and it curls up, its back showing; let go before half way and it lies back down, past half way it comes off in your hand and sticks down wherever you let go.

Use

import { Sticker } from "@cesarvenzac/stickers/react";

<Sticker
  src="/heart.svg"
  finish="holo"
  label="A heart"
  style={{ width: 160, height: 160 }}
/>;

Or without React:

import { sticker } from "@cesarvenzac/stickers";

sticker(element, "/heart.svg", { finish: "holo", drag: true });

Peel

Finish
Pattern
Lights off
One sticker to peel, its finish picked below. Let go before half way and it lies back down; past it, it comes off, until you stick it back. Turn the lights off for the glow.

Holographic foils

Smooth
Lines
Squares
Dots
Shards
The holographic foil in its five patterns: smooth, lines, squares, dots and shards. Move over them: each patch flashes its colour as the light comes square to its grooves.

What it does

  • Any picture. An image, a canvas, or SVG markup painted in your page's own tokens (its var(--…) are read on the sticker): fitted inside, a border grown round its outline, narrow gaps closed and holes filled, as a die-cutter's kiss-cut follows a drawing.
  • A real peel. The sheet rolls round a cylinder from wherever it's held, its back showing (in a colour of yours, with words printed on it if you like) and its shadow falling on what's still stuck. The point you hold stays under the pointer.
  • Picked up and stuck down. It lifts toward you, its shadow growing, and follows the point you hold it by, swinging round behind it as a card dragged across a table does; let go, and it's pressed down where it is.
  • Five finishes. Paper; gloss, a laminate's highlight; holographic foil, the spectrum running across it as the light moves; glitter, flakes catching the light one by one; and glow in the dark.
  • Holographic patterns. The foil is a diffraction grating, its grooves laid smooth, in fine lines, small squares, dots or shards, each patch flashing its colour as the light comes square to them and silver when it doesn't.
  • Lit by the pointer. The light is a point above it: move over a sticker and its finish answers. With the lights off, the pointer is a torch.
  • Glow in the dark. When the page goes dark, a phosphorescent sticker gives back the light it took in, bright at first and fading as phosphor does, half in twelve seconds; the torch charges it again. Dark follows the page (a dark class, data-theme, color-scheme, the system's setting), or you say so.
  • For everyone. Arrow keys move a sticker and Enter peels one off. Under reduced motion nothing swings or bounces.
  • One shader. TypeScript with no dependencies, about 20 kB, every sticker on a page drawn by one WebGL 2 context. Flat where there's none, and drawn by the server in React until it's ready.

Docs