asciify-engine 4.24.0 → 4.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +325 -0
- package/README.md +71 -718
- package/dist/core.cjs +1 -1
- package/dist/core.js +1 -1
- package/dist/field.cjs +1 -1
- package/dist/field.d.cts +132 -272
- package/dist/field.d.ts +132 -272
- package/dist/field.js +1 -1
- package/dist/glyph-field-C2fQIlnq.d.cts +292 -0
- package/dist/glyph-field-DRC-7uVf.d.ts +292 -0
- package/dist/hover.cjs +1 -1
- package/dist/hover.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/kit/chunk-2FH6GGV6.js +1 -0
- package/dist/kit/chunk-2GAV4OAK.js +1 -0
- package/dist/kit/{chunk-C4KZYCPF.js → chunk-2LBQ7QJT.js} +1 -1
- package/dist/kit/{chunk-BN7HL52Z.js → chunk-3LJ5C3U3.js} +1 -1
- package/dist/kit/{chunk-NURPDP3Y.js → chunk-3MHEDZLZ.js} +1 -1
- package/dist/kit/{chunk-BR6ZNJZW.js → chunk-3OD5BMF5.js} +1 -1
- package/dist/kit/{chunk-C3C7AYKL.js → chunk-3VEMKDBW.js} +1 -1
- package/dist/kit/{chunk-PFKYKAIP.js → chunk-42KMN727.js} +1 -1
- package/dist/kit/{chunk-2CF4PX6U.js → chunk-6G5MPND3.js} +1 -1
- package/dist/kit/{chunk-QALCXKU6.js → chunk-6WU247CB.js} +1 -1
- package/dist/kit/{chunk-YBRP6BFW.js → chunk-776H2BJ7.js} +1 -1
- package/dist/kit/chunk-7DXSG526.js +1 -0
- package/dist/kit/{chunk-H2UZBVKE.js → chunk-7M2FFUZ3.js} +1 -1
- package/dist/kit/{chunk-5BEBNKYM.js → chunk-7NVKRDKE.js} +1 -1
- package/dist/kit/{chunk-XB4DKPGL.js → chunk-AIGAJMNN.js} +1 -1
- package/dist/kit/{chunk-O7SGY4YJ.js → chunk-B3TY6UXJ.js} +1 -1
- package/dist/kit/{chunk-XDKKCIIL.js → chunk-BFBG3VHI.js} +1 -1
- package/dist/kit/{chunk-3A5LID2G.js → chunk-CG6SGQMY.js} +1 -1
- package/dist/kit/{chunk-T3GWGPST.js → chunk-CGSWUO67.js} +1 -1
- package/dist/kit/{chunk-DFOWXOZR.js → chunk-DAJSBX6H.js} +1 -1
- package/dist/kit/{chunk-IUKSHYED.js → chunk-DCLJHSWM.js} +1 -1
- package/dist/kit/{chunk-W2STAN6V.js → chunk-DMRPBFLW.js} +1 -1
- package/dist/kit/{chunk-XANKANGR.js → chunk-E3FPFANJ.js} +1 -1
- package/dist/kit/{chunk-VC2ZQG63.js → chunk-EKYEA7Z4.js} +1 -1
- package/dist/kit/{chunk-IQTGJRDX.js → chunk-F6F2C3RH.js} +1 -1
- package/dist/kit/chunk-FEAFQY7O.js +1 -0
- package/dist/kit/{chunk-FUI5AVIF.js → chunk-FHN3PPSI.js} +1 -1
- package/dist/kit/{chunk-QRCXXS5Z.js → chunk-FPCCX4FM.js} +1 -1
- package/dist/kit/{chunk-TTGMK4EA.js → chunk-FWODCYYJ.js} +1 -1
- package/dist/kit/{chunk-AIM3J2US.js → chunk-GBNV3GXG.js} +1 -1
- package/dist/kit/chunk-GF72XM4C.js +1 -0
- package/dist/kit/{chunk-SARCZMLN.js → chunk-GKR3ROYR.js} +1 -1
- package/dist/kit/{chunk-ROR6MG3K.js → chunk-H5KHXZWR.js} +1 -1
- package/dist/kit/{chunk-PCIAA2LL.js → chunk-I5R2347P.js} +1 -1
- package/dist/kit/{chunk-4QHFEMFS.js → chunk-IBNDCKEX.js} +1 -1
- package/dist/kit/{chunk-J2YZBT3N.js → chunk-ILXVBO7M.js} +1 -1
- package/dist/kit/{chunk-S62H7ZIU.js → chunk-JELJEEJO.js} +1 -1
- package/dist/kit/{chunk-2NVKPXPL.js → chunk-K6JX64AS.js} +1 -1
- package/dist/kit/{chunk-3473NPIN.js → chunk-KCEYRIU4.js} +1 -1
- package/dist/kit/{chunk-HTUGMGVA.js → chunk-KDROJANO.js} +1 -1
- package/dist/kit/{chunk-5QE6UMXN.js → chunk-KEE55QSD.js} +1 -1
- package/dist/kit/{chunk-MIZ2DUHU.js → chunk-KFXMLIVF.js} +1 -1
- package/dist/kit/{chunk-G57QACJG.js → chunk-KLRF3S7O.js} +1 -1
- package/dist/kit/{chunk-ENTDGT2V.js → chunk-KXI3T72F.js} +1 -1
- package/dist/kit/{chunk-4ZQFDFEH.js → chunk-KY5KCIZE.js} +1 -1
- package/dist/kit/{chunk-4OT66HSZ.js → chunk-LE53AVKR.js} +1 -1
- package/dist/kit/{chunk-WJLZM3DR.js → chunk-LVCGC3SO.js} +1 -1
- package/dist/kit/chunk-M5VVLYI2.js +1 -0
- package/dist/kit/{chunk-7ABNWOW4.js → chunk-MJJSZS23.js} +1 -1
- package/dist/kit/{chunk-VVW7LZT2.js → chunk-MZFK765W.js} +1 -1
- package/dist/kit/{chunk-5I4IZTL5.js → chunk-NF4WVWAC.js} +1 -1
- package/dist/kit/{chunk-PIU2BMFU.js → chunk-NW4U2YRE.js} +1 -1
- package/dist/kit/{chunk-5Z2EJAUV.js → chunk-ORSI57T2.js} +1 -1
- package/dist/kit/{chunk-UML6XQAR.js → chunk-QSTDYL35.js} +1 -1
- package/dist/kit/{chunk-K563CCOL.js → chunk-QVICL57J.js} +1 -1
- package/dist/kit/{chunk-MQJQIDO5.js → chunk-RXOPJJC4.js} +1 -1
- package/dist/kit/{chunk-SNCXU7KF.js → chunk-SDSW7422.js} +1 -1
- package/dist/kit/{chunk-DZ5XGHTJ.js → chunk-TRDA73HN.js} +1 -1
- package/dist/kit/{chunk-KWTF6Q5W.js → chunk-UOYBFLGJ.js} +1 -1
- package/dist/kit/chunk-UVLKCAKH.js +1 -0
- package/dist/kit/{chunk-YCWMOTYH.js → chunk-VBWG7HQA.js} +1 -1
- package/dist/kit/{chunk-FR3ZJNOY.js → chunk-VIUEAEBX.js} +1 -1
- package/dist/kit/{chunk-ZRJVOUWH.js → chunk-VV2KP7ZW.js} +1 -1
- package/dist/kit/chunk-VX2AD3M7.js +1 -0
- package/dist/kit/{chunk-RFLIFKZ4.js → chunk-W4U5CK6L.js} +1 -1
- package/dist/kit/{chunk-I4QVLLRQ.js → chunk-WI2AF2KE.js} +1 -1
- package/dist/kit/{chunk-MGVPLQ3Z.js → chunk-XUCYFWC3.js} +1 -1
- package/dist/kit/{chunk-BNVRKD3V.js → chunk-Z2FRNFMB.js} +1 -1
- package/dist/kit/{chunk-BQZCLGCY.js → chunk-Z3KD6CLE.js} +1 -1
- package/dist/kit/{chunk-E3TUOX2A.js → chunk-ZCXNGJGB.js} +1 -1
- package/dist/kit/{chunk-IPVN22ZM.js → chunk-ZWZZMU5P.js} +1 -1
- package/dist/kit.cjs +1 -1
- package/dist/kit.d.cts +4 -2
- package/dist/kit.d.ts +4 -2
- package/dist/kit.js +1 -1
- package/dist/studio-worker.js +1 -0
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +1 -1
- package/package.json +3 -1
- package/skills/asciify-engine/SKILL.md +2 -2
- package/skills/asciify-engine/references/applying-asciify.md +1 -1
- package/skills/asciify-engine/references/kit.md +2 -2
- package/skills/asciify-engine/references/performance.md +6 -3
- package/dist/kit/chunk-3PCKMO6I.js +0 -1
- package/dist/kit/chunk-4HWMQCAM.js +0 -1
- package/dist/kit/chunk-73M2OESE.js +0 -1
- package/dist/kit/chunk-BTD6EFAW.js +0 -1
- package/dist/kit/chunk-OWEZV7TQ.js +0 -1
- package/dist/kit/chunk-S7RZP2MT.js +0 -1
- package/dist/kit/chunk-UO7RB7RC.js +0 -1
- package/dist/kit/chunk-XM56OTYT.js +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "asciify-engine",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.26.0",
|
|
4
4
|
"description": "Framework-agnostic ASCII art engine. Convert images, videos, and GIFs into ASCII art rendered on canvas, or run full-bleed GPU character fields with a fluid cursor wake.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -74,6 +74,7 @@
|
|
|
74
74
|
"skills/asciify-engine",
|
|
75
75
|
"README.md",
|
|
76
76
|
"LICENSE",
|
|
77
|
+
"CHANGELOG.md",
|
|
77
78
|
"examples/media-background.ts",
|
|
78
79
|
"examples/studio-composition.ts",
|
|
79
80
|
"examples/layered-composition.ts",
|
|
@@ -95,6 +96,7 @@
|
|
|
95
96
|
"test:hover": "node tests/hover-browser.mjs",
|
|
96
97
|
"test:finish": "node tests/hero-finish-browser.mjs",
|
|
97
98
|
"test:studio": "node tests/studio-browser.mjs",
|
|
99
|
+
"test:parity": "node tests/studio-parity-browser.mjs",
|
|
98
100
|
"bench:dither": "node scripts/benchmark-dither.mjs",
|
|
99
101
|
"bench:hover": "node scripts/benchmark-hover-fields.mjs"
|
|
100
102
|
},
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
name: asciify-engine
|
|
3
3
|
description: Apply Asciify the way asciify.org does - ASCII components and backgrounds that belong in a real interface, inked from the theme, clear around text, inside the page's radii and motion. Use for UI components in characters (loading, status, toasts, tabs, AI states, charts, transitions, pages), animated ASCII backgrounds, and also photo, video and GIF conversion, GPU character fields, artwork looks for wallpapers, posters and prints, art styles and export, hover and motion, layered typography and rendering performance.
|
|
4
4
|
metadata:
|
|
5
|
-
tested-engine: "4.
|
|
5
|
+
tested-engine: "4.26.0"
|
|
6
6
|
updated: "2026-10-17"
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
# Asciify Engine
|
|
10
10
|
|
|
11
|
-
Use the published `asciify-engine` npm package. Tested against **4.
|
|
11
|
+
Use the published `asciify-engine` npm package. Tested against **4.26.0**. Check the application's installed version and its public types before using newer options; a local checkout can contain unpublished changes.
|
|
12
12
|
|
|
13
13
|
- Agent entry: https://asciify.org/skill (redirects to this Markdown document).
|
|
14
14
|
- Components: https://asciify.org/components · Looks: https://asciify.org/looks · Backgrounds: https://asciify.org/backgrounds
|
|
@@ -149,7 +149,7 @@ decode(headline, { duration: 800, settle: 'text' }); // decorative, under the 80
|
|
|
149
149
|
|
|
150
150
|
## 7. Performance
|
|
151
151
|
|
|
152
|
-
- **
|
|
152
|
+
- **Fields share one context.** Every field on the page draws through one WebGL2 context, so the count of fields is bounded by what is animating on screen, not by contexts. Static fields draw once and stop. Sharing still helps: one `pill()` call over a list draws every pill with one field.
|
|
153
153
|
- **Lazy by default.** Fields mount within half a viewport and release beyond one. Use `lazy: false` only for the hero in the first viewport.
|
|
154
154
|
- **Posters.** Give every field above the fold, and every field that matters without WebGL, a still per theme, and swap it on theme change with `update({ poster })` rather than remounting.
|
|
155
155
|
- **Canvas presets cost CPU, not contexts.** Count them toward the page anyway; one animated ground per viewport.
|
|
@@ -169,8 +169,8 @@ const s = mountSurface({ host: el, look: () => ({ mark: 'glyph', cellSize: 6 }),
|
|
|
169
169
|
|
|
170
170
|
A page can hold every kit component at once. The shared core keeps the GPU cost to what is on screen:
|
|
171
171
|
|
|
172
|
-
- **Lazy mounting.** A field mounts when its element comes within half a viewport of the screen and is released, freeing its
|
|
173
|
-
- **
|
|
172
|
+
- **Lazy mounting.** A field mounts when its element comes within half a viewport of the screen and is released, freeing its GPU memory, beyond one viewport. Mounts that cost more than about 4 ms in a frame wait for the next one, nearest the screen first. The handle survives release and remount: its methods keep working, `update()` calls made while released apply on the next mount, `pause()` holds, and the component paints its current state when it mounts again. `handle.field` stays the same object throughout. A remount draws into the same canvas (a field with a context of its own swaps in a copy, with its attributes and inline styles). `lazy: false` mounts at once, anywhere on the page, and is never released by distance.
|
|
173
|
+
- **One context, and a budget for the rest.** Kit fields draw through the page's one shared WebGL2 context and hold none of their own. `setFieldBudget(n)` (default 12) limits fields that fall back to a context of their own (a canvas in another document, or one already holding a WebGL context; browsers drop the oldest past about 16): past it the live one farthest off screen is released first. `getFieldBudget()` reads it.
|
|
174
174
|
- **Posters.** `poster: '/stills/hero.webp'` puts an `<img>` under the canvas (`update({ poster })` points it at another still, such as the other theme's), placed exactly where the field draws. It fades out (280 ms, none under reduced motion) when the first GPU frame lands, shows again while the field is released, and stays as the fallback without WebGL or after the field fails, until `destroy()`. `update({ poster })` swaps the still in place, for a theme change, on every component including the page helpers and `asciiVideo`. `asciiVideo` keeps its own poster.
|
|
175
175
|
- **Pausing.** As before, a field draws nothing while the page is hidden or its element is off screen.
|
|
176
176
|
|
|
@@ -12,15 +12,18 @@ What `asciify-engine` promises a host page, and the default budgets. Measured by
|
|
|
12
12
|
- **Mounting is spread out.** Kit fields mount when they come within half a viewport of the screen, at most one per frame however many a host starts in one task (a route change, a long list). Shader programs link with `KHR_parallel_shader_compile` where the browser has it.
|
|
13
13
|
- **Nothing runs when nothing changes.** A still field stops its frame loop. Fields off screen, in a hidden tab, in a `display: none` host or with zero size do not draw. Reduced motion settles every component on a still.
|
|
14
14
|
- **Ambient motion is capped.** Drift, scenes and self-animating components draw at most 60 frames a second on any screen (30 with two cores or less, 2 GB of memory or less, or Save-Data). The pointer's wake, lantern, trail, pulses and anything under the pointer keep the screen's full rate.
|
|
15
|
-
- **Studio
|
|
15
|
+
- **Studio draws off the main thread.** `mountStudio` and `mountStudioMedia` draw in a dedicated worker on `OffscreenCanvas`; the page only posts pointer input and shows each finished frame (an `ImageBitmap`, no copy), so a first frame or a hover never blocks the page. A hover draws at the screen's full rate: workers take turns drawing frames (up to three for a small artwork, within 6 megapixels of frames in all), and Pointillism's dots are filled on the GPU. Output is pixel-identical to drawing on the page; Pointillism's GPU dots match within rounding. Where `OffscreenCanvas` 2D is missing, or a worker cannot start, the same renderer draws on the page at most 60 times a second, never taking more than half the main thread. `destroy()` terminates the workers.
|
|
16
16
|
- **Listeners are passive** where the event allows, and every listener, observer, frame, timer, object URL and context is released by `destroy()`, including after a hundred quick mount and destroy cycles.
|
|
17
17
|
- **No global CSS but scoped fallbacks.** The few components that inject styles use one `<style id="ascii-kit-…">` each, with every rule inside `:where()` (zero specificity). No console output in normal use.
|
|
18
18
|
|
|
19
19
|
## GPU and memory
|
|
20
20
|
|
|
21
|
-
- **
|
|
21
|
+
- **One context per page.** Every glyph field on the page (kit components, page helpers and `mountGlyphField`) draws through one shared WebGL2 context and one frame loop, and each field's canvas receives its frame with a 2D copy. Programs compile once for the page and glyph atlases are shared per charset, font and size, so mounting a field creates no context and compiles nothing; 150 components on one page hold one context. A context the browser takes back is replaced, and every field draws again. The context is let go three seconds after the page's last field.
|
|
22
|
+
- **GPU memory budget: 256 MB per page.** The shared context counts what every field holds on the GPU: its render targets, its source texture with mipmaps, its wake and trail buffers, its canvas, the shared atlases and the shared drawing buffer. Past 256 MB, kit fields off screen are released to their posters, farthest first, and fields waiting to mount keep their posters until there is room; a field on screen is never released for memory. Atlases are shared per charset, font and size; up to eight that no field uses are kept for a remount and evicted oldest first (all of them while over budget). The shared drawing buffer shrinks when the largest field leaves. Fields mounted directly with `mountGlyphField` count toward the total but are never released by it: destroy them yourself.
|
|
23
|
+
- **Context budget.** `setFieldBudget(n)` (default 12) still limits fields that fall back to a context of their own: a canvas from another document, or one that already holds a WebGL context. Past it the field farthest off screen is released to its `poster`.
|
|
24
|
+
- **Page listeners don't grow.** One pointer listener (capture, on the window), one visibility, motion, colour-scheme and font listener, and one ResizeObserver serve every field, so mounting and releasing fields while scrolling adds and removes none.
|
|
22
25
|
- **Backing store capped.** Pixel ratio is at most 2 by default (`look.maxPixelRatio`), and one field's backing store at most about one 4K screen (8.3 million pixels): a full-bleed field on a 5K or 6K display keeps its cells and draws them at a lower ratio.
|
|
23
|
-
- **Slow frames degrade, not stall.**
|
|
26
|
+
- **Slow frames degrade, not stall.** The shared context times its own frames on the GPU (`EXT_disjoint_timer_query_webgl2`, or the frame loop's gaps where it is missing) and lowers the render scale in steps, down to one device pixel per CSS pixel, before any frame is given up; it climbs back once there is headroom. Past that, about a second of frames slower than 24 fps stops a field's ambient motion; the pointer response keeps working.
|
|
24
27
|
- **Software WebGL counts as unsupported.** SwiftShader and llvmpipe report `isGlyphFieldSupported() === false` (pass `allowSoftware` to override), so components keep their HTML and poster instead of drawing every pixel on the CPU. Without WebGL2 the same fallback applies.
|
|
25
28
|
|
|
26
29
|
## What a host should still do
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{mountGlyphField as e}from"../field.js";var t={ascii:{mark:"glyph",charset:" .:-=+*#%@"},blocks:{mark:"glyph",charset:" ░▒▓█"},braille:{mark:"glyph",charset:" ⠁⠃⠇⡇⣇⣧⣷⣿"},dots:{mark:"dot"},lines:{mark:"glyph",charset:" -═╪╬"},cross:{mark:"glyph",charset:" ·+xX#"},diagonal:{mark:"glyph",charset:" /╱╳"},diamond:{mark:"glyph",charset:" ·◇◈◆"},mixed:{mark:"glyph",charset:" .:+/◇#@"},pixel:{mark:"pixel"},mosaic:{mark:"mosaic"},lego:{mark:"lego"},voxel:{mark:"voxel"},disco:{mark:"disco"},dither:{mark:"dither"},hex:{mark:"hex"},led:{mark:"led"},cmyk:{mark:"cmyk"},stipple:{mark:"stipple"},engraving:{mark:"engraving"},crosshatch:{mark:"crosshatch"},woodblock:{mark:"woodblock"},risograph:{mark:"risograph"},pointillism:{mark:"pointillism"}},n=e=>"string"==typeof e&&Object.prototype.hasOwnProperty.call(t,e),r=/\p{L}/u,o=null,a=new Set,s=new Set;function i(e){const{charset:t,style:r}=e??{};o=e?{...t?{charset:t}:{},...n(r)?{style:r}:{}}:null;for(const e of s)e.relook();for(const e of[...a])e(o)}var l=()=>o;function c(e){return a.add(e),()=>{a.delete(e)}}var u=12,m=new Set,h=null,d=null,p=0,f=-1e9,g=0,y=!1,v=!1,k=()=>{const e=d?.timeline?.currentTime;return"number"==typeof e?e:null};function b(e){u=Number.isFinite(e)&&e>=1?Math.floor(e):12,O()}var w=()=>u,x=()=>"undefined"!=typeof performance?performance.now():Date.now(),E=()=>"number"==typeof innerHeight?innerHeight:0;function S(e,t=e.getBoundingClientRect()){if(!1===e.isConnected)return 1/0;if("function"==typeof e.getClientRects&&0===e.getClientRects().length)return 1/0;const n=t.bottom<0?-t.bottom:t.top-E();return n>0?n:0}function C(){try{const e=d?.querySelectorAll?.("dialog:modal");return e?.length?e[e.length-1]:null}catch{return null}}var M=1e8;function A(e,t){if(e.eager)return void(e.wanted=!0);const n=E(),r=S(e.host,t);!n||r<=.5*n?e.wanted=!0:r>1*n&&(e.wanted=!1)}function P(e){let t=!1;for(const n of e)if(n?.target)for(const e of m)e.host===n.target&&(A(e,n.boundingClientRect??void 0),t=!0);t&&O()}var W=()=>O(),L=null,$=e=>{L!==e&&(L?.removeEventListener?.("close",W,!0),e?.addEventListener?.("close",W,!0),L=e)};function z(e){d!==e.doc&&(d=e.doc,m.clear(),p=g=0,f=-1e9),$(d),m.add(e);const t=function(){const e="function"==typeof IntersectionObserver?IntersectionObserver:null;if(!e)return null;if(h?.ctor!==e){h?.list.forEach(e=>e.disconnect()),h={ctor:e,list:["50% 0px","100% 0px","0px"].map(t=>new e(P,{rootMargin:t}))};for(const e of m)h.list.forEach(t=>t.observe(e.host))}return h.list}();t?.forEach(t=>t.observe(e.host)),t?A(e):e.wanted=!0,O()}function O(e=!1){if(y)v=!0;else{y=!0;try{do{v=!1;const t=x(),n=k();(e||(null===n?t-f>16||t<f:n!==f))&&(f=n??t,g=0);for(const e of m)!1===e.host.isConnected&&(e.wanted=!1);for(const e of m)e.live&&!e.wanted&&e.release();const r=[...m].filter(e=>e.live),o=C(),a=e=>!!o&&!o.contains(e.host),s=e=>S(e.host)+(a(e)?M:0),i=e=>e.eager&&!a(e),l=()=>r.filter(e=>e.live).map(e=>[e,s(e)+(i(e)?0:1e9)]).sort((e,t)=>t[1]-e[1]);for(let e=r.length-u,t=e>0?l():[];e>0;e--)t.shift()?.[0].release();const c=[...m].filter(e=>e.wanted&&!e.live).map(e=>[e,e.eager?-1:s(e)]).sort((e,t)=>e[1]-t[1]);let h=0;for(const[t,n]of c){if(!m.has(t)||t.live)continue;if(!t.eager&&g>=4&&(!e||h)){p||(p=requestAnimationFrame(()=>{p=0,O(!0)}));break}if(r.filter(e=>e.live).length>=u){const e=l()[0]?.[0];if(!e||!t.eager&&(i(e)||s(e)<=n))break;e.release()}const o=x();t.mount(),g+=x()-o,h++,t.live&&r.push(t)}}while(v)}finally{y=!1}}}var R='ui-monospace, "SF Mono", Menlo, Consolas, monospace',T=new Map;function j(e,t=R){const n=`${t}\0${e}`,r=T.get(n);if(r)return r;let o={max:1,mean:1};try{const n="undefined"==typeof document?null:Object.assign(document.createElement("canvas"),{width:48,height:48}).getContext("2d",{willReadFrequently:!0});if(n&&"function"==typeof n.getImageData){n.font=`500 36px ${t}`,n.textAlign="center",n.textBaseline="middle";const r=e=>{n.clearRect(0,0,48,48),n.fillStyle="#000",n.fillText(e,24,25);const t=n.getImageData(0,0,48,48).data;let r=0;for(let e=3;e<t.length;e+=4)r+=t[e];return r/255},a=e=>[...e].filter(e=>e.trim()).map(r),s=e=>e.reduce((e,t)=>e+t,0)/Math.max(1,e.length),i=a(e),l=a(".:-=+*#%@"),c=r("@");i.length&&c>0&&s(l)>0&&(o={max:Math.max(...i)/c,mean:s(i)/s(l)})}}catch{}return T.set(n,o),o}function F(e,t){const{max:n,mean:r}=j(e,t.font??R),o=t.glyphScale??.8,a=t.gamma??1,s=t.fontWeight??500;return n>1.15?{glyphScale:Math.max(.3,o*Math.max(.62,n**-.36)),gamma:a,fontWeight:s}:r>1.5?{glyphScale:Math.max(.3,o*r**-.25),gamma:a,fontWeight:s}:n<.85?{glyphScale:Math.min(1.6,o*Math.min(1.3,n**-.3)),gamma:a,fontWeight:n<.6?Math.max(s,700):s}:{glyphScale:o,gamma:a,fontWeight:s}}var B=new WeakMap;function q(e,t){for(const n of B.get(e)?.keys()??[])n.getAttribute("src")!==t&&(n.src=t)}function I(e){const t=B.get(e);B.delete(e),t?.forEach(e=>e())}var D=()=>"function"==typeof matchMedia&&matchMedia("(prefers-reduced-motion: reduce)").matches;function X(e,t,n,r,o){const a=document.createElement("img");a.alt="",a.decoding="async",a.setAttribute("aria-hidden","true"),a.setAttribute("style",`${n};object-fit:cover${D()?"":";transition:opacity 280ms cubic-bezier(.23, 1, .32, 1)"}`),a.style.opacity="1",a.dataset.asciiPoster="",a.src=t;const s=e.style.getPropertyValue("position"),i="function"==typeof getComputedStyle&&"static"===getComputedStyle(e).position;i&&e.style.setProperty("position","relative");const l=e.style.getPropertyValue("isolation"),c=/z-index:\s*-1/.test(n)&&"function"==typeof getComputedStyle&&"auto"===getComputedStyle(e).isolation;c&&e.style.setProperty("isolation","isolate"),o?.parentElement===e?e.insertBefore(a,o):e.appendChild(a);let u=!1;const m=()=>{u||(u=!0,a.remove(),B.get(r)?.delete(a),i&&(s?e.style.setProperty("position",s):e.style.removeProperty("position")),c&&(l?e.style.setProperty("isolation",l):e.style.removeProperty("isolation")))},h=B.get(r)??new Map;return h.set(a,m),B.set(r,h),{show(e){a.style.opacity=e?"1":"0"},remove:m}}function H(e){const t=document.createElement("canvas");for(const n of e.getAttributeNames?.()??[])"width"!==n&&"height"!==n&&t.setAttribute(n,e.getAttribute(n));return t.style.cssText=e.style.cssText,Object.assign(t.dataset,e.dataset),e.replaceWith?e.replaceWith(t):e.parentElement&&(e.parentElement.insertBefore(t,e),e.remove()),t}function N(n){const{host:a,kit:i}=n;let l,c=n.canvas,u=null,d=!1,p=!1,f=!1,g=!1,y={},v={},k=n.source,b=!1,w={},x=null,E=null,S=!1,C=null,M=()=>{};const A=!n.ownPoster&&i?.current.poster?X(a,i.current.poster,n.place,i,c):null,P=()=>{if(!o||!1===i?.current.globalLook||"glyph"!==(v.mark??"glyph")&&!n.glyphs||r.test(v.charset??""))return;const e=o.style?t[o.style]:void 0,a=e?.mark??"glyph",s="glyph"===a?o.charset||(e&&"charset"in e?e.charset:void 0):void 0;return e||s?{mark:a,charset:s}:void 0},W=()=>({...n.glyphs?Object.fromEntries(Object.keys(n.glyphs()).map(e=>[e,v[e]]).filter(([,e])=>void 0!==e)):{},mark:v.mark??"glyph",charset:v.charset??" .,:-=+*#%@",glyphScale:v.glyphScale??.8,gamma:v.gamma??1,fontWeight:v.fontWeight??500}),L=e=>{if(!e.charset)return{...W(),mark:e.mark};const t=n.glyphs&&"glyph"!==(v.mark??"glyph")?n.glyphs():{};return{...t,mark:e.mark,charset:e.charset,...F(e.charset,{...v,...t})}},R=()=>{const e=P(),t=e&&`${e.mark}\0${e.charset??""}`;return t===l?null:(l=t,e?L(e):W())},T={host:a,doc:document,eager:!1===i?.current.lazy,wanted:!1,live:!1,mount(){if(p||u)return;d&&(c=n.canvas=H(c)),d=!0,v={...n.options(),...y},l=void 0;const t=R();let r;try{r=e(c,{...v,...t,...void 0===k?{}:{source:k},onError:()=>{u===r&&j()}})}catch{return void j()}u=r,T.live=!0;const o=c;let a=0;const s=()=>{u===r&&(clearTimeout(a),a=setTimeout(()=>{u===r&&c===o&&(T.release(),O())},1e3))},i=()=>clearTimeout(a);o.addEventListener?.("webglcontextlost",s),o.addEventListener?.("webglcontextrestored",i),M=()=>{clearTimeout(a),o.removeEventListener?.("webglcontextlost",s),o.removeEventListener?.("webglcontextrestored",i)},b&&r.pause(),r.ready.then(()=>{u===r&&(S=!0,A?.show(!1),x?.(),x=E=null)},()=>{}),n.onMount?.(r,c)},release(){if(!u)return;const e=u;u=null,T.live=!1,S=!1,M(),C?.clear(),C=null,w=e.settings,e.destroy(),(e=>{try{const t=e.getContext("webgl2");t&&!t.isContextLost?.()&&t.getExtension("WEBGL_lose_context")?.loseContext()}catch{}})(c),p||(c=n.canvas=H(c),d=!1),A?.show(!0),n.onRelease?.()}};function j(){f||(f=!0,B(),g||n.onFail())}function B(){p||(p=!0,T.release(),function(e){m.delete(e)&&([...m].some(t=>t.host===e.host)||h?.list.forEach(t=>t.unobserve(e.host)),!m.size&&h&&(h.list.forEach(e=>e.disconnect()),h=null),m.size||$(null),O())}(T),s.delete(q),c.remove(),f?A?.show(!0):A?.remove())}const q={relook(){const e=R();if(!e||!u)return;const t=u,r=S&&!(i?.current.reducedMotion??D());C?.clear(),C=null,r&&(t.redraw(),C=function(e,t){if(!e.width||!e.height||"undefined"==typeof document)return null;const n=document.createElement("canvas");n.width=e.width,n.height=e.height;const r=n.getContext("2d");if(!r||"function"!=typeof n.animate)return null;try{r.drawImage(e,0,0)}catch{return null}n.setAttribute("aria-hidden","true"),n.dataset.asciiSweep="",n.setAttribute("style",t);const o=document.createElement("span");let a,s;o.setAttribute("aria-hidden","true"),o.dataset.asciiSweep="",o.setAttribute("style",`${t};right:auto;width:2px;margin-left:-1px;opacity:0;background:var(--ascii-sweep, #f3ba32);box-shadow:0 0 10px 1px color-mix(in srgb, var(--ascii-sweep, #f3ba32) 40%, transparent)`),e.after(n,o);const i=()=>{a?.cancel(),s?.cancel(),n.remove(),o.remove()};return{clear:i,reveal(){if(!n.isConnected)return;const t={duration:200,delay:40,easing:"cubic-bezier(.23,1,.32,1)",fill:"both"};a=n.animate([{clipPath:"inset(0% 0% 0% 0%)"},{clipPath:"inset(0% 0% 0% 100%)"}],t);const r=e.clientWidth||e.getBoundingClientRect().width;s=o.animate([{transform:"translateX(0px)",opacity:.35},{opacity:.35,offset:.7},{transform:`translateX(${r}px)`,opacity:0}],t),a.onfinish=i}}}(c,n.place)),t.update(e);const o=C;o&&requestAnimationFrame(()=>requestAnimationFrame(()=>{C===o&&u===t?o.reveal():o.clear()}))}};return{field:{get canvas(){return c},get ready(){return u?u.ready:E??(E=new Promise(e=>{x=e}))},get settings(){return u?.settings??w},update(e){if(y={...y,...e},v={...v,...e},!u)return;const t=R(),n=P();u.update(n?{...e,...L(n)}:t?{...e,...t}:e)},setSource:e=>(k=e,u?u.setSource(e):Promise.resolve()),pointer(e,t){u?.pointer(e,t)},redraw(){u?.redraw()},pulse(e){u?.pulse(e)},play(){b=!1,u?.play()},pause(){b=!0,u?.pause()},resize(){u?.resize()},destroy(){B()}},get canvas(){return c},get live(){return!!u},get failed(){return f},start(){s.add(q),g=!0;try{z(T)}finally{g=!1}},destroy:B}}export{t as KIT_STYLES,F as balanceCharset,I as disposeKit,w as getFieldBudget,l as getGlobalLook,j as inkWeight,N as liveField,X as poster,b as setFieldBudget,i as setGlobalLook,q as setPosterSource,c as subscribeGlobalLook};//# sourceMappingURL=chunk-3PCKMO6I.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{injectStyle as e}from"./chunk-4OT66HSZ.js";import{drawBlocks as t,snapshot as n,blocksOf as r,BLOCK_W as o,BLOCK_H as s}from"./chunk-BNVRKD3V.js";import{styleKeeper as i,mountSurface as a,house as c,clamp as l,handle as u,hash as d,boxIn as f,prefersReduced as p}from"./chunk-S7RZP2MT.js";var h={input:"input",rows:'[role="option"]',hotkey:"k",manage:!0,closeOnRun:!0,highlight:!0,ai:"[data-ai]"},m=200,g=3600,y=40,v="cubic-bezier(.16, 1, .3, 1)",x=`\n:where([data-ascii-cmd-highlight]){position:absolute;left:0;top:0;z-index:-1;pointer-events:none;opacity:0;background:var(--ascii-cmd-highlight,color-mix(in oklab,currentColor 7%,transparent));transition:translate 240ms ${v},width 240ms ${v},height 240ms ${v},opacity 160ms ${v}}\n:where([data-ascii-cmd-highlight][data-on]){opacity:1}\n@media (prefers-reduced-motion:reduce){:where([data-ascii-cmd-highlight]){transition:none}}\n`;function k(k,w={}){const b={current:{...h,...w}},E=i(),$=()=>[...k.querySelectorAll(b.current.rows)],M=()=>k.querySelector(b.current.input),A=i();let L=b.current.open??!k.hasAttribute("hidden"),S=0,T=null,C=!1,O=0,H=null,R=[],W=null,D=0,P=0;const z=new WeakMap,K=()=>!!(b.current.reducedMotion??p());e("ascii-kit-command",x),"static"===getComputedStyle(k).position&&A.set(k,"position","relative"),A.set(k,"isolation","isolate");const j=document.createElement("div");j.setAttribute("aria-hidden","true"),j.dataset.asciiCmdHighlight="",b.current.highlight&&k.insertBefore(j,k.firstElementChild);const F=e=>{if(void 0===e.offsetParent)return f(k,e);let t=0,n=0;for(let r=e;r&&r!==k;r=r.offsetParent)t+=r.offsetLeft,n+=r.offsetTop;for(let r=e.parentElement;r&&r!==k;r=r.parentElement)t-=r.scrollLeft,n-=r.scrollTop;return{x:t,y:n,w:e.offsetWidth,h:e.offsetHeight}},N=e=>{const t=$()[S];if(!j.parentElement)return;if(!t||!L)return void delete j.dataset.on;const n=F(t),r=!e||void 0===j.dataset.on||K();r&&(j.style.transition="none"),j.style.translate=`${n.x}px ${n.y}px`,j.style.width=`${n.w}px`,j.style.height=`${n.h}px`,j.style.borderRadius=getComputedStyle(t).borderTopLeftRadius,j.dataset.on="",r&&(j.offsetWidth,j.style.removeProperty("transition"))};let V=null;const q=i();H=a({host:k,layer:"under",look:()=>({mark:"glyph",charset:" .:-=+*#%@",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:5,cellAspect:.62,glyphScale:.92,...b.current.look}),ink:()=>b.current.ink??"--ascii-ink-strong",kit:b,reducedMotion:()=>b.current.reducedMotion,resolution:2,onFail:()=>{H=null},paint:({pen:e,now:i,still:a,box:u})=>{if(e.setTransform(2,0,0,2,0,0),T){const n=T,r=(i-n.start)/(n.closing?m:260);if(!(r>=1||a)){const o=n.closing?1-1.02*c(r):1.04*c(r);return t(e,n.snap,n.blocks,n.order,o,(e,t)=>[(n.ox-e.x)*t*.9,(n.oy-e.y)*t*.9],n.closing?1:1-l((r-.72)/.28),.4),!0}T=null}if(!L||C)return!1;let f=!1;R=R.filter(n=>{const r=(i-n.start)/280;return(r>=.7||a)&&n.styles.restore(),r>=1||a||!k.contains(n.row)?(n.styles.restore(),!1):(f=!0,r>0&&t(e,n.snap,n.blocks,n.order,1.04*c(r),(e,t)=>[14*t,0],1-l((r-.7)/.3),.42),!0)});const p=$()[S];if(p&&!a&&p.matches(b.current.ai)){p!==W&&(W=p,D=i+160);const t=i-D,a=t>=0?t%g/1100:-1;if(a>=0&&a<1&&!R.some(e=>e.row===p))((e,t,i,a,c)=>{const l=H,u=`${t.textContent}|${i.x}|${i.y}|${i.w}`;if(V?.row!==t||V.key!==u){const e=n(t,l.box,l.canvas.clientWidth||k.offsetWidth,l.canvas.clientHeight||k.offsetHeight,2);V={row:t,key:u,snap:e,blocks:r(e,2)}}const f=i.x-y+(i.w+80)*(e=>e<.5?4*e**3:1-(-2*e+2)**3/2)(a),p=Math.floor(c/70);for(const t of V.blocks){const n=(t.x+2-f)/y;if(n<=-1||n>=1)continue;const r=1-n*n;d(t.x+p,t.y)>.35+.65*r||(e.globalAlpha=Math.min(1,1.6*r),e.drawImage(V.snap,2*t.x,2*t.y,2*o,2*s,t.x,t.y,o,s))}e.globalAlpha=1;const h=f-i.x;q.set(t,"mask-image",`linear-gradient(90deg, #000 ${h-y}px, transparent ${h-14}px, transparent ${h+14}px, #000 ${h+y}px)`)})(e,p,u(p),a,i),f=!0;else{if(q.restore(),f)return!0;P&&clearTimeout(P);const e=t>=0?g-t%g:-t;P=setTimeout(()=>{P=0,H?.kick()},Math.max(16,e))}}else W=null,q.restore();return f}}),H&&(k.dataset.gpu="");const B=(e=!0)=>{const t=$();if(S=t.length?Math.min(Math.max(0,S),t.length-1):0,N(e),!b.current.manage)return;t.forEach((e,t)=>e.setAttribute("aria-selected",String(t===S)));const n=M(),r=t[S]?.id;n&&r&&n.setAttribute("aria-activedescendant",r)},Z=()=>`inset(0 round ${getComputedStyle(k).borderTopLeftRadius||"0px"})`,G=()=>{const e=b.current.trigger,t=k.offsetWidth,n=k.offsetHeight;if(!e)return`inset(0 ${Math.max(0,t/2-40)}px ${Math.max(0,n-36)}px round 18px)`;const r=f(k,e);return`inset(${r.y}px ${t-r.x-r.w}px ${n-r.y-r.h}px ${r.x}px round ${r.h/2}px)`},I=e=>{const t=H;if(!t)return;const o=k.offsetWidth,s=k.offsetHeight,i=n(k,t.box,o,s,2),a=r(i,2),c=b.current.trigger,l=c?t.box(c):{x:o/2,y:0,w:0,h:0},u=l.x+l.w/2,d=l.y+l.h/2,f=Math.hypot(o,s)||1;T={snap:i,blocks:a,order:Float32Array.from(a,e=>Math.hypot(e.x-u,e.y-d)/f*.7+.3*e.seed),ox:u,oy:d,start:performance.now(),closing:e},t.kick()},U=e=>{if(e)for(const e of[...k.children])"CANVAS"===e.tagName&&void 0!==e.dataset.asciiKit||E.set(e,"opacity","0");else E.restore()},J=(e,t,n="none")=>"function"!=typeof k.animate?null:k.animate(e.map(e=>({clipPath:e})),{duration:t,easing:v,fill:n}),Q=()=>{O&&clearTimeout(O),O=0},X=(e=!0)=>{!L||C?(Q(),L=!0,C=!1,S=0,k.removeAttribute("hidden"),k.dataset.open="",b.current.trigger?.setAttribute("aria-expanded","true"),B(!1),(()=>{for(const e of $())z.set(e,F(e).y)})(),e&&M()?.focus({preventScroll:!0}),b.current.onOpenChange?.(!0),K()?H?.kick():(k.dataset.state="opening",J([G(),Z()],260),H&&(C=!0,U(!0),I(!1)),O=setTimeout(()=>{O=0,delete k.dataset.state,C=!1,U(!1),H?.kick()},143))):e&&M()?.focus({preventScroll:!0})},Y=()=>{if(!L)return;Q();const e=k.contains(document.activeElement),t=()=>{O=0,C=!1,L=!1,T=null,delete k.dataset.state,delete k.dataset.open,U(!1),N(!1);for(const e of R)e.styles.restore();R=[],q.restore(),V=null,k.setAttribute("hidden",""),b.current.trigger?.setAttribute("aria-expanded","false"),e&&b.current.trigger?.focus({preventScroll:!0}),H?.kick(),b.current.onOpenChange?.(!1)};if(K())return void t();C=!0,k.dataset.state="closing",H&&(I(!0),U(!0));const n=J([Z(),G()],m,"forwards"),r="function"==typeof k.animate?k.animate([{opacity:1},{opacity:1,offset:.4},{opacity:0}],{duration:m,fill:"forwards"}):null;O=setTimeout(()=>{t(),n?.cancel(),r?.cancel()},m)},_=e=>{const t=$().length;t&&(S=(Math.round(e)%t+t)%t,B(),H?.kick())},ee=(e=S)=>{const t=$()[e];if(!t||C)return;_(e),H?.field.pulse({element:t,strength:.6}),t.matches(b.current.ai)&&(W=t,D=performance.now()),t.dataset.run="",b.current.onRun?.(e,t);const n=()=>{delete t.dataset.run,b.current.closeOnRun&&Y()};K()?n():setTimeout(n,240)},te=e=>{if(!b.current.manage)return;const t=$().length;if("Escape"===e.key&&L)return e.preventDefault(),e.stopPropagation(),void Y();if(e.target!==M()&&!$().includes(e.target))return;const n="ArrowDown"===e.key?S+1:"ArrowUp"===e.key?S-1:"Home"===e.key?0:"End"===e.key?t-1:null;if(null!==n)return e.preventDefault(),void _(n);"Enter"===e.key&&(e.preventDefault(),ee())},ne=e=>{const t=e.target?.closest?.(b.current.rows);return t?$().indexOf(t):-1},re=e=>{if(!b.current.manage)return;const t=ne(e);t<0||t!==S&&_(t)},oe=e=>{if(!b.current.manage)return;const t=ne(e);t>=0&&ee(t)},se=()=>{b.current.manage&&(S=0,B(!1))},ie="function"==typeof MutationObserver?new MutationObserver(()=>{L&&(B(!1),(()=>{const e=H,t=$(),o=t.filter(e=>{const t=F(e).y,n=z.get(e);return z.set(e,t),void 0===n||Math.abs(n-t)>1});for(const e of R)t.includes(e.row)&&!o.includes(e.row)||e.styles.restore();if(R=R.filter(e=>t.includes(e.row)&&!o.includes(e.row)),!e||!e.live||e.still()||C||!L)return;const s=e.canvas.clientWidth||k.offsetWidth,a=e.canvas.clientHeight||k.offsetHeight,c=performance.now();o.forEach((t,o)=>{const l=n(t,e.box,s,a,2),u=r(l,2);if(!u.length)return;const d=Math.min(...u.map(e=>e.x)),f=Math.max(1,Math.max(...u.map(e=>e.x))-d),p=i();for(const e of[...t.children])p.set(e,"opacity","0");R.push({row:t,snap:l,blocks:u,order:Float32Array.from(u,e=>(e.x-d)/f*.72+.28*e.seed),start:c+28*o,styles:p})}),e.kick()})())}):null;ie?.observe(k,{childList:!0,subtree:!0});const ae="function"==typeof ResizeObserver?new ResizeObserver(()=>N(!1)):null;ae?.observe(k);const ce=()=>{L?Y():X(!0)},le=e=>{const t=b.current.hotkey;t&&e.key?.toLowerCase()===t.toLowerCase()&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),L?document.activeElement===M()?Y():M()?.focus():X(!0))},ue=e=>{if(!b.current.manage||!L||C)return;const t=e.target;k.contains(t)||b.current.trigger?.contains(t)||Y()};k.addEventListener("keydown",te),k.addEventListener("pointermove",re),k.addEventListener("click",oe),k.addEventListener("input",se);const de=b.current.trigger;return de?.addEventListener("click",ce),de?.setAttribute("aria-expanded",String(L)),de?.setAttribute("aria-haspopup","dialog"),document.addEventListener("keydown",le),document.addEventListener("pointerdown",ue),L?k.dataset.open="":k.setAttribute("hidden",""),B(),u(()=>H,b,()=>{B(),H?.refresh()},{open:X,close:Y,select:_,run:ee,toggle(){L?Y():X(!0)},get isOpen(){return L},get selected(){return S}},()=>{Q(),P&&clearTimeout(P),U(!1);for(const e of R)e.styles.restore();q.restore(),ie?.disconnect(),ae?.disconnect(),j.remove(),A.restore(),k.removeEventListener("keydown",te),k.removeEventListener("pointermove",re),k.removeEventListener("click",oe),k.removeEventListener("input",se),de?.removeEventListener("click",ce),document.removeEventListener("keydown",le),document.removeEventListener("pointerdown",ue),delete k.dataset.gpu,delete k.dataset.state})}var w=h;export{w as COMMAND_PALETTE_DEFAULTS,k as commandPalette};//# sourceMappingURL=chunk-4HWMQCAM.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{parseColor as t}from"./chunk-ZCHGV2CV.js";import{mountCanvas as o}from"./chunk-BR6ZNJZW.js";import{mixHex as e}from"./chunk-S7RZP2MT.js";function n(o,e,n,a,r={}){const{fontSize:i=13,chars:l=" .,:;i+xX#&@",color:h="#ff4500",hotColor:f="#ffe066",intensity:c=.85,wind:s=0,speed:m=1,lightMode:M=!1}=r,p=.62*i,d=1.4*i,g=Math.ceil(e/p),u=Math.ceil(n/d),b=g*u,x="__fire_heat__",S=o.canvas;let k=S[x];k&&k.length===b||(k=new Float32Array(b),S[x]=k);const A=.18*(.016*m),_=s*m*.8,y=u-1,z=a*m;for(let t=0;t<g;t++){const o=(.6*(.5*Math.sin(.31*t+4.1*z)+.5)+.4*(.5*Math.sin(.73*t-2.7*z)+.5))*c;k[y*g+t]=Math.min(1,o+.15*Math.random()*c),y>0&&(k[(y-1)*g+t]=Math.min(1,.85*o+.1*Math.random()*c))}const C=new Float32Array(b);for(let t=0;t<u-2;t++)for(let o=0;o<g;o++){const e=.4*k[(t+1)*g+o]+.25*k[(t+2)*g+Math.max(0,Math.min(g-1,o+Math.round(_)))]+.175*k[(t+1)*g+Math.max(0,o-1)]+.175*k[(t+1)*g+Math.min(g-1,o+1)];C[t*g+o]=Math.max(0,e-A-.02*Math.random()*m)}for(let t=0;t<g;t++)C[(u-1)*g+t]=k[(u-1)*g+t],u>1&&(C[(u-2)*g+t]=k[(u-2)*g+t]);S[x]=C;const Z=t(h)??{r:255,g:69,b:0},$=t(f)??{r:255,g:224,b:102};o.clearRect(0,0,e,n),o.font=`${i}px "JetBrains Mono", monospace`,o.textBaseline="top";for(let t=0;t<u;t++)for(let e=0;e<g;e++){const n=C[t*g+e];if(n<.03)continue;const a=l[Math.min(l.length-1,Math.floor(n*l.length))];if(" "===a)continue;const r=Math.min(1,1.2*n),i=Z.r+($.r-Z.r)*r|0,h=Z.g+($.g-Z.g)*r|0,f=Z.b+($.b-Z.b)*r|0,c=M?1-.3*n:Math.min(1,n+.15);o.globalAlpha=c,o.fillStyle=`rgb(${i},${h},${f})`,o.fillText(a,e*p,t*d)}o.globalAlpha=1}var a={id:"fire",name:"Fire",description:"A cellular flame rising from the bottom edge.",cellSize:13,speed:1,cursor:!1,mount:t=>o(t,(t,o,a,r,i,l)=>n(t,o,a,l.elapsed,{fontSize:l.fontSize,chars:l.chars,color:l.ink,hotColor:l.accent??e(l.ink,"#ffffff",.6),speed:l.speed}),48)};export{a as fire,n as renderFireBackground};//# sourceMappingURL=chunk-73M2OESE.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{styleKeeper as e,isDark as t,BASE_LOOK as n,prefersReduced as r,resolveColor as o,mergeOptions as i}from"./chunk-S7RZP2MT.js";import{poster as s,liveField as l,disposeKit as u,setPosterSource as a}from"./chunk-3PCKMO6I.js";import{isGlyphFieldSupported as c}from"../field.js";var d=e=>new Promise(t=>setTimeout(t,e));function p(i){const{host:u,layer:a="under",kit:d}=i;if("undefined"==typeof document)return null;const p=`position:absolute;inset:0;width:100%;height:100%;pointer-events:none;border-radius:inherit;z-index:${"under"===a?-1:"auto"}`;if(!c())return d?.current.poster&&!i.ownPoster&&s(u,d.current.poster,p,d),null;const f=e(),m=document.createElement("canvas");"static"===getComputedStyle(u).position&&f.set(u,"position","relative"),"under"===a&&f.set(u,"isolation","isolate"),m.dataset.asciiKit="",m.setAttribute("style",p),u.appendChild(m);let h=t(u),g=!1;const v=()=>{const e=i.reducedMotion();return!0===e?{speed:0,drift:0,respectReducedMotion:!0}:{respectReducedMotion:!1!==e}},b=()=>o(i.ink(h),u,h?"#d8d6cf":"#1d1d1b")??"#888888",y=l({host:u,canvas:m,kit:d,place:p,ownPoster:i.ownPoster,glyphs:i.glyphs,source:i.source??null,options:()=>({...n,...i.look(h),...v(),ink:b(),interactionTarget:u,label:i.label??""}),onMount:(e,t)=>{i.label||(t.removeAttribute("role"),t.removeAttribute("aria-label"),t.setAttribute("aria-hidden","true")),i.onMount?.()},onRelease:i.onRelease,onFail:()=>{j(),i.onFail?.()}}),M=y.field;let k=0;const w=()=>{g||(h=t(u),M.update({...n,...i.look(h),...v(),ink:b()}))},P=()=>{k||g||(k=requestAnimationFrame(()=>{k=0,w()}))},R="function"==typeof matchMedia?matchMedia("(prefers-color-scheme: dark)"):null;R?.addEventListener?.("change",P);const O="function"==typeof MutationObserver?new MutationObserver(P):null;for(const e of[document.documentElement,document.body])e&&O?.observe(e,{attributes:!0,attributeFilter:["class","data-theme","data-mode","style"]});function j(){g||(g=!0,k&&cancelAnimationFrame(k),O?.disconnect(),R?.removeEventListener?.("change",P),y.destroy(),f.restore())}return y.start(),y.failed?(j(),null):{field:M,get canvas(){return y.canvas},get live(){return y.live},dark:()=>h,still:()=>!!(i.reducedMotion()??r()),refresh:w,destroy:j}}function f(e,t,n,r,o=()=>{}){let s=!1;const l={get supported(){return!!e()&&!s},get field(){return s?null:e()?.field??null},update(r){if(s)return;t.current=i(t.current,r);const o=r.poster;o&&a(t,o),n(t.current),e()?.refresh()},play(){s||e()?.field.play()},pause(){s||e()?.field.pause()},destroy(){s||(s=!0,o(),e()?.destroy(),u(t))}};return Object.defineProperties(r,Object.getOwnPropertyDescriptors(l))}function m(e,t){const n=Object.assign(document.createElement("canvas"),{width:e,height:t}),r=n.getContext("2d");return r.fillStyle="#000",r.fillRect(0,0,e,t),{canvas:n,pen:r}}function h(e,t,n){if(!t)return void e.pulse({strength:n});if("getBoundingClientRect"in t)return void e.pulse({element:t,strength:n});const r=e.canvas.getBoundingClientRect();e.pulse({x:t.x-r.left,y:t.y-r.top,strength:n})}export{m as blank,p as mountPageField,f as pageHandle,h as pulseAt,d as sleep};//# sourceMappingURL=chunk-BTD6EFAW.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{styleKeeper as t,srOnly as e,mountSurface as n,house as o,handle as r,clamp as l,smoothstep as a,hash as i}from"./chunk-S7RZP2MT.js";var c={value:0,duration:360,stagger:60,glyphs:"#%*+=-:",format:t=>t.toLocaleString(),face:"text"};function s(t,e){const n=(t,e)=>t[t.length-1-e]??"";for(let o=e.length-1;o>=0;o--)if(/\d/.test(n(e,o))&&n(t,o)!==n(e,o))return o;return-1}function f(f,u={}){const p=parseFloat((f.textContent??"").replace(/[^\d.-]/g,"")),h={current:{...c,...u,value:u.value??(Number.isFinite(p)?p:0)}},g=t();let d=h.current.value,m=h.current.format(d),y={from:m,to:m,t0:-1e9,up:!0,first:-1},x=null;const v=e(m,!0),S=document.createElement("span"),k=()=>{S.replaceChildren(...[...m].map(t=>Object.assign(document.createElement("span"),{textContent:t}))),v.textContent=m};x=n({host:f,look:()=>({mark:"glyph",charset:" .:-=+*#%@",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:3,cellAspect:.66,glyphScale:1,shade:.2,contrast:1.1,...h.current.look}),ink:()=>h.current.ink??getComputedStyle(f).color,kit:h,reducedMotion:()=>h.current.reducedMotion,resolution:2,onFail:()=>{x=null,f.textContent=m,g.restore()},paint:({pen:t,now:e,still:n,box:r,scale:c})=>{const s=getComputedStyle(S),f=parseFloat(s.fontSize),u=parseFloat(s.letterSpacing)||0,p=`${s.fontStyle} ${s.fontWeight} ${s.fontSize} ${s.fontFamily}`;t.setTransform(c,0,0,c,0,0),t.font=p,t.textAlign="center",t.textBaseline="alphabetic";const g=t.measureText("0"),d=g.fontBoundingBoxAscent||.8*f,m=g.fontBoundingBoxDescent||.2*f,{from:x,to:v,t0:k,up:b,first:C}=y,A=[...S.children],F=h.current,M="glyph"===F.face,w=(t,e)=>t[t.length-1-e]??"";let B=!1;return A.forEach((c,s)=>{const h=A.length-1-s,g=r(c),y=g.x+(g.w-u)/2,S=g.y,T=g.h,$=S+(T-d-m)/2+d,E=w(v,h),z=C-h,G=!n&&C>=0&&z>=0&&/\d/.test(E)?l((e-k)/(F.duration+z*F.stagger)):1,N=o(G),P=G<1&&!M?a(.72,1,G).toFixed(3):"";if(c.style.opacity!==P&&(c.style.opacity=P),G>=1)return void(M&&(t.globalAlpha=1,t.font=p,t.fillStyle="#fff",t.fillText(E,y,$)));B=!0,t.globalAlpha=M?1:1-a(.72,1,G);const j=5+2*z,W=[w(x,h),...Array.from({length:j},(t,e)=>F.glyphs[Math.floor(i(e+7*h,k)*F.glyphs.length)]??""),E];b||W.reverse();const D=(W.length-1)*T,I=b?N*D:D-N*D;t.save(),t.beginPath(),t.rect(y-g.w,S,2*g.w,T),t.clip(),W.forEach((e,n)=>{const o=$+n*T-I;if(o<S-T||o>S+2*T)return;const r=n>0&&n<W.length-1;t.font=r?`600 ${.84*f}px "Geist Mono", ui-monospace, monospace`:p,t.fillStyle=r?"#d0d0d0":"#fff",t.fillText(e,y,o)}),t.restore()}),t.globalAlpha=1,B}});const b=()=>{x&&g.set(S,"color","glyph"===h.current.face?"transparent":"inherit")};x&&(g.set(S,"display","inline-flex"),b(),S.setAttribute("aria-hidden","true"),f.replaceChildren(v,S,...(t=>[...t.children].filter(t=>"IMG"===t.tagName&&void 0!==t.dataset?.asciiPoster))(f),x.canvas),k(),document.fonts?.ready.then(()=>x?.kick()));const C=t=>{if(!Number.isFinite(t))return;const e=d,n=m;d=h.current.value=t,m=h.current.format(t),x?n!==m&&(y={from:n,to:m,up:t>=e,first:s(n,m),t0:performance.now()},k(),x.kick()):f.textContent=m};return r(()=>x,h,t=>{b(),t.value!==d?C(t.value):(m=t.format(d),k(),x?.refresh())},{set:C,get value(){return d}},()=>{x&&(f.textContent=m),g.restore()})}var u=c;export{u as ODOMETER_DEFAULTS,s as firstChanged,f as odometer};//# sourceMappingURL=chunk-OWEZV7TQ.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{poster as e,liveField as t,disposeKit as n,setPosterSource as o}from"./chunk-3PCKMO6I.js";import{isGlyphFieldSupported as r}from"../field.js";var i,a,s=(e,t=0,n=1)=>Math.min(n,Math.max(t,e)),c=(e,t)=>{const n=43758.5453*Math.sin(127.1*e+311.7*t);return n-Math.floor(n)},l=(e,t=3)=>1-(1-s(e))**t,d=(e,t,n)=>{const o=s((n-e)/(t-e));return o*o*(3-2*o)},u=e=>{if(e<=0)return 0;if(e>=1)return 1;const t=(e,t,n)=>3*t*e*(1-e)**2+3*n*e*e*(1-e)+e**3;let n=0,o=1,r=e;for(let i=0;i<22;i++)r=(n+o)/2,t(r,.16,.3)<e?n=r:o=r;return t(r,1,1)},p=()=>"function"==typeof matchMedia&&matchMedia("(prefers-reduced-motion: reduce)").matches,h=e=>e??p(),f={scene:"none",background:"transparent",color:"ink",levels:"none",fit:"cover",focus:{x:.5,y:.5},vignette:0,drift:0,hover:"none",shade:0,contrast:1,brightness:0,gamma:1,maxPixelRatio:2,clear:!1};function m(e,t,n){let o=(e??"").trim();const r=/^var\(\s*(--[\w-]+)\s*(?:,\s*(.+))?\)$/.exec(o);if(r?o=v(t,r[1])||(r[2]??"").trim():o.startsWith("--")&&(o=v(t,o)),!o)return n?m(n,t):null;if(/^#[\da-f]{6}$/i.test(o))return o.toLowerCase();if(/^#[\da-f]{3}$/i.test(o))return`#${[...o.slice(1)].map(e=>e+e).join("")}`.toLowerCase();const i=/^rgba?\(\s*([\d.]+)[\s,]+([\d.]+)[\s,]+([\d.]+)/i.exec(o);if(i)return g([+i[1],+i[2],+i[3]]);if(void 0===a)try{a="undefined"==typeof document?null:Object.assign(document.createElement("canvas"),{width:1,height:1}).getContext("2d",{willReadFrequently:!0})}catch{a=null}if(!a)return n?m(n,t):null;a.clearRect(0,0,1,1),a.fillStyle="#000",a.fillStyle=o,a.fillRect(0,0,1,1);const[s,c,l]=a.getImageData(0,0,1,1).data;return g([s,c,l])}var v=(e,t)=>"function"==typeof getComputedStyle?getComputedStyle(e).getPropertyValue(t).trim():"",g=e=>`#${e.map(e=>Math.round(s(e,0,255)).toString(16).padStart(2,"0")).join("")}`,y=e=>{const t=parseInt(e.slice(1,7),16);return[t>>16&255,t>>8&255,255&t]},b=(e,t,n)=>{const o=y(e),r=y(t);return g(o.map((e,t)=>e+(r[t]-e)*n))};function x(e){const t="function"==typeof getComputedStyle?getComputedStyle(e):null,n=/^rgba?\(\s*([\d.]+)[\s,]+([\d.]+)[\s,]+([\d.]+)(?:\s*[,/]\s*([\d.]+%?))?/i.exec(t?.backgroundColor??"");if(n){if((void 0===n[4]?1:n[4].endsWith("%")?parseFloat(n[4])/100:parseFloat(n[4]))>=.5)return.2126*+n[1]+.7152*+n[2]+.0722*+n[3]<128}const o=m(t?.color??"",e);if(!o)return"function"==typeof matchMedia&&matchMedia("(prefers-color-scheme: dark)").matches;const[r,i,a]=y(o);return.2126*r+.7152*i+.0722*a>140}function w(){const e=[];return{set(t,n,o){e.some(([e,o])=>e===t&&o===n)||e.push([t,n,t.style.getPropertyValue(n)]),t.style.setProperty(n,o)},restore(){for(const[t,n,o]of e.reverse())o?t.style.setProperty(n,o):t.style.removeProperty(n);e.length=0}}}function M(e="",t=!1){const n=document.createElement("span");return n.setAttribute("style","position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0"),t&&n.setAttribute("aria-live","polite"),n.textContent=e,n}function k(e,t){const n=e.getBoundingClientRect(),o=t.getBoundingClientRect(),r=n.width/(e.offsetWidth||n.width||1)||1;return{x:(o.left-n.left)/r,y:(o.top-n.top)/r,w:o.width/r,h:o.height/r}}function C(e,t){const n={...e,...t},o=e.look,r=t.look;return r&&(n.look=Object.fromEntries(Object.entries({...o,...r}).filter(([,e])=>void 0!==e))),n}var E=new WeakMap,R=e=>E.get(e)?.()??null;function F(n){const{host:o,layer:a="over",outset:s=0,kit:c}=n;if("undefined"==typeof document)return null;const l=`position:absolute;left:${-s}px;top:${-s}px;width:calc(100% + ${2*s}px);height:calc(100% + ${2*s}px);pointer-events:none;z-index:${"under"===a?-1:"auto"}`;if(!r())return c?.current.poster&&e(o,c.current.poster,l,c),null;const d=w(),u=document.createElement("canvas"),h=document.createElement("canvas"),v=h.getContext("2d");if(!v)return null;"static"===getComputedStyle(o).position&&d.set(o,"position","relative"),"under"===a&&d.set(o,"isolation","isolate"),u.setAttribute("aria-hidden","true"),u.dataset.asciiKit="";const g=u.style;g.position="absolute",g.left=g.top=-s+"px",g.width=g.height=`calc(100% + ${2*s}px)`,g.pointerEvents="none",g.zIndex="under"===a?"-1":"",o.appendChild(u);const y=()=>{const e=getComputedStyle(o);$.canvas.style.borderRadius=[e.borderTopLeftRadius,e.borderTopRightRadius,e.borderBottomRightRadius,e.borderBottomLeftRadius].map(e=>s&&/^[\d.]+px$/.test(e)?`${parseFloat(e)+s}px`:e).join(" ")};let b=x(o);const M=()=>m(n.ink(b),o)??m(getComputedStyle(o).color,o)??(b?"#d8d6cf":"#1d1d1b");let C=0,R=!1,F=!0,S=!1,A=-1/0,L=-1/0;const O=e=>{L=e.timeStamp};o.addEventListener("pointermove",O,{passive:!0}),o.addEventListener("pointerdown",O,{passive:!0});const $=t({host:o,canvas:u,kit:c,place:l,options:()=>({...f,...n.look(),ink:M(),interactionTarget:o,label:""}),onMount:(e,t)=>{E.set(t,q),t.removeAttribute("role"),t.removeAttribute("aria-label"),e.ready.then(T,()=>{}),T()},onRelease:()=>{C&&cancelAnimationFrame(C),C=0},onFail:()=>{Q(),n.onFail?.()}}),j=$.field;y();const P=()=>!!(n.reducedMotion()??p()),W=e=>k($.canvas,e),I=e=>{const t=$.canvas,r=Math.max(1,t.clientWidth||o.clientWidth+2*s),i=Math.max(1,t.clientHeight||o.clientHeight+2*s),a=n.resolution??1,[c,l]="function"==typeof a?a(r,i):[Math.max(1,Math.round(r*a)),Math.max(1,Math.round(i*a))];h.width===c&&h.height===l||(h.width=c,h.height=l),v.setTransform(1,0,0,1,0,0),v.globalAlpha=1,v.globalCompositeOperation="source-over",v.filter="none",v.fillStyle="#000",v.fillRect(0,0,c,l);let d=!1;try{d=n.paint({pen:v,width:c,height:l,w:r,h:i,scale:c/r,now:e,still:P(),dark:b,box:W})}catch(e){"undefined"!=typeof console&&console.error(e)}return j.setSource(h).then(()=>{S||j.redraw()}),d};function q(){const e=$.canvas,t=Math.max(1,e.clientWidth||o.clientWidth+2*s),r=Math.max(1,e.clientHeight||o.clientHeight+2*s),i=n.resolution??1,[a,c]="function"==typeof i?i(t,r):[Math.max(1,Math.round(t*i)),Math.max(1,Math.round(r*i))],l=document.createElement("canvas");l.width=a,l.height=c;const d=l.getContext("2d");if(!d)return null;d.fillStyle="#000",d.fillRect(0,0,a,c);try{n.paint({pen:d,width:a,height:c,w:t,h:r,scale:a/t,now:performance.now(),still:!0,dark:b,box:W})}catch{return null}return l}E.set(u,q);const z=e=>{if(C=0,S||R||!$.live)return;if(e-A<(i??(i=(()=>{const e="undefined"==typeof navigator?void 0:navigator;return 1e3/(e&&(e.hardwareConcurrency>0&&e.hardwareConcurrency<=2||e.deviceMemory&&e.deviceMemory<=2||e.connection?.saveData)?30:60)-2})()))&&e-L>1e3)return void(C=requestAnimationFrame(z));A=e;!I(e)||P()||!F||"undefined"!=typeof document&&document.hidden||(C=requestAnimationFrame(z))};function T(){C||S||R||!$.live||(C=requestAnimationFrame(z))}const B="function"==typeof ResizeObserver?new ResizeObserver(()=>{y(),j.resize(),!$.live||S||R||I(performance.now()),T()}):null;B?.observe(o);const H="function"==typeof IntersectionObserver?new IntersectionObserver(([e])=>{F=e.isIntersecting,F&&T()},{rootMargin:"64px"}):null;H?.observe(o);const D=()=>{document.hidden||T()};document.addEventListener("visibilitychange",D);let K=0;const V=()=>{K||S||(K=requestAnimationFrame(()=>{K=0,S||(b=x(o),j.update({ink:M()}),n.onTheme?.(),T())}))},G="function"==typeof matchMedia?matchMedia("(prefers-color-scheme: dark)"):null;G?.addEventListener?.("change",V);const J="function"==typeof matchMedia?matchMedia("(prefers-reduced-motion: reduce)"):null;J?.addEventListener?.("change",T);const N="function"==typeof MutationObserver?new MutationObserver(V):null;for(const e of[document.documentElement,document.body])e&&N?.observe(e,{attributes:!0,attributeFilter:["class","data-theme","data-mode","style"]});function Q(){S||(S=!0,C&&cancelAnimationFrame(C),K&&cancelAnimationFrame(K),C=K=0,B?.disconnect(),H?.disconnect(),N?.disconnect(),document.removeEventListener("visibilitychange",D),o.removeEventListener("pointermove",O),o.removeEventListener("pointerdown",O),G?.removeEventListener?.("change",V),J?.removeEventListener?.("change",T),$.destroy(),d.restore(),h.width=h.height=1)}return $.start(),$.failed?(Q(),null):{field:j,get canvas(){return $.canvas},get live(){return $.live},kick:T,refresh(){S||(b=x(o),j.update({...f,...n.look(),ink:M()}),T())},still:P,dark:()=>b,box:W,play(){R&&(R=!1,j.play(),T())},pause(){R=!0,C&&cancelAnimationFrame(C),C=0,j.pause()},destroy:Q}}function S(e,t,r,i,a=()=>{}){let s=!1;const c={get supported(){return!!e()&&!s},get field(){return s?null:e()?.field??null},update(e){if(s)return;t.current=C(t.current,e);const n=e.poster;n&&o(t,n),r(t.current)},play(){s||e()?.play()},pause(){s||e()?.pause()},destroy(){s||(s=!0,e()?.destroy(),n(t),a())}};return Object.defineProperties(i,Object.getOwnPropertyDescriptors(c))}export{f as BASE_LOOK,k as boxIn,s as clamp,l as easeOut,S as handle,c as hash,y as hexRgb,u as house,x as isDark,C as mergeOptions,b as mixHex,F as mountSurface,p as prefersReduced,h as reducedFrom,m as resolveColor,R as settledSource,d as smoothstep,M as srOnly,w as styleKeeper,g as toHex};//# sourceMappingURL=chunk-S7RZP2MT.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{parseColor as t,MONO as e,pixelSnap as n,fbm as o,hash2 as a,band as r,ditherIndex as i,toneAlpha as c}from"./chunk-ZCHGV2CV.js";import{mountCanvas as h}from"./chunk-BR6ZNJZW.js";import{hexRgb as s}from"./chunk-S7RZP2MT.js";function l(h,s,l,f,M={x:.5,y:.5},m={}){const{fontSize:g=13,charAspect:u=.62,lineHeightRatio:d=1.3,chars:p=" .:-=+*#%@",baseColor:x=null,accentColor:$,accentThreshold:S=.52,mouseInfluence:b=.4,mouseFalloff:C=2.8,speed:k=1,vortex:v=!0,sparkles:y=!1,breathe:z=!0,lightMode:R=!1}=m,Z=Array.from(p),j=g*u,w=g*d,A=Math.ceil(s/j),T=Math.ceil(l/w),B=M.x,H=M.y,V=$?t($):null;h.clearRect(0,0,s,l),h.font=`${g}px ${e}`;const W=n(h);h.textBaseline="top";const q=f*k,F=z?.12*(.5*Math.sin(.22*q)+.5):0;for(let t=0;t<T;t++)for(let e=0;e<A;e++){const n=e/A,s=t/T,l=.045,f=.08*q,M=.06,g=.45*((.5*Math.sin(.08*e+.05*t+.6*q)+.5+(.5*Math.sin(.03*e-.07*t+.4*q)+.5)+(.5*Math.sin(.05*e+.03*t+.8*q)+.5))/3)+.35*(.5*o(e*l+f,t*l*1.4-.7*f)+.5)+.2*(.5*Math.sin((e+.65*t)*M+1.1*q)+.5)+F,u=n-B,d=s-H,p=Math.sqrt(u*u+d*d);let $=0;if(v&&p<.35){const t=Math.atan2(d,u),e=Math.sin(4*t+2.2*q-14*p),n=Math.max(0,1-p/.35);$=e*n*n*.22}const k=g*(1-b)+(Math.max(0,1-p*C)+.5*$)*b+.15*$,z=Math.min(1,Math.max(0,k));let G=z;if(y&&z>.72){const n=Math.floor(8*q),o=a(7*e+3*n,11*t+n);o>.88&&(G=Math.min(1,z+4*(o-.88)))}const I=r(G,.32,.9);if(I<=0)continue;const J=i(I,Z.length,e,t,m.ditherStrength);if(" "===Z[J])continue;const N=c(I);h.fillStyle=V&&G>S?`rgba(${V.r},${V.g},${V.b},${N})`:x?x.replace("{a}",String(N)):R?`rgba(111,109,103,${N})`:`rgba(143,141,134,${N})`,h.fillText(Z[J],W(e*j),W(t*w))}}var f={id:"wave",name:"Wave",description:"An interference field with a soft vortex at the cursor and a slow breath.",cellSize:13,speed:.6,cursor:!0,mount:t=>h(t,(t,e,n,o,a,r)=>{const[i,c,h]=s(r.ink);l(t,e,n,o,a,{ditherStrength:r.ditherStrength,fontSize:r.fontSize,chars:r.chars,lightMode:r.lightMode,baseColor:`rgba(${i},${c},${h},{a})`,accentColor:r.accent})})};export{l as renderWaveBackground,f as wave};//# sourceMappingURL=chunk-UO7RB7RC.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{MONO as t,GRAPHITE_LIGHT as e,GRAPHITE_DARK as o,pixelSnap as r,parseColor as n,band as c,ditherIndex as i,toneAlpha as a,vnoise as l}from"./chunk-ZCHGV2CV.js";import{mountCanvas as s}from"./chunk-BR6ZNJZW.js";function h(s,h,f,d,g={x:.5,y:.5},u={}){const{fontSize:m=13,chars:M=" .:-=+*#%@",accentColor:p,color:$,octaves:x=4,speed:S=1,scale:b=1,accentThreshold:y=.9,mouseWarp:z=.3,lightMode:C=!1}=u,k=Array.from(M),Z=.62*m,j=1.3*m,v=Math.ceil(h/Z),w=Math.ceil(f/j);s.clearRect(0,0,h,f),s.font=`${m}px ${t}`,s.textBaseline="top";const A=C?e:o;let B=A.r,N=A.g,R=A.b;const T=r(s);if($){const t=n($);t&&(B=t.r,N=t.g,R=t.b)}let V=B,W=N,q=R;const G=p?n(p):null;G&&(V=G.r,W=G.g,q=G.b);const H=.035*b,J=d*S,D=Math.min(6,Math.max(1,x)),E=(t,e)=>{let o=0,r=.5,n=1,c=0;for(let i=0;i<D;i++)o+=l(t*n,e*n)*r,c+=r,r*=.5,n*=2.1;return o/c};for(let t=0;t<w;t++)for(let e=0;e<v;e++){const o=e*H+.06*J,r=t*H*1.3-.04*J,n=e/v-g.x,l=t/w-g.y,h=Math.sqrt(n*n+l*l),f=z>0?.12*Math.max(0,1-h/z):0,d=E(o+f*Math.sin(1.3*J+8*l),r+f*Math.cos(.9*J+8*n)),m=c(.5*d+.5,.7,.83);if(m<=0)continue;const M=k[i(m,k.length,e,t,u.ditherStrength)];if(" "===M)continue;const p=!!G&&m>y,$=a(m);s.fillStyle=p?`rgba(${V},${W},${q},${$})`:`rgba(${B},${N},${R},${$})`,s.fillText(M,T(e*Z),T(t*j))}}var f={id:"noise",name:"Noise",description:"A slow fractal noise field that warps around the cursor.",cellSize:13,speed:.5,cursor:!0,mount:t=>s(t,(t,e,o,r,n,c)=>h(t,e,o,r,n,{ditherStrength:c.ditherStrength,fontSize:c.fontSize,chars:c.chars,lightMode:c.lightMode,color:c.ink,accentColor:c.accent}))};export{f as noise,h as renderNoiseBackground};//# sourceMappingURL=chunk-XM56OTYT.js.map
|