Commit Graph

388 Commits

Author SHA1 Message Date
08b38a4368 style: move module pill to nav bar with lesson counter
- Module pill now in game-controls between prev/next buttons
- Level indicator (e.g. "1 of 3") inside the pill
- Updated pill styling for nav bar context
2025-12-30 19:51:05 +01:00
bf43902444 style: make hint bar float over editor
- Editor content now extends full height
- Hint area floats at bottom with blur effect
- Hide hint area when empty
- Update hint styling for dark background
2025-12-30 18:36:19 +01:00
bf2a53eca6 style: improve preview section UI
- Make preview-header fully transparent
- Add inset shadow to preview-section
- Remove green tint from expected overlay
2025-12-30 18:34:41 +01:00
6a21cacdee style: make preview-header transparent, remove border 2025-12-30 18:28:57 +01:00
3dfb63ac31 fix: change preview-header border from bottom to top 2025-12-30 18:27:59 +01:00
68472b41fa refactor: shorten compound class names to single words
- box-model: .margin-box→.outer, .border-box→.sized, .shorthand-box→.spaced,
  .padding-box→.padded, .border-demo→.line
- units-variables: .unit-box→.box, .var-box→.themed, .calc-box→.sized,
  .viewport-box→.view
- responsive: .responsive-box→.panel, .fluid-text→.text, .grid-responsive→.cards
- Move expected toggle below preview area
- Update German translations with same changes
2025-12-30 18:23:54 +01:00
45e6cbaa8d fix: reorder instruction elements - title first, pill second
- Move h2 lesson-title before module-pill
- Add more spacing before lesson-description
2025-12-30 18:11:11 +01:00
334b147706 refactor: reorder lesson modules and update footer links
- Reorder modules by learning path: HTML first, then CSS, then Tailwind
- Group modules with comments for clarity
- Change footer link from GitHub to Gitea (librete.ch)
2025-12-30 18:09:47 +01:00
38541c7a78 fix: add kbd tags to lesson messages and reorder task/description
- Replace single quotes with <kbd> tags in validation messages
- German and English lessons updated for consistent formatting
- Move task instruction before description in UI (index.html)
2025-12-30 18:08:11 +01:00
1267ce15ae refactor: shorten class names in layout lessons for easier typing
- flexbox.json: .flex-container → .wrap
- grid.json: .grid-container → .grid, .grid-layout → .page,
  .responsive-grid → .cards, .align-grid → .cells, .overlap-grid → .stack
- 07-layouts.json: .flex-container → .flex, .flex-item → .item,
  .grid-container → .grid
- CLAUDE.md: add short class names rule (1-2 syllables max)
2025-12-30 16:47:31 +01:00
3bf630adf6 fix: ensure preview iframe html/body have min-height 100% 2025-12-30 16:29:49 +01:00
15f10bcdf8 refactor: shorten lesson titles and improve content
- Shorten verbose lesson titles for better sidebar display
- Minor content improvements across lessons
2025-12-30 16:22:48 +01:00
23549f1e90 fix: improve lesson content with kbd tags, solutions, and animation contrast
- Add <kbd> tags to CSS property values and selectors in task descriptions
- Add solution code to all lessons for better guidance
- Improve animation contrast in transitions lesson (black/white instead
  of similar purples, dramatic color changes for visibility)
