feat: Phase 2 frontend shell

Sidebar with collapsible nav, dark/light theme tokens, and
localStorage-backed state for collapse/theme/active view.
Chaos factor UI is display-only pending Phase 3 backend wiring.
This commit is contained in:
claudecode
2026-06-30 22:39:34 -04:00
parent 3bcd5bc694
commit 2faa168847
3 changed files with 535 additions and 1 deletions
+132
View File
@@ -12,7 +12,139 @@
<link rel="stylesheet" href="css/styles.css">
</head>
<body>
<div class="app">
<aside class="sidebar" id="sidebar">
<div class="sidebar-header">
<div class="sidebar-brand">
<svg class="sidebar-logo" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<path d="M12 3l1.8 4.6L18 9l-4.2 1.4L12 15l-1.8-4.6L6 9l4.2-1.4L12 3z"/>
</svg>
<span class="sidebar-title">Mythic Oracle</span>
</div>
<button class="sidebar-collapse-toggle" id="collapseToggle" aria-label="Collapse sidebar">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<path d="M15 6l-6 6 6 6"/>
</svg>
</button>
</div>
<nav class="sidebar-nav">
<div class="nav-section">
<div class="nav-section-label">Oracle</div>
<button class="nav-item active" data-view="oracle">
<svg class="nav-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<circle cx="12" cy="11" r="7"/>
<path d="M6 20h12"/>
</svg>
<span class="nav-label">Oracle</span>
</button>
<button class="nav-item" data-view="meaning">
<svg class="nav-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<path d="M4 4h16v12H8l-4 4V4z"/>
</svg>
<span class="nav-label">Meaning</span>
</button>
<button class="nav-item" data-view="une">
<svg class="nav-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<path d="M4 6h16M4 12h16M4 18h10"/>
</svg>
<span class="nav-label">UNE</span>
</button>
</div>
<div class="nav-section">
<div class="nav-section-label">Tools</div>
<button class="nav-item" data-view="dice">
<svg class="nav-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<rect x="4" y="4" width="16" height="16" rx="3"/>
<circle cx="8.5" cy="8.5" r="0.75" fill="currentColor" stroke="none"/>
<circle cx="15.5" cy="8.5" r="0.75" fill="currentColor" stroke="none"/>
<circle cx="12" cy="12" r="0.75" fill="currentColor" stroke="none"/>
<circle cx="8.5" cy="15.5" r="0.75" fill="currentColor" stroke="none"/>
<circle cx="15.5" cy="15.5" r="0.75" fill="currentColor" stroke="none"/>
</svg>
<span class="nav-label">Dice</span>
</button>
<button class="nav-item" data-view="tables">
<svg class="nav-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<rect x="3" y="3" width="18" height="18" rx="1"/>
<path d="M3 9h18M3 15h18M9 3v18M15 3v18"/>
</svg>
<span class="nav-label">Tables</span>
</button>
</div>
<div class="nav-section">
<div class="nav-section-label">Campaign</div>
<button class="nav-item" data-view="threads">
<svg class="nav-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<path d="M4 6h2M4 12h2M4 18h2M9 6h11M9 12h11M9 18h11"/>
</svg>
<span class="nav-label">Threads</span>
</button>
<button class="nav-item" data-view="npcs">
<svg class="nav-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<circle cx="12" cy="8" r="4"/>
<path d="M4 20c0-4 4-6 8-6s8 2 8 6"/>
</svg>
<span class="nav-label">NPCs</span>
</button>
<button class="nav-item" data-view="notes">
<svg class="nav-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<path d="M6 3h9l3 3v15H6z"/>
<path d="M9 8h8M9 12h8M9 16h5"/>
</svg>
<span class="nav-label">Notes</span>
</button>
<button class="nav-item" data-view="character">
<svg class="nav-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<path d="M12 3l7 3v6c0 5-3.5 8-7 9-3.5-1-7-4-7-9V6z"/>
</svg>
<span class="nav-label">Character</span>
</button>
</div>
<div class="nav-section">
<div class="nav-section-label">Settings</div>
<button class="nav-item" data-view="campaign-management">
<svg class="nav-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<circle cx="12" cy="12" r="3"/>
<path d="M12 2v3M12 19v3M4.2 4.2l2.1 2.1M17.7 17.7l2.1 2.1M2 12h3M19 12h3M4.2 19.8l2.1-2.1M17.7 6.3l2.1-2.1"/>
</svg>
<span class="nav-label">Campaign Management</span>
</button>
<button class="nav-item nav-action" id="themeToggle" aria-label="Toggle light and dark theme">
<svg class="nav-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<path d="M20 14.5A8.5 8.5 0 1 1 9.5 4a7 7 0 0 0 10.5 10.5z"/>
</svg>
<span class="nav-label">Theme Toggle</span>
</button>
</div>
</nav>
<div class="chaos-factor">
<div class="chaos-factor-label">Chaos Factor</div>
<div class="chaos-factor-controls">
<button class="chaos-btn" id="chaosMinus" aria-label="Decrease chaos factor">&minus;</button>
<span class="chaos-factor-value" id="chaosValue">5</span>
<button class="chaos-btn" id="chaosPlus" aria-label="Increase chaos factor">+</button>
</div>
</div>
</aside>
<main class="main-content">
<div class="view active" id="view-oracle"></div>
<div class="view" id="view-meaning"></div>
<div class="view" id="view-une"></div>
<div class="view" id="view-dice"></div>
<div class="view" id="view-tables"></div>
<div class="view" id="view-threads"></div>
<div class="view" id="view-npcs"></div>
<div class="view" id="view-notes"></div>
<div class="view" id="view-character"></div>
<div class="view" id="view-campaign-management"></div>
</main>
</div>
</body>
<script src="js/app.js" type="module"></script>
</html>