Phase 0+1: Scaffold, Datenmodell, Karte und Liste
Reines HTML5/CSS3/JavaScript ohne Build-Tooling, lauffaehig direkt per Doppelklick auf index.html (file://, kein Server noetig): - Datenmodell fuer Ausflugsziele mit allen Feldern aus der Anforderung, 15 feste Kategorien inkl. Farbe/Icon - Zentraler Pub/Sub-Store mit LocalStorage-Persistenz und Migrations-Grundgeruest - Interaktive Karte (Leaflet + Leaflet.markercluster, lokal vendored) mit kategoriefarbenen Markern, Clustering, Popups, Geolocation-Button - Kartengrundlage ueber CARTO-Basemaps statt tile.openstreetmap.org, da dessen Referer-Pflicht file://-Aufrufe blockiert - Seed-Daten als eingebettetes Script (data/seed.js) statt JSON-Datei, da fetch() auf lokale Dateien unter file:// nicht zuverlaessig funktioniert - Ergebnisliste mit 10 Beispiel-Ausflugszielen, sicher gerendert ueber textContent/DOM-APIs statt innerHTML (Vorbereitung fuer spaeteren KI-JSON-Import mit Fremddaten) - Responsives Layout (Desktop nebeneinander, Mobile gestapelt)
This commit is contained in:
@@ -0,0 +1,129 @@
|
||||
/* Wiederverwendbare Komponenten: Status-Banner, Buttons, Ergebnis-Cards,
|
||||
Karten-Marker/Popups. */
|
||||
|
||||
.app-status {
|
||||
background: #fdecea;
|
||||
color: var(--color-danger);
|
||||
padding: var(--space-sm) var(--space-lg);
|
||||
font-size: 0.9rem;
|
||||
border-bottom: 1px solid var(--color-danger);
|
||||
}
|
||||
|
||||
.btn {
|
||||
border: none;
|
||||
border-radius: var(--radius-sm);
|
||||
padding: var(--space-sm) var(--space-md);
|
||||
font-size: 0.85rem;
|
||||
font-weight: 600;
|
||||
box-shadow: var(--shadow-card);
|
||||
}
|
||||
|
||||
.btn:disabled {
|
||||
opacity: 0.6;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.btn--secondary {
|
||||
background: var(--color-surface);
|
||||
color: var(--color-primary-dark);
|
||||
}
|
||||
|
||||
.map-panel__loading {
|
||||
padding: var(--space-md);
|
||||
color: var(--color-text-muted);
|
||||
}
|
||||
|
||||
/* Ergebnisliste */
|
||||
|
||||
.place-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: var(--space-md);
|
||||
}
|
||||
|
||||
.list-empty {
|
||||
color: var(--color-text-muted);
|
||||
padding: var(--space-md) 0;
|
||||
}
|
||||
|
||||
.place-card {
|
||||
background: var(--color-surface);
|
||||
border: 1px solid var(--color-border);
|
||||
border-radius: var(--radius-md);
|
||||
padding: var(--space-md);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: var(--space-xs);
|
||||
cursor: pointer;
|
||||
transition: box-shadow 0.15s ease, transform 0.15s ease;
|
||||
}
|
||||
|
||||
.place-card:hover,
|
||||
.place-card:focus-visible {
|
||||
box-shadow: var(--shadow-card);
|
||||
transform: translateY(-1px);
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.place-card__name {
|
||||
font-size: 1rem;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.place-card__category {
|
||||
align-self: flex-start;
|
||||
color: #fff;
|
||||
font-size: 0.75rem;
|
||||
font-weight: 600;
|
||||
padding: 2px var(--space-sm);
|
||||
border-radius: 999px;
|
||||
}
|
||||
|
||||
.place-card__desc {
|
||||
color: var(--color-text-muted);
|
||||
font-size: 0.875rem;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
/* Karten-Marker (L.divIcon) */
|
||||
|
||||
.eventmap-marker {
|
||||
background: transparent;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.eventmap-marker__glyph {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
border-radius: 50%;
|
||||
box-shadow: var(--shadow-card);
|
||||
font-size: 1rem;
|
||||
line-height: 1;
|
||||
border: 2px solid #fff;
|
||||
}
|
||||
|
||||
/* Karten-Popup */
|
||||
|
||||
.eventmap-popup {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 4px;
|
||||
max-width: 220px;
|
||||
}
|
||||
|
||||
.eventmap-popup__title {
|
||||
font-size: 0.95rem;
|
||||
}
|
||||
|
||||
.eventmap-popup__category {
|
||||
font-size: 0.8rem;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.eventmap-popup__desc {
|
||||
font-size: 0.85rem;
|
||||
color: var(--color-text-muted);
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
/* Grundlegendes App-Layout: Header + Karte/Liste. Mobile-first;
|
||||
Desktop-Anpassungen (>=1024px) siehe css/responsive.css. */
|
||||
|
||||
.app-header {
|
||||
height: var(--header-height);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
padding: 0 var(--space-lg);
|
||||
background: var(--color-primary);
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.app-header__title {
|
||||
font-size: 1.4rem;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.app-header__subtitle {
|
||||
font-size: 0.85rem;
|
||||
opacity: 0.9;
|
||||
}
|
||||
|
||||
.app-layout {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.map-panel {
|
||||
position: relative;
|
||||
height: 50vh;
|
||||
min-height: 320px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.map-panel__toolbar {
|
||||
position: absolute;
|
||||
top: var(--space-sm);
|
||||
left: var(--space-sm);
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
.map-panel__map {
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: var(--color-border);
|
||||
}
|
||||
|
||||
.list-panel {
|
||||
padding: var(--space-md);
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.list-panel__title {
|
||||
font-size: 1.1rem;
|
||||
margin-bottom: var(--space-md);
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
/* Schlankes Reset - kein komplettes Normalize.css nötig für dieses Projekt. */
|
||||
|
||||
*,
|
||||
*::before,
|
||||
*::after {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
html,
|
||||
body {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
|
||||
color: var(--color-text);
|
||||
background: var(--color-background);
|
||||
}
|
||||
|
||||
h1,
|
||||
h2,
|
||||
h3,
|
||||
p {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
ul,
|
||||
ol {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
button {
|
||||
font: inherit;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
img {
|
||||
max-width: 100%;
|
||||
display: block;
|
||||
}
|
||||
|
||||
a {
|
||||
color: inherit;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
/* Desktop-Layout ab 1024px: Karte und Liste nebeneinander (Grid). */
|
||||
|
||||
@media (min-width: 1024px) {
|
||||
.app-layout {
|
||||
display: grid;
|
||||
grid-template-columns: 65% 35%;
|
||||
height: calc(100vh - var(--header-height));
|
||||
}
|
||||
|
||||
.map-panel {
|
||||
height: 100%;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
.list-panel {
|
||||
height: 100%;
|
||||
overflow-y: auto;
|
||||
border-left: 1px solid var(--color-border);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
/* Design-Tokens der Anwendung. */
|
||||
|
||||
:root {
|
||||
/* Basisfarben */
|
||||
--color-primary: #2e7d32;
|
||||
--color-primary-dark: #1b5e20;
|
||||
--color-text: #1a1a1a;
|
||||
--color-text-muted: #5f6368;
|
||||
--color-background: #f5f6f8;
|
||||
--color-surface: #ffffff;
|
||||
--color-border: #e0e0e0;
|
||||
--color-danger: #c62828;
|
||||
|
||||
/* Kategorie-Farben (siehe js/config/categories.js) */
|
||||
--category-naturpark: #2e7d32;
|
||||
--category-wald-wanderweg: #1b5e20;
|
||||
--category-see-badestelle: #0288d1;
|
||||
--category-erlebnispark: #f57c00;
|
||||
--category-freizeitpark: #e64a19;
|
||||
--category-tierpark-zoo: #ff8f00;
|
||||
--category-spielplatz: #d81b60;
|
||||
--category-museum-kinder: #7b1fa2;
|
||||
--category-indoor-spielplatz: #5e35b1;
|
||||
--category-bauernhof: #6d4c41;
|
||||
--category-kletterpark: #00897b;
|
||||
--category-aussichtspunkt: #455a64;
|
||||
--category-cafe-restaurant: #c62828;
|
||||
--category-sonstige-aktivitaet: #00acc1;
|
||||
--category-sonstige: #616161;
|
||||
|
||||
/* Spacing */
|
||||
--space-xs: 4px;
|
||||
--space-sm: 8px;
|
||||
--space-md: 16px;
|
||||
--space-lg: 24px;
|
||||
--space-xl: 32px;
|
||||
|
||||
/* Radius/Shadow */
|
||||
--radius-sm: 4px;
|
||||
--radius-md: 8px;
|
||||
--shadow-card: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.08);
|
||||
|
||||
/* Layout */
|
||||
--breakpoint-desktop: 1024px;
|
||||
--header-height: 64px;
|
||||
}
|
||||
Reference in New Issue
Block a user