Refactoring: Inline-Styles → CSS-Klassen (worlds.js, dog-profile.js, settings.js) — 20 neue w3-/by-Klassen (SW by-v773)

This commit is contained in:
rene 2026-05-08 12:22:04 +02:00
parent 3b8c9a72d8
commit ce14bb1d2c
8 changed files with 389 additions and 115 deletions

View file

@ -8370,3 +8370,336 @@ svg.empty-state-icon {
.breed-community-chip:hover, .breed-community-chip:active {
background: #fff3e0;
}
/* ============================================================
REFACTORING: Extrahierte Inline-Styles aus worlds.js,
dog-profile.js und settings.js
============================================================ */
/* ----------------------------------------------------------
Bottom-Sheet Overlay (position:fixed, flex-column, flex-end)
Verwendet in: _openFab, _openAllChips, _openQuickGassi,
_openConfigModal (worlds.js)
---------------------------------------------------------- */
.w3-sheet-overlay {
position: fixed;
inset: 0;
z-index: 460;
display: flex;
flex-direction: column;
justify-content: flex-end;
}
/* Backdrop (halbtransparent + blur) */
.w3-backdrop {
position: absolute;
inset: 0;
background: rgba(0, 0, 0, 0.55);
backdrop-filter: blur(2px);
}
/* Sheet-Panel (weißer Boden, abgerundete Oberkante) */
.w3-sheet-panel {
position: relative;
z-index: 1;
background: var(--c-bg);
border-radius: 24px 24px 0 0;
padding: 20px 16px calc(env(safe-area-inset-bottom, 16px) + 16px);
box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.2);
}
/* Sheet-Panel mit Scroll (für lange Inhalte) */
.w3-sheet-panel--scroll {
max-height: 82vh;
overflow-y: auto;
}
/* Sheet-Header-Zeile (Titel links, Button rechts) */
.w3-sheet-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 16px;
}
.w3-sheet-header--mb20 {
margin-bottom: 20px;
}
/* Sheet-Titel */
.w3-sheet-title {
font-size: var(--text-base);
font-weight: 700;
}
/* Runder Schließen-Button (28px) */
.w3-close-btn {
background: var(--c-border);
border: none;
border-radius: 50%;
width: 28px;
height: 28px;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
}
/* Runder Schließen-Button (32px — größere Variante) */
.w3-close-btn--lg {
background: var(--c-border);
border: none;
border-radius: 50%;
width: 32px;
height: 32px;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
}
/* FAB-Options-Button (Zeilen-Stil, flex, card-bg) */
.w3-fab-option {
display: flex;
align-items: center;
gap: 14px;
width: 100%;
background: var(--c-bg-card, var(--c-surface));
border: 1px solid var(--c-border);
border-radius: 14px;
padding: 14px 16px;
cursor: pointer;
text-align: left;
transition: background 0.12s;
}
/* Icon-Dot (runder farbiger Container für ph-icons) */
.w3-icon-dot {
width: 40px;
height: 40px;
border-radius: 12px;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
}
/* Icon-Dot groß (44px) */
.w3-icon-dot--lg {
width: 44px;
height: 44px;
border-radius: 12px;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
}
/* Chip-Button (Grid-Spalten, vertikal gestapelt) */
.w3-chip-btn {
display: flex;
flex-direction: column;
align-items: center;
gap: 6px;
background: var(--c-bg-card, var(--c-surface));
border: 1px solid var(--c-border);
border-radius: 14px;
padding: 12px 6px;
cursor: pointer;
transition: background 0.12s;
}
/* Chip-Button Label */
.w3-chip-label {
font-size: 10px;
font-weight: 600;
color: var(--c-text);
text-align: center;
line-height: 1.2;
word-break: break-word;
}
/* Vertikal gestapelte Button-Gruppe (Modal-Footer) */
.w3-btn-stack {
display: flex;
flex-direction: column;
gap: var(--space-2);
width: 100%;
}
/* Sektion-Label (uppercase, klein, gedämpft) */
.w3-section-label {
font-size: var(--text-xs);
font-weight: 700;
color: var(--c-text-secondary);
letter-spacing: 0.08em;
text-transform: uppercase;
margin-bottom: 10px;
}
/* Schnell-Gassi Dauer-Button */
.w3-dur-btn {
padding: 12px 6px;
border-radius: 12px;
border: 2px solid var(--c-border);
background: var(--c-bg-card, var(--c-surface));
cursor: pointer;
font-weight: 700;
font-size: var(--text-sm);
color: var(--c-text);
}
.w3-dur-btn.active {
border-color: var(--c-primary);
background: var(--c-primary-subtle);
color: var(--c-primary);
}
/* Submit-Button (volle Breite, primary, flex-center) */
.w3-submit-btn {
width: 100%;
padding: 16px;
border-radius: 14px;
background: var(--c-primary);
color: white;
border: none;
cursor: pointer;
font-size: var(--text-base);
font-weight: 700;
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
}
/* "Weitere Funktionen"-Link-Button */
.w3-all-btn {
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
width: 100%;
padding: 12px;
border: none;
background: none;
cursor: pointer;
color: var(--c-primary);
font-size: var(--text-sm);
font-weight: 600;
}
/* ----------------------------------------------------------
Settings / Dog-Profile: Card-Sektion-Header
(uppercase Label mit Border-Bottom)
---------------------------------------------------------- */
.by-card-section-header {
padding: var(--space-3) var(--space-4);
font-size: var(--text-xs);
font-weight: 600;
color: var(--c-text-secondary);
text-transform: uppercase;
letter-spacing: 0.05em;
border-bottom: 1px solid var(--c-border);
}
/* ----------------------------------------------------------
Dog-Profile: Info-Card-Zeile (xs-Label + Wert)
---------------------------------------------------------- */
.dp-info-label {
font-size: var(--text-xs);
color: var(--c-text-secondary);
margin-bottom: 2px;
}
/* Passport: Datensatz-Zeile */
.pp-data-row {
display: flex;
align-items: flex-start;
gap: var(--space-3);
padding: var(--space-3) 0;
border-bottom: 1px solid var(--c-border);
}
/* Settings: Sidebar-Item mit Padding */
.settings-sidebar-item {
padding: var(--space-4);
border-radius: 0;
border-bottom: 1px solid var(--c-border);
}
/* Settings: Toggle-Zeile (flex, icon + label + toggle) */
.settings-toggle-row {
display: flex;
align-items: center;
gap: var(--space-3);
padding: var(--space-4);
border-bottom: 1px solid var(--c-border);
}
/* Settings: Toggle-Label-Block */
.settings-toggle-label {
flex: 1;
}
/* Settings: Inline-Toggle (44×24px) */
.by-toggle-wrap {
position: relative;
display: inline-block;
width: 44px;
height: 24px;
flex-shrink: 0;
}
.by-toggle-wrap input {
opacity: 0;
width: 0;
height: 0;
position: absolute;
}
.by-toggle-track {
position: absolute;
cursor: pointer;
inset: 0;
border-radius: 12px;
background: var(--c-border);
transition: background 0.2s;
}
.by-toggle-thumb {
position: absolute;
top: 2px;
width: 20px;
height: 20px;
border-radius: 50%;
background: #fff;
transition: left 0.2s;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
/* Settings: Version-Badge */
.by-version-badge {
background: var(--c-surface-2);
border: 1px solid var(--c-border);
border-radius: 100px;
padding: 2px 10px;
font-family: monospace;
font-size: 10px;
color: var(--c-text-muted);
}
/* Avatar-Kreis (56px, primary bg) */
.by-avatar-circle {
width: 56px;
height: 56px;
border-radius: 50%;
background: var(--c-primary);
color: #fff;
display: flex;
align-items: center;
justify-content: center;
font-size: 1.5rem;
font-weight: 700;
flex-shrink: 0;
cursor: pointer;
overflow: hidden;
position: relative;
}