add js demos for chapter 3: manipulate, classlist, create, events, preventdefault, todo, fetch, localstorage

This commit is contained in:
2026-04-20 13:14:56 +02:00
parent 754ff9436c
commit 7626852ac1
25 changed files with 664 additions and 0 deletions

View File

@@ -0,0 +1,46 @@
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<title>LocalStorage</title>
<style>
body { font-family: system-ui, sans-serif; padding: 1.5rem; }
.card {
border: 1px solid #e5e7eb;
border-radius: 6px;
padding: 14px;
margin-bottom: 1rem;
background: #f9fafb;
}
h3 { margin: 0 0 0.4rem; font-size: 0.85rem; color: #6b7280; text-transform: uppercase; letter-spacing: 0.04em; }
.kv {
display: grid;
grid-template-columns: auto 1fr;
gap: 6px 14px;
font-family: ui-monospace, monospace;
font-size: 0.9rem;
}
.k { color: #7c2d12; font-weight: 700; }
.v { color: #14532d; }
.reload {
background: #dcfce7;
border: 2px solid #16a34a;
padding: 10px 14px;
border-radius: 6px;
color: #14532d;
font-weight: 600;
}
.icon { font-size: 1.2em; margin-right: 6px; }
</style>
</head>
<body>
<div class="card">
<h3>localStorage</h3>
<div class="kv">
<div class="k">"name"</div><div class="v">"Max"</div>
<div class="k">"settings"</div><div class="v">{"darkMode":true}</div>
</div>
</div>
<div class="reload"><span class="icon">💾</span>Bleibt nach Reload / Browser-Neustart erhalten</div>
</body>
</html>