{"_id":"@a2kama/presets","_rev":"2-7ca71d93ddf62d8b0d90a8c3f7ccf909","name":"@a2kama/presets","dist-tags":{"latest":"1.1.0"},"versions":{"1.0.0":{"name":"@a2kama/presets","version":"1.0.0","keywords":[],"author":"","license":"ISC","_id":"@a2kama/presets@1.0.0","maintainers":[{"name":"dltldn333","email":"dltldn333@gmail.com"}],"dist":{"shasum":"58feebf9a049043f70b71aa8b46dfdf6857736d9","tarball":"https://registry.npmjs.org/@a2kama/presets/-/presets-1.0.0.tgz","fileCount":9,"integrity":"sha512-ni5s168nXFaaggEViM8w/ML7bgg0ARCH9pcP6Pbo6IiszFAbybfEYlgubnvK3QwDGmlgybvsLvzUSwrTw6GYQA==","signatures":[{"sig":"MEYCIQCfHumxStm2bI8mYxPIZZkcIbISQzv7sSNpbiFP9VgNLAIhAOPLAqUsYepc2BI6CMgjOsIolRbjFbgMkiE5WxTPZbGa","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":22192},"main":"src/index.ts","gitHead":"8d4a4c47a7eae43625aae05778e14552c116bfb1","scripts":{},"_npmUser":{"name":"dltldn333","email":"dltldn333@gmail.com"},"_npmVersion":"10.9.2","description":"Presets for a2kama","directories":{},"_nodeVersion":"22.17.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/presets_1.0.0_1784693348286_0.7704439532936205","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"_id":"@a2kama/presets@1.1.0","bugs":{"url":"https://github.com/dltldn333/a2kama/issues"},"dist":{"shasum":"0bd31dc44c123bb2c280a71d4a1465fbf66d44c9","tarball":"https://registry.npmjs.org/@a2kama/presets/-/presets-1.1.0.tgz","fileCount":17,"integrity":"sha512-kCICNwmn+fk+i8SJcYe3smLw9CkoIQqJ6DjTsyZEORfPzhV43nOlOyrPfkiQCx6fegCLnXx/21EfjQjpqHMExQ==","signatures":[{"sig":"MEUCICnHilg1mV+0z3LDFBv31mnkA0KJgvv8kzN+B79BCyhiAiEA4rnzO4e1aKB4loWziWbfb2n9j5661tXKrdSsM/TEARQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIDVdr+kExdR9Hb7mQww9bRS/1obbeUENj0Ot+Cgl380kAiA8ha04rKduVp84d5QhCAM6pPaACs/DkNBi5h0X/2KBlA=="}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@a2kama%2fpresets@1.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":85186},"main":"./dist/index.cjs","name":"@a2kama/presets","_from":"file:a2kama-presets-1.1.0.tgz","types":"./dist/index.d.ts","author":"","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.cjs","a2kama-source":"./src/index.ts"}},"license":"MIT","scripts":{"build":"vite build"},"version":"1.1.0","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:602a26f0-79c6-47e8-baa1-77de610dd5d1"}},"homepage":"https://github.com/dltldn333/a2kama#readme","keywords":[],"_resolved":"/tmp/43910106d041ef0399c69f54be9df4f8/a2kama-presets-1.1.0.tgz","_integrity":"sha512-kCICNwmn+fk+i8SJcYe3smLw9CkoIQqJ6DjTsyZEORfPzhV43nOlOyrPfkiQCx6fegCLnXx/21EfjQjpqHMExQ==","repository":{"url":"git+https://github.com/dltldn333/a2kama.git","type":"git","directory":"packages/presets"},"_npmVersion":"11.19.0","description":"Presets for a2kama","directories":{},"maintainers":[{"name":"dltldn333","email":"dltldn333@gmail.com"}],"_nodeVersion":"24.20.0","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/presets_1.1.0_1789426034284_0.4449122397284033"}}},"time":{"created":"2026-07-22T04:09:08.134Z","modified":"2026-09-14T22:47:14.853Z","1.0.0":"2026-07-22T04:09:08.438Z","1.1.0":"2026-09-14T22:47:14.364Z"},"license":"MIT","keywords":[],"description":"Presets for a2kama","maintainers":[{"name":"dltldn333","email":"dltldn333@gmail.com"}],"readme":"<!-- Generated by WRITEME. Do not edit this file; edit WRITEME.md instead. -->\n\n<p align=\"center\">\n  <a href=\"https://www.npmjs.com/package/@a2kama/presets\"><img src=\"https://img.shields.io/npm/v/@a2kama/presets.svg?color=black\"></a>\n  <a href=\"https://www.npmjs.org/package/@a2kama/presets\"><img src=\"https://img.shields.io/npm/dm/@a2kama/presets.svg?color=black\"></a>\n  <a href=\"https://opensource.org/licenses/MIT\"><img src=\"https://img.shields.io/badge/License-MIT-yellow.svg?color=black\"></a>\n  <a href=\"https://www.typescriptlang.org/\"><img src=\"https://img.shields.io/badge/TypeScript-Ready-blue.svg?color=black\"></a>\n</p>\n\n# @a2kama/presets\n\n> **Ready-made shader recipes for [a2kama](https://www.npmjs.com/package/a2kama).**\n\nEach preset returns a recipe that you register with `a2kama.register()`. The same presets are also re-exported from `a2kama/presets`.\n\n## Usage\n\n```javascript\nimport a2kama from \"a2kama\";\nimport { a2kGlass } from \"@a2kama/presets\";\n\na2kama.register(\"myGlass\", a2kGlass.normal({ refraction: 150, depth: 30 }));\na2kama.init();\n```\n\nOptions can be changed after `init()`. Assignments are applied to the shader immediately.\n\n```javascript\nconst options = a2kama.getOptions(\".glass-card\");\noptions.refraction = 200;\n```\n\n## a2kGlass\n\n`a2kGlass.normal(options)` renders refractive glass with a beveled edge and specular highlights.\n\n| Option | Default | Range | Description |\n| :----- | :------ | :---- | :---------- |\n| `lightDirection` | `45` | 0 – 360 | Angle of the main light source in degrees. |\n| `lightIntensity` | `0.6` | 0 – 2 | Intensity multiplier for the specular highlights. |\n| `lightSymmetry` | `1.0` | 0 – 1 | Light reflection symmetry (0 single-sided, 1 mirrored). |\n| `refraction` | `100` | 0 – 300 | Base strength of background refraction. |\n| `depth` | `40` | 0 – 200 | Apparent thickness of the glass in pixels. |\n| `dispersion` | `0` | 0 – 200 | Chromatic aberration. Heavy on performance when > 0. |\n| `frost` | `0` | 0 – 100 | Blur radius for frosted glass. Heavy on performance when > 0. |\n| `splay` | `0` | 0 – 200 | Tangential distortion that pulls the background towards the corners. |\n| `zoom` | `1.0` | 0.1 – 5 | Scale of the background inside the glass. |\n| `bevelWidth` | `depth / 2` | 0 – depth | Width of the outer beveled edge in pixels. |\n| `bevelCurve` | `3.0` | 0.1 – 10 | Sharpness of the beveled edge. |\n\n## a2kWater\n\n`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.\n\n| Option | Default | Range | Description |\n| :----- | :------ | :---- | :---------- |\n| `speed` | `2.0` | 0 – 4 | Animation speed multiplier. `0` freezes the surface. |\n| `amplitude` | `8` | 0 – 40 | Maximum refraction offset in pixels. |\n| `wavelength` | `90` | 10 – 400 | Length of the primary wave in pixels. |\n| `direction` | `30` | 0 – 360 | Travel direction of the primary wave in degrees (0 = right, 90 = up). |\n| `turbulence` | `0.6` | 0 – 1 | Weight of the secondary waves. `0` gives clean parallel waves. |\n| `edgeSoftness` | `16` | 0 – 100 | Distance from the edge, in pixels, over which the distortion fades in. |\n| `highlight` | `0.5` | 0 – 2 | Strength of the glints on slopes facing the light. |\n| `lightDirection` | `45` | 0 – 360 | Angle of the light source in degrees. |\n| `tint` | `[0.36, 0.66, 0.85]` | 0 – 1 each | Water color as RGB. |\n| `tintStrength` | `0.18` | 0 – 1 | How much of the tint is mixed into the background. |\n\n`intensity` is still accepted as a deprecated alias of `amplitude`.\n\n## Interactive presets\n\n`a2kJelly` and `a2kRipple` stay still until they are poked. Pass the element's options and a pointer position to `trigger()`:\n\n```javascript\nconst card = document.querySelector(\".widget\");\nconst options = a2kama.getOptions(card);\n\ncard.addEventListener(\"click\", (event) => {\n  a2kRipple.trigger(options, card, event.clientX, event.clientY);\n});\n```\n\n### a2kJelly\n\nA tinted gel that wobbles out from the point where it is poked, then settles.\n\n| Option | Default | Range | Description |\n| :----- | :------ | :---- | :---------- |\n| `speed` | `2` | 0 – 4 | Speed of the wobble after a poke. |\n| `wobble` | `10` | 0 – 40 | Wobble displacement in pixels. |\n| `duration` | `1.6` | 0.2 – 4 | Seconds until the wobble settles, at speed 1. |\n| `softness` | `36` | 1 – 120 | Width of the soft, bulging rim in pixels. |\n| `refraction` | `18` | 0 – 80 | Lens pull at the rim in pixels. |\n| `gloss` | `0.8` | 0 – 2 | Glossy highlight strength. |\n| `tintStrength` | `0.45` | 0 – 1 | How strongly the jelly color fills the body. |\n| `tint` | `[1, 0.42, 0.68]` | 0 – 1 each | Jelly color as RGB. |\n\n### a2kRipple\n\nRings that spread from each click point.\n\n| Option | Default | Range | Description |\n| :----- | :------ | :---- | :---------- |\n| `speed` | `480` | 0 – 1200 | How fast the rings travel, in pixels per second. |\n| `amplitude` | `10` | 0 – 40 | Maximum refraction offset in pixels. |\n| `wavelength` | `36` | 8 – 160 | Distance between rings in pixels. |\n| `duration` | `1.6` | 0.2 – 5 | Seconds until a ripple fades out. |\n| `autoInterval` | `0` | 0 – 8 | Seconds between automatic ripples from the center. `0` turns them off. |\n| `highlight` | `0.35` | 0 – 2 | Brightness of the ring crests. |\n\n## More presets\n\nAll animated presets advance their own time uniform through a2kama; `speed` scales it.\n\n### a2kPrism\n\nA row of prism facets that bend and split the background into color.\n\n| Option | Default | Range | Description |\n| :----- | :------ | :---- | :---------- |\n| `facetSize` | `10` | 2 – 200 | Width of each facet in pixels. |\n| `angle` | `35` | 0 – 360 | Direction across the facets in degrees. |\n| `refraction` | `10` | 0 – 40 | How far each facet bends the background, in pixels. |\n| `dispersion` | `6` | 0 – 30 | RGB split between channels in pixels. |\n| `rainbow` | `0.3` | 0 – 1 | Strength of the rainbow sheen. |\n\n### a2kAurora\n\nSwaying aurora curtains over the background.\n\n| Option | Default | Range | Description |\n| :----- | :------ | :---- | :---------- |\n| `speed` | `2` | 0 – 4 | Animation speed multiplier. |\n| `intensity` | `0.8` | 0 – 2 | Brightness of the aurora. |\n| `scale` | `240` | 40 – 600 | Size of the curtain pattern in pixels. |\n| `warp` | `6` | 0 – 30 | Sideways warp of the background in pixels. |\n| `colorA` | `[0.15, 1, 0.65]` | 0 – 1 each | First aurora color as RGB. |\n| `colorB` | `[0.55, 0.35, 1]` | 0 – 1 each | Second aurora color as RGB. |\n\n### a2kBloom\n\nBright parts of the background glow.\n\n| Option | Default | Range | Description |\n| :----- | :------ | :---- | :---------- |\n| `threshold` | `0.55` | 0 – 0.95 | Brightness above which the background glows. |\n| `radius` | `22` | 0 – 60 | Glow radius in pixels. |\n| `intensity` | `1.2` | 0 – 4 | Glow strength. |\n| `tint` | `[1, 0.95, 0.9]` | 0 – 1 each | Glow color as RGB. |\n\n### a2kHeatHaze\n\nRising air that shimmers the background.\n\n| Option | Default | Range | Description |\n| :----- | :------ | :---- | :---------- |\n| `speed` | `2` | 0 – 4 | Animation speed multiplier. |\n| `amplitude` | `5` | 0 – 30 | Shimmer displacement in pixels. |\n| `scale` | `48` | 10 – 200 | Size of the air pockets in pixels. |\n| `tintStrength` | `0.1` | 0 – 1 | How strongly the warm tint colors the background. |\n| `tint` | `[1, 0.85, 0.7]` | 0 – 1 each | Warm tint as RGB. |\n\n### a2kSmoke\n\nCurling smoke drifting over the background.\n\n| Option | Default | Range | Description |\n| :----- | :------ | :---- | :---------- |\n| `speed` | `1.2` | 0 – 4 | Animation speed multiplier. |\n| `density` | `0.65` | 0 – 1 | How much the smoke covers the background. |\n| `scale` | `170` | 40 – 500 | Size of the wisps in pixels. |\n| `distortion` | `5` | 0 – 30 | Swirl displacement in pixels. |\n| `color` | `[0.92, 0.93, 0.96]` | 0 – 1 each | Smoke color as RGB. |\n\n### a2kOil\n\nAn iridescent oil film swirling over a darkened background.\n\n| Option | Default | Range | Description |\n| :----- | :------ | :---- | :---------- |\n| `speed` | `0.8` | 0 – 4 | Animation speed multiplier. |\n| `intensity` | `0.65` | 0 – 1 | Strength of the film colors. |\n| `scale` | `190` | 40 – 500 | Size of the swirls in pixels. |\n| `refraction` | `7` | 0 – 30 | Swirl displacement in pixels. |\n| `darkness` | `0.3` | 0 – 1 | How much the background is darkened. |\n| `bands` | `1` | 0.2 – 4 | Density of the color bands. |\n\n**License | MIT © dltldn333**\n","readmeFilename":"README.md","homepage":"https://github.com/dltldn333/a2kama#readme","repository":{"url":"git+https://github.com/dltldn333/a2kama.git","type":"git","directory":"packages/presets"},"bugs":{"url":"https://github.com/dltldn333/a2kama/issues"}}