PageSourceSearch

https://freakyfontgen.org/_next/static/chunks/588.14bd776aab36ddbe.js

js freakyfontgen.org collected 2026-10-07 17:25:21 UTC 3,604 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[348,588],{7588:(e,t,l)=>{l.r(t),l.d(t,{default:()=>i});var a=l(5155),n=l(2115),o=l(4085),r=l(3348);function i({results:e}){let[t,l]=(0,n.useState)(null),[i,s]=(0,n.useState)(!1);(0,n.useEffect)(()=>{s(!0)},[]),(0,n.useEffect)(()=>{i&&null===t&&e.length>0&&l(Math.floor(Math.random()*e.length))},[t,e.length,i]);let d=(0,n.useMemo)(()=>{if(null===t||0===e.length)return"";let l=Math.min(t,e.length-1);return e[l]??""},[t,e]);return i?(0,a.jsxs)("div",{className:"flex flex-col gap-3 py-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)(o.$,{onClick:function(){if(!i||0===e.length)return;if(1===e.length){l(0);return}let a=Math.floor(Math.random()*e.length);a===t&&(a=(a+1)%e.length),l(a)},variant:"outline",className:"px-6 py-4 text-lg h-14",children:"Random"}),d&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o.$,{onClick:()=>navigator.clipboard.writeText(d),variant:"outline",className:"px-6 py-4 text-lg h-14",children:"Copy"}),(0,a.jsx)(r.default,{text:d,fileName:"freaky-font-random.png",hideOnMobile:!0,className:"px-6 py-4 text-lg h-14"})]})]}),d&&(0,a.jsx)("div",{className:"rounded-md border border-border bg-background/50 px-4 py-3 text-foreground font-mono text-lg md:text-xl",children:d})]}):(0,a.jsxs)("div",{className:"flex flex-col gap-3 py-4",children:[(0,a.jsx)("div",{className:"flex items-center gap-3",children:(0,a.jsx)(o.$,{disabled:!0,variant:"outline",className:"px-6 py-4 text-lg h-14",children:"Random"})}),(0,a.jsx)("div",{className:"text-center py-4",children:(0,a.jsx)("p",{className:"text-muted-foreground",children:"Loading random picker..."})})]})}},3348:(e,t,l)=>{l.r(t),l.d(t,{DownloadPngButton:()=>r,default:()=>i});var a=l(5155),n=l(2115),o=l(4085);function r({text:e,fileName:t="freaky-font.png",fontSize:l=128,padding:r=64,textColor:i="#ffffff",background:s="transparent",fontFamily:d="system-ui, Apple Color Emoji, Segoe UI Emoji, Noto Color Emoji, sans-serif",maxWidthPx:c,lineHeight:f=1.2,dpr:h,className:m,hideOnMobile:u=!0}){let[x,p]=(0,n.useState)(!1),g=(0,n.useCallback)(async()=>{if(e&&!x)try{p(!0);let a=document.createElement("canvas"),n=a.getContext("2d");if(!n)throw Error("Canvas not supported");let o=h??window.devicePixelRatio??1;n.font=`${l}px ${d}`,n.textBaseline="alphabetic";let m=function(e,t,l){if(!l)return[t];let a=Array.from(t),n=[],o="";for(let t of a){let a=o+t;e.measureText(a).width>l&&o?(n.push(o),o=t):o=a}return o&&n.push(o),n}(n,e,c),u=m.map(e=>n.measureText(e)),x=Math.max(...u.map(e=>e.actualBoundingBoxAscent||.8*l)),g=Math.max(...u.map(e=>e.actualBoundingBoxDescent||.2*l)),b=(x+g)*f,y=Math.max(...u.map(e=>e.width)),N=b*m.length,w=Math.ceil(y+2*r),j=Math.ceil(N+2*r);a.width=Math.max(1,Math.floor(w*o)),a.height=Math.max(1,Math.floor(j*o)),n.scale(o,o),"transparent"!==s&&(n.fillStyle=s,n.fillRect(0,0,w,j)),n.fillStyle=i,n.font=`${l}px ${d}`;let v=r+x;for(let e=0;e<m.length;e++)n.fillText(m[e],r,v),v+=b;let M=await new Promise(e=>a.toBlob(t=>e(t),"image/png"));if(!M)throw Error("Failed to create PNG blob");let k=URL.createObjectURL(M),C=document.createElement("a"),E=t||"download.png";C.href=k,C.download=E,document.body.appendChild(C),C.click(),C.remove(),URL.revokeObjectURL(k)}catch(e){console.error("PNG download failed",e)}finally{p(!1)}},[e,x,l,r,i,s,d,c,f,h,t]);return(0,a.jsx)(o.$,{type:"button",variant:"outline",onClick:g,disabled:x,className:`${u?"hidden sm:inline-flex":"inline-flex"} ${m??""}`.trim(),"aria-label":"Download as PNG",title:"Download as PNG",children:x?"Preparing...":"Download"})}let i=r}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.