Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<link rel="icon" type="image/png" href="/train-icon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>train-detection-app</title>
<title>Midnight Train</title>
</head>
<body>
<div id="root"></div>
Expand Down
1 change: 0 additions & 1 deletion public/favicon.svg

This file was deleted.

24 changes: 0 additions & 24 deletions public/icons.svg

This file was deleted.

Binary file added public/train-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
106 changes: 85 additions & 21 deletions src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
max-width: 1400px;
margin: 0 auto;
display: flex;
align-items: flex-start;
align-items: center;
gap: 12px;
}

Expand All @@ -45,6 +45,15 @@
gap: 16px;
}

.header-tagline {
font-size: 0.7rem;
font-weight: 600;
letter-spacing: 0.08em;
text-transform: uppercase;
color: var(--accent);
margin: 2px 0 6px;
}

.header-subtitles {
display: flex;
flex-direction: column;
Expand Down Expand Up @@ -72,9 +81,9 @@
}

.header-icon {
font-size: 2rem;
line-height: 1;
margin-top: 2px;
width: 48px;
height: 48px;
object-fit: contain;
}

.app-header h1 {
Expand All @@ -94,6 +103,48 @@
gap: 24px;
}

.app-footer {
margin-top: 16px;
padding: 24px;
text-align: center;
display: flex;
flex-direction: column;
align-items: center;
gap: 6px;
border-top: 1px solid var(--border);
}

.footer-credit {
font-size: 0.85rem;
color: var(--text-muted);
}

.footer-links {
display: flex;
align-items: center;
gap: 8px;
font-size: 0.85rem;
}

.footer-links a {
color: var(--accent);
text-decoration: none;
}

.footer-links a:hover {
text-decoration: underline;
}

.footer-sep {
color: var(--text-muted);
}

.footer-copy {
font-size: 0.75rem;
color: var(--text-muted);
opacity: 0.6;
}

/* ── Shared card ── */
.card {
background: var(--surface);
Expand All @@ -102,6 +153,35 @@
padding: 20px;
}

/* ── Global time range selector ── */
.global-time-range {
background: var(--surface);
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 14px 20px;
}

.global-time-range__presets {
display: flex;
gap: 8px;
flex-wrap: wrap;
}

.global-time-range__custom {
display: flex;
flex-wrap: wrap;
gap: 12px;
align-items: flex-end;
margin-top: 12px;
}

.custom-time-error {
width: 100%;
margin: 4px 0 0;
font-size: 0.8rem;
color: var(--red);
}

/* ── Section title ── */
.section-title {
font-size: 0.95rem;
Expand Down Expand Up @@ -313,22 +393,6 @@
margin-bottom: 16px;
}

.preset-btn {
background: var(--surface-2);
border: 1px solid var(--border);
color: var(--text-muted);
border-radius: 6px;
padding: 5px 14px;
font-size: 0.8rem;
cursor: pointer;
transition: all 0.15s;
}

.preset-btn:hover {
border-color: var(--accent);
color: var(--accent);
}

.query-inputs {
display: flex;
flex-wrap: wrap;
Expand Down Expand Up @@ -386,7 +450,7 @@
display: flex;
flex-direction: column;
gap: 8px;
max-height: 420px;
max-height: 800px;
overflow-y: auto;
padding-right: 4px;
}
Expand Down
28 changes: 21 additions & 7 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,37 +1,51 @@
import { useState } from 'react';
import StatsPanel from './components/StatsPanel';
import LatestTrain from './components/LatestTrain';
import DetectionChart from './components/DetectionChart';
import TimeRangeQuery from './components/TimeRangeQuery';
import GlobalTimeRange, { makePresetRange } from './components/GlobalTimeRange';
import type { TimeRange } from './components/GlobalTimeRange';
import './App.css';

function App() {
const [timeRange, setTimeRange] = useState<TimeRange>(() => makePresetRange('7d'));
return (
<div className="app">
<header className="app-header">
<div className="header-inner">
<span className="header-icon">🚂 ✨</span>
<img src="/train-icon.png" alt="" className="header-icon" />
<div className="header-text">
<h1>Overnight Train Dashboard</h1>
<h1>Midnight Train</h1>
<p className="header-tagline">Train Detection Dashboard</p>
<div className="header-subtitles">
<p className="header-subtitle">
Overnight recordings (11PM - 7AM) · Old Town, Tacoma
<span className="header-dot">·</span>
</p>
<p className="header-subtitle2">
Recording device positioned indoors on 30th Street, 2 blocks down from McCarver Street railroad crossing.
Recorded indoors on 30th St, 2 blocks from McCarver Street crossing.
</p>
</div>
</div>
</div>
</header>
<main className="app-main">
<StatsPanel />
<GlobalTimeRange value={timeRange} onChange={setTimeRange} />
<StatsPanel start={timeRange.start} end={timeRange.end} />
<div className="main-grid">
<LatestTrain />
<DetectionChart />
<DetectionChart start={timeRange.start} end={timeRange.end} />
</div>
<TimeRangeQuery />
<TimeRangeQuery start={timeRange.start} end={timeRange.end} />
</main>
<footer className="app-footer">
<p className="footer-credit">Created by Camille Ibsen</p>
<div className="footer-links">
<a href="https://github.com/ibsenc" target="_blank" rel="noopener noreferrer">GitHub</a>
<span className="footer-sep">·</span>
<a href="https://www.linkedin.com/in/camille-ibsen/" target="_blank" rel="noopener noreferrer">LinkedIn</a>
</div>
<p className="footer-copy">© 2026 Midnight Train</p>
</footer>
</div>
);
}
Expand Down
Loading