Implement dark-first design system with Geist typography (#28)
Co-authored-by: Julian Tabel <juliantabel.jt@gmail.com> Co-committed-by: Julian Tabel <juliantabel.jt@gmail.com>
This commit was merged in pull request #28.
This commit is contained in:
@@ -3,9 +3,9 @@ import { useRuns } from '../hooks/useRuns'
|
||||
import type { RunStatus } from '../types'
|
||||
|
||||
const statusStyles: Record<RunStatus, string> = {
|
||||
active: 'bg-green-100 text-green-800 dark:bg-green-900/40 dark:text-green-300',
|
||||
completed: 'bg-blue-100 text-blue-800 dark:bg-blue-900/40 dark:text-blue-300',
|
||||
failed: 'bg-red-100 text-red-800 dark:bg-red-900/40 dark:text-red-300',
|
||||
active: 'bg-status-active-bg text-status-active border border-status-active/20',
|
||||
completed: 'bg-status-completed-bg text-status-completed border border-status-completed/20',
|
||||
failed: 'bg-status-failed-bg text-status-failed border border-status-failed/20',
|
||||
}
|
||||
|
||||
export function Home() {
|
||||
@@ -16,42 +16,46 @@ export function Home() {
|
||||
|
||||
return (
|
||||
<div className="max-w-4xl mx-auto p-8">
|
||||
<div className="text-center py-12">
|
||||
<h1 className="text-4xl font-bold text-gray-900 dark:text-gray-100 mb-2">
|
||||
Another Nuzlocke Tracker
|
||||
</h1>
|
||||
<p className="text-lg text-gray-600 dark:text-gray-400 mb-8">
|
||||
Track your Nuzlocke runs with ease
|
||||
</p>
|
||||
<Link
|
||||
to="/runs/new"
|
||||
className="inline-block px-6 py-3 bg-blue-600 text-white rounded-lg font-medium text-lg hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 transition-colors"
|
||||
>
|
||||
Start New Run
|
||||
</Link>
|
||||
{/* Hero */}
|
||||
<div className="relative text-center py-16 mb-8 overflow-hidden rounded-2xl bg-gradient-to-b from-surface-2 to-surface-0 border border-border-default">
|
||||
<img
|
||||
src="/favicon.svg"
|
||||
alt=""
|
||||
className="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-64 h-64 opacity-[0.04] pointer-events-none select-none"
|
||||
/>
|
||||
<div className="relative">
|
||||
<h1 className="text-4xl sm:text-5xl font-bold tracking-tight text-text-primary mb-3">
|
||||
Another Nuzlocke Tracker
|
||||
</h1>
|
||||
<p className="text-lg text-text-secondary mb-8">Track your Nuzlocke runs with ease</p>
|
||||
<Link
|
||||
to="/runs/new"
|
||||
className="inline-block px-6 py-3 bg-accent-600 text-white rounded-lg font-medium text-lg hover:bg-accent-500 focus:outline-none focus:ring-2 focus:ring-accent-400 focus:ring-offset-2 focus:ring-offset-surface-0 transition-all active:scale-[0.98]"
|
||||
>
|
||||
Start New Run
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{isLoading && (
|
||||
<div className="flex items-center justify-center py-8">
|
||||
<div className="w-6 h-6 border-2 border-blue-600 border-t-transparent rounded-full animate-spin" />
|
||||
<div className="w-6 h-6 border-2 border-accent-400 border-t-transparent rounded-full animate-spin" />
|
||||
</div>
|
||||
)}
|
||||
|
||||
{activeRun && (
|
||||
<div className="mb-8">
|
||||
<h2 className="text-sm font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wide mb-3">
|
||||
<h2 className="text-xs font-medium text-text-tertiary uppercase tracking-wider mb-3">
|
||||
Continue Playing
|
||||
</h2>
|
||||
<Link
|
||||
to={`/runs/${activeRun.id}`}
|
||||
className="block bg-white dark:bg-gray-800 rounded-lg shadow hover:shadow-md transition-shadow p-5 border-l-4 border-green-500"
|
||||
className="block bg-surface-1 rounded-xl border border-border-default hover:border-accent-400/30 transition-all hover:-translate-y-0.5 p-5"
|
||||
>
|
||||
<div className="flex items-center justify-between">
|
||||
<div>
|
||||
<h3 className="text-lg font-semibold text-gray-900 dark:text-gray-100">
|
||||
{activeRun.name}
|
||||
</h3>
|
||||
<p className="text-sm text-gray-500 dark:text-gray-400">
|
||||
<h3 className="text-lg font-semibold text-text-primary">{activeRun.name}</h3>
|
||||
<p className="text-sm text-text-secondary">
|
||||
Started{' '}
|
||||
{new Date(activeRun.startedAt).toLocaleDateString(undefined, {
|
||||
year: 'numeric',
|
||||
@@ -60,9 +64,7 @@ export function Home() {
|
||||
})}
|
||||
</p>
|
||||
</div>
|
||||
<span className="text-blue-600 dark:text-blue-400 font-medium text-sm">
|
||||
Resume →
|
||||
</span>
|
||||
<span className="text-accent-300 font-medium text-sm">Resume →</span>
|
||||
</div>
|
||||
</Link>
|
||||
</div>
|
||||
@@ -71,10 +73,13 @@ export function Home() {
|
||||
{recentRuns && recentRuns.length > 0 && (
|
||||
<div>
|
||||
<div className="flex items-center justify-between mb-3">
|
||||
<h2 className="text-sm font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wide">
|
||||
<h2 className="text-xs font-medium text-text-tertiary uppercase tracking-wider">
|
||||
Recent Runs
|
||||
</h2>
|
||||
<Link to="/runs" className="text-sm text-blue-600 dark:text-blue-400 hover:underline">
|
||||
<Link
|
||||
to="/runs"
|
||||
className="text-sm text-text-link hover:text-accent-200 transition-colors"
|
||||
>
|
||||
View all
|
||||
</Link>
|
||||
</div>
|
||||
@@ -83,12 +88,12 @@ export function Home() {
|
||||
<Link
|
||||
key={run.id}
|
||||
to={`/runs/${run.id}`}
|
||||
className="block bg-white dark:bg-gray-800 rounded-lg shadow hover:shadow-md transition-shadow p-4"
|
||||
className="block bg-surface-1 rounded-xl border border-border-default hover:border-border-accent transition-all hover:-translate-y-0.5 p-4"
|
||||
>
|
||||
<div className="flex items-center justify-between">
|
||||
<div>
|
||||
<h3 className="font-medium text-gray-900 dark:text-gray-100">{run.name}</h3>
|
||||
<p className="text-xs text-gray-500 dark:text-gray-400">
|
||||
<h3 className="font-medium text-text-primary">{run.name}</h3>
|
||||
<p className="text-xs text-text-secondary">
|
||||
{new Date(run.startedAt).toLocaleDateString(undefined, {
|
||||
year: 'numeric',
|
||||
month: 'short',
|
||||
@@ -109,7 +114,7 @@ export function Home() {
|
||||
)}
|
||||
|
||||
{runs && runs.length === 0 && (
|
||||
<p className="text-center text-gray-500 dark:text-gray-400">
|
||||
<p className="text-center text-text-secondary">
|
||||
No runs yet. Start your first Nuzlocke challenge above!
|
||||
</p>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user