MCPcopy Create free account
hub / github.com/boringstack-xyz/boringstack / buildSvg

Function buildSvg

apps/docs/scripts/generate-og-image.mjs:43–149  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

41
42function escapeXml(value) {
43 return value
44 .replaceAll("&", "&")
45 .replaceAll("<", "&lt;")
46 .replaceAll(">", "&gt;");
47}
48
49function buildSvg() {
50 return `
51<svg
52 xmlns="http://www.w3.org/2000/svg"
53 width="1200" height="630"
54 viewBox="0 0 1200 630"
55>
56 <defs>
57 <radialGradient id="bgGlowA" cx="84%" cy="22%" r="60%">
58 <stop offset="0%" stop-color="${PALETTE.accent}" stop-opacity="0.20" />
59 <stop offset="100%" stop-color="${PALETTE.accent}" stop-opacity="0" />
60 </radialGradient>
61 <radialGradient id="bgGlowB" cx="8%" cy="90%" r="50%">
62 <stop offset="0%" stop-color="${PALETTE.accentStrong}" stop-opacity="0.12" />
63 <stop offset="100%" stop-color="${PALETTE.accentStrong}" stop-opacity="0" />
64 </radialGradient>
65 <linearGradient id="cardFill" x1="0%" y1="0%" x2="0%" y2="100%">
66 <stop offset="0%" stop-color="${PALETTE.bgCard}" />
67 <stop offset="100%" stop-color="${PALETTE.bgCardEdge}" />
68 </linearGradient>
69 <linearGradient id="cardStroke" x1="0%" y1="0%" x2="100%" y2="100%">
70 <stop offset="0%" stop-color="${PALETTE.borderStrong}" stop-opacity="0.9" />
71 <stop offset="100%" stop-color="${PALETTE.border}" stop-opacity="0.6" />
72 </linearGradient>
73 </defs>
74
75 <rect width="1200" height="630" fill="${PALETTE.bgOuter}" />
76 <rect width="1200" height="630" fill="url(#bgGlowA)" />
77 <rect width="1200" height="630" fill="url(#bgGlowB)" />
78
79 <rect
80 x="40" y="40"
81 width="1120" height="550"
82 rx="22" ry="22"
83 fill="url(#cardFill)"
84 stroke="url(#cardStroke)"
85 stroke-width="1.5"
86 />
87
88 <!-- Brand row -->
89 <g transform="translate(80,128)">
90 <text
91 font-family="ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Monaco, Consolas, monospace"
92 font-size="44"
93 font-weight="700"
94 fill="${PALETTE.accent}"
95 >&gt;_</text>
96 <text
97 x="82" y="0"
98 font-family="-apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, sans-serif"
99 font-size="44"
100 font-weight="800"

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected