npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@kongyo2/cards-css

v0.5.0

Published

Framework-agnostic holographic trading-card effect (tilt, shine, glare and 14 foils: holo, reverse, cosmos, glitter, aurora, rainbow, gold, prism, radiant, crystal, metal, oilslick, sunburst, mosaic) with procedurally code-generated textures.

Readme

cards-css

npm Ask DeepWiki

Framework-agnostic holographic trading-card effect — tilt, shine, glare and fourteen foils (from the classic holo to aurora, gold, oilslick and mosaic) that react to pointer and gyroscope, with procedurally code-generated textures. No runtime dependencies.

cards-css — holographic trading cards showing the holo, reverse, cosmos and glitter foils

Live demo → — move the pointer across a card, or tilt your phone, to see the foil shift.

Install

npm install @kongyo2/cards-css

Quick start

import { createHoloCard } from "@kongyo2/cards-css";
import "@kongyo2/cards-css/styles.css";

const card = createHoloCard({
  image: "/cards/phoenix.png",
  imageAlt: "Phoenix",
  effect: "holo",
});

document.querySelector("#stage").append(card.element);

createHoloCard builds the full element for you. To enhance markup you already have on the page (it must contain the .holo-card__rotator structure), use attachHoloCard(element, options) instead.

Effects

Set via the effect option (or card.setEffect(...) at runtime). The full list is exported as HOLO_EFFECTS for building pickers:

| Effect | Description | | ---------- | ------------------------------------------------------------------ | | none | Tilt, shine and glare only — no foil | | holo | Rainbow holographic foil | | reverse | Reverse-line holographic foil | | cosmos | Galaxy / cosmos foil (procedural — needs textureSeed) | | glitter | Glitter / sparkle foil (procedural — needs textureSeed) | | aurora | Northern-lights ribbons drifting across the card | | rainbow | Pastel rainbow wash with sparkle flecks (secret-rare style) | | gold | Molten gold foil with a hard specular sweep | | prism | Prismatic conic facets fanning around the parallax point | | radiant | Criss-cross radiant lines with white hatching | | crystal | Sharp crystalline shards gliding at independent speeds | | metal | Brushed-metal sheen with an anisotropic highlight | | oilslick | Oil-film interference rings with a moiré swirl | | sunburst | Coloured rays bursting from the pointer | | mosaic | Holographic mosaic tiles flipping as the card tilts |

rainbow and gold additionally layer the procedural glitter / grain textures when a textureSeed is provided, and degrade gracefully without one.

Options

| Option | Type | Default | Notes | | ----------------- | --------- | -------- | -------------------------------------------------- | | image | string | — | Front image source (required for createHoloCard) | | imageAlt | string | "" | Alt text for the front image | | back / backAlt| string | — | Optional card-back image and its alt text | | className | string | — | Extra class names for the root element | | effect | HoloEffect | "none" | One of the effects above | | interactive | boolean | true | React to pointer move | | activateOnClick | boolean | false | Click (or focus + Enter/Space) to pop the card into a centered showcase | | gyroscope | boolean \| GyroscopeOptions | true | Tilt to device orientation while active; pass an object to tune rangeX / rangeY / sensitivity / invertX / invertY | | showcase | boolean \| ShowcaseOptions | false | Auto-animate once on mount; pass an object to tune delay / duration / loop / speed / intensity / spring. Skipped under prefers-reduced-motion unless respectReducedMotion: false | | glow | string | — | CSS color for the card glow | | aspectRatio | number | — | Card aspect ratio (width / height) | | textureSeed | number | — | Seed for the generated cosmos / glitter textures (and the cosmos background placement, so a seeded card is fully deterministic); without it those two foils render without their procedural layers | | mask | string \| MaskOptions | — | Mask URL, or { image, size, position, repeat, mode }mode: "card" clips the whole card into the mask silhouette | | foil | string | — | URL for a custom foil overlay | | palette | PaletteOptions | — | Foil colour theming: a preset (rainbow / gold / aurora / ruby / sapphire / mono) and/or custom sunpillars / spectrum / cosmos colour stops plus edge / back / glow | | glare | GlareOptions | — | Custom dynamic glare: a full image, or compose the pointer-tracking gradient from shape / extent / size / stops, plus blend / opacity | | depth | boolean \| DepthOptions | — | Foil 3D depth / extrusion: true for defaults, or tune strength / perspective / shadow / layerScale | | physics | PhysicsOptions | — | Interaction tuning: maxTilt / maxTiltX / maxTiltY, parallax, glareRange, returnDelay, and per-target spring tuning (interactSpring / popoverSpring / snapSpring / springs) | | visual | VisualOptions | — | Foil multipliers (brightness / contrast / saturate / glareOpacity / shineOpacity) and lineSpace / lineAngle / glitterSize / imageFit | | layers | HoloLayerOptions[] | — | Extra stacked layers between artwork and foil, each with image / content, blend, opacity, parallax, mask | | vars | Record<string, string \| number> | — | Arbitrary CSS custom properties on the root, for content linkage |

createHoloCard additionally accepts content and overlay (a Node or (doc) => Node) for free-form front and foreground content — name plates, badges, live data — plus overlayInteractive to let the overlay receive pointer events.

Asymmetric springs

Every spring tuning accepts an axes map for independent per-component physics, so a card can snap horizontally while easing vertically:

createHoloCard({
  image: "/cards/phoenix.png",
  effect: "holo",
  physics: { springs: { rotate: { axes: { x: { stiffness: 0.12 }, y: { stiffness: 0.04 } } } } },
});

Content linkage

While interacting, the card publishes its state as CSS custom properties on the root — --pointer-x, --pointer-y, --pointer-dx / --pointer-dy (signed, −1…1), --tilt-x / --tilt-y (degrees), --pointer-from-center and --card-active — so custom content / overlay / layers can parallax, glow or react in lockstep with the foil.

API

  • createHoloCard(options)HoloCard — builds the element (image required).
  • attachHoloCard(element, options?)HoloCard — wraps existing markup.
  • HOLO_EFFECTS — every built-in effect name (none first), for pickers / cycling.
  • HoloCard
    • element — the root HTMLElement to mount.
    • active / interacting — state getters.
    • front — the .holo-card__front element (or null), for appending content.
    • activate() / deactivate() — pop the card in / out of showcase.
    • setEffect(effect) — swap the foil at runtime.
    • setVisual(visual) / setVars(vars) — update visual controls / CSS variables at runtime.
    • setPalette(palette) — recolour the foil / swap themes at runtime.
    • setGlare(glare) — update the dynamic glare at runtime.
    • setDepth(depth) — toggle or tune the 3D depth at runtime (false disables it).
    • setGyroscope(gyroscope) — update gyroscope tuning at runtime.
    • addLayer(options) — insert an extra layer between artwork and foil, returns the element.
    • destroy() — remove listeners and timers, and clear the interaction state (classes, inline variables) from the element.

On iOS, gyroscope access needs a one-time permission prompt triggered by a user gesture — call requestOrientationPermission() (exported) from a click/tap handler.

License

MIT © kongyo2