asciify-engine 4.22.0 → 4.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -0
- package/dist/{animation-presets-KnEWoJ_q.d.ts → animation-presets-CzM3jLT6.d.cts} +1 -1
- package/dist/{animation-presets-CEdD0FMM.d.cts → animation-presets-a8WDzKDj.d.ts} +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.d.cts +5 -4
- package/dist/core.d.ts +5 -4
- package/dist/core.js +1 -1
- package/dist/field.cjs +1 -1
- package/dist/field.d.cts +10 -1
- package/dist/field.d.ts +10 -1
- package/dist/field.js +1 -1
- package/dist/{hover-guide-CAfsLjFZ.d.cts → hover-catalog-CrmxlmUe.d.cts} +37 -10
- package/dist/{hover-guide-CAfsLjFZ.d.ts → hover-catalog-CrmxlmUe.d.ts} +37 -10
- package/dist/hover-guide-DdFnAnfU.d.cts +9 -0
- package/dist/hover-guide-DdFnAnfU.d.ts +9 -0
- package/dist/hover.cjs +1 -1
- package/dist/hover.d.cts +7 -5
- package/dist/hover.d.ts +7 -5
- package/dist/hover.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +4 -3
- package/dist/index.d.ts +4 -3
- package/dist/index.js +1 -1
- package/dist/kit/chunk-2CF4PX6U.js +1 -0
- package/dist/kit/chunk-2NVKPXPL.js +1 -0
- package/dist/kit/chunk-3473NPIN.js +1 -0
- package/dist/kit/chunk-3A5LID2G.js +1 -0
- package/dist/kit/chunk-3PCKMO6I.js +1 -0
- package/dist/kit/chunk-4HWMQCAM.js +1 -0
- package/dist/kit/chunk-4OT66HSZ.js +1 -0
- package/dist/kit/chunk-4QHFEMFS.js +1 -0
- package/dist/kit/chunk-4ZQFDFEH.js +1 -0
- package/dist/kit/chunk-5BEBNKYM.js +1 -0
- package/dist/kit/chunk-5I4IZTL5.js +1 -0
- package/dist/kit/chunk-5QE6UMXN.js +1 -0
- package/dist/kit/chunk-5Z2EJAUV.js +1 -0
- package/dist/kit/chunk-73M2OESE.js +1 -0
- package/dist/kit/chunk-7ABNWOW4.js +1 -0
- package/dist/kit/chunk-AIM3J2US.js +1 -0
- package/dist/kit/chunk-BN7HL52Z.js +1 -0
- package/dist/kit/chunk-BNVRKD3V.js +1 -0
- package/dist/kit/chunk-BQZCLGCY.js +1 -0
- package/dist/kit/chunk-BR6ZNJZW.js +1 -0
- package/dist/kit/chunk-BTD6EFAW.js +1 -0
- package/dist/kit/chunk-C3C7AYKL.js +1 -0
- package/dist/kit/chunk-C4KZYCPF.js +1 -0
- package/dist/kit/chunk-DFOWXOZR.js +1 -0
- package/dist/kit/chunk-DZ5XGHTJ.js +1 -0
- package/dist/kit/chunk-E3TUOX2A.js +1 -0
- package/dist/kit/chunk-ENTDGT2V.js +1 -0
- package/dist/kit/chunk-FR3ZJNOY.js +1 -0
- package/dist/kit/chunk-FUI5AVIF.js +1 -0
- package/dist/kit/chunk-G57QACJG.js +1 -0
- package/dist/kit/chunk-H2UZBVKE.js +1 -0
- package/dist/kit/chunk-HTUGMGVA.js +1 -0
- package/dist/kit/chunk-I4QVLLRQ.js +1 -0
- package/dist/kit/chunk-IPVN22ZM.js +1 -0
- package/dist/kit/chunk-IQTGJRDX.js +1 -0
- package/dist/kit/chunk-IUKSHYED.js +1 -0
- package/dist/kit/chunk-J2YZBT3N.js +1 -0
- package/dist/kit/chunk-K563CCOL.js +1 -0
- package/dist/kit/chunk-KWTF6Q5W.js +1 -0
- package/dist/kit/chunk-MGVPLQ3Z.js +1 -0
- package/dist/kit/chunk-MIZ2DUHU.js +1 -0
- package/dist/kit/chunk-MQJQIDO5.js +1 -0
- package/dist/kit/chunk-NURPDP3Y.js +1 -0
- package/dist/kit/chunk-O7SGY4YJ.js +1 -0
- package/dist/kit/chunk-OWEZV7TQ.js +1 -0
- package/dist/kit/chunk-PCIAA2LL.js +1 -0
- package/dist/kit/chunk-PFKYKAIP.js +1 -0
- package/dist/kit/chunk-PIU2BMFU.js +1 -0
- package/dist/kit/chunk-QALCXKU6.js +1 -0
- package/dist/kit/chunk-QRCXXS5Z.js +1 -0
- package/dist/kit/chunk-RFLIFKZ4.js +1 -0
- package/dist/kit/chunk-ROR6MG3K.js +1 -0
- package/dist/kit/chunk-S62H7ZIU.js +1 -0
- package/dist/kit/chunk-S7RZP2MT.js +1 -0
- package/dist/kit/chunk-SARCZMLN.js +1 -0
- package/dist/kit/chunk-SNCXU7KF.js +1 -0
- package/dist/kit/chunk-T3GWGPST.js +1 -0
- package/dist/kit/chunk-TTGMK4EA.js +1 -0
- package/dist/kit/chunk-UML6XQAR.js +1 -0
- package/dist/kit/chunk-UO7RB7RC.js +1 -0
- package/dist/kit/chunk-VC2ZQG63.js +1 -0
- package/dist/kit/chunk-VVW7LZT2.js +1 -0
- package/dist/kit/chunk-W2STAN6V.js +1 -0
- package/dist/kit/chunk-WJLZM3DR.js +1 -0
- package/dist/kit/chunk-XANKANGR.js +1 -0
- package/dist/kit/chunk-XB4DKPGL.js +1 -0
- package/dist/kit/chunk-XDKKCIIL.js +1 -0
- package/dist/kit/chunk-XM56OTYT.js +1 -0
- package/dist/kit/chunk-XPXMCXYI.js +1 -0
- package/dist/kit/chunk-YBRP6BFW.js +1 -0
- package/dist/kit/chunk-YCWMOTYH.js +1 -0
- package/dist/kit/chunk-ZCHGV2CV.js +1 -0
- package/dist/kit/chunk-ZRJVOUWH.js +1 -0
- package/dist/kit.cjs +1 -1
- package/dist/kit.d.cts +1 -0
- package/dist/kit.d.ts +1 -0
- package/dist/kit.js +1 -1
- package/dist/{model-BHIQYYk-.d.ts → model-C3TTmMXv.d.ts} +2 -1
- package/dist/{model-BzgEEqzP.d.cts → model-DAZNnqXr.d.cts} +2 -1
- package/dist/studio.cjs +1 -1
- package/dist/studio.d.cts +6 -4
- package/dist/studio.d.ts +6 -4
- package/dist/studio.js +1 -1
- package/dist/{types-C9lka3yC.d.ts → types-BnakIXAU.d.ts} +1 -1
- package/dist/{types-DOl5f2x3.d.cts → types-_8MohOZ1.d.cts} +1 -1
- package/package.json +2 -2
- package/skills/asciify-engine/SKILL.md +3 -3
- package/skills/asciify-engine/references/glyph-field.md +2 -1
- package/skills/asciify-engine/references/kit.md +1 -1
- package/skills/asciify-engine/references/performance.md +30 -0
- package/skills/asciify-engine/references/studio-effects.md +12 -6
- package/skills/asciify-engine/references/studio-workspace.md +1 -1
- package/skills/asciify-engine/references/upgrading.md +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{MONO as t,GRAPHITE_LIGHT as e,GRAPHITE_DARK as o,pixelSnap as r,parseColor as n,band as c,ditherIndex as i,toneAlpha as a,vnoise as l}from"./chunk-ZCHGV2CV.js";import{mountCanvas as s}from"./chunk-BR6ZNJZW.js";function h(s,h,f,d,g={x:.5,y:.5},u={}){const{fontSize:m=13,chars:M=" .:-=+*#%@",accentColor:p,color:$,octaves:x=4,speed:S=1,scale:b=1,accentThreshold:y=.9,mouseWarp:z=.3,lightMode:C=!1}=u,k=Array.from(M),Z=.62*m,j=1.3*m,v=Math.ceil(h/Z),w=Math.ceil(f/j);s.clearRect(0,0,h,f),s.font=`${m}px ${t}`,s.textBaseline="top";const A=C?e:o;let B=A.r,N=A.g,R=A.b;const T=r(s);if($){const t=n($);t&&(B=t.r,N=t.g,R=t.b)}let V=B,W=N,q=R;const G=p?n(p):null;G&&(V=G.r,W=G.g,q=G.b);const H=.035*b,J=d*S,D=Math.min(6,Math.max(1,x)),E=(t,e)=>{let o=0,r=.5,n=1,c=0;for(let i=0;i<D;i++)o+=l(t*n,e*n)*r,c+=r,r*=.5,n*=2.1;return o/c};for(let t=0;t<w;t++)for(let e=0;e<v;e++){const o=e*H+.06*J,r=t*H*1.3-.04*J,n=e/v-g.x,l=t/w-g.y,h=Math.sqrt(n*n+l*l),f=z>0?.12*Math.max(0,1-h/z):0,d=E(o+f*Math.sin(1.3*J+8*l),r+f*Math.cos(.9*J+8*n)),m=c(.5*d+.5,.7,.83);if(m<=0)continue;const M=k[i(m,k.length,e,t,u.ditherStrength)];if(" "===M)continue;const p=!!G&&m>y,$=a(m);s.fillStyle=p?`rgba(${V},${W},${q},${$})`:`rgba(${B},${N},${R},${$})`,s.fillText(M,T(e*Z),T(t*j))}}var f={id:"noise",name:"Noise",description:"A slow fractal noise field that warps around the cursor.",cellSize:13,speed:.5,cursor:!0,mount:t=>s(t,(t,e,o,r,n,c)=>h(t,e,o,r,n,{ditherStrength:c.ditherStrength,fontSize:c.fontSize,chars:c.chars,lightMode:c.lightMode,color:c.ink,accentColor:c.accent}))};export{f as noise,h as renderNoiseBackground};//# sourceMappingURL=chunk-XM56OTYT.js.map
|
|
@@ -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{scenePreset as e}from"./chunk-C3C7AYKL.js";var r=e({id:"mesh",name:"Mesh",description:"Four soft lights on slow paths: a gradient mesh written in characters.",cellSize:11,scene:"mesh",charset:" .:-=+*#%@",hover:"trail"});export{r as mesh};//# sourceMappingURL=chunk-YBRP6BFW.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{mountSurface as t,house as e,styleKeeper as n,handle as r,clamp as o}from"./chunk-S7RZP2MT.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=[],k={cols:0,rows:0};const y=()=>u.current.values??[],E=()=>({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}=E(),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,k.cols,k.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:E,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;k={cols:h,rows:d};const m=y(),M=m.length,v=p?Math.min(64,l-p):16;p=l;const b=new Float32Array(h*d),E=(t,e,n)=>{const r=(d-1-e)*h+t;n>b[r]&&(b[r]=n)};for(let t=0;t<h;t++)E(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++)E(a,t+1,(t===l?Math.min(1,r+.2):r)*i*o(n-t))}};let P=!1;const H=i?1:e((l-g)/u.current.duration);H<1&&(P=!0);for(const t of w)R({...t,h:t.h*(1-H)},a);H>=1&&(w=[]);for(let t=0;t<M;t++){!i&&$(t,l)<1&&(P=!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&&(P=!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(),P||c}});const R=n(),P=x?null:document.createElement("div"),H=()=>{if(!P)return;const t=y(),e=t.length,n=u.current.max??1.04*Math.max(...t,0);P.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}))};P&&("static"===getComputedStyle(s).position&&R.set(s,"position","relative"),P.setAttribute("aria-hidden","true"),P.setAttribute("style","position:absolute;inset:0;display:flex;align-items:flex-end;pointer-events:none"),s.appendChild(P));const I=document.createElement("table");I.setAttribute("style","position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0");const W=()=>{const t=u.current.format??(t=>t.toLocaleString()),e=u.current.labels??[],n=document.createElement("tbody");y().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)}),I.replaceChildren(n)};W(),s.appendChild(I);const z=!s.hasAttribute("tabindex"),F=!s.hasAttribute("role");z&&(s.tabIndex=0),F&&s.setAttribute("role","group");const O=t=>{const e=y().length,n=null!==t&&e?Math.min(e-1,Math.max(0,Math.round(t))):null;n!==m&&(m=n,x?.kick(),H(),u.current.onHover?.(m,null===m?null:y()[m],null===m?null:u.current.labels?.[m]??null))},X=t=>u.current.stagger??(t<=7?45:12),j=(t,n)=>{const r=y(),o=u.current.labels,l=performance.now(),i=!!x?.still(),c=k.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 E=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:E++*X(A)*.6),w=[...s,...c.filter((t,e)=>!p.has(e))].filter(t=>t.h>.01),d=r,g=l,x?.kick(),H()};H();const B=t=>{const e=s.getBoundingClientRect(),n=y().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 O(null);if(!k.cols)return void O(i(r,n));const{bar:l,gap:a,left:h}=c(k.cols,n);O(Math.round(((t.clientX-e.left-L.left)/L.cell-h-l/2)/Math.max(1,l+a)))},D=()=>O(null),G=t=>{const e=y().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(),O(n))};s.addEventListener("pointermove",B),s.addEventListener("pointerdown",B),s.addEventListener("pointerleave",D),s.addEventListener("pointercancel",D),s.addEventListener("keydown",G),s.addEventListener("blur",D);const T="function"==typeof IntersectionObserver?new IntersectionObserver(([t])=>{t?.isIntersecting&&!M&&(M=!0,!1!==u.current.intro&&(()=>{const t=y().length;d=y(),g=performance.now(),v=[],w=[],b=Array.from({length:t},(e,n)=>n*X(t)),f=y().map((t,e,n)=>C(e,n.length)),x?.kick(),H()})())},{threshold:.4}):null;T?.observe(s);let Y=u.current.labels;return r(()=>x,u,t=>{W(),t.values!==d&&(j(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&&O(null),W(),j(n,r)},highlight:O,get active(){return m},get values(){return y()}},()=>{T?.disconnect(),I.remove(),P?.remove(),R.restore(),s.removeEventListener("pointermove",B),s.removeEventListener("pointerdown",B),s.removeEventListener("pointerleave",D),s.removeEventListener("pointercancel",D),s.removeEventListener("keydown",G),s.removeEventListener("blur",D),z&&s.removeAttribute("tabindex"),F&&s.removeAttribute("role")})}var h=l;export{h as BLOCK_CHART_DEFAULTS,i as barAt,c as barLayout,s as blockChart};//# sourceMappingURL=chunk-YCWMOTYH.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function n(n){const t=n.match(/^#([0-9a-f]{3,8})$/i)?.[1];if(t){const n=t.length<=4?t.split("").map(n=>parseInt(n+n,16)):[parseInt(t.slice(0,2),16),parseInt(t.slice(2,4),16),parseInt(t.slice(4,6),16)];return{r:n[0],g:n[1],b:n[2]}}const r=n.match(/rgba?\(\s*(\d+)[,\s]+(\d+)[,\s]+(\d+)/i);return r?{r:+r[1],g:+r[2],b:+r[3]}:null}function t(n){return n*n*n*(n*(6*n-15)+10)}function r(n,t,r){return n+(t-n)*r}function o(n,t){let r=127*n+311*t;return r^=r>>13,(r*(r*r*15731+789221)+1376312589&2147483647)/2147483647}function a(n,a){const e=Math.floor(n),i=Math.floor(a),u=a-i,c=t(n-e),s=t(u),f=o(e,i),M=o(e+1,i),h=o(e,i+1),m=o(e+1,i+1);return r(r(f,M,c),r(h,m,c),s)}function e(n,t){return(.5*a(n,t)+.25*a(2.1*n,2.1*t)+.125*a(4.3*n,4.3*t))/.875}var i='"Geist Mono", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace';function u(n){const t=("function"==typeof n.getTransform?n.getTransform().a:1)||1;return n=>Math.round(n*t)/t}var c={r:111,g:109,b:103},s={r:143,g:141,b:134};function f(n,t,r){return Math.min(1,Math.max(0,(n-t)/(r-t)))}function M(n,t=.3,r=.95){return t+(r-t)*Math.min(1,Math.max(0,n))}var h=[0,8,2,10,12,4,14,6,3,11,1,9,15,7,13,5];function m(n,t,r,o,a=0){const e=(h[(3&o)<<2|3&r]+.5)/16;return Math.min(t-1,Math.max(0,Math.floor(n*(t-1)+e*Math.min(1,Math.max(0,a)))))}export{s as GRAPHITE_DARK,c as GRAPHITE_LIGHT,i as MONO,f as band,m as ditherIndex,e as fbm,o as hash2,n as parseColor,u as pixelSnap,M as toneAlpha,a as vnoise};//# sourceMappingURL=chunk-ZCHGV2CV.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{styleKeeper as t,mountSurface as e,handle as n,hash as r,house as o}from"./chunk-S7RZP2MT.js";var a={duration:800,trigger:"visible",replayOnHover:!0,settle:"glyphs"};function i(t,e,n=.82){const o=t.getContext("2d");if(!o)return;const a=t.width,i=t.height,l=o.createImageData(a,i),c=t=>t*t*(3-2*t),s=(t,e)=>{const n=Math.floor(t),o=Math.floor(e),a=c(t-n),i=c(e-o),l=r(n,o),s=r(n+1,o),f=r(n,o+1);return l+(s-l)*a+(f-l)*i+(l-s-f+r(n+1,o+1))*a*i};for(let t=0;t<i;t++)for(let r=0;r<a;r++){const o=.6*s(r/6+2.4*e,t/3.5-.8*e)+.4*s(r/2.5-3*e,t/2),c=Math.min(1,2.4*(1-Math.hypot(2*(r/a-.5),2*(t/i-.5))*n)),f=.72*Math.max(0,o-.42)*Math.max(0,c)*255,g=4*(t*a+r);l.data[g]=l.data[g+1]=l.data[g+2]=f,l.data[g+3]=255}o.putImageData(l,0,0)}function l(l,c={}){const s={current:{...a,...c}},f=t(),g=document.createElement("canvas"),d=document.createElement("canvas");let h=-1,p="",u=!1,m=!1,x=null;const v=(t,e)=>{const n=`${t}x${e}:${s.current.text??""}:${l.textContent}`;if(n===p)return;p=n,g.width=t,g.height=e;const r=g.getContext("2d");r.fillStyle="#000",r.fillRect(0,0,t,e),void 0!==s.current.text?function(t,e,n,r,o){const a=getComputedStyle(e),i=n.split("\n");t.fillStyle="#fff",t.textAlign="center",t.textBaseline="middle";const l=(parseFloat(a.letterSpacing)||0)/(parseFloat(a.fontSize)||16),c=e=>{"letterSpacing"in t&&(t.letterSpacing=l*e+"px")};t.font=`${a.fontWeight} 100px ${a.fontFamily}`,c(0);const s=Math.max(1,...i.map(e=>t.measureText(e).width)),f=Math.min(.94*r/s*100,.9*o/i.length);t.font=`${a.fontWeight} ${f}px ${a.fontFamily}`,c(f),i.forEach((e,n)=>t.fillText(e,r/2,o/2+(n-(i.length-1)/2)*f*1.04))}(r,l,s.current.text,t,e):function(t,e,n,r){const o=document.createTreeWalker(e,NodeFilter.SHOW_TEXT),a=document.createRange();t.fillStyle="#fff",t.textAlign="left",t.textBaseline="alphabetic";for(let e=o.nextNode();e;e=o.nextNode()){const o=e.parentElement;if(!o)continue;const i=getComputedStyle(o);t.font=`${i.fontStyle} ${i.fontWeight} ${parseFloat(i.fontSize)*r}px ${i.fontFamily}`,"letterSpacing"in t&&(t.letterSpacing=(parseFloat(i.letterSpacing)||0)*r+"px");const l=t.measureText("Hg"),c=l.fontBoundingBoxAscent||parseFloat(i.fontSize)*r*.8,s=l.fontBoundingBoxDescent||parseFloat(i.fontSize)*r*.2,f="uppercase"===i.textTransform?t=>t.toUpperCase():"lowercase"===i.textTransform?t=>t.toLowerCase():t=>t;for(const o of e.data.matchAll(/\S+/g)){a.setStart(e,o.index),a.setEnd(e,o.index+o[0].length);const i=a.getClientRects()[0];if(!i)continue;const l=(i.top-n.top)*r,g=i.height*r;t.fillText(f(o[0]),(i.left-n.left)*r,l+(g-c-s)/2+c)}}a.detach?.()}(r,l,l.getBoundingClientRect(),t/(l.getBoundingClientRect().width||1))};x=e({host:l,look:()=>({mark:"glyph",charset:" .:-=+*#%@",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:4.5,cellAspect:.62,glyphScale:.92,contrast:1.35,hover:"trail",trail:{strength:.6,radius:.2},...s.current.look}),ink:()=>s.current.ink??getComputedStyle(l).color,kit:s,reducedMotion:()=>s.current.reducedMotion,resolution:2,onFail:()=>{x=null,f.restore()},paint:({pen:t,width:e,height:n,now:a,still:l})=>{v(e,n);const c=s.current,f="text"===c.settle;if(h<0||l)return!(!m&&"visible"===c.trigger&&!l)&&(f&&h>=0||t.drawImage(g,0,0),h>=0&&S(),!1);const p=a-h,x=.3*c.duration,w=.7*c.duration,y=Math.max(2,Math.ceil(e/20)),M=Math.max(2,Math.ceil(n/20));if(d.width===y&&d.height===M||(d.width=y,d.height=M),i(d,p/1e3),t.imageSmoothingEnabled=!0,p<x)return t.drawImage(d,0,0,e,n),u&&(t.globalAlpha=1-o(p/x),t.drawImage(g,0,0),t.globalAlpha=1),!0;const b=Math.min(1,(p-x)/w),E=(1.18*b-.02)*e,k=.14*e,I=5.58,$=Math.floor(a/16);if(b>=1)return f||t.drawImage(g,0,0),S(),!1;t.drawImage(d,0,0,e,n),E>0&&t.drawImage(g,0,0,E,n,0,0,E,n);for(let e=Math.max(0,Math.floor(E/I)*I);e<E+k;e+=I){const o=(e-E)/k;for(let a=0;a<n;a+=9)r(e+13*$,a)<o||(t.globalAlpha=.35+.65*r(a+7*$,e),t.fillStyle="#000",t.fillRect(e,a,I,9),t.drawImage(g,e,a,I,9,e,a,I,9))}return t.globalAlpha=1,!0}});const S=()=>{h=-1,u="text"!==s.current.settle,u||f.restore()},w=()=>{x&&(f.set(l,"-webkit-text-fill-color","transparent"),m=!0,h=performance.now(),x.kick())};let y=!1;const M=x&&"visible"===s.current.trigger&&"function"==typeof IntersectionObserver?new IntersectionObserver(([t])=>{t.isIntersecting&&!y&&w(),y=t.isIntersecting},{threshold:.5}):null;x&&("text"!==s.current.settle&&f.set(l,"-webkit-text-fill-color","transparent"),u="text"!==s.current.settle&&"manual"===s.current.trigger,M?M.observe(l):"visible"===s.current.trigger&&w());let b=!1;const E=()=>{b||(b=!0,s.current.replayOnHover&&h<0&&w())},k=()=>{b=!1},I=t=>{!b||t.target instanceof Node&&l.contains(t.target)||(b=!1)};return x&&(l.addEventListener("pointerenter",E),l.addEventListener("pointermove",E),l.addEventListener("pointerleave",k),document.addEventListener("pointermove",I,!0)),x&&document.fonts?.ready.then(()=>{p="",x?.kick()}),n(()=>x,s,()=>{p="",x?.refresh()},{replay:w},()=>{M?.disconnect(),l.removeEventListener("pointerenter",E),l.removeEventListener("pointermove",E),l.removeEventListener("pointerleave",k),document.removeEventListener("pointermove",I,!0),f.restore()})}var c=a;export{c as DECODE_DEFAULTS,l as decode,i as driftNoise};//# sourceMappingURL=chunk-ZRJVOUWH.js.map
|