feat: add dev server

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Corey Johnson 2026-01-06 11:19:31 -08:00
parent 6e22ec9d76
commit 23472bae66
2 changed files with 47 additions and 0 deletions

33
src/dev/index.html Normal file
View File

@ -0,0 +1,33 @@
<!DOCTYPE html>
<html data-theme="dark">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Tiny Sprites</title>
<link rel="stylesheet" href="/public/pico.min.css">
<style>
.preview-area {
min-height: 200px;
display: flex;
align-items: center;
justify-content: center;
background-image:
linear-gradient(45deg, #3a3a3a 25%, transparent 25%),
linear-gradient(-45deg, #3a3a3a 25%, transparent 25%),
linear-gradient(45deg, transparent 75%, #3a3a3a 75%),
linear-gradient(-45deg, transparent 75%, #3a3a3a 75%);
background-size: 16px 16px;
background-position: 0 0, 0 8px, 8px -8px, -8px 0;
border-radius: var(--pico-border-radius);
}
.preview-area > div { image-rendering: pixelated; }
</style>
</head>
<body>
<main class="container">
<h1>Tiny Sprites</h1>
<div id="app"></div>
</main>
<script type="module" src="./app.tsx"></script>
</body>
</html>

14
src/dev/server.tsx Normal file
View File

@ -0,0 +1,14 @@
#!/usr/bin/env bun
import { Hono } from "hono"
import { serveStatic } from "hono/bun"
import index from "./index.html"
const app = new Hono()
app.use("/public/*", serveStatic({ root: "./" }))
app.get("/", (c) => c.html(index))
export default {
port: 3000,
fetch: app.fetch,
}