Build an interactive "Grand Strategy Nation Creator" web app...
Prompt
Build an interactive "Grand Strategy Nation Creator" web app inspired by Hearts of Iron IV (HoI4) in a single self-contained HTML/React file. Visual Style & Layout: - Design an authentic mid-20th-century grand-strategy dossier UI: dark slate/gunmetal panels, subtle brushed-brass borders, crisp condensed headers, and rich tooltips on hover. - Include a live top resource bar that dynamically updates based on the player's choices: Political Power (+/day), Stability (%), War Support (%), Manpower, Civilian/Military Factories, and Command Power. Core Features to Build: 1. Procedural Leader Portrait & Profile ("Oil-Painted Dossier" SVG/Canvas): - Render a detailed, stylized procedural SVG/Canvas leader portrait inside an ornate brass frame with painterly shading and lighting. - Provide customization controls AND a "Randomize Portrait" button for: face structure, skin tone, hair & facial hair, eyewear (monocle, round glasses, none), headwear (officer peaked cap, beret, royal crown, bareheaded), attire (general uniform with medals/epaulettes, statesman suit, revolutionary tunic), and portrait backdrop. - Allow editing the Leader's Name, Title, and selecting 2–3 Leader Traits (e.g., Silent Workhorse, Captain of Industry, Stout Defender, Compassionate Gentleman, University Rector) that apply real green/red stat modifiers to the nation. 2. Dynamic Flag Designer & Ideology Variants: - Interactive SVG flag canvas (3:2 ratio) with selectable divisions (Horizontal/Vertical Tricolor, Nordic Cross, Saltire, Canton, Chevron, Sunburst), custom color pickers, and central vector emblems (star, eagle, gear & wheat, crown, anchor, sun, shield). - Include a "Waving Flag" toggle and automatic Ideology Flag Variants so switching the ruling ideology subtly adapts the flag's emblem or color palette. 3. Ideology Wheel & Party Popularity Pie Chart: - Interactive SVG pie chart displaying national popularity across 4 ideologies (Democratic, Syndicalist, Monarchist / Non-Aligned, and Technocratic) with linked sliders that automatically balance to 100%. - Changing the ruling party updates the party name, diplomatic rules, and national modifiers. 4. National Spirits & One-Click Generator: - Include 3 National Spirit slots with custom SVG badge icons, lore descriptions, and gameplay modifiers (e.g., "+10% Factory Output", "-5% Consumer Goods", "+15% Defense on Core Territory"). - "Randomize Entire Nation" button: Generates a cohesive fictional country name, capital city, custom flag, matching leader portrait, ruling party, and balanced stats in one click. - Working "Export Dossier Card (PNG)" and "Export Nation Data (JSON)" buttons. Make every control, tooltip, and stat calculation genuinely functional with zero placeholder buttons.
A system prompt was added to support web rendering
Response not available