A professional, accessible, and feature-rich Pomodoro timer built with vanilla JavaScript. Boost your productivity with the proven Pomodoro Technique.
- โฑ๏ธ Customizable Timers - Set your own work, break, and long break durations
- ๐ Cycle Tracking - Zero-indexed cycles (0/4 โ 4/4) with automatic long breaks
- ๐ต Background Music - YouTube integration with hidden player (audio only)
- ๐ Smart Notifications - Browser notifications when sessions complete
- ๐พ Auto-Save - All settings and progress saved automatically
- ๐ฑ Progressive Web App - Install on any device, works offline
- โฟ WCAG AA Compliant - Fully accessible to all users
- ๐จ Modern UI - Clean blue accent design with smooth animations
- ๐ Dark Mode - Automatic dark mode based on system preferences
- โจ๏ธ Keyboard Shortcuts - Full keyboard navigation (Space, R, S)
- ๐ Responsive - Works perfectly on all screen sizes (360px to 4K)
- ๐ก๏ธ Offline Support - Service worker caches everything
- ๐ Zero Dependencies - Pure vanilla JavaScript
- ๐ง Modular Architecture - Clean, maintainable code structure
- ๐ก๏ธ Error Handling - Comprehensive error handling and recovery
- ๐ Privacy First - All data stored locally, no tracking
- ๐ Cross-Browser - Works on Chrome, Firefox, Safari, Edge
- ๐ Professional Logging - Developer-friendly console messages
-
Clone the repository
git clone https://github.com/hjadmz/pomodoro-timer.git cd pomodoro-timer -
Serve the files
Using Python:
python -m http.server 8000Using Node.js:
npx serveUsing PHP:
php -S localhost:8000 -
Open in browser
http://localhost:8000
- Click Start to begin a 25-minute work session
- Work until the timer completes
- Take a 5-minute short break
- After 4 work cycles, enjoy a 15-minute long break
Space- Start/Pause timerR- Reset timerS- Jump to settings
- Scroll to the Settings section
- Adjust durations and cycles to your preference
- Enable notifications (requires browser permission)
- Add a YouTube URL for background music (optional)
- Click Save Settings
| Browser | Minimum Version | Support Level |
|---|---|---|
| Chrome | 90+ | โ Full |
| Firefox | 88+ | โ Full |
| Safari | 14+ | โ Full |
| Edge | 90+ | โ Full |
| iOS Safari | 14+ | |
| Android Chrome | 90+ | โ Full |
pomodoro-timer/
โโโ index.html # Main HTML
โโโ manifest.webmanifest # PWA manifest
โโโ service-worker.js # Offline support
โโโ offline.html # Offline fallback
โโโ robots.txt # SEO configuration
โโโ LICENSE # MIT License
โโโ README.md # This file
โโโ .gitignore # Git exclusions
โโโ css/
โ โโโ style.css # Complete stylesheet
โโโ js/
โ โโโ state.js # State management
โ โโโ timer.js # Timer logic
โ โโโ player.js # YouTube integration
โ โโโ notifications.js # Notification handling
โ โโโ ui.js # UI updates
โ โโโ app.js # Main orchestrator
โโโ assets/
โโโ icons/ # PWA icons (12 sizes)
Edit CSS custom properties in css/style.css:
:root {
--color-primary: #3b82f6; /* Blue accent */
--color-success: #10b981; /* Success states */
--color-bg: #f8fafc; /* Background */
--color-text: #1e293b; /* Text color */
}
Default durations in js/state.js:
const DEFAULT_STATE = {
settings: {
workDuration: 25, // Minutes
breakDuration: 5, // Minutes
longBreakDuration: 15, // Minutes
cyclesBeforeLongBreak: 4 // Cycles (0-indexed)
}
};
- Semantic HTML - Proper heading hierarchy and landmarks
- ARIA Labels - Comprehensive screen reader support
- Keyboard Navigation - All functionality accessible via keyboard
- Focus Indicators - Clear visual focus states
- Color Contrast - WCAG AA compliant (4.5:1+ ratios)
- Reduced Motion - Respects
prefers-reduced-motion - Touch Targets - Minimum 44x44px tap targets
- No Tracking - Zero analytics or tracking scripts
- Local Storage Only - All data stored on your device
- No External Requests - Except YouTube (optional)
- No Cookies - No cookies used
- Open Source - Full transparency
Desktop:
- Click the install icon in the address bar
- Follow browser prompts
Mobile:
- Open in browser
- Tap "Add to Home Screen"
- Confirm installation
- Works completely offline after first load
- Settings and progress saved locally
- Graceful degradation for online-only features
- Check browser supports notifications
- Grant permission when prompted
- Note: iOS Safari doesn't support web notifications
- Check internet connection
- Verify valid YouTube URL format
- Check browser console for errors
- Ensure localStorage is available
- Not in private/incognito mode
- Check browser console for errors
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
- Indentation: 2 spaces
- Naming: camelCase (JS), kebab-case (CSS)
- Comments: JSDoc for functions
- No emojis in code (only in README)
This project is licensed under the MIT License - see LICENSE file.
Henry Adams
- GitHub: @hjadmz
- Pomodoro Techniqueยฎ by Francesco Cirillo
- YouTube IFrame API by Google
- Inspired by the productivity community
- Issues: GitHub Issues
- Discussions: GitHub Discussions
Made with โค๏ธ by Henry Adams
Pomodoro Techniqueยฎ is a registered trademark of Francesco Cirillo