pomodoro-timer-with-game

🍅 Pomodoro Timer

A clean, installable Pomodoro focus timer built with vanilla HTML, CSS, and JavaScript — no frameworks, no build step. Every file is thoroughly commented to make the code easy to follow and learn from. Track your tasks, build a study streak, play ambient sounds, and stay focused.

一个干净简洁、可安装的番茄钟,用纯前端技术(HTML / CSS / JavaScript)从零打造,没有使用任何框架,也无需构建步骤。每个文件都配有详细注释,方便阅读和学习。管理任务清单、累积专注天数、播放环境音,帮你保持专注。

🔗 Live demo / 在线体验: https://vv0611.github.io/pomodoro-timer-with-game/timer.html

Demo


📷 Screenshots / 截图

Main interface Customizable durations

Tasks and streaks Fullscreen focus mode


✨ Features / 功能

Core timer

Stay on track

Atmosphere & alerts

Works like an app


核心计时

保持专注

氛围与提醒

像 App 一样使用


🛠️ Technical highlights / 技术亮点

A few details worth a closer look if you’re here to learn:

如果你是来学习的,这几个细节值得细看:


📦 Tech stack / 技术栈


🚀 Run locally / 本地运行

Because it uses a service worker, open it through a local server (not by double-clicking the file). 因为用到了 Service Worker,请通过本地服务器打开(不要直接双击文件)。

# 1. Clone the repo / 克隆仓库
git clone https://github.com/VV0611/pomodoro-timer.git
cd pomodoro-timer

# 2. Start any static server, e.g. with Python / 启动一个静态服务器,例如用 Python:
python -m http.server 5500

# 3. Open in your browser / 在浏览器打开:
#    http://localhost:5500/timer.html

Using VS Code? The Live Server extension works great — right-click timer.html → “Open with Live Server”. 用 VS Code 的话?装 Live Server 扩展很方便 —— 右键 timer.html → “Open with Live Server”。


📁 Project structure / 文件结构

pomodoro-timer/
├── timer.html      # Markup / app structure  ·  页面结构
├── timer.css       # Styles & theme          ·  样式与主题
├── timer.js        # All the timer logic      ·  全部计时逻辑
├── sw.js           # Service worker (offline) ·  Service Worker(离线缓存)
├── manifest.json   # PWA manifest             ·  PWA 配置清单
├── icon.png        # App icon (512×512 PNG)   ·  应用图标
└── cats/           # State-driven cat images (PNG, transparent bg)  ·  状态驱动猫咪图片(透明背景 PNG)
    ├── idle-cat.png
    ├── focus-cat.png
    ├── paused-cat.png
    ├── shortbreak-cat.png
    ├── longbreak-cat.png
    └── done-cat.png

🔄 Changelog / 更新记录

v5.1 — 2026-06-22

Cat Companion polish / 猫咪伴侣细节改善


v5.0 — 2026-06-22

Cat Companion mini-game / 猫咪伴侣小游戏

Cat stats & levelling / 猫咪属性与升级

Shop & Closet tabs / 商店 & 衣柜标签页

PWA update / PWA 更新


v4.4 — 2026-06-15

Auto-start next session / 自动开始下一轮


v4.3 — 2026-06-15

Notification UX & English UI / 通知体验改善 & 界面英文化


v2.0 — 2026-06-13

Ambient sounds overhaul / 环境音重构

Bug fixes / 问题修复

v4.2 — 2026-06-15

Daily pomodoro goal / 每日番茄钟目标


v4.1 — 2026-06-15

Notification prompt & chime / 通知权限提示 & 琶音音效


v4.0 — 2026-06-13

Black-cat theme / 黑猫主题

State-driven cat images / 状态驱动猫咪图片

Polish / 细节打磨


v3.0 — 2026-06-13

Sound files compressed / 音频文件压缩


v1.0 — 2026-06-12


📝 License / 许可

Free to use and learn from. Feel free to fork it and make it your own. 可自由使用和学习。欢迎 fork 并改造成你自己的版本。