Files
code-crispies/src/index.de.html
Michael Czechowski 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

198 lines
7.1 KiB
HTML

<!doctype html>
<html lang="de">
<head>
<meta charset="UTF-8" />
<link rel="icon" href="./favicon.ico" type="image/x-icon" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>CODE CRISPIES - CSS interaktiv lernen</title>
<link rel="stylesheet" href="main.css" />
</head>
<body>
<div class="app-container">
<!-- Minimaler Header -->
<header class="header">
<button id="menu-btn" class="menu-toggle" aria-label="Menü öffnen">
<span class="hamburger-line"></span>
<span class="hamburger-line"></span>
<span class="hamburger-line"></span>
</button>
<div class="logo">
<img src="./bowl.png" width="40" alt="CODE CRISPIES Logo" />
<h1>CODE<span>CRISPIES</span></h1>
</div>
<div class="header-actions">
<a href="./index.html" class="lang-switch" aria-label="Switch language: English">EN</a>
<button id="help-btn" class="help-toggle" aria-label="Hilfe">?</button>
</div>
</header>
<!-- Hauptlayout -->
<main class="game-layout">
<!-- Linke Spalte: Anleitung + Editor -->
<div class="left-panel">
<section class="instructions">
<h2 id="lesson-title">Laden...</h2>
<div class="lesson-description" id="lesson-description">
Bitte wähle eine Lektion aus, um zu beginnen.
</div>
<div class="task-instruction" id="task-instruction">
<!-- Aufgabenanweisungen werden hier angezeigt -->
</div>
</section>
<section class="editor-section">
<div class="code-editor">
<div class="editor-header">
<label for="code-input" class="editor-label">CSS-Editor</label>
<div class="editor-actions">
<div class="editor-tools">
<button id="undo-btn" class="btn btn-icon" title="Rückgängig (Strg+Z)"></button>
<button id="redo-btn" class="btn btn-icon" title="Wiederholen (Strg+Umschalt+Z)"></button>
<button id="reset-code-btn" class="btn btn-icon" title="Auf Anfangscode zurücksetzen"></button>
</div>
<button id="run-btn" class="btn btn-run">
<img src="./gear.svg" alt="" />Ausführen
</button>
</div>
</div>
<div class="editor-content">
<!-- Textarea wird durch CodeMirror ersetzt -->
<textarea id="code-input" class="code-input" spellcheck="false" autocomplete="off" style="display: none;"></textarea>
</div>
</div>
<div class="hint-area" id="hint-area">
<!-- Hinweise werden hier angezeigt -->
</div>
</section>
</div>
<!-- Rechte Spalte: Vorschau + Navigation -->
<div class="right-panel">
<div class="preview-section">
<div class="preview-header">
<span class="preview-label">Deine Ausgabe</span>
<button id="show-expected-btn" class="btn btn-small">Lösung zeigen</button>
</div>
<div class="preview-wrapper">
<div class="preview-frame" id="preview-area">
<!-- Vorschau-Iframe wird hier angezeigt -->
</div>
<div class="expected-overlay" id="expected-overlay">
<div class="expected-frame" id="preview-expected">
<!-- Erwartetes Ergebnis (umschaltbar) -->
</div>
</div>
</div>
</div>
<div class="game-controls">
<button id="prev-btn" class="btn">Zurück</button>
<div class="level-indicator" id="level-indicator">Lektion 0/0</div>
<button id="next-btn" class="btn btn-primary">Weiter</button>
</div>
</div>
</main>
<!-- Seitenleisten-Hintergrund -->
<div class="sidebar-backdrop" id="sidebar-backdrop"></div>
<!-- Ausklappbare Seitenleiste -->
<aside class="sidebar-drawer" id="sidebar-drawer">
<div class="sidebar-header">
<h3>Menü</h3>
<button id="close-sidebar" class="close-btn" aria-label="Menü schließen">&times;</button>
</div>
<div class="sidebar-section">
<h4>Fortschritt</h4>
<div class="progress-display" id="progress-display">
<div class="progress-bar">
<div class="progress-fill" id="progress-fill"></div>
</div>
<span class="progress-text" id="progress-text">0% abgeschlossen</span>
</div>
</div>
<div class="sidebar-section">
<h4>Lektionen</h4>
<div class="module-list" id="module-list">
<!-- Modulliste wird hier eingefügt -->
</div>
</div>
<div class="sidebar-section">
<h4>Einstellungen</h4>
<label class="toggle-switch">
<input type="checkbox" id="disable-feedback-toggle" checked />
<span class="toggle-slider"></span>
<span class="toggle-label">Hinweise anzeigen</span>
</label>
<button id="reset-btn" class="btn btn-text">Fortschritt zurücksetzen</button>
</div>
<footer class="app-footer">
Open Source:
<a href="https://github.com/nextlevelshit/code-crispies" target="_blank">GitHub</a>
von <a href="https://dailysh.it" title="Michael W. Czechowski">mwc</a>
</footer>
</aside>
<!-- Hilfe-Dialog -->
<dialog id="help-dialog" class="dialog">
<div class="dialog-header">
<h3>Hilfe</h3>
<button id="help-dialog-close" class="dialog-close" aria-label="Schließen">&times;</button>
</div>
<div class="dialog-content">
<h4>So verwendest du Code Crispies</h4>
<p>Code Crispies ist eine interaktive Plattform zum Lernen von HTML, CSS und Tailwind durch praktische Übungen.</p>
<h4>Erste Schritte</h4>
<p>Öffne das Menü (☰), um ein Lektionsmodul auszuwählen. Jedes Modul enthält eine Reihe von Lektionen.</p>
<h4>Lektionen abschließen</h4>
<ol>
<li>Lies die Anleitung auf der linken Seite</li>
<li>Schreibe deinen Code im Editor</li>
<li>Klicke auf "Ausführen" oder drücke Strg+Enter zum Testen</li>
<li>Folge den Hinweisen, um Fehler zu beheben</li>
<li>Klicke auf "Weiter", wenn du fertig bist</li>
</ol>
<h4>Tipps</h4>
<ul>
<li>Klicke auf "Lösung zeigen", um das Zielergebnis zu sehen</li>
<li>Dein Fortschritt wird automatisch gespeichert</li>
<li>Strg+Enter führt deinen Code aus</li>
</ul>
<h4>Emmet-Kürzel (HTML-Modus)</h4>
<p>Tippe Abkürzungen und drücke Tab zum Erweitern:</p>
<ul>
<li><kbd>div.container</kbd> → div mit Klasse</li>
<li><kbd>ul>li*5</kbd> → ul mit 5 li-Kindern</li>
<li><kbd>nav>ul>li*3>a</kbd> → verschachtelte Struktur</li>
<li><kbd>p{Hallo}</kbd> → p mit Textinhalt</li>
</ul>
</div>
</dialog>
<!-- Zurücksetzen-Bestätigungsdialog -->
<dialog id="reset-dialog" class="dialog">
<div class="dialog-header">
<h3>Fortschritt zurücksetzen</h3>
<button id="reset-dialog-close" class="dialog-close" aria-label="Schließen">&times;</button>
</div>
<div class="dialog-content">
<p>Bist du sicher, dass du deinen gesamten Fortschritt zurücksetzen möchtest? Dies kann nicht rückgängig gemacht werden.</p>
<div class="dialog-actions">
<button id="cancel-reset" class="btn">Abbrechen</button>
<button id="confirm-reset" class="btn btn-ghost">Alles zurücksetzen</button>
</div>
</div>
</dialog>
</div>
<script type="module" src="app.de.js"></script>
</body>
</html>