|
1 | | -import { useState, useEffect } from 'react'; |
| 1 | +import { useState } from 'react'; |
2 | 2 | import Nav from './components/Nav.jsx'; |
3 | 3 | import Hero from './components/hero/Hero.jsx'; |
4 | | -import TrackTabs from './components/TrackTabs.jsx'; |
| 4 | +import WhyRecourse from './components/WhyRecourse.jsx'; |
| 5 | +import FeaturedResources from './components/FeaturedResources.jsx'; |
| 6 | +import PathCards from './components/PathCards.jsx'; |
5 | 7 | import ResearchTrack from './components/tracks/ResearchTrack/index.jsx'; |
6 | 8 | import BuildTrack from './components/tracks/BuildTrack/index.jsx'; |
7 | 9 | import DeployTrack from './components/tracks/DeployTrack/index.jsx'; |
8 | 10 | import Footer from './components/Footer.jsx'; |
9 | 11 |
|
10 | 12 | export default function App() { |
11 | 13 | const [activeTab, setActiveTab] = useState('research'); |
12 | | - const [isMobile, setIsMobile] = useState(false); |
13 | 14 |
|
14 | | - useEffect(() => { |
15 | | - const check = () => setIsMobile(window.innerWidth < 1024); |
16 | | - check(); |
17 | | - window.addEventListener('resize', check); |
18 | | - return () => window.removeEventListener('resize', check); |
19 | | - }, []); |
20 | | - |
21 | | - const TRACK_HEADERS = [ |
22 | | - { key: 'research', label: 'Explore Research', icon: '🔬', color: '#2563eb' }, |
23 | | - { key: 'build', label: 'Build with Recourse', icon: '⚙', color: '#7c3aed' }, |
24 | | - { key: 'deploy', label: 'Deploy', icon: '🏢', color: '#059669' }, |
| 15 | + const TRACKS = [ |
| 16 | + { |
| 17 | + key: 'research', |
| 18 | + label: 'Research', |
| 19 | + kicker: 'Map the field', |
| 20 | + title: 'Survey the literature and identify open questions.', |
| 21 | + description: 'For scholars and advanced readers who need foundations, distinctions, and a clear view of the active research landscape.', |
| 22 | + bullets: ['Search seminal papers and newer threads', 'Compare causal, optimization, and game-theoretic approaches', 'Capture open problems worth pursuing'], |
| 23 | + cta: 'Explore research', |
| 24 | + color: '#2453a6', |
| 25 | + softColor: '#dbe7ff', |
| 26 | + panelId: 'research-panel', |
| 27 | + component: <ResearchTrack />, |
| 28 | + }, |
| 29 | + { |
| 30 | + key: 'build', |
| 31 | + label: 'Build', |
| 32 | + kicker: 'Prototype confidently', |
| 33 | + title: 'Move from theory into implementation patterns.', |
| 34 | + description: 'For builders evaluating methods, metrics, and packages before integrating recourse into real model pipelines.', |
| 35 | + bullets: ['Compare methods by assumptions and tradeoffs', 'Inspect evaluation metrics before choosing a benchmark', 'Find practical package starting points'], |
| 36 | + cta: 'See implementation guidance', |
| 37 | + color: '#8a4b18', |
| 38 | + softColor: '#f7e5d1', |
| 39 | + panelId: 'build-panel', |
| 40 | + component: <BuildTrack />, |
| 41 | + }, |
| 42 | + { |
| 43 | + key: 'deploy', |
| 44 | + label: 'Deploy', |
| 45 | + kicker: 'Operate responsibly', |
| 46 | + title: 'Translate recourse into product, policy, and governance.', |
| 47 | + description: 'For leaders and deployment teams aligning user experience, compliance, and institutional value.', |
| 48 | + bullets: ['Connect technical metrics to business outcomes', 'Understand governance and audit implications', 'Frame recourse as an organizational capability'], |
| 49 | + cta: 'Review deployment guidance', |
| 50 | + color: '#1d7a55', |
| 51 | + softColor: '#dff3ea', |
| 52 | + panelId: 'deploy-panel', |
| 53 | + component: <DeployTrack />, |
| 54 | + }, |
25 | 55 | ]; |
26 | 56 |
|
| 57 | + const activeTrack = TRACKS.find((track) => track.key === activeTab) ?? TRACKS[0]; |
| 58 | + |
27 | 59 | return ( |
28 | 60 | <> |
29 | 61 | <Nav /> |
30 | 62 | <Hero /> |
| 63 | + <main className="page-shell"> |
| 64 | + <WhyRecourse /> |
| 65 | + <FeaturedResources /> |
| 66 | + <PathCards activePath={activeTab} setActivePath={setActiveTab} tracks={TRACKS} /> |
31 | 67 |
|
32 | | - <section style={{ borderTop: '1px solid #e2e8f0' }}> |
33 | | - {/* Section intro */} |
34 | | - <div style={{ textAlign: 'center', padding: '3rem 2rem 0' }}> |
35 | | - <div style={{ fontSize: '.72rem', fontWeight: 700, color: '#2563eb', textTransform: 'uppercase', letterSpacing: '.12em', marginBottom: '.6rem' }}> |
36 | | - Choose Your Path |
| 68 | + <section id={activeTrack.panelId} className="section-shell active-track-shell"> |
| 69 | + <div className="active-track-header"> |
| 70 | + <div> |
| 71 | + <span className="eyebrow">Active Path</span> |
| 72 | + <h2>{activeTrack.label}</h2> |
| 73 | + </div> |
| 74 | + <div className="active-track-switcher"> |
| 75 | + {TRACKS.map((track) => ( |
| 76 | + <button |
| 77 | + key={track.key} |
| 78 | + type="button" |
| 79 | + className={track.key === activeTab ? 'active' : ''} |
| 80 | + onClick={() => setActiveTab(track.key)} |
| 81 | + > |
| 82 | + {track.label} |
| 83 | + </button> |
| 84 | + ))} |
| 85 | + </div> |
37 | 86 | </div> |
38 | | - <h2 style={{ fontSize: 'clamp(1.6rem,3vw,2.2rem)', fontWeight: 900, letterSpacing: '-.03em', marginBottom: '.6rem' }}> |
39 | | - Three Tracks, One Mission |
40 | | - </h2> |
41 | | - <p style={{ fontSize: '1rem', color: '#64748b', maxWidth: 560, margin: '0 auto', lineHeight: 1.7 }}> |
42 | | - Whether you study recourse, build it, or deploy it — find exactly what you need. |
43 | | - </p> |
44 | | - </div> |
45 | 87 |
|
46 | | - {/* Mobile: tab switcher */} |
47 | | - {isMobile && <TrackTabs active={activeTab} setActive={setActiveTab} />} |
48 | | - |
49 | | - {isMobile ? ( |
50 | | - <div style={{ maxWidth: 640, margin: '0 auto' }}> |
51 | | - {activeTab === 'research' && <ResearchTrack />} |
52 | | - {activeTab === 'build' && <BuildTrack />} |
53 | | - {activeTab === 'deploy' && <DeployTrack />} |
54 | | - </div> |
55 | | - ) : ( |
56 | | - /* Desktop: 3 independently-scrollable columns */ |
57 | | - <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr 1fr' }}> |
58 | | - {/* Column label row */} |
59 | | - <div style={{ gridColumn: '1 / -1', display: 'grid', gridTemplateColumns: '1fr 1fr 1fr', borderBottom: '1px solid #e2e8f0' }}> |
60 | | - {TRACK_HEADERS.map((col, i) => ( |
61 | | - <a key={col.key} href={`#${col.key}`} |
62 | | - style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', gap: 8, padding: '1rem', |
63 | | - borderRight: i < 2 ? '1px solid #e2e8f0' : 'none', background: '#f8fafc', textDecoration: 'none', |
64 | | - transition: 'background .2s' }} |
65 | | - onMouseEnter={e => e.currentTarget.style.background = '#fff'} |
66 | | - onMouseLeave={e => e.currentTarget.style.background = '#f8fafc'}> |
67 | | - <span style={{ fontSize: '1.1rem' }}>{col.icon}</span> |
68 | | - <span style={{ fontWeight: 800, fontSize: '.88rem', color: col.color }}>{col.label}</span> |
69 | | - </a> |
70 | | - ))} |
| 88 | + <div className="active-track-hero card-lift"> |
| 89 | + <div> |
| 90 | + <span className="path-badge" style={{ background: activeTrack.softColor, color: activeTrack.color }}> |
| 91 | + {activeTrack.kicker} |
| 92 | + </span> |
| 93 | + <h3>{activeTrack.title}</h3> |
| 94 | + <p>{activeTrack.description}</p> |
71 | 95 | </div> |
| 96 | + <ul> |
| 97 | + {activeTrack.bullets.map((bullet) => ( |
| 98 | + <li key={bullet}>{bullet}</li> |
| 99 | + ))} |
| 100 | + </ul> |
| 101 | + </div> |
72 | 102 |
|
73 | | - {/* Track columns */} |
74 | | - <div id="research" className="track-col" style={{ borderRight: '1px solid #e2e8f0' }}><ResearchTrack /></div> |
75 | | - <div id="build" className="track-col" style={{ borderRight: '1px solid #e2e8f0' }}><BuildTrack /></div> |
76 | | - <div id="deploy" className="track-col"><DeployTrack /></div> |
| 103 | + <div className="track-panel"> |
| 104 | + {activeTrack.component} |
77 | 105 | </div> |
78 | | - )} |
79 | | - </section> |
| 106 | + </section> |
| 107 | + </main> |
80 | 108 |
|
81 | 109 | <Footer /> |
82 | 110 | </> |
|
0 commit comments