2 lines
1.2 KiB
JavaScript
2 lines
1.2 KiB
JavaScript
import{c as x}from"./Cu5ilWky.js";function d(s,o){return s?s.split(" ").map(t=>t[0]).join("").toUpperCase().slice(0,2):o.slice(0,2).toUpperCase()}function y(s,o){let t=0;for(let e=0;e<s.length;e++)t=(t<<5)-t+s.charCodeAt(e)|0;const i=Math.abs(t%360),r=(i+40+Math.abs((t>>8)%40))%360,c=55+Math.abs((t>>4)%25),a=45+Math.abs((t>>12)%15),h=`hsl(${i}, ${c}%, ${a}%)`,f=`hsl(${r}, ${c}%, ${a+10}%)`,l=[];for(let e=0;e<5;e++){const n=Math.abs((t>>e*5)%32),p=20+n%5*15,$=20+Math.floor(n/5)*15,g=8+n%12,u=.08+n%4*.04;l.push(`<circle cx="${p}" cy="${$}" r="${g}" fill="white" opacity="${u}"/>`)}return`data:image/svg+xml,${encodeURIComponent(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><linearGradient id="g" x1="0%" y1="0%" x2="100%" y2="100%"><stop offset="0%" stop-color="${h}"/><stop offset="100%" stop-color="${f}"/></linearGradient></defs><rect width="100" height="100" fill="url(#g)"/>${l.join("")}<text x="50" y="50" text-anchor="middle" dominant-baseline="central" font-family="system-ui,sans-serif" font-size="38" font-weight="600" fill="white" opacity="0.9">${o}</text></svg>`)}`}function w(s,o,t,i){if(s)return s.startsWith("http")?s:`${x.serverUrl}${s}`;const r=d(t,i);return y(o??i,r)}export{w as r};
|