Skip to content

Commit 9821e01

Browse files
Merge pull request #2 from nextlevelshit/feature/new-lessons
Feature/new lessons
2 parents 1b3c2b4 + e0cee41 commit 9821e01

21 files changed

Lines changed: 2993 additions & 79 deletions

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
node_modules
44
dist
55
coverage
6+
.env
7+
.env.local
68

79
# Claude Code local settings (user-specific)
810
.claude/settings.local.json

docs/ROADMAP.md

Lines changed: 297 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,297 @@
1+
# Code Crispies Roadmap
2+
3+
## Current State (Updated)
4+
5+
**Total Active Lessons:** 101 (excluding welcome, goodbye, playground)
6+
**Target:** 100 lessons for milestone system ✅ ACHIEVED
7+
8+
### Current Module Breakdown
9+
10+
| Module | Lessons | Category | Status |
11+
|--------|---------|----------|--------|
12+
| Basic Selectors | 10 | CSS ||
13+
| Colors | 4 | CSS ||
14+
| **Gradients** | 3 | CSS | ✅ NEW |
15+
| Typography | 6 | CSS | ✅ +2 |
16+
| Box Model | 8 | CSS ||
17+
| Flexbox | 6 | CSS ||
18+
| Grid | 6 | CSS ||
19+
| **Positioning** | 4 | CSS | ✅ NEW |
20+
| Units & Variables | 4 | CSS ||
21+
| Responsive | 4 | CSS ||
22+
| Transitions & Animations | 4 | CSS ||
23+
| **Filters** | 4 | CSS | ✅ NEW |
24+
| **Pseudo-elements** | 4 | CSS | ✅ NEW |
25+
| HTML Elements | 2 | HTML ||
26+
| **Semantic HTML** | 3 | HTML | ✅ NEW |
27+
| Figure | 3 | HTML ||
28+
| SVG | 3 | HTML ||
29+
| Details/Summary | 3 | HTML ||
30+
| Dialog | 2 | HTML ||
31+
| Progress/Meter | 3 | HTML ||
32+
| Forms Basic | 3 | HTML ||
33+
| Forms Validation | 1 | HTML ||
34+
| Fieldset | 3 | HTML ||
35+
| Datalist | 2 | HTML ||
36+
| Tables | 3 | HTML | ✅ +2 |
37+
| **Total** | **101** | ||
38+
39+
---
40+
41+
## Phase 1: Milestone Progress System ✅ COMPLETED
42+
43+
### Design
44+
45+
Replace percentage-based progress with milestone markers:
46+
47+
```
48+
[1] [5] [10] [20] [30] [50] [75] [100]
49+
● ● ◐ ○ ○ ○ ○ ○
50+
```
51+
52+
**Milestones:**
53+
- 1 lesson - First Step
54+
- 5 lessons - Getting Started
55+
- 10 lessons - Rookie
56+
- 20 lessons - Learner
57+
- 30 lessons - Intermediate
58+
- 50 lessons - Halfway Hero
59+
- 75 lessons - Advanced
60+
- 100 lessons - Master
61+
62+
### Implementation ✅
63+
64+
1. **Update `LessonEngine.getProgressStats()`**
65+
- Added `currentMilestone` and `nextMilestone` fields
66+
- Added `milestonesReached: number[]`
67+
- Added `progressToNext` percentage
68+
69+
2. **Update Progress UI**
70+
- Added milestone dots with visual states (reached, current, next)
71+
- Animate milestone completion
72+
- Show current milestone badge
73+
74+
3. **Add Milestone Celebration**
75+
- Confetti/animation on reaching milestones
76+
- Achievement unlocks in sidebar
77+
78+
---
79+
80+
## Phase 2: New Lessons (34 needed to reach 100)
81+
82+
### Priority 1: Expand Existing Modules (+15 lessons)
83+
84+
#### CSS Colors (+3)
85+
- Gradients (linear-gradient)
86+
- Color functions (hsl, rgb)
87+
- Opacity and transparency
88+
89+
#### Typography (+3)
90+
- Web fonts (@font-face)
91+
- Text shadows
92+
- Letter/word spacing
93+
94+
#### Responsive (+3)
95+
- Container queries
96+
- Aspect ratio
97+
- Clamp() for fluid typography
98+
99+
#### Transitions & Animations (+3)
100+
- Keyframe animations
101+
- Animation timing functions
102+
- Transform origin
103+
104+
#### Tables (+3)
105+
- Table styling (borders, spacing)
106+
- Responsive tables
107+
- Table accessibility
108+
109+
### Priority 2: New CSS Modules (+12 lessons)
110+
111+
#### Filters & Effects (4 lessons)
112+
- CSS filters (blur, brightness, contrast)
113+
- Backdrop filters
114+
- Mix-blend-mode
115+
- Box shadows advanced
116+
117+
#### Positioning (4 lessons)
118+
- Relative positioning
119+
- Absolute positioning
120+
- Fixed/sticky positioning
121+
- Z-index stacking
122+
123+
#### Pseudo-elements (4 lessons)
124+
- ::before and ::after
125+
- ::first-letter and ::first-line
126+
- ::marker for lists
127+
- Content property
128+
129+
### Priority 3: New HTML Modules (+7 lessons)
130+
131+
#### Semantic Structure (3 lessons)
132+
- Article vs Section
133+
- Header/Footer/Main
134+
- Nav and Aside
135+
136+
#### Media Elements (2 lessons)
137+
- Picture element (responsive images)
138+
- Audio/Video basics
139+
140+
#### Accessibility (2 lessons)
141+
- ARIA labels
142+
- Skip links
143+
- Focus management
144+
145+
---
146+
147+
## MDN Topics Reference
148+
149+
### CSS Topics from MDN (prioritized for interactive lessons)
150+
151+
**Layout Systems:**
152+
- [x] Flexbox (covered)
153+
- [x] Grid (covered)
154+
- [ ] Multi-column layout
155+
- [ ] Positioned layout (z-index, stacking)
156+
157+
**Visual Effects:**
158+
- [x] Colors (partially covered)
159+
- [ ] Filters (blur, brightness, contrast, drop-shadow)
160+
- [ ] Blend modes (mix-blend-mode, background-blend-mode)
161+
- [ ] Masking and clipping
162+
- [ ] Shapes (shape-outside)
163+
164+
**Typography:**
165+
- [x] Basic text (covered)
166+
- [ ] Web fonts (@font-face)
167+
- [ ] Variable fonts
168+
- [ ] Text decoration advanced
169+
170+
**Animations:**
171+
- [x] Transitions (covered)
172+
- [ ] Keyframe animations
173+
- [ ] Scroll-driven animations (experimental)
174+
- [ ] View transitions
175+
176+
**Advanced:**
177+
- [x] Custom properties (covered in units-variables)
178+
- [ ] Container queries
179+
- [ ] Anchor positioning (new)
180+
- [ ] Logical properties (for RTL support)
181+
182+
### HTML Topics from MDN
183+
184+
**Structural:**
185+
- [x] Basic elements (covered)
186+
- [x] Figure/figcaption (covered)
187+
- [ ] Article vs section semantics
188+
- [ ] Template element
189+
190+
**Interactive:**
191+
- [x] Details/Summary (covered)
192+
- [x] Dialog (have JSON, not active)
193+
- [ ] Datalist (have JSON, not active)
194+
- [ ] Progress/Meter (have JSON, not active)
195+
196+
**Forms:**
197+
- [x] Basic forms (covered)
198+
- [x] Validation (covered)
199+
- [x] Fieldset (have JSON, not active)
200+
- [ ] Input types exploration
201+
202+
**Media:**
203+
- [x] SVG basics (covered)
204+
- [ ] Picture element
205+
- [ ] srcset and sizes
206+
- [ ] Audio/Video
207+
208+
---
209+
210+
## Inactive Lesson Files (Ready to Activate)
211+
212+
These lesson files exist but aren't in the active module list:
213+
214+
| File | Lessons | Topic |
215+
|------|---------|-------|
216+
| 24-html-progress-meter.json | 3 | Progress/Meter elements |
217+
| 25-html-datalist.json | 2 | Datalist for autocomplete |
218+
| 27-html-dialog.json | 2 | Native dialog element |
219+
| 28-html-forms-fieldset.json | 3 | Fieldset/legend grouping |
220+
| 31-html-marquee.json | 3 | Marquee (deprecated but fun) |
221+
| **Total** | **13** | |
222+
223+
**Quick Win:** Activating these adds 13 lessons immediately → 79 total
224+
225+
---
226+
227+
## Implementation Order
228+
229+
### Week 1: Foundation
230+
1. Design milestone UI component
231+
2. Implement milestone progress system
232+
3. Add milestone celebrations
233+
234+
### Week 2: Quick Wins
235+
4. Activate 5 inactive HTML modules (+13 lessons)
236+
5. Test and fix translations
237+
238+
### Week 3-4: New Content
239+
6. Create Filters & Effects module (+4)
240+
7. Create Positioning module (+4)
241+
8. Expand existing modules (+7)
242+
243+
### Final Polish
244+
9. Reach 100 lessons milestone
245+
10. Add milestone achievements to sidebar
246+
11. Update landing page messaging
247+
248+
---
249+
250+
## Technical Notes
251+
252+
### Milestone Data Structure
253+
254+
```js
255+
const MILESTONES = [1, 5, 10, 20, 30, 50, 75, 100];
256+
257+
function getMilestoneProgress(completed) {
258+
const reached = MILESTONES.filter(m => completed >= m);
259+
const current = reached[reached.length - 1] || 0;
260+
const next = MILESTONES.find(m => m > completed) || 100;
261+
262+
return {
263+
current,
264+
next,
265+
reached,
266+
percentToNext: ((completed - current) / (next - current)) * 100
267+
};
268+
}
269+
```
270+
271+
### Progress Display Update
272+
273+
```html
274+
<div class="milestone-progress">
275+
<div class="milestones">
276+
<span class="milestone reached" data-value="1">1</span>
277+
<span class="milestone reached" data-value="5">5</span>
278+
<span class="milestone current" data-value="10">10</span>
279+
<span class="milestone" data-value="20">20</span>
280+
<!-- ... -->
281+
</div>
282+
<div class="progress-bar">
283+
<div class="progress-fill" style="width: 35%"></div>
284+
</div>
285+
<span class="progress-label">12 of 100 lessons</span>
286+
</div>
287+
```
288+
289+
---
290+
291+
## Success Metrics
292+
293+
- [ ] 100 total lessons
294+
- [ ] Milestone system implemented
295+
- [ ] All 6 languages have translations
296+
- [ ] Achievement celebrations working
297+
- [ ] Mobile responsive milestone UI

