Aufgaben-Python/courses/html_css/13_bem_methodik_und_modularitaet/musterloesung.html

190 lines
5.1 KiB
HTML

<!DOCTYPE html>
<html lang="de">
<head>
<link rel="icon" type="image/svg+xml" href="../../../assets/favicon.svg">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Musterlösung: BEM-Methodik &amp; Modularität</title>
<style>
:root {
--primary: #4f46e5;
--primary-hover: #4338ca;
--bg: #0f172a;
--surface: #1e293b;
--text: #f8fafc;
--text-muted: #94a3b8;
--border: #334155;
--accent: #8b5cf6;
--amber: #f59e0b;
}
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
background-color: var(--bg);
color: var(--text);
line-height: 1.6;
padding: 30px;
}
.container {
max-width: 960px;
margin: 0 auto;
}
.pricing-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
gap: 24px;
margin-top: 32px;
align-items: center;
}
/* 🎯 TEILZIEL 1: BEM Block & Elements für .pricing-card */
.pricing-card {
background: var(--surface);
border: 1px solid var(--border);
border-radius: 12px;
padding: 28px;
display: flex;
flex-direction: column;
gap: 20px;
position: relative;
transition: all 0.2s ease;
}
.pricing-card__header {
display: flex;
justify-content: space-between;
align-items: center;
}
.pricing-card__title {
font-size: 1.25rem;
font-weight: 700;
}
.pricing-card__price {
font-size: 2.2rem;
font-weight: 800;
color: var(--text);
}
.pricing-card__features {
list-style: none;
display: flex;
flex-direction: column;
gap: 10px;
color: var(--text-muted);
font-size: 0.95rem;
}
/* 🎯 TEILZIEL 2: BEM Block-Modifier .pricing-card--popular */
.pricing-card--popular {
border-color: var(--accent);
box-shadow: 0 10px 25px -5px rgba(139, 92, 246, 0.3);
transform: scale(1.03);
}
/* 🎯 TEILZIEL 3: BEM Button-Block .btn & Modifiers */
.btn {
display: block;
width: 100%;
text-align: center;
padding: 10px 20px;
border-radius: 6px;
font-weight: 600;
text-decoration: none;
cursor: pointer;
border: none;
transition: all 0.2s ease;
}
.btn--primary {
background: var(--primary);
color: white;
}
.btn--primary:hover {
background: var(--primary-hover);
}
.btn--outline {
background: transparent;
border: 1px solid var(--border);
color: var(--text);
}
.btn--outline:hover {
background: rgba(255, 255, 255, 0.05);
border-color: var(--text-muted);
}
/* 🎯 TEILZIEL 4: BEM Badge-Element & Modifier */
.pricing-card__badge {
font-size: 0.75rem;
font-weight: 700;
padding: 4px 10px;
border-radius: 9999px;
text-transform: uppercase;
letter-spacing: 0.5px;
}
.pricing-card__badge--highlight {
background: var(--amber);
color: #000;
}
</style>
</head>
<body>
<div class="container">
<header style="text-align: center;">
<h1 style="font-size: 2.2rem; margin-bottom: 8px;">Wähle deinen Plan</h1>
<p style="color: var(--text-muted);">Modulare BEM-Komponenten ohne Kaskaden-Konflikte.</p>
</header>
<main>
<div class="pricing-grid">
<!-- Starter Plan -->
<article class="pricing-card">
<div class="pricing-card__header">
<h3 class="pricing-card__title">Starter</h3>
<span class="pricing-card__badge" style="background: rgba(255,255,255,0.1); color: var(--text-muted);">Basis</span>
</div>
<div class="pricing-card__price">€ 0 <span style="font-size: 1rem; color: var(--text-muted); font-weight: 400;">/ Monat</span></div>
<ul class="pricing-card__features">
<li>✓ 1 Projekt</li>
<li>✓ Community Support</li>
<li>✓ Standard Analytics</li>
</ul>
<div class="pricing-card__footer">
<a href="#" class="btn btn--outline">Kostenlos starten</a>
</div>
</article>
<!-- Pro Plan (Popular Modifier) -->
<article class="pricing-card pricing-card--popular">
<div class="pricing-card__header">
<h3 class="pricing-card__title">Professional</h3>
<span class="pricing-card__badge pricing-card__badge--highlight">🔥 Beliebt</span>
</div>
<div class="pricing-card__price">€ 29 <span style="font-size: 1rem; color: var(--text-muted); font-weight: 400;">/ Monat</span></div>
<ul class="pricing-card__features">
<li>✓ Unbegrenzte Projekte</li>
<li>✓ Prioritäts-Support</li>
<li>✓ Erweiterte Metriken &amp; Dark Mode</li>
</ul>
<div class="pricing-card__footer">
<a href="#" class="btn btn--primary">Jetzt upgraden</a>
</div>
</article>
</div>
</main>
</div>
</body>
</html>