This is the starter code for the Live Coding Session. During the session, we will populate these files to build a Pomodoro Timer featuring:
- ⏱️ Focus, Short Break, and Long Break modes
▶️ Start/Pause/Reset controls with live countdown- 🔄 SVG progress ring animation
- 🎨 Dynamic theme colors based on mode
- 📊 Session tracking
| File | Description |
|---|---|
pomodoro.html |
Contains the complete HTML structure, font links, and button elements. |
styles/pomodoro.css |
Contains CSS variables, GDG color palette, and all styling (pre-built). |
js/main.js |
The main file we'll code together! Contains the skeleton structure with comments and hints. |
- Click the green Code button at the top of this page.
- Select Download ZIP.
- Extract (Unzip) the downloaded file to a folder on your computer.
Open your terminal (Command Prompt or PowerShell) and run:
git clone https://github.com/gdg-pup-webdev/sj2-boilerplate.git- Open this folder in VS Code.
- Right-click
pomodoro.htmland select "Open with Live Server". - Follow along with the speaker!
During this session, we'll cover the following JavaScript concepts:
- Variables & Constants - Storing timer durations and state
- DOM Manipulation - Selecting and updating HTML elements
- Functions - Creating reusable code blocks
- Event Listeners - Responding to button clicks
- setInterval / clearInterval - Creating the countdown timer
- Conditionals - Handling different timer modes
- CSS Custom Properties - Changing theme colors with JavaScript
The js/main.js file is organized into 5 sections:
- Variables & Configuration - Timer durations and state variables
- DOM Elements - Selecting buttons and display elements
- Timer Functions -
updateTimerDisplay(),startTimer(),resetTimer(),setMode() - Event Listeners - Connecting buttons to functions
- Initialization - Starting the app
Happy coding! 🎉