lessons/04-typography.json

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,53 @@
9898
"message": "Set letter-spacing to <kbd>1px</kbd>"
9999
}
100100
]
101+
},
102+
{
103+
"id": "text-decoration",
104+
"title": "Text Decoration",
105+
"description": "The <kbd>text-decoration</kbd> property adds lines to text. Common values:<br><br>• <kbd>underline</kbd> — line below text<br>• <kbd>line-through</kbd> — strikethrough<br>• <kbd>none</kbd> — removes decoration (useful for links)<br><br>You can also style decorations with <kbd>text-decoration-color</kbd> and <kbd>text-decoration-style</kbd>.",
106+
"task": "Show the old price with a strikethrough. Add <kbd>text-decoration: line-through</kbd>.",
107+
"previewHTML": "<div class=\"price-box\"><span class=\"old-price\">$49.99</span><span class=\"new-price\">$29.99</span></div>",
108+
"previewBaseCSS": "body { font-family: system-ui; padding: 1rem; } .price-box { display: flex; gap: 1rem; align-items: center; } .old-price { color: #999; font-size: 1rem; } .new-price { color: coral; font-size: 1.5rem; font-weight: bold; }",
109+
"sandboxCSS": "",
110+
"codePrefix": ".old-price {\n ",
111+
"initialCode": "",
112+
"codeSuffix": "\n}",
113+
"previewContainer": "preview-area",
114+
"solution": "text-decoration: line-through;",
115+
"validations": [
116+
{
117+
"type": "property_value",
118+
"value": { "property": "text-decoration", "expected": "line-through" },
119+
"message": "Set text-decoration to <kbd>line-through</kbd>"
120+
}
121+
]
122+
},
123+
{
124+
"id": "text-shadow",
125+
"title": "Text Shadow",
126+
"description": "The <kbd>text-shadow</kbd> property adds shadow effects to text. The syntax is:<br><br><pre>text-shadow: x-offset y-offset blur color;</pre><br>Example: <kbd>text-shadow: 2px 2px 4px gray</kbd> creates a soft shadow offset down and right.",
127+
"task": "Add depth to the heading with <kbd>text-shadow: 2px 2px 4px gray</kbd>.",
128+
"previewHTML": "<h1 class=\"hero-title\">Welcome</h1>",
129+
"previewBaseCSS": "body { font-family: system-ui; padding: 2rem; background: linear-gradient(135deg, #667eea, #764ba2); } .hero-title { margin: 0; font-size: 3rem; color: white; text-align: center; }",
130+
"sandboxCSS": "",
131+
"codePrefix": ".hero-title {\n ",
132+
"initialCode": "",
133+
"codeSuffix": "\n}",
134+
"previewContainer": "preview-area",
135+
"solution": "text-shadow: 2px 2px 4px gray;",
136+
"validations": [
137+
{
138+
"type": "contains",
139+
"value": "text-shadow",
140+
"message": "Use <kbd>text-shadow</kbd> property"
141+
},
142+
{
143+
"type": "contains",
144+
"value": "2px 2px",
145+
"message": "Set offset to <kbd>2px 2px</kbd>"
146+
}
147+
]
101148
}
102149
]
103150
}

0 commit comments

Comments
 (0)