diff --git a/src/components/awards/ribbonDesign/RibbonArt.tsx b/src/components/awards/ribbonDesign/RibbonArt.tsx index 76b8726f..1cb45ecf 100644 --- a/src/components/awards/ribbonDesign/RibbonArt.tsx +++ b/src/components/awards/ribbonDesign/RibbonArt.tsx @@ -14,6 +14,7 @@ * - `computeDeviceSlots(...)` lays the devices out as one centered cluster on * the ribbon face, evenly spaced and shrunk to fit narrow ribbons. */ +import type { ReactNode } from "react"; import { RIBBON_CONSTANTS, DEFAULT_RIBBON } from "./constants"; import type { DeviceType, RibbonDesign } from "./types"; @@ -88,22 +89,53 @@ export function computeDeviceSlots( const DEVICE_SHAPES: Record = { star: "M50 2 L60.6 35.4 L95.7 35.2 L67.1 55.6 L78.2 88.8 L50 68 L21.8 88.8 L32.9 55.6 L4.3 35.2 L39.4 35.4 Z", oakLeaf: - "M50 94 C36 84 28 70 28 54 C28 40 34 26 50 6 C66 26 72 40 72 54 C72 70 64 84 50 94 Z M50 18 L50 84", - arrowUp: "M50 4 L88 44 L66 44 L66 96 L34 96 L34 44 L12 44 Z", + "M50 88 Q68 90 80 80 Q72 74 64 72 Q86 70 92 52 Q78 50 66 50 Q84 40 80 22 Q70 26 60 30 Q56 18 50 4 Q44 18 40 30 Q30 26 20 22 Q16 40 34 50 Q22 50 8 52 Q14 70 32 72 Q24 74 20 80 Q32 90 50 88 Z", + valor: "M10 12 L30 12 L50 66 L70 12 L90 12 L56 92 L44 92 Z", campaignClasp: "M12 32 L88 32 L88 68 L12 68 Z", }; +const BRASS_OUTLINE = "#3b2208"; + +/** + * Brass device body shared by every device type. Built for legibility at + * ribbon scale (~24px): a brass gradient with a dark outline carries the + * silhouette. Offset highlight/shadow layers blur together when small, so the + * emboss is expressed through the gradient and outline instead. The gradient + * id is static: every instance defines the identical gradient, so duplicates + * are harmless, and RibbonArt stays hook-free for server components. + */ +function BrassShape({ d, children }: { d: string; children?: ReactNode }) { + return ( + + + + + + + + + + {children} + + ); +} + function DeviceShape({ type }: { type: DeviceType }) { - const d = DEVICE_SHAPES[type]; + const d = DEVICE_SHAPES[type] ?? DEVICE_SHAPES.star; if (type === "oakLeaf") { - // Filled silhouette plus a central vein stroke for readability. + // Leaf rotated and given an engraved midrib plus a brass stem at the + // bottom right, so it reads as a sprig rather than a flat blob. return ( - - + + + + + + ); } - return ; + return ; } /** diff --git a/src/components/awards/ribbonDesign/constants.ts b/src/components/awards/ribbonDesign/constants.ts index 150b507b..c4785286 100644 --- a/src/components/awards/ribbonDesign/constants.ts +++ b/src/components/awards/ribbonDesign/constants.ts @@ -40,7 +40,7 @@ export const MILITARY_COLORS: { name: string; hex: string }[] = [ export const RIBBON_DEVICE_INFO: Record = { star: { label: "Star", symbol: "\u2605" }, oakLeaf: { label: "Oak Leaf", symbol: "\u{1F333}" }, - arrowUp: { label: "Arrow", symbol: "\u2191" }, + valor: { label: "Valor (V)", symbol: "V" }, campaignClasp: { label: "Clasp", symbol: "\u2015" }, }; diff --git a/src/components/awards/ribbonDesign/types.ts b/src/components/awards/ribbonDesign/types.ts index b60c2c56..f1d03ef2 100644 --- a/src/components/awards/ribbonDesign/types.ts +++ b/src/components/awards/ribbonDesign/types.ts @@ -1,6 +1,6 @@ // ─── Types ────────────────────────────────────────────────────────── -export type DeviceType = "star" | "oakLeaf" | "arrowUp" | "campaignClasp"; +export type DeviceType = "star" | "oakLeaf" | "valor" | "campaignClasp"; export type Device = { id: string; diff --git a/src/lib/awards/ribbonValidation.ts b/src/lib/awards/ribbonValidation.ts index 1ef5d52c..1279fde5 100644 --- a/src/lib/awards/ribbonValidation.ts +++ b/src/lib/awards/ribbonValidation.ts @@ -43,7 +43,7 @@ export function validateRibbonDesign(design: unknown): RibbonValidationResult { return { ok: false, error: "Must have at most 6 devices" }; } - const validDeviceTypes = ["star", "oakLeaf", "arrowUp", "campaignClasp"]; + const validDeviceTypes = ["star", "oakLeaf", "valor", "campaignClasp"]; for (let i = 0; i < devices.length; i++) { const device = devices[i]; if (!device || typeof device !== "object") {