Change from sidebar to tabs

This commit is contained in:
Peter Stockings
2026-01-14 11:27:00 +11:00
parent 863f563a01
commit 21baa6616b
3 changed files with 33 additions and 64 deletions

View File

@@ -1,5 +1,6 @@
.app-layout {
display: flex;
flex-direction: column;
width: 100vw;
height: 100vh;
overflow: hidden;

View File

@@ -1,21 +1,26 @@
.sidebar {
width: 280px;
height: 100vh;
width: 100%;
height: 64px;
background: var(--bg-darker);
border-right: 1px solid var(--border-color);
border-bottom: 1px solid var(--border-color);
display: flex;
flex-direction: column;
padding: 2rem 0;
box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
align-items: center;
padding: 0 1.5rem;
box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
z-index: 100;
flex-shrink: 0;
}
.sidebar-header {
padding: 0 1.5rem 2rem;
border-bottom: 1px solid var(--border-color);
padding: 0;
margin-right: 3rem;
border: none;
display: flex;
align-items: center;
}
.sidebar-logo {
font-size: 1.75rem;
font-size: 1.5rem;
font-weight: 700;
margin: 0;
background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
@@ -24,69 +29,44 @@
background-clip: text;
}
.sidebar-tagline {
margin: 0.25rem 0 0;
font-size: 0.875rem;
color: rgba(255, 255, 255, 0.5);
font-weight: 300;
}
.sidebar-nav {
flex: 1;
padding: 2rem 1rem;
display: flex;
flex-direction: column;
flex-direction: row;
align-items: center;
gap: 0.5rem;
height: 100%;
overflow-x: auto;
}
.nav-item {
display: flex;
align-items: center;
gap: 1rem;
padding: 1rem 1.25rem;
justify-content: center;
padding: 0.5rem 1rem;
background: transparent;
border: 1px solid rgba(255, 255, 255, 0.1);
border-radius: 12px;
border: 1px solid transparent;
border-radius: 8px;
color: rgba(255, 255, 255, 0.7);
cursor: pointer;
transition: all 0.3s ease;
font-size: 1rem;
text-align: left;
transition: all 0.2s ease;
font-size: 0.9rem;
text-decoration: none;
white-space: nowrap;
}
.nav-item:hover {
background: rgba(255, 255, 255, 0.05);
border-color: var(--primary);
color: rgba(255, 255, 255, 0.9);
transform: translateX(4px);
}
.nav-item.active {
background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%);
border-color: var(--primary);
color: #fff;
box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}
.nav-icon {
font-size: 1.5rem;
line-height: 1;
background: rgba(99, 102, 241, 0.1);
border-color: rgba(99, 102, 241, 0.3);
color: var(--primary);
font-weight: 500;
}
.nav-name {
font-weight: 500;
}
.sidebar-footer {
padding: 0 1.5rem;
border-top: 1px solid rgba(255, 255, 255, 0.1);
padding-top: 1.5rem;
}
.footer-text {
margin: 0;
font-size: 0.75rem;
color: rgba(255, 255, 255, 0.4);
text-align: center;
font-style: italic;
}

View File

@@ -7,7 +7,6 @@ export interface AppInfo {
id: AppId;
path: string;
name: string;
icon: string;
description: string;
}
@@ -16,45 +15,39 @@ export const APPS: AppInfo[] = [
id: 'image-approx',
path: '/image-approx',
name: 'Image Approximation',
icon: '🎨',
description: 'Evolve triangles to approximate images',
},
{
id: 'snake-ai',
path: '/snake-ai',
name: 'Neural Network Snake',
icon: '🐍',
description: 'Evolve neural networks to play Snake',
},
{
id: 'rogue-gen',
path: '/rogue-gen',
name: 'Rogue Map Gen',
icon: '🏰',
description: 'Evolve cellular automata for dungeon generation',
},
{
id: 'neat-arena',
path: '/neat-arena',
name: 'NEAT Arena',
icon: '⚔️',
description: 'Evolve AI agents to fight in a top-down shooter',
},
{
id: 'lunar-lander',
path: '/lunar-lander',
name: 'Lunar Lander',
icon: '🚀',
description: 'Evolve a spaceship to land safely',
},
];
export default function Sidebar() {
return (
<aside className="sidebar">
<header className="sidebar">
<div className="sidebar-header">
<h1 className="sidebar-logo">🧬 Evolution</h1>
<p className="sidebar-tagline">Mini-Apps</p>
</div>
<nav className="sidebar-nav">
@@ -65,15 +58,10 @@ export default function Sidebar() {
className={({ isActive }) => `nav-item ${isActive ? 'active' : ''}`}
title={app.description}
>
<span className="nav-icon">{app.icon}</span>
<span className="nav-name">{app.name}</span>
</NavLink>
))}
</nav>
<div className="sidebar-footer">
<p className="footer-text">Select an app to begin</p>
</div>
</aside>
</header>
);
}