saladday1's picture
code: sync from git
61db3dc verified
Raw History Blame
1.8 kB
/**
* Model names set the way minimax.io sets them. `MarkLockup` is the card picture: "MiniMax" in
* Outfit over the mark in Abhaya Libre ExtraBold ("M3.1", "H3"; a word model stacks its word,
* "Speech" over "2.8"), and a trailing word in Libre Baskerville italic ("flash", "image").
* `TitleLockup` is the headline over a hero: one line of Outfit with that italic word.
*/
const split = (name: string) => {
const m = /^MiniMax-(.+?)(?:-([A-Za-z]{3,}))?$/.exec(name)
if (!m) return null
const word = /^([A-Za-z]{3,})-?([0-9.]+)$/.exec(m[1]) // Music3, Text-01
return { token: m[1], word: word?.[1], mark: word ? word[2] : m[1], tail: m[2]?.toLowerCase() }
}
export function MarkLockup({ name }: { name: string }) {
const p = split(name)
if (!p) return <span className="text-center font-numeral text-[44px] leading-[0.9] font-extrabold">{name}</span>
return (
<span role="img" aria-label={name} className="flex flex-col items-center text-center">
<span aria-hidden className="font-display text-[24px] leading-none font-semibold tracking-[-0.01em]">MiniMax</span>
{p.word && <span aria-hidden className="mt-1 font-numeral text-[34px] leading-[0.9] font-extrabold">{p.word}</span>}
<span aria-hidden className={`font-numeral leading-[0.82] font-extrabold tracking-[-0.01em] ${p.mark.length > 4 ? "text-[62px]" : "text-[80px]"}`}>{p.mark}</span>
{p.tail && <span aria-hidden className="-mt-1 font-serif text-[30px] leading-none italic">{p.tail}</span>}
</span>
)
}
export function TitleLockup({ name }: { name: string }) {
const p = split(name)
if (!p) return <>{name}</>
return (
<>
MiniMax {p.token}
{p.tail && <span className="ml-[0.18em] font-serif font-normal italic tracking-[-0.02em]">{p.tail}</span>}
</>
)
}