// Flat, 2D artwork drawn as inline SVG. No gradients, no filters.
import { raw } from 'hono/html';
export const SPROUT_PATH = 'M230 460 V386 C230 358 140 344 102 240 C180 234 230 268 230 310 V292 C230 172 318 86 446 70 C440 196 350 262 296 284 C276 292 270 302 270 324 V460 A20 20 0 0 1 230 460Z';
export const sprout = (size = 28, color = 'currentColor', cls = '') =>
raw(``);
const ICONS: Record = {
leaf: '',
'leaf-filled': '',
star: '',
download: '',
replant: '',
search: '',
external: '',
copy: '',
send: '',
help: '',
check: '',
flag: '',
seed: '',
shield: '',
fork: '',
clock: '',
file: '',
plug: '',
menu: '',
share: '',
comment: '',
lock: '',
};
// Social marks, the same ones the other sites use.
const BRAND: Record = {
x: '',
linkedin: '',
youtube: '',
instagram: '',
reddit: '',
substack: '',
makerworld: '',
};
export function icon(name: string, size = 18, cls = '') {
if (BRAND[name]) return raw(``);
const body = ICONS[name] ?? '';
return raw(``);
}
// ---------------------------------------------------------------------------
// Illustration system. Everything below is built from four primitives on a
// fixed grid: the logo sprout, a two-arc leaf, circles and rounded rectangles.
// Flat fills only, at most two tones per glyph.
// ---------------------------------------------------------------------------
const n = (v: number) => Math.round(v * 100) / 100;
/** A leaf: two equal arcs between two points. `slim` > 0.71 makes it narrower. */
function leaf(ax: number, ay: number, bx: number, by: number, slim = 0.76) {
const r = n(Math.hypot(bx - ax, by - ay) * slim);
return `M${n(ax)} ${n(ay)}A${r} ${r} 0 0 1 ${n(bx)} ${n(by)}A${r} ${r} 0 0 1 ${n(ax)} ${n(ay)}Z`;
}
/** The logo sprout, centred on (cx, cy) and `h` units tall. */
function sproutGlyph(cx: number, cy: number, h: number, color: string) {
const k = n(h / 410);
return ``;
}
/** The Skillfarm mark as an app icon: cream sprout on a sage rounded square. */
export function brandMark(size = 32, cls = '') {
return raw(``);
}
/** Homepage art: farm plots seen from above, each one a skill. */
export function heroScene() {
const pill = (x: number, y: number, label: string) => {
const w = 30 + label.length * 7.6;
return `${label}`;
};
const tree = (x: number, y: number, r: number) => ``;
return raw(``);
}
/** One shallow hill between two flat colour fields. */
export function hillEdge(fill: string, flip = false) {
return raw(``);
}
// Tier badges: one round seal per tier, one glyph each, drawn on a 64 grid.
const stem = (top: number, bottom: number, color: string) => ``;
const pair = (y: number, dx: number, dy: number, color: string, slim = 0.76) =>
``;
const TIER_ART: Record = {
seedling: { tint: '#E4EFD3', ink: '#5A8A4A', glyph: sproutGlyph(32, 32.500, 30, '#5A8A4A') },
grower: {
tint: '#CFE2B8', ink: '#3F6B34',
glyph: `${stem(20, 50, '#3F6B34')}${pair(44, 13, 9, '#3F6B34')}${pair(33, 11, 8, '#3F6B34')}`,
},
farmer: {
tint: '#FBE7B2', ink: '#9A5F10',
glyph: ``,
},
harvester: {
tint: '#F8D5C4', ink: '#B5471F',
glyph: `${stem(24, 52, '#B5471F')}${pair(47, 9, 8, '#B5471F', 0.9)}${pair(39, 9, 8, '#B5471F', 0.9)}${pair(31, 9, 8, '#B5471F', 0.9)}`,
},
homesteader: {
tint: '#EAD3C3', ink: '#6E2F1B',
glyph: ``,
},
'blue-ribbon': {
tint: '#D5E3F4', ink: '#2F5C94',
glyph: `${Array.from({ length: 12 }, (_, i) => ``).join('')}${sproutGlyph(32, 26, 9.500, '#2F5C94')}`,
},
};
export function tierArt(key: string, size = 40) {
const t = TIER_ART[key] ?? TIER_ART.seedling;
return raw(``);
}
const AVATAR_TINTS = [
['#CFE2B8', '#3F6B34'], ['#FBE7B2', '#8C4A2F'], ['#F8D5C4', '#8C3B22'], ['#D5E3F4', '#2F5C94'], ['#DDEBE3', '#3F6B34'], ['#EAD3C3', '#6E2F1B'],
];
/** Default avatar: a sprout on a flat tint chosen from the member id. */
export function defaultAvatar(seed: string, size: number) {
let h = 0;
for (let i = 0; i < seed.length; i++) h = (h * 31 + seed.charCodeAt(i)) >>> 0;
const [bg, fg] = AVATAR_TINTS[h % AVATAR_TINTS.length];
return raw(``);
}
const drop = (x: number, y: number, color: string) =>
``;
/** Spot icons: a rounded-square tile with one glyph, on a 72 grid. */
export function spot(name: 'plant' | 'tend' | 'harvest' | 'empty' | 'mcp' | 'news' | 'coffee') {
const ground = (color: string) => ``;
const art: Record = {
plant: `${ground('#8C5A3C')}`,
tend: `${ground('#8C5A3C')}${sproutGlyph(36, 39, 24, '#5A8A4A')}${drop(18, 26, '#3F74B5')}${drop(54, 26, '#3F74B5')}${drop(36, 16, '#3F74B5')}`,
harvest: ``,
empty: ``,
news: ``,
coffee: ``,
mcp: ``,
};
return raw(``);
}