feat: change to dark mode theme
based on dracula midnight colors
This commit is contained in:
70
index.html
70
index.html
@@ -5,26 +5,26 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Gridfinity Calculator</title>
|
||||
</head>
|
||||
<body class="bg-slate-50 text-slate-900 min-h-screen">
|
||||
<body class="bg-dracula-darker text-dracula-foreground min-h-screen">
|
||||
<div id="app" class="max-w-2xl mx-auto p-4 md:p-8">
|
||||
<header class="mb-8 text-center">
|
||||
<h1 class="text-3xl font-bold text-slate-800">Gridfinity Calculator</h1>
|
||||
<p class="text-slate-600">Plan your modular storage layout</p>
|
||||
<h1 class="text-3xl font-bold text-dracula-purple">Gridfinity Calculator</h1>
|
||||
<p class="text-dracula-comment">Plan your modular storage layout</p>
|
||||
</header>
|
||||
|
||||
<main class="grid gap-8">
|
||||
<!-- Inputs Section -->
|
||||
<section class="bg-white p-6 rounded-xl shadow-sm border border-slate-200">
|
||||
<div class="flex flex-col md:flex-row md:items-center justify-between gap-4 mb-6 pb-6 border-b border-slate-100">
|
||||
<section class="bg-dracula-dark p-6 rounded-xl shadow-sm border border-dracula-currentLine">
|
||||
<div class="flex flex-col md:flex-row md:items-center justify-between gap-4 mb-6 pb-6 border-b border-dracula-currentLine">
|
||||
<h2 class="text-xl font-semibold flex items-center gap-2">
|
||||
Drawer Dimensions
|
||||
</h2>
|
||||
|
||||
<div class="flex items-center gap-3">
|
||||
<label class="text-sm font-medium text-slate-700">Units:</label>
|
||||
<div class="flex bg-slate-100 p-1 rounded-lg">
|
||||
<button id="unit-mm" class="px-4 py-1 rounded-md text-sm font-medium text-slate-600 hover:text-slate-900 transition-colors">mm</button>
|
||||
<button id="unit-in" class="px-4 py-1 rounded-md text-sm font-medium bg-blue-600 text-white shadow-sm transition-colors">inches</button>
|
||||
<label class="text-sm font-medium text-dracula-foreground">Units:</label>
|
||||
<div class="flex bg-dracula-darker p-1 rounded-lg">
|
||||
<button id="unit-mm" class="px-4 py-1 rounded-md text-sm font-medium text-dracula-comment hover:text-dracula-foreground transition-colors">mm</button>
|
||||
<button id="unit-in" class="px-4 py-1 rounded-md text-sm font-medium bg-dracula-purple text-dracula-darker shadow-sm transition-colors">inches</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -32,41 +32,41 @@
|
||||
|
||||
<div class="grid grid-cols-1 md:grid-cols-3 gap-4">
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-slate-700 mb-1">Width</label>
|
||||
<input type="number" id="input-width" class="w-full px-3 py-2 border border-slate-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500" placeholder="0" step="any" />
|
||||
<label class="block text-sm font-medium text-dracula-comment mb-1">Width</label>
|
||||
<input type="number" id="input-width" class="w-full px-3 py-2 bg-dracula-darker border border-dracula-currentLine rounded-lg focus:ring-2 focus:ring-dracula-purple focus:border-dracula-purple text-dracula-foreground" placeholder="0" step="any" />
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-slate-700 mb-1">Length / Depth</label>
|
||||
<input type="number" id="input-length" class="w-full px-3 py-2 border border-slate-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500" placeholder="0" step="any" />
|
||||
<label class="block text-sm font-medium text-dracula-comment mb-1">Length / Depth</label>
|
||||
<input type="number" id="input-length" class="w-full px-3 py-2 bg-dracula-darker border border-dracula-currentLine rounded-lg focus:ring-2 focus:ring-dracula-purple focus:border-dracula-purple text-dracula-foreground" placeholder="0" step="any" />
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-slate-700 mb-1">Height</label>
|
||||
<input type="number" id="input-height" class="w-full px-3 py-2 border border-slate-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500" placeholder="0" step="any" />
|
||||
<label class="block text-sm font-medium text-dracula-comment mb-1">Height</label>
|
||||
<input type="number" id="input-height" class="w-full px-3 py-2 bg-dracula-darker border border-dracula-currentLine rounded-lg focus:ring-2 focus:ring-dracula-purple focus:border-dracula-purple text-dracula-foreground" placeholder="0" step="any" />
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Results Section -->
|
||||
<section id="results" class="bg-blue-600 text-white p-6 rounded-xl shadow-md hidden">
|
||||
<section id="results" class="bg-dracula-purple text-dracula-darker p-6 rounded-xl shadow-md hidden">
|
||||
<h2 class="text-xl font-semibold mb-6">Calculation Results</h2>
|
||||
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-8">
|
||||
<div class="space-y-4">
|
||||
<div>
|
||||
<p class="text-blue-100 text-sm uppercase tracking-wider font-semibold">Grid Count</p>
|
||||
<p class="text-dracula-darker/70 text-sm uppercase tracking-wider font-bold">Grid Count</p>
|
||||
<p class="text-4xl font-bold" id="result-grid-count">0 x 0</p>
|
||||
<p class="text-blue-100 text-sm mt-1" id="result-grid-fractional">0.00 x 0.00 grids</p>
|
||||
<p class="text-dracula-darker/70 text-sm mt-1 font-medium" id="result-grid-fractional">0.00 x 0.00 grids</p>
|
||||
</div>
|
||||
<div>
|
||||
<p class="text-blue-100 text-sm uppercase tracking-wider font-semibold">Max Bin Height</p>
|
||||
<p class="text-dracula-darker/70 text-sm uppercase tracking-wider font-bold">Max Bin Height</p>
|
||||
<p class="text-4xl font-bold" id="result-bin-height">0U</p>
|
||||
<p class="text-blue-100 text-sm mt-1">Vertical Units (7mm each)</p>
|
||||
<p class="text-dracula-darker/70 text-sm mt-1 font-medium">Vertical Units (7mm each)</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bg-blue-700/50 p-4 rounded-lg space-y-3">
|
||||
<h3 class="font-semibold border-b border-blue-500/50 pb-2">Remaining Space</h3>
|
||||
<div class="grid grid-cols-2 gap-2 text-sm">
|
||||
<div class="bg-dracula-darker/10 p-4 rounded-lg space-y-3">
|
||||
<h3 class="font-bold border-b border-dracula-darker/20 pb-2 text-dracula-darker">Remaining Space</h3>
|
||||
<div class="grid grid-cols-2 gap-2 text-sm font-medium">
|
||||
<span>Width Gap:</span>
|
||||
<span id="gap-width" class="font-mono text-right">0.0 mm</span>
|
||||
<span>Length Gap:</span>
|
||||
@@ -79,32 +79,32 @@
|
||||
</section>
|
||||
|
||||
<!-- Spec Overrides -->
|
||||
<details class="bg-white border border-slate-200 rounded-xl overflow-hidden shadow-sm">
|
||||
<summary class="px-6 py-4 font-medium cursor-pointer hover:bg-slate-50 flex items-center justify-between">
|
||||
<details class="bg-dracula-dark border border-dracula-currentLine rounded-xl overflow-hidden shadow-sm">
|
||||
<summary class="px-6 py-4 font-medium cursor-pointer hover:bg-dracula-currentLine flex items-center justify-between">
|
||||
<span>Gridfinity Spec Overrides</span>
|
||||
<span class="text-slate-400 text-sm font-normal">Standard: 42x42x7mm</span>
|
||||
<span class="text-dracula-comment text-sm font-normal">Standard: 42x42x7mm</span>
|
||||
</summary>
|
||||
<div class="p-6 border-t border-slate-100 space-y-4 bg-slate-50/50">
|
||||
<div class="p-6 border-t border-dracula-currentLine space-y-4 bg-dracula-darker/30">
|
||||
<div class="grid grid-cols-1 md:grid-cols-3 gap-4">
|
||||
<div>
|
||||
<label class="block text-xs font-semibold text-slate-500 uppercase mb-1">Grid Size (mm)</label>
|
||||
<input type="number" id="spec-grid-size" value="42" class="w-full px-3 py-2 border border-slate-300 rounded-lg text-sm" />
|
||||
<label class="block text-xs font-semibold text-dracula-comment uppercase mb-1">Grid Size (mm)</label>
|
||||
<input type="number" id="spec-grid-size" value="42" class="w-full px-3 py-2 bg-dracula-darker border border-dracula-currentLine rounded-lg text-sm text-dracula-foreground" />
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-xs font-semibold text-slate-500 uppercase mb-1">Unit Height (mm)</label>
|
||||
<input type="number" id="spec-height-unit" value="7" class="w-full px-3 py-2 border border-slate-300 rounded-lg text-sm" />
|
||||
<label class="block text-xs font-semibold text-dracula-comment uppercase mb-1">Unit Height (mm)</label>
|
||||
<input type="number" id="spec-height-unit" value="7" class="w-full px-3 py-2 bg-dracula-darker border border-dracula-currentLine rounded-lg text-sm text-dracula-foreground" />
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-xs font-semibold text-slate-500 uppercase mb-1">Base Thickness (mm)</label>
|
||||
<input type="number" id="spec-base-thickness" value="4.8" class="w-full px-3 py-2 border border-slate-300 rounded-lg text-sm" />
|
||||
<label class="block text-xs font-semibold text-dracula-comment uppercase mb-1">Base Thickness (mm)</label>
|
||||
<input type="number" id="spec-base-thickness" value="4.8" class="w-full px-3 py-2 bg-dracula-darker border border-dracula-currentLine rounded-lg text-sm text-dracula-foreground" />
|
||||
</div>
|
||||
</div>
|
||||
<p class="text-xs text-slate-400 italic">Adjust these to scale the system for an exact fit in your drawer.</p>
|
||||
<p class="text-xs text-dracula-comment italic">Adjust these to scale the system for an exact fit in your drawer.</p>
|
||||
</div>
|
||||
</details>
|
||||
</main>
|
||||
|
||||
<footer class="mt-12 text-center text-slate-400 text-sm">
|
||||
<footer class="mt-12 text-center text-dracula-comment text-sm">
|
||||
<p>Follows the Gridfinity spec by Zach Freedman</p>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
- Setting up the Vite/TypeScript/Tailwind environment.
|
||||
|
||||
## Active Decisions
|
||||
- **Dark Mode Implementation**: Adopted a Dracula Midnight theme (`#21222c` background) as the primary interface style. Added custom Dracula color palette to `tailwind.config.js`.
|
||||
- Using **Vite** for the build tool.
|
||||
- Using **Vanilla TypeScript** to avoid framework overhead.
|
||||
- Using **Vitest** for unit testing calculation logic.
|
||||
|
||||
@@ -1,18 +1,19 @@
|
||||
# Progress Tracking
|
||||
|
||||
## Milestones
|
||||
- [ ] Initial Environment & Docs Setup
|
||||
- [ ] Core Calculation Engine
|
||||
- [ ] Web UI & Integration
|
||||
- [ ] Final Build & Polish
|
||||
- [x] Initial Environment & Docs Setup
|
||||
- [x] Core Calculation Engine
|
||||
- [x] Web UI & Integration
|
||||
- [x] Final Build & Polish
|
||||
- [x] Firebase deployment
|
||||
|
||||
## Todo List
|
||||
- [x] Create project structure
|
||||
- [x] Initialize Memory Bank documents
|
||||
- [ ] Create Blueprint documents (PRD, Architecture)
|
||||
- [ ] Project setup (Vite, TS, Tailwind, Vitest)
|
||||
- [ ] Implement `src/calculator.ts`
|
||||
- [ ] Write tests in `src/calculator.test.ts`
|
||||
- [ ] Implement `index.html` UI
|
||||
- [ ] Implement `src/main.ts` glue code
|
||||
- [ ] Verify build output
|
||||
- [x] Create Blueprint documents (PRD, Architecture)
|
||||
- [x] Project setup (Vite, TS, Tailwind, Vitest)
|
||||
- [x] Implement `src/calculator.ts`
|
||||
- [x] Write tests in `src/calculator.test.ts`
|
||||
- [x] Implement `index.html` UI
|
||||
- [x] Implement `src/main.ts` glue code
|
||||
- [x] Verify build output
|
||||
|
||||
16
src/main.ts
16
src/main.ts
@@ -70,15 +70,15 @@ function updateResults() {
|
||||
|
||||
function setUnitStyles(unit: 'mm' | 'in') {
|
||||
if (unit === 'in') {
|
||||
unitInBtn.classList.add('bg-blue-600', 'text-white', 'shadow-sm');
|
||||
unitInBtn.classList.remove('text-slate-600', 'hover:text-slate-900');
|
||||
unitMmBtn.classList.remove('bg-blue-600', 'text-white', 'shadow-sm');
|
||||
unitMmBtn.classList.add('text-slate-600', 'hover:text-slate-900');
|
||||
unitInBtn.classList.add('bg-dracula-purple', 'text-dracula-darker', 'shadow-sm');
|
||||
unitInBtn.classList.remove('text-dracula-comment', 'hover:text-dracula-foreground');
|
||||
unitMmBtn.classList.remove('bg-dracula-purple', 'text-dracula-darker', 'shadow-sm');
|
||||
unitMmBtn.classList.add('text-dracula-comment', 'hover:text-dracula-foreground');
|
||||
} else {
|
||||
unitMmBtn.classList.add('bg-blue-600', 'text-white', 'shadow-sm');
|
||||
unitMmBtn.classList.remove('text-slate-600', 'hover:text-slate-900');
|
||||
unitInBtn.classList.remove('bg-blue-600', 'text-white', 'shadow-sm');
|
||||
unitInBtn.classList.add('text-slate-600', 'hover:text-slate-900');
|
||||
unitMmBtn.classList.add('bg-dracula-purple', 'text-dracula-darker', 'shadow-sm');
|
||||
unitMmBtn.classList.remove('text-dracula-comment', 'hover:text-dracula-foreground');
|
||||
unitInBtn.classList.remove('bg-dracula-purple', 'text-dracula-darker', 'shadow-sm');
|
||||
unitInBtn.classList.add('text-dracula-comment', 'hover:text-dracula-foreground');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,24 @@ export default {
|
||||
"./src/**/*.{js,ts,jsx,tsx}",
|
||||
],
|
||||
theme: {
|
||||
extend: {},
|
||||
extend: {
|
||||
colors: {
|
||||
dracula: {
|
||||
darker: '#21222c',
|
||||
dark: '#282a36',
|
||||
currentLine: '#44475a',
|
||||
foreground: '#f8f8f2',
|
||||
comment: '#6272a4',
|
||||
cyan: '#8be9fd',
|
||||
green: '#50fa7b',
|
||||
orange: '#ffb86c',
|
||||
pink: '#ff79c6',
|
||||
purple: '#bd93f9',
|
||||
red: '#ff5544',
|
||||
yellow: '#f1fa8c',
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
plugins: [],
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user