Skip to content

Commit 37b5959

Browse files
committed
minor design tweaks
1 parent 83de832 commit 37b5959

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

src/App.jsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ const algorithms = getAlgorithms();
1313

1414
function App() {
1515
const [showCredits, setShowCredits] = React.useState(false);
16+
const [isSidebarCollapsed, setIsSidebarCollapsed] = React.useState(false);
1617

1718
return (
1819
<Router>
@@ -23,8 +24,10 @@ function App() {
2324
metrics={metrics}
2425
algorithms={algorithms}
2526
onShowCredits={() => setShowCredits(true)}
27+
isCollapsed={isSidebarCollapsed}
28+
onToggleCollapse={setIsSidebarCollapsed}
2629
/>
27-
<main className="flex-1 md:ml-64 min-h-screen w-full overflow-x-hidden">
30+
<main className={`flex-1 min-h-screen w-full overflow-x-hidden transition-all duration-300 ${isSidebarCollapsed ? 'md:ml-16' : 'md:ml-64'}`}>
2831
<Routes>
2932
<Route path="/" element={<LandingPage metrics={metrics} />} />
3033
<Route path="/metric/:id" element={<MetricDetail metrics={metrics} />} />

src/components/Sidebar.jsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@ import React from 'react';
22
import { Link, useLocation } from 'react-router-dom';
33
import { Activity, Github, Info, ChevronLeft, ChevronRight, Menu, X } from 'lucide-react';
44

5-
const Sidebar = ({ metrics, algorithms, onShowCredits }) => {
5+
const Sidebar = ({ metrics, algorithms, onShowCredits, isCollapsed, onToggleCollapse }) => {
66
const location = useLocation();
77
const [openSection, setOpenSection] = React.useState('algorithms');
8-
const [isCollapsed, setIsCollapsed] = React.useState(false);
98
const [isMobileMenuOpen, setIsMobileMenuOpen] = React.useState(false);
109

1110
// Auto-expand section based on URL
@@ -170,7 +169,7 @@ const Sidebar = ({ metrics, algorithms, onShowCredits }) => {
170169
<aside className={`hidden md:flex flex-col fixed h-full bg-surface border-r-2 border-black z-10 transition-all duration-300 ${isCollapsed ? 'w-16' : 'w-64'}`}>
171170
{/* Collapse/Expand Button */}
172171
<button
173-
onClick={() => setIsCollapsed(!isCollapsed)}
172+
onClick={() => onToggleCollapse(!isCollapsed)}
174173
className="absolute -right-3 top-24 bg-accent-yellow border-2 border-black p-1 shadow-[2px_2px_0px_0px_rgba(0,0,0,1)] hover:shadow-[4px_4px_0px_0px_rgba(0,0,0,1)] hover:-translate-x-0.5 transition-all z-20"
175174
title={isCollapsed ? 'Expand sidebar' : 'Collapse sidebar'}
176175
>

src/pages/LandingPage.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ import LogAnalyzer from '../components/LogAnalyzer';
44

55
const LandingPage = ({ metrics }) => (
66
<div className="animate-in fade-in pt-16 pb-20 px-4 md:px-6 max-w-7xl mx-auto overflow-x-hidden">
7-
<header className="mb-20 relative overflow-hidden">
7+
<header className="mb-20 relative">
88
{/* Decorative Elements */}
99
<div className="absolute -top-10 right-0 w-32 h-32 bg-accent-yellow border-2 border-black shadow-[8px_8px_0px_0px_rgba(0,0,0,1)] rotate-12 hidden md:block"></div>
10-
<div className="absolute top-20 -left-10 w-16 h-16 bg-accent-pink border-2 border-black rounded-full shadow-[4px_4px_0px_0px_rgba(0,0,0,1)] hidden md:block"></div>
10+
<div className="absolute top-2 -left-6 w-12 h-12 bg-accent-pink border-2 border-black rounded-full shadow-[4px_4px_0px_0px_rgba(0,0,0,1)] hidden md:block"></div>
1111

1212
<div className="relative z-10 max-w-6xl">
1313
<div className="inline-block bg-accent-cyan border-2 border-black px-4 py-2 font-black uppercase tracking-wider text-sm mb-8 shadow-[4px_4px_0px_0px_rgba(0,0,0,1)]">

0 commit comments

Comments
 (0)