No description
  • Svelte 88.4%
  • TypeScript 4.7%
  • HTML 3.1%
  • CSS 3%
  • JavaScript 0.8%
Find a file
Tej Chajed 2d728835f4
Make app a PWA with offline support (#11)
## Summary
- Add `@vite-pwa/sveltekit` for automatic service worker generation
(Workbox) and web manifest
- Generate 192px and 512px PNG icons from `favicon.svg` at build time
via a sharp-based Vite plugin
- Enable prerendering via `+layout.ts` so the PWA precache includes the
HTML shell
- Add apple-touch-icon and favicon links to `app.html`

## Test plan
- [x] `bun run build` completes with no warnings
- [x] `bun run check` passes
- [x] Built output includes `sw.js`, `manifest.webmanifest`,
`icon-192.png`, `icon-512.png`
- [x] App is installable as a PWA in Chrome/Safari
- [x] App works offline after initial load

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

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 09:07:08 -05:00
.claude Make prettier a claude hook 2026-02-26 21:28:46 -06:00
.github Merge pull request #2 from tchajed/dependabot/github_actions/actions/checkout-6 2026-02-26 20:58:09 -06:00
src Make app a PWA with offline support (#11) 2026-03-19 09:07:08 -05:00
static Add clock favicon 2026-02-26 21:00:30 -06:00
.gitignore Initial exam timer app 2026-02-26 20:29:08 -06:00
.npmrc Initial exam timer app 2026-02-26 20:29:08 -06:00
.prettierrc Initial exam timer app 2026-02-26 20:29:08 -06:00
bun.lock Make app a PWA with offline support (#11) 2026-03-19 09:07:08 -05:00
CLAUDE.md prettier 2026-02-26 21:28:45 -06:00
LOG.md prettier 2026-02-26 21:28:45 -06:00
package.json Make app a PWA with offline support (#11) 2026-03-19 09:07:08 -05:00
README.md prettier 2026-02-26 20:55:52 -06:00
svelte.config.js prettier 2026-02-26 20:55:52 -06:00
tsconfig.json prettier 2026-02-26 20:55:52 -06:00
vite.config.ts Make app a PWA with offline support (#11) 2026-03-19 09:07:08 -05:00

Exam Timer

A single-page web app for displaying a countdown timer and instructions to students during an exam.

Features

  • Instructions pane — left side shows rendered Markdown; click anywhere to edit the source, press Escape or click "Done" to return to the preview
  • Timer pane — right side shows a large countdown; set the timer by entering either a duration (hours + minutes) or a specific end time
  • Color transitions as time runs low: amber → orange (< 10 min) → red with pulse (< 5 min) → "Time's Up"
  • Both the instructions and the timer end time persist in localStorage, so a page reload resumes where you left off

Development

bun install
bun run dev

Open http://localhost:5173.

Scripts

Script Description
bun run dev Start dev server
bun run build Production build
bun run preview Preview the production build
bun run check Type-check with svelte-check
bun run format Format all files with Prettier

Stack