Modify with Understanding
Now that you understand the counter app's anatomy, you can modify it intelligently:
- Know WHERE to make changes
- Know WHY changes work
- Combine manual edits with AI assistance
Setup
Step 1: Create the File
- Open VS Code
- Open your
vibe-coding-coursefolder - Create new file:
counter.html - Copy the counter code from Lesson 2.6
- Save and open with Live Server
Step 2: Verify It Works
- Click + button — count increases
- Click - button — count decreases
- Both buttons respond to hover
Challenge 1: Style Changes (Manual)
Make these modifications without AI help:
1.1: Change Background Color
Task: Change the body background from light gray to light blue.
1.2: Change Count Color
Task: Make the count number dark blue.
1.3: Round the Buttons More
Task: Make buttons more rounded (pill-shaped).
Challenge 2: Logic Changes (Manual)
2.1: Change Starting Value
Task: Make the counter start at 10 instead of 0.
2.2: Change Increment Amount
Task: Make the + button add 5 instead of 1.
2.3: Add a Reset Button
Task: Add a "Reset" button that sets count back to 0.
Challenge 3: Feature Addition (AI-Assisted)
For these challenges, use AI to help write the code.
3.1: Maximum Limit
Task: Add a maximum limit of 100. Display "MAX!" when reaching 100.
3.2: Color Based on Value
Task: Make the count change color:
- Negative: Red
- Zero: Black
- Positive: Green
3.3: Keyboard Support
Task: Allow keyboard control:
- Up arrow or +: Increment
- Down arrow or -: Decrement
- R key: Reset
Modification Checklist
✅ Track Your Progress
0/9Reflection: What Did You Learn?
The Power of Code Literacy
You can now:
- Read code and understand it
- Know WHERE to make changes
- Combine manual edits with AI help
- Debug when things don't work
Bonus Challenge
Transform the counter into a different app while keeping the same code structure.
Ideas:
- Score Keeper: Track two teams' scores
- Temperature Converter: Display in Celsius and Fahrenheit
- Tip Calculator: Enter amount, calculate tip
- Timer Display: Count up every second
Reflection Journal
Module 2 Complete!
What You've Mastered
✅ Module 2 Skills
0/6The Transformation
You've gone from "seeing magic code" to "understanding every line."
Next Module
Module 3: Version Control
Learn to save your code safely with Git and GitHub — the professional safety net!