SPB Git
870 B · 13 lines tsx
1/** Deterministic monogram used instead of third-party logos (avoids trademark/logo redistribution). */2export function LogoMark({ name, size = 40, className = "" }: { name: string; size?: number; className?: string }) {3  const initials = name.replace(/[^\p{L}\p{N} ]/gu, "").split(/\s+/).filter(Boolean).slice(0, 2).map((w) => w[0]!.toUpperCase()).join("") || "?";4  let h = 0; for (const c of name) h = (h * 31 + c.charCodeAt(0)) >>> 0;5  const hue = h % 360;6  return (7    <span aria-hidden className={`inline-flex shrink-0 items-center justify-center rounded-xl font-semibold ${className}`}8      style={{ width: size, height: size, fontSize: size * 0.38, background: `linear-gradient(135deg, oklch(0.92 0.05 ${hue}) 0%, oklch(0.82 0.1 ${(hue + 40) % 360}) 100%)`, color: `oklch(0.32 0.08 ${hue})`, letterSpacing: "-0.02em" }}>9      {initials}10    </span>11  );12}13
Files · laptop-initial-20261102
Menu

Theme