glyph
func(c uint8) stringglyph returns the stroke encoding for one character, or "" for anything unknown — an unknown character draws nothing rather than a box, because this markup lands inside a token that other people's software renders and a missing letter is better than a wrong one.
- OID
- 0cbe92…66c1:3
glyph details
glyphW
untyped bigint// grid width of one glyph
Value
(10 <untyped> bigint)
glyphH
untyped bigint// grid height, top to bottom
Value
(14 <untyped> bigint)
glyphAd
untyped bigint// advance: glyph width plus the gap to the next one
Value
(12 <untyped> bigint)
hexish
func(c uint8) inthexish decodes one coordinate character. Digits are themselves; a..d carry 10..13, which is the only reason y can exceed nine in two characters.
- OID
- 0cbe92…66c1:5
hexish details
MarkerText
func(s string, x int, y int, size int, colour string, weight int) stringMarkerText draws a line of text as stroked paths. \`size\` is the CAP HEIGHT in user units, not an em size: it is the height of a capital letter, which is the measurement anybody positioning this by eye is actually thinking in. \`x\` is the left edge and \`y\` is the TOP of the capitals, matching how the rest of this file positions things and unlike SVG's own text baseline, which is a trap when mixing the two. The jitter is what makes it read as a pen rather than a plotter. It is derived from the character and its position, so it is stable: the same string renders identically on every read, which matters because these cards are regenerated constantly and a letter that wobbled between reads would look like a rendering fault.
- OID
- 0cbe92…66c1:6
MarkerText details
strokes
func(enc string, ox int, oy int, size int, idx int) stringstrokes turns one glyph's encoding into path elements at a position.
- OID
- 0cbe92…66c1:7
strokes details
wobble
func(seed int) intwobble is a tiny deterministic offset in the range -1..1. Not random: the cards are regenerated on every read, and anything genuinely random would make the lettering shimmer.
- OID
- 0cbe92…66c1:8
wobble details
MarkerWidth
func(s string, size int) intMarkerWidth is what MarkerText will occupy, so a caller can centre it. Counts every character including the ones that draw nothing, because a space still advances.
- OID
- 0cbe92…66c1:9
MarkerWidth details
MarkerCentred
func(s string, cx int, y int, size int, colour string, weight int) stringMarkerCentred draws text centred on cx, which is what almost every caller here wants and what the SVG text-anchor attribute would have done for them if a font had been available.
- OID
- 0cbe92…66c1:10
MarkerCentred details
keyFX
untyped stringSeasonal decoration, driven by DATA rather than by code. The card is generated on every read, so anything it draws can change after names have been sold. That makes a holiday overlay possible — snow in December, falling leaves in October — across every token at once. The temptation is to write a drawSnow() into this realm and a drawPumpkins() next year, which would make every new decoration a redeploy of the view. So it is parameterised instead. This realm knows how to draw drifting particles; WHICH particles, what colour, how many and until when live in a global that any admin call can rewrite. Christmas is then one transaction, not a deployment, and so is turning it off. Format, read from the global key \`cardfx\`: dir:fall;n:22;c:#ffffff;c2:#dbeafe;s:3;d:9;until:1767225600 dir fall | rise | burst drift down, drift up, or fireworks n 1..40 how many c #rrggbb colour (c2, c3 optional, cycled) s 1..6 pixel size d 2..30 seconds for one traverse (lower = faster) sv 0..3 size jitter, so they are not all identical k 4..16 sparks per shell, when dir is burst sh sq | leaf | petal particle shape; leaf and petal are angled until unix seconds, 0 = no expiry \`until\` matters more than it looks: an overlay that expires on its own cannot be forgotten in January. Everything is parsed defensively and a malformed value yields NO overlay, for the same reason the sprite parser does — this markup lands inside a token that other people's software renders.
Value
"cardfx"
overlaySVG
func(now int64) string- OID
- 0cbe92…66c1:11
overlaySVG details
pickRule
func(spec string, now int64) stringA SCHEDULE, so December snows without anybody remembering to make it. This is free in a way the treasury swap was not. That needed somebody to send a transaction, because a realm cannot act on its own. This needs nobody, because the card is generated on every read and can simply look at the clock — the decoration is a rendering decision, not an action. Rules are separated by "|" and the FIRST one whose window contains today wins, so put the specific ones first: from:12-01;to:01-06;dir:fall;n:26;c:#ffffff|from:10-24;to:11-02;dir:rise;n:22;c:#f97316 from/to are MM-DD and RECUR every year, which is the point — set it once and every December snows. A window whose start is after its end wraps the new year, so 12-01 to 01-06 is what you would expect rather than an empty range. A rule with no window is always eligible, so a bare spec still behaves as it did.
- OID
- 0cbe92…66c1:13
pickRule details
ruleField
func(rule string, key string) string- OID
- 0cbe92…66c1:14
ruleField details
mmdd
func(s string) (int, bool)mmdd reads "12-01" into 1201. Rejects anything that is not a real calendar date, so a typo cannot silently make a rule match all year.
- OID
- 0cbe92…66c1:15
mmdd details
buildOverlay
func(spec string, now int64) string- OID
- 0cbe92…66c1:16
buildOverlay details
hash
func(i int) intA small deterministic spread. Not random: the same index must always give the same particle, or a cached render and a fresh one disagree.
- OID
- 0cbe92…66c1:17
hash details
atoiClamp
func(s string, lo int, hi int) int- OID
- 0cbe92…66c1:18
atoiClamp details
fireworks
func(shells int, sparks int, size int, dur int, cols []string) stringFireworks: a shell climbs, vanishes, and throws sparks outward. The cost question is worth answering plainly, because it is the first decoration that is not one rect per particle. A shell is 1 rect for the climb plus k rects for the burst, so \`n:5;k:10\` is 55 rects — the same order as the 34 the rain already draws, and a fifth of the 128 the domain sprite draws on every card anyway. None of it is stored: the card is built during a read, so this costs no gas and no storage, only the browser's time. That is the real ceiling, so the totals are capped below rather than left to whoever writes the spec. Two phases in one loop, driven by keyTimes on a single animation each, because a \<set> chain or nested \<g> would double the element count for the same picture.
- OID
- 0cbe92…66c1:19
fireworks details
dirCos
[16]intSixteen directions on a circle, as hundredths. A table rather than math.Sin: the same integers must come out on every node, and this is the whole of the trigonometry the card needs.
- OID
- 0cbe92…66c1:21
dirCos details
dirSin
[16]intSixteen directions on a circle, as hundredths. A table rather than math.Sin: the same integers must come out on every node, and this is the whole of the trigonometry the card needs.
- OID
- 0cbe92…66c1:23
dirSin details
shapeAt
func(kind string, x int, y int, px int, ang int, col string) stringshapeAt draws one non-square particle at a position, turned to its own angle. Leaves and petals are two curves each rather than a polygon: a leaf is pointed at both ends, a petal is round at one, and that single difference is the whole of what distinguishes October from April. The numbers are derived from the particle size so \`s\` still means what it means everywhere else, and both shapes stay legible at the size a card is actually looked at.
- OID
- 0cbe92…66c1:24
shapeAt details
weekdayMatch
func(spec string, t time.Time) boolweekdayMatch reads "fri" or "fri-13": a weekday, optionally pinned to a day of the month. Anything it does not understand matches nothing, so a typo disables its own rule rather than firing every day.
- OID
- 0cbe92…66c1:25
weekdayMatch details
keyDisplayName
untyped stringProfile keys inside a name's extension slot. Conventions owned by this realm and the logic realm, not by the vault — the vault stores strings and has no opinion about what they mean.
Value
"displayName"
keyBio
untyped stringProfile keys inside a name's extension slot. Conventions owned by this realm and the logic realm, not by the vault — the vault stores strings and has no opinion about what they mean.
Value
"bio"
keyWebsite
untyped stringProfile keys inside a name's extension slot. Conventions owned by this realm and the logic realm, not by the vault — the vault stores strings and has no opinion about what they mean.
Value
"website"
Render
func(path string) string- OID
- 0cbe92…66c1:26
Render details
renderHome
func() string- OID
- 0cbe92…66c1:28
renderHome details
renderDomain
func(domainLabel string) string- OID
- 0cbe92…66c1:29
renderDomain details
renderName
func(label string, domainLabel string) string- OID
- 0cbe92…66c1:30
renderName details
splitCSV
func(s string) []string- OID
- 0cbe92…66c1:31
splitCSV details
splitTokenID
func(tid string) (label string, domain string)splitTokenID splits \`label\*domain\`; a leading "\*" yields an empty label, which is how a domain page is addressed.
- OID
- 0cbe92…66c1:32
splitTokenID details
escapeMarkdown
func(s string) stringescapeMarkdown neutralises user-authored text so it renders as the literal characters typed rather than as markup. Backslash-escapes the CommonMark ASCII punctuation set and folds newlines, which stops headings, lists, tables, images, links, and raw HTML alike.
- OID
- 0cbe92…66c1:33
escapeMarkdown details
isSafeURL
func(u string) boolisSafeURL only admits plain http/https. Everything else — javascript:, data:, anything unrecognised — is refused a live link. Checked on read rather than on write so tightening the rule later also applies to profiles that already exist.
- OID
- 0cbe92…66c1:34
isSafeURL details
skinFor
func(now int64) stringskinFor returns the skin named by whichever calendar rule is active today, or "" for the ordinary card. Reusing pickRule means a skin obeys the same window rules, the same first-match-wins ordering and the same year wrapping as every other season.
- OID
- 0cbe92…66c1:35
skinFor details
skinFromSpec
func(spec string, now int64) stringSplit out so the calendar logic can be tested against a spec directly, without standing up a vault to hold one.
- OID
- 0cbe92…66c1:37
skinFromSpec details
hasSkin
func(name string) boolhasSkin reports whether a name is renderable as this skin. Unknown names render nothing rather than a broken card — the same defensive stance the overlay parser takes, and for the same reason: this markup lands inside a token that other people's software renders.
- OID
- 0cbe92…66c1:38
hasSkin details
seedOf
func(tid string) intseedOf turns a token id into a small number, so that a card can differ from the one beside it without any randomness — which a deterministic machine does not have. Every node computes the same answer for the same name, which is the requirement; looking arbitrary is merely the effect.
- OID
- 0cbe92…66c1:39
seedOf details
skinSVG
func(name string, tid string, now int64) stringskinSVG renders a complete 400x400 card. Same frame as the ordinary one, so nothing downstream has to know which it received.
- OID
- 0cbe92…66c1:40
skinSVG details
head
func(bg string) string- OID
- 0cbe92…66c1:41
head details
foot
func() string- OID
- 0cbe92…66c1:42
foot details
skinPizza
func(label string, size int, seed int) string\---------------- 22 May: the pizza ---------------- \* \* Eight wedges with a gap between them, so it reads as CUT rather than \* merely divided, and each wedge carries its own toppings inside its own \* group — that is what makes a slice leave with its pepperoni still on \* it instead of leaving them floating over the board. \* \* EVERY NAME EATS IN ITS OWN ORDER. The seed decides which slice goes \* first and how long each one waits, so a marketplace full of these is a \* room full of pizzas being eaten from different sides at different \* rates rather than one animation repeated. It is derived from the token \* id, so it is the same on every node and different for every name.
- OID
- 0cbe92…66c1:43
skinPizza details
wedge
func(cx int, cy int, r float64, a0 float64, a1 float64, fill string) string- OID
- 0cbe92…66c1:44
wedge details
polar
func(cx int, cy int, r float64, deg float64) (int, int)Degrees clockwise from twelve o'clock, which is how a pizza is cut. Integer maths throughout: a realm has no floating point worth trusting across nodes, and a pizza does not need sub-pixel accuracy.
- OID
- 0cbe92…66c1:45
polar details
sinApprox
func(x float64) float64- OID
- 0cbe92…66c1:46
sinApprox details
cosApprox
func(x float64) float64- OID
- 0cbe92…66c1:47
cosApprox details
skinPaper
func(label string, size int, now int64) string\---------------- 3 Jan: the front page ----------------
- OID
- 0cbe92…66c1:48
skinPaper details
skinCal
func(label string, size int) string\---------------- 29 Feb: the calendar page ----------------
- OID
- 0cbe92…66c1:49
skinCal details
skinFog
func(label string, size int) string\---------------- 20 Apr: the fog ----------------
- OID
- 0cbe92…66c1:50
skinFog details
skinSlash
func(label string, size int) string\---------------- Friday 13th: the poster ----------------
- OID
- 0cbe92…66c1:51
skinSlash details
skinPi
func(label string, size int) string\---------------- 14 Mar: pi ----------------
- OID
- 0cbe92…66c1:52
skinPi details
skinHeart
func(label string, size int) string\---------------- 14 Feb: the heart ---------------- \* \* A real double thump, not one pulse: squeeze, small recoil, second \* smaller squeeze, then a long rest. The rest is most of what makes it \* read as a heartbeat rather than a throb.
- OID
- 0cbe92…66c1:53
skinHeart details
esc
func(s string) stringMarkup safety, same as everywhere else that puts a name into SVG: a label is validated on registration, but this is the last gate before it lands inside somebody else's renderer.
- OID
- 0cbe92…66c1:54
esc details
TokenURI
func(tid string) stringTokenURI returns the full data: URI for a token, generated on every read so the image always reflects current state (never baked at mint).
- OID
- 0cbe92…66c1:55
TokenURI details
BuildSVG
func(tid string) stringBuildSVG renders a token. Everything on the card derives from four stored values — owner, registered, expires, and the domain's drawing — so a renewal moves \`expires\` and the bar, the time remaining and the years held all follow from it. Nothing is baked at mint: the card is generated on every read, which is what lets a domain's artwork be changed after its names have been sold.
- OID
- 0cbe92…66c1:57
BuildSVG details
cardSVG
func(tid string, art string, registered int64, expires int64, streak int64, frozen bool, now int64, overlay string) stringcardSVG is the card itself, with every stored value already resolved. Split out from BuildSVG so the markup can be rendered — and asserted against — without a vault under it. TestStaticFrameShowsTheDate is the reason: what a marketplace shows as a still is a property of this string and of nothing else, and it deserves to be checked rather than assumed.
- OID
- 0cbe92…66c1:58
cardSVG details
fitSize
func(s string) intfitSize solves for a size rather than stepping through a ladder. Monospace glyphs are ~0.6em, so a name up to the full 32-character limit sets on one line without overflowing 336px.
- OID
- 0cbe92…66c1:59
fitSize details
domainAccent
func(domainLabel string) stringdomainAccent reads the accent out of the domain's stored drawing, so the card wears the domain's own colour without this realm carrying a palette of its own. Falls back to the house colour.
- OID
- 0cbe92…66c1:60
domainAccent details
accentOf
func(enc string) string- OID
- 0cbe92…66c1:61
accentOf details
remaining
func(expires int64, now int64) string- OID
- 0cbe92…66c1:62
remaining details
keyArt
untyped stringkeyArt is the per-domain extension key holding the drawing. The value is "A#facc15,B#7c2d12|............|....AAAA....|..." — the palette, then twelve rows of twelve characters where '.' is transparent. PARSED DEFENSIVELY AND NEVER TRUSTED. It is written by whichever logic realm is current, so a future one could store something malformed; anything unexpected yields no sprite rather than broken markup inside a token that a marketplace will render.
Value
"art"
spriteSVG
func(enc string, px int, ox int, oy int, opacity string) string- OID
- 0cbe92…66c1:63
spriteSVG details
isHexColour
func(s string) bool- OID
- 0cbe92…66c1:64
isHexColour details
placeholderSVG
func(msg string) string- OID
- 0cbe92…66c1:65
placeholderSVG details
daySeconds
int64statusFields formats a lifecycle state for display. Reads the grace period from nsdata rather than hardcoding it, so retuning the lifecycle is a config change and this stays correct. All lifecycle times are unix seconds, so this is integer arithmetic over a day constant rather than duration division.
Value
86400
statusFields
func(expires int64, frozen bool) (status string, edge string)- OID
- 0cbe92…66c1:66
statusFields details
escapeXML
func(s string) string- OID
- 0cbe92…66c1:67