- Simplify validation messages with kbd formatting
2025-12-30 16:22:24 +01:00
91241e000a Merge branch 'feat/i18n-js' - JS-based internationalization 2025-12-30 16:11:23 +01:00
2e8cd6a050 feat(i18n): add dynamic lesson loading by language
- Import both EN and DE lesson files in lessons.js
- loadModules() now accepts language parameter
- toggleLanguage() reloads lessons in new language
- initializeModules() uses current language from i18n
- Preserves user position when switching languages
2025-12-30 15:43:00 +01:00
f0f7cd6779 test: update renderer tests for i18n changes
Remove expectations for Lessons heading since it's now in
HTML rather than being added by renderModuleList()
2025-12-30 15:12:04 +01:00
28f53c7dc3 chore: change port to 1234 and add Makefile/flake.nix
- Change dev server port from 1312 to 1234
- Add Makefile for common development commands
- Add flake.nix for Nix development environment
2025-12-30 15:11:57 +01:00
b9f8fde9b9 fix(i18n): update help text to reflect live preview
- Preview updates automatically as you type
- Ctrl+Enter triggers immediate validation, not required for basic use
2025-12-30 15:11:50 +01:00
08c3c8faee refactor(i18n): remove duplicate German files
German content now handled via i18n.js translations module.
Removes index.de.html and app.de.js in favor of single
language-agnostic codebase.
2025-12-30 15:10:57 +01:00
ffee16a3d4 feat(i18n): integrate translations in app.js
- Import and initialize i18n module
- Add language toggle button handler
- Replace hardcoded strings with t() function calls
- Update dynamic text (progress, success messages, etc.)
2025-12-30 15:10:44 +01:00
0570453a25 feat(i18n): add JS-based internationalization
- Create i18n.js module with EN/DE translations
- Add data-i18n attributes to index.html for dynamic text
- Update renderer.js to use translation functions
- Language switcher button replaces link to German page
- Stores preference in localStorage, detects browser language
2025-12-30 15:10:38 +01:00
0ad7ea1c54 feat: close dialogs on backdrop click
Native dialog elements don't close on backdrop click by default.
Added click handlers that check if click target is the dialog itself
(not its children) to enable this expected UX behavior.
2025-12-30 14:54:49 +01:00
83d1bb4d18 docs: expand help dialog with learning modes and editor tools
- Add About section mentioning open-source and no account required
- Add Learning Modes section (CSS, Tailwind, HTML)
- Add Editor Tools section (undo, redo, reset, show expected)
- Add dedicated Keyboard Shortcuts section
- Update Emmet examples to be more practical
2025-12-30 14:54:43 +01:00
901c584145 style: widen help dialog from 500px to 600px 2025-12-30 14:54:35 +01:00
44e9f3041f fix: remove redundant Lessons heading from sidebar
The HTML already has an h4 heading for the lessons section with proper
ARIA labeling. The renderer was adding a duplicate h3 heading.
2025-12-30 14:54:28 +01:00
1803cc40f5 refactor: remove placeholder HTML comments from lesson initialCode
Clean up lesson files by removing useless HTML comment placeholders
from initialCode fields. Users now start with a clean editor instead
of seeing instructional comments they need to delete.
2025-12-30 12:45:18 +01:00
6f00985894 fix(i18n): change button text 'Erneut' to 'Erneut anwenden' 2025-12-30 12:39:08 +01:00
d491ff6a1e docs: clarify that progress element is not self-closing
Make explicit that <progress> requires a closing tag and can
contain fallback text, unlike self-closing tags like <input>.
2025-12-30 12:37:54 +01:00
a2649c9d2d feat: add Emmet pro tip to FAQ accordion lesson
Explain details*3>summary+p shorthand for quickly scaffolding
multiple disclosure widgets with nested summary and p elements.
2025-12-30 12:36:05 +01:00
ad74e22f61 docs: add lesson design best practices to CLAUDE.md
Document learnings for creating effective lessons:
- Clear task instructions with selector and property
- Use codePrefix for context
- Simple, human-friendly values
- Named CSS colors for engagement
- Focused validations
- Semantic HTML in examples
2025-12-30 12:25:33 +01:00
2f2969da11 fix: escape HTML tags in lesson validation messages
Prevent HTML elements like <details>, <option>, <form> from being
rendered as actual elements in hint messages by properly escaping
them with &lt; &gt; and wrapping in <kbd> tags.
2025-12-30 12:25:22 +01:00
a8db5b69cf refactor: improve lesson clarity and use friendlier values
Flexbox and Box Model lessons:
- Use explicit task instructions with selector AND property
- Include selector in codePrefix for better context
- Replace hex colors with named CSS colors (steelblue, coral, etc.)
- Simplify values (2px instead of 0.125rem, 1rem instead of 1.25rem)
- Remove redundant contains validations
- Wrap code examples in <code> tags for proper styling
2025-12-30 12:25:15 +01:00
2edec54110 style: add code element styling and accessibility enhancements
- Style code elements in task instructions with white alpha background
- Style code elements in lesson descriptions and hints
- Add skip-link CSS for keyboard navigation
- Add sidebar shift animation when drawer is open
- Add focus styles for sidebar navigation items
2025-12-30 12:25:02 +01:00
36c281d7e7 feat: improve sidebar keyboard accessibility
- Add skip-to-content link for keyboard users
- Convert module headers and lesson items from divs to buttons
- Add ARIA attributes (aria-expanded, aria-controls, aria-label)
- Add focus return to trigger element when closing sidebar
- Shift main content when sidebar is open using CSS :has()
- Add code element styling in instruction boxes
2025-12-30 12:24:53 +01:00
09f937ca07 feat: add CSS lessons matching lecture content (box model, flexbox, responsive, transitions, variables)
- Add 5 CSS modules to lessons.js config (EN)
- Create German translations for all 5 CSS modules
- Add CSS modules to lessons.de.js config
- Fix test to use toBeGreaterThanOrEqual for module count
2025-12-29 15:26:59 +01:00
2ce8bb2b1e fix: remove kbd tags from actual HTML code in lessons
- Remove erroneous kbd tags from solution/initialCode fields
- Keep kbd tags only in messages/descriptions where appropriate
2025-12-25 15:59:59 +01:00
31407dcb51 fix: add kbd tags to validation messages for clarity
- Wrap HTML element names in <kbd> tags in all validation messages
- Apply consistent formatting to both English and German lessons
- Make hints clearer about which elements/attributes to use
- Fix mobile editor layout overflow issue
2025-12-25 15:55:26 +01:00
935969a80c fix: improve WCAG compliance and mobile editor height
- Add aria-describedby to password inputs for screen readers
- Connect hint text to input via id reference
- Increase mobile editor min-height to 50vh
2025-12-25 15:28:11 +01:00
3cbb404781 fix: add minimum height for code editor on mobile
- Set min-height: 200px for editor-section
- Set min-height: 150px for editor-content
- Ensures editor is usable on small screens
2025-12-25 15:27:03 +01:00
5ec56e52fc feat: add module pill indicator and cross-module navigation
- Add module title pill above lesson title showing current category
- Enable next/prev buttons to cross module boundaries
- Automatically advance to next module when completing last lesson
- Go to last lesson of previous module when navigating back
2025-12-25 15:25:39 +01:00
c8a643582f fix: remove placeholder comments and improve German translations
- Remove placeholder comments from initialCode fields
- Fix typo: "wichtig Wort" -> "wichtigen Wort" in de/20-html-elements.json
- Improve German validation messages for readability
- Use consistent terminology (Eingabefeld instead of Input)
2025-12-25 15:16:31 +01:00
529256b367 feat: add 10 new HTML5 lesson modules (EN + DE)
New lesson modules covering native HTML5 features:
- Details & Summary: disclosure widgets
- Progress & Meter: progress bars and gauges
- Datalist: autocomplete inputs
- Data Attributes: custom data-* attributes
- Dialog: native modal dialogs
- Forms with Fieldset: grouped form controls
- Figure & Figcaption: self-contained content
- Tables: structured data with caption, thead, tbody, tfoot
- Marquee: classic scrolling text (deprecated but fun)
- SVG Basics: drawing circles, rectangles, and lines

