# UI Migration Guide: index.html → Next.js
## ✅ COMPLETED
### 1. **CSS Design Tokens**
- ✅ Created design token mapping in `globals.css`
- All color variables, fonts, and spacing preserved
- Ready for selective integration
### 2. **JSX Conversion**
- ✅ Created `/ui/app/page-landing.tsx`
- Converted HTML → React JSX components
- `class` → `className`
- Canvas refs with `useEffect` lifecycle
- All sections: hero, overview, simulation, architecture, metrics
### 3. **Canvas Initialization**
- ✅ Added `useRef` hooks for canvas elements
- ✅ Wrapped canvas logic in `useEffect`
- ✅ TODO placeholders for actual drawing logic
---
## 📋 INTEGRATION STEPS
### Step 1: Apply index.html CSS to globals.css
Your `globals.css` has old styles. Update it with index.html theme:
```bash
# Option A: Keep existing structure, add index.html CSS as override
# Option B: Replace entire globals.css with index.html styles (RECOMMENDED)
```
The `page-landing.tsx` expects these CSS classes:
- Layout: `nav`, `section`, `footer`
- Components: `card`, `btn-primary`, `btn-secondary`, `metric-block`
- Utilities: `anim-1`, `divider`, `hero-stats`
### Step 2: Choose Integration Strategy
**Option A: Use Landing Page Separately** ✅ (SIMPLEST)
```
/app/page.tsx → Your existing interactive app
/app/landing.tsx → New static landing (page-landing.tsx)
/app/layout.tsx → Wrap both
```
**Option B: Replace page.tsx Completely** (if landing is the main page)
```
/app/page.tsx → Replace with page-landing.tsx
/app/mission/page.tsx → Move existing components to subfolder
```
**Option C: Hybrid** (recommended)
```
/app/page.tsx → Dynamic switcher (landing vs mission)
/app/landing.tsx → page-landing.tsx
/app/components/* → Existing components
```
---
## 🎨 CSS INTEGRATION
### Required Classes from index.html:
```css
/* Navigation */
nav, .nav-logo, .nav-links, .nav-badge
/* Hero Section */
#hero, .hero-content, .hero-tag, .hero-ctas
.btn-primary, .btn-secondary
/* Cards */
.cards-grid, .card, .card-id, .card-title, .card-footer
/* Simulation */
.sim-wrapper, .sim-topbar, .sim-body, .sim-panel
.agent-row, .trust-bar-bg, .trust-bar-fill
.metric-block, .metric-value
/* Architecture */
.arch-node, .arch-flow
/* Metrics */
.metric-block, .metric-grid
/* Footer */
footer, .footer-left, .footer-right
/* Animations */
@keyframes pulse-dot, fadeInUp
.anim-1, .anim-2, .anim-3, .anim-4, .anim-5
```
---
## 🖼️ CANVAS MIGRATION
The new `page-landing.tsx` has placeholders:
```typescript
function initHeroCanvas(canvas: HTMLCanvasElement) {
// TODO: Copy canvas.js logic from index.html
// The neural network grid visualization
}
function initSimCanvas(canvas: HTMLCanvasElement) {
// TODO: Copy canvas.js logic from index.html
// The orchestrator network visualization
}
```
**To migrate canvas logic:**
1. Find the inline `