- commit
- 44e818cac04952b2bec7ba817e5e0b75d88d59e5
- parent
- 1fac86972be2af043d6a5e7cb85d32902af08a67
- author
- Dami <dami.etoile@gmail.com>
| M | src/ | 12 | +++++++----- |
@@ -116,14 +116,15 @@ export function cardSVG(c: Card): string {
116116 const e = escapeHTML;117117 const title = wrap(c.name, 22, 1)[0] ?? c.name;118118 let lines: string[];119- let facts: string;119+ // The facts sit left of the QR plate, so two short lines rather than one long one.120+ let facts: string[];120121 if (c.state === "unclaimed") {121122 lines = ["Nobody owns this relay yet.", "Claim it with one signature."];122- facts = "unclaimed";123+ facts = ["unclaimed"];123124 } else if (c.state === "leased") {124125 const day = c.expires_at ? new Date(c.expires_at * 1000).toISOString().slice(0, 10) : "";125126 lines = ["A temporary relay, open to everyone", `until ${day}. Claim it to keep it.`];126- facts = "temporary";127+ facts = ["temporary"];127128 } else {128129 lines = wrap(c.description || "A nostr relay on bind.ws.", 46, 2);129130 const parts = [@@ -132,7 +133,7 @@ export function cardSVG(c: Card): string {
132133 c.reads === "open" ? "anyone reads" : c.reads === "auth" ? "sign in to read" : "members read",133134 c.fuel === "out" ? "out of fuel" : c.fuel === "burning" ? "burning sats" : "on free allowance",134135 ].filter(Boolean);135- facts = parts.join(" | ");136+ facts = [parts.slice(0, 2).join(" | "), parts.slice(2).join(" | ")].filter(Boolean);136137 }137138 const qr = c.naddr ? qrEncode(c.naddr) : null;138139 let qrSVGInner = "";@@ -150,7 +151,8 @@ export function cardSVG(c: Card): string {
150151 <text x="58" y="50" font-family="${sans}" font-weight="700" font-size="30" fill="${ink}">${e(title)}</text>151152 <text x="40" y="96" font-family="${sans}" font-size="17" fill="${ink2}">${e(lines[0] ?? "")}</text>152153 <text x="40" y="120" font-family="${sans}" font-size="17" fill="${ink2}">${e(lines[1] ?? "")}</text>153-<text x="40" y="176" font-family="${mono}" font-size="13" fill="${forest}">${e(facts)}</text>154+<text x="40" y="170" font-family="${mono}" font-size="13" fill="${forest}">${e(facts[0] ?? "")}</text>155+<text x="40" y="192" font-family="${mono}" font-size="13" fill="${forest}">${e(facts[1] ?? "")}</text>154156 <text x="40" y="262" font-family="${mono}" font-size="15" fill="${ink}">${e(c.url)}</text>155157 <text x="40" y="286" font-family="${sans}" font-size="12" fill="${ink2}">a bind.ws relay</text>156158 ${qrSVGInner}