asciify-engine 4.23.0 → 4.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +315 -0
- package/README.md +71 -711
- package/dist/core.cjs +1 -1
- package/dist/core.js +1 -1
- package/dist/field.cjs +1 -1
- package/dist/field.d.cts +4 -1
- package/dist/field.d.ts +4 -1
- package/dist/field.js +1 -1
- package/dist/hover.cjs +1 -1
- package/dist/hover.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/kit/chunk-2D2SG6FW.js +1 -0
- package/dist/kit/chunk-2JQ4MRIP.js +1 -0
- package/dist/kit/chunk-2KFBIOVS.js +1 -0
- package/dist/kit/chunk-2TQW2PIG.js +1 -0
- package/dist/kit/chunk-3F6FTBMN.js +1 -0
- package/dist/kit/chunk-4SHQA3CO.js +1 -0
- package/dist/kit/chunk-4XT5IKM3.js +1 -0
- package/dist/kit/chunk-6L2GAV5C.js +1 -0
- package/dist/kit/chunk-6XNIZ52V.js +1 -0
- package/dist/kit/chunk-6YVZZ3DO.js +1 -0
- package/dist/kit/chunk-A6EDU3UT.js +1 -0
- package/dist/kit/chunk-A73S2BCE.js +1 -0
- package/dist/kit/chunk-ANLBW5RI.js +1 -0
- package/dist/kit/chunk-B6GZ645M.js +1 -0
- package/dist/kit/chunk-BBOSHBZK.js +1 -0
- package/dist/kit/chunk-BJRPY7UB.js +1 -0
- package/dist/kit/chunk-CA5J25SV.js +1 -0
- package/dist/kit/chunk-CR7QS3B3.js +1 -0
- package/dist/kit/chunk-D4KCZSIP.js +1 -0
- package/dist/kit/chunk-EHXSXMBE.js +1 -0
- package/dist/kit/chunk-EHYFSX5K.js +1 -0
- package/dist/kit/chunk-EJ3W4FN6.js +1 -0
- package/dist/kit/chunk-EK4GIXIO.js +1 -0
- package/dist/kit/chunk-EPVZIGEZ.js +1 -0
- package/dist/kit/chunk-EWPT56TR.js +1 -0
- package/dist/kit/chunk-FIWIUXNV.js +1 -0
- package/dist/kit/chunk-G4BQYQJ6.js +1 -0
- package/dist/kit/chunk-GCIZKMJL.js +1 -0
- package/dist/kit/chunk-H4DBJULW.js +1 -0
- package/dist/kit/chunk-HMW5NRUV.js +1 -0
- package/dist/kit/chunk-IUX46UDR.js +1 -0
- package/dist/kit/chunk-JAM46FF6.js +1 -0
- package/dist/kit/chunk-JRSCTMFM.js +1 -0
- package/dist/kit/chunk-KBXVIAWS.js +1 -0
- package/dist/kit/chunk-KJJJORN6.js +1 -0
- package/dist/kit/chunk-KS3TL3S2.js +1 -0
- package/dist/kit/chunk-KTYCGGRO.js +1 -0
- package/dist/kit/chunk-L3P7ZDSK.js +1 -0
- package/dist/kit/chunk-LUOIH2EM.js +1 -0
- package/dist/kit/chunk-MIA6TUQC.js +1 -0
- package/dist/kit/chunk-MRDEO5HZ.js +1 -0
- package/dist/kit/chunk-NPJ77LDC.js +1 -0
- package/dist/kit/chunk-ODMQERGZ.js +1 -0
- package/dist/kit/chunk-ONVONNUH.js +1 -0
- package/dist/kit/chunk-OVCIHOOS.js +1 -0
- package/dist/kit/chunk-P6S6HSN3.js +1 -0
- package/dist/kit/chunk-PCGRRX5P.js +1 -0
- package/dist/kit/chunk-PDNKLLBI.js +1 -0
- package/dist/kit/chunk-PFNFW4ZI.js +1 -0
- package/dist/kit/chunk-PFQBEWCF.js +1 -0
- package/dist/kit/chunk-PND73YEV.js +1 -0
- package/dist/kit/chunk-PZAQLUAS.js +1 -0
- package/dist/kit/chunk-QKZYCROD.js +1 -0
- package/dist/kit/chunk-QTVMD62E.js +1 -0
- package/dist/kit/chunk-QZHZWO7N.js +1 -0
- package/dist/kit/chunk-SAQJAH2I.js +1 -0
- package/dist/kit/chunk-SE6MQQLB.js +1 -0
- package/dist/kit/chunk-SQGJ263V.js +1 -0
- package/dist/kit/chunk-SVXRMHUJ.js +1 -0
- package/dist/kit/chunk-UO4U32P7.js +1 -0
- package/dist/kit/chunk-V6GEQ5Y5.js +1 -0
- package/dist/kit/chunk-VFV7HZ3G.js +1 -0
- package/dist/kit/chunk-WT3XOWAI.js +1 -0
- package/dist/kit/chunk-XDNCXCR7.js +1 -0
- package/dist/kit/chunk-XPXMCXYI.js +1 -0
- package/dist/kit/chunk-XVB3B3FV.js +1 -0
- package/dist/kit/chunk-XXPDXJMQ.js +1 -0
- package/dist/kit/chunk-XYLLL2PQ.js +1 -0
- package/dist/kit/chunk-YBBYCUFP.js +1 -0
- package/dist/kit/chunk-YDP6566E.js +1 -0
- package/dist/kit/chunk-YL2AXWRA.js +1 -0
- package/dist/kit/chunk-ZCHGV2CV.js +1 -0
- package/dist/kit/chunk-ZYYLWSPY.js +1 -0
- package/dist/kit.cjs +1 -1
- package/dist/kit.d.cts +3 -1
- package/dist/kit.d.ts +3 -1
- package/dist/kit.js +1 -1
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +1 -1
- package/package.json +3 -2
- package/skills/asciify-engine/SKILL.md +3 -3
- package/skills/asciify-engine/references/applying-asciify.md +1 -1
- package/skills/asciify-engine/references/kit.md +2 -2
- package/skills/asciify-engine/references/performance.md +33 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{parseColor as t,hash2 as o}from"./chunk-ZCHGV2CV.js";import{mountCanvas as e}from"./chunk-KTYCGGRO.js";import{mixHex as l}from"./chunk-PFQBEWCF.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),d=Math.ceil(r/b),C=t(s)??{r:0,g:255,b:136},M=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<d&&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 S=i*g;for(let t=0;t<d;t++)for(let l=0;l<m;l++){const r=$(l,t);if(0===r)continue;const i=c[r]??"·",n=(8*S+40*o(l,23*t))%m,f=(6*S+40*o(17*t,11*l))%d,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(${M.r},${M.g},${M.b})`):(e.globalAlpha=g,e.fillStyle=`rgb(${C.r},${C.g},${C.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-CR7QS3B3.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{styleKeeper as t,mountSurface as e,easeOut as o,handle as n}from"./chunk-PFQBEWCF.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-D4KCZSIP.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{mountSurface as t,house as e,styleKeeper as n,handle as r,clamp as o}from"./chunk-PFQBEWCF.js";var l={values:[],duration:560},a=.46,i=(t,e)=>e?Math.min(e-1,Math.max(0,Math.floor(t*e))):-1;function c(t,e){if(!e)return{bar:0,gap:0,left:0};const n=e<=7?.5:.6;let r=Math.max(1,Math.floor(t/e));for(;r>1&&e*r+(e-1)*Math.max(1,Math.round(r*n))>t;)r--;const o=e>1?Math.max(0,Math.min(Math.ceil(r*n*1.6),Math.floor((t-e*r)/(e-1)))):0;return{bar:r,gap:o,left:Math.max(0,Math.floor((t-e*r-(e-1)*o)/2))}}function s(s,h={}){const u={current:{...l,...h}};let d=u.current.values,m=null,f=[],p=0,M=!1,x=null,g=!1===u.current.intro?-1e9:performance.now(),v=[],b=[],w=[],E={cols:0,rows:0};const k=()=>u.current.values??[],y=()=>({mark:"glyph",charset:" .:-=+*#%@",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:7,cellAspect:1,glyphScale:1.1,shade:.5,blend:"off",...u.current.look}),A=(t,e)=>{const{cellSize:n=7,maxPixelRatio:r=2}=y(),o=Math.min("number"==typeof devicePixelRatio&&devicePixelRatio>0?devicePixelRatio:1,r),l=Math.max(2,Math.round(n*o)),a=l/o,i=t=>{const e=Math.max(1,Math.floor(t*o/l));for(let t=e;t>1&&t>e-8;t--)if(Math.abs(t*a-Math.round(t*a))<.01)return t;return e},c=i(t),s=Math.max(2,i(e));return{cols:c,rows:s,cell:a,gw:Math.round(c*a),gh:Math.round(s*a)}};let L={left:0,cell:0};const C=(t,e)=>null===m?t===e-1?.8:a:t===m?.8:.3,$=(t,n)=>e((n-g-(b[t]??0))/u.current.duration),S=(t,e,n,r)=>{const l=((t,e,n,r)=>{const{bar:l,gap:a,left:i}=c(n,e.length),s=u.current.max??1.04*Math.max(...e,0),h=s>0?o(Math.max(0,e[t])/s)*(r-1):0,d=i+t*(l+a);return{x0:d,x1:d+l,h:h>0?Math.max(1,Math.round(h)):0}})(t,e,E.cols,E.rows);if(r)return l;const a=v[t]??{...l,h:0},i=$(t,n);return{x0:a.x0+(l.x0-a.x0)*i,x1:a.x1+(l.x1-a.x1)*i,h:a.h+(l.h-a.h)*i}};x=t({host:s,look:y,ink:()=>u.current.ink??"--ascii-ink-strong",kit:u,reducedMotion:()=>u.current.reducedMotion,resolution:(t,e)=>{const{cell:n}=A(t,e);return[Math.max(2,2*Math.round(t/n)),Math.max(4,2*Math.round(e/n))]},onFail:()=>{x=null},paint:({pen:t,width:n,height:r,now:l,still:i})=>{const c=(()=>{const t=x?.canvas;if(!t||!s.offsetWidth)return!1;const{gw:e,gh:n,cell:r}=A(s.offsetWidth,s.offsetHeight),o=Math.round((s.offsetWidth-e)/2),l=[`${o}px`,s.offsetHeight-n+"px",`${e}px`,`${n}px`];L={left:o,cell:r};let a=!1;return["left","top","width","height"].forEach((e,n)=>{t.style[e]!==l[n]&&(t.style[e]=l[n],a=!0)}),a&&x?.field.resize(),a})(),h=n/2,d=r/2;E={cols:h,rows:d};const m=k(),M=m.length,v=p?Math.min(64,l-p):16;p=l;const b=new Float32Array(h*d),y=(t,e,n)=>{const r=(d-1-e)*h+t;n>b[r]&&(b[r]=n)};for(let t=0;t<h;t++)y(t,0,.16);const R=({x0:t,x1:e,h:n},r)=>{if(n<=.01)return;const l=Math.ceil(n)-1;for(let a=Math.max(0,Math.floor(t));a<Math.min(h,Math.ceil(e));a++){const i=o(Math.min(a+1,e)-Math.max(a,t));for(let t=0;t<=l&&t<d-1;t++)y(a,t+1,(t===l?Math.min(1,r+.2):r)*i*o(n-t))}};let F=!1;const P=i?1:e((l-g)/u.current.duration);P<1&&(F=!0);for(const t of w)R({...t,h:t.h*(1-P)},a);P>=1&&(w=[]);for(let t=0;t<M;t++){!i&&$(t,l)<1&&(F=!0);const e=C(t,M),n=f[t]??e;f[t]=i?e:n+(e-n)*(1-Math.exp(-v/70)),Math.abs(f[t]-e)>.004&&(F=!0),R(S(t,m,l,i),f[t])}for(let e=0;e<b.length;e++){if(b[e]<=0)continue;const n=Math.round(255*b[e]);t.fillStyle=`rgb(${n} ${n} ${n})`,t.fillRect(e%h*2,2*Math.floor(e/h),2,2)}return c&&i&&x?.kick(),F||c}});const R=n(),F=x?null:document.createElement("div"),P=()=>{if(!F)return;const t=k(),e=t.length,n=u.current.max??1.04*Math.max(...t,0);F.replaceChildren(...t.map((t,r)=>{const l=document.createElement("div");return l.setAttribute("style",`flex:1 1 0;height:${n>0?(100*o(t/n)).toFixed(2):0}%;margin:0 ${e<=7?22:18}%;background:currentColor;opacity:${.9*(.16+.84*C(r,e))}`),l}))};F&&("static"===getComputedStyle(s).position&&R.set(s,"position","relative"),F.setAttribute("aria-hidden","true"),F.setAttribute("style","position:absolute;inset:0;display:flex;align-items:flex-end;pointer-events:none"),s.appendChild(F));const W=document.createElement("table");W.setAttribute("style","position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0");const H=()=>{const t=u.current.format??(t=>t.toLocaleString()),e=u.current.labels??[],n=document.createElement("tbody");k().forEach((r,o)=>{const l=document.createElement("tr"),a=document.createElement("th"),i=document.createElement("td");a.setAttribute("scope","row"),a.setAttribute("style","font-weight:inherit"),a.textContent=e[o]??String(o+1),i.textContent=t(r),l.appendChild(a),l.appendChild(i),n.appendChild(l)}),W.replaceChildren(n)};H(),s.appendChild(W);const I=!s.hasAttribute("tabindex"),z=!s.hasAttribute("role");I&&(s.tabIndex=0),z&&s.setAttribute("role","group");const B=t=>{const e=k().length,n=null!==t&&e?Math.min(e-1,Math.max(0,Math.round(t))):null;n!==m&&(m=n,x?.kick(),P(),u.current.onHover?.(m,null===m?null:k()[m],null===m?null:u.current.labels?.[m]??null))},O=t=>u.current.stagger??(t<=7?45:12),X=(t,n)=>{const r=k(),o=u.current.labels,l=performance.now(),i=!!x?.still(),c=E.cols&&!i?t.map((e,n)=>S(n,t,l,!1)):[],s=i?[]:w.map(t=>({...t,h:t.h*(1-e((l-g)/u.current.duration))})),h=new Map,m=(t,e,r)=>o&&n?r?.[t]??`#${t}`:"#"+(e-1-t);t.forEach((e,r)=>h.set(m(r,t.length,n),r));const p=new Set,M=f;let y=0;const A=r.length;v=r.map((t,e)=>{const n=h.get(m(e,A,o));return void 0!==n&&c[n]?(p.add(n),c[n]):null}),f=r.map((t,e)=>{const n=h.get(m(e,A,o));return void 0!==n?M[n]??a:a}),b=v.map(t=>t?0:y++*O(A)*.6),w=[...s,...c.filter((t,e)=>!p.has(e))].filter(t=>t.h>.01),d=r,g=l,x?.kick(),P()};P();const j=t=>{const e=s.getBoundingClientRect(),n=k().length;if(!e.width)return;const r=(t.clientX-e.left)/e.width,o=t.clientY-e.top;if(r<0||r>1||o<0||o>e.height)return void B(null);if(!E.cols)return void B(i(r,n));const{bar:l,gap:a,left:h}=c(E.cols,n);B(Math.round(((t.clientX-e.left-L.left)/L.cell-h-l/2)/Math.max(1,l+a)))},D=()=>B(null),G=t=>{const e=k().length,n="ArrowRight"===t.key?null===m?0:Math.min(e-1,m+1):"ArrowLeft"===t.key?null===m?e-1:Math.max(0,m-1):"Home"===t.key?0:"End"===t.key?e-1:"Escape"===t.key?null:void 0;void 0!==n&&e&&(t.preventDefault(),B(n))};s.addEventListener("pointermove",j),s.addEventListener("pointerdown",j),s.addEventListener("pointerleave",D),s.addEventListener("pointercancel",D),s.addEventListener("keydown",G),s.addEventListener("blur",D);const Q="function"==typeof IntersectionObserver?new IntersectionObserver(([t])=>{t?.isIntersecting&&!M&&(M=!0,!1!==u.current.intro&&(()=>{const t=k().length;d=k(),g=performance.now(),v=[],w=[],b=Array.from({length:t},(e,n)=>n*O(t)),f=k().map((t,e,n)=>C(e,n.length)),x?.kick(),P()})())},{threshold:.4}):null;Q?.observe(s);let Y=u.current.labels;return r(()=>x,u,t=>{H(),t.values!==d&&(X(d,Y),Y=t.labels),x?.refresh()},{set(t,e){const n=d,r=Y;u.current={...u.current,values:[...t],...e?{labels:[...e]}:{}},Y=u.current.labels,null!==m&&m>=t.length&&B(null),H(),X(n,r)},highlight:B,get active(){return m},get values(){return k()}},()=>{Q?.disconnect(),W.remove(),F?.remove(),R.restore(),s.removeEventListener("pointermove",j),s.removeEventListener("pointerdown",j),s.removeEventListener("pointerleave",D),s.removeEventListener("pointercancel",D),s.removeEventListener("keydown",G),s.removeEventListener("blur",D),I&&s.removeAttribute("tabindex"),z&&s.removeAttribute("role")})}var h=l;export{h as BLOCK_CHART_DEFAULTS,i as barAt,c as barLayout,s as blockChart};//# sourceMappingURL=chunk-EHXSXMBE.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{velocity as t,stepSpring as e}from"./chunk-XDNCXCR7.js";import{clamp as r,styleKeeper as n,mountSurface as o,handle as a,prefersReduced as i}from"./chunk-PFQBEWCF.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,C=0,S=-1,R=new Map,$=null,F=null;const W=t=>v()[D(t)]??null,q=()=>u.clientWidth||160,D=t=>{const e=v().length;return e?(t%e+e)%e:0},P=(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 T(){const t=v(),e=x+(E?1:0),r=!m.current.loop&&e>=t.length?null:W(e);t.forEach(t=>{F?(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")}F=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:()=>{F=null,p.restore(),T()},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=P(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=P(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 X=t=>{I=0;const n=Math.min(1/30,Math.max(0,(t-C)/1e3));C=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);!F&&t&&p.set(t,"transform",`translate(${M.x}px, ${w.x}px) rotate(${.22*r(M.x/q(),-1.6,1.6)}rad)`)})(),F?.kick(),(o||y||E)&&(I=requestAnimationFrame(X))},N=()=>{I||(C=performance.now(),I=requestAnimationFrame(X))},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=D(x);return y=!1,f()||!F?(x+=1,j(),F||p.set(r,"transform","")):(E={dir:t,start:performance.now(),x0:M.x,y0:w.x},b.to=1),T(),N(),m.current.onSwipe?.(t,n,r),!0},B=e=>{if(!y||void 0!==e&&void 0!==e.pointerId&&e.pointerId!==S)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),N())},G=()=>u.getBoundingClientRect().width/(u.clientWidth||1)||1,H=t=>{if(0!==t.button||E)return;try{u.setPointerCapture?.(t.pointerId)}catch{}S=t.pointerId;const e=G();y=!0,k=t.clientX-M.x*e,A=t.clientY-w.x/.3*e,L=[],N()},Y=t=>{if(!y||t.pointerId!==S)return;const e=G();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(),N()},O=t=>{"ArrowLeft"!==t.key&&"ArrowRight"!==t.key||(t.preventDefault(),z("ArrowRight"===t.key?1:-1))},Q=()=>F?.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"),T(),u.addEventListener("pointerdown",H),u.addEventListener("pointermove",Y),u.addEventListener("pointerup",B),u.addEventListener("pointercancel",B),u.addEventListener("lostpointercapture",B),u.addEventListener("keydown",O),u.addEventListener("load",Q,!0),u.addEventListener("dragstart",U),a(()=>F,m,()=>{R=new Map,T(),F?.refresh()},{next:z,get index(){return D(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",H),u.removeEventListener("pointermove",Y),u.removeEventListener("pointerup",B),u.removeEventListener("pointercancel",B),u.removeEventListener("lostpointercapture",B),u.removeEventListener("keydown",O),u.removeEventListener("load",Q,!0),u.removeEventListener("dragstart",U)})}var g=l;export{g as SWIPE_DECK_DEFAULTS,u as swipeDeck,d as toneImage};//# sourceMappingURL=chunk-EHYFSX5K.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{blank as t,mountPageField as e,pageHandle as n}from"./chunk-4SHQA3CO.js";import{styleKeeper as r}from"./chunk-PFQBEWCF.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-EJ3W4FN6.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-KTYCGGRO.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),C=Math.ceil(f/m);a.clearRect(0,0,s,f),a.font=`${d}px ${t}`,a.textBaseline="top";const x=b?o:e;let z=x.r,w=x.g,y=x.b;const G=n(a);if(u){const t=r(u);t&&(z=t.r,w=t.g,y=t.b)}let j=z,v=w,R=y;const T=S?r(S):null;T&&(j=T.r,v=T.g,R=T.b);const V=M*$,A=g.chars?Array.from(g.chars):void 0,B=["-","\\","|","/"];for(let t=0;t<C;t++){const o=t/C;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))%B.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)]:B[u];if(" "===S)continue;const $=!!T&&M>.85,b=l(M);a.fillStyle=$?`rgba(${j},${v},${R},${b})`:`rgba(${z},${w},${y},${b})`,a.fillText(S,G(e*p),G(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-EK4GIXIO.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{imageFor as e,injectStyle as t,imageReady as r,drawCover as i}from"./chunk-PCGRRX5P.js";import{styleKeeper as n,clamp as o,mountSurface as a,handle as s,house as l}from"./chunk-PFQBEWCF.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]"),E=x??document.createElement("div"),M=y??document.createElement("span"),C=e=>{void 0===e&&E.hasAttribute("aria-label")||E.setAttribute("aria-label",e??"Photo and ASCII split")},L=()=>{const e=Math.round(h);p.set(c,"--ascii-pos",`${h}%`),E.setAttribute("aria-valuenow",String(e)),E.setAttribute("aria-valuetext",`${e}% photo, ${100-e}% ASCII`)},S=(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,L(),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),L(),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},F=e=>{if(0!==e.button)return;c.setPointerCapture?.(e.pointerId),f=!0,c.dataset.dragging="";const t=N(e.clientX);S(t,Math.abs(t-h)>3),E.focus({preventScroll:!0})},P=e=>{f&&S(N(e.clientX))},I=()=>{f=!1,delete c.dataset.dragging},j=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(),S(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||(M.className="ascii-compare-line",M.setAttribute("aria-hidden","true")),x||(E.className="ascii-compare-handle",E.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>',E.setAttribute("role","slider"),E.tabIndex=0),C(u.current.label),E.setAttribute("aria-valuemin","0"),E.setAttribute("aria-valuemax","100"),E.setAttribute("aria-orientation","horizontal");for(const e of[k,M,E])c.contains(e)||(c.appendChild(e),w.push(e));L(),c.addEventListener("pointerdown",F),c.addEventListener("pointermove",P),c.addEventListener("pointerup",I),c.addEventListener("pointercancel",I),E.addEventListener("keydown",j),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=>{C(e.label),e.position!==A&&(A=e.position,S(e.position,!0)),g?.refresh()},{set:S,get position(){return h}},()=>{b&&cancelAnimationFrame(b),c.removeEventListener("pointerdown",F),c.removeEventListener("pointermove",P),c.removeEventListener("pointerup",I),c.removeEventListener("pointercancel",I),E.removeEventListener("keydown",j),delete c.dataset.dragging,w.forEach(e=>e.remove()),q(),p.restore()})}export{c as compare};//# sourceMappingURL=chunk-EPVZIGEZ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{parseColor as t}from"./chunk-ZCHGV2CV.js";import{mountCanvas as o}from"./chunk-KTYCGGRO.js";import{mixHex as e}from"./chunk-PFQBEWCF.js";function n(o,e,n,a,r={}){const{fontSize:i=13,chars:l=" .,:;i+xX#&@",color:h="#ff4500",hotColor:f="#ffe066",intensity:c=.85,wind:s=0,speed:m=1,lightMode:M=!1}=r,p=.62*i,d=1.4*i,g=Math.ceil(e/p),u=Math.ceil(n/d),b=g*u,x="__fire_heat__",C=o.canvas;let k=C[x];k&&k.length===b||(k=new Float32Array(b),C[x]=k);const A=.18*(.016*m),F=s*m*.8,S=u-1,_=a*m;for(let t=0;t<g;t++){const o=(.6*(.5*Math.sin(.31*t+4.1*_)+.5)+.4*(.5*Math.sin(.73*t-2.7*_)+.5))*c;k[S*g+t]=Math.min(1,o+.15*Math.random()*c),S>0&&(k[(S-1)*g+t]=Math.min(1,.85*o+.1*Math.random()*c))}const y=new Float32Array(b);for(let t=0;t<u-2;t++)for(let o=0;o<g;o++){const e=.4*k[(t+1)*g+o]+.25*k[(t+2)*g+Math.max(0,Math.min(g-1,o+Math.round(F)))]+.175*k[(t+1)*g+Math.max(0,o-1)]+.175*k[(t+1)*g+Math.min(g-1,o+1)];y[t*g+o]=Math.max(0,e-A-.02*Math.random()*m)}for(let t=0;t<g;t++)y[(u-1)*g+t]=k[(u-1)*g+t],u>1&&(y[(u-2)*g+t]=k[(u-2)*g+t]);C[x]=y;const z=t(h)??{r:255,g:69,b:0},$=t(f)??{r:255,g:224,b:102};o.clearRect(0,0,e,n),o.font=`${i}px "JetBrains Mono", monospace`,o.textBaseline="top";for(let t=0;t<u;t++)for(let e=0;e<g;e++){const n=y[t*g+e];if(n<.03)continue;const a=l[Math.min(l.length-1,Math.floor(n*l.length))];if(" "===a)continue;const r=Math.min(1,1.2*n),i=z.r+($.r-z.r)*r|0,h=z.g+($.g-z.g)*r|0,f=z.b+($.b-z.b)*r|0,c=M?1-.3*n:Math.min(1,n+.15);o.globalAlpha=c,o.fillStyle=`rgb(${i},${h},${f})`,o.fillText(a,e*p,t*d)}o.globalAlpha=1}var a={id:"fire",name:"Fire",description:"A cellular flame rising from the bottom edge.",cellSize:13,speed:1,cursor:!1,mount:t=>o(t,(t,o,a,r,i,l)=>n(t,o,a,l.elapsed,{fontSize:l.fontSize,chars:l.chars,color:l.ink,hotColor:l.accent??e(l.ink,"#ffffff",.6),speed:l.speed}),48)};export{a as fire,n as renderFireBackground};//# sourceMappingURL=chunk-EWPT56TR.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{scenePreset as e}from"./chunk-OVCIHOOS.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-FIWIUXNV.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{clamp as e,hash as t,styleKeeper as r,mountSurface as o,handle as n,prefersReduced as i}from"./chunk-PFQBEWCF.js";var a={kind:"heart",icon:"svg",manage:!0,outset:40,layer:"under"},l=t=>1-(1-e(t))**3,s=e=>e>=1?1:1-Math.exp(-5*e)*Math.cos(9*e);function c(e,t,r,o,n){if(e.beginPath(),"heart"===t){const t=n/29;for(let n=0;n<=56;n++){const i=n/56*Math.PI*2,a=16*Math.sin(i)**3,l=-(13*Math.cos(i)-5*Math.cos(2*i)-2*Math.cos(3*i)-Math.cos(4*i));0===n?e.moveTo(r+a*t,o+(l-2.5)*t):e.lineTo(r+a*t,o+(l-2.5)*t)}}else{const t=.7*n,i=o-n/2,a=r-t/2,l=.12*n;e.moveTo(a,i+l),e.arcTo(a,i,a+l,i,l),e.lineTo(a+t-l,i),e.arcTo(a+t,i,a+t,i+l,l),e.lineTo(a+t,o+n/2),e.lineTo(r,o+n/2-.27*n),e.lineTo(a,o+n/2)}e.closePath()}function u(e,t,r,o,n,i){const a=e.createRadialGradient(r,o-.1*n,0,r,o,.62*n);a.addColorStop(0,"#fff"),a.addColorStop(.7,"#e6e6e6"),a.addColorStop(1,"#8c8c8c"),e.globalAlpha=i,e.fillStyle=a,e.shadowColor="#bbb",e.shadowBlur=Math.max(2,.08*n),c(e,t,r,o,n),e.fill(),e.shadowBlur=0,e.globalAlpha=1}function d(r,o,n,i,a){const d=n.x+n.w/2,h=n.y+n.h/2,f=n.h,p=1.45*f,k=s(i/.3),g=(e=>e<.5?4*e**3:1-(-2*e+2)**3/2)(e((i-.42)/.3)),b=g>0?p+(f-p)*g:.7*f+(p-.7*f)*k,M=e((i-.04)/.46);M>0&&M<1&&(r.strokeStyle=(t=>{const r=Math.round(255*e(t));return`rgb(${r} ${r} ${r})`})(.8*(1-M)**1.4),r.lineWidth=2.4-1.2*M,r.lineJoin="round",c(r,o,d,h,f*(1.2+.5*l(M))),r.stroke());r.fillStyle="#fff";for(let e=0;e<7;e++){const o=(i-.1-.05*t(e,a))/.5;if(o<=0||o>=1)continue;const n=-Math.PI/2+(e-3)/7*Math.PI*1.7+.3*(t(a+1,e)-.5),s=f*(.75+(.55+.35*t(e,a+2))*l(o)),c=1.8*(1-.6*o);r.globalAlpha=1-o*o,r.beginPath(),r.arc(d+Math.cos(n)*s*1.15,h+Math.sin(n)*s*.85,c,0,2*Math.PI),r.fill()}r.globalAlpha=1,u(r,o,d,h,b,1-e((i-.72)/.28))}function h(e,s={}){const c={current:{...a,...s}},h=r(),f=()=>e.querySelector(c.current.icon)??e,p=()=>!!(c.current.reducedMotion??i());let k="true"===e.getAttribute("aria-pressed"),g=[],b=[],M=null;M=o({host:e,outset:c.current.outset,layer:c.current.layer,look:()=>({mark:"glyph",charset:" .:-=+*#%@",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:4,cellAspect:.62,glyphScale:.92,...c.current.look}),ink:e=>c.current.ink??("heart"===c.current.kind?`var(--ascii-like, ${e?"#ff6b70":"#e5484d"})`:"--ascii-ink-strong"),kit:c,reducedMotion:()=>c.current.reducedMotion,onFail:()=>{M=null},paint:({pen:e,w:r,now:o,box:n})=>{const i=n(f()),a=c.current.kind;g=g.filter(r=>{const n=(o-r.start)/("burst"===r.kind?560:300);if(n>=1)return!1;if(n<0)return!0;if(e.save(),"burst"===r.kind)d(e,a,i,n,r.seed);else{const r=i.x+i.w/2,o=i.y+i.h/2+3*l(n),s=i.h*(1+.12*l(n));u(e,a,r,o,s,(1-n)**1.4),e.fillStyle="#000";for(let i=o-s/2;i<o+s/2;i+=3)for(let o=r-s/2;o<r+s/2;o+=2)t(o,i)<1.15*n&&e.fillRect(o,i,2,3)}return e.restore(),!0});const s=c.current.limit;if(s&&g.length){const t=n(s),o=t.y+t.h,i=e.createLinearGradient(0,o-2,0,o+8);i.addColorStop(0,"#000"),i.addColorStop(1,"rgb(0 0 0 / 0)"),e.fillStyle="#000",e.fillRect(0,0,r,o-2),e.fillStyle=i,e.fillRect(0,o-2,r,10)}return g.length>0}});const m=()=>{b.forEach(clearTimeout),b=[]},y=()=>{if(m(),h.restore(),!M||p())return;const t=performance.now(),r=f();g=g.filter(e=>"undo"!==e.kind),g.push({kind:"burst",start:t,seed:Math.floor(t)%97}),r!==e&&h.set(r,"opacity","0"),b.push(setTimeout(()=>{h.restore(),r!==e&&"function"==typeof r.animate&&r.animate({opacity:["0","1"],scale:[".7","1"]},{duration:220,easing:"cubic-bezier(.34, 1.42, .64, 1)"})},347.2)),M.kick()},S=()=>{m(),h.restore(),M&&!p()&&(g=g.filter(e=>"burst"!==e.kind),g.push({kind:"undo",start:performance.now(),seed:0}),M.kick())},T=(t=!k)=>{k=t,e.setAttribute("aria-pressed",String(k)),k?y():S()},v=()=>{c.current.manage&&(T(),c.current.onChange?.(k))};return!e.hasAttribute("aria-pressed")&&c.current.manage&&e.setAttribute("aria-pressed","false"),e.addEventListener("click",v),n(()=>M,c,()=>M?.refresh(),{burst:y,undo:S,toggle:T,get pressed(){return k}},()=>{m(),h.restore(),e.removeEventListener("click",v)})}var f=a;export{f as LIKE_BURST_DEFAULTS,d as burstFrame,h as likeBurst,s as springOut};//# sourceMappingURL=chunk-G4BQYQJ6.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-KTYCGGRO.js";import{mixHex as l}from"./chunk-PFQBEWCF.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:b=.55,heightScale:M=.55,stars:d=!0,lightMode:m=!1}=i,k=.62*c,u=1.4*c,C=Math.ceil(l/k),x=Math.ceil(n/u),S=o(f)??{r:76,g:175,b:80},$=o(h)??{r:26,g:35,b:126},y=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(C);for(let o=0;o<C;o++){const e=(.5*t((o/C+A)*b*3,.5)+.5)*M;z[o]=Math.floor(e*x)}for(let o=0;o<x;o++)for(let t=0;t<C;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(${$.r+60},${$.g+60},${$.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=S.r+(y.r-S.r)*f|0,g=S.g+(y.g-S.g)*f|0,p=S.b+(y.b-S.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-GCIZKMJL.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{blank as t,mountPageField as e,pageHandle as o,sleep as n,pulseAt as r}from"./chunk-4SHQA3CO.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-H4DBJULW.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{mountPageField as e,pageHandle as t,sleep as r,pulseAt as o}from"./chunk-4SHQA3CO.js";import{styleKeeper as a}from"./chunk-PFQBEWCF.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-HMW5NRUV.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-PFQBEWCF.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="",A=null;const M=d?e("",!0):null,v=document.createElement("span");let F="",$="";const E=()=>f.current.reducedMotion??s(),B=(t,e)=>{$=F,F=t,d&&(M&&(M.textContent=t),A?(v.replaceChildren(...[...t].map(t=>Object.assign(document.createElement("span"),{textContent:t}))),b=e?performance.now():-1e9,A.kick()):d.textContent=t)};d&&(A=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:()=>{A=null,d.textContent=F,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),A=y.y+(y.h-m-g)/2+m,M=y.x+y.w/2,v=k?$[c]??" ":s.textContent,F=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],B=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=A+n*y.h-B;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,M,o)}),t.restore()}),t.globalAlpha=1,S||!n&&("thinking"===x||k)}}),A&&M&&(m.set(v,"display","inline-flex"),m.set(v,"white-space","pre"),v.setAttribute("aria-hidden","true"),d.replaceChildren(M,v,A.canvas)));const T=document.createElement("span"),z=()=>{w++,x="thinking",C=performance.now(),S="",T.replaceChildren(),u.replaceChildren(T),u.setAttribute("aria-busy","true"),B(f.current.labels?.thinking??"Thinking…",!1),f.current.onState?.("thinking",0),A?.kick()};let P=0,W=0;return f.current.start&&z(),i(()=>A,f,()=>A?.refresh(),{think:z,stream:async t=>{"thinking"!==x&&z();const e=w;P=0;let n="";const o=()=>{"thinking"===x&&(x="streaming",W=performance.now(),k=Math.max(1,Math.round((W-C)/1e3)),B((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()&&!A?.still();for(const n of t.match(/\s+|\S+/g)??[]){if(/^\s/.test(n)){T.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()-W));m.set(t,"transition",`opacity 260ms cubic-bezier(.16, 1, .3, 1) ${Math.round(e)}ms`),requestAnimationFrame(()=>requestAnimationFrame(()=>t.style.setProperty("opacity","1")))}P++,T.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()-W))+260;await new Promise(t=>setTimeout(t,a)),e===w&&(x="done",u.setAttribute("aria-busy","false"),f.current.onState?.("done",k),A?.kick())},get state(){return x}},()=>{w++,m.restore(),u.removeAttribute("aria-busy"),S?u.textContent=S:u.replaceChildren(...g),d&&(F?d.textContent=F:d.replaceChildren(...y))})}var p=c;export{p as THINKING_DEFAULTS,u as thinking};//# sourceMappingURL=chunk-IUX46UDR.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{mountField as e,hoverOf as t,narrow as r}from"./chunk-OVCIHOOS.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-JAM46FF6.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{mergeOptions as e,prefersReduced as t}from"./chunk-PFQBEWCF.js";import{disposeKit as r,setPosterSource as o}from"./chunk-XVB3B3FV.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 C=!1;const F=e=>{C=!0,e.destroy(),y&&!f&&("function"==typeof getComputedStyle&&"static"===getComputedStyle(s).position&&s.style.setProperty("position","relative"),s.style.setProperty("isolation","isolate"))},M=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 F(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),F(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?M(r):y&&(y.canvas.style.opacity=k(),y.refresh())},play(){!f&&d&&(d=!1,y?.play())},pause(){f||(d=!0,y?.pause())},setPreset:M,destroy(){if(!f){f=!0;for(const e of m)clearTimeout(e.timer),e.run.destroy(),C=!0;m.clear(),y?.destroy(),y=null,C&&(P("position",S.position),P("isolation",S.isolation)),r(p)}}}}export{c as background,i as backgroundCharset};//# sourceMappingURL=chunk-JRSCTMFM.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{renderMaterial as t}from"./chunk-XPXMCXYI.js";import{mountCanvas as i}from"./chunk-KTYCGGRO.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-KBXVIAWS.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{snapshot as e,drawCover as t,toneOf as n}from"./chunk-PCGRRX5P.js";import{styleKeeper as r,srOnly as o,mountSurface as i,clamp as a,smoothstep as s,easeOut as l,handle as h}from"./chunk-PFQBEWCF.js";var c={threshold:64},u=.3;function d(e,t,n=300,r=.86,o=.2){const i=2*Math.sqrt(n)*r,a=Math.max(1,Math.ceil(240*t)),s=t/a;for(let t=0;t<a;t++)e.v+=(-n*(e.x-e.to)-i*e.v)*s,e.x+=e.v*s;return!(Math.abs(e.x-e.to)<o&&Math.abs(e.v)<12*o)||(e.x=e.to,e.v=0,!1)}function p(p,f){const m={current:{...c,...f}},v=r(),g=()=>m.current.content??p.children[0]??null,y=o("",!0),w={x:0,v:0,to:0};let M="idle",x=!1,b=!1,k=0,E=-1,L=0,P=0,C=0,A=!0,S=0,F=null,I=[];const R=new WeakSet,T=e=>{y.textContent=e};F=i({host:p,look:()=>({mark:"glyph",charset:" .:-=+*#%@",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:5,cellAspect:.62,glyphScale:.94,...m.current.look}),ink:()=>m.current.ink??"--ascii-ink-strong",kit:m,reducedMotion:()=>m.current.reducedMotion,resolution:2,onFail:()=>{F=null},paint:({pen:r,w:o,now:i,still:h,scale:c,box:p})=>{const f=C?Math.min(1/30,(i-C)/1e3):1/60;C=i;let y=x;h?(w.x=w.to,w.v=0):x||(y=d(w,f)||y),"refreshing"===M&&(L+=6.5*f,y=!0),"done"===M&&i-P<320&&(y=!0);const b=g();b&&v.set(b,"translate",`0 ${Math.max(0,w.x).toFixed(2)}px`),r.setTransform(c,0,0,c,0,0);const k=m.current,E=Math.max(0,w.x),R=a(E/k.threshold),T=Math.min(k.threshold,48),W="idle"===M||"pulling"===M?s(.1,.55,R):a(E/T),Y=o/2,D=Math.min(E,T)/2+.25*Math.max(0,E-T);"pulling"===M&&R>=1&&!S&&(S=i),R<1&&(S=0);const H=S&&!h&&i-S<260?.14*Math.sin(Math.PI*((i-S)/260)):0;if(H&&(y=!0),E>.5&&W>.01){if(r.save(),r.beginPath(),r.rect(0,0,o,E),r.clip(),r.translate(Y,D),r.scale(W*(1+H),W*(1+H)),r.lineWidth=4,r.lineCap="round","idle"===M||"pulling"===M){const e=-Math.PI/2+.03*Math.max(0,E-k.threshold);r.strokeStyle=`rgba(255,255,255,${.55+.45*R})`,r.beginPath(),r.arc(0,0,11,e,e+2*Math.PI*Math.max(.02,R)),r.stroke()}else{const e="done"===M&&A?h?1:l((i-P)/300):0,t="refreshing"!==M||h?1:l((i-P)/240),n=24,o=2*Math.PI*(1-.22*t);for(let i=0;i<n;i++){const a=L-Math.PI/2+i/n*o,s=1-.85*t*(1-i/(n-1));r.strokeStyle=`rgba(255,255,255,${s*(1-e)*("done"!==M||A?1:.4)})`,r.beginPath(),r.arc(0,0,11,a,a+o/n+.02),r.stroke()}e>0&&function(e,t,n,r,o){if(o<=0)return;const i=[[-.82,.02],[-.26,.56],[.86,-.6]].map(([e,o])=>[t+e*r,n+o*r]),a=Math.hypot(i[1][0]-i[0][0],i[1][1]-i[0][1])+Math.hypot(i[2][0]-i[1][0],i[2][1]-i[1][1]);e.save(),e.strokeStyle="#fff",e.lineWidth=4.5,e.lineCap="round",e.lineJoin="round",e.setLineDash([a*o,a]),e.beginPath(),e.moveTo(i[0][0],i[0][1]),e.lineTo(i[1][0],i[1][1]),e.lineTo(i[2][0],i[2][1]),e.stroke(),e.restore()}(r,0,0,11,e)}r.restore()}return I=I.filter(o=>{if(!o.row.isConnected)return q(o,!0),!1;const a=h?1:(i-o.start)/760;if(a<0||!Number.isFinite(a))return y=y||Number.isFinite(a),!0;if(a>=u&&q(o),a>=1)return q(o,!0),!1;const s=p(o.row);(!o.snap||Math.abs(o.snap.width/2-s.w)>.5||Math.abs(o.snap.height/2-s.h)>.5)&&(o.snap=e(o.row,s.w,s.h,e=>{const t=p(e);return{x:t.x-s.x,y:t.y-s.y,w:t.w,h:t.h}}).canvas,o.photos=[...o.row.querySelectorAll("img")]);const c=o.snap;return o.photos.length&&function(e,r,o){const i=r.getContext("2d"),a=o(e.row);e.photos=e.photos.filter(e=>{if(!e.complete)return!0;if(!i||!e.naturalWidth)return!1;const r=o(e),s=r.x-a.x,l=r.y-a.y,h=Math.min(parseFloat(getComputedStyle(e).borderTopLeftRadius)||0,r.w/2,r.h/2);return i.save(),i.setTransform(2,0,0,2,0,0),i.beginPath(),i.roundRect(s,l,r.w,r.h,h),i.clip(),i.fillStyle="#000",i.fillRect(s,l,r.w,r.h),t(i,n({image:e,width:e.naturalWidth,height:e.naturalHeight},!F?.dark()),s,l,r.w,r.h),i.restore(),!1})}(o,c,p),r.globalAlpha=a<u?l(a/u,3):1-l((a-u)/.7,3),r.drawImage(c,s.x,s.y,s.w,s.h),r.globalAlpha=1,y=!0,!0}),y||(C=0),y}});const W=()=>F?.kick();function q(e,t=!1){const n=e.row.style;e.shown||(e.shown=!0,n.transition="opacity 280ms cubic-bezier(.16, 1, .3, 1)",n.opacity=e.opacity),t&&(n.transition=e.transition)}const Y=(e,t)=>{if(F&&!F.still()){for(const n of e)n instanceof HTMLElement&&!R.has(n)&&(R.add(n),I.push({row:n,snap:null,start:t,opacity:n.style.opacity,transition:n.style.transition,shown:!1,photos:[...n.querySelectorAll("img")]}),n.style.transition="none",n.style.opacity="0");W()}},D=()=>{const e=performance.now();I.forEach(t=>{t.start===1/0&&(t.start=e)}),W()},H=e=>new Promise(t=>setTimeout(t,e)),$=async()=>{if("refreshing"===M||"done"===M)return;const e=m.current,t=!F||F.still();M="refreshing",x=b=!1,w.to=Math.min(e.threshold,48),P=performance.now(),p.setAttribute("aria-busy","true"),T(e.messages?.refreshing??"Refreshing."),W(),A=!0;try{await Promise.all([e.onRefresh(),H(t?0:600)])}catch{A=!1}if("refreshing"===M){if(A&&e.reveal&&!t){await new Promise(e=>"function"==typeof requestAnimationFrame?requestAnimationFrame(()=>e()):e());const t=g();t&&Y(t.querySelectorAll(e.reveal),1/0)}M="done",P=performance.now(),T(A?e.messages?.done??"Updated.":e.messages?.failed??"Couldn’t refresh."),W(),await H(t?0:620),"done"===M?(M="idle",w.to=0,D(),p.removeAttribute("aria-busy"),W()):D()}},j=e=>{0!==e.button||"idle"!==M||p.scrollTop>0||(x=!0,b=!1,k=e.clientY,E=e.pointerId)},z=e=>{if(!x||e.pointerId!==E)return;e.clientY<k&&(k=e.clientY);const t=(e.clientY-k)/(p.getBoundingClientRect().height/(p.clientHeight||1)||1);if(!b){if(t<6)return;b=!0,M="pulling";try{p.setPointerCapture?.(e.pointerId)}catch{}}w.x=w.to=(e=>128*(1-Math.exp(-Math.max(0,e)/128)))(t-6),w.v=0,W()},B=()=>{if(x&&(x=!1,b)){if(b=!1,w.x>=m.current.threshold)return M="idle",void $();M="idle",w.to=0,W()}},G=e=>{b&&e.preventDefault()},N=e=>{x&&e.preventDefault()};return F?(v.set(p,"overscroll-behavior-y","contain"),p.appendChild(y),p.addEventListener("pointerdown",j),p.addEventListener("pointermove",z),p.addEventListener("pointerup",B),p.addEventListener("pointercancel",B),p.addEventListener("touchmove",G,{passive:!1}),p.addEventListener("dragstart",N),p.addEventListener("selectstart",N)):p.appendChild(y),h(()=>F,m,()=>F?.refresh(),{refresh:$,revealRows:e=>Y(e,performance.now()),get state(){return M}},()=>{M="idle",I.forEach(e=>{e.row.style.opacity=e.opacity,e.row.style.transition=e.transition}),I=[],p.removeEventListener("pointerdown",j),p.removeEventListener("pointermove",z),p.removeEventListener("pointerup",B),p.removeEventListener("pointercancel",B),p.removeEventListener("touchmove",G),p.removeEventListener("dragstart",N),p.removeEventListener("selectstart",N),p.removeAttribute("aria-busy"),y.remove(),v.restore()})}var f=c;export{f as PULL_REFRESH_DEFAULTS,p as pullRefresh,d as stepSpring};//# sourceMappingURL=chunk-KJJJORN6.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-PFQBEWCF.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),k=document.createElement("span"),C=()=>{k.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(k),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:C,up:S,first:b}=y,F=[...k.children],A=h.current,B="glyph"===A.face,M=(t,e)=>t[t.length-1-e]??"";let w=!1;return F.forEach((c,s)=>{const h=F.length-1-s,g=r(c),y=g.x+(g.w-u)/2,k=g.y,E=g.h,$=k+(E-d-m)/2+d,T=M(v,h),z=b-h,G=!n&&b>=0&&z>=0&&/\d/.test(T)?l((e-C)/(A.duration+z*A.stagger)):1,N=o(G),P=G<1&&!B?a(.72,1,G).toFixed(3):"";if(c.style.opacity!==P&&(c.style.opacity=P),G>=1)return void(B&&(t.globalAlpha=1,t.font=p,t.fillStyle="#fff",t.fillText(T,y,$)));w=!0,t.globalAlpha=B?1:1-a(.72,1,G);const W=5+2*z,j=[M(x,h),...Array.from({length:W},(t,e)=>A.glyphs[Math.floor(i(e+7*h,C)*A.glyphs.length)]??""),T];S||j.reverse();const D=(j.length-1)*E,I=S?N*D:D-N*D;t.save(),t.beginPath(),t.rect(y-g.w,k,2*g.w,E),t.clip(),j.forEach((e,n)=>{const o=$+n*E-I;if(o<k-E||o>k+2*E)return;const r=n>0&&n<j.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,w}});const S=()=>{x&&g.set(k,"color","glyph"===h.current.face?"transparent":"inherit")};x&&(g.set(k,"display","inline-flex"),S(),k.setAttribute("aria-hidden","true"),f.replaceChildren(v,k,...(t=>[...t.children].filter(t=>"IMG"===t.tagName&&void 0!==t.dataset?.asciiPoster))(f),x.canvas),C(),document.fonts?.ready.then(()=>x?.kick()));const b=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()},C(),x.kick()):f.textContent=m};return r(()=>x,h,t=>{S(),t.value!==d?b(t.value):(m=t.format(d),C(),x?.refresh())},{set:b,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-KS3TL3S2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{styleKeeper as e,isDark as t,resolveColor as n,prefersReduced as i,boxIn as o}from"./chunk-PFQBEWCF.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 E=0,M=!0,w=!1,L=!1,A=0,C=0,F=0,O=!1,S=9,R=9,z=1,k=1,q=u;const I={x:.5,y:.5},P=()=>!!(d.reducedMotion()??i()),W=()=>{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,S,I,n);l(v,z,k,S,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(E=0,L||w||!M||"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&&(O=!O))return void(E=requestAnimationFrame(j));const o=A?Math.min(.05,(e-A)/1e3):0;if(A=e,t||(S+=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));W(),t||(E=requestAnimationFrame(j))},B=()=>{E||L||w||!M||(E=requestAnimationFrame(j))},H=()=>{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,M&&!w&&W(),B()};H();const T="function"==typeof ResizeObserver?new ResizeObserver(H):null;T?.observe(m);const G="function"==typeof IntersectionObserver?new IntersectionObserver(([e])=>{M=e.isIntersecting,A=0,M?B():E&&(cancelAnimationFrame(E),E=0)},{rootMargin:"64px"}):null;G?.observe(m);const K=()=>{A=0,B()};document.addEventListener("visibilitychange",K);const Q="function"==typeof matchMedia?matchMedia("(prefers-reduced-motion: reduce)"):null;Q?.addEventListener?.("change",K),0===a.users++&&"function"==typeof addEventListener&&addEventListener("pointermove",c,{passive:!0});const X="object"==typeof document.fonts?document.fonts:null,Y=()=>{L||!M||w||(W(),B())};X?.addEventListener?.("loadingdone",Y),X?.ready?.then(Y,()=>{});let D=0;const J=()=>{D||L||(D=requestAnimationFrame(()=>{D=0,L||(y=t(m),x(),P()&&W(),B())}))},N="function"==typeof matchMedia?matchMedia("(prefers-color-scheme: dark)"):null;N?.addEventListener?.("change",J);const U="function"==typeof MutationObserver?new MutationObserver(J):null;for(const e of[document.documentElement,document.body])e&&U?.observe(e,{attributes:!0,attributeFilter:["class","data-theme","data-mode","style"]});return{field:null,canvas:h,refresh(){L||(y=t(m),x(),P()&&M&&!w&&W(),B())},play(){w&&(w=!1,A=0,B())},pause(){w=!0,E&&cancelAnimationFrame(E),E=0},destroy(){L||(L=!0,E&&cancelAnimationFrame(E),D&&cancelAnimationFrame(D),E=D=0,T?.disconnect(),G?.disconnect(),U?.disconnect(),document.removeEventListener("visibilitychange",K),Q?.removeEventListener?.("change",K),N?.removeEventListener?.("change",J),X?.removeEventListener?.("loadingdone",Y),0===--a.users&&"function"==typeof removeEventListener&&removeEventListener("pointermove",c),h.remove(),h.width=h.height=0,p.restore())}}}export{d as mountCanvas};//# sourceMappingURL=chunk-KTYCGGRO.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{parseColor as t,hash2 as o}from"./chunk-ZCHGV2CV.js";import{mountCanvas as e}from"./chunk-KTYCGGRO.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,C=255,z=255;if(g&&(y=55,C=55,z=55),h){const o=t(h);o&&(y=o.r,C=o.g,z=o.b)}let k=212,v=255,w=0;const G=t(m);G&&(k=G.r,v=G.g,w=G.b);const T=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},${C},${z},${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*T)))/.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,G=g?.85*M:.18*M;e.fillStyle=b?`rgba(${k},${v},${w},${g?.95:.38})`:`rgba(${y},${C},${z},${G})`,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-L3P7ZDSK.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{scenePreset as e}from"./chunk-OVCIHOOS.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-LUOIH2EM.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{snapshot as t}from"./chunk-V6GEQ5Y5.js";import{hash as e,styleKeeper as a,mountSurface as n,handle as o,house as i,prefersReduced as s}from"./chunk-PFQBEWCF.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-MIA6TUQC.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{parseColor as t,hash2 as e}from"./chunk-ZCHGV2CV.js";import{mountCanvas as o}from"./chunk-KTYCGGRO.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,C=255,S=255;if(p&&(b=55,C=55,S=55),a){const e=t(a);e&&(b=e.r,C=e.g,S=e.b)}let x=212,z=255,k=0;const y=t(g);y&&(x=y.r,z=y.g,k=y.b);const G=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(G*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(${x},${z},${k},${p?.92:.28})`:`rgba(${b},${C},${S},${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-MRDEO5HZ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{scenePreset as e}from"./chunk-OVCIHOOS.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-NPJ77LDC.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{parseColor as t}from"./chunk-ZCHGV2CV.js";import{mountCanvas as e}from"./chunk-KTYCGGRO.js";function o(e,o,n,c,r={x:.5,y:.5},l={}){const{fontSize:s=14,chars:a=". · ○ ◎ ●",accentColor:i,color:h,rings:f=5,speed:M=1,sharpness:g=4,lightMode:p=!1}=l,m=i??(p?"#007a5e":"#00ffcc");e.clearRect(0,0,o,n),e.textBaseline="middle",e.textAlign="center";const u=o*r.x,d=n*r.y,x=1.6*Math.sqrt(u*u+d*d)+.2*Math.sqrt(o*o+n*n);let $=255,b=255,C=255;if(p&&($=55,b=55,C=55),h){const e=t(h);e&&($=e.r,b=e.g,C=e.b)}let S=0,z=255,k=204;const q=t(m);q&&(S=q.r,z=q.g,k=q.b);const y=a.replace(/ /g,"").split("");if(0===y.length)return;const G=Math.ceil(o/s),R=Math.ceil(n/s);for(let t=0;t<R;t++)for(let o=0;o<G;o++){const n=o*s+.5*s,r=t*s+.5*s,l=n-u,a=r-d,i=Math.sqrt(l*l+a*a)/x;let h=0;for(let t=0;t<f;t++){const e=(c*M*.38+t/f)%1,o=Math.abs(i-e),n=Math.max(0,1-o*x/(s*(12-g)));h+=Math.cos(n*Math.PI*.5)*n}if(h=Math.min(1,h),h<.02)continue;const m=h>.6;e.font=`${s}px monospace`;const q=Math.floor(h*(y.length-1)),G=y[Math.min(q,y.length-1)],R=p?.88*h:.22*h;e.fillStyle=m?`rgba(${S},${z},${k},${Math.min(p?.95:.4,.55*h)})`:`rgba(${$},${b},${C},${R})`,e.fillText(G,n,r)}e.textAlign="left"}var n={id:"pulse",name:"Pulse",description:"Rings of characters ripple out from the cursor.",cellSize:14,speed:1,cursor:!0,mount:t=>e(t,(t,e,n,c,r,l)=>o(t,e,n,c,r,{fontSize:l.fontSize,chars:l.chars,lightMode:l.lightMode,color:l.ink,accentColor:l.accent}))};export{n as pulse,o as renderPulseBackground};//# sourceMappingURL=chunk-ODMQERGZ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{renderMaterial as t}from"./chunk-XPXMCXYI.js";import{mountCanvas as i}from"./chunk-KTYCGGRO.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-ONVONNUH.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{mountPageField as e}from"./chunk-4SHQA3CO.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-OVCIHOOS.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-PFQBEWCF.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:F,x0:L}=s(f.w,E),S=t=>u<1?t:Math.round(t*b)/b,R=S(f.x+L),z=S(f.y+f.h-7-$),P=(R%E+E)%E-E,I=(z%$+$)%$-$,O=A.canvas,W=`${P.toFixed(3)}px ${I.toFixed(3)}px`;O.style.translate!==W&&(O.style.translate=W);const B=t=>`${Math.max(0,t).toFixed(2)}px`,C=R-P,H=z-I,T=`inset(${B(H)} ${B(O.clientWidth-C-F*E)} ${B(O.clientHeight-H-$)} ${B(C)})`;O.style.clipPath!==T&&(O.style.clipPath=T);const j=u<1?1-t(u,2):0;for(let t=0;t<F;t++){const n=F>1?t/(F-1):.5,o=d.dir>0?n:1-n,i=r(0,.42,1-Math.abs(2*n-1))*(.5+j*(.5*o**1.4-.2));e.fillStyle=`rgb(${Math.round(255*i)} ${Math.round(255*i)} ${Math.round(255*i)})`,e.fillRect(R-P+t*E,z-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]))},F=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))},S="function"==typeof ResizeObserver?new ResizeObserver(()=>{A?.live||k()}):null;return S?.observe(u),u.addEventListener("click",F),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",F),u.removeEventListener("keydown",L),S?.disconnect(),b.restore()})}var d=l;export{d as TABS_DEFAULTS,s as indicatorRow,c as streamSpan,u as tabs};//# sourceMappingURL=chunk-P6S6HSN3.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{clamp as t,hash as e}from"./chunk-PFQBEWCF.js";function n(t){const e=()=>({image:t,width:t.naturalWidth,height:t.naturalHeight});return t.complete&&t.naturalWidth?Promise.resolve(e()):new Promise((n,o)=>{const a=()=>{r(),n(e())},i=()=>{r(),o(new Error(`Could not load ${t.src}`))},r=()=>{t.removeEventListener("load",a),t.removeEventListener("error",i)};t.addEventListener("load",a),t.addEventListener("error",i)})}function o(t,e=document.createElement("img")){return(t=>{try{return"undefined"!=typeof location&&new URL(t,location.href).origin!==location.origin}catch{return!1}})(t)&&!e.crossOrigin&&(e.crossOrigin="anonymous"),e.decoding="async",e.src=t,e}function a(t,e,n,o,a,i,r=.5,h=.5){if(a<=0||i<=0||!e.width||!e.height)return;const l=Math.max(a/e.width,i/e.height),c=a/l,d=i/l;t.drawImage(e.image,(e.width-c)*r,(e.height-d)*h,c,d,n,o,a,i)}function i(e,n,o=.08){const a=Math.min(1,420/Math.max(1,e.width,e.height)),i=document.createElement("canvas");i.width=Math.max(1,Math.round(e.width*a)),i.height=Math.max(1,Math.round(e.height*a));const r=i.getContext("2d",{willReadFrequently:!0});if(!r)return e;let h;r.drawImage(e.image,0,0,i.width,i.height);try{h=r.getImageData(0,0,i.width,i.height)}catch{return e}const l=h.data,c=new Uint32Array(256),d=l.length/4,s=t=>.2126*l[t]+.7152*l[t+1]+.0722*l[t+2];for(let t=0;t<l.length;t+=4)c[Math.round(s(t))]++;let u=0,f=255,g=0;for(let t=0;t<256;t++)if(g+=c[t],g>=.02*d){u=t;break}g=0;for(let t=255;t>=0;t--)if(g+=c[t],g>=.02*d){f=t;break}const m=Math.max(1,f-u);for(let e=0;e<l.length;e+=4){let a=t((s(e)-u)/m);n&&(a=1-a),l[e]=l[e+1]=l[e+2]=Math.round(255*(o+(1-o)*a)),l[e+3]=255}return r.putImageData(h,0,0),{image:i,width:i.width,height:i.height}}var r={strong:1,text:.82,meta:.55,tile:.42,icon:.62},h=new Set(["IMG","SVG","svg","VIDEO","PICTURE"]),l=t=>[...t.children].flatMap(t=>h.has(t.tagName)?[t]:[t,...l(t)]);function c(e,n,o,a){const i=document.createElement("canvas");i.width=Math.max(2,Math.round(2*n)),i.height=Math.max(2,Math.round(2*o));const c=[],d=i.getContext("2d");if(!d)return{canvas:i,rects:c};d.scale(2,2),d.fillStyle="#000",d.fillRect(0,0,n,o);const s=a(e),u=e.getBoundingClientRect(),f=u.width/(e.offsetWidth||u.width||1)||1,g=t=>{for(let n=t;n&&n!==e.parentElement;n=n.parentElement){const t=n.dataset?.paint;if(t&&void 0!==r[t])return r[t]}return parseFloat(t?getComputedStyle(t).fontWeight:"400")>=500?1:.7},m=e=>{const n=Math.round(255*t(e));return`rgb(${n} ${n} ${n})`},w=l(e),p=[e,...w].filter(t=>{const e=t.dataset?.paint;return"tile"===e||"icon"===e||!e&&h.has(t.tagName)&&!t.closest("[data-paint]")});for(const t of p){const e=a(t);if(e.w<=0||e.h<=0)continue;const n=t.dataset?.paint;d.fillStyle=m("icon"===n?r.icon:r.tile),d.beginPath(),"icon"===n||"svg"===t.tagName.toLowerCase()?d.arc(e.x+e.w/2,e.y+e.h/2,.4*Math.min(e.w,e.h),0,2*Math.PI):d.roundRect(e.x,e.y,e.w,e.h,Math.min(parseFloat(getComputedStyle(t).borderTopLeftRadius)||0,e.h/2)),d.fill(),c.push(e)}const y=document.createTreeWalker(e,4),x=document.createRange();d.textBaseline="middle";for(let t=y.nextNode();t;t=y.nextNode()){const e=t.parentElement;if(!e||e.closest('[data-paint="none"]'))continue;const n=getComputedStyle(e);d.font=`${n.fontStyle} ${n.fontWeight} ${n.fontSize} ${n.fontFamily}`,d.fillStyle=m(g(e)),d.shadowColor=d.fillStyle,d.shadowBlur=4;for(const e of t.data.matchAll(/\S+/g)){x.setStart(t,e.index),x.setEnd(t,e.index+e[0].length);const n=x.getClientRects()[0];if(!n)continue;const o={x:s.x+(n.left-u.left)/f,y:s.y+(n.top-u.top)/f,w:n.width/f,h:n.height/f};d.fillText(e[0],o.x,o.y+o.h/2),c.push(o)}}return d.shadowBlur=0,x.detach?.(),{canvas:i,rects:c}}function d(t){const n=new Set,o=[];for(const a of t)for(let t=6*Math.floor((a.y-2)/6);t<a.y+a.h+2;t+=6)for(let i=4*Math.floor((a.x-2)/4);i<a.x+a.w+2;i+=4){const a=`${i},${t}`;n.has(a)||(n.add(a),o.push({x:i,y:t,seed:e(i,t)}))}return o}function s(t,e,n,o,a,i,r=1,h=.32){for(let l=0;l<n.length;l++){const c=n[l],d=(a-o[l]*(1-h))/h;if(d<=0)continue;const s=d>=1?0:1-d;let u=c.x,f=c.y;if(s>0){const[t,e]=i(c,s);u+=t,f+=e}t.globalAlpha=r*(1-s*s),t.drawImage(e,2*c.x,2*c.y,8,12,u,f,4,6)}t.globalAlpha=1}function u(t,e){if("undefined"==typeof document||document.getElementById(t))return;const n=document.createElement("style");n.setAttribute("id",t),n.textContent=e,(document.head??document.documentElement).appendChild(n)}export{d as blocksOf,s as drawBlocks,a as drawCover,o as imageFor,n as imageReady,u as injectStyle,c as snapshot,i as toneOf};//# sourceMappingURL=chunk-PCGRRX5P.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{scenePreset as e,FIELD_GRAPHITE as t,narrow as r}from"./chunk-OVCIHOOS.js";var l=e({id:"swell",name:"Swell",description:"A fine grid that swells in slow rolling waves, quiet in the middle. Dots by default, or characters.",cellSize:10,opacity:.6,scene:"swell",mark:"dot",charset:" .:-=+*#",hover:"lantern",graphite:t,tune:()=>({scale:r()?1.5:1,contrast:.62,brightness:-.19,blend:"auto",lantern:{radius:.12,strength:.5,trail:1,follow:8},trail:{strength:.7,radius:.35}})});export{l as swell};//# sourceMappingURL=chunk-PDNKLLBI.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{injectStyle as t,drawBlocks as e,snapshot as n,blocksOf as o}from"./chunk-PCGRRX5P.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-PFQBEWCF.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,P=!1,M=!1,T=null;const z=[];t("ascii-kit-toast",x),w.className="ascii-toasts",w.setAttribute("aria-label",g.current.label),p.append(w,y);const S=new WeakSet,A=t=>{delete t.dataset.forming,S.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 F=()=>!!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)})},I=(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(()=>B(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)}})($||P),N=()=>{$=!0,j()},G=()=>{$=!1,j()},H=()=>{P=!0,j()},R=t=>{w.contains(t.relatedTarget)||(P=!1,j())};function B(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)||($=P=!1,j())},i=k[k.length-1]===n;F()&&(i||L||e)?(A(n.node),I(n.node,!1,e),n.node.dataset.gone="",W(),z.push(setTimeout(o,220))):o()}w.addEventListener("pointerenter",N),w.addEventListener("pointerleave",G),w.addEventListener("focusin",H),w.addEventListener("focusout",R);let D=null;const Q=t=>{if(!g.current.swipe||0!==t.button||D)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&&(D={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(!D||t.pointerId!==D.id)return;const e=performance.now(),n=t.clientX-D.x0;D.v=(n-D.dx)/Math.max(1,e-D.t),D.dx=n,D.t=e,D.item.node.style.setProperty("transform",`translateX(${n}px)`),D.item.node.style.setProperty("opacity",String(i(1-Math.abs(n)/260,.2)))},J=t=>{if(!D||t.pointerId!==D.id)return;const{item:e,dx:n}=D,o=e.node,i=performance.now()-D.t>90?0:D.v;D=null,delete o.dataset.swiping;const a=Math.abs(n)>64||Math.abs(i)>.45&&Math.abs(n)>8;o.style.removeProperty("opacity"),a?(B(e.id,n||i),o.style.setProperty("transform",`translateX(${n+48*Math.sign(n||i)}px)`)):o.style.removeProperty("transform")};w.addEventListener("pointerdown",Q),w.addEventListener("pointermove",q),w.addEventListener("pointerup",J),w.addEventListener("pointercancel",J);return l(()=>T,g,t=>{w.setAttribute("aria-label",t.label),T?.refresh()},{push:t=>{if(M)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=>B(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,()=>B(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,F()?(i.dataset.forming="",(t=>{const e=m(g.current.ink??"--ascii-ink-strong",p,h(p)?"#d8d6cf":"#1d1d1b");e&&b(getComputedStyle(t).backgroundColor,e)&&(S.add(t),t.style.setProperty("transition","none","important"),t.style.setProperty("background-color","transparent","important"),t.style.setProperty("box-shadow","none","important"))})(i),I(i,!0)):T?.kick(),X(a),e},dismiss:t=>B(t),clear(){[...k].forEach(t=>B(t.id))},get toasts(){return k.filter(t=>void 0===t.node.dataset.gone).map(t=>t.id)}},()=>{M=!0;for(const t of k)t.timer&&clearTimeout(t.timer);z.forEach(clearTimeout),w.removeEventListener("pointerenter",N),w.removeEventListener("pointerleave",G),w.removeEventListener("focusin",H),w.removeEventListener("focusout",R),w.removeEventListener("pointerdown",Q),w.removeEventListener("pointermove",q),w.removeEventListener("pointerup",J),w.removeEventListener("pointercancel",J),k=[],E=[],w.remove(),y.remove(),v.restore()})}var w=u;export{w as TOAST_DEFAULTS,b as hidesInk,v as toastStack};//# sourceMappingURL=chunk-PFNFW4ZI.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{poster as e,watchPointer as t,liveField as n,requestFieldFrame as o,watchVisibility as r,watchTheme as i,watchMotionPreference as a,cancelFieldFrame as s,disposeKit as c,setPosterSource as l,ambientFactor as u}from"./chunk-XVB3B3FV.js";import{isGlyphFieldSupported as d}from"../field.js";var p,f,h=(e,t=0,n=1)=>Math.min(n,Math.max(t,e)),m=(e,t)=>{const n=43758.5453*Math.sin(127.1*e+311.7*t);return n-Math.floor(n)},g=(e,t=3)=>1-(1-h(e))**t,y=(e,t,n)=>{const o=h((n-e)/(t-e));return o*o*(3-2*o)},v=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)},b=()=>"function"==typeof matchMedia&&matchMedia("(prefers-reduced-motion: reduce)").matches,x=e=>e??b(),w={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=k(t,r[1])||(r[2]??"").trim():o.startsWith("--")&&(o=k(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 C([+i[1],+i[2],+i[3]]);if(void 0===f)try{f="undefined"==typeof document?null:Object.assign(document.createElement("canvas"),{width:1,height:1}).getContext("2d",{willReadFrequently:!0})}catch{f=null}if(!f)return n?M(n,t):null;f.clearRect(0,0,1,1),f.fillStyle="#000",f.fillStyle=o,f.fillRect(0,0,1,1);const[a,s,c]=f.getImageData(0,0,1,1).data;return C([a,s,c])}var k=(e,t)=>"function"==typeof getComputedStyle?getComputedStyle(e).getPropertyValue(t).trim():"",C=e=>`#${e.map(e=>Math.round(h(e,0,255)).toString(16).padStart(2,"0")).join("")}`,R=e=>{const t=parseInt(e.slice(1,7),16);return[t>>16&255,t>>8&255,255&t]},S=(e,t,n)=>{const o=R(e),r=R(t);return C(o.map((e,t)=>e+(r[t]-e)*n))};function $(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]=R(o);return.2126*r+.7152*i+.0722*a>140}function O(){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 j(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 P(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 W(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,F=e=>E.get(e)?.()??null;function A(c){const{host:l,layer:f="over",outset:h=0,kit:m}=c;if("undefined"==typeof document)return null;const g=`position:absolute;left:${-h}px;top:${-h}px;width:calc(100% + ${2*h}px);height:calc(100% + ${2*h}px);pointer-events:none;z-index:${"under"===f?-1:"auto"}`;if(!d())return m?.current.poster&&e(l,m.current.poster,g,m),null;const y=O(),v=document.createElement("canvas"),x=document.createElement("canvas"),k=x.getContext("2d");if(!k)return null;"static"===getComputedStyle(l).position&&y.set(l,"position","relative"),"under"===f&&y.set(l,"isolation","isolate"),v.setAttribute("aria-hidden","true"),v.dataset.asciiKit="";const C=v.style;C.position="absolute",C.left=C.top=-h+"px",C.width=C.height=`calc(100% + ${2*h}px)`,C.pointerEvents="none",C.zIndex="under"===f?"-1":"",l.appendChild(v);const R=()=>{const e=getComputedStyle(l);H.canvas.style.borderRadius=[e.borderTopLeftRadius,e.borderTopRightRadius,e.borderBottomRightRadius,e.borderBottomLeftRadius].map(e=>h&&/^[\d.]+px$/.test(e)?`${parseFloat(e)+h}px`:e).join(" ")};let S=$(l);const j=()=>M(c.ink(S),l)??M(getComputedStyle(l).color,l)??(S?"#d8d6cf":"#1d1d1b");let W=!1,F=!1,A=!0,B=!1,I=-1/0,z=-1/0;const T=t({target:l,move:e=>{z=e.timeStamp},leave(){}}),H=n({host:l,canvas:v,kit:m,place:g,options:()=>({...w,...c.look(),ink:j(),interactionTarget:l,label:""}),onMount:(e,t)=>{E.set(t,K),t.removeAttribute("role"),t.removeAttribute("aria-label"),e.ready.then(G,()=>{}),G()},onRelease:()=>{W&&s(X),W=!1},onFail:()=>{ee(),c.onFail?.()}}),L=H.field;R();const V=()=>!!(c.reducedMotion()??b()),D=e=>P(H.canvas,e),q=e=>{const t=H.canvas,n=Math.max(1,t.clientWidth||l.clientWidth+2*h),o=Math.max(1,t.clientHeight||l.clientHeight+2*h),r=c.resolution??1,[i,a]="function"==typeof r?r(n,o):[Math.max(1,Math.round(n*r)),Math.max(1,Math.round(o*r))];x.width===i&&x.height===a||(x.width=i,x.height=a),k.setTransform(1,0,0,1,0,0),k.globalAlpha=1,k.globalCompositeOperation="source-over",k.filter="none",k.fillStyle="#000",k.fillRect(0,0,i,a);let s=!1;try{s=c.paint({pen:k,width:i,height:a,w:n,h:o,scale:i/n,now:e,still:V(),dark:S,box:D})}catch(e){"undefined"!=typeof console&&console.error(e)}return L.setSource(x),B||L.redraw(),s};function K(){const e=H.canvas,t=Math.max(1,e.clientWidth||l.clientWidth+2*h),n=Math.max(1,e.clientHeight||l.clientHeight+2*h),o=c.resolution??1,[r,i]="function"==typeof o?o(t,n):[Math.max(1,Math.round(t*o)),Math.max(1,Math.round(n*o))],a=document.createElement("canvas");a.width=r,a.height=i;const s=a.getContext("2d");if(!s)return null;s.fillStyle="#000",s.fillRect(0,0,r,i);try{c.paint({pen:s,width:r,height:i,w:t,h:n,scale:r/t,now:performance.now(),still:!0,dark:S,box:D})}catch{return null}return a}function X(e){if(W=!1,B||F||!H.live)return;if(e-I<(p??(p=(()=>{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})()))*u()&&e-z>1e3)return W=!0,void o(X);I=e;!q(e)||V()||!A||"undefined"!=typeof document&&document.hidden||(W=!0,o(X))}function G(){W||B||F||!H.live||(W=!0,o(X))}E.set(v,K);const J="function"==typeof ResizeObserver?new ResizeObserver(()=>{R(),L.resize(),!H.live||B||F||q(performance.now()),G()}):null;J?.observe(l);const N="function"==typeof IntersectionObserver?new IntersectionObserver(([e])=>{A=e.isIntersecting,A&&G()},{rootMargin:"64px"}):null;N?.observe(l);const Q=r(()=>{document.hidden||G()});let U=!1;const Y=()=>{U=!1,B||(S=$(l),L.update({ink:j()}),c.onTheme?.(),G())},Z=i(()=>{U||B||(U=!0,o(Y))}),_=a(G);function ee(){B||(B=!0,W&&s(X),U&&s(Y),W=U=!1,J?.disconnect(),N?.disconnect(),Q(),T(),Z(),_(),H.destroy(),y.restore(),x.width=x.height=1)}return H.start(),H.failed?(ee(),null):{field:L,get canvas(){return H.canvas},get live(){return H.live},kick:G,refresh(){B||(S=$(l),L.update({...w,...c.look(),ink:j()}),G())},still:V,dark:()=>S,box:D,play(){F&&(F=!1,L.play(),G())},pause(){F=!0,W&&s(X),W=!1,L.pause()},destroy:ee}}function B(e,t,n,o,r=()=>{}){let i=!1;const a={get supported(){return!!e()&&!i},get field(){return i?null:e()?.field??null},update(e){if(i)return;t.current=W(t.current,e);const o=e.poster;o&&l(t,o),n(t.current)},play(){i||e()?.play()},pause(){i||e()?.pause()},destroy(){i||(i=!0,e()?.destroy(),c(t),r())}};return Object.defineProperties(o,Object.getOwnPropertyDescriptors(a))}export{w as BASE_LOOK,P as boxIn,h as clamp,g as easeOut,B as handle,m as hash,R as hexRgb,v as house,$ as isDark,W as mergeOptions,S as mixHex,A as mountSurface,b as prefersReduced,x as reducedFrom,M as resolveColor,F as settledSource,y as smoothstep,j as srOnly,O as styleKeeper,C as toHex};//# sourceMappingURL=chunk-PFQBEWCF.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{scenePreset as e}from"./chunk-OVCIHOOS.js";var r=e({id:"halo",name:"Halo",description:"A corona breathes slowly round the middle, its rays turning; the centre stays empty for a headline.",cellSize:11,scene:"halo",charset:" .·:-=+*",hover:"lantern",middle:!1,feather:.12});export{r as halo};//# sourceMappingURL=chunk-PND73YEV.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{scenePreset as r,FIELD_GRAPHITE as e,narrow as t}from"./chunk-OVCIHOOS.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-PZAQLUAS.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{scenePreset as e}from"./chunk-OVCIHOOS.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-QKZYCROD.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{scenePreset as e,FIELD_GRAPHITE as r,narrow as t}from"./chunk-OVCIHOOS.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-QTVMD62E.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{snapshot as e}from"./chunk-PCGRRX5P.js";import{styleKeeper as t,mountSurface as o,clamp as r,house as n}from"./chunk-PFQBEWCF.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-QZHZWO7N.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{parseColor as t,hash2 as o}from"./chunk-ZCHGV2CV.js";import{mountCanvas as e}from"./chunk-KTYCGGRO.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),C=Math.ceil(c/u);e.clearRect(0,0,n,c),e.font=`${r}px monospace`,e.textBaseline="top";let b=255,S=255,x=255;if($&&(b=55,S=55,x=55),f){const o=t(f);o&&(b=o.r,S=o.g,x=o.b)}let z=212,k=255,y=0;const G=t(p);G&&(z=G.r,k=G.g,y=G.b);const R=C+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>=C)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(${b},${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-SAQJAH2I.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{driftNoise as t}from"./chunk-BBOSHBZK.js";import{styleKeeper as e,mountSurface as r,handle as i}from"./chunk-PFQBEWCF.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 A=(t,e)=>{b=t,c.dataset.state=t,c.setAttribute("aria-busy",String("generating"===t)),g.current.onState?.(t,e)},S=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"))},L=t=>new Promise(e=>setTimeout(e,t)),O=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"))},R=async(t=g.current.stream)=>{if(!t)return b;const e=++d,r=()=>e===d,i=!!M?.still();p=performance.now(),A("generating"),S(!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){O(e.final),M&&x(await m(e.final),o.final.k,o.final.blur);break}if(!M){O(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 L(i?0:544),!r())return b;A("done"),S(!0),M?.kick()}catch(t){if(!r())return b;x(null,0,n),await L(i?0:340),A("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&&R(),i(()=>M,g,()=>M?.refresh(),{run:R,reset(){d++,x(null,0,n),A("idle"),S(!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-SE6MQQLB.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{scenePreset as e}from"./chunk-OVCIHOOS.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-SQGJ263V.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{parseColor as o,hash2 as t}from"./chunk-ZCHGV2CV.js";import{mountCanvas as l}from"./chunk-KTYCGGRO.js";import{mixHex as e}from"./chunk-PFQBEWCF.js";function r(l,e,r,a,i={}){const{fontSize:n=13,baseChars:f="ATCG",bridgeChars:h="-=≡",color:c="#00e5ff",color2:s="#ff4081",bridgeColor:b="#88ffcc",speed:g=1,helixCount:M,lightMode:p=!1}=i,d=.62*n,m=1.4*n,u=Math.ceil(e/d),C=Math.ceil(r/m),$=M??Math.max(1,Math.floor(e/80)),x=u/$,S=o(c)??{r:0,g:229,b:255},k=o(s)??{r:255,g:64,b:129},A=o(b)??{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*g,z=.35*x;for(let o=0;o<$;o++){const e=x*(o+.5);for(let r=0;r<C;r++){const a=r/C*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 b=t(31*o+7*r,3),g=f[Math.floor(b*f.length)],M=.5*(Math.sin(a)+1),p=.5*(Math.sin(a+Math.PI)+1);if(l.globalAlpha=.35+.65*M,l.fillStyle=`rgb(${S.r},${S.g},${S.b})`,l.fillText(g,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*(M+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-SVXRMHUJ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{MONO as t,GRAPHITE_LIGHT as e,GRAPHITE_DARK as o,pixelSnap as r,parseColor as n,band as c,ditherIndex as i,toneAlpha as a,vnoise as l}from"./chunk-ZCHGV2CV.js";import{mountCanvas as s}from"./chunk-KTYCGGRO.js";function h(s,h,f,d,g={x:.5,y:.5},u={}){const{fontSize:m=13,chars:M=" .:-=+*#%@",accentColor:p,color:$,octaves:x=4,speed:S=1,scale:b=1,accentThreshold:C=.9,mouseWarp:y=.3,lightMode:z=!1}=u,k=Array.from(M),G=.62*m,T=1.3*m,j=Math.ceil(h/G),v=Math.ceil(f/T);s.clearRect(0,0,h,f),s.font=`${m}px ${t}`,s.textBaseline="top";const w=z?e:o;let A=w.r,R=w.g,V=w.b;const q=r(s);if($){const t=n($);t&&(A=t.r,R=t.g,V=t.b)}let B=A,H=R,K=V;const N=p?n(p):null;N&&(B=N.r,H=N.g,K=N.b);const O=.035*b,W=d*S,Y=Math.min(6,Math.max(1,x)),Z=(t,e)=>{let o=0,r=.5,n=1,c=0;for(let i=0;i<Y;i++)o+=l(t*n,e*n)*r,c+=r,r*=.5,n*=2.1;return o/c};for(let t=0;t<v;t++)for(let e=0;e<j;e++){const o=e*O+.06*W,r=t*O*1.3-.04*W,n=e/j-g.x,l=t/v-g.y,h=Math.sqrt(n*n+l*l),f=y>0?.12*Math.max(0,1-h/y):0,d=Z(o+f*Math.sin(1.3*W+8*l),r+f*Math.cos(.9*W+8*n)),m=c(.5*d+.5,.7,.83);if(m<=0)continue;const M=k[i(m,k.length,e,t,u.ditherStrength)];if(" "===M)continue;const p=!!N&&m>C,$=a(m);s.fillStyle=p?`rgba(${B},${H},${K},${$})`:`rgba(${A},${R},${V},${$})`,s.fillText(M,q(e*G),q(t*T))}}var f={id:"noise",name:"Noise",description:"A slow fractal noise field that warps around the cursor.",cellSize:13,speed:.5,cursor:!0,mount:t=>s(t,(t,e,o,r,n,c)=>h(t,e,o,r,n,{ditherStrength:c.ditherStrength,fontSize:c.fontSize,chars:c.chars,lightMode:c.lightMode,color:c.ink,accentColor:c.accent}))};export{f as noise,h as renderNoiseBackground};//# sourceMappingURL=chunk-UO4U32P7.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{hash as t,settledSource as e}from"./chunk-PFQBEWCF.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-V6GEQ5Y5.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{mountSurface as t}from"./chunk-PFQBEWCF.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-VFV7HZ3G.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{scenePreset as e}from"./chunk-OVCIHOOS.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-WT3XOWAI.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{styleKeeper as t,mountSurface as e,clamp as r,handle as n,resolveColor as o,mixHex as a,prefersReduced as i}from"./chunk-PFQBEWCF.js";var s={thumb:'[role="slider"]',label:"[data-label]",threshold:.9,resetAfter:0},l=720,c=(t,e,r)=>t+(e-t)*r,d=t=>1-(1-t)**3,u=(t,e,r)=>({x:t,v:0,to:t,k:e,z:r});function m(t,e,r=.4){const n=2*Math.sqrt(t.k)*t.z,o=Math.max(1,Math.ceil(240*e)),a=e/o;for(let e=0;e<o;e++)t.v+=(-t.k*(t.x-t.to)-n*t.v)*a,t.x+=t.v*a;return!(Math.abs(t.x-t.to)<r&&Math.abs(t.v)<12*r)||(t.x=t.to,t.v=0,!1)}var f=t=>{t.x=t.to,t.v=0};function h(t,e){const r=t.filter(([,t])=>e-t<80);if(r.length<2)return 0;const[n,o]=r[0],[a,i]=r[r.length-1];return i>o?(a-n)/(i-o)*1e3:0}function p(p,v={}){const x={current:{...s,...v}},b=t(),g=p.querySelector(x.current.thumb)??p.firstElementChild,k=()=>p.querySelector(x.current.label),y=()=>!!(x.current.reducedMotion??i());let A=u(0,520,.8),w=u(0,150,1),M=!1,E=0,L=!1,S=0,C=0,I=[],P=0,T=0,F=0,W="",q=-1,z=null;const D=()=>{if(!g)return null;const t=Math.max(0,(p.clientHeight-g.offsetHeight)/2);return{pad:t,size:g.offsetHeight,max:Math.max(1,p.clientWidth-g.offsetWidth-2*t)}},R=()=>p.getBoundingClientRect().width/(p.clientWidth||1)||1,$=t=>o(x.current.ink??"--ascii-ink-strong",p)??o(getComputedStyle(p).color,p)??(t?"#d8d6cf":"#1d1d1b");z=e({host:p,layer:"under",look:()=>({mark:"glyph",charset:" .:-=+*#%@",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:4,cellAspect:.62,glyphScale:.94,...x.current.look}),ink:$,kit:x,reducedMotion:()=>x.current.reducedMotion,onFail:()=>{z=null},onTheme:()=>{W=""},paint:({pen:t,w:e,h:n,now:i,still:s,dark:u,box:m})=>{const f=D();if(!f)return!1;const h=L?s?1:r((i-S)/l):0,v=d(r(h/.5)),b=d(r((h-.36)/.3)),g=d(r((h-.46)/.4)),k=r((h-.5)/.5),y=1+.07*Math.sin(Math.PI*k)*(1-k),M=C?1-r((i-C)/260):1,E=x.current.mark?m(x.current.mark):{x:e/2-18,y:n/2-18,w:36,h:36},I=E.x+E.w/2,P=E.y+E.h/2,T=Math.min(E.w/2,n/2-2)*y,F=L?a($(u),(t=>o(x.current.color??"--ascii-success",p,t?"#3ccf7e":"#17844a"))(u),d(r(s?1:(i-S)/360))):$(u);F!==W&&(W=F,z?.field.update({ink:F})),t.save(),t.globalAlpha=M,t.beginPath(),e>4&&n>4&&t.roundRect(2,2,e-4,n-4,(n-4)/2),t.clip(),t.fillStyle=`rgba(255,255,255,${.1*(1-v)})`,t.fillRect(0,0,e,n);const q=f.pad+A.x+f.size/2,R=L?1:w.x,H=c(0,I-T,v),B=c(q,I+T,v),G=c(0,P-T,v),X=c(n,P+T,v);if(B-H>1&&R>.004){const e=t.createLinearGradient(H,0,B,0);e.addColorStop(0,`rgba(255,255,255,${c(.14,1,v)*R})`),e.addColorStop(.62,`rgba(255,255,255,${c(.48,1,v)*R})`),e.addColorStop(1,`rgba(255,255,255,${R})`),t.fillStyle=e,t.globalAlpha=M*(1-.28*b),t.beginPath(),t.roundRect(H,G,B-H,X-G,c(0,T,v)),t.fill()}return b>0&&(t.globalAlpha=1,t.fillStyle="#000",t.beginPath(),t.arc(I,P,Math.max(0,T-5)*b,0,2*Math.PI),t.fill()),t.restore(),g>0&&function(t,e,r,n,o,a,i){if(o<=0||a<=0)return;const s=[[-.82,.02],[-.26,.56],[.86,-.6]].map(([t,o])=>[e+t*n,r+o*n]),l=Math.hypot(s[1][0]-s[0][0],s[1][1]-s[0][1])+Math.hypot(s[2][0]-s[1][0],s[2][1]-s[1][1]);t.save(),t.globalAlpha=a,t.strokeStyle="#fff",t.lineWidth=i,t.lineCap="round",t.lineJoin="round",t.setLineDash([l*o,l]),t.beginPath(),t.moveTo(s[0][0],s[0][1]),t.lineTo(s[1][0],s[1][1]),t.lineTo(s[2][0],s[2][1]),t.stroke(),t.restore()}(t,I+.02*T,P+.07*T,.55*T,g,M,4.5),!1}});const H=()=>{const t=D();if(!t||!g)return;const e=A.x/t.max;b.set(g,"translate",`${A.x}px 0`),g.setAttribute("aria-valuenow",String(Math.round(100*r(e))));const n=k();n&&b.set(n,"opacity",String(L?0:1-r(1.7*e)))},B=t=>{P=0;const e=Math.min(1/30,Math.max(0,(t-T)/1e3));T=t;let r=!M&&m(A,e,.3);r=m(w,e,.003)||r,C&&(t-C>=260||y())&&(C=0,L=!1,A=u(0,520,.8),w=u(0,150,1),p.dataset.state="idle",delete p.dataset.confirmed,g&&(b.set(g,"opacity","1"),b.set(g,"scale","1"),g.tabIndex=0)),L&&t-S>302.4&&(p.dataset.confirmed=""),H(),z?.kick(),(r||M||L&&t-S<760||C>0)&&(P=requestAnimationFrame(B))},G=()=>{P||(T=performance.now(),P=requestAnimationFrame(B))},X=()=>{const t=D();if(!t||L)return;const e=t.max-A.x;M=!1,L=!0,A.to=t.max,w.to=1,S=performance.now()+(e>4?200:90),y()&&(f(A),f(w),S=-1e6,p.dataset.confirmed=""),p.dataset.state="confirmed",g&&(g.setAttribute("aria-valuetext","Confirmed"),g.tabIndex=-1,b.set(g,"transition","opacity 200ms 160ms, scale 240ms 160ms"),b.set(g,"opacity","0"),b.set(g,"scale",".6")),F&&clearTimeout(F),x.current.resetAfter>0&&(F=setTimeout(j,x.current.resetAfter)),H(),G(),x.current.onConfirm?.()};function j(){if(F&&clearTimeout(F),F=0,!L)return A.to=0,w.to=0,void G();C=performance.now(),p.dataset.state="resetting",g?.removeAttribute("aria-valuetext"),G()}const J=t=>{const e=D();if(!M||!e||void 0!==t&&void 0!==t.pointerId&&t.pointerId!==q)return;M=!1;const n=h(I,performance.now());A.x>=e.max*x.current.threshold||n>900&&A.x>.5*e.max?X():(A.to=0,A.v=.25*r(n,-1500,1500),w.to=0,y()&&(f(A),f(w)),p.dataset.state="idle",G())},Q=t=>{if(0===t.button&&!L&&g)if(g.contains(t.target)){try{g.setPointerCapture?.(t.pointerId)}catch{}q=t.pointerId,M=!0,E=t.clientX-A.x*R(),w.to=1,I=[],p.dataset.state="dragging",G()}else M||y()||(A.v+=420,w.to=0,G())},U=t=>{const e=D();M&&e&&t.pointerId===q&&(A.x=A.to=r((t.clientX-E)/R(),0,e.max),A.v=0,I.push([A.x,performance.now()]),I.length>8&&I.shift(),A.x>=e.max-.5?X():G())},K=t=>{const e=D();if(!e||L)return;if("Enter"===t.key||" "===t.key||"End"===t.key)return t.preventDefault(),void X();const n={ArrowRight:1,ArrowUp:1,ArrowLeft:-1,ArrowDown:-1}[t.key],o="Home"===t.key?0:void 0!==n?r(A.to+n*e.max/4,0,e.max):null;null!==o&&(t.preventDefault(),A.to=o,w.to=o>0?1:0,y()&&(f(A),f(w)),o>=e.max-.5?X():G())};g&&(g.hasAttribute("role")||g.setAttribute("role","slider"),g.hasAttribute("tabindex")||(g.tabIndex=0),g.hasAttribute("aria-label")||g.setAttribute("aria-label",k()?.textContent?.trim()||"Slide to confirm"),g.setAttribute("aria-valuemin","0"),g.setAttribute("aria-valuemax","100"),g.setAttribute("aria-valuenow","0"),b.set(g,"touch-action","none"),g.addEventListener("keydown",K));const N=t=>t.preventDefault();return p.dataset.state="idle",p.addEventListener("pointerdown",Q),p.addEventListener("pointermove",U),p.addEventListener("pointerup",J),p.addEventListener("pointercancel",J),p.addEventListener("lostpointercapture",J),p.addEventListener("dragstart",N),n(()=>z,x,()=>z?.refresh(),{confirm:X,reset:j,get confirmed(){return L}},()=>{P&&cancelAnimationFrame(P),F&&clearTimeout(F),P=F=0,g?.removeEventListener("keydown",K),p.removeEventListener("pointerdown",Q),p.removeEventListener("pointermove",U),p.removeEventListener("pointerup",J),p.removeEventListener("pointercancel",J),p.removeEventListener("lostpointercapture",J),p.removeEventListener("dragstart",N),b.restore(),delete p.dataset.state,delete p.dataset.confirmed})}var v=s;export{v as SLIDE_TO_CONFIRM_DEFAULTS,p as slideToConfirm,m as stepSpring,h as velocity};//# sourceMappingURL=chunk-XDNCXCR7.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{parseColor as t,GRAPHITE_LIGHT as o,GRAPHITE_DARK as e,pixelSnap as r,MONO as n,band as a,ditherIndex as c,toneAlpha as l}from"./chunk-ZCHGV2CV.js";function h(h,i,f,s,m,x={}){if(f<=0||s<=0)return;const M=Math.max(6,x.fontSize??12),u=.62*M,$=1.2*M,d=t(x.color??x.accentColor??"")??(x.lightMode?o:e),g=r(i),p=m*Math.max(0,x.speed??.35),C=f/s;i.clearRect(0,0,f,s),i.font=`${M}px ${n}`,i.textBaseline="top";const S=Array.from(x.chars||" .:-=+*#%@");for(let t=0;t<s;t+=$)for(let o=0;o<f;o+=u){const e=o/s,r=t/s,n=a(Math.min(1,Math.max(0,h(e,r,C,p))),.06,.72);if(n<=0)continue;const f=S[c(n,S.length,Math.round(o/u),Math.round(t/$),x.ditherStrength)];" "!==f&&(i.fillStyle=`rgba(${d.r},${d.g},${d.b},${l(n)})`,i.fillText(f,g(o),g(t)))}}export{h as renderMaterial};//# sourceMappingURL=chunk-XPXMCXYI.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{mountGlyphField as e}from"../field.js";var t=new Set,n=0,o=0,r=null,a=[],i=0,s=1,l=0,c=0;function u(e){n=0,i&&e>i&&(a.push(e-i),a.length>120&&a.shift()),i=e,o=performance.now();const r=[...t];t.clear();for(const t of r)try{t(e)}catch(e){"undefined"!=typeof console&&console.error(e)}const u=performance.now()-o;if(l=.9*l+.1*u,e-c>500){c=e;const t=function(){if(a.length<20)return 1e3/60;const e=[...a].sort((e,t)=>e-t);return Math.min(1e3/60,Math.max(1e3/360,e[Math.floor(.2*e.length)]))}(),n=!1;(l>.5*t||n)&&s<3?s++:l<.2*t&&!n&&s>1&&s--}t.size||(i=0)}var d=()=>s;function m(e){t.add(e),n&&r!==requestAnimationFrame&&(n=0),n||(r=requestAnimationFrame,n=requestAnimationFrame(u))}function f(e){t.delete(e),!t.size&&n&&(cancelAnimationFrame(n),n=0,i=0)}var h=new Set,p=new Set,g=new Set,y=new Set,v=new Set,w=!1,b=null,k=null,x=null,E=null,M=e=>{let t=null;for(const n of h){if(n.target===window){(!n.near||n.near()||n.inside)&&n.move(e);continue}t??(t=e.composedPath());t.includes(n.target)?(n.inside=!0,n.move(e)):n.inside&&(n.inside=!1,n.leave())}},S=()=>{for(const e of h)e.inside=!1,e.leave()},L=()=>{for(const e of[...p])e()},A=()=>{for(const e of[...g])e()},C=()=>{for(const e of[...y])e()},P=e=>{for(const t of[...v])t(e)};function z(){const e=h.size+p.size+g.size+y.size+v.size>0;if("undefined"==typeof document)return;if(b!==document&&(w=!1,b=document,k=x=null,E=null),e===w)return;w=e;const t=e?"addEventListener":"removeEventListener";if("undefined"!=typeof window&&(window[t]?.("pointermove",M,{capture:!0,passive:!0}),window[t]?.("pointerdown",M,{capture:!0,passive:!0})),document[t]?.("pointerleave",S),document[t]?.("visibilitychange",L),("undefined"==typeof document?void 0:document.fonts)?.[t]?.("loadingdone",P),k??(k="function"==typeof matchMedia?matchMedia("(prefers-reduced-motion: reduce)"):null),x??(x="function"==typeof matchMedia?matchMedia("(prefers-color-scheme: dark)"):null),k?.[t]?.("change",A),x?.[t]?.("change",C),e){E??(E="function"==typeof MutationObserver?new MutationObserver(C):null);for(const e of[document.documentElement,document.body])e&&E?.observe(e,{attributes:!0,attributeFilter:["class","data-theme","data-mode","style"]})}else E?.disconnect()}var W=(e,t)=>(e.add(t),z(),()=>{e.delete(t)&&z()});function F(e){const t=e.target;if("undefined"==typeof window||t===window||"undefined"==typeof document)return W(h,e);const n=t,o=n.getRootNode?.();if(n.ownerDocument===document&&(!o||o===document))return W(h,e);const r=e.move,a=()=>e.leave();return n.addEventListener("pointermove",r,{passive:!0}),n.addEventListener("pointerdown",r,{passive:!0}),n.addEventListener("pointerleave",a),()=>{n.removeEventListener("pointermove",r),n.removeEventListener("pointerdown",r),n.removeEventListener("pointerleave",a)}}var T=e=>W(p,e),O=e=>W(g,e),R=e=>W(y,e),$=()=>null,q=new WeakSet,j={ascii:{mark:"glyph",charset:" .:-=+*#%@"},blocks:{mark:"glyph",charset:" ░▒▓█"},braille:{mark:"glyph",charset:" ⠁⠃⠇⡇⣇⣧⣷⣿"},dots:{mark:"dot"},lines:{mark:"glyph",charset:" -═╪╬"},cross:{mark:"glyph",charset:" ·+xX#"},diagonal:{mark:"glyph",charset:" /╱╳"},diamond:{mark:"glyph",charset:" ·◇◈◆"},mixed:{mark:"glyph",charset:" .:+/◇#@"},pixel:{mark:"pixel"},mosaic:{mark:"mosaic"},lego:{mark:"lego"},voxel:{mark:"voxel"},disco:{mark:"disco"},dither:{mark:"dither"},hex:{mark:"hex"},led:{mark:"led"},cmyk:{mark:"cmyk"},stipple:{mark:"stipple"},engraving:{mark:"engraving"},crosshatch:{mark:"crosshatch"},woodblock:{mark:"woodblock"},risograph:{mark:"risograph"},pointillism:{mark:"pointillism"}},B=e=>"string"==typeof e&&Object.prototype.hasOwnProperty.call(j,e),I=/\p{L}/u,D=null,N=new Set,X=new Set;function H(e){const{charset:t,style:n}=e??{};D=e?{...t?{charset:t}:{},...B(n)?{style:n}:{}}:null;for(const e of X)e.relook();for(const e of[...N])e(D)}var V=()=>D;function _(e){return N.add(e),()=>{N.delete(e)}}var G=12,J=new Set,K=null,Q=null,U=0,Y=-1e9,Z=0,ee=!1,te=!1,ne=()=>{const e=Q?.timeline?.currentTime;return"number"==typeof e?e:null};function oe(e){G=Number.isFinite(e)&&e>=1?Math.floor(e):12,be()}var re=()=>G,ae=()=>"undefined"!=typeof performance?performance.now():Date.now(),ie=()=>"number"==typeof innerHeight?innerHeight:0;function se(e,t=e.getBoundingClientRect()){if(!1===e.isConnected)return 1/0;if("function"==typeof e.getClientRects&&0===e.getClientRects().length)return 1/0;const n=t.bottom<0?-t.bottom:t.top-ie();return n>0?n:0}function le(){try{const e=Q?.querySelectorAll?.("dialog:modal");return e?.length?e[e.length-1]:null}catch{return null}}var ce=1e8;function ue(e,t){if(e.eager)return void(e.wanted=!0);const n=ie(),o=se(e.host,t);!n||o<=.5*n?e.wanted=!0:o>1*n&&(e.wanted=!1)}function de(e){let t=!1;for(const n of e)if(n?.target)for(const e of J)e.host===n.target&&(ue(e,n.boundingClientRect??void 0),t=!0);t&&be()}var me=()=>be(),fe=-1e9,he=0,pe=()=>{const e=ae();return e>=fe&&e-fe<140},ge=()=>{fe=ae(),clearTimeout(he),he=setTimeout(()=>be(),140)},ye=null,ve=e=>{ye!==e&&(ye?.removeEventListener?.("close",me,!0),ye?.removeEventListener?.("scroll",ge,!0),e?.addEventListener?.("close",me,!0),e?.addEventListener?.("scroll",ge,{capture:!0,passive:!0}),e||clearTimeout(he),ye=e)};function we(e){Q!==e.doc&&(Q=e.doc,J.clear(),U=Z=0,Y=fe=-1e9),ve(Q),J.add(e);const t=function(){const e="function"==typeof IntersectionObserver?IntersectionObserver:null;if(!e)return null;if(K?.ctor!==e){K?.list.forEach(e=>e.disconnect()),K={ctor:e,list:["50% 0px","100% 0px","0px"].map(t=>new e(de,{rootMargin:t}))};for(const e of J)K.list.forEach(t=>t.observe(e.host))}return K.list}();t?.forEach(t=>t.observe(e.host)),t?ue(e):e.wanted=!0,be()}function be(e=!1){if(ee)te=!0;else{ee=!0;try{do{te=!1;const t=ae(),n=ne();(e||(null===n?t-Y>16||t<Y:n!==Y))&&(Y=n??t,Z=0);for(const e of J)!1===e.host.isConnected&&(e.wanted=!1);for(const e of J)e.live&&!e.wanted&&e.release();const o=[...J].filter(e=>e.live&&!e.shared),r=le(),a=e=>!!r&&!r.contains(e.host),i=e=>se(e.host)+(a(e)?ce:0),s=e=>e.eager&&!a(e),l=()=>o.filter(e=>e.live&&!e.shared).map(e=>[e,i(e)+(s(e)?0:1e9)]).sort((e,t)=>t[1]-e[1]);for(let e=o.length-G,t=e>0?l():[];e>0;e--)t.shift()?.[0].release();const c=$(),u=[...J].filter(e=>e.wanted&&!e.live).map(e=>[e,e.eager?-1:i(e)]).sort((e,t)=>e[1]-t[1]);let d=0;const m=pe();for(const[t,n]of u){if(!J.has(t)||t.live)continue;if(m&&!t.eager&&(n>0||t.poster))continue;if(c&&c.roomy,!t.eager&&Z>=4&&(!e||d)){U||(U=requestAnimationFrame(()=>{U=0,be(!0)}));break}if(o.filter(e=>e.live&&!e.shared).length>=G){const e=l()[0]?.[0];if(!e||(s(e)?!t.eager||i(e)<=i(t):!t.eager&&i(e)<=n))break;e.release()}const r=ae();t.mount(),Z+=ae()-r,d++,t.live&&!t.shared&&o.push(t)}}while(te)}finally{ee=!1}}}var ke='ui-monospace, "SF Mono", Menlo, Consolas, monospace',xe=new Map;function Ee(e,t=ke){const n=`${t}\0${e}`,o=xe.get(n);if(o)return o;let r={max:1,mean:1};try{const n="undefined"==typeof document?null:Object.assign(document.createElement("canvas"),{width:48,height:48}).getContext("2d",{willReadFrequently:!0});if(n&&"function"==typeof n.getImageData){n.font=`500 36px ${t}`,n.textAlign="center",n.textBaseline="middle";const o=e=>{n.clearRect(0,0,48,48),n.fillStyle="#000",n.fillText(e,24,25);const t=n.getImageData(0,0,48,48).data;let o=0;for(let e=3;e<t.length;e+=4)o+=t[e];return o/255},a=e=>[...e].filter(e=>e.trim()).map(o),i=e=>e.reduce((e,t)=>e+t,0)/Math.max(1,e.length),s=a(e),l=a(".:-=+*#%@"),c=o("@");s.length&&c>0&&i(l)>0&&(r={max:Math.max(...s)/c,mean:i(s)/i(l)})}}catch{}return xe.set(n,r),r}function Me(e,t){const{max:n,mean:o}=Ee(e,t.font??ke),r=t.glyphScale??.8,a=t.gamma??1,i=t.fontWeight??500;return n>1.15?{glyphScale:Math.max(.3,r*Math.max(.62,n**-.36)),gamma:a,fontWeight:i}:o>1.5?{glyphScale:Math.max(.3,r*o**-.25),gamma:a,fontWeight:i}:n<.85?{glyphScale:Math.min(1.6,r*Math.min(1.3,n**-.3)),gamma:a,fontWeight:n<.6?Math.max(i,700):i}:{glyphScale:r,gamma:a,fontWeight:i}}var Se=new WeakMap;function Le(e,t){for(const n of Se.get(e)?.keys()??[])n.getAttribute("src")!==t&&(n.src=t)}function Ae(e){const t=Se.get(e);Se.delete(e),t?.forEach(e=>e())}var Ce=()=>"function"==typeof matchMedia&&matchMedia("(prefers-reduced-motion: reduce)").matches;function Pe(e,t,n,o,r){const a=document.createElement("img");a.alt="",a.decoding="async",a.setAttribute("aria-hidden","true"),a.setAttribute("style",`${n};object-fit:cover${Ce()?"":";transition:opacity 280ms cubic-bezier(.23, 1, .32, 1)"}`),a.style.opacity="1",a.dataset.asciiPoster="",a.src=t;const i=e.style.getPropertyValue("position"),s="function"==typeof getComputedStyle&&"static"===getComputedStyle(e).position;s&&e.style.setProperty("position","relative");const l=e.style.getPropertyValue("isolation"),c=/z-index:\s*-1/.test(n)&&"function"==typeof getComputedStyle&&"auto"===getComputedStyle(e).isolation;c&&e.style.setProperty("isolation","isolate"),r?.parentElement===e?e.insertBefore(a,r):e.appendChild(a);let u=!1;const d=()=>{u||(u=!0,a.remove(),Se.get(o)?.delete(a),s&&(i?e.style.setProperty("position",i):e.style.removeProperty("position")),c&&(l?e.style.setProperty("isolation",l):e.style.removeProperty("isolation")))},m=Se.get(o)??new Map;return m.set(a,d),Se.set(o,m),{show(e){a.style.opacity=e?"1":"0"},remove:d}}function ze(e){const t=document.createElement("canvas");for(const n of e.getAttributeNames?.()??[])"width"!==n&&"height"!==n&&t.setAttribute(n,e.getAttribute(n));return t.style.cssText=e.style.cssText,Object.assign(t.dataset,e.dataset),e.replaceWith?e.replaceWith(t):e.parentElement&&(e.parentElement.insertBefore(t,e),e.remove()),t}function We(t){const{host:n,kit:o}=t;let r,a=t.canvas,i=null,s=!1,l=!1,c=!1,u=!1,d={},m={},f=t.source,h=!1,p={},g=null,y=null,v=!1,w=null,b=()=>{};const k=!t.ownPoster&&o?.current.poster?Pe(n,o.current.poster,t.place,o,a):null,x=()=>{if(!D||!1===o?.current.globalLook||"glyph"!==(m.mark??"glyph")&&!t.glyphs||I.test(m.charset??""))return;const e=D.style?j[D.style]:void 0,n=e?.mark??"glyph",r="glyph"===n?D.charset||(e&&"charset"in e?e.charset:void 0):void 0;return e||r?{mark:n,charset:r}:void 0},E=()=>({...t.glyphs?Object.fromEntries(Object.keys(t.glyphs()).map(e=>[e,m[e]]).filter(([,e])=>void 0!==e)):{},mark:m.mark??"glyph",charset:m.charset??" .,:-=+*#%@",glyphScale:m.glyphScale??.8,gamma:m.gamma??1,fontWeight:m.fontWeight??500}),M=e=>{if(!e.charset)return{...E(),mark:e.mark};const n=t.glyphs&&"glyph"!==(m.mark??"glyph")?t.glyphs():{};return{...n,mark:e.mark,charset:e.charset,...Me(e.charset,{...m,...n})}},S=()=>{const e=x(),t=e&&`${e.mark}\0${e.charset??""}`;return t===r?null:(r=t,e?M(e):E())},L={host:n,doc:document,eager:!1===o?.current.lazy,wanted:!1,live:!1,poster:!!k||!!t.ownPoster,mount(){if(l||i)return;s&&(a=t.canvas=ze(a)),s=!0,m={...t.options(),...d},r=void 0;const n=S();let o;try{o=e(a,{...m,...n,...void 0===f?{}:{source:f},onError:()=>{i===o&&A()}})}catch{return void A()}i=o,L.live=!0,L.shared=(e=>q.has(e))(a);const c=a;if(L.shared)b=()=>{};else{let e=0;const t=()=>{i===o&&(clearTimeout(e),e=setTimeout(()=>{i===o&&a===c&&(L.release(),be())},1e3))},n=()=>clearTimeout(e);c.addEventListener?.("webglcontextlost",t),c.addEventListener?.("webglcontextrestored",n),b=()=>{clearTimeout(e),c.removeEventListener?.("webglcontextlost",t),c.removeEventListener?.("webglcontextrestored",n)}}h&&o.pause(),o.ready.then(()=>{i===o&&(v=!0,k?.show(!1),g?.(),g=y=null)},()=>{}),t.onMount?.(o,a)},release(){if(!i)return;const e=i;i=null,L.live=!1,v=!1,b(),w?.clear(),w=null,p=e.settings,e.destroy(),L.shared?l||(a.width=a.width,s=!1):((e=>{try{const t=e.getContext("webgl2");t&&!t.isContextLost?.()&&t.getExtension("WEBGL_lose_context")?.loseContext()}catch{}})(a),l||(a=t.canvas=ze(a),s=!1)),k?.show(!0),t.onRelease?.()}};function A(){c||(c=!0,C(),u||t.onFail())}function C(){l||(l=!0,L.release(),function(e){J.delete(e)&&([...J].some(t=>t.host===e.host)||K?.list.forEach(t=>t.unobserve(e.host)),!J.size&&K&&(K.list.forEach(e=>e.disconnect()),K=null),J.size||ve(null),be())}(L),X.delete(P),a.remove(),c?k?.show(!0):k?.remove())}const P={relook(){const e=S();if(!e||!i)return;const n=i,r=v&&!(o?.current.reducedMotion??Ce());w?.clear(),w=null,r&&(n.redraw(),w=function(e,t){if(!e.width||!e.height||"undefined"==typeof document)return null;const n=document.createElement("canvas");n.width=e.width,n.height=e.height;const o=n.getContext("2d");if(!o||"function"!=typeof n.animate)return null;try{o.drawImage(e,0,0)}catch{return null}n.setAttribute("aria-hidden","true"),n.dataset.asciiSweep="",n.setAttribute("style",t);const r=document.createElement("span");let a,i;r.setAttribute("aria-hidden","true"),r.dataset.asciiSweep="",r.setAttribute("style",`${t};right:auto;width:2px;margin-left:-1px;opacity:0;background:var(--ascii-sweep, #f3ba32);box-shadow:0 0 10px 1px color-mix(in srgb, var(--ascii-sweep, #f3ba32) 40%, transparent)`),e.after(n,r);const s=()=>{a?.cancel(),i?.cancel(),n.remove(),r.remove()};return{clear:s,reveal(){if(!n.isConnected)return;const t={duration:200,delay:40,easing:"cubic-bezier(.23,1,.32,1)",fill:"both"};a=n.animate([{clipPath:"inset(0% 0% 0% 0%)"},{clipPath:"inset(0% 0% 0% 100%)"}],t);const o=e.clientWidth||e.getBoundingClientRect().width;i=r.animate([{transform:"translateX(0px)",opacity:.35},{opacity:.35,offset:.7},{transform:`translateX(${o}px)`,opacity:0}],t),a.onfinish=s}}}(a,t.place)),n.update(e);const s=w;s&&requestAnimationFrame(()=>requestAnimationFrame(()=>{w===s&&i===n?s.reveal():s.clear()}))}};return{field:{get canvas(){return a},get ready(){return i?i.ready:y??(y=new Promise(e=>{g=e}))},get settings(){return i?.settings??p},update(e){if(d={...d,...e},m={...m,...e},!i)return;const t=S(),n=x();i.update(n?{...e,...M(n)}:t?{...e,...t}:e)},setSource:e=>(f=e,i?i.setSource(e):Promise.resolve()),pointer(e,t){i?.pointer(e,t)},redraw(){i?.redraw()},pulse(e){i?.pulse(e)},play(){h=!1,i?.play()},pause(){h=!0,i?.pause()},resize(){i?.resize()},destroy(){C()}},get canvas(){return a},get live(){return!!i},get failed(){return c},start(){X.add(P),u=!0;try{we(L)}finally{u=!1}},destroy:C}}export{j as KIT_STYLES,d as ambientFactor,Me as balanceCharset,f as cancelFieldFrame,Ae as disposeKit,re as getFieldBudget,V as getGlobalLook,Ee as inkWeight,We as liveField,Pe as poster,m as requestFieldFrame,oe as setFieldBudget,H as setGlobalLook,Le as setPosterSource,_ as subscribeGlobalLook,O as watchMotionPreference,F as watchPointer,R as watchTheme,T as watchVisibility};//# sourceMappingURL=chunk-XVB3B3FV.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{renderMaterial as i}from"./chunk-XPXMCXYI.js";import{mountCanvas as t}from"./chunk-KTYCGGRO.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-XXPDXJMQ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{imageFor as e,drawCover as t,injectStyle as a,imageReady as n,toneOf as r}from"./chunk-PCGRRX5P.js";import{styleKeeper as i,clamp as o,mountSurface as c,smoothstep as s,handle as l,prefersReduced as p}from"./chunk-PFQBEWCF.js";var d=e=>"string"==typeof e?{src:e}:e;function u(u,h){const m={current:{open:0,duration:420,label:"Images",...h}},f=i(),v=m.current.images.map(d);let x=o(Math.round(m.current.open),0,Math.max(0,v.length-1)),b=0,g=0;const w=v.map((e,t)=>({x:t===x?1:0,v:0})),y=v.map(()=>null),k=v.map(()=>null);let E=null;const A=v.map(t=>{const a=document.createElement("button");a.type="button",a.className="ascii-acc-panel",a.setAttribute("aria-label",[t.title??t.alt,t.meta].filter(Boolean).join(", ")||t.src);const n=e(t.src);if(n.className="ascii-acc-photo",n.alt="",n.draggable=!1,t.focus&&n.style.setProperty("object-position",`${100*t.focus.x}% ${100*t.focus.y}%`),a.appendChild(n),t.title||t.meta){const e=document.createElement("span");e.className="ascii-acc-caption",e.setAttribute("aria-hidden","true");for(const[a,n]of[["ascii-acc-title",t.title],["ascii-acc-meta",t.meta]]){if(!n)continue;const t=document.createElement("span");t.className=a,t.textContent=n,e.appendChild(t)}a.appendChild(e)}return a});function M(e,t){const a=b?Math.min(.064,(e-b)/1e3):1/60;b=e;const n=5/(Math.max(1,m.current.duration)/1e3),r=Math.max(1,Math.ceil(240*a)),i=a/r;let o=!1;return w.forEach((e,a)=>{const c=a===x?1:0;t&&(e.x=c,e.v=0);for(let t=0;t<r&&(e.x!==c||e.v);t++)e.v+=(-n*n*(e.x-c)-2*n*e.v)*i,e.x+=e.v*i;Math.abs(e.x-c)<.001&&Math.abs(e.v)<.01?(e.x=c,e.v=0):o=!0,F(A[a],e.x)}),o||(b=0),o}function F(e,t){const a=e.style;a.setProperty("--ascii-acc-open",t.toFixed(4)),a.setProperty("--ascii-acc-photo",(E?s(.15,.75,t):.45+.55*t).toFixed(3)),a.setProperty("--ascii-acc-caption",s(.6,1,t).toFixed(3))}E=c({host:u,layer:"under",look:()=>({blend:"coarse",mark:"glyph",charset:" .:-=+*#%@",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:6,cellAspect:.62,glyphScale:.94,hover:"trail",trail:{strength:.5,radius:.25},...m.current.look}),ink:()=>m.current.ink??"--ascii-ink-strong",kit:m,reducedMotion:()=>m.current.reducedMotion,onFail:()=>{E=null,delete u.dataset.asciiField},onTheme:()=>{y.forEach((e,t)=>{k[t]=e&&E?r(e,!E.dark()):null}),E?.kick()},paint:({pen:e,still:a,now:n,box:r})=>{const i=M(n,a);return A.forEach((a,n)=>{const i=k[n],o=w[n].x,c=1-s(.45,.95,o);if(!i||c<=0)return;const l=r(a),p=parseFloat(getComputedStyle(a).borderTopLeftRadius)||0,d=1.04-.04*o;e.save(),e.beginPath(),e.roundRect(l.x,l.y,l.w,l.h,p),e.clip(),e.globalAlpha=c,t(e,i,l.x-l.w*(d-1)/2,l.y-l.h*(d-1)/2,l.w*d,l.h*d,v[n].focus?.x,v[n].focus?.y),e.restore()}),i}});const L=()=>{A.forEach((e,t)=>{e.setAttribute("aria-expanded",String(t===x)),e.tabIndex=t===x?0:-1})},C=(e,t=!1)=>{e=o(Math.round(e),0,A.length-1),t&&A[e]?.focus(),e!==x&&(x=e,L(),m.current.onChange?.(e),(()=>{if(E)return void E.kick();if(g||"function"!=typeof requestAnimationFrame)return void(g||M(performance.now(),!0));const e=t=>{g=M(t,!!(m.current.reducedMotion??p()))?requestAnimationFrame(e):0};g=requestAnimationFrame(e)})())};let P=0,S=0,j=0,R=0,T=0;const q=()=>{P&&clearTimeout(P),P=0},N=A.map((e,t)=>{const a=e=>{if("mouse"!==e.pointerType)return;const a=e.timeStamp||performance.now(),n=Math.max(1,a-j);if(R=j&&n<100?.5*R+Math.abs(e.clientX-S)/n*.5:0,S=e.clientX,j=a,T!==t&&q(),T=t,t!==x)return R<.3?(q(),void C(t)):void(P||(P=setTimeout(()=>{P=0,C(T)},90)));q()},n=()=>{q(),C(t)},r=()=>{e.matches(":focus-visible")&&C(t)},i=e=>{const a={ArrowRight:1,ArrowDown:1,ArrowLeft:-1,ArrowUp:-1}[e.key],n="Home"===e.key?0:"End"===e.key?A.length-1:void 0!==a?(t+a+A.length)%A.length:null;null!==n&&(e.preventDefault(),C(n,!0))};return e.addEventListener("pointermove",a),e.addEventListener("pointerdown",n),e.addEventListener("click",n),e.addEventListener("focus",r),e.addEventListener("keydown",i),()=>{e.removeEventListener("pointermove",a),e.removeEventListener("pointerdown",n),e.removeEventListener("click",n),e.removeEventListener("focus",r),e.removeEventListener("keydown",i)}}),z=()=>{q(),j=0};u.addEventListener("pointerleave",z),a("ascii-kit-accordion",'\n:where([data-ascii-accordion]){display:flex;gap:6px}\n:where(.ascii-acc-panel){position:relative;flex:calc(1 + 3.2 * var(--ascii-acc-open, 0)) 1 0;min-width:0;margin:0;padding:0;border:0;border-radius:12px;overflow:hidden;background:transparent;color:#fff;font:inherit;text-align:left;cursor:pointer;-webkit-tap-highlight-color:transparent}\n:where(.ascii-acc-panel[aria-expanded="true"]){cursor:default}\n:where(.ascii-acc-photo){position:absolute;inset:0;width:100%;height:100%;object-fit:cover;opacity:var(--ascii-acc-photo, 0);scale:calc(1.04 - .04 * var(--ascii-acc-open, 0))}\n:where(.ascii-acc-caption){position:absolute;inset:auto 0 0;display:flex;color:#fff;flex-direction:column;gap:2px;padding:28px 12px 11px;background:linear-gradient(to top, rgb(0 0 0 / .62), transparent);white-space:nowrap;opacity:var(--ascii-acc-caption, 0);translate:0 calc(6px - 6px * var(--ascii-acc-caption, 0))}\n:where(.ascii-acc-title){font-size:15px;font-weight:500}\n:where(.ascii-acc-meta){font-size:14px;opacity:.8}\n'),u.dataset.asciiAccordion="",E&&(u.dataset.asciiField="");const X=u.getAttribute("role"),B=u.getAttribute("aria-label");return X||u.setAttribute("role","group"),B||u.setAttribute("aria-label",m.current.label),A.forEach((e,t)=>{F(e,w[t].x),u.appendChild(e)}),L(),A.forEach((e,t)=>{const a=e.querySelector("img");a&&n(a).then(e=>{y[t]=e,k[t]=E?r(e,!E.dark()):null,E?.kick()},()=>{})}),l(()=>E,m,e=>{B||u.setAttribute("aria-label",e.label),E?.refresh()},{select:C,get open(){return x}},()=>{N.forEach(e=>e()),q(),g&&cancelAnimationFrame(g),u.removeEventListener("pointerleave",z),A.forEach(e=>e.remove()),delete u.dataset.asciiAccordion,delete u.dataset.asciiField,X||u.removeAttribute("role"),B||u.removeAttribute("aria-label"),f.restore()})}export{u as accordion};//# sourceMappingURL=chunk-XYLLL2PQ.js.map
|