asciify-engine 4.22.0 → 4.24.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/README.md +13 -0
- package/dist/{animation-presets-KnEWoJ_q.d.ts → animation-presets-CzM3jLT6.d.cts} +1 -1
- package/dist/{animation-presets-CEdD0FMM.d.cts → animation-presets-a8WDzKDj.d.ts} +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.d.cts +5 -4
- package/dist/core.d.ts +5 -4
- package/dist/core.js +1 -1
- package/dist/field.cjs +1 -1
- package/dist/field.d.cts +10 -1
- package/dist/field.d.ts +10 -1
- package/dist/field.js +1 -1
- package/dist/{hover-guide-CAfsLjFZ.d.cts → hover-catalog-CrmxlmUe.d.cts} +37 -10
- package/dist/{hover-guide-CAfsLjFZ.d.ts → hover-catalog-CrmxlmUe.d.ts} +37 -10
- package/dist/hover-guide-DdFnAnfU.d.cts +9 -0
- package/dist/hover-guide-DdFnAnfU.d.ts +9 -0
- package/dist/hover.cjs +1 -1
- package/dist/hover.d.cts +7 -5
- package/dist/hover.d.ts +7 -5
- package/dist/hover.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +4 -3
- package/dist/index.d.ts +4 -3
- package/dist/index.js +1 -1
- package/dist/kit/chunk-2CF4PX6U.js +1 -0
- package/dist/kit/chunk-2NVKPXPL.js +1 -0
- package/dist/kit/chunk-3473NPIN.js +1 -0
- package/dist/kit/chunk-3A5LID2G.js +1 -0
- package/dist/kit/chunk-3PCKMO6I.js +1 -0
- package/dist/kit/chunk-4HWMQCAM.js +1 -0
- package/dist/kit/chunk-4OT66HSZ.js +1 -0
- package/dist/kit/chunk-4QHFEMFS.js +1 -0
- package/dist/kit/chunk-4ZQFDFEH.js +1 -0
- package/dist/kit/chunk-5BEBNKYM.js +1 -0
- package/dist/kit/chunk-5I4IZTL5.js +1 -0
- package/dist/kit/chunk-5QE6UMXN.js +1 -0
- package/dist/kit/chunk-5Z2EJAUV.js +1 -0
- package/dist/kit/chunk-73M2OESE.js +1 -0
- package/dist/kit/chunk-7ABNWOW4.js +1 -0
- package/dist/kit/chunk-AIM3J2US.js +1 -0
- package/dist/kit/chunk-BN7HL52Z.js +1 -0
- package/dist/kit/chunk-BNVRKD3V.js +1 -0
- package/dist/kit/chunk-BQZCLGCY.js +1 -0
- package/dist/kit/chunk-BR6ZNJZW.js +1 -0
- package/dist/kit/chunk-BTD6EFAW.js +1 -0
- package/dist/kit/chunk-C3C7AYKL.js +1 -0
- package/dist/kit/chunk-C4KZYCPF.js +1 -0
- package/dist/kit/chunk-DFOWXOZR.js +1 -0
- package/dist/kit/chunk-DZ5XGHTJ.js +1 -0
- package/dist/kit/chunk-E3TUOX2A.js +1 -0
- package/dist/kit/chunk-ENTDGT2V.js +1 -0
- package/dist/kit/chunk-FR3ZJNOY.js +1 -0
- package/dist/kit/chunk-FUI5AVIF.js +1 -0
- package/dist/kit/chunk-G57QACJG.js +1 -0
- package/dist/kit/chunk-H2UZBVKE.js +1 -0
- package/dist/kit/chunk-HTUGMGVA.js +1 -0
- package/dist/kit/chunk-I4QVLLRQ.js +1 -0
- package/dist/kit/chunk-IPVN22ZM.js +1 -0
- package/dist/kit/chunk-IQTGJRDX.js +1 -0
- package/dist/kit/chunk-IUKSHYED.js +1 -0
- package/dist/kit/chunk-J2YZBT3N.js +1 -0
- package/dist/kit/chunk-K563CCOL.js +1 -0
- package/dist/kit/chunk-KWTF6Q5W.js +1 -0
- package/dist/kit/chunk-MGVPLQ3Z.js +1 -0
- package/dist/kit/chunk-MIZ2DUHU.js +1 -0
- package/dist/kit/chunk-MQJQIDO5.js +1 -0
- package/dist/kit/chunk-NURPDP3Y.js +1 -0
- package/dist/kit/chunk-O7SGY4YJ.js +1 -0
- package/dist/kit/chunk-OWEZV7TQ.js +1 -0
- package/dist/kit/chunk-PCIAA2LL.js +1 -0
- package/dist/kit/chunk-PFKYKAIP.js +1 -0
- package/dist/kit/chunk-PIU2BMFU.js +1 -0
- package/dist/kit/chunk-QALCXKU6.js +1 -0
- package/dist/kit/chunk-QRCXXS5Z.js +1 -0
- package/dist/kit/chunk-RFLIFKZ4.js +1 -0
- package/dist/kit/chunk-ROR6MG3K.js +1 -0
- package/dist/kit/chunk-S62H7ZIU.js +1 -0
- package/dist/kit/chunk-S7RZP2MT.js +1 -0
- package/dist/kit/chunk-SARCZMLN.js +1 -0
- package/dist/kit/chunk-SNCXU7KF.js +1 -0
- package/dist/kit/chunk-T3GWGPST.js +1 -0
- package/dist/kit/chunk-TTGMK4EA.js +1 -0
- package/dist/kit/chunk-UML6XQAR.js +1 -0
- package/dist/kit/chunk-UO7RB7RC.js +1 -0
- package/dist/kit/chunk-VC2ZQG63.js +1 -0
- package/dist/kit/chunk-VVW7LZT2.js +1 -0
- package/dist/kit/chunk-W2STAN6V.js +1 -0
- package/dist/kit/chunk-WJLZM3DR.js +1 -0
- package/dist/kit/chunk-XANKANGR.js +1 -0
- package/dist/kit/chunk-XB4DKPGL.js +1 -0
- package/dist/kit/chunk-XDKKCIIL.js +1 -0
- package/dist/kit/chunk-XM56OTYT.js +1 -0
- package/dist/kit/chunk-XPXMCXYI.js +1 -0
- package/dist/kit/chunk-YBRP6BFW.js +1 -0
- package/dist/kit/chunk-YCWMOTYH.js +1 -0
- package/dist/kit/chunk-ZCHGV2CV.js +1 -0
- package/dist/kit/chunk-ZRJVOUWH.js +1 -0
- package/dist/kit.cjs +1 -1
- package/dist/kit.d.cts +1 -0
- package/dist/kit.d.ts +1 -0
- package/dist/kit.js +1 -1
- package/dist/{model-BHIQYYk-.d.ts → model-C3TTmMXv.d.ts} +2 -1
- package/dist/{model-BzgEEqzP.d.cts → model-DAZNnqXr.d.cts} +2 -1
- package/dist/studio.cjs +1 -1
- package/dist/studio.d.cts +6 -4
- package/dist/studio.d.ts +6 -4
- package/dist/studio.js +1 -1
- package/dist/{types-C9lka3yC.d.ts → types-BnakIXAU.d.ts} +1 -1
- package/dist/{types-DOl5f2x3.d.cts → types-_8MohOZ1.d.cts} +1 -1
- package/package.json +2 -2
- package/skills/asciify-engine/SKILL.md +3 -3
- package/skills/asciify-engine/references/glyph-field.md +2 -1
- package/skills/asciify-engine/references/kit.md +1 -1
- package/skills/asciify-engine/references/performance.md +30 -0
- package/skills/asciify-engine/references/studio-effects.md +12 -6
- package/skills/asciify-engine/references/studio-workspace.md +1 -1
- package/skills/asciify-engine/references/upgrading.md +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{scenePreset as r,FIELD_GRAPHITE as e,narrow as t}from"./chunk-C3C7AYKL.js";var a=r({id:"drift",name:"Drift",description:"Characters that drift slowly in broad lobes and stay clear around your content.",cellSize:11,scene:"drift",charset:" .:-=+*#",hover:"trail",graphite:e,middle:!1,feather:.2,tune:r=>({scale:t()?"dot"===r.mark?1.8:1.6:1,brightness:"dot"===r.mark?0:.05,blend:"auto",lantern:{radius:.16,strength:.35,trail:.6,follow:9},trail:{strength:.9,radius:"dot"===r.mark?.4:.32},...r.clear?{clear:{element:r.clear,padding:32,feather:.2,shape:"rect"}}:{}})});export{a as drift};//# sourceMappingURL=chunk-AIM3J2US.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{MONO as t,GRAPHITE_LIGHT as o,GRAPHITE_DARK as e,pixelSnap as n,parseColor as r,hash2 as c,band as h,ditherIndex as i,toneAlpha as l}from"./chunk-ZCHGV2CV.js";import{mountCanvas as a}from"./chunk-BR6ZNJZW.js";function s(a,s,f,M,g={}){const{fontSize:d=13,color:u,accentColor:S,speed:$=.4,layers:I=4,turbulence:P=.8,lightMode:b=!1}=g,p=.62*d,m=1.3*d,k=Math.ceil(s/p),x=Math.ceil(f/m);a.clearRect(0,0,s,f),a.font=`${d}px ${t}`,a.textBaseline="top";const z=b?o:e;let C=z.r,w=z.g,y=z.b;const Z=n(a);if(u){const t=r(u);t&&(C=t.r,w=t.g,y=t.b)}let j=C,v=w,B=y;const R=S?r(S):null;R&&(j=R.r,v=R.g,B=R.b);const V=M*$,A=g.chars?Array.from(g.chars):void 0,G=["-","\\","|","/"];for(let t=0;t<x;t++){const o=t/x;for(let e=0;e<k;e++){const n=e/k;let r=0,s=0;for(let t=0;t<I;t++){const e=c(13*t,7*t+3),h=1.1+2.4*e,i=.9+2*c(29*t,11*t+1),l=e*Math.PI*6,a=(.2+.5*c(41*t,17*t))*(t%2==0?1:-1.3),f=Math.sin(n*h*Math.PI*2+V*a+l),M=Math.cos(o*i*Math.PI*2+V*a*.6+1.7*l),g=Math.sin(n*i*Math.PI*P+o*h*Math.PI*P+V*a*.4);r+=Math.atan2(M+.3*g,f),s+=.5*(f*M+1)}const f=r/I,M=h(s/I,.54,.74);if(M<=0)continue;const d=(f%Math.PI+Math.PI)%Math.PI,u=Math.round(d/(Math.PI/4))%G.length;if(!A&&g.ditherStrength&&0===i(M,2,e,t,g.ditherStrength))continue;const S=A?A[i(M,A.length,e,t,g.ditherStrength)]:G[u];if(" "===S)continue;const $=!!R&&M>.85,b=l(M);a.fillStyle=$?`rgba(${j},${v},${B},${b})`:`rgba(${C},${w},${y},${b})`,a.fillText(S,Z(e*p),Z(t*m))}}}var f={id:"silk",name:"Silk",description:"Long ribbons that follow a slow flow field.",cellSize:13,speed:1,cursor:!1,mount:t=>a(t,(t,o,e,n,r,c)=>s(t,o,e,n,{ditherStrength:c.ditherStrength,fontSize:c.fontSize,chars:c.chars,lightMode:c.lightMode,color:c.ink,accentColor:c.accent}))};export{s as renderSilkBackground,f as silk};//# sourceMappingURL=chunk-BN7HL52Z.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{hash as t,settledSource as e}from"./chunk-S7RZP2MT.js";var o=t=>{const e=Math.round(255*Math.min(1,Math.max(0,t)));return`rgb(${e} ${e} ${e})`},n=t=>{if(!t||"transparent"===t)return 0;const e=/\/\s*([\d.]+)(%?)\s*\)$/.exec(t);if(e)return parseFloat(e[1])/(e[2]?100:1);const o=/^rgba\([^)]*,\s*([\d.]+)\s*\)$/.exec(t);return o?parseFloat(o[1]):1},i=/^(IMG|PICTURE|VIDEO|CANVAS|SVG|svg)$/;function a(t,a,s,c){const d=(t,e)=>Math.max(0,Math.min(parseFloat(t.borderTopLeftRadius)||0,e.w/2,e.h/2)),f=[a,...a.querySelectorAll("*")];t.save();for(const l of f){if("CANVAS"===l.tagName&&void 0!==l.dataset?.asciiKit){if(!c||l===c.skip)continue;const o=s(l),n=o.w>0&&o.h>0?e(l):null;n&&(t.globalCompositeOperation="lighter",t.drawImage(n,o.x,o.y,o.w,o.h),t.globalCompositeOperation="source-over");continue}if(void 0!==l.dataset?.asciiPoster)continue;const f=s(l);if(f.w<=0||f.h<=0)continue;const h=getComputedStyle(l);if("hidden"===h.visibility||"none"===h.display)continue;const u=n(h.backgroundColor)>.03,g=(parseFloat(h.borderTopWidth)||0)>0&&n(h.borderTopColor)>.1;if(t.beginPath(),l===a)(u||g)&&(t.strokeStyle=o(.42),t.lineWidth=3,t.roundRect(f.x+1.5,f.y+1.5,f.w-3,f.h-3,d(h,f)),t.stroke());else{if(i.test(l.tagName)){t.fillStyle=o(.5),f.w<32&&f.h<32?t.arc(f.x+f.w/2,f.y+f.h/2,.36*Math.min(f.w,f.h),0,2*Math.PI):t.roundRect(f.x,f.y,f.w,f.h,d(h,f)),t.fill();continue}u?(t.fillStyle=o(.22),t.roundRect(f.x,f.y,f.w,f.h,d(h,f)),t.fill()):g&&(t.strokeStyle=o(.32),t.lineWidth=1.5,t.roundRect(f.x+.75,f.y+.75,f.w-1.5,f.h-1.5,d(h,f)),t.stroke())}if("INPUT"===l.tagName||"TEXTAREA"===l.tagName){const e=l,o=e.value||e.placeholder||"";o&&r(t,o,f.x+(parseFloat(h.paddingLeft)||0),f.y,f.h,h,e.value?.82:.5)}}!function(t,e,o){if("function"!=typeof document.createTreeWalker)return;const n=document.createTreeWalker(e,4),i=document.createRange(),a=o(e),s=e.getBoundingClientRect(),c=s.width/(e.offsetWidth||s.width||1)||1;let d=0;for(let o=n.nextNode();o&&d<2e3;o=n.nextNode()){const n=o.parentElement;if(!n)continue;const f=getComputedStyle(n);if("hidden"===f.visibility||l(n,e))continue;const h=(parseFloat(f.fontWeight)||400)>=600||/^H[1-6]$/.test(n.tagName)?1:.8;for(const e of o.data.matchAll(/\S+/g)){i.setStart(o,e.index),i.setEnd(o,e.index+e[0].length);const n=i.getClientRects()[0];n&&(d++,r(t,e[0],a.x+(n.left-s.left)/c,a.y+(n.top-s.top)/c,n.height/c,f,h))}}i.detach?.()}(t,a,s),t.restore()}function r(t,e,n,i,a,r,l){const s=Math.min(900,(parseFloat(r.fontWeight)||400)+200);t.font=`${r.fontStyle||"normal"} ${s} ${r.fontSize} ${r.fontFamily}`,t.fillStyle=o(l),t.shadowColor=o(l),t.shadowBlur=3,t.textBaseline="middle",t.fillText(e,n,i+a/2),t.shadowBlur=0}function l(t,e){for(;t&&t!==e;t=t.parentElement){const e=t,o=getComputedStyle(e);if(e.offsetWidth<=1&&e.offsetHeight<=1&&"hidden"===o.overflow)return!0;if("inset(50%)"===o.clipPath||"rect(0px, 0px, 0px, 0px)"===o.clip)return!0}return!1}function s(t,e,o,n,i=2,r){const l=document.createElement("canvas");l.width=Math.max(2,Math.round(o*i)),l.height=Math.max(2,Math.round(n*i));const s=l.getContext("2d",{willReadFrequently:!0});return s?(s.setTransform(i,0,0,i,0,0),s.fillStyle="#000",s.fillRect(0,0,o,n),a(s,t,e,r),l):l}var c=4,d=6;function f(e,o=2){const n=e.getContext("2d",{willReadFrequently:!0});if(!n)return[];const i=e.width,a=e.height,r=n.getImageData(0,0,i,a).data,l=[];for(let e=0;e<a/o;e+=6)for(let n=0;n<i/o;n+=4){let s=!1;for(let t=0;t<6*o&&!s;t+=3)for(let l=0;l<4*o&&!s;l+=2){const c=Math.round(n*o+l),d=Math.round(e*o+t);c<i&&d<a&&r[4*(d*i+c)]>10&&(s=!0)}s&&l.push({x:n,y:e,seed:t(n,e)})}return l}function h(t,e,o,n,i,a,r=1,l=.32,s=2){for(let c=0;c<o.length;c++){const d=o[c],f=(i-n[c]*(1-l))/l;if(f<=0)continue;const h=f>=1?0:1-f;let u=d.x,g=d.y;if(h>0){const[t,e]=a(d,h);u+=t,g+=e}t.globalAlpha=r*(1-h*h),t.drawImage(e,d.x*s,d.y*s,4*s,6*s,u,g,4,6)}t.globalAlpha=1}export{d as BLOCK_H,c as BLOCK_W,f as blocksOf,h as drawBlocks,s as snapshot};//# sourceMappingURL=chunk-BNVRKD3V.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{scenePreset as e}from"./chunk-C3C7AYKL.js";var t=e({id:"ripple",name:"Ripple",description:"Still water: drops land here and there and ring outward, and the pointer drops its own.",cellSize:11,scene:"ripple",charset:" .·:-~=",hover:"none",extra(e,t){const{host:n}=e;let r=-1e9,i=-1e4,o=-1e4;const s=n=>{const s=performance.now();if(!1===e.settings().cursor||s-r<260||Math.hypot(n.clientX-i,n.clientY-o)<48)return;r=s,i=n.clientX,o=n.clientY;const c=t.canvas.getBoundingClientRect();t.field?.pulse({x:n.clientX-c.left,y:n.clientY-c.top,strength:.5})};return n.addEventListener("pointermove",s,{passive:!0}),()=>n.removeEventListener("pointermove",s)}});export{t as ripple};//# sourceMappingURL=chunk-BQZCLGCY.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{styleKeeper as e,isDark as t,resolveColor as n,prefersReduced as i,boxIn as o}from"./chunk-S7RZP2MT.js";var r="#6f6d67",s="#8f8d86",a={x:-1,y:-1,users:0},c=e=>{a.x=e.clientX,a.y=e.clientY};function d(d,l,u=0){if("undefined"==typeof document)return null;const{host:m}=d,h=document.createElement("canvas");let f=null;try{f=h.getContext("2d")}catch{f=null}if(!f)return null;const v=f,p=e();"static"===getComputedStyle(m).position&&p.set(m,"position","relative"),p.set(m,"isolation","isolate"),h.dataset.asciiKit="",h.setAttribute("aria-hidden","true"),h.setAttribute("style","position:absolute;inset:0;width:100%;height:100%;pointer-events:none;border-radius:inherit;z-index:-1"),m.appendChild(h);let g,y=t(m),b="";const x=()=>{b=n(d.ink(y),m,y?s:r)??s;const e=d.settings().accent;g=e?n(e,m)??void 0:void 0};x();let M=0,w=!0,E=!1,L=!1,A=0,C=0,F=0,S=!1,O=9,R=9,z=1,k=1,q=u;const I={x:.5,y:.5},P=()=>!!(d.reducedMotion()??i()),T=()=>{const e=d.settings(),t=performance.now(),n={fontSize:e.cellSize,chars:e.charset,ditherStrength:e.dither,lightMode:!y,ink:b,accent:g,elapsed:R,speed:e.speed};for(v.globalAlpha=1,v.globalCompositeOperation="source-over";q>0;q--)l(v,z,k,O,I,n);l(v,z,k,O,I,n),(e=>{if(!e||!e.isConnected)return;const t=o(h,e);if(!t.w||!t.h)return;const n=.71*t.w+32,i=.71*t.h+32,r=h.width/z||1;v.save(),v.setTransform(r*n,0,0,r*i,r*(t.x+t.w/2),r*(t.y+t.h/2));const s=v.createRadialGradient(0,0,0,0,0,1);s.addColorStop(0,"rgba(0,0,0,1)"),s.addColorStop(.72,"rgba(0,0,0,1)"),s.addColorStop(1,"rgba(0,0,0,0)"),v.globalCompositeOperation="destination-out",v.fillStyle=s,v.fillRect(-1,-1,2,2),v.restore()})(e.clear),F=.9*F+.1*(performance.now()-t),h.dataset.painted=""},j=e=>{if(M=0,L||E||!w||"undefined"!=typeof document&&document.hidden)return void(A=C=0);const t=P(),n=d.settings(),i=C?e-C:17;if(C=e,!t&&F>4.5&&i<12&&(S=!S))return void(M=requestAnimationFrame(j));const o=A?Math.min(.05,(e-A)/1e3):0;if(A=e,t||(O+=o*n.speed,R+=o),n.cursor&&a.x>=0){const e=h.getBoundingClientRect();e.width&&e.height&&(I.x+=.07*((a.x-e.left)/e.width-I.x),I.y+=.07*((a.y-e.top)/e.height-I.y))}else n.cursor||(I.x+=.07*(.5-I.x),I.y+=.07*(.5-I.y));T(),t||(M=requestAnimationFrame(j))},H=()=>{M||L||E||!w||(M=requestAnimationFrame(j))},W=()=>{if(L)return;const e=Math.min(2,"number"==typeof devicePixelRatio&&devicePixelRatio||1);z=Math.max(1,h.clientWidth||m.clientWidth||1),k=Math.max(1,h.clientHeight||m.clientHeight||1),h.width=Math.round(z*e),h.height=Math.round(k*e),v.setTransform(e,0,0,e,0,0),q=u,w&&!E&&T(),H()};W();const B="function"==typeof ResizeObserver?new ResizeObserver(W):null;B?.observe(m);const G="function"==typeof IntersectionObserver?new IntersectionObserver(([e])=>{w=e.isIntersecting,A=0,w?H():M&&(cancelAnimationFrame(M),M=0)},{rootMargin:"64px"}):null;G?.observe(m);const K=()=>{A=0,H()};document.addEventListener("visibilitychange",K);const X="function"==typeof matchMedia?matchMedia("(prefers-reduced-motion: reduce)"):null;X?.addEventListener?.("change",K),0===a.users++&&"function"==typeof addEventListener&&addEventListener("pointermove",c,{passive:!0});const Y="object"==typeof document.fonts?document.fonts:null,Z=()=>{L||!w||E||(T(),H())};Y?.addEventListener?.("loadingdone",Z),Y?.ready?.then(Z,()=>{});let D=0;const J=()=>{D||L||(D=requestAnimationFrame(()=>{D=0,L||(y=t(m),x(),P()&&T(),H())}))},N="function"==typeof matchMedia?matchMedia("(prefers-color-scheme: dark)"):null;N?.addEventListener?.("change",J);const Q="function"==typeof MutationObserver?new MutationObserver(J):null;for(const e of[document.documentElement,document.body])e&&Q?.observe(e,{attributes:!0,attributeFilter:["class","data-theme","data-mode","style"]});return{field:null,canvas:h,refresh(){L||(y=t(m),x(),P()&&w&&!E&&T(),H())},play(){E&&(E=!1,A=0,H())},pause(){E=!0,M&&cancelAnimationFrame(M),M=0},destroy(){L||(L=!0,M&&cancelAnimationFrame(M),D&&cancelAnimationFrame(D),M=D=0,B?.disconnect(),G?.disconnect(),Q?.disconnect(),document.removeEventListener("visibilitychange",K),X?.removeEventListener?.("change",K),N?.removeEventListener?.("change",J),Y?.removeEventListener?.("loadingdone",Z),0===--a.users&&"function"==typeof removeEventListener&&removeEventListener("pointermove",c),h.remove(),h.width=h.height=0,p.restore())}}}export{d as mountCanvas};//# sourceMappingURL=chunk-BR6ZNJZW.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{mountPageField as e}from"./chunk-BTD6EFAW.js";var r=(e,r)=>!1===e.cursor?"none":"string"==typeof e.cursor?e.cursor:r;function t(r,t,n,l){let o=null;if(o=e({host:r.host,kit:r.kit,layer:"under",glyphs:l&&(()=>l(r.settings())),look:e=>{const n=r.settings();return{...t(n,e),...n.look}},ink:e=>r.ink(e)??(e?n.dark:n.light),reducedMotion:r.reducedMotion,onFail:()=>{o=null,r.onFail()}}),!o)return null;const i=o.canvas;return{get field(){return o?.field??null},get canvas(){return o?.canvas??i},refresh(){o?.refresh()},play(){o?.field.play()},pause(){o?.field.pause()},destroy(){o?.destroy(),o=null}}}var n=()=>"number"==typeof innerWidth&&innerWidth<760,l={light:"#86847e",dark:"#7c7a74"},o={light:"#8f8d86",dark:"#64625d"},i=e=>({font:'"Geist Mono", ui-monospace, monospace',fontWeight:400,cellSize:e.cellSize,cellAspect:.62,glyphScale:.86}),s=e=>({cellSize:e.cellSize,cellAspect:1,dotScale:.68}),a={x:.18,y:.2,width:.64,height:.6,feather:.3,shape:"ellipse"};function c(e){const{scene:n,charset:o,hover:c,middle:d=a,feather:h=.3,graphite:u=l}=e,p=e.mark??"glyph";return{id:e.id,name:e.name,description:e.description,cellSize:e.cellSize,speed:e.speed??1,cursor:e.cursor??!0,opacity:e.opacity,mount(l){const a=t(l,(t,l)=>{const a=((e,r)=>e.mark??(e.charset||e.look?.charset?"glyph":r))(t,p);return{scene:n,color:"ink",shade:0,background:"transparent",vignette:0,speed:t.speed,maxPixelRatio:2,levels:"none",blend:"on",..."dot"===a?{mark:"dot",...s(t)}:{mark:"glyph",charset:t.charset??o,...i(t)},hover:r(t,c),lantern:{radius:.14,strength:.45,trail:.8,follow:9},trail:{strength:.8,radius:.35},fluid:{radius:.09,refraction:.03,glow:.6},clear:t.clear?{element:t.clear,padding:0,feather:h,shape:"ellipse"}:d,...e.tune?.(t,l)}},u,"dot"===p?e=>({...i(e),charset:o}):void 0);if(!a||!e.extra)return a;const g=e.extra(l,a),f=a.destroy.bind(a);return Object.assign(a,{destroy(){g(),f()}})}}}export{o as FIELD_GRAPHITE,r as hoverOf,t as mountField,n as narrow,c as scenePreset};//# sourceMappingURL=chunk-C3C7AYKL.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{mountPageField as e,pageHandle as t}from"./chunk-BTD6EFAW.js";import{styleKeeper as r,prefersReduced as o}from"./chunk-S7RZP2MT.js";var n="position:absolute;inset:0;width:100%;height:100%;object-fit:cover;border-radius:inherit;pointer-events:none";function s(s,i={}){const l={current:{...i}},a=r(),c=[],p=s.querySelector("video"),u=l.current.src??p??null,d=()=>l.current.reducedMotion??o();let y=null,h=0;y=u?e({host:s,layer:"over",look:()=>({mark:"glyph",scene:"none",charset:" .:-=+*#%@",font:'"Geist", Arial, sans-serif',fontWeight:500,cellSize:6,cellAspect:.8,glyphScale:.8,color:"ink",shade:0,contrast:1.25,levels:"auto",fit:"cover",focus:{x:.5,y:.5},hover:"trail",trail:{strength:.9,radius:.35},...l.current.look}),ink:()=>l.current.ink??"--ascii-ink-strong",source:u,label:l.current.label??"Video, drawn in characters",kit:l,ownPoster:!0,reducedMotion:()=>l.current.reducedMotion,onFail:()=>{y=null,a.restore(),v()},onRelease:()=>{f=!1,g(),u instanceof HTMLVideoElement&&u.pause?.()},onMount:()=>{h++&&(y?.field.ready.then(()=>{f=!0,g()}),k&&u instanceof HTMLVideoElement&&u.play?.()?.catch?.(()=>{}))}}):null,y&&u instanceof HTMLVideoElement&&(s.contains(u)&&a.set(u,"opacity","0"),u.muted=!0,u.loop=!0,u.playsInline=!0);let m=null;l.current.poster&&u&&(m=Object.assign(document.createElement("img"),{alt:"",decoding:"async"}),m.className="ascii-video-poster",m.setAttribute("aria-hidden","true"),m.setAttribute("style",`${n};transition:opacity 280ms cubic-bezier(.16, 1, .3, 1)`),m.src=l.current.poster,"static"===getComputedStyle(s).position&&a.set(s,"position","relative"),s.appendChild(m),c.push(m));let f=!1;const g=()=>{m&&(m.style.opacity=y&&f&&(k||!d())?"0":"1")};let b=null;function v(){!b&&u&&(u instanceof HTMLVideoElement?b=u:(b=document.createElement("video"),b.src=u,b.setAttribute("style",n),b.setAttribute("aria-label",l.current.label??"Video"),"static"===getComputedStyle(s).position&&a.set(s,"position","relative"),m?s.insertBefore(b,m):s.appendChild(b),c.push(b)),l.current.poster&&!b.poster&&(b.poster=l.current.poster),b.muted=!0,b.loop=!0,b.playsInline=!0,m&&(m.style.opacity="0"),k&&b.play?.()?.catch?.(()=>{}))}let k=l.current.autoplay??!(y?y.still():d());y?(y.field.ready.then(()=>{f=!0,k||y?.field.pause(),g()}),k&&u instanceof HTMLVideoElement&&u.play?.()?.catch?.(()=>{}),g()):v();const M=t(()=>y,l,e=>{m&&e.poster&&m.getAttribute("src")!==e.poster&&(m.src=e.poster),b&&e.poster&&(b.poster=e.poster)},{toggle:()=>(k?M.pause():M.play(),k),get playing(){return k}},()=>{c.forEach(e=>e.remove()),a.restore()}),E=M.play,A=M.pause;return M.play=()=>{y&&!M.supported||(k=!0,y?E():b?.play?.()?.catch?.(()=>{}),g())},M.pause=()=>{y&&!M.supported||(k=!1,y?A():b?.pause?.(),g())},M}export{s as asciiVideo};//# sourceMappingURL=chunk-C4KZYCPF.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{styleKeeper as t,mountSurface as e,easeOut as n,srOnly as o,handle as r,isDark as a}from"./chunk-S7RZP2MT.js";var i={tone:"neutral",live:!1,indicator:!0,sheen:!0},l={light:{green:[22,150,82],amber:[214,138,8],red:[214,52,52],neutral:[120,120,114],new:[255,255,255]},dark:{green:[120,240,170],amber:[255,206,110],red:[255,156,156],neutral:[200,200,192],new:[255,255,255]}},s={light:[[.03," "],[.08,"·"],[.13,"•"],[.18,"○"],[.5,"●"],[.56,"◐"],[.62,"◓"],[.68,"◑"],[.74,"◒"],[.8,"●"],[.88,"✧"],[2,"✦"]],dark:[[.02," "],[.06,"✦"],[.1,"✧"],[.2,"·"],[.3,"•"],[.38,"○"],[.64,"●"],[.68,"◐"],[.72,"◓"],[.76,"◑"],[.8,"◒"],[2,"●"]]},c=t=>Array.from({length:96},(e,n)=>t.find(([t])=>n/95<t)[1]).join(""),d={light:c(s.light),dark:c(s.dark)},h=["◐","◓","◑","◒"],u=["✧","·","✧","✦","✧","✦"],f=12;var p=(t,e)=>{return"green"===(n=t.dataset.tone)||"amber"===n||"red"===n||"neutral"===n||"new"===n?t.dataset.tone:e;var n};function m(t,e,n){return{x:t.x+2,y:Math.round((t.y+t.h/2)/n-.5)*n,w:Math.max(0,t.w-4)}}function x(t,e){const n=t=>t.toFixed(2),o=e/2,r=t.filter(t=>t.w>2*o).map(({x:t,y:r,w:a})=>`M${n(t+o)} ${n(r)}H${n(t+a-o)}A${n(o)} ${n(o)} 0 0 1 ${n(t+a-o)} ${n(r+e)}H${n(t+o)}A${n(o)} ${n(o)} 0 0 1 ${n(t+o)} ${n(r)}Z`).join("");return r?`path("${r}")`:"inset(50%)"}function M(c,M={}){const g={current:{...i,...M}},y=c instanceof HTMLElement?[c]:[...c],w=1===y.length,v=w?y[0]:y.length?function(t){let e=t[0].parentElement;for(;e&&!t.every(t=>e.contains(t));)e=e.parentElement;return e??document.body}(y):null,b=t(),k=new Map,$=new Map,E=new Map,C=new Map,S=[],A=t=>void 0!==t.dataset.count?"count":"new"===p(t,g.current.tone)?"new":"status",z=t=>void 0!==t.dataset.live?"false"!==t.dataset.live:g.current.live,F=(t=-1e6)=>{for(const e of y){const n=p(e,g.current.tone),o=k.get(e);o?o.to!==n&&k.set(e,{from:o.to,to:n,at:t}):k.set(e,{from:n,to:n,at:-1e6})}};F();const L=()=>I?.dark()??(!v||a(v))?"dark":"light",T=()=>({mark:"glyph",charset:d[L()],font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:f,cellAspect:1,glyphScale:1,color:"source",saturation:1,shade:0,...g.current.look}),j=()=>{const{cellSize:t=f,cellAspect:e=1}=T(),n=Math.min(2,globalThis.devicePixelRatio||1),o=Math.max(2,Math.round(t*n));return{ch:o/n,cw:Math.max(2,Math.round(o*e))/n}};let H=[0,0];const P=new Map;let I=null,R="";function q(){for(;S.length;)S.pop()();b.restore()}I=v?e({host:v,layer:w?"under":"over",look:T,ink:()=>g.current.ink,kit:g,reducedMotion:()=>g.current.reducedMotion,resolution:(t,e)=>{const{cw:n,ch:o}=j();return[Math.max(2,Math.round(2*t/n)),Math.max(2,Math.round(2*e/o))]},onFail:()=>{I=null,q()},onTheme:()=>I?.field.update({charset:d[L()]}),paint:({pen:t,now:e,still:o,dark:r,box:a,width:i,w:c})=>{const d=g.current,f=r?"dark":"light",p={...l[f],...d.tones?.[f]},M=(t,e)=>((t,e,n=.5)=>{const o=s[t],r=o.findIndex(([,t])=>t===e),a=r>0?o[r-1][0]:0;return a+(Math.min(o[r][0],1)-a)*n})(f,t,e),{cw:w,ch:S}=j(),F=i/c,L=(e,n,o,r)=>{r<=0||(t.fillStyle=function(t,e){const n=Math.max(1,...t),o=t.map(t=>t/n*255),r=(.2126*o[0]+.7152*o[1]+.0722*o[2])/255,a=Math.min(1,e/Math.max(r,.01));return`rgb(${o.map(t=>Math.round(Math.max(0,Math.min(255,t*a)))).join(" ")})`}(o,r),t.fillRect(Math.round((e+.5)*w*F)-1,Math.round((n+.5)*S*F)-1,2,2))};let T=!1;const q=y.map(t=>"count"!==A(t)&&d.indicator?t.querySelector("[data-dot]"):null),B=y.map((t,e)=>{const n=a(t),o=q[e]?a(q[e]):null,[r,i]=P.get(t)??[0,0],l=t=>({...t,x:t.x+H[0]-r,y:t.y+H[1]-i});return{b:l(n),dot:o&&l(o)}}),N=B.find((t,e)=>t.dot&&"status"===A(y[e]))??B.find(t=>t.dot)??B[0];if(N){const t=(t,e)=>{const n=((t-e/2)%e+e)%e;return n>.001?n-e:0},e=[N.dot?t(N.dot.x+N.dot.w/2,w):0,t(N.b.y+N.b.h/2,S)];(Math.abs(e[0]-H[0])>.01||Math.abs(e[1]-H[1])>.01)&&(H=e,I.canvas.style.translate=`${H[0].toFixed(2)}px ${H[1].toFixed(2)}px`)}const W=I.canvas.style,Z=(t,e,n)=>Math.max(1,Math.floor((t-e)/n))*n+"px",G=Z(v.clientWidth,H[0],w),O=Z(v.clientHeight,H[1],S);W.width===G&&W.height===O||(W.width=G,W.height=O,I.field.resize(),T=!0);const D=B.map((t,e)=>{const n=t=>({...t,x:t.x-H[0],y:t.y-H[1]});return((t,e,n,o,r)=>{const[a,i]=P.get(t)??[0,0],l=(t,e)=>Math.round((t-e/2)/e)*e+e/2-t,s=n?l(n.x+n.w/2,o):0,c=l(e.y+e.h/2,r);return(Math.abs(s-a)>.01||Math.abs(c-i)>.01)&&(P.set(t,[s,c]),b.set(t,"translate",`${s.toFixed(2)}px ${c.toFixed(2)}px`)),{b:{...e,x:e.x+s,y:e.y+c},dot:n&&{...n,x:n.x+s,y:n.y+c}}})(y[e],n(t.b),t.dot&&n(t.dot),w,S)}),J=D.map(t=>t.b).map(t=>m(t,0,S)),K=x(J,S);return K!==R&&(R=K,I.canvas.style.clipPath=K),y.forEach((t,r)=>{const i=J[r],l=A(t),s=Math.round(i.y/S),c=Math.ceil(i.x/w),d=Math.floor((i.x+i.w)/w)-1;var m,x,g;if(!(d<c))if("status"===l){const a=D[r].dot;if(!a)return;const i=k.get(t),l=e-i.at,u=o?1:n(l/240);u<1&&(T=!0);const y=(m=p[i.from],x=p[i.to],g=u,m.map((t,e)=>t+(x[e]-t)*g)),v=!o&&z(t),b=Math.floor((a.x+a.w/2)/w),$="light"===f?.55:.7,E="light"===f?.35:.25;let C="neutral"===i.to?M("○"):"amber"===i.to&&z(t)?M("◐"):M("●",$);"red"===i.to&&!o&&l<640?(T=!0,Math.floor(l/160)%2==0&&(C=M("○"))):v&&"amber"===i.to?(T=!0,C=M(h[Math.floor((e+90*r)/130)%4])):v&&(T=!0,C=M("●",$-E*Math.cos((e+500*r)/2200*Math.PI*2))),b>=c&&b<=d&&L(b,s,y,C)}else if("new"===l){const n=D[r].dot;if(!n)return;const a=(e-($.get(t)??-1e6))/720,i=Math.floor((n.x+n.w/2)/w);a<1&&!o&&(T=!0),i>=c&&i<=d&&L(i,s,p.new,M(a<1&&!o?u[Math.floor(a*u.length)]:"✦"))}else{const r=E.get(t),i=C.get(t)?.digits.children;if(!i)return;if((r?(e-r.at)/600:1)>=1||o){for(const t of i)t.style.opacity="",t.style.translate="";return}T=!0,[...i].forEach((t,o)=>{if(!r.changed[o])return;const i=t,l=a(i),h=(e-r.at-70*o)/460,u=n((h-.72)/.28);if(i.style.opacity=String(u),i.style.translate=`0 ${3*(u-1)}px`,h<=0||h>=.78)return;const f=Math.min(d,Math.max(c,Math.floor((l.x+l.w/2)/w)));L(f,s,p.neutral,M(["·","•","○","●"][Math.floor(9*h)%4]))})}}),T}}):null;const B=t=>[...t].map(t=>Object.assign(document.createElement("span"),{textContent:" "===t?"":t}));if(I){w||(I.canvas.style.zIndex="1");for(const t of y){if("count"===A(t)){const e=(t.textContent??"").trim(),n=[...t.childNodes],r=o(e),a=document.createElement("span");a.setAttribute("aria-hidden","true"),b.set(a,"display","inline-flex"),a.replaceChildren(...B(e)),t.replaceChildren(r,a),C.set(t,{text:e,live:r,digits:a}),S.push(()=>{const o=C.get(t)?.text??e;o===e?t.replaceChildren(...n):t.textContent=o})}else if(g.current.indicator&&!t.querySelector("[data-dot]")){const e=document.createElement("span");e.dataset.dot="",e.setAttribute("aria-hidden","true"),e.setAttribute("style",`display:inline-block;flex:none;width:${f}px;height:${f}px;margin-inline-end:4px;vertical-align:middle`),t.prepend(e),S.push(()=>e.remove())}if(!w)for(const e of[...t.childNodes])if(3===e.nodeType&&e.textContent?.trim()){const t=document.createElement("span");e.parentElement.insertBefore(t,e),t.appendChild(e),S.push(()=>{t.parentElement?.insertBefore(e,t),t.remove()}),N(t)}else e instanceof HTMLElement&&void 0===e.dataset.dot&&N(e)}C.size&&document.fonts?.ready.then(()=>I?.kick()),v.addEventListener("pointermove",G),v.addEventListener("pointerleave",O)}function N(t){"static"===getComputedStyle(t).position&&b.set(t,"position","relative"),b.set(t,"z-index","2")}function W(t){const e=performance.now();for(const n of t?[t]:y.filter(t=>"new"===A(t)))$.set(n,e);I?.kick()}let Z=null;function G(t){const e=t.target,n=y.find(t=>e&&t.contains(e))??null;n!==Z&&(Z=n,n&&"new"===A(n)&&g.current.sheen&&W(n))}function O(){Z=null}return r(()=>I,g,()=>{F(performance.now()),I?.refresh()},{sheen:W,count:(t,e)=>{const n=e??y.find(t=>"count"===A(t));if(!n)return;const o=String(t),r=C.get(n);if(!r)return void(n.textContent=o);if(o===r.text)return;const a=Math.max(o.length,r.text.length),i=r.text.padStart(a," "),l=o.padStart(a," "),s=I?.still()??!0;r.text=o,r.live.textContent=o,r.digits.replaceChildren(...B(l)),E.set(n,{at:s?-1e6:performance.now(),changed:[...l].map((t,e)=>t!==i[e])}),I?.kick()},refresh:()=>{F(performance.now()),I?.kick()}},()=>{v?.removeEventListener("pointermove",G),v?.removeEventListener("pointerleave",O),q()})}var g=i;export{g as PILL_DEFAULTS,l as PILL_TONES,x as laneClip,M as pill,m as pillLane,p as pillTone};//# sourceMappingURL=chunk-DFOWXOZR.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{scenePreset as e}from"./chunk-C3C7AYKL.js";var a=e({id:"cascade",name:"Cascade",description:"Streaks fall in three depths: far ones faint and slow, near ones rare, bright and quick.",cellSize:11,scene:"cascade",charset:" .:;|",hover:"lantern",tune:()=>({blend:"off"}),middle:{x:.22,y:.25,width:.56,height:.5,feather:.3,shape:"ellipse"}});export{a as cascade};//# sourceMappingURL=chunk-DZ5XGHTJ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{renderMaterial as t}from"./chunk-XPXMCXYI.js";import{mountCanvas as i}from"./chunk-BR6ZNJZW.js";var n=(t,i,n,e)=>{const r=7*i+.55*Math.sin(2.2*t+.09*e)+.22*Math.sin(4.8*t-.07*e),o=.5+.5*Math.sin(r);return Math.pow(o,5)*(.35+.65*i)+.08*Math.pow(.5+.5*Math.sin(17*r),3)*o},e={id:"dune",name:"Dune",description:"Layered sand ridges with slow-moving light and fine grain.",cellSize:12,speed:1,cursor:!1,mount:e=>i(e,(i,e,r,o,h,s)=>t(n,i,e,r,o,{ditherStrength:s.ditherStrength,fontSize:s.fontSize,chars:s.chars,lightMode:s.lightMode,color:s.ink}))};export{e as dune};//# sourceMappingURL=chunk-E3TUOX2A.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{styleKeeper as t,clamp as e,mountSurface as o,handle as r,house as n}from"./chunk-S7RZP2MT.js";var a={aurora:["#2ee6c8","#9d7bff","#ff6fb5"],brand:["#ffb000","#ffd84d"]},i={palette:"aurora",swell:!0},l=t=>"mono"===t?[]:"string"==typeof t?[...a[t]??a.aurora]:[...t];function s(t,o){if(1===t.length)return t[0];const r=e(o)*(t.length-1),n=Math.min(t.length-2,Math.floor(r)),a=r-n,[i,l]=[t[n],t[n+1]].map(t=>[1,3,5].map(e=>parseInt(t.slice(e,e+2),16)||0));return`rgb(${i.map((t,e)=>Math.round(t+(l[e]-t)*a)).join(" ")})`}function c(t,o,r,n,a,i){const l=t=>{const o=Math.round(255*e(t)/2.2);return`rgb(${o} ${o} ${o})`},c=o/2,d=r/2,h=.36/(.92-.16*a)*Math.min(o,r),u=.86+.46*a,f=n*(.25+.6*a),p=t.createRadialGradient(c,d,.92*h,c,d,1.3*h);p.addColorStop(0,l(.36*u)),p.addColorStop(1,"#000"),t.fillStyle=p,t.fillRect(0,0,o,r),t.save(),t.beginPath(),t.arc(c,d,h,0,2*Math.PI),t.clip();const g=c+.8*Math.cos(f)*h*.62,m=d-.55*h*.62,M=t.createRadialGradient(g,m,0,g,m,1.7*h);M.addColorStop(0,l(.95*u)),M.addColorStop(.55,l(.5*u)),M.addColorStop(1,l(.18)),t.fillStyle=M,t.fillRect(c-h,d-h,2*h,2*h),t.globalCompositeOperation="lighter",t.lineWidth=Math.max(1.5,.05*h);for(let e=0;e<6;e++){const o=e/6*Math.PI+.35*n,r=Math.sin(o);r<0||(t.strokeStyle=l(.16*r),t.beginPath(),t.ellipse(c,d,h*Math.abs(Math.cos(o)),h,0,0,2*Math.PI),t.stroke())}const S=t.createRadialGradient(c,d,.7*h,c,d,h);if(S.addColorStop(0,"#000"),S.addColorStop(1,l(.3)),t.fillStyle=S,t.fillRect(c-h,d-h,2*h,2*h),t.restore(),t.globalCompositeOperation="source-over",!i.length)return;t.globalCompositeOperation="color";const k=.4*n,v=.5*a,y=t.createLinearGradient(c-Math.cos(k)*h,d-Math.sin(k)*h,c+Math.cos(k)*h,d+Math.sin(k)*h);y.addColorStop(0,s(i,v)),y.addColorStop(.5,s(i,v+.25)),y.addColorStop(1,s(i,v+.5)),t.fillStyle=y,t.fillRect(0,0,o,r),t.globalCompositeOperation="source-over"}function d(a,s={}){const d={current:{...i,...s}},h=t();let u="idle",f=0,p=e(d.current.level??0),g=p,m=0,M=0,S=l(d.current.palette),k=null,v=null,y=0;const b=t=>{t.canvas.style.filter=!t.dark()&&S.length?"brightness(.68) saturate(1.35)":""},C=t=>{a.style.setProperty("--ascii-level",t.toFixed(3)),d.current.swell&&h.set(a,"scale",String(1+.1*t))};k=o({host:a,outset:Math.round(.08*(a.offsetWidth||0)),look:()=>({mark:"glyph",charset:" .:-=+*#%@",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:6,cellAspect:.62,glyphScale:.92,fit:"cover",color:S.length?"source":"ink",contrast:2.2,brightness:1.1-.5,saturation:1.4,...d.current.look}),ink:()=>d.current.ink??"--ascii-ink-strong",kit:d,reducedMotion:()=>d.current.reducedMotion,onTheme:()=>k&&b(k),onFail:()=>{k=null},paint:({pen:t,w:o,h:r,now:a,still:i})=>{const l=M?Math.min(64,a-M):16;M=a;const s=e((t=>"listening"===u?v?v.read():p:"thinking"===u?.2+.1*Math.sin((t-f)/120):"done"===u?m*(1-n(e((t-f)/420))):p)(a));return i||"done"===u?g=s:g+=(s-g)*(1-(1-(s>g?.45:.12))**(l/16.7)),i||C(g),c(t,o,r,i?0:a/1e3,g,S),!0}}),k&&b(k);const w=()=>{y++,v&&(v.stream.getTracks().forEach(t=>t.stop()),v.context.close().catch(()=>{}),v=null)},P=t=>{"listening"!==t&&w(),"done"===t&&(m=g),u=t,f=performance.now(),a.dataset.state=t,k||C("listening"===t?p:0),k?.kick()};return r(()=>k,d,t=>{S=l(t.palette),void 0!==t.level&&(p=e(t.level)),k?.refresh(),k&&b(k)},{level(t){p=e(Number.isFinite(t)?t:0),k||"listening"!==u||C(p),k?.kick()},listen:()=>P("listening"),think:()=>P("thinking"),done:()=>P("done"),idle:()=>{p=0,P("idle")},async mic(){w();const t=y,e="undefined"!=typeof navigator?navigator.mediaDevices:void 0,o=globalThis.AudioContext;if(!e?.getUserMedia||!o)return!1;let r;try{r=await e.getUserMedia({audio:!0})}catch{return!1}if(t!==y)return r.getTracks().forEach(t=>t.stop()),!1;const n=new o,a=n.createAnalyser();a.fftSize=1024,n.createMediaStreamSource(r).connect(a);const i=new Uint8Array(a.fftSize);return v={stream:r,context:n,read(){a.getByteTimeDomainData(i);let t=0;for(const e of i)t+=((e-128)/128)**2;return 5*Math.sqrt(t/i.length)}},P("listening"),!0},get state(){return u},get current(){return g}},()=>{w(),h.restore(),a.style.removeProperty("--ascii-level"),delete a.dataset.state})}var h=i;export{h as VOICE_ORB_DEFAULTS,a as VOICE_PALETTES,c as paintOrb,d as voiceOrb};//# sourceMappingURL=chunk-ENTDGT2V.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{injectStyle as e}from"./chunk-4OT66HSZ.js";import{mountSurface as t,hash as n,handle as r,prefersReduced as i,clamp as o,house as a,smoothstep as s}from"./chunk-S7RZP2MT.js";var l={caret:!0,settle:60,stagger:18,reasoningLines:2,transition:"flicker",roll:300,glyphs:"#%*+=-:"},c="cubic-bezier(.16, 1, .3, 1)",d=`\n:where(.ascii-reasoning){display:grid;grid-template-rows:1fr;transition:grid-template-rows 260ms ${c},opacity 200ms ${c}}\n:where(.ascii-reasoning[data-collapsed]){grid-template-rows:0fr;opacity:0}\n:where(.ascii-reasoning-in){min-height:0;overflow:hidden}\n:where(.ascii-reasoning ol){height:calc(var(--ascii-reasoning-lines, 2) * 1.5em);margin:0 0 .5em;padding:0;list-style:none;overflow:hidden;-webkit-mask-image:linear-gradient(to bottom,transparent,#000 45%);mask-image:linear-gradient(to bottom,transparent,#000 45%)}\n:where(.ascii-reasoning li){height:1.5em;line-height:1.5em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;opacity:.62;translate:0 calc(var(--ascii-reasoning-shift, 0) * -1.5em);transition:translate 240ms ${c},opacity 200ms ${c}}\n:where(.ascii-reasoning li[data-new]){opacity:0}\n@media (prefers-reduced-motion: reduce){:where(.ascii-reasoning, .ascii-reasoning li){transition:none}}\n`,p=.7,h=e=>[...e.children].filter(e=>"IMG"===e.tagName&&void 0!==e.dataset?.asciiPoster);function u(c,u={}){const m={current:{...l,...u}},g=[...c.childNodes];let f="idle",y="",x=[],w=null,v=0,b=null,k=null,M=null;const S=()=>{const e=getComputedStyle(c),t=parseFloat(e.fontSize)||15,n=parseFloat(e.lineHeight),r=Number.isFinite(n)&&n>0?n:1.5*t;return{size:t,line:r,ch:r/2,cw:Math.max(2,Math.round(.44*t))}},C="roll"===m.current.transition;let A=null,$=null;const P=e=>{f!==e&&(f=e,"done"!==e&&"stopped"!==e||(A?.setAttribute("data-collapsed",""),A?.setAttribute("aria-hidden","true")),"streaming"===e?c.setAttribute("aria-busy","true"):c.removeAttribute("aria-busy"),m.current.onState?.(e))},E=e=>{e.span.style.removeProperty("color"),e.span.style.removeProperty("opacity")},z=()=>{x.forEach(E),x=[],"streaming"===f&&b&&P("done"),b?.(),b=null};if(M=t({host:c,look:()=>{if(C){return{mark:"glyph",charset:" .:-=+*#%@",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:S().size<24?2:3,cellAspect:.66,glyphScale:1,shade:.2,contrast:1.1,...m.current.look}}const{ch:e,cw:t}=S();return{mark:"glyph",charset:" :-=+*#%@",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:e,cellAspect:t/e,glyphScale:1,shade:.6,...m.current.look}},ink:()=>m.current.ink??getComputedStyle(c).color,kit:m,reducedMotion:()=>m.current.reducedMotion,onFail:()=>{M=null,z()},resolution:C?2:1,paint:({pen:e,now:t,still:r,box:i,scale:l})=>{if(C)return((e,t,r,i,l)=>{const d=getComputedStyle(c),p=parseFloat(d.fontSize)||15,{line:h}=S(),u=`${d.fontStyle} ${d.fontWeight} ${d.fontSize} ${d.fontFamily}`;e.setTransform(l,0,0,l,0,0),e.textAlign="left",e.textBaseline="alphabetic",e.font=u;const g=e.measureText("x"),y=g.fontBoundingBoxAscent||.8*p,v=g.fontBoundingBoxDescent||.2*p;r&&(x.forEach(E),x=[]);const k=m.current;if(x=x.filter(r=>{if(t>=r.at)return E(r),!1;const l=o((t-r.from)/Math.max(1,r.at-r.from)),c=a(l),d=i(r.span);if(r.span.style.setProperty("opacity",s(.72,1,l).toFixed(3)),l<=0)return!0;const m=d.y+(d.h-h)/2,g=m+(h-y-v)/2+y,f=3+r.seed%3,x=[...Array.from({length:f},(e,t)=>k.glyphs[Math.floor(n(t,r.seed)*k.glyphs.length)]??""),r.span.textContent??""],w=(1-c)*(x.length-1)*h;return e.save(),e.beginPath(),e.rect(d.x-2,m,d.w+4,h),e.clip(),e.globalAlpha=1-s(.72,1,l),x.forEach((t,n)=>{const r=g+(n-(x.length-1))*h+w;if(r<m-h||r>m+2*h)return;const i=n===x.length-1;e.font=i?u:`600 ${.84*p}px "Geist Mono", ui-monospace, monospace`,e.fillStyle=i?"#fff":"#d0d0d0",e.fillText(t,d.x+(i?0:(d.w-e.measureText(t).width)/2),r)}),e.restore(),!0}),e.globalAlpha=1,!x.length&&b&&z(),k.caret&&"idle"!==f&&(w||"streaming"===f)){const n=x.find(e=>e.from>t),r=n?n.span.previousElementSibling:w,o=r?i(r):{x:0,y:0,w:0,h:h},a=o.y+(o.h-h)/2;e.fillStyle="streaming"===f?"#fff":"rgb(178.5 178.5 178.5)",e.fillRect(o.x+o.w+.18*p,a+.2*h,Math.max(2,.5*p),.6*h)}return x.length>0})(e,t,r,i,l);const{line:d,ch:h,cw:u,size:g}=S(),y=Math.floor(t/48),v=d/4,k=(t,n)=>{const r=Math.floor((t.y-v+t.h/2)/d)*d+v+(d-h)/2,i=Math.round(t.x/u),o=Math.round(255*n);e.fillStyle=`rgb(${o} ${o} ${o})`,e.fillRect(i*u,r,Math.max(1,Math.round((t.x+t.w)/u)-i)*u,h)};if(r&&(x.forEach(E),x=[]),x=x.filter(e=>t>=e.at?(E(e),!1):(k(i(e.span),.55+.45*n(y,e.seed)),!0)),!x.length&&b&&z(),m.current.caret&&"idle"!==f&&(w||"streaming"===f)){const e=w?i(w):{x:0,y:v,w:0,h:d},t=Math.round((e.x+e.w+.3*g)/u)*u;k({x:t,y:e.y,w:u,h:e.h},"streaming"===f?1:p)}return x.length>0}}),M){const e=getComputedStyle(c),t=M.canvas.style,n=e=>parseFloat(e??"")||0,{line:r}=S(),i=n(e.paddingTop)-r/4,o=n(e.paddingRight)-r/2,a=n(e.paddingBottom)-r/4,s=n(e.paddingLeft);t.top=`${i}px`,t.left=`${s}px`,t.width=`calc(100% - ${s+o}px)`,t.height=`calc(100% - ${i+a}px)`}return r(()=>M,m,()=>M?.refresh(),{write:e=>{if(!e)return;"streaming"!==f&&("idle"===f&&(c.replaceChildren(...h(c)),M&&c.appendChild(M.canvas)),k=null,P("streaming")),y+=e;const t=e=>c.appendChild(e);if(!M)return void t(document.createTextNode(e));const n=performance.now(),r=m.current,i=M.still();let o=0;for(const a of e.match(/\s+|\S/g)??[]){if(/^\s/.test(a)){t(document.createTextNode(a));continue}const e=document.createElement("span");if(e.textContent=a,!i)if(C){const t=x.length?x[x.length-1].from+r.stagger:n,i=Math.max(n,t);e.style.setProperty("opacity","0"),x.push({span:e,from:i,at:i+r.roll,seed:31*v+o})}else e.style.setProperty("color","transparent"),x.push({span:e,from:n,at:n+r.settle+o*r.stagger,seed:31*v+o});t(e),w=e,o++}v++,M.kick()},done:()=>k||("streaming"!==f?Promise.resolve():(k=new Promise(e=>{b=e}),M&&x.length?M.kick():z(),k)),stop(){if("idle"===f&&A)return k=null,P("stopped"),void M?.kick();"streaming"===f&&(x.forEach(E),x=[],P("stopped"),b?.(),b=null,M?.kick())},reasoning:t=>{if(!t||"undefined"==typeof document)return;if(!A||!$){e("ascii-kit-reasoning",d),A=document.createElement("div"),A.className="ascii-reasoning";const t=document.createElement("div");t.className="ascii-reasoning-in",$=document.createElement("ol"),t.appendChild($),A.appendChild(t),c.parentElement?.insertBefore(A,c)}A.removeAttribute("data-collapsed"),A.removeAttribute("aria-hidden");const n=Math.max(1,Math.round(m.current.reasoningLines));A.style.setProperty("--ascii-reasoning-lines",String(n));const r=document.createElement("li");r.textContent=t;const o=m.current.reducedMotion??i();o||r.setAttribute("data-new",""),$.appendChild(r);const a=A,s=String(Math.max(0,$.children.length-n));o?a.style.setProperty("--ascii-reasoning-shift",s):(getComputedStyle(r).translate,requestAnimationFrame(()=>{r.removeAttribute("data-new"),a.style.setProperty("--ascii-reasoning-shift",s)}))},reset(){x=[],y="",w=null,v=0,A?.remove(),A=$=null,b?.(),b=null,k=null,c.replaceChildren(...h(c)),M&&c.appendChild(M.canvas),P("idle"),M?.kick()},get state(){return f},get text(){return y}},()=>{b?.(),b=null,A?.remove(),A=$=null,c.removeAttribute("aria-busy"),y?c.textContent=y:c.replaceChildren(...g)})}var m=l;export{m as STREAM_TEXT_DEFAULTS,u as streamText};//# sourceMappingURL=chunk-FR3ZJNOY.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{scenePreset as e}from"./chunk-C3C7AYKL.js";var r=e({id:"aurora",name:"Aurora",description:"Curtains of light at three depths hang from the top in tall vertical rays, brightest along their hems.",cellSize:11,scene:"aurora",charset:" .:¦|",hover:"lantern",tune:()=>({blend:"off"}),middle:{x:.2,y:.42,width:.6,height:.5,feather:.3,shape:"ellipse"}});export{r as aurora};//# sourceMappingURL=chunk-FUI5AVIF.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{easeOut as t,styleKeeper as e,mountSurface as n,smoothstep as r,handle as o,boxIn as i,clamp as a}from"./chunk-S7RZP2MT.js";var l={tabs:'[role="tab"]',duration:440,panels:"hidden",manage:!0};function c(e,n,r){const o=Math.sign(n.x+n.w/2-(e.x+e.w/2))||1,i=t(r/.78,4),a=t((r-.14)/.86,4);return{left:e.x+(n.x-e.x)*(o>0?a:i),right:e.x+e.w+(n.x+n.w-e.x-e.w)*(o>0?i:a),dir:o}}function s(t,e,n=20){const r=Math.max(0,Math.floor((t-2*n)/e));return{n:r,x0:(t-r*e)/2}}function u(u,d={}){const h={current:{...l,...d}},x=()=>[...u.querySelectorAll(h.current.tabs)],f=x().findIndex(t=>"true"===t.getAttribute("aria-selected"));let g=Math.max(0,h.current.active??(f>=0?f:0)),p=-1e6,v=null,y=null;const b=e(),m=()=>({mark:"glyph",charset:" .:-=+*#%@",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:6,cellAspect:.62,glyphScale:.96,blend:"off",...h.current.look}),M=t=>{const e=i(u,t);return{...e,x:e.x-u.clientLeft,y:e.y-u.clientTop}},w=t=>{y=t;const e=t=>Math.round(100*t)/100+"px";b.set(u,"--tabs-x",e(t.x)),b.set(u,"--tabs-y",e(t.y)),b.set(u,"--tabs-w",e(t.w)),b.set(u,"--tabs-h",e(t.h))},k=()=>{const t=x()[g];t&&w(M(t))};let A=null;A=n({host:u,layer:"under",look:m,ink:()=>h.current.ink??"--ascii-ink",kit:h,reducedMotion:()=>h.current.reducedMotion,onFail:()=>{A=null,k()},paint:({pen:e,now:n,still:o})=>{const i=x()[g];if(!i)return!1;const l=M(i),u=o||!v?1:a((n-p)/h.current.duration),d=u<1?c(v,l,u):{left:l.x,right:l.x+l.w,dir:1},f={x:d.left,y:l.y,w:d.right-d.left,h:l.h};w(f),u>=1&&(v=null);const y=m(),b=Math.min(2,globalThis.devicePixelRatio||1),k=Math.max(2,Math.round((y.cellSize??6)*b)),$=k/b,E=Math.max(2,Math.round(k*(y.cellAspect??.62)))/b,{n:S,x0:L}=s(f.w,E),R=t=>u<1?t:Math.round(t*b)/b,z=R(f.x+L),F=R(f.y+f.h-7-$),P=(z%E+E)%E-E,I=(F%$+$)%$-$,O=A.canvas,T=`${P.toFixed(3)}px ${I.toFixed(3)}px`;O.style.translate!==T&&(O.style.translate=T);const H=t=>`${Math.max(0,t).toFixed(2)}px`,W=z-P,j=F-I,q=`inset(${H(j)} ${H(O.clientWidth-W-S*E)} ${H(O.clientHeight-j-$)} ${H(W)})`;O.style.clipPath!==q&&(O.style.clipPath=q);const B=u<1?1-t(u,2):0;for(let t=0;t<S;t++){const n=S>1?t/(S-1):.5,o=d.dir>0?n:1-n,i=r(0,.42,1-Math.abs(2*n-1))*(.5+B*(.5*o**1.4-.2));e.fillStyle=`rgb(${Math.round(255*i)} ${Math.round(255*i)} ${Math.round(255*i)})`,e.fillRect(z-P+t*E,F-I,E,$)}return u<1}});const $=()=>{const t=h.current;x().forEach((e,n)=>{const r=n===g;t.manage&&(e.setAttribute("aria-selected",String(r)),e.tabIndex=r?0:-1);const o=e.getAttribute("aria-controls")?document.getElementById(e.getAttribute("aria-controls")):null;o&&"none"!==t.panels&&("hidden"===t.panels?o.hidden=!r:o.toggleAttribute("data-active",r))})},E=(t,e=!1)=>{const n=x();if(!n.length)return;const r=(t%n.length+n.length)%n.length;e&&n[r].focus(),r!==g&&(v=y??M(n[g]),g=r,p=performance.now(),$(),A&&!A.still()||(v=null,k()),A.kick(),h.current.onChange?.(r,n[r]))},S=t=>{if(!h.current.manage)return;const e=t.target.closest?.(h.current.tabs),n=e?x().indexOf(e):-1;n>=0&&E(n)},L=t=>{if(!h.current.manage)return;const e={ArrowRight:g+1,ArrowLeft:g-1,Home:0,End:x().length-1};t.key in e&&(t.preventDefault(),E(e[t.key],!0))},R="function"==typeof ResizeObserver?new ResizeObserver(()=>{A?.live||k()}):null;return R?.observe(u),u.addEventListener("click",S),u.addEventListener("keydown",L),$(),k(),o(()=>A,h,t=>{void 0!==t.active&&t.active!==g&&E(t.active),$(),A?.refresh()},{select:E,get active(){return g}},()=>{u.removeEventListener("click",S),u.removeEventListener("keydown",L),R?.disconnect(),b.restore()})}var d=l;export{d as TABS_DEFAULTS,s as indicatorRow,c as streamSpan,u as tabs};//# sourceMappingURL=chunk-G57QACJG.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{parseColor as t,hash2 as o}from"./chunk-ZCHGV2CV.js";import{mountCanvas as e}from"./chunk-BR6ZNJZW.js";function n(e,n,c,i,a={x:.5,y:.5},r={}){const{fontSize:l=13,chars:s=" ·:;=+*#%@",color:h,accentColor:f,speed:M=1,radius:$=.38,swirl:d=3,lightMode:g=!1}=r,m=f??(g?"#6b8700":"#d4ff00"),p=.62*l,u=1.4*l,x=Math.ceil(n/p),b=Math.ceil(c/u),S=n/c;e.clearRect(0,0,n,c),e.font=`${l}px monospace`,e.textBaseline="top";let y=255,z=255,C=255;if(g&&(y=55,z=55,C=55),h){const o=t(h);o&&(y=o.r,z=o.g,C=o.b)}let k=212,v=255,w=0;const V=t(m);V&&(k=V.r,v=V.g,w=V.b);const Z=i*M;for(let t=0;t<b;t++){const n=t/b;for(let c=0;c<x;c++){const i=(c/x-a.x)*S,r=n-a.y,l=Math.sqrt(i*i+r*r)/$;if(l>1){const n=o(3*c,7*t)*Math.max(0,1-3*(l-1));if(n<.62)continue;const i=n*(g?.28:.04);e.fillStyle=`rgba(${y},${z},${C},${i})`,e.fillText(s[1],c*p,t*u);continue}const h=Math.max(0,1-Math.abs(l-(.15+.12*Math.sin(1.1*Z)))/.07),f=Math.pow(1-l,2.2),M=Math.min(1,f+.6*h);if(M<.06)continue;const d=Math.floor(M*(s.length-1)),m=s[Math.min(s.length-1,d)],b=h>.35||l<.08,V=g?.85*M:.18*M;e.fillStyle=b?`rgba(${k},${v},${w},${g?.95:.38})`:`rgba(${y},${z},${C},${V})`,e.fillText(m,c*p,t*u)}}}var c={id:"void",name:"Void",description:"A gravity well that spirals characters around the cursor.",cellSize:13,speed:1,cursor:!0,mount:t=>e(t,(t,o,e,c,i,a)=>n(t,o,e,c,i,{fontSize:a.fontSize,chars:a.chars,lightMode:a.lightMode,color:a.ink,accentColor:a.accent}))};export{n as renderVoidBackground,c as voidWell};//# sourceMappingURL=chunk-H2UZBVKE.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{driftNoise as t}from"./chunk-ZRJVOUWH.js";import{styleKeeper as e,mountSurface as r,handle as i}from"./chunk-S7RZP2MT.js";var a=680,n=12,o={preview:[{k:.55,blur:6},{k:.8,blur:2.5}],final:{k:1,blur:0}},l=t=>.5-.5*Math.cos(Math.PI*Math.min(1,Math.max(0,t))),s=t=>{const e=t/1e3;return e<60?`${e.toFixed(1)}s`:`${Math.floor(e/60)}:${String(Math.floor(e%60)).padStart(2,"0")}`},m=async t=>{if("function"==typeof createImageBitmap)return createImageBitmap("string"==typeof t?await(await fetch(t)).blob():t);const e=new Image;return e.crossOrigin="anonymous",e.src="string"==typeof t?t:URL.createObjectURL(t),await e.decode(),e};function c(c,u={}){const g={current:{...u}},h=e(),f=document.createElement("canvas");let b="idle",p=0,d=0,k="",M=null;const w={from:{img:null,k:0,blur:n},to:{img:null,k:0,blur:n},at:-1e6},y=()=>void 0===g.current.image?c.querySelector("img"):g.current.image,v=(t,e)=>{const r=e?1:l((t-w.at)/a),i="generating"===b&&!e&&w.to.img?1-.45*(1-Math.exp(-Math.max(0,t-w.at)/1600)):1,n=(w.from.blur+(w.to.blur-w.from.blur)*r)*i,o=(w.from.img?w.from.k:0)+((w.to.img?w.to.k:0)-(w.from.img?w.from.k:0))*r;return w.to.img??w.from.img?[{img:w.from.img,k:o,blur:n,mix:1},{img:w.to.img,k:o,blur:n,mix:w.from.img?r:1}].filter(t=>t.img):[]},x=(t,e,r)=>{const i=performance.now(),o=M?.still()?1:l((i-w.at)/a),[s]=v(i,!!M?.still());w.from={img:(o>=.5?w.to.img:w.from.img)??w.to.img??w.from.img,k:s?.k??0,blur:s?.blur??n},w.to={img:t,k:e,blur:r},w.at=i,M?.kick()};M=r({host:c,layer:"under",look:()=>({blend:"coarse",mark:"glyph",charset:" .:-=+*#%@",font:'"Geist", Arial, sans-serif',fontWeight:500,cellSize:7,cellAspect:.8,glyphScale:.8,contrast:1.4,drift:.5,speed:.6,hover:"trail",trail:{strength:.9,radius:.35},...g.current.look}),ink:()=>g.current.ink??"--ascii-ink-strong",kit:g,reducedMotion:()=>g.current.reducedMotion,resolution:(t,e)=>{const r=Math.min(480,Math.max(2,Math.round(t)));return[r,Math.max(2,Math.round(r*e/Math.max(1,t)))]},onFail:()=>{M=null,h.restore()},paint:({pen:e,width:r,height:i,now:n,still:o})=>{const l="generating"===b,m=o?0:(n-p)/1e3;l&&g.current.elapsed&&(g.current.elapsed.textContent=s(n-p));const c=l&&!o?1+.12*Math.sin(2.1*m)*(.7+.3*Math.sin(.37*m)):1,u=Math.max(2,Math.ceil(24*i/Math.max(1,r)));24===f.width&&f.height===u||(f.width=24,f.height=u),t(f,3.1+(l?.55*m:0),.35);const h=v(n,o),d=Math.min(1,h[0]?.k??0);e.imageSmoothingEnabled=!0,e.globalAlpha=Math.max(0,1-d),e.filter=`brightness(${1.7*c})`,e.drawImage(f,0,0,r,i);for(const{img:t,k:a,blur:n,mix:o=1}of h){if(!t||a<=0||o<=0)continue;const l=t.width,s=t.height,m=Math.min(s,l*i/r),c=Math.min(l,s*r/i);e.globalAlpha=Math.min(1,1.25*a)*o,e.filter=`brightness(1.3) blur(${n*r/480}px)`,e.drawImage(t,(l-c)/2,Math.max(0,.45*(s-m)),c,m,0,0,r,i)}const k=l&&!o?.6*Math.min(1,d)*(1-Math.max(0,d-.8)/.2):0;return k>.01&&(e.globalCompositeOperation="lighter",e.globalAlpha=k,e.filter=`brightness(${.9*c})`,e.drawImage(f,0,0,r,i),e.globalCompositeOperation="source-over"),e.filter="none",e.globalAlpha=1,l||n-w.at<a}});const R=(t,e)=>{b=t,c.dataset.state=t,c.setAttribute("aria-busy",String("generating"===t)),g.current.onState?.(t,e)},A=t=>{const e=y();e&&M&&(h.set(e,"transition",M.still()?"none":`opacity ${t?560:440}ms cubic-bezier(.45, 0, .25, 1)`),h.set(e,"opacity",t?"1":"0"))},S=t=>new Promise(e=>setTimeout(e,t)),U=t=>{const e=y();e&&(k&&URL.revokeObjectURL(k),k="string"==typeof t?"":URL.createObjectURL(t),e.src=k||t,M||h.set(e,"visibility","visible"))},L=async(t=g.current.stream)=>{if(!t)return b;const e=++d,r=()=>e===d,i=!!M?.still();p=performance.now(),R("generating"),A(!1),x(null,0,n);let a=0;try{for await(const e of"function"==typeof t?t():t){if(!r())return b;if(!(e.final??e.preview))continue;if(e.final){U(e.final),M&&x(await m(e.final),o.final.k,o.final.blur);break}if(!M){U(e.preview);continue}const t=o.preview[Math.min(a++,o.preview.length-1)];x(await m(e.preview),t.k,t.blur)}if(await S(i?0:544),!r())return b;R("done"),A(!0),M?.kick()}catch(t){if(!r())return b;x(null,0,n),await S(i?0:340),R("failed",t)}return b};{const t=y();t&&h.set(t,M?"opacity":"visibility",M?"0":t.getAttribute("src")?"visible":"hidden")}return g.current.stream&&L(),i(()=>M,g,()=>M?.refresh(),{run:L,reset(){d++,x(null,0,n),R("idle"),A(!1)},get state(){return b}},()=>{d++,k&&URL.revokeObjectURL(k),delete c.dataset.state,c.removeAttribute("aria-busy"),h.restore()})}export{s as elapsedLabel,c as imageGenerate};//# sourceMappingURL=chunk-HTUGMGVA.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{parseColor as t,hash2 as o}from"./chunk-ZCHGV2CV.js";import{mountCanvas as c}from"./chunk-BR6ZNJZW.js";function e(c,e,n,r,a={x:.5,y:.5},i={}){const{fontSize:l=12,chars:s="·-=+|/",accentColor:h,color:f,bands:d=3,speed:g=1,bandWidth:M=.12,glitch:m=!0,lightMode:p=!1}=i,$=h??(p?"#6b8700":"#d4ff00"),b=.62*l,x=1.4*l,u=Math.ceil(e/b),S=Math.ceil(n/x);c.clearRect(0,0,e,n),c.font=`${l}px monospace`,c.textBaseline="top";let z=255,C=255,k=255;if(p&&(z=55,C=55,k=55),f){const o=t(f);o&&(z=o.r,C=o.g,k=o.b)}let y=212,Z=255,j=0;const B=t($);B&&(y=B.r,Z=B.g,j=B.b);const G=r*g;for(let t=0;t<S;t++)for(let e=0;e<u;e++){const n=t/S,r=((n*d-.5*G)%1+1)%1,i=Math.max(0,1-r/M),l=.35*(.5*o(3*e,7*t)+.5);let h=0;if(m){const c=e/u-a.x,r=n-a.y,i=Math.sqrt(c*c+r*r);if(i<.18){const c=o(11*e+Math.floor(12*G),5*t);h=Math.max(0,1-i/.18)*(c>.5?c-.3:0)}}const f=Math.min(1,l+.8*i+.6*h);if(f<.04)continue;const g=s[Math.floor(f*(s.length-1))],$=i>.55,B=p?.82*f:.12*f;c.fillStyle=$?`rgba(${y},${Z},${j},${p?.92:.28})`:`rgba(${z},${C},${k},${B})`,c.fillText(g,e*b,t*x)}}var n={id:"grid",name:"Grid",description:"Scan bands roll down a character grid and glitch near the cursor.",cellSize:12,speed:1,cursor:!0,mount:t=>c(t,(t,o,c,n,r,a)=>e(t,o,c,n,r,{fontSize:a.fontSize,chars:a.chars,lightMode:a.lightMode,color:a.ink,accentColor:a.accent}))};export{n as grid,e as renderGridBackground};//# sourceMappingURL=chunk-I4QVLLRQ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{styleKeeper as t,srOnly as e,mountSurface as n,clamp as o,smoothstep as r,hash as a,house as l,handle as i,prefersReduced as s}from"./chunk-S7RZP2MT.js";var c={start:!0,stagger:38,roll:520,wave:55,glyphs:"#%*+=-:"},h=t=>`Thought for ${t}s`;function u(u,p={}){const f={current:{...c,...p}},m=t(),g=[...u.childNodes],d=f.current.label??null,y=d?[...d.childNodes]:[];let x="done",k=0,C=0,b=-1e9,w=0,S="",M=null;const A=d?e("",!0):null,v=document.createElement("span");let $="",T="";const E=()=>f.current.reducedMotion??s(),F=(t,e)=>{T=$,$=t,d&&(A&&(A.textContent=t),M?(v.replaceChildren(...[...t].map(t=>Object.assign(document.createElement("span"),{textContent:t}))),b=e?performance.now():-1e9,M.kick()):d.textContent=t)};d&&(M=n({host:d,look:()=>({mark:"glyph",charset:" .:-=+*#%@",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:2,cellAspect:.66,glyphScale:1,shade:.2,contrast:1.1,...f.current.look}),ink:()=>f.current.ink??getComputedStyle(d).color,kit:f,reducedMotion:()=>f.current.reducedMotion,resolution:2,onFail:()=>{M=null,d.textContent=$,m.restore()},paint:({pen:t,now:e,still:n,box:i,scale:s})=>{const c=getComputedStyle(v),h=parseFloat(c.fontSize)||14,u=`${c.fontStyle} ${c.fontWeight} ${c.fontSize} ${c.fontFamily}`;t.setTransform(s,0,0,s,0,0),t.textAlign="center",t.textBaseline="alphabetic",t.font=u;const p=t.measureText("x"),m=p.fontBoundingBoxAscent||.8*h,g=p.fontBoundingBoxDescent||.2*h,d=f.current,y=[...v.children],k=e-b<d.roll+y.length*d.wave,w=y.length*d.wave+d.roll+420;let S=!1;return y.forEach((s,c)=>{let p=1;if(!n&&k)p=o((e-b-c*d.wave)/d.roll);else if(!n&&"thinking"===x){const t=(e-C)%w-c*d.wave;p=t<0||t>d.roll?1:t/d.roll}const f=p<1?r(.7,1,p).toFixed(3):"";if(s.style.opacity!==f&&(s.style.opacity=f),p>=1||!s.textContent?.trim())return;S=!0;const y=i(s),M=y.y+(y.h-m-g)/2+m,A=y.x+y.w/2,v=k?T[c]??" ":s.textContent,$=s.textContent,E=[v,...Array.from({length:3},(t,e)=>d.glyphs[Math.floor(a(e+7*c,Math.floor(C))*d.glyphs.length)]??""),$],F=l(p)*(E.length-1)*y.h;t.save(),t.beginPath(),t.rect(y.x-2,y.y,y.w+4,y.h),t.clip(),t.globalAlpha=1-r(.7,1,p),E.forEach((e,n)=>{const o=M+n*y.h-F;if(o<y.y-y.h||o>y.y+2*y.h)return;const r=0===n||n===E.length-1;t.font=r?u:`600 ${.86*h}px "Geist Mono", ui-monospace, monospace`,t.fillStyle=r?"#fff":"#d0d0d0",t.fillText(e,A,o)}),t.restore()}),t.globalAlpha=1,S||!n&&("thinking"===x||k)}}),M&&A&&(m.set(v,"display","inline-flex"),m.set(v,"white-space","pre"),v.setAttribute("aria-hidden","true"),d.replaceChildren(A,v,M.canvas)));const B=document.createElement("span"),z=()=>{w++,x="thinking",C=performance.now(),S="",B.replaceChildren(),u.replaceChildren(B),u.setAttribute("aria-busy","true"),F(f.current.labels?.thinking??"Thinking…",!1),f.current.onState?.("thinking",0),M?.kick()};let P=0,j=0;return f.current.start&&z(),i(()=>M,f,()=>M?.refresh(),{think:z,stream:async t=>{"thinking"!==x&&z();const e=w;P=0;let n="";const o=()=>{"thinking"===x&&(x="streaming",j=performance.now(),k=Math.max(1,Math.round((j-C)/1e3)),F((f.current.labels?.done??h)(k),!0),f.current.onState?.("streaming",k))},r=(t,e)=>{n+=t;const r=e?n.length:n.search(/\s\S*$/)+1;r<=0||(o(),S+=n.slice(0,r),(t=>{const e=!E()&&!M?.still();for(const n of t.match(/\s+|\S+/g)??[]){if(/^\s/.test(n)){B.append(n);continue}const t=document.createElement("span");if(t.textContent=n,e){m.set(t,"opacity","0");const e=Math.max(0,P*f.current.stagger-(performance.now()-j));m.set(t,"transition",`opacity 260ms cubic-bezier(.16, 1, .3, 1) ${Math.round(e)}ms`),requestAnimationFrame(()=>requestAnimationFrame(()=>t.style.setProperty("opacity","1")))}P++,B.appendChild(t)}})(n.slice(0,r)),n=n.slice(r))};if("string"==typeof t)r(t,!0);else{for await(const n of t){if(e!==w)return;r(n,!1)}if(e!==w)return;r("",!0)}o();const a=E()?0:Math.max(0,P*f.current.stagger-(performance.now()-j))+260;await new Promise(t=>setTimeout(t,a)),e===w&&(x="done",u.setAttribute("aria-busy","false"),f.current.onState?.("done",k),M?.kick())},get state(){return x}},()=>{w++,m.restore(),u.removeAttribute("aria-busy"),S?u.textContent=S:u.replaceChildren(...g),d&&($?d.textContent=$:d.replaceChildren(...y))})}var p=c;export{p as THINKING_DEFAULTS,u as thinking};//# sourceMappingURL=chunk-IPVN22ZM.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{scenePreset as e}from"./chunk-C3C7AYKL.js";var t=e({id:"caustics",name:"Caustics",description:"Light focused by moving water: fine bright lines that fold, part and meet again.",cellSize:11,scene:"caustics",charset:" .:-=+*#",hover:"lantern",tune:()=>({blend:"off",lantern:{radius:.14,strength:.22,trail:.8,follow:9}})});export{t as caustics};//# sourceMappingURL=chunk-IQTGJRDX.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{injectStyle as t,drawBlocks as e,snapshot as n,blocksOf as o}from"./chunk-4OT66HSZ.js";import{clamp as i,styleKeeper as a,srOnly as r,mountSurface as s,house as c,hash as d,handle as l,hexRgb as p,resolveColor as m,isDark as h}from"./chunk-S7RZP2MT.js";var u={max:3,duration:6e3,label:"Notifications",swipe:!0},f="cubic-bezier(.16, 1, .3, 1)",x=`\n:where(.ascii-toasts){position:relative;margin:0;padding:0;list-style:none;min-height:52px}\n:where(.ascii-toast){position:absolute;left:0;right:0;bottom:0;box-sizing:border-box;display:flex;align-items:center;gap:10px;min-height:52px;padding:8px 8px 8px 10px;border-radius:14px;background:var(--ascii-toast-bg,Canvas);color:var(--ascii-toast-ink,CanvasText);box-shadow:var(--ascii-toast-shadow,0 1px 2px rgb(0 0 0 / .06),0 10px 28px -10px rgb(0 0 0 / .22));z-index:calc(10 - var(--d,0));transform-origin:50% 0;translate:0 calc(var(--d,0) * -12px);scale:calc(1 - var(--d,0) * .05);touch-action:pan-y;transition:translate 380ms ${f},scale 380ms ${f},opacity 220ms ${f},transform 300ms ${f},filter 380ms ${f}}\n:where(.ascii-toast)::after{content:"";position:absolute;left:0;right:0;top:100%;height:10px}\n:where(.ascii-toast) > *{transition:opacity 200ms ${f}}\n:where(.ascii-toast[data-back]) > *{opacity:0}\n:where(.ascii-toasts:not([data-open])) :where(.ascii-toast[data-back]){filter:brightness(calc(1 - var(--d,0) * .04))}\n:where(.ascii-toasts:not([data-open])) :where(.ascii-toast[data-back]) > *{pointer-events:none}\n:where(.ascii-toasts[data-open]) :where(.ascii-toast){translate:0 calc(var(--d,0) * (-100% - 8px));scale:1}\n:where(.ascii-toasts[data-open]) :where(.ascii-toast[data-back]) > *{opacity:1}\n:where(.ascii-toast[data-forming]){animation:ascii-toast-in 420ms ${f} both}\n:where(.ascii-toast[data-forming],.ascii-toast[data-gone]) > *{opacity:0;transition:none}\n:where(.ascii-toast[data-gone]){opacity:0;scale:.97;pointer-events:none}\n:where(.ascii-toast[data-swiping]){transition:translate 380ms ${f},scale 380ms ${f},opacity 220ms ${f}}\n@keyframes ascii-toast-in{from{opacity:0;translate:0 14px}}\n:where(.ascii-toast-icon){display:grid;place-items:center;flex:none;width:32px;height:32px;border-radius:9px;background:rgb(128 128 128 / .14)}\n:where(.ascii-toast-text){display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}\n:where(.ascii-toast-title){overflow:hidden;font-size:14px;font-weight:600;text-overflow:ellipsis;white-space:nowrap}\n:where(.ascii-toast-body){overflow:hidden;font-size:13px;opacity:.68;text-overflow:ellipsis;white-space:nowrap}\n:where(.ascii-toast-action,.ascii-toast-close){flex:none;border:0;background:rgb(128 128 128 / .14);color:inherit;font:inherit;cursor:pointer}\n:where(.ascii-toast-action){height:32px;padding:0 12px;border-radius:999px;font-size:14px;font-weight:500}\n:where(.ascii-toast-close){display:grid;place-items:center;width:28px;height:28px;border-radius:999px;background:transparent;font-size:18px;line-height:1;opacity:.6}\n@media (prefers-reduced-motion:reduce){:where(.ascii-toast){transition:none}:where(.ascii-toast[data-forming]){animation:none}}\n`,g=t=>{const[e,n,o]=p(t).map(t=>{const e=t/255;return e<=.04045?e/12.92:((e+.055)/1.055)**2.4});return.2126*e+.7152*n+.0722*o};function b(t,e){const n=/^rgba?\(\s*([\d.]+)[\s,]+([\d.]+)[\s,]+([\d.]+)(?:[\s,/]+([\d.]+%?))?/i.exec(t.trim());if(!n)return!1;if(!((void 0===n[4]?1:n[4].endsWith("%")?parseFloat(n[4])/100:parseFloat(n[4]))>=.5))return!1;const o=`#${[n[1],n[2],n[3]].map(t=>Math.round(i(+t,0,255)).toString(16).padStart(2,"0")).join("")}`,[a,r]=[g(o),g(e)].sort((t,e)=>e-t);return(a+.05)/(r+.05)<3}function v(p,f={}){const g={current:{...u,...f}},v=a(),w=document.createElement("ol"),y=r("",!1);y.setAttribute("role","status");let k=[],E=[],C=0,L=!1,$=!1,M=!1,P=!1,T=null;const S=[];t("ascii-kit-toast",x),w.className="ascii-toasts",w.setAttribute("aria-label",g.current.label),p.append(w,y);const z=new WeakSet,A=t=>{delete t.dataset.forming,z.delete(t)&&(t.style.removeProperty("transition"),t.style.removeProperty("background-color"),t.style.removeProperty("box-shadow"))};T=s({host:p,look:()=>({mark:"glyph",charset:" .:-=+*#%@",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:5,cellAspect:.62,glyphScale:.92,...g.current.look}),outset:24,resolution:2,ink:()=>g.current.ink??"--ascii-ink-strong",kit:g,reducedMotion:()=>g.current.reducedMotion,onFail:()=>{T=null,E=[];for(const t of k)A(t.node)},paint:({pen:t,now:n,scale:o,still:a,box:r})=>(t.setTransform(o,0,0,o,0,0),E=E.filter(o=>{const a=(n-o.start)/o.ms;if(o.form&&a>=.62&&A(o.node),a>=1)return!1;if(o.form)e(t,o.snap,o.blocks,o.order,1.04*c(a),(t,e)=>[70*(t.seed-.5)*e,(14+26*d(t.x,t.y))*e],1-i((a-.62)/.28));else{const n=o.dir;e(t,o.snap,o.blocks,o.order,1-1.04*(1-(1-a)**3),(t,e)=>[n*(14+34*t.seed+.5*Math.abs(o.throw))*e,14*(d(t.y,t.x)-.35)*e],1-i((a-.75)/.25))}return!0}),E.length>0)}),T&&(T.canvas.style.zIndex="11");const I=()=>!!T&&T.live&&!T.still(),W=()=>{const t=k.filter(t=>void 0===t.node.dataset.gone);t.forEach((e,n)=>{const o=t.length-1-n;v.set(e.node,"--d",String(o)),0===o?(e.node.dataset.front="",delete e.node.dataset.back):(e.node.dataset.back="",delete e.node.dataset.front)})},F=(t,e,i=0)=>{if(!T)return;const a=T.canvas.clientWidth||p.clientWidth+48,r=T.canvas.clientHeight||p.clientHeight+48,s=n(t,a,r,T.box),c=o(s.rects),d=Math.max(1,...c.map(t=>t.x)),l=i<0?-1:1,m=l>0?t=>t.x/d:t=>1-t.x/d,h=Float32Array.from(c,t=>e?t.x/d*.3+.7*t.seed:.62*m(t)+.38*t.seed);E.push({start:performance.now(),ms:e?340:440,snap:s.canvas,blocks:c,order:h,form:e,node:t,dir:l,throw:i}),T.kick()},X=t=>{t.timer&&clearTimeout(t.timer),t.timer=0,L||t.left<=0||(t.since=performance.now(),t.timer=setTimeout(()=>G(t.id),t.left))},j=()=>(t=>{if(t!==L){L=t,t?w.dataset.open="":delete w.dataset.open;for(const e of k)t&&e.timer&&(clearTimeout(e.timer),e.timer=0,e.left=Math.max(400,e.left-(performance.now()-e.since))),t||X(e)}})($||M),H=()=>{$=!0,j()},N=()=>{$=!1,j()},Z=()=>{M=!0,j()},D=t=>{w.contains(t.relatedTarget)||(M=!1,j())};function G(t,e=0){const n=k.find(e=>e.id===t);if(!n||void 0!==n.node.dataset.gone)return;n.timer&&clearTimeout(n.timer);const o=()=>{k=k.filter(t=>t!==n),E=E.filter(t=>t.node!==n.node),n.node.remove(),W(),T?.kick(),k.some(t=>void 0===t.node.dataset.gone)||($=M=!1,j())},i=k[k.length-1]===n;I()&&(i||L||e)?(A(n.node),F(n.node,!1,e),n.node.dataset.gone="",W(),S.push(setTimeout(o,220))):o()}w.addEventListener("pointerenter",H),w.addEventListener("pointerleave",N),w.addEventListener("focusin",Z),w.addEventListener("focusout",D);let O=null;const R=t=>{if(!g.current.swipe||0!==t.button||O)return;const e=t.target;if(e?.closest?.('button, a, input, textarea, select, [role="button"]'))return;const n=e?.closest?.("[data-toast]"),o=n&&k.find(t=>t.node===n);o&&void 0===n.dataset.gone&&void 0===n.dataset.forming&&(O={item:o,id:t.pointerId,x0:t.clientX,dx:0,t:performance.now(),v:0},n.dataset.swiping="",n.setPointerCapture?.(t.pointerId))},q=t=>{if(!O||t.pointerId!==O.id)return;const e=performance.now(),n=t.clientX-O.x0;O.v=(n-O.dx)/Math.max(1,e-O.t),O.dx=n,O.t=e,O.item.node.style.setProperty("transform",`translateX(${n}px)`),O.item.node.style.setProperty("opacity",String(i(1-Math.abs(n)/260,.2)))},B=t=>{if(!O||t.pointerId!==O.id)return;const{item:e,dx:n}=O,o=e.node,i=performance.now()-O.t>90?0:O.v;O=null,delete o.dataset.swiping;const a=Math.abs(n)>64||Math.abs(i)>.45&&Math.abs(n)>8;o.style.removeProperty("opacity"),a?(G(e.id,n||i),o.style.setProperty("transform",`translateX(${n+48*Math.sign(n||i)}px)`)):o.style.removeProperty("transform")};w.addEventListener("pointerdown",R),w.addEventListener("pointermove",q),w.addEventListener("pointerup",B),w.addEventListener("pointercancel",B);return l(()=>T,g,t=>{w.setAttribute("aria-label",t.label),T?.refresh()},{push:t=>{if(P)return-1;const e=++C,n=k.filter(t=>void 0===t.node.dataset.gone),o=n.length+1-Math.max(1,g.current.max);o>0&&n.slice(0,o).forEach(t=>G(t.id));const i=g.current.render?g.current.render(t,e):function(t,e){const n=(t,e,n)=>{const o=document.createElement(t);return o.className=e,n&&(o.dataset.paint=n),o},o=n("li","ascii-toast");if(void 0!==t.icon){const e=n("span","ascii-toast-icon","tile");e.setAttribute("aria-hidden","true"),"string"==typeof t.icon?e.textContent=t.icon:e.appendChild(t.icon),o.appendChild(e)}const i=n("span","ascii-toast-text"),a=n("b","ascii-toast-title","strong");if(a.textContent=t.title,i.appendChild(a),t.body){const e=n("span","ascii-toast-body","meta");e.textContent=t.body,i.appendChild(e)}if(o.appendChild(i),t.action){const{label:i,onClick:a}=t.action,r=n("button","ascii-toast-action","text");r.type="button",r.textContent=i,r.addEventListener("click",()=>{a(),e()}),o.appendChild(r)}const r=n("button","ascii-toast-close","none");return r.type="button",r.setAttribute("aria-label",`Dismiss ${t.title}`),r.textContent="×",r.addEventListener("click",e),o.appendChild(r),o}(t,()=>G(e));i.dataset.toast=String(e);const a={id:e,node:i,timer:0,left:t.duration??g.current.duration,since:0,born:performance.now()};return k.push(a),w.appendChild(i),W(),y.textContent=t.body?`${t.title}. ${t.body}`:t.title,I()?(i.dataset.forming="",(t=>{const e=m(g.current.ink??"--ascii-ink-strong",p,h(p)?"#d8d6cf":"#1d1d1b");e&&b(getComputedStyle(t).backgroundColor,e)&&(z.add(t),t.style.setProperty("transition","none","important"),t.style.setProperty("background-color","transparent","important"),t.style.setProperty("box-shadow","none","important"))})(i),F(i,!0)):T?.kick(),X(a),e},dismiss:t=>G(t),clear(){[...k].forEach(t=>G(t.id))},get toasts(){return k.filter(t=>void 0===t.node.dataset.gone).map(t=>t.id)}},()=>{P=!0;for(const t of k)t.timer&&clearTimeout(t.timer);S.forEach(clearTimeout),w.removeEventListener("pointerenter",H),w.removeEventListener("pointerleave",N),w.removeEventListener("focusin",Z),w.removeEventListener("focusout",D),w.removeEventListener("pointerdown",R),w.removeEventListener("pointermove",q),w.removeEventListener("pointerup",B),w.removeEventListener("pointercancel",B),k=[],E=[],w.remove(),y.remove(),v.restore()})}var w=u;export{w as TOAST_DEFAULTS,b as hidesInk,v as toastStack};//# sourceMappingURL=chunk-IUKSHYED.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{blank as e,mountPageField as t,pageHandle as n,pulseAt as r,sleep as o}from"./chunk-BTD6EFAW.js";import{hash as l}from"./chunk-S7RZP2MT.js";var a={preset:"hero",clear:!1,text:"404",ripple:!0},i=28,c='600 440px "Geist", Arial, sans-serif',s=()=>"number"==typeof innerWidth&&innerWidth<760,d=e=>({mark:"glyph",scene:"drift",levels:"auto",charset:" .:+*#",font:'"Geist Mono", ui-monospace, monospace',fontWeight:400,cellSize:10,cellAspect:.62,glyphScale:.86,color:"ink",shade:0,hover:"trail",trail:{strength:.9,radius:.32},...e}),h={mark:"glyph",scene:"none",charset:" .:-=+*#%@",font:'"Geist", Arial, sans-serif',fontWeight:500,cellSize:7,cellAspect:.8,glyphScale:.8,color:"ink",shade:0,contrast:1.4,fit:"contain",clear:!1,focus:{x:.5,y:.5},drift:.8,speed:.7,levels:"auto",hover:"trail",trail:{strength:1,radius:.42}};function f(t){const n=document.createElement("canvas").getContext("2d");n.font=c;const r=Math.max(320,Math.ceil(n.measureText(t).width)+160),{canvas:o,pen:l}=e(r,560);return l.fillStyle="#fff",l.textAlign="center",l.textBaseline="middle",l.font=c,l.letterSpacing="-10px",l.fillText(t,r/2,296),o}function u(e){const t=e.getContext("2d").getImageData(0,0,e.width,e.height).data,n=[];for(let r=0;r<e.height;r+=i)for(let o=0;o<e.width;o+=i){let a=!1;for(let n=0;n<i&&!a;n+=4)for(let l=0;l<i&&!a;l+=4)a=(t[4*((r+n)*e.width+o+l)]??0)>40;if(!a)continue;const c=n.length,s=l(c,1)*Math.PI*2,d=120+420*l(c,2);n.push({x:o,y:r,dx:Math.cos(s)*d+.5*(o-e.width/2),dy:Math.sin(s)*d*.6,lag:.35*l(c,3)})}return n}var p=[...Array.from({length:10},(e,t)=>(t+1)/10),1,1,1,...Array.from({length:14},(e,t)=>1-(t+1)/14)];function g(e,t,n,r){const o=t.getContext("2d");o.globalAlpha=1,o.fillStyle="#000",o.fillRect(0,0,t.width,t.height);for(const t of n){const n=Math.min(1,Math.max(0,(r-t.lag*(1-r))/(1-.5*t.lag))),l=n*n*(3-2*n);o.globalAlpha=1-.72*l,o.drawImage(e,t.x,t.y,i,i,t.x+t.dx*l,t.y+t.dy*l,i,i)}o.globalAlpha=1}function m(l,i={}){const m={current:{...a,...i}},x=()=>"notFound"===m.current.preset;let y=0,v=!1,b=0;const w={x:-1e4,y:-1e4,at:-1e6},k=()=>f(m.current.text);let M=null;M=t({host:l,look:()=>{const e=m.current,t=e.clear,n=e=>!!t&&{element:t,padding:-14,feather:e,shape:"ellipse"};return{..."notFound"===e.preset?h:"brand"===e.preset?d({scale:s()?1.4:1.6,brightness:.24,contrast:1.1,clear:n(.3)}):d({scale:s()?1.6:1.9,brightness:.26,contrast:1.15,clear:n(.22)}),...e.look}},ink:e=>{const t=m.current,n=t.palette,r="string"==typeof n?n:n?.[e?"dark":"light"];return r??t.ink?r??t.ink:"notFound"===t.preset?e?"#d8d6cf":"#1d1d1b":"brand"===t.preset?`var(--brand, ${e?"#8f80ff":"#5b4bd1"})`:e?"#8a8881":"#6b6964"},source:x()?k():null,label:m.current.label??(x()?m.current.text:void 0),kit:m,reducedMotion:()=>m.current.reducedMotion,onFail:()=>{M=null}}),M&&x()&&document.fonts?.load?.(c).then(()=>{M&&x()&&!v&&M.field.setSource(k())},()=>{});const S=(e,t=1.4)=>{M&&!M.still()&&(b=performance.now()+1400,r(M.field,e,t))},A=e=>{const t=m.current,n=performance.now();!M||x()||!t.ripple||M.still()||n<b||n-w.at<520||Math.hypot(e.clientX-w.x,e.clientY-w.y)<36||(Object.assign(w,{x:e.clientX,y:e.clientY,at:n}),r(M.field,{x:e.clientX,y:e.clientY},.65))};M&&l.addEventListener("pointermove",A);let F=m.current.preset,W=m.current.text;return n(()=>M,m,e=>{M&&((e.preset!==F||"notFound"===e.preset&&e.text!==W)&&(y++,v=!1,M.field.setSource("notFound"===e.preset?k():null)),F=e.preset,W=e.text)},{pulse:S,scatter:async t=>{const n=M?.field;if(!n)return;if(!x())return void S(t);if(t&&S(t,1.2),v||M.still())return;v=!0;const r=++y,l=k(),a=u(l),i=e(l.width,l.height).canvas;for(const e of p){const t=performance.now();if(g(l,i,a,e),await n.setSource(i),await o(Math.max(0,44-(performance.now()-t))),r!==y||!M)return void(v=!1)}await n.setSource(l),v=!1}},()=>{y++,l.removeEventListener("pointermove",A)})}var x=a;export{x as FIELD_BACKGROUND_DEFAULTS,p as SCATTER_STEPS,m as fieldBackground,f as lostArt,u as lostTiles};//# sourceMappingURL=chunk-J2YZBT3N.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{hash as e,styleKeeper as t,srOnly as n,mountSurface as r,handle as i}from"./chunk-S7RZP2MT.js";import{isGlyphFieldSupported as l}from"../field.js";var o={check:!0,shake:!0};function a(e,t){const n=Math.max(3,3*Math.round(e*t/3));return{cw:n/3*2/t,ch:n/t,cellSize:n/t}}function s(t,n,r,i,l,o=0){const a=24*r+170;if(n<a){const r=(n-24*t)/170;return r<1?1+Math.floor(e(t+o,Math.floor(n/46))*(r<0?3:9)):0}if(!i||l)return 0;const s=(((n-a)/1250-.07*t)%1+1)%1;return s<.3?1+Math.round(8*Math.sin(Math.PI*(s/.3))):0}var c="cubic-bezier(.16, 1, .3, 1)";function d(e,d={}){const u={current:{...o,...d}},h=t(),p=u.current.label??e,m=u.current.text??(p.textContent??"").trim(),f=[...p.childNodes],g=void 0!==u.current.icon?u.current.icon:m?null:e.querySelector("svg"),y=e.getAttribute("aria-label");let v="idle",b=m,x=-1e9,M=0,C=null,w={cw:9,ch:15,cellSize:15};const $=n(m),k=document.createElement("span"),A=document.createElement("span");A.setAttribute("aria-hidden","true"),A.dataset.asciiCheck="",A.innerHTML='<svg viewBox="0 0 24 24" width="1.1em" height="1.1em" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M20 6 9 17l-5-5"/></svg>';const S=()=>{const e=Math.min(globalThis.devicePixelRatio||1,2);w=a(parseFloat(getComputedStyle(p).fontSize)||15,e)},z=()=>{if(g)return k.replaceChildren(),C&&k.appendChild(C.canvas),k.style.width=`${w.cw}px`,void(k.style.height=`${w.ch}px`);const t=[...b];for(const e of[...k.children])"SPAN"===e.tagName&&e.remove();const n=C&&C.canvas.parentElement===k?C.canvas:null;for(const[e,r]of t.entries()){const t=document.createElement("span");t.textContent=r,t.setAttribute("style",`position:absolute;top:0;left:${e*w.cw}px;width:${w.cw}px;height:${w.ch}px;line-height:${w.ch}px;text-align:center`),n?k.insertBefore(t,n):k.appendChild(t)}C&&!n&&k.appendChild(C.canvas),k.style.width=t.length*w.cw+"px",k.style.height=`${w.ch}px`,$.textContent=b,M=Math.max(M,e.offsetWidth),M&&h.set(e,"min-width",`${M}px`)},P="undefined"!=typeof document&&l();if(P){S(),k.setAttribute("aria-hidden","true");const t="position:absolute;left:50%;top:50%;translate:-50% -50%;pointer-events:none";g?("static"===getComputedStyle(e).position&&h.set(e,"position","relative"),k.setAttribute("style",t),A.setAttribute("style",`${t};display:grid;place-items:center;opacity:0;scale:.5`),e.appendChild(k),e.appendChild(A)):(k.setAttribute("style","display:inline-block;vertical-align:middle;position:relative;white-space:pre"),A.setAttribute("style","display:inline-grid;place-items:center;vertical-align:middle;overflow:hidden;width:0;opacity:0;scale:.5"),p.replaceChildren($,A,k)),z()}C=P?r({host:k,look:()=>({mark:"glyph",charset:" .:-=+*#%@",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:w.cellSize,cellAspect:2/3,glyphScale:.94,...u.current.look}),ink:()=>u.current.ink??getComputedStyle(p).color,kit:u,reducedMotion:()=>u.current.reducedMotion,resolution:(e,t)=>[Math.max(2,2*Math.round(e/w.cw)),Math.max(3,3*Math.round(t/w.ch))],onFail:()=>{C=null,k.remove(),A.remove(),h.restore(),g||(p.replaceChildren(...f),p.textContent=b)},paint:({pen:e,now:t,still:n})=>{const r=t-x;if(g){if("loading"!==v||n)return!1;const t=1+Math.round(8*(.5-.5*Math.cos(2*Math.PI*r/720))),i=Math.round(t/9*255);return e.fillStyle=`rgb(${i} ${i} ${i})`,e.fillRect(0,0,2,3),!0}const i=[...k.children].filter(e=>"SPAN"===e.tagName);let l="loading"===v&&!n;for(let t=0;t<i.length;t++){const o=n?0:s(t,r,i.length,"loading"===v,n,b.length);r<24*i.length+170&&(l=!0);const a=" "===b[t];if(i[t].style.visibility=o&&!a?"hidden":"",!o||a)continue;const c=Math.round(o/9*255);e.fillStyle=`rgb(${c} ${c} ${c})`,e.fillRect(2*t,0,2,3)}return l}}):null,P&&!C&&(k.remove(),A.remove(),g||p.replaceChildren(...f),h.restore());const R=(t,n)=>{v=t,b=g?"":n,e.dataset.state=t,"loading"===t?e.setAttribute("aria-busy","true"):e.removeAttribute("aria-busy"),g&&null!==y&&e.setAttribute("aria-label","idle"===t?y:n),u.current.announce&&(u.current.announce.textContent="idle"===t?"":n),C?(x=performance.now(),((e,t)=>{const n=t?"none":`opacity 160ms ${c} ${e?120:0}ms, scale 240ms ${c} ${e?120:0}ms`;if(A.style.transition=n,A.style.opacity=e?"1":"0",A.style.scale=e?"1":".5",g||(A.style.width=e?"1.1em":"0",A.style.marginRight=e?".45em":"0"),g&&"style"in g){const e="idle"!==v&&"error"!==v;h.set(g,"transition",n.replace(/ 120ms/g,"")),h.set(g,"opacity",e?t&&"loading"===v?".4":"0":"1"),h.set(g,"scale",e&&!t?".6":"1")}})(!("success"!==t||!g&&!u.current.check),C.still()),z(),C.kick(),"error"===t&&u.current.shake&&!C.still()&&"function"==typeof e.animate&&e.animate([{translate:"0"},{translate:"-4px 0"},{translate:"4px 0"},{translate:"-2px 0"},{translate:"0"}],{duration:280,easing:c})):g||(p.textContent=n)};return i(()=>C,u,()=>{C&&(S(),z(),C.refresh())},{start(e=(g?y??"":`${m}…`)){R("loading",e)},succeed(e="Done"){R("success",e)},fail(e="Retry"){R("error",e)},reset(e=(g?y??"":m)){R("idle",e)},get state(){return v}},()=>{C&&(k.remove(),A.remove(),g||p.replaceChildren(...f)),g&&null!==y&&e.setAttribute("aria-label",y),delete e.dataset.state,e.removeAttribute("aria-busy"),h.restore()})}var u=o;export{u as BUTTON_LOADING_DEFAULTS,d as buttonLoading,a as letterCells,s as letterGlyph};//# sourceMappingURL=chunk-K563CCOL.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{mountSurface as t}from"./chunk-S7RZP2MT.js";var e=class{constructor(t=1,e=3.5,s=!1){this.strokes=[],this.advected=[0,0,0],this.previous=null,this.energy=0,this.continuousWake=s,this.decayRate=e,this.aspect=Math.max(.25,Math.min(4,t));const i=s?96:64;this.columns=this.aspect>=1?i:Math.round(i*this.aspect),this.rows=this.aspect>=1?Math.round(i/this.aspect):i,this.front=new Float32Array(this.columns*this.rows*3),this.back=new Float32Array(this.front.length)}get active(){return this.energy>5e-4||this.strokes.length>0}move(t,e){if(!Number.isFinite(t+e))return;if(this.continuousWake&&!this.previous)return void(this.previous={x:t,y:e});const s=this.previous??{x:t-.004,y:e-.001},i=Math.max(-.09,Math.min(.09,t-s.x)),n=Math.max(-.09,Math.min(.09,e-s.y));if(this.previous={x:t,y:e},Math.abs(i)+Math.abs(n)<1e-4)return;const a=Math.min(1,25*Math.hypot(i*this.aspect,n)+.06);this.strokes.push({x:t,y:e,dx:i,dy:n,speed:a,fromX:s.x,fromY:s.y}),this.strokes.length>12&&this.strokes.shift()}leave(){this.previous=null}clear(){this.front.fill(0),this.back.fill(0),this.strokes.length=0,this.previous=null,this.energy=0}read(t,e,s,i){const n=Math.max(0,Math.min(this.columns-1.001,e*(this.columns-1))),a=Math.max(0,Math.min(this.rows-1.001,s*(this.rows-1))),h=Math.floor(n),o=Math.floor(a),r=n-h,c=a-o,l=3*(o*this.columns+h),m=l+3*this.columns,u=1-r,d=1-c;i[0]=(t[l]*u+t[l+3]*r)*d+(t[m]*u+t[m+3]*r)*c,i[1]=(t[l+1]*u+t[l+4]*r)*d+(t[m+1]*u+t[m+4]*r)*c,i[2]=(t[l+2]*u+t[l+5]*r)*d+(t[m+2]*u+t[m+5]*r)*c}sample(t,e,s){this.read(this.front,t,e,s)}step(t){if(!this.active)return;const e=Math.max(0,Math.min(.05,t)),s=Math.exp(-e*this.decayRate),i=Math.exp(-e*(this.decayRate+.5)),n=Math.max(1,this.aspect),a=Math.max(1,1/this.aspect);let h=0;for(let t=0;t<this.rows;t++)for(let o=0;o<this.columns;o++){const r=3*(t*this.columns+o),c=o/(this.columns-1),l=t/(this.rows-1),m=this.continuousWake?.65:2,u=c-this.front[r]*e*m,d=l-this.front[r+1]*e*m;this.read(this.front,u,d,this.advected);let M=this.advected[0]*s,f=this.advected[1]*s,p=this.advected[2]*i;for(const t of this.strokes){let e=(c-t.x)*n,s=(l-t.y)*a;if(this.continuousWake){const i=(c-t.fromX)*n,h=(l-t.fromY)*a,o=(t.x-t.fromX)*n,r=(t.y-t.fromY)*a,m=Math.max(0,Math.min(1,(i*o+h*r)/(o*o+r*r||1)));e=i-o*m,s=h-r*m;const u=e*e+s*s;if(u>.0225)continue;const d=Math.exp(-u/.0032),v=Math.hypot(t.dx*n,t.dy*a),x=Math.min(.025,.55*v);M+=(4.2*t.dx-s*x)*d,f+=(4.2*t.dy+e*x)*d,p=Math.max(p,Math.min(.7,18*v)*d);continue}const i=e*e+s*s;if(i>.045)continue;const h=Math.exp(-i/.0075),o=t.speed;M+=(2.8*t.dx-s*o*.16)*h,f+=(2.8*t.dy+e*o*.16)*h,p+=o*h*.3}this.back[r]=Math.max(-.18,Math.min(.18,M)),this.back[r+1]=Math.max(-.18,Math.min(.18,f)),this.back[r+2]=Math.min(.8,p),h=Math.max(h,Math.abs(M),Math.abs(f),p)}[this.front,this.back]=[this.back,this.front],this.strokes.length=0,this.energy=h,this.active||this.clear()}};var s=" .:+-=xICA$FY#@",i=.58,n=72649.5/59542.5;var a={id:"fluid",name:"Fluid",description:"Flowing folds with a soft wake behind the cursor. The original Asciify hero.",cellSize:7,speed:1,cursor:!0,opacity:.7,mount:function(a){const{host:h}=a;let o=new e(1),r=1,c=12,l=0,m=!1,u=null;const d=[],M=(t,e)=>((t,e,s)=>Math.max(t,Math.sqrt(e*s*i/26e3)))(a.settings().cellSize,t,e),f=t({host:h,kit:a.kit,layer:"under",look:()=>{const t=a.settings();return{mark:"glyph",charset:t.charset??s,font:'"JetBrains Mono", monospace',fontWeight:400,cellSize:M(h.clientWidth||1,h.clientHeight||1)/i,cellAspect:i,glyphScale:.9,cellFit:"fill",maxPixelRatio:1.5,clear:!!t.clear&&{element:t.clear,padding:8,feather:.22,shape:"ellipse"},color:"ink",shade:0,levels:"none",fit:"cover",gamma:1,contrast:n,brightness:-.0004316244699164449-.5/Math.max(1,Array.from(t.charset??s).length-1),...t.look}},ink:t=>a.ink(t)??"#8f8d86",resolution:(t,e)=>{const s=Math.max(192,Math.min(384,Math.ceil(Math.max(t,e*i)/M(t,e)))),n=t/e;return n>=1?[s,Math.max(1,Math.round(s/n))]:[Math.max(1,Math.round(s*n)),s]},reducedMotion:a.reducedMotion,onFail:()=>a.onFail(),paint:({pen:t,width:s,height:i,w:n,h:M,now:f,still:p})=>{const v=a.settings(),x=l?Math.min(.05,(f-l)/1e3):1/60;l=f,p||(c+=x*v.speed);const g=n/M;if(Math.abs(g-r)>.01&&(o=new e(g),r=g),p||!v.cursor)o.clear(),d.length=0;else{const t=h.getBoundingClientRect();if(t.width&&t.height)for(const e of d)o.move((e.x-t.left)/t.width,(e.y-t.top)/t.height);d.length=0,m&&(o.leave(),m=!1),o.step(x)}u&&u.width===s&&u.height===i||(u=t.createImageData(s,i));const y=u.data;!function(t,e,s,i,n,a){const h=[0,0,0],o=a.active;for(let r=0;r<s;r++)for(let c=0;c<e;c++){const l=c/e,m=r/s;o&&a.sample(l,m,h);const u=(l-.5-h[0])*i,d=m-.5-h[1],M=u+.22*Math.sin(5.2*d+.17*n)+.15*Math.sin(2.4*u-3.1*d-.1*n),f=d+.19*Math.sin(3.5*u+.13*n),p=Math.hypot(.8*M+.18,1.1*f),v=.5+.5*Math.sin(14*p-2.8*M+1.4*Math.sin(5*f)-.24*n),x=.5+.5*Math.sin(3.6*M-2.9*f+.09*n),g=Math.max(0,Math.min(1,v*v*(.48+.32*x)-.075+.75*h[2])),y=Math.round(255*g),k=4*(r*e+c);t[k]=t[k+1]=t[k+2]=y,t[k+3]=255}}(y,s,i,g,c,o);for(let t=0;t<y.length;t+=4){const e=y[t]<10?0:Math.min(255,1.45*y[t]);y[t]=y[t+1]=y[t+2]=.299*e+e*(185/232)*.587,y[t+3]=255}return t.putImageData(u,0,0),!0}});if(!f)return null;const p=t=>{if(t.target instanceof Element&&t.target.closest("button, a, input, select, summary, textarea"))return m=!0,void f.kick();d.push({x:t.clientX,y:t.clientY}),d.length>6&&d.shift(),f.kick()},v=()=>{m=!0,f.kick()};return h.addEventListener("pointermove",p),h.addEventListener("pointerdown",p),h.addEventListener("pointerleave",v),h.addEventListener("pointercancel",v),{get field(){return f.field},get canvas(){return f.canvas},refresh:()=>f.refresh(),play:()=>{l=0,f.play()},pause:()=>f.pause(),destroy(){h.removeEventListener("pointermove",p),h.removeEventListener("pointerdown",p),h.removeEventListener("pointerleave",v),h.removeEventListener("pointercancel",v),f.destroy()}}}};export{a as fluid};//# sourceMappingURL=chunk-KWTF6Q5W.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{mountPageField as e,pageHandle as t,sleep as r,pulseAt as o}from"./chunk-BTD6EFAW.js";import{styleKeeper as a}from"./chunk-S7RZP2MT.js";function n(n,l={}){const i={current:{...l}},c=a(),s=n.querySelector("img"),u=i.current.image??s??null;let d=null;d=u?e({host:n,look:()=>{const e=i.current;return{mark:"glyph",scene:"none",charset:" .:-=+*#%@",font:'"Geist", Arial, sans-serif',fontWeight:500,cellSize:6,cellAspect:.8,glyphScale:.8,color:"ink",shade:0,contrast:1.3,levels:"auto",fit:"cover",focus:e.focus??{x:.5,y:.4},hover:"trail",trail:{strength:.95,radius:.42},clear:!!e.clear&&{element:e.clear,padding:8,feather:.12,shape:"rect"},...e.look}},ink:()=>i.current.ink??"--ascii-ink-strong",source:u,label:i.current.label??(u instanceof HTMLImageElement&&u.alt||void 0),kit:i,reducedMotion:()=>i.current.reducedMotion,onFail:()=>{d=null,c.restore()}}):null,d&&s&&u===s&&c.set(s,"opacity","0");let h=0,m=!1;return t(()=>d,i,()=>{},{pulse:(e,t=1)=>{d&&!d.still()&&o(d.field,e,t)},shimmer:e=>{const t=d?.field;if(!t||e===m||e&&d.still())return;const o=++h;m=e,e?(async()=>{let e;try{e=await(async()=>{if(u instanceof HTMLImageElement)return u.complete||await u.decode(),u;const e=new Image;return e.crossOrigin="anonymous",e.src=u,await e.decode(),e})()}catch{return}const a=Math.min(1,1400/Math.max(e.naturalWidth,e.naturalHeight,1)),n=Object.assign(document.createElement("canvas"),{width:Math.max(1,Math.round(e.naturalWidth*a)),height:Math.max(1,Math.round(e.naturalHeight*a))}),l=n.getContext("2d"),i=n.width,c=n.height,s=performance.now();for(;o===h&&d?.field===t;){const o=performance.now(),a=-.4*i+1.8*((o-s)/1100%1)*i;l.globalCompositeOperation="source-over",l.drawImage(e,0,0,i,c);const u=l.createLinearGradient(a-.22*i,.3*a,a+.22*i,.3*a+.3*c);u.addColorStop(0,"rgb(0 0 0 / 0)"),u.addColorStop(.5,"rgb(255 255 255 / .42)"),u.addColorStop(1,"rgb(0 0 0 / 0)"),l.globalCompositeOperation="lighter",l.fillStyle=u,l.fillRect(0,0,i,c),await t.setSource(n),await r(Math.max(0,48-(performance.now()-o)))}})():t.setSource(u)}},()=>{h++,c.restore()})}export{n as artPanel};//# sourceMappingURL=chunk-MGVPLQ3Z.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{styleKeeper as t,mountSurface as e,handle as r,hash as n,prefersReduced as o,clamp as a,house as i}from"./chunk-S7RZP2MT.js";var s={length:6,accept:"digits",cells:"[data-cell]"},l=560,c=t=>{const e=Math.round(255*a(t));return`rgb(${e} ${e} ${e})`},u=(t,e,r="digits")=>("digits"===r?t.replace(/\D/g,""):t.replace(/[^a-z\d]/gi,"").toUpperCase()).slice(0,e);function d(d,h={}){const p={current:{...s,...h}},f=t(),m=t(),g=[],v=()=>!!(p.current.reducedMotion??o()),b=()=>Math.max(1,Math.round(p.current.length));let y="",x="idle",M=!1,A=[],w="",E=-1e9,S="",k=-1e9,C=[],$=[],L=0,P=null;const T=new Map;"static"===getComputedStyle(d).position&&f.set(d,"position","relative");let B=d.querySelector("input");B||(B=document.createElement("input"),B.setAttribute("style","position:absolute;inset:0;width:100%;height:100%;margin:0;padding:0;border:0;opacity:0;font-size:16px;cursor:text"),d.appendChild(B),g.push(B));const q=B;q.setAttribute("inputmode","digits"===p.current.accept?"numeric":"text"),q.setAttribute("autocomplete","one-time-code"),q.setAttribute("maxlength",String(b())),"digits"===p.current.accept&&q.setAttribute("pattern","[0-9]*"),q.hasAttribute("aria-label")||q.hasAttribute("aria-labelledby")||q.setAttribute("aria-label",`Verification code, ${b()} ${"digits"===p.current.accept?"digits":"characters"}`);const z=()=>{const t=[...d.querySelectorAll(p.current.cells)];for(;t.length<b();){const e=document.createElement("span");e.dataset.cell="",e.setAttribute("aria-hidden","true"),q.parentElement===d?d.insertBefore(e,q):d.appendChild(e),g.push(e),t.push(e)}return t.slice(0,b())},I=t=>{let e=t.querySelector("[data-digit]");return e||(e=document.createElement("span"),e.dataset.digit="",t.appendChild(e),g.push(e)),e},W=(t,e,r,o,a,i,s,l=1,c=0,u=0,d=1)=>{const h=((t,e,r,n)=>{const o=`${t}|${Math.round(e)}x${Math.round(r)}|${n}`;let a=T.get(o);if(!a){a=document.createElement("canvas"),a.width=Math.max(2,Math.round(2*e)),a.height=Math.max(2,Math.round(2*r));const i=a.getContext("2d");i&&(i.scale(2,2),i.fillStyle="#fff",i.shadowColor="#fff",i.shadowBlur=3,i.font=`600 ${Math.round(.6*r)}px ${n}`,i.textAlign="center",i.textBaseline="middle",i.fillText(t,e/2,r/2+1)),T.set(o,a)}return a})(e,r.w,r.h,s);t.globalAlpha=l;const p=r.w*d,f=r.h*d,m=r.x+(r.w-p)/2+c,g=r.y+(r.h-f)/2+u;for(let e=0;e<r.h;e+=4)for(let s=0;s<r.w;s+=3){if(n(s+31*i,e)>1.3*o-.12)continue;const r=3*(1-o);t.drawImage(h,2*s,2*e,6,8,m+s*d+(n(s,e+a)-.5)*r,g+e*d+(n(e,s+a)-.5)*r,3*d,4*d)}t.globalAlpha=1},F=(t,e)=>{t.toggleAttribute("data-shown",e),m.set(I(t),"opacity",e?"1":"0")};P=e({host:d,outset:16,look:()=>({mark:"glyph",charset:" .:-=+*#%@",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:4,cellAspect:.62,glyphScale:.92,...p.current.look}),ink:()=>p.current.ink??"--ascii-ink-strong",kit:p,reducedMotion:()=>p.current.reducedMotion,resolution:2,onFail:()=>{P=null,m.restore(),z().forEach(t=>F(t,!0))},paint:({pen:t,w:e,h:r,now:n,still:o,box:s})=>{t.setTransform(2,0,0,2,0,0);const u=z(),h=o?0:Math.floor(n/110),p=getComputedStyle(d).fontFamily||"sans-serif";if("success"===x){const s=o?1:(n-k)/700,l=e/2,d=r/2;if(u.forEach(t=>F(t,!1)),s<.55){const e=(s/.55)**2;C.forEach((r,n)=>S[n]&&W(t,S[n],r,1,h,n,p,1-e**3,(l-r.x-r.w/2)*e,(d-r.y-r.h/2)*e,1-.65*e))}const f=a((s-.45)/.55);return f>0&&f<1&&(t.strokeStyle=c(.55*(1-f)),t.lineWidth=3,t.beginPath(),t.arc(l,d,18+44*(t=>1-(1-a(t))**3)(f),0,2*Math.PI),t.stroke()),((t,e,r,n)=>{if(n<=0)return;const o=[[e-20,r+1],[e-7,r+14],[e+21,r-14]],a=Math.hypot(13,13),i=Math.hypot(28,28);let s=n*(a+i);t.strokeStyle="#fff",t.lineWidth=8,t.lineCap="round",t.lineJoin="round",t.shadowColor="#fff",t.shadowBlur=4,t.beginPath(),t.moveTo(o[0][0],o[0][1]);const l=Math.min(1,s/a);if(t.lineTo(o[0][0]+(o[1][0]-o[0][0])*l,o[0][1]+(o[1][1]-o[0][1])*l),s-=a,s>0){const e=Math.min(1,s/i);t.lineTo(o[1][0]+(o[2][0]-o[1][0])*e,o[1][1]+(o[2][1]-o[1][1])*e)}t.stroke(),t.shadowBlur=0})(t,l,d+1,i(a((s-.4)/.45))),s<1}let f=!1;const m=n-E;return u.forEach((e,r)=>{const a=s(e),i=y[r];if(m<l&&w[r])return F(e,!1),W(t,w[r],a,1-m/l,h,r,p),void(f=!0);if(i){const s=o?1:(n-A[r])/300;if(F(e,s>=.7),s>=1)return;return f=!0,void(s>0&&W(t,i,a,s,h,r,p,s>.7?1-(s-.7)/.3:1))}if(F(e,!1),M&&r===y.length&&m>=l){const e=o?.6:.5-.5*Math.cos(n/1600*Math.PI*2);t.fillStyle=c(.2+.26*e),t.beginPath(),t.roundRect(a.x+a.w/2-1.5,a.y+a.h/2-11,3,22,1.5),t.fill(),f=!0}}),f}});const R=(t,e)=>{$.push(setTimeout(e,t))},j=()=>{$.forEach(clearTimeout),$=[]},D=()=>{d.dataset.state=x,"error"===x?q.setAttribute("aria-invalid","true"):q.removeAttribute("aria-invalid");const t=M&&"success"!==x?Math.min(y.length,b()-1):-1;z().forEach((e,r)=>{I(e).textContent=y[r]??"",e.toggleAttribute("data-active",r===t),P||F(e,!0),"success"===x&&P?(f.set(e,"transition","opacity 200ms, scale 240ms cubic-bezier(.16, 1, .3, 1)"),f.set(e,"opacity","0"),f.set(e,"scale",".86")):(e.style.removeProperty("opacity"),e.style.removeProperty("scale"))}),q.value!==y&&(q.value=y),P?.kick()},G=t=>{j(),"idle"!==x&&(x="idle",k=-1e9),w="",E=-1e9;const e=u(t,b(),p.current.accept),r=performance.now();let n=0;for(let t=0;t<e.length;t++)e[t]!==y[t]&&(A[t]=v()?-1e9:r+L*n++);y=e,D(),e.length===b()&&R(v()||!P?0:300+L*Math.max(0,n-1)+80,()=>p.current.onComplete?.(e)),L=0},J=()=>G(q.value),U=()=>{L=55},V=()=>{M=!0,D()},Z=()=>{M=!1,D()};return q.addEventListener("input",J),q.addEventListener("paste",U),q.addEventListener("focus",V),q.addEventListener("blur",Z),q.value?G(q.value):D(),r(()=>P,p,()=>{q.setAttribute("maxlength",String(b())),D(),P?.refresh()},{verify:t=>{j();const e=performance.now();if(t)return S=y,C=P?z().map(t=>P.box(t)):[],k=e,x="success",void D();w=y,E=v()||!P?e-l:e,x="error",D(),v()||"function"!=typeof d.animate||d.animate([{translate:"0"},{translate:"-9px"},{translate:"7px"},{translate:"-4px"},{translate:"2px"},{translate:"0"}],{duration:380,easing:"ease-out"});const r=y;R(v()||!P?0:l,()=>{w===r&&(w="",y="",D())})},clear:()=>{j(),w="",E=-1e9,k=-1e9,y="",x="idle",D()},fill(t){L=55,G(t)},get value(){return y},get state(){return x}},()=>{j(),q.removeEventListener("input",J),q.removeEventListener("paste",U),q.removeEventListener("focus",V),q.removeEventListener("blur",Z),m.restore(),f.restore();for(const t of g)t.remove();for(const t of d.querySelectorAll(p.current.cells))t.removeAttribute("data-shown"),t.removeAttribute("data-active");delete d.dataset.state})}var h=s;export{h as CODE_INPUT_DEFAULTS,u as cleanCode,d as codeInput};//# sourceMappingURL=chunk-MIZ2DUHU.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{mountField as e,hoverOf as t,narrow as r}from"./chunk-C3C7AYKL.js";var a={id:"field",name:"Field",description:"A word becomes the background, drawn by the GPU with a soft wake.",cellSize:13,speed:1,cursor:!0,mount:a=>e(a,(e,a)=>({scene:"flow",levels:"auto",charset:e.charset??" .,:-+"+e.text.replace(/\s+/g,"").toUpperCase(),font:'"Geist", Arial, sans-serif',fontWeight:500,cellSize:e.cellSize,cellAspect:.8,glyphScale:.76,color:"ink",shade:a?r()?.1:.4:0,background:"transparent",contrast:1.1,scale:r()?1.6:1,brightness:r()&&a?.08:0,vignette:0,speed:e.speed,maxPixelRatio:2,hover:t(e,"trail"),fluid:{radius:.09,refraction:.04,glow:.7,dissipation:1.3},lantern:{radius:.13,strength:.6,trail:.5,follow:11},trail:{strength:.9,radius:.4}}),{light:"#9a9891",dark:"#7d7b75"})};export{a as wordField};//# sourceMappingURL=chunk-MQJQIDO5.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{scenePreset as e}from"./chunk-C3C7AYKL.js";var n=e({id:"constellation",name:"Constellation",description:"Points wander and neighbours close enough are linked by fine lines that come and go.",cellSize:11,scene:"constellation",charset:" .·:+*#",hover:"lantern",tune:()=>({blend:"off"})});export{n as constellation};//# sourceMappingURL=chunk-NURPDP3Y.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{renderMaterial as i}from"./chunk-XPXMCXYI.js";import{mountCanvas as t}from"./chunk-BR6ZNJZW.js";var o=(i,t,o,r)=>{const e=.12+.06*Math.sin(.1*r),n=Math.sin(68*i),h=Math.sin(68*(i*Math.cos(e)+t*Math.sin(e)));return.8*Math.pow((n+h+2)/4,3)},r={id:"moire",name:"Moiré",description:"Two fine line fields overlap into broad, shifting bands.",cellSize:12,speed:1,cursor:!1,mount:r=>t(r,(t,r,e,n,h,s)=>i(o,t,r,e,n,{ditherStrength:s.ditherStrength,fontSize:s.fontSize,chars:s.chars,lightMode:s.lightMode,color:s.ink}))};export{r as moire};//# sourceMappingURL=chunk-O7SGY4YJ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{blank as t,mountPageField as e,pageHandle as n}from"./chunk-BTD6EFAW.js";import{styleKeeper as r}from"./chunk-S7RZP2MT.js";var o={font:'Georgia, "Times New Roman", serif',fontWeight:600};function i(e,n=o.font,r=o.fontWeight,i=520){const{canvas:c,pen:l}=t(1800,Math.max(1,Math.round(i))),s=Math.min(400,1700/Math.max(3,.56*[...e].length));return l.fillStyle="#fff",l.textAlign="center",l.textBaseline="middle",l.font=`${r} ${s}px ${n}`,l.fillText(e||" ",c.width/2,c.height/2+.05*s),c}function c(t,c={}){const l=(t.textContent??"").trim(),s={current:{...o,...c}};let a=s.current.text??l;const u=r(),f=()=>i(a,s.current.font,s.current.fontWeight,s.current.artHeight),d=!l;let h=null;h=e({host:t,layer:"over",look:()=>({mark:"glyph",scene:"none",charset:" .:-=+*#%@",font:'"Geist", Arial, sans-serif',fontWeight:500,cellSize:7,cellAspect:.8,glyphScale:.8,color:"ink",shade:0,contrast:1.3,levels:"auto",fit:"contain",focus:{x:.5,y:.5},hover:"trail",trail:{strength:.62,radius:.22},...s.current.look}),ink:()=>s.current.ink??"--ascii-ink-strong",source:f(),label:d?s.current.label??a:void 0,kit:s,reducedMotion:()=>s.current.reducedMotion,onFail:()=>{h=null,u.restore()}}),h&&l&&u.set(t,"color","transparent"),h&&document.fonts?.load?.(`${s.current.fontWeight} 100px ${s.current.font}`).then(()=>{h&&h.field.setSource(f())},()=>{});const x=e=>{if(e!==a)if(a=e,void 0!==s.current.text&&(s.current={...s.current,text:a}),h)if(h.field.setSource(f()),d)h.field.update({label:s.current.label??(a||" ")});else{for(const e of[...t.childNodes])e!==h.canvas&&e.remove();t.prepend(document.createTextNode(a))}else l&&(t.textContent=a)};return n(()=>h,s,t=>{void 0!==t.text&&t.text!==a?x(t.text):h&&h.field.setSource(f())},{setText:x,get text(){return a}},()=>u.restore())}export{i as wordArt,c as wordmark};//# sourceMappingURL=chunk-PCIAA2LL.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{blank as t,mountPageField as e,pageHandle as o,sleep as n,pulseAt as r}from"./chunk-BTD6EFAW.js";var i={saving:null,font:'"Geist", Arial, sans-serif'};function a(t,e){const o=t.getBoundingClientRect(),n=o.height?t.offsetHeight/o.height:1,r=e?.getBoundingClientRect().top??o.top+o.height;let i=e;for(;i&&i.parentElement!==t;)i=i.parentElement;let a=o.top;for(const e of Array.from(t.children)){if(e===i)break;if(void 0!==e.dataset?.asciiKit)continue;const t=e.getBoundingClientRect();t.height&&(a=Math.max(a,t.top+t.height))}return{middle:((a+r)/2-o.top)*n,height:(r-a)*n}}function l(e,o,n,r=i.font){const l=Math.max(2,Math.round(2*e.offsetWidth)),s=Math.max(2,Math.round(2*e.offsetHeight)),{canvas:c,pen:f}=t(l,s),d=f.createRadialGradient(l,0,0,l,0,.52*Math.hypot(l,s));d.addColorStop(0,"rgb(150 150 150)"),d.addColorStop(.4,"rgb(64 64 64)"),d.addColorStop(1,"rgb(0 0 0)"),f.fillStyle=d,f.fillRect(0,0,l,s);const h=o?a(e,n):null;if(o&&h&&h.height>=30){const t=Math.min(2*h.height*.9,.34*l),e=l-.07*l,n=2*h.middle+.04*t;f.font=`600 ${t}px ${r}`,f.letterSpacing=.04*-t+"px",f.textAlign="right",f.textBaseline="middle",f.lineJoin="round",f.lineWidth=.28*t,f.strokeStyle="rgb(0 0 0 / .85)",f.strokeText(o,e,n),f.fillStyle="#fff",f.fillText(o,e,n)}return c}function s(a,s={}){const c={current:{...i,...s}},f=(t=c.current.saving)=>l(a,t,(()=>{const t=c.current.price;return"string"==typeof t?a.querySelector(t):t??a.querySelector("[data-price]")})(),c.current.font);let d=null,h=0,u=0,g=0,p=null;p=e({host:a,look:()=>({mark:"dot",scene:"drift",scale:"number"==typeof innerWidth&&innerWidth<760?1.7:1,cellSize:4,cellAspect:1,dotScale:.92,color:"ink",shade:0,fit:"cover",focus:{x:.5,y:.5},levels:"none",contrast:1.1,brightness:-.04,drift:.5,hover:"lantern",lantern:{radius:.26,strength:.4,trail:.7,follow:8},trail:{strength:.9,radius:.4},fluid:{radius:.09,refraction:.03,glow:.6},...c.current.look}),ink:t=>c.current.ink??(t?"#aeaca5":"#5c5a55"),source:d=f(),kit:c,reducedMotion:()=>c.current.reducedMotion,onFail:()=>{p=null,m?.disconnect()}}),u=a.offsetWidth,g=a.offsetHeight;const m=p&&"function"==typeof ResizeObserver?new ResizeObserver(()=>{!p||Math.abs(a.offsetWidth-u)<2&&Math.abs(a.offsetHeight-g)<2||(u=a.offsetWidth,g=a.offsetHeight,h++,p.field.setSource(d=f()))}):null;m?.observe(a);const S=async e=>{const o=p?.field,r=d;if(d=e,!o)return;const i=++h;if(!r||p.still())return void await o.setSource(e);const a=t(e.width,e.height),l=a.pen,s=e.width,c=e.height,f=.34*s;for(let t=1;t<=9&&i===h;t++){const i=performance.now(),d=t/9*(s+2*f)-f,h=Math.max(0,Math.min(s,d));l.globalCompositeOperation="source-over",l.drawImage(r,0,0,s,c),h>0&&l.drawImage(e,0,0,h,c,0,0,h,c);const u=l.createLinearGradient(d-f,0,d+.4*f,0);u.addColorStop(0,"rgb(0 0 0 / 0)"),u.addColorStop(.72,"rgb(255 255 255 / .5)"),u.addColorStop(1,"rgb(0 0 0 / 0)"),l.globalCompositeOperation="lighter",l.fillStyle=u,l.fillRect(0,0,s,c),await o.setSource(a.canvas),await n(Math.max(0,48-(performance.now()-i)))}i===h&&p?.field===o&&await o.setSource(e)};return o(()=>p,c,()=>{S(f())},{sweep:()=>S(f()),saving:t=>(c.current={...c.current,saving:t},S(f(t))),pulse:(t,e=1.6)=>{p&&!p.still()&&r(p.field,t,e)}},()=>{h++,m?.disconnect()})}export{l as planArt,s as pricingGlow,a as savingRoom};//# sourceMappingURL=chunk-PFKYKAIP.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{mergeOptions as e,prefersReduced as t}from"./chunk-S7RZP2MT.js";import{disposeKit as r,setPosterSource as o}from"./chunk-3PCKMO6I.js";var s={standard:{label:"Classic ASCII",chars:" .:-=+*#%@"},asciify:{label:"Asciify",chars:" .:-=+YCIFSA#@"},minimal:{label:"Minimal",chars:" .:+"},detailed:{label:"Detailed",chars:" .,:;-~=+*xX#%@"},letters:{label:"Letters",chars:" .liLTYCFSAWM"},technical:{label:"Technical",chars:" ._:;+/>=][{}*$#@"},blocks:{label:"Tonal blocks",chars:" ░▒▓█"},braille:{label:"Braille",chars:" ⠁⠃⠇⡇⣇⣧⣷⣿"}},n=(e,t,r,o)=>"number"==typeof e&&Number.isFinite(e)?Math.min(o,Math.max(r,e)):t;function i(e){if(!e)return;if("dots"===e)return" ·∙•●";const t=s[e];return t&&Object.prototype.hasOwnProperty.call(s,e)?t.chars:e.startsWith(" ")?e:" "+e}function c(s,c){if(!c||!c.preset||"function"!=typeof c.preset.mount)throw new TypeError("background() needs a preset, such as `aurora` imported from asciify-engine/kit.");const l=c.preset;let a=c.poster;const u=e=>({...e,poster:e.preset===l?a:void 0}),p={current:u({...c})};let y=null,d=!1,f=!1;const m=new Set,h=()=>{const e=p.current,t=e.preset;return{speed:n(e.speed,t.speed,0,5),cellSize:n(e.cellSize,t.cellSize,3,96),charset:i(e.charset),cursor:"none"!==e.look?.hover&&(e.cursor??t.cursor),mark:"glyph"===e.mark||"dot"===e.mark?e.mark:void 0,clear:e.clear??!1,dither:n(e.dither,0,0,1),accent:e.accent,text:e.text?.trim()||"ASCIIFY",look:e.look}},b=e=>{const t=p.current,r=t.palette;return("string"==typeof r?r:r?.[e?"dark":"light"])??t.color??t.ink},k=()=>String(n(p.current.opacity,p.current.preset.opacity??1,0,1)),g=()=>!!(p.current.reducedMotion??t()),v=e=>{let t=null;if(t=p.current.preset.mount({host:s,kit:p,settings:h,ink:b,reducedMotion:()=>p.current.reducedMotion,onFail:()=>{y===t&&(y=null)}}),!t)return null;const r=t.canvas.style;return e&&(r.opacity="0",r.transition="opacity 320ms cubic-bezier(.16, 1, .3, 1)",t.canvas.offsetWidth),r.opacity=k(),d&&t.pause(),t},S={position:s.style.getPropertyValue("position"),isolation:s.style.getPropertyValue("isolation")},P=(e,t)=>{t?s.style.setProperty(e,t):s.style.removeProperty(e)};let M=!1;const C=e=>{M=!0,e.destroy(),y&&!f&&("function"==typeof getComputedStyle&&"static"===getComputedStyle(s).position&&s.style.setProperty("position","relative"),s.style.setProperty("isolation","isolate"))},T=e=>{if(f||!e||"function"!=typeof e.mount||e===p.current.preset)return;p.current=u({...p.current,preset:e});const t=y;y=v(!!t&&!g()),t&&(e=>{if(g())return void C(e);e.canvas.style.transition="opacity 320ms cubic-bezier(.16, 1, .3, 1)",e.canvas.style.opacity="0";const t={run:e,timer:setTimeout(()=>{m.delete(t),C(e)},340)};m.add(t)})(t)};y=v(!1);return{get supported(){return!!y&&!f},get field(){return f?null:y?.field??null},get preset(){return p.current.preset},update(t){if(f||!t)return;const{preset:r,...s}=t;"poster"in s&&(a=s.poster),p.current=u(e(p.current,s)),s.poster&&p.current.poster&&o(p,s.poster),r&&r!==p.current.preset?T(r):y&&(y.canvas.style.opacity=k(),y.refresh())},play(){!f&&d&&(d=!1,y?.play())},pause(){f||(d=!0,y?.pause())},setPreset:T,destroy(){if(!f){f=!0;for(const e of m)clearTimeout(e.timer),e.run.destroy(),M=!0;m.clear(),y?.destroy(),y=null,M&&(P("position",S.position),P("isolation",S.isolation)),r(p)}}}}export{c as background,i as backgroundCharset};//# sourceMappingURL=chunk-PIU2BMFU.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{renderMaterial as t}from"./chunk-XPXMCXYI.js";import{mountCanvas as e}from"./chunk-BR6ZNJZW.js";var o=(t,e,o,r)=>{const h=2.8*t+1.8*e+.018*r,a=1.2*t-3.2*e,i=Math.abs(2*(h-Math.floor(h))-1),n=Math.abs(2*(a-Math.floor(a))-1);return.85*Math.pow(Math.min(i,n),1.8)},r={id:"facet",name:"Facet",description:"Quiet folded planes catch light along their edges.",cellSize:12,speed:1,cursor:!1,mount:r=>e(r,(e,r,h,a,i,n)=>t(o,e,r,h,a,{ditherStrength:n.ditherStrength,fontSize:n.fontSize,chars:n.chars,lightMode:n.lightMode,color:n.ink}))};export{r as facet};//# sourceMappingURL=chunk-QALCXKU6.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{scenePreset as e}from"./chunk-C3C7AYKL.js";var r=e({id:"contour",name:"Contour",description:"Survey lines over a slowly shifting terrain, every fifth an index line.",cellSize:11,scene:"contour",charset:" .·-~=",hover:"lantern"});export{r as contour};//# sourceMappingURL=chunk-QRCXXS5Z.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{renderMaterial as t}from"./chunk-XPXMCXYI.js";import{mountCanvas as e}from"./chunk-BR6ZNJZW.js";var n=(t,e,n,i)=>{const r=.2*Math.sin(3*t+2*e+.2*i);return(.65*Math.pow(.5+.5*Math.sin(45*(t+r)),8)+.35*Math.pow(.5+.5*Math.sin(50*(e-.3*r)),10))*(.4+.6*Math.sin(2*e+.4))},i={id:"weave",name:"Weave",description:"Interlaced threads with a subtle change in tension.",cellSize:12,speed:1,cursor:!1,mount:i=>e(i,(e,i,r,h,o,a)=>t(n,e,i,r,h,{ditherStrength:a.ditherStrength,fontSize:a.fontSize,chars:a.chars,lightMode:a.lightMode,color:a.ink}))};export{i as weave};//# sourceMappingURL=chunk-RFLIFKZ4.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{styleKeeper as t,mountSurface as e,easeOut as o,handle as n}from"./chunk-S7RZP2MT.js";var a={blocks:"[data-block]",shimmer:1400,resolve:420,stagger:60,develop:640},r=t=>`rgb(${255*t} ${255*t} ${255*t})`,l=(t,e,n)=>t<0?0:o((t-e)/n,3),i=t=>parseFloat(t)||0;function s(t,e,o=1){const n=getComputedStyle(t),a=t.getBoundingClientRect(),r=n.borderTopLeftRadius,l=r.endsWith("%")?i(r)/100*Math.min(a.width,a.height):i(r);if("text"!==e)return{radius:l/o,lines:[]};const s=i(n.fontSize)||14,c="normal"===n.lineHeight?1.2*s:i(n.lineHeight),u=Math.min(c,.62*s),h=new Map,m="undefined"!=typeof document&&"function"==typeof document.createRange?document.createRange():null;m?.selectNodeContents(t);for(const t of m?[...m.getClientRects()]:[]){if(!t.width)continue;const e=Math.round((t.top+t.bottom)/2/Math.max(1,c/2)),o=h.get(e);h.set(e,o?{left:Math.min(o.left,t.left),right:Math.max(o.right,t.right),top:Math.min(o.top,t.top),bottom:Math.max(o.bottom,t.bottom)}:{left:t.left,right:t.right,top:t.top,bottom:t.bottom})}const d=[...h.values()].map(t=>{const e=Math.max(t.left,a.left),n=Math.min(t.right,a.right),r=(t.top+t.bottom)/2;return{x:(e-a.left)/o,y:(r-u/2-a.top)/o,w:Math.max(0,n-e)/o,h:u/o}}).filter(t=>t.w>0);return d.length||d.push({x:0,y:(a.height-u)/2/o,w:a.width/o,h:u/o}),{radius:(l||u/2)/o,lines:d}}function c(t){const e=t.dataset.block;return"text"===e||"photo"===e||"avatar"===e?e:"IMG"===t.tagName||"PICTURE"===t.tagName||"VIDEO"===t.tagName?/^50%|^9999px/.test(getComputedStyle(t).borderTopLeftRadius)?"avatar":"photo":"text"}function u(i,u={}){const h={current:{...a,...u}},m=t();let d=0,f=null,g=null,p=null,b=null;const M=()=>[...i.querySelectorAll(h.current.blocks)].map((t,e)=>({el:t,kind:c(t),delay:void 0!==t.dataset.delay?Number(t.dataset.delay):80+e*h.current.stagger})),y=["mask-image","-webkit-mask-image"],k=()=>{m.restore(),i.removeAttribute("aria-busy"),g?.(),g=null};b=e({host:i,look:()=>({mark:"glyph",charset:" .:-=+*#%@",cellSize:5,cellAspect:.62,glyphScale:.92,font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,contrast:1.15,shade:.35,...h.current.look}),ink:()=>h.current.ink??"--ascii-ink-strong",kit:h,reducedMotion:()=>h.current.reducedMotion,onFail:()=>{b=null,k()},paint:({pen:t,now:e,still:n,box:a,w:i})=>{if(null!==f&&n)return k(),!1;const c=h.current,u=null===f?-1:e-f;if(null!==f&&u>Math.max(h.current.develop,...M().map(t=>t.delay+h.current.resolve))+16)return k(),!1;null!==f&&(t=>{for(const{el:e,kind:o,delay:n}of M()){const a=l(t,n,h.current.resolve);if(m.set(e,"opacity",String("text"===o?Math.min(1,1.6*a):a)),"text"===o){const t=128*a-14;for(const o of y)m.set(e,o,a>=1?"none":`linear-gradient(90deg, #000 ${t-14}%, transparent ${t+14}%)`)}}})(u);const g=Math.max(140,.42*i),p=i+g,b=-g+(n?.4:(e-d)/c.shimmer%1)*p,x=n?1:o((e-d)/280,3),v=t.createLinearGradient(b-p,0,b+p,.08*p);for(let t=0;t<=32;t++){const e=Math.abs(t/16-1)*p,o=Math.min(e,Math.abs(p-e)),n=o<g?.5+.5*Math.cos(o/g*Math.PI):0;v.addColorStop(t/32,r(.24+(.54-.24)*n))}const w=(e,o,n,a,r)=>{t.beginPath(),t.roundRect(e,o,Math.max(0,n),a,Math.min(r,a/2,Math.max(0,n)/2))};for(const{el:e,kind:n,delay:r}of M()){const{x:i,y:h,w:m,h:d}=a(e),f=e.getBoundingClientRect().width,g=s(e,n,f&&m?f/m:1),p=l(u,r,c.resolve);if(t.fillStyle=v,"photo"===n){const n=u<0?0:o(u/c.develop,4);t.globalAlpha=(1-p)*x,w(i,h,m,d,g.radius),t.fill();const a=e instanceof HTMLImageElement?e:e.querySelector("img");if(n>0&&a?.complete&&a.naturalWidth){const e=Math.max(m/a.naturalWidth,d/a.naturalHeight),o=a.naturalWidth*e,r=a.naturalHeight*e;t.save(),w(i,h,m,d,g.radius),t.clip(),t.globalAlpha=n*(1-p),t.drawImage(a,i+(m-o)/2,h+(d-r)/2,o,r),t.restore()}}else if("avatar"===n)t.globalAlpha=(1-p)*x,t.beginPath(),t.arc(i+m/2,h+d/2,Math.min(m,d)/2,0,2*Math.PI),t.fill();else{t.globalAlpha=x*(1-p);for(const e of g.lines){const o=i+e.x,n=o+e.w*p;w(n,h+e.y,o+e.w-n,e.h,g.radius),t.fill()}}t.globalAlpha=1}return!0}});const x=()=>{const t=null!==f;if(d=performance.now(),f=null,i.setAttribute("aria-busy","true"),b){if(t&&!b.still())for(const{el:t}of M())t.animate?.([{opacity:1},{opacity:0}],{duration:240,easing:"cubic-bezier(.16, 1, .3, 1)"});(()=>{for(const{el:t}of M()){m.set(t,"opacity","0");for(const e of y)t.style.removeProperty(e)}})(),b.kick()}};return x(),n(()=>b,h,()=>b?.refresh(),{resolve:()=>b?(null!==f&&p||(f=performance.now(),p=new Promise(t=>{g=t}),b.kick()),p):(i.removeAttribute("aria-busy"),Promise.resolve()),reset(){g?.(),g=null,p=null,x()},get loading(){return null===f}},()=>{k()})}var h=a;export{h as SKELETON_DEFAULTS,c as blockKind,s as blockShape,u as skeleton};//# sourceMappingURL=chunk-ROR6MG3K.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{snapshot as e}from"./chunk-4OT66HSZ.js";import{styleKeeper as t,mountSurface as o,clamp as r,house as n}from"./chunk-S7RZP2MT.js";var a={duration:620,collapse:!0,remove:!1},i=16,l=new WeakMap;function s(s,c={}){const d=l.get(s);if(d)return d;const h={...a,...c},p=t(),u=s.offsetHeight,g=()=>{for(const e of s.children)p.set(e,"opacity","0");p.set(s,"color","transparent"),p.set(s,"pointer-events","none"),s.setAttribute("aria-hidden","true")},f=e=>{h.collapse&&(p.set(s,"box-sizing","border-box"),p.set(s,"overflow","hidden"),p.set(s,"min-height","0"),p.set(s,"height",`${(u*(1-e)).toFixed(2)}px`),e>=1&&(p.set(s,"padding-block","0"),p.set(s,"margin-block","0"),p.set(s,"border-width","0")))},m=h.host??s.parentElement??s;let k=0,b=!1,w=null,v={x:0,y:0,w:0,h:0},x=()=>{};const y=o({host:m,look:()=>({mark:"glyph",charset:" .:-=+*#%@",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:5,cellAspect:.62,glyphScale:.92,contrast:1.6,drift:5,...h.look}),outset:i,resolution:2,ink:()=>h.ink??"--ascii-ink-strong",kit:{current:{lazy:!1,globalLook:h.globalLook}},reducedMotion:()=>h.reducedMotion,onFail:()=>x(),paint:({pen:e,now:t,still:o,scale:a})=>{if(o)return queueMicrotask(x),!1;if(!w||!b)return!1;const l=t-k,s=r(l/h.duration);e.setTransform(a,0,0,a,0,0),l>=300&&f(n(r((l-300)/260))),e.save(),e.globalAlpha=r(2.2*(1-s))*(1-.9*s*s),e.translate(8*s,-14*s),e.drawImage(w,0,0,w.width/2,w.height/2),e.globalCompositeOperation="destination-out";const c=v.x+v.w,d=c-(1.3*s-.3)*v.w,p=c-1.3*s*v.w,u=e.createLinearGradient(p,0,Math.max(p+1,d),0);u.addColorStop(0,"rgba(0,0,0,0)"),u.addColorStop(1,"rgba(0,0,0,1)"),e.globalAlpha=1,e.fillStyle=u,e.fillRect(v.x-i,v.y-i,v.w+32,v.h+32),e.restore();const g=l>=Math.max(h.duration,h.collapse?560:0);return g&&queueMicrotask(x),!g}}),M=new Promise(t=>{let o=!1;if(x=()=>{o||(o=!0,y?.destroy(),f(1),h.remove&&s.remove(),l.delete(s),t())},!y||y.still())return g(),void x();v=y.box(s),w=e(s,y.canvas.clientWidth||v.w+32,y.canvas.clientHeight||v.h+32,y.box).canvas;y.field.ready.then(()=>{o||b||(g(),b=!0,k=performance.now(),y.kick())},()=>{g(),x()})});return l.set(s,M),M}var c=a;export{c as DISINTEGRATE_DEFAULTS,s as disintegrate};//# sourceMappingURL=chunk-S62H7ZIU.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{parseColor as t,hash2 as e}from"./chunk-ZCHGV2CV.js";import{mountCanvas as o}from"./chunk-BR6ZNJZW.js";function r(o,r,c,n,l={}){const{fontSize:i=14,chars:s=" ·∙•:-=+*#",color:a,accentColor:h,speed:f=.5,harmonics:m=3,lightMode:p=!1}=l,g=h??(p?"#6b8700":"#d4ff00"),M=.62*i,d=1.4*i,$=Math.ceil(r/M),u=Math.ceil(c/d);o.clearRect(0,0,r,c),o.font=`${i}px monospace`,o.textBaseline="top";let b=255,S=255,x=255;if(p&&(b=55,S=55,x=55),a){const e=t(a);e&&(b=e.r,S=e.g,x=e.b)}let z=212,C=255,k=0;const y=t(g);y&&(z=y.r,C=y.g,k=y.b);const Z=n*f,j=Array.from({length:m},(t,e)=>1/(e+1)).reduce((t,e)=>t+e,0);for(let t=0;t<u;t++)for(let r=0;r<$;r++){let c=0;for(let o=0;o<m;o++){const n=.18+1.4*e(r*(o+3)+7,t*(o+5)+11),l=e(r*(o+7),t*(o+9)+3)*Math.PI*2,i=1/(o+1);c+=Math.sin(Z*n+l)*i}const n=.5*(c/j+1);if(n<.28)continue;const l=(n-.28)/.72,i=s[Math.min(s.length-1,Math.floor(l*s.length))],a=n>.88,h=p?.82*l:.13*l;o.fillStyle=a?`rgba(${z},${C},${k},${p?.92:.28})`:`rgba(${b},${S},${x},${h})`,o.fillText(i,r*M,t*d)}}var c={id:"morph",name:"Morph",description:"Every cell shimmers at its own frequencies.",cellSize:14,speed:1,cursor:!1,mount:t=>o(t,(t,e,o,c,n,l)=>r(t,e,o,c,{fontSize:l.fontSize,chars:l.chars,lightMode:l.lightMode,color:l.ink,accentColor:l.accent}))};export{c as morph,r as renderMorphBackground};//# sourceMappingURL=chunk-SARCZMLN.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{clamp as t,hash as e,mountSurface as r,handle as a,smoothstep as n}from"./chunk-S7RZP2MT.js";var o={colorful:["#22c55e","#06b6d4","#6366f1","#d946ef","#f43f5e","#f59e0b"],mono:["#ffffff"],ocean:["#22d3ee","#3b82f6","#2dd4bf","#818cf8"],sunset:["#f97316","#f43f5e","#ec4899","#fbbf24"]},s={palette:"colorful",mode:"rotate",grain:"dots",speed:1,hover:!0,depth:18},i=["rotate","pulse","progress"],l=t=>{const e=/^#[\da-f]{3}$/i.test(t)?`#${[...t.slice(1)].map(t=>t+t).join("")}`:t;return[1,3,5].map(t=>(parseInt(e.slice(t,t+2),16)||0)/255)},h=(t,e,r)=>t.map((t,a)=>t+(e[a]-t)*r),c=l("#ff4a4a"),u=l("#2fd67b");function p(t){const e=("string"==typeof t?o[t]??o.colorful:t.length?t:o.colorful).map(l),r=new Float32Array(1024);for(let t=0;t<256;t++){const a=t/256*e.length,n=Math.floor(a),o=a-n,s=1===e.length?e[0]:h(e[n%e.length],e[(n+1)%e.length],o*o*(3-2*o)),i=Math.max(...s,.01);r.set([s[0]/i,s[1]/i,s[2]/i,(.2126*s[0]+.7152*s[1]+.0722*s[2])/i],4*t)}return r}var m=(t,e)=>{const r=(-t%1+1)%1,a=1-r;return Math.max(r<e?(1-r/e)**2.2:0,a<.03?(1-a/.03)**2:0)},M=t=>Math.max(m(t,.3),.75*m(t-.5,.22)),f=(t,e)=>t<=e?.42+.4*(t/Math.max(e,.001))**1.6+.38*Math.exp(-(((e-t)/.03)**2)):t-e<.014?1.2*(1-(t-e)/.014)**2:0,d=(e,r)=>t((e-.68*r)/.07);function g(t,r,a,n,o,s,i){const l=Math.ceil(t/a),h=t/2,c=r/2,u=Math.min(h,c),[p,m,M,f]=[0,1,2,3].map(t=>Math.max(0,Math.min(s[t]??s[0]??0,u))),d=new Int32Array(l*Math.ceil(r/n)).fill(-1),g=[],x=[],v=[];for(let t=0;t<d.length;t++){const r=(t%l+.5)*a-h,s=(Math.floor(t/l)+.5)*n-c,u=r<0?s<0?p:f:s<0?m:M,k=Math.abs(r)-h+u,b=Math.abs(s)-c+u,y=-(Math.hypot(Math.max(k,0),Math.max(b,0))+Math.min(Math.max(k,b),0)-u),L=y>0?Math.min(Math.max(0,1-y/Math.max(1,o))**1.7,y/Math.max(.1,i)):0;if(L<.004)continue;d[t]=g.length,g.push(L);const w=Math.atan2(s/Math.max(1,c),r/Math.max(1,h))/(2*Math.PI)+.25,A=w-Math.floor(w);x.push(A),v.push(.78*e(Math.floor(46*A),5)+.22*e(t,9))}const k=Math.max(1,Math.round(t)),b=Math.max(1,Math.round(r)),y=[],L=[];for(let t=0;t<b;t++)for(let e=0;e<k;e++){const r=d[Math.min(l-1,Math.floor((e+.5)/a))+l*Math.floor((t+.5)/n)];r>=0&&(y.push(t*k+e),L.push(r))}return{W:k,H:b,weight:Float32Array.from(g),turn:Float32Array.from(x),crack:Float32Array.from(v),pixel:Int32Array.from(y),owner:Int32Array.from(L)}}function x(o,l={}){const h={current:{...s,...l}};let m="idle",x=0,v=p(h.current.palette),k=!1;const b=()=>"mono"===h.current.palette,y=()=>({..."glyphs"===h.current.grain?{mark:"glyph",charset:" ·.:-+*",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:5,cellAspect:.6,glyphScale:1}:{mark:"dot",cellSize:3.5,cellAspect:1,dotScale:.82},color:b()?"ink":"source",saturation:1.25,shade:.55,contrast:2.4,brightness:.58,...h.current.look}),L=t=>{const e=!t.dark();t.canvas.style.opacity=e?"0.72":"",t.canvas.style.filter=e&&!b()?"brightness(1.45) saturate(.9)":""};let w=null,A=null,I=new Uint8Array(0),$="",E=0,F=null,P=0,R=.62,S=0,T=0,W=0,j=0,z=0,H=0;const B={rotate:0,pulse:0,progress:0};B[h.current.mode]=1;let D=null;D=r({host:o,look:y,ink:t=>h.current.ink??(t?"#b3b1aa":"#8a8882"),kit:h,reducedMotion:()=>h.current.reducedMotion,onTheme:()=>D&&L(D),onFail:()=>{D=null},resolution:(t,e)=>[Math.max(1,Math.round(t)),Math.max(1,Math.round(e))],paint:r=>{const{pen:a,w:s,h:l,now:p,still:b,dark:L}=r,U=h.current,C=getComputedStyle(o),G=Math.min(o.clientWidth||s,o.clientHeight||l),N=Math.max(2,Math.min(U.depth,Math.min(parseFloat(C.paddingTop)||U.depth,parseFloat(C.paddingLeft)||U.depth)-2)),Z=[C.borderTopLeftRadius,C.borderTopRightRadius,C.borderBottomRightRadius,C.borderBottomLeftRadius].map(t=>((t,e)=>t.endsWith("%")?parseFloat(t)/100*e:parseFloat(t)||0)(t??"",G)),q=y(),J="dot"!==q.mark,K=q.cellSize??(J?5:3.5),O=q.cellAspect??(J?.6:1),Q=`${s}x${l}:${U.grain}:${N}:${Z.join(",")}:${K}:${O}`;if(Q!==$){$=Q,D.canvas.style.clipPath=`inset(0 round ${Z.map(t=>`${t}px`).join(" ")})`;const t=Math.min(globalThis.devicePixelRatio||1,q.maxPixelRatio??2),e=Math.max(2,Math.round(K*t)),r=Math.max(2,Math.round(e*O))/t,n=e/t;w=g(s,l,r,n,N,Z,J?Math.min(r,n)/2:(q.dotScale??.82)*r/2),A=a.createImageData(w.W,w.H),I=new Uint8Array(3*w.weight.length)}const V=w,X=A.data,Y=V.crack,_=(e,r,n,o,s)=>{I.fill(0);for(let a=0;a<V.weight.length;a++){const i=V.turn[a],l=t(V.weight[a]*e(i,a))*(L?1.12:.8);if(l<.03)continue;const h=4*(255&Math.floor(((i-r)%1+1)%1*256));let p=v[h],m=v[h+1],M=v[h+2],f=v[h+3];const d=s&&L?s(i):0;(o>0||n>0||d>0)&&(o>0&&(p+=(u[0]-p)*o,m+=(u[1]-m)*o,M+=(u[2]-M)*o),n>0&&(p+=(c[0]-p)*n,m+=(c[1]-m)*n,M+=(c[2]-M)*n),d>0&&(p+=(1-p)*d,m+=(1-m)*d,M+=(1-M)*d),f=.2126*p+.7152*m+.0722*M);const g=255*Math.min(1,(l+.12)/2.4/Math.max(f,.01));I[3*a]=p*g,I[3*a+1]=m*g,I[3*a+2]=M*g}X.fill(0);for(let t=0;t<V.pixel.length;t++){const e=4*V.pixel[t],r=3*V.owner[t];X[e]=I[r],X[e+1]=I[r+1],X[e+2]=I[r+2],X[e+3]=255}a.putImageData(A,0,0)};if(b){const t="progress"===U.mode?t=>"running"===m||"error"===m?f(t,x):.14:t=>("running"===m?.75:.55)*(.7+.3*Math.cos(2*Math.PI*(t-.12)));return"success"===m?_(()=>.62,0,0,.9):"error"===m?_((e,r)=>.5*t(e)*d(Y[r],1),0,.9,0):_(t,0,0,0),!1}const tt=E?Math.min(48,p-E):16;E=p,m!==F&&("running"===m&&"running"!==F&&(z=0),P=p,F=m);let et=p-P;"success"===m&&et>2700&&(m=F="idle",x=0,P=p,et=0);const rt="running"===m,at="error"===m,nt="success"===m,ot=U.hover&&k;for(const t of i)B[t]+=((t===U.mode?1:0)-B[t])*(1-Math.exp(-tt/260));if(at)T=0;else{const t=(rt?1500-500*x:"pulse"===U.mode?9e3:2600)/Math.max(.05,U.speed);T+=(1/t*(ot?1.35:1)-T)*(1-Math.exp(-tt/320)),R+=T*tt,H+=tt,S+=tt/("pulse"===U.mode?14e3:26e3)*(1-B.progress),(rt||nt)&&(z+=((nt?1:x)-z)*(1-Math.exp(-tt/110)))}W+=((ot?1:0)-W)*(1-Math.exp(-tt/220)),j=at?.9*n(0,60,et):j*Math.exp(-tt/180);const st=1+.22*W,it=.32+.68*(.5-.5*Math.cos(2*Math.PI*H/2400)),lt=.05+.1*(.5-.5*Math.cos(2*Math.PI*H/5200)),ht=rt||nt||at,ct=t=>st*(B.rotate*M(t-R)+B.pulse*(rt||at?M(t-R):it*(.78+.22*Math.cos(2*Math.PI*(t-R))))+B.progress*(ht?f(t,z):lt));if(nt){const e=n(0,260,et),r=t((et-240)/620),a=1-n(860,1060,et),o=n(780,1e3,et),s=n(1350,2450,et),i=(L?.86:.55)*e*(1-o)+.62*o*(1-s),l=1-e*(1-n(1900,2700,et)*(1-B.progress)),h=t=>{if(et<240)return 0;const e=r-t;return a*(e>=0?e<.2?(1-e/.2)**2:0:e>-.02?(1+e/.02)**2:0)};return _(t=>Math.max(ct(t)*l,i*(.9+.1*Math.cos(2*Math.PI*(t-.1))),1.3*h(t),B.progress*lt*s),S,0,.9*o*(1-s),e=>t(.8*h(e))),!0}if(at){const t=et<90?1.2:et<170?.1:et<260?1.2:et<340?.1:1,r=n(380,1150,et),a=1-.5*n(700,1500,et),o=Math.floor(et/50);return _((n,s)=>{const i=d(Y[s],r);return i<=0?0:ct(n)*t*i*a*(1-1.4*r*(1-r)*e(s,o))},S,j,0),et<1600||Math.abs(W-(ot?1:0))>.01}return _(ct,S,j,0),!0}});const U=()=>{k||(k=!0,D?.kick())},C=()=>{k=!1,D?.kick()},G=t=>{k=t.target?.matches?.(":focus-visible")??!1,D?.kick()};D&&(L(D),o.addEventListener("pointerenter",U),o.addEventListener("pointermove",U),o.addEventListener("pointerleave",C),o.addEventListener("focusin",G),o.addEventListener("focusout",C));const N=t=>{m=t,D?.kick()};return a(()=>D,h,t=>{v=p(t.palette),D?.refresh(),D&&L(D)},{progress(e){x=t(Number.isFinite(e)?e:0),N("running")},success(){N("success")},error(){N("error")},reset(){x=0,N("idle")}},()=>{o.removeEventListener("pointerenter",U),o.removeEventListener("pointermove",U),o.removeEventListener("pointerleave",C),o.removeEventListener("focusin",G),o.removeEventListener("focusout",C)})}var v=s;export{v as BEAM_DEFAULTS,o as BEAM_PALETTES,x as beam,M as beamArcs,g as beamBand,d as beamCracked,p as beamPalette,f as beamRing};//# sourceMappingURL=chunk-SNCXU7KF.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{renderMaterial as t}from"./chunk-XPXMCXYI.js";import{mountCanvas as i}from"./chunk-BR6ZNJZW.js";var o=(t,i,o,r)=>{const e=5.5*(t-.5*o)+.65*Math.sin(3.2*i+.2*r)+.12*r;return Math.pow(.5+.5*Math.cos(e),7)*(.45+.55*Math.sin(2.4*i+.2))},r={id:"veil",name:"Veil",description:"Tall folds of light drifting across a quiet ground.",cellSize:12,speed:1,cursor:!1,mount:r=>i(r,(i,r,e,n,h,s)=>t(o,i,r,e,n,{ditherStrength:s.ditherStrength,fontSize:s.fontSize,chars:s.chars,lightMode:s.lightMode,color:s.ink}))};export{r as veil};//# sourceMappingURL=chunk-T3GWGPST.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{velocity as t,stepSpring as e}from"./chunk-2NVKPXPL.js";import{clamp as r,styleKeeper as n,mountSurface as o,handle as a,prefersReduced as i}from"./chunk-S7RZP2MT.js";var l={cards:"[data-card]",loop:!0,threshold:.4,outset:56},h=(t,e,r)=>t+(e-t)*r,s=(t,e,r)=>({x:t,v:0,to:t,k:e,z:r}),c=Array.from({length:96},(t,e)=>{const r=43758.5453*Math.sin(127.1*e+311.7);return r-Math.floor(r)});function d(t,e,n=.04){if(!t.complete||!t.naturalWidth)return null;const o=Math.min(1,420/Math.max(t.naturalWidth,t.naturalHeight)),a=document.createElement("canvas");a.width=Math.max(1,Math.round(t.naturalWidth*o)),a.height=Math.max(1,Math.round(t.naturalHeight*o));const i=a.getContext("2d",{willReadFrequently:!0});if(!i)return null;try{i.drawImage(t,0,0,a.width,a.height);const o=i.getImageData(0,0,a.width,a.height),l=o.data,h=new Uint32Array(256),s=l.length/4,c=t=>.2126*l[t]+.7152*l[t+1]+.0722*l[t+2];for(let t=0;t<l.length;t+=4)h[Math.round(c(t))]++;let d=0,u=255,g=0;for(let t=0;t<256;t++)if(g+=h[t],g>=.02*s){d=t;break}g=0;for(let t=255;t>=0;t--)if(g+=h[t],g>=.02*s){u=t;break}const m=Math.max(1,u-d);for(let t=0;t<l.length;t+=4){let o=r((c(t)-d)/m);e&&(o=1-o),l[t]=l[t+1]=l[t+2]=Math.round(255*(n+(1-n)*o)),l[t+3]=255}return i.putImageData(o,0,0),a}catch{return null}}function u(u,g={}){const m={current:{...l,...g}},p=n(),f=()=>!!(m.current.reducedMotion??i()),v=()=>[...u.querySelectorAll(m.current.cards)];let x=0,M=s(0,380,.72),w=s(0,380,.8),b=s(0,260,.9),y=!1,k=0,A=0,E=null,L=[],I=0,S=0,C=-1,R=new Map,$=null,P=null;const W=t=>v()[F(t)]??null,q=()=>u.clientWidth||160,F=t=>{const e=v().length;return e?(t%e+e)%e:0},T=(t,e,r,n)=>{const o=W(t);if(!o||!m.current.loop&&t>=v().length)return null;const a="IMG"===o.tagName?o:o.querySelector("img"),i=`${a?.currentSrc||a?.src||""}|${a?.complete}|${Math.round(e)}x${Math.round(r)}|${n}`,l=R.get(o);if(l?.key===i)return l.canvas;const h=document.createElement("canvas");h.width=Math.max(1,Math.round(e)),h.height=Math.max(1,Math.round(r));const s=h.getContext("2d");if(!s)return null;const c=m.current.radius??(parseFloat(getComputedStyle(u).borderTopLeftRadius)||16);s.beginPath(),s.roundRect(0,0,h.width,h.height,Math.min(c,h.width/2,h.height/2)),s.clip();const g=a?d(a,n):null;if(g){const t=Math.max(h.width/g.width,h.height/g.height),e=h.width/t,r=h.height/t;s.drawImage(g,(g.width-e)/2,(g.height-r)/2,e,r,0,0,h.width,h.height)}else s.fillStyle="rgb(60 60 60)",s.fillRect(0,0,h.width,h.height);return s.strokeStyle="rgb(150 150 150)",s.lineWidth=6,s.stroke(),R.set(o,{key:i,canvas:h}),h};function D(){const t=v(),e=x+(E?1:0),r=!m.current.loop&&e>=t.length?null:W(e);t.forEach(t=>{P?(p.set(t,"opacity","0"),t!==r?t.setAttribute("aria-hidden","true"):t.removeAttribute("aria-hidden")):t.hidden=t!==r}),u.setAttribute("aria-label",r?`${r.getAttribute("aria-label")||r.querySelector("img")?.alt||r.textContent?.trim()||"Card"}. Left arrow to pass, right arrow to keep.`:"No more cards")}P=o({host:u,outset:m.current.outset,look:()=>({blend:"coarse",mark:"glyph",charset:" .:-=+*#%@",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:4,cellAspect:.62,glyphScale:.94,contrast:1.3,...m.current.look}),ink:()=>m.current.ink??"--ascii-ink-strong",kit:m,reducedMotion:()=>m.current.reducedMotion,onFail:()=>{P=null,p.restore(),D()},onTheme:()=>{R=new Map},paint:({pen:t,w:e,now:n,dark:o,box:a})=>{const i=a(u),l=i.w,s=i.h,d=i.x+l/2,g=i.y+s/2,m=r(b.x),p=(e,r,n,a,i=0)=>{const h=T(e,l,s,!o);!h||a<=0||(t.save(),t.translate(d,g+n),t.scale(r,r),t.globalAlpha=a,t.drawImage(h,-l/2,-s/2),i>0&&(t.globalCompositeOperation="destination-out",t.globalAlpha=i,t.drawImage(((t,e)=>{let r=$;if(!r||r.width!==Math.round(t)||r.height!==Math.round(e)){r=$=document.createElement("canvas"),r.width=Math.max(1,Math.round(t)),r.height=Math.max(1,Math.round(e));const n=r.getContext("2d");if(n)for(let t=0;t<r.height;t+=6)for(let e=0;e<r.width;e+=4){const r=43758.5453*Math.sin(12.9898*e+78.233*t);r-Math.floor(r)<.55&&(n.fillStyle="#000",n.fillRect(e,t,4,6))}}return r})(l,s),-l/2,-s/2)),t.restore())};p(x+2,h(.86,.93,m),h(24,12,m),h(.3,.55,m),.3),p(x+1,h(.93,1,m),h(12,0,m),h(.55,1,m),.4*(1-m));const f=T(x,l,s,!o);if(!f)return!1;const v=E?r((n-E.start)/620):0,y=E?.dir??1,k=E?E.x0+y*l*.9*(1-(1-v)**3):M.x,A=E?E.y0:w.x;if(t.save(),t.translate(d+k,g+A),t.rotate(.22*r(k/l,-1.6,1.6)),!E)return t.drawImage(f,-l/2,-s/2),t.restore(),!1;const L=Math.ceil(s/6);for(let n=0;n<L;n++){const o=c[n%c.length],a=r(1.55*v-.55*o);if(a>=1)continue;const i=y*a*a*l*(.5+.9*o),h=6*n,u=Math.min(6,s-h),g=y>0?d+k+i+.62*l:d+k+i-.62*l,m=y>0?e-4-g:g-4;t.globalAlpha=(1-a*a)*r(m/56),t.drawImage(f,0,h,l,u,-l/2+i,-s/2+h,l,u)}return t.restore(),!1}});const N=t=>{I=0;const n=Math.min(1/30,Math.max(0,(t-S)/1e3));S=t;let o=!1;y||E||(o=e(M,n,.3),o=e(w,n,.3)||o),o=e(b,n,.002)||o,E&&t-E.start>=620&&(E=null,x+=1,j()),(()=>{(m.current.leanTarget??u).style.setProperty("--ascii-lean",String(E?0:r(M.x/(.4*q()),-1,1)));const t=W(x);!P&&t&&p.set(t,"transform",`translate(${M.x}px, ${w.x}px) rotate(${.22*r(M.x/q(),-1.6,1.6)}rad)`)})(),P?.kick(),(o||y||E)&&(I=requestAnimationFrame(N))},X=()=>{I||(S=performance.now(),I=requestAnimationFrame(N))},j=()=>{M=s(0,380,.72),w=s(0,380,.8),b=s(0,260,.9)},z=(t=1)=>{const e=v();if(E||!e.length||!m.current.loop&&x>=e.length)return!1;const r=W(x),n=F(x);return y=!1,f()||!P?(x+=1,j(),P||p.set(r,"transform","")):(E={dir:t,start:performance.now(),x0:M.x,y0:w.x},b.to=1),D(),X(),m.current.onSwipe?.(t,n,r),!0},G=e=>{if(!y||void 0!==e&&void 0!==e.pointerId&&e.pointerId!==C)return;y=!1;const n=t(L,performance.now()),o=q();Math.abs(M.x)>o*m.current.threshold||Math.abs(n)>650&&Math.sign(n)===Math.sign(M.x)&&Math.abs(M.x)>16?z(M.x<0?-1:1):(M.to=0,w.to=0,b.to=0,M.v=.2*r(n,-1600,1600),f()&&(M.x=w.x=b.x=0,M.v=w.v=b.v=0),X())},H=()=>u.getBoundingClientRect().width/(u.clientWidth||1)||1,Y=t=>{if(0!==t.button||E)return;try{u.setPointerCapture?.(t.pointerId)}catch{}C=t.pointerId;const e=H();y=!0,k=t.clientX-M.x*e,A=t.clientY-w.x/.3*e,L=[],X()},B=t=>{if(!y||t.pointerId!==C)return;const e=H();M.x=M.to=(t.clientX-k)/e,w.x=w.to=(t.clientY-A)/e*.3,M.v=w.v=0,b.to=.5*r(Math.abs(M.x)/q()),L.push([M.x,performance.now()]),L.length>8&&L.shift(),X()},K=t=>{"ArrowLeft"!==t.key&&"ArrowRight"!==t.key||(t.preventDefault(),z("ArrowRight"===t.key?1:-1))},O=()=>P?.kick(),U=t=>t.preventDefault();return u.hasAttribute("tabindex")||(u.tabIndex=0),u.setAttribute("role",u.getAttribute("role")??"group"),u.setAttribute("aria-roledescription","card"),p.set(u,"touch-action","none"),D(),u.addEventListener("pointerdown",Y),u.addEventListener("pointermove",B),u.addEventListener("pointerup",G),u.addEventListener("pointercancel",G),u.addEventListener("lostpointercapture",G),u.addEventListener("keydown",K),u.addEventListener("load",O,!0),u.addEventListener("dragstart",U),a(()=>P,m,()=>{R=new Map,D(),P?.refresh()},{next:z,get index(){return F(x+(E?1:0))}},()=>{I&&cancelAnimationFrame(I),I=0,p.restore(),v().forEach(t=>{t.hidden=!1,t.removeAttribute("aria-hidden")}),(m.current.leanTarget??u).style.removeProperty("--ascii-lean"),u.removeAttribute("aria-roledescription"),u.removeEventListener("pointerdown",Y),u.removeEventListener("pointermove",B),u.removeEventListener("pointerup",G),u.removeEventListener("pointercancel",G),u.removeEventListener("lostpointercapture",G),u.removeEventListener("keydown",K),u.removeEventListener("load",O,!0),u.removeEventListener("dragstart",U)})}var g=l;export{g as SWIPE_DECK_DEFAULTS,u as swipeDeck,d as toneImage};//# sourceMappingURL=chunk-TTGMK4EA.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{parseColor as o,fbm as t,hash2 as e}from"./chunk-ZCHGV2CV.js";import{mountCanvas as r}from"./chunk-BR6ZNJZW.js";import{mixHex as l}from"./chunk-S7RZP2MT.js";function n(r,l,n,a,i={}){const{fontSize:c=13,chars:s=" .,:;+*#@",color:f="#4caf50",skyColor:h="#1a237e",peakColor:g="#e0e0e0",speed:p=1,roughness:M=.55,heightScale:b=.55,stars:d=!0,lightMode:m=!1}=i,k=.62*c,u=1.4*c,S=Math.ceil(l/k),x=Math.ceil(n/u),$=o(f)??{r:76,g:175,b:80},y=o(h)??{r:26,g:35,b:126},C=o(g)??{r:224,g:224,b:224};r.clearRect(0,0,l,n),r.font=`${c}px "JetBrains Mono", monospace`,r.textBaseline="top";const A=a*p*.4,z=new Array(S);for(let o=0;o<S;o++){const e=(.5*t((o/S+A)*M*3,.5)+.5)*b;z[o]=Math.floor(e*x)}for(let o=0;o<x;o++)for(let t=0;t<S;t++){const l=x-1-z[t],n=o===l;if(!(o>=l)){if(d){const l=e(7*t+Math.floor(.3*A),13*o);if(l>.97){const e=.3*Math.sin(2*a+100*l)+.7;r.globalAlpha=.5*e,r.fillStyle=`rgb(${y.r+60},${y.g+60},${y.b+80})`,r.fillText("·",t*k,o*u)}}continue}const i=(o-l)/Math.max(1,z[t]),c=s[Math.min(s.length-1,Math.floor(i*s.length))];if(" "===c&&!n)continue;const f=n?1:Math.max(0,1-4*i),h=$.r+(C.r-$.r)*f|0,g=$.g+(C.g-$.g)*f|0,p=$.b+(C.b-$.b)*f|0;r.globalAlpha=.5+.5*i,r.fillStyle=`rgb(${h},${g},${p})`,r.fillText(n?s[s.length-1]:c,t*k,o*u)}r.globalAlpha=1}var a={id:"terrain",name:"Terrain",description:"A side-scrolling landscape drawn in density characters.",cellSize:13,speed:1,cursor:!1,mount:o=>r(o,(o,t,e,r,a,i)=>n(o,t,e,r,{fontSize:i.fontSize,chars:i.chars,lightMode:i.lightMode,color:i.ink,peakColor:i.accent??l(i.ink,"#ffffff",.65),skyColor:l(i.ink,"#0c0d0b",.55)}))};export{n as renderTerrainBackground,a as terrain};//# sourceMappingURL=chunk-UML6XQAR.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{scenePreset as e}from"./chunk-C3C7AYKL.js";var r=e({id:"interference",name:"Interference",description:"Two fine ring grids from slowly orbiting centres; where they cross, moiré bands open and close.",cellSize:11,scene:"interference",charset:" .:-=+*#",hover:"lantern"});export{r as interference};//# sourceMappingURL=chunk-VC2ZQG63.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{imageFor as e,injectStyle as t,imageReady as r,drawCover as i}from"./chunk-4OT66HSZ.js";import{styleKeeper as n,clamp as o,mountSurface as a,handle as s,house as l}from"./chunk-S7RZP2MT.js";function c(c,d){const u={current:{position:50,...d}},p=n();let h=o(u.current.position,0,100),m=null,g=null,v={from:h,to:h,at:-1e9},b=0,f=!1;const w=[];let A=u.current.position;g=a({host:c,layer:"under",look:()=>({blend:"coarse",mark:"glyph",charset:" .:-=+*#%@",font:'"Geist", Arial, sans-serif',fontWeight:600,cellSize:6,cellAspect:.8,glyphScale:.96,color:"source",levels:"auto",saturation:1.3,contrast:1.45,gamma:.85,brightness:.14,hover:"trail",trail:{strength:.7,radius:.3},...u.current.look}),ink:()=>u.current.ink??"--ascii-ink-strong",kit:u,reducedMotion:()=>u.current.reducedMotion,resolution:(e,t)=>{const r=Math.min(1600,Math.max(2,Math.round(2*e)));return[r,Math.max(2,Math.round(r*t/Math.max(1,e)))]},onFail:()=>{g=null},paint:({pen:e,width:t,height:r})=>(e.imageSmoothingQuality="high",m&&i(e,m,0,0,t,r),!1)});const k="string"==typeof u.current.image?e(u.current.image):u.current.image,x=c.querySelector('[role="slider"]'),y=c.querySelector("[data-compare-line]"),M=x??document.createElement("div"),E=y??document.createElement("span"),L=e=>{void 0===e&&M.hasAttribute("aria-label")||M.setAttribute("aria-label",e??"Photo and ASCII split")},S=()=>{const e=Math.round(h);p.set(c,"--ascii-pos",`${h}%`),M.setAttribute("aria-valuenow",String(e)),M.setAttribute("aria-valuetext",`${e}% photo, ${100-e}% ASCII`)},C=(e,t=!1)=>{if(e=o(e,0,100),!g)return void(h=e);if(b&&(cancelAnimationFrame(b),b=0),!t||g.still()||Math.abs(e-h)<.5)return h=e,S(),void u.current.onChange?.(h);v={from:h,to:e,at:performance.now()};const r=e=>{const t=o((e-v.at)/280);h=v.from+(v.to-v.from)*l(t),S(),u.current.onChange?.(h),b=t<1?requestAnimationFrame(r):0};b=requestAnimationFrame(r)},N=e=>{const t=c.getBoundingClientRect();return t.width?(e-t.left)/t.width*100:h},I=e=>{if(0!==e.button)return;c.setPointerCapture?.(e.pointerId),f=!0,c.dataset.dragging="";const t=N(e.clientX);C(t,Math.abs(t-h)>3),M.focus({preventScroll:!0})},j=e=>{f&&C(N(e.clientX))},F=()=>{f=!1,delete c.dataset.dragging},P=e=>{const t={ArrowLeft:-5,ArrowDown:-5,ArrowRight:5,ArrowUp:5,PageDown:-20,PageUp:20}[e.key],r="Home"===e.key?0:"End"===e.key?100:void 0!==t?5*Math.round(h/5)+t:null;null!==r&&(e.preventDefault(),C(r,!0))};let q=()=>{};if(g){t("ascii-kit-compare","\n:where(.ascii-compare-photo){position:absolute;inset:0;width:100%;height:100%;object-fit:cover;pointer-events:none;clip-path:inset(0 calc(100% - var(--ascii-pos, 50%)) 0 0)}\n:where(.ascii-compare-line){position:absolute;top:0;bottom:0;left:var(--ascii-pos, 50%);width:2px;translate:-50% 0;background:#fff;box-shadow:0 0 0 .5px rgb(0 0 0 / .25),0 0 12px rgb(0 0 0 / .45);pointer-events:none}\n:where(.ascii-compare-handle){position:absolute;top:50%;left:var(--ascii-pos, 50%);display:grid;place-items:center;width:40px;height:40px;translate:-50% -50%;border-radius:50%;background:#fff;color:#111;box-shadow:0 0 0 1px rgb(0 0 0 / .08),0 4px 14px rgb(0 0 0 / .4);cursor:grab;touch-action:none}\n:where(.ascii-compare-handle:focus-visible){outline:2px solid #fff;outline-offset:3px}\n"),p.set(c,"overflow","hidden"),p.set(c,"touch-action","pan-y"),p.set(c,"user-select","none"),p.set(c,"cursor","ew-resize");const e={className:k.className,hidden:k.getAttribute("aria-hidden")};q=()=>{k.className=e.className,null===e.hidden?k.removeAttribute("aria-hidden"):k.setAttribute("aria-hidden",e.hidden)},k.className=(e.className?`${e.className} `:"")+"ascii-compare-photo",k.setAttribute("aria-hidden","true"),k.draggable=!1,y||(E.className="ascii-compare-line",E.setAttribute("aria-hidden","true")),x||(M.className="ascii-compare-handle",M.innerHTML='<svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m9 7-5 5 5 5M15 7l5 5-5 5"/></svg>',M.setAttribute("role","slider"),M.tabIndex=0),L(u.current.label),M.setAttribute("aria-valuemin","0"),M.setAttribute("aria-valuemax","100"),M.setAttribute("aria-orientation","horizontal");for(const e of[k,E,M])c.contains(e)||(c.appendChild(e),w.push(e));S(),c.addEventListener("pointerdown",I),c.addEventListener("pointermove",j),c.addEventListener("pointerup",F),c.addEventListener("pointercancel",F),M.addEventListener("keydown",P),r(k).then(e=>{m=e,g?.kick()},()=>{})}else c.contains(k)||("static"===getComputedStyle(c).position&&p.set(c,"position","relative"),k.setAttribute("style","position:absolute;inset:0;width:100%;height:100%;object-fit:cover;border-radius:inherit"),c.appendChild(k),w.push(k));return s(()=>g,u,e=>{L(e.label),e.position!==A&&(A=e.position,C(e.position,!0)),g?.refresh()},{set:C,get position(){return h}},()=>{b&&cancelAnimationFrame(b),c.removeEventListener("pointerdown",I),c.removeEventListener("pointermove",j),c.removeEventListener("pointerup",F),c.removeEventListener("pointercancel",F),M.removeEventListener("keydown",P),delete c.dataset.dragging,w.forEach(e=>e.remove()),q(),p.restore()})}export{c as compare};//# sourceMappingURL=chunk-VVW7LZT2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{scenePreset as e,FIELD_GRAPHITE as r,narrow as t}from"./chunk-C3C7AYKL.js";var a=e({id:"halftone",name:"Halftone",description:"The drifting ground drawn as dots, clear around your content.",cellSize:14,scene:"drift",mark:"dot",charset:" .:-=+*#",hover:"lantern",graphite:r,middle:!1,feather:.2,tune:e=>({scale:t()?1.8:1,blend:"auto",dotScale:.64,lantern:{radius:.16,strength:.35,trail:.6,follow:9},trail:{strength:.9,radius:.4},...e.clear?{clear:{element:e.clear,padding:32,feather:.2,shape:"rect"}}:{}})});export{a as halftone};//# sourceMappingURL=chunk-W2STAN6V.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{snapshot as t}from"./chunk-BNVRKD3V.js";import{hash as e,styleKeeper as a,mountSurface as n,handle as o,house as i,prefersReduced as s}from"./chunk-S7RZP2MT.js";var r={dissolve:300,condense:300},c=10,l=16,h=t=>.5-.5*Math.cos(Math.PI*Math.min(1,Math.max(0,t))),d=t=>i(Math.min(1,Math.max(0,t))),u=()=>{let t=()=>{};return[new Promise(e=>{t=e}),t]};function g(t,a,n,o,i,s=!1){const r=a.width,h=a.height,d=Math.ceil(r/c),u=Math.ceil(h/l),g=[],m=[],f=Math.max(...[[0,0],[r,0],[0,h],[r,h]].map(([t,e])=>Math.hypot(t-o.x,e-o.y)))||1,x=function(t,e,a){const n=p.get(t);if(n)return n;const o=Object.assign(document.createElement("canvas"),{width:e,height:a}),i=Object.assign(document.createElement("canvas"),{width:t.width,height:t.height}),s=o.getContext("2d"),r=i.getContext("2d"),c={mask:o,maskPen:s,data:s.createImageData(e,a),clip:i,clipPen:r};return p.set(t,c),c}(a,d,u),M=x.data.data;let w=0;for(let t=0;t<u;t++)for(let a=0;a<d;a++){const i=a*c,r=t*l,h=Math.hypot(i+5-o.x,r+8-o.y)/f*.72+.28*e(i,r),u=s?n-h-.12:h-n;M[4*(t*d+a)+3]=u>0?255:0,u>0&&w++,u>0&&u<.07?g.push([i,r]):u<=0&&u>-.12&&m.push([i,r,-u/.12])}if(w){x.maskPen.putImageData(x.data,0,0);const e=x.clipPen;e.globalCompositeOperation="source-over",e.clearRect(0,0,r,h),e.drawImage(a,0,0),e.globalCompositeOperation="destination-in",e.imageSmoothingEnabled=!1,e.drawImage(x.mask,0,0,d*c,u*l),e.globalCompositeOperation="source-over",t.drawImage(x.clip,0,0)}for(const[n,o,r]of m)t.globalAlpha=(1-r)*(s?.7:1),t.drawImage(a,n,o,c,l,n+18*(e(o,n+i)-.5)*r,o-10*r*(s?-.6:1),c,l);t.globalAlpha=1,t.globalCompositeOperation="lighter",t.globalAlpha=s?.5:1;for(const[e,n]of g)t.drawImage(a,e,n,c,l,e,n,c,l);t.globalAlpha=1,t.globalCompositeOperation="source-over"}var p=new WeakMap;function m(e,i={}){const c={current:{...r,...i}},l=a();let p=null,m=0,f=0,x=Promise.resolve(),M=0,w=null;const b="function"==typeof matchMedia&&matchMedia("(pointer: coarse)").matches?1:2,k=t=>{t.handed(),t.landing(),t.done()};w=n({host:e,look:()=>({mark:"glyph",charset:" .:-=+*#%@",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:8,cellAspect:.6,glyphScale:.9,contrast:1.15,shade:.55,...c.current.look}),ink:()=>c.current.ink??"--ascii-ink-strong",kit:{get current(){return{...c.current,poster:void 0}}},reducedMotion:()=>c.current.reducedMotion,resolution:b,onFail:()=>{w=null;const t=p;p=null,l.restore(),t&&k(t)},paint:({pen:t,width:e,height:a,now:n})=>{const o=p;if(!o)return!1;const i=n-o.start,s=i/o.outMs,r=o.next?(n-o.nextAt)/o.nextMs:0;var c;s<1&&g(t,o.out,1.12*h(s),o.at,++f),o.next&&r>0&&g(t,o.next,.1+1.14*(c=r,1-(1-Math.min(1,Math.max(0,c)))**2),o.at,f,!0);const l=o.next?(n-o.nextAt-o.nextMs+o.hand)/o.hand:-1,u=d(i/o.hand)*(1-d(l));u<1&&(t.globalAlpha=1-u,t.fillStyle="#000",t.fillRect(0,0,e,a),t.globalAlpha=1);const x=Math.round(-160*h(2*s)*(o.next?1-h(r):1))/1e3;return x!==m&&(m=x,w?.field.update({brightness:x})),0===o.stage&&i>=o.hand&&(o.stage=1,o.handed()),1===o.stage&&l>=0&&(o.stage=2,o.landing()),!(l>=1)||(p=null,o.done(),!1)}});const v=(t,a)=>{if(t&&"getBoundingClientRect"in t){const e=a.box(t);return{x:(e.x+e.w/2)*b,y:(e.y+e.h/2)*b}}return t?{x:t.x*b,y:t.y*b}:{x:e.offsetWidth/2*b,y:0}},y=a=>t(e,a.box,e.offsetWidth,e.offsetHeight,b,{skip:a.canvas}),A=(t,a)=>{for(const n of[...e.children].filter(t=>void 0===t.dataset.asciiKit&&void 0===t.dataset.asciiPoster))l.set(n,"transition",a?`opacity ${a}ms cubic-bezier(.16, 1, .3, 1)`:"none"),l.set(n,"opacity",t?"1":"0")},C=async(t,a)=>{const n=w;if(!n||(c.current.reducedMotion??s())||!n.live)return void await t();const{dissolve:o,condense:i}=c.current,r=Math.max(1,Math.min(110,o/2,i/2)),[h,d]=u(),[g,f]=u(),[x,M]=u(),b=p={at:v(a??c.current.origin,n),start:performance.now(),hand:r,out:y(n),outMs:Math.max(1,o),next:null,nextAt:0,nextMs:Math.max(1,i),handed:d,landing:f,done:M,stage:0};if(e.dataset.state="out",A(!1,r),n.kick(),await h,p===b){try{await t()}catch(t){throw p===b&&(p=null,l.restore(),w?.field.update({brightness:0})),t}w&&p===b&&(n.canvas.isConnected&&n.canvas.parentElement===e||e.appendChild(n.canvas),A(!1,0),e.dataset.state="in",b.next=y(n),b.nextAt=performance.now(),n.kick(),await g,p===b&&A(!0,r),await x,l.restore(),m=0,w?.field.update({brightness:0}),w?.kick())}};return o(()=>w,c,()=>w?.refresh(),{swap(t,a){M++;const n=x.then(()=>C(t,a)).finally(()=>{0===--M&&delete e.dataset.state});return x=n.catch(()=>{}),n},get busy(){return M>0}},()=>{const t=p;p=null,l.restore(),delete e.dataset.state,t&&k(t)})}var f=r;export{f as PAGE_DISSOLVE_DEFAULTS,g as dissolveFrame,m as pageDissolve};//# sourceMappingURL=chunk-WJLZM3DR.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{parseColor as t,hash2 as o}from"./chunk-ZCHGV2CV.js";import{mountCanvas as e}from"./chunk-BR6ZNJZW.js";import{mixHex as l}from"./chunk-S7RZP2MT.js";var r=1,i=2,n=4,f=8,c={3:"─",12:"│",9:"┌",10:"┐",5:"└",6:"┘",11:"┬",7:"┴",13:"├",14:"┤",15:"┼",[r]:"╶",[i]:"╴",[n]:"╵",[f]:"╷"};function a(e,l,r,i,n={}){const{fontSize:f=13,pulseColor:a="#ffffff",color:s="#00ff88",density:h=.38,speed:g=1,lightMode:p=!1}=n,u=.62*f,b=1.4*f,m=Math.ceil(l/u),M=Math.ceil(r/b),d=t(s)??{r:0,g:255,b:136},S=t(a)??{r:255,g:255,b:255},$=(t,e)=>{if(o(17*t+1,7*e+2)>h)return 0;let l=0;return t+1<m&&o(17*t+1,7*e+2)>.15&&(l|=1),t-1>=0&&o(17*(t-1)+1,7*e+2)>.15&&(l|=2),e+1<M&&o(17*t+1,7*(e+1)+2)>.15&&(l|=8),e-1>=0&&o(17*t+1,7*(e-1)+2)>.15&&(l|=4),l};e.clearRect(0,0,l,r),e.font=`${f}px "JetBrains Mono", monospace`,e.textBaseline="top";const C=i*g;for(let t=0;t<M;t++)for(let l=0;l<m;l++){const r=$(l,t);if(0===r)continue;const i=c[r]??"·",n=(8*C+40*o(l,23*t))%m,f=(6*C+40*o(17*t,11*l))%M,a=(1&r||2&r)&&Math.abs(l-n)<1.5,s=(4&r||8&r)&&Math.abs(t-f)<1.5,h=a||s,g=.25+.35*o(3*l,5*t);h?(e.globalAlpha=.95,e.fillStyle=`rgb(${S.r},${S.g},${S.b})`):(e.globalAlpha=g,e.fillStyle=`rgb(${d.r},${d.g},${d.b})`),e.fillText(i,l*u,t*b)}e.globalAlpha=1}var s={id:"circuit",name:"Circuit",description:"Circuit traces with signals running along them.",cellSize:13,speed:1,cursor:!1,mount:t=>e(t,(t,o,e,r,i,n)=>a(t,o,e,r,{fontSize:n.fontSize,chars:n.chars,lightMode:n.lightMode,color:n.ink,pulseColor:n.accent??l(n.ink,"#ffffff",.7)}))};export{s as circuit,a as renderCircuitBackground};//# sourceMappingURL=chunk-XANKANGR.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{parseColor as o,hash2 as t}from"./chunk-ZCHGV2CV.js";import{mountCanvas as l}from"./chunk-BR6ZNJZW.js";import{mixHex as e}from"./chunk-S7RZP2MT.js";function r(l,e,r,a,i={}){const{fontSize:n=13,baseChars:f="ATCG",bridgeChars:h="-=≡",color:c="#00e5ff",color2:s="#ff4081",bridgeColor:M="#88ffcc",speed:b=1,helixCount:g,lightMode:p=!1}=i,d=.62*n,m=1.4*n,u=Math.ceil(e/d),$=Math.ceil(r/m),x=g??Math.max(1,Math.floor(e/80)),C=u/x,S=o(c)??{r:0,g:229,b:255},k=o(s)??{r:255,g:64,b:129},A=o(M)??{r:136,g:255,b:204};l.clearRect(0,0,e,r),l.font=`${n}px "JetBrains Mono", monospace`,l.textBaseline="top";const T=a*b,z=.35*C;for(let o=0;o<x;o++){const e=C*(o+.5);for(let r=0;r<$;r++){const a=r/$*Math.PI*6-1.8*T,i=e+Math.sin(a)*z,n=e+Math.sin(a+Math.PI)*z,c=Math.round(i),s=Math.round(n);if(c<0||c>=u)continue;const M=t(31*o+7*r,3),b=f[Math.floor(M*f.length)],g=.5*(Math.sin(a)+1),p=.5*(Math.sin(a+Math.PI)+1);if(l.globalAlpha=.35+.65*g,l.fillStyle=`rgb(${S.r},${S.g},${S.b})`,l.fillText(b,c*d,r*m),s>=0&&s<u){const e=t(53*o+11*r,7),a=f[Math.floor(e*f.length)];l.globalAlpha=.35+.65*p,l.fillStyle=`rgb(${k.r},${k.g},${k.b})`,l.fillText(a,s*d,r*m)}if(r%3===0){const e=Math.min(c,s),a=Math.max(c,s);if(a-e>1){const i=t(17*r+43*o,5),n=h[Math.floor(i*h.length)],f=.25*(g+p)+.2;l.globalAlpha=f,l.fillStyle=`rgb(${A.r},${A.g},${A.b})`;for(let o=e+1;o<a;o++)l.fillText(n,o*d,r*m)}}}}l.globalAlpha=1}var a={id:"dna",name:"DNA",description:"Double helices scroll past with base-pair letters.",cellSize:13,speed:1,cursor:!1,mount:o=>l(o,(o,t,l,a,i,n)=>r(o,t,l,a,{fontSize:n.fontSize,color:n.ink,color2:n.accent??e(n.ink,"#ffffff",.55),bridgeColor:e(n.ink,"#0c0d0b",.35)}))};export{a as dna,r as renderDnaBackground};//# sourceMappingURL=chunk-XB4DKPGL.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{parseColor as t,hash2 as o}from"./chunk-ZCHGV2CV.js";import{mountCanvas as e}from"./chunk-BR6ZNJZW.js";function n(e,n,c,l,i={}){const{fontSize:r=13,chars:a="0123456789ABCDEF@#$&*+=/<>",accentColor:s,color:f,speed:h=1,density:g=.55,tailLength:d=14,lightMode:$=!1}=i,p=s??($?"#6b8700":"#d4ff00"),m=.62*r,u=1.4*r,M=Math.ceil(n/m),b=Math.ceil(c/u);e.clearRect(0,0,n,c),e.font=`${r}px monospace`,e.textBaseline="top";let C=255,S=255,x=255;if($&&(C=55,S=55,x=55),f){const o=t(f);o&&(C=o.r,S=o.g,x=o.b)}let z=212,k=255,y=0;const B=t(p);B&&(z=B.r,k=B.g,y=B.b);const R=b+d;for(let t=0;t<M;t++){if(o(17*t,3)>g)continue;const n=(.5+1.5*o(31*t,7))*h,c=o(13*t,11)*R,i=Math.floor((l*n*7+c)%R),r=t*m;for(let n=0;n<=d;n++){const c=i-(d-n);if(c<0||c>=b)continue;const s=c*u,f=o(53*t+Math.floor(5*l+n),7*c),h=a[Math.floor(f*a.length)],g=n/d;if(n===d)e.fillStyle=`rgba(${z},${k},${y},${$?.7:.85})`;else{const t=$?.85*g:.15*g;e.fillStyle=`rgba(${C},${S},${x},${t})`}e.fillText(h,r,s)}}}var c={id:"rain",name:"Rain",description:"Columns of falling characters with bright heads.",cellSize:13,speed:1,cursor:!1,mount:t=>e(t,(t,o,e,c,l,i)=>n(t,o,e,c,{fontSize:i.fontSize,chars:i.chars,lightMode:i.lightMode,color:i.ink,accentColor:i.accent}))};export{c as rain,n as renderRainBackground};//# sourceMappingURL=chunk-XDKKCIIL.js.map
|