Each module includes 2-3 progressive lessons with fancy
styling (pastel gradients, 100vh layouts, etc).
2025-12-25 14:23:37 +01:00
524b353589 refactor: simplify HTML lessons to use semantic elements only
- Remove presentational classes (.form-group, .required, .hint, .checkbox-group)
- Replace <span class="required">*</span> with plain * in label text
- Replace <div class="hint"> with semantic <small> element
- Simplify checkbox markup to use native label wrapping pattern
- Update previewBaseCSS to style semantic elements directly
- Add code quality standards to CLAUDE.md emphasizing WCAG compliance and native HTML
2025-12-24 01:55:47 +01:00
1761fa8ad2 feat: rename success message to "CRISPY!" with Japanese smiley
- Update overlay text: "Perfect Match!" → "CRISPY! ٩(◕‿◕)۶"
- Update success hint in English and German versions
- Fun branding touch matching the app name
2025-12-24 01:43:26 +01:00
7fb70e7257 refactor: replace custom modal with native HTML dialog element
- Convert help and reset modals to native <dialog> elements
- Content is now in HTML, not dynamically generated via JS
- Use dialog.showModal() and dialog.close() native API
- Dialog handles Escape key natively for closing
- Fix list indentation in help dialog with proper padding
- Add styled kbd elements for keyboard shortcuts
- Separate dialogs for help and reset confirmation
- Apply same changes to German version

Benefits:
- Better accessibility (native focus trapping, escape handling)
- Simpler JavaScript (no DOM manipulation for content)
- Content visible in HTML source for easier editing
- Native backdrop styling via ::backdrop
2025-12-24 00:57:24 +01:00
1c99e0ab0d feat: add language switcher between English and German
- Add language toggle button in header (EN/DE)
- Link directly to the other language version
- Style consistent with existing header buttons
- Accessible with proper aria-labels
2025-12-24 00:51:54 +01:00
1cecc549a2 feat: add complete German translation of the website
- Add German HTML entry point (index.de.html)
- Add German app.js with translated UI strings (app.de.js)
- Add German lesson config (lessons.de.js)
- Add German translations of all 6 lesson modules:
  - HTML Elements: Block vs Inline
  - HTML Forms: Basic Inputs
  - HTML Forms: Validation
  - CSS: Basic Selectors
  - CSS: Advanced Selectors
  - Tailwind: Basics

All IDs, variable names, and code examples remain in English.
Only user-facing text has been translated to German.
2025-12-24 00:32:07 +01:00
8d5e126258 fix: remove unused validation percentage indicator
The 0% indicator next to the Run button was not providing useful
feedback. Removed from HTML, CSS, and app.js.
2025-12-24 00:17:28 +01:00
1328d7c004 feat: add undo/redo/reset editor tools with keyboard shortcuts
- Add history extension to CodeMirror for undo/redo support
- Ctrl+Z for undo, Ctrl+Shift+Z for redo now work
- Add toolbar buttons: ↶ Undo, ↷ Redo, ⟲ Reset
- Reset button restores editor to initial lesson code
- Add .btn-icon and .editor-tools CSS styles
2025-12-23 23:14:32 +01:00
c98d8326b5 fix: align HTML lesson task instructions with solution code
Update task instructions to explicitly specify all content that appears
in the solution, so students can complete lessons without guessing:

- semantic-containers: specify "My Website", "Welcome to my site!", "Copyright 2025"
- form-structure: specify label text "Name:" and attribute values
- input-types: specify label texts "Email:" and "Password:"
- input-constraints: specify placeholder text "Enter password"
2025-12-23 09:39:07 +01:00