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

@a2kama/presets

v1.1.0

Published

Presets for a2kama

Readme

@a2kama/presets

Ready-made shader recipes for a2kama.

Each preset returns a recipe that you register with a2kama.register(). The same presets are also re-exported from a2kama/presets.

Usage

import a2kama from "a2kama";
import { a2kGlass } from "@a2kama/presets";

a2kama.register("myGlass", a2kGlass.normal({ refraction: 150, depth: 30 }));
a2kama.init();

Options can be changed after init(). Assignments are applied to the shader immediately.

const options = a2kama.getOptions(".glass-card");
options.refraction = 200;

a2kGlass

a2kGlass.normal(options) renders refractive glass with a beveled edge and specular highlights.

| Option | Default | Range | Description | | :----- | :------ | :---- | :---------- | | lightDirection | 45 | 0 – 360 | Angle of the main light source in degrees. | | lightIntensity | 0.6 | 0 – 2 | Intensity multiplier for the specular highlights. | | lightSymmetry | 1.0 | 0 – 1 | Light reflection symmetry (0 single-sided, 1 mirrored). | | refraction | 100 | 0 – 300 | Base strength of background refraction. | | depth | 40 | 0 – 200 | Apparent thickness of the glass in pixels. | | dispersion | 0 | 0 – 200 | Chromatic aberration. Heavy on performance when > 0. | | frost | 0 | 0 – 100 | Blur radius for frosted glass. Heavy on performance when > 0. | | splay | 0 | 0 – 200 | Tangential distortion that pulls the background towards the corners. | | zoom | 1.0 | 0.1 – 5 | Scale of the background inside the glass. | | bevelWidth | depth / 2 | 0 – depth | Width of the outer beveled edge in pixels. | | bevelCurve | 3.0 | 0.1 – 10 | Sharpness of the beveled edge. |

a2kWater

a2kWater.normal(options) renders an animated water surface. Several directional waves are layered in element space, their slopes refract the background, and slopes facing the light glint. a2kama advances the uWaterTime uniform every frame, so no animation loop is needed.

| Option | Default | Range | Description | | :----- | :------ | :---- | :---------- | | speed | 2.0 | 0 – 4 | Animation speed multiplier. 0 freezes the surface. | | amplitude | 8 | 0 – 40 | Maximum refraction offset in pixels. | | wavelength | 90 | 10 – 400 | Length of the primary wave in pixels. | | direction | 30 | 0 – 360 | Travel direction of the primary wave in degrees (0 = right, 90 = up). | | turbulence | 0.6 | 0 – 1 | Weight of the secondary waves. 0 gives clean parallel waves. | | edgeSoftness | 16 | 0 – 100 | Distance from the edge, in pixels, over which the distortion fades in. | | highlight | 0.5 | 0 – 2 | Strength of the glints on slopes facing the light. | | lightDirection | 45 | 0 – 360 | Angle of the light source in degrees. | | tint | [0.36, 0.66, 0.85] | 0 – 1 each | Water color as RGB. | | tintStrength | 0.18 | 0 – 1 | How much of the tint is mixed into the background. |

intensity is still accepted as a deprecated alias of amplitude.

Interactive presets

a2kJelly and a2kRipple stay still until they are poked. Pass the element's options and a pointer position to trigger():

const card = document.querySelector(".widget");
const options = a2kama.getOptions(card);

card.addEventListener("click", (event) => {
  a2kRipple.trigger(options, card, event.clientX, event.clientY);
});

a2kJelly

A tinted gel that wobbles out from the point where it is poked, then settles.

| Option | Default | Range | Description | | :----- | :------ | :---- | :---------- | | speed | 2 | 0 – 4 | Speed of the wobble after a poke. | | wobble | 10 | 0 – 40 | Wobble displacement in pixels. | | duration | 1.6 | 0.2 – 4 | Seconds until the wobble settles, at speed 1. | | softness | 36 | 1 – 120 | Width of the soft, bulging rim in pixels. | | refraction | 18 | 0 – 80 | Lens pull at the rim in pixels. | | gloss | 0.8 | 0 – 2 | Glossy highlight strength. | | tintStrength | 0.45 | 0 – 1 | How strongly the jelly color fills the body. | | tint | [1, 0.42, 0.68] | 0 – 1 each | Jelly color as RGB. |

a2kRipple

Rings that spread from each click point.

| Option | Default | Range | Description | | :----- | :------ | :---- | :---------- | | speed | 480 | 0 – 1200 | How fast the rings travel, in pixels per second. | | amplitude | 10 | 0 – 40 | Maximum refraction offset in pixels. | | wavelength | 36 | 8 – 160 | Distance between rings in pixels. | | duration | 1.6 | 0.2 – 5 | Seconds until a ripple fades out. | | autoInterval | 0 | 0 – 8 | Seconds between automatic ripples from the center. 0 turns them off. | | highlight | 0.35 | 0 – 2 | Brightness of the ring crests. |

More presets

All animated presets advance their own time uniform through a2kama; speed scales it.

a2kPrism

A row of prism facets that bend and split the background into color.

| Option | Default | Range | Description | | :----- | :------ | :---- | :---------- | | facetSize | 10 | 2 – 200 | Width of each facet in pixels. | | angle | 35 | 0 – 360 | Direction across the facets in degrees. | | refraction | 10 | 0 – 40 | How far each facet bends the background, in pixels. | | dispersion | 6 | 0 – 30 | RGB split between channels in pixels. | | rainbow | 0.3 | 0 – 1 | Strength of the rainbow sheen. |

a2kAurora

Swaying aurora curtains over the background.

| Option | Default | Range | Description | | :----- | :------ | :---- | :---------- | | speed | 2 | 0 – 4 | Animation speed multiplier. | | intensity | 0.8 | 0 – 2 | Brightness of the aurora. | | scale | 240 | 40 – 600 | Size of the curtain pattern in pixels. | | warp | 6 | 0 – 30 | Sideways warp of the background in pixels. | | colorA | [0.15, 1, 0.65] | 0 – 1 each | First aurora color as RGB. | | colorB | [0.55, 0.35, 1] | 0 – 1 each | Second aurora color as RGB. |

a2kBloom

Bright parts of the background glow.

| Option | Default | Range | Description | | :----- | :------ | :---- | :---------- | | threshold | 0.55 | 0 – 0.95 | Brightness above which the background glows. | | radius | 22 | 0 – 60 | Glow radius in pixels. | | intensity | 1.2 | 0 – 4 | Glow strength. | | tint | [1, 0.95, 0.9] | 0 – 1 each | Glow color as RGB. |

a2kHeatHaze

Rising air that shimmers the background.

| Option | Default | Range | Description | | :----- | :------ | :---- | :---------- | | speed | 2 | 0 – 4 | Animation speed multiplier. | | amplitude | 5 | 0 – 30 | Shimmer displacement in pixels. | | scale | 48 | 10 – 200 | Size of the air pockets in pixels. | | tintStrength | 0.1 | 0 – 1 | How strongly the warm tint colors the background. | | tint | [1, 0.85, 0.7] | 0 – 1 each | Warm tint as RGB. |

a2kSmoke

Curling smoke drifting over the background.

| Option | Default | Range | Description | | :----- | :------ | :---- | :---------- | | speed | 1.2 | 0 – 4 | Animation speed multiplier. | | density | 0.65 | 0 – 1 | How much the smoke covers the background. | | scale | 170 | 40 – 500 | Size of the wisps in pixels. | | distortion | 5 | 0 – 30 | Swirl displacement in pixels. | | color | [0.92, 0.93, 0.96] | 0 – 1 each | Smoke color as RGB. |

a2kOil

An iridescent oil film swirling over a darkened background.

| Option | Default | Range | Description | | :----- | :------ | :---- | :---------- | | speed | 0.8 | 0 – 4 | Animation speed multiplier. | | intensity | 0.65 | 0 – 1 | Strength of the film colors. | | scale | 190 | 40 – 500 | Size of the swirls in pixels. | | refraction | 7 | 0 – 30 | Swirl displacement in pixels. | | darkness | 0.3 | 0 – 1 | How much the background is darkened. | | bands | 1 | 0.2 – 4 | Density of the color bands. |

License | MIT © dltldn333