feat: Swipe-Gesten für Task-Listenansicht (Mobil)
Swipe links = Status-Toggle (offen ↔ erledigt), Swipe rechts = Bearbeiten-Modal. - renderSwipeRow(): Wrapper mit zwei Reveal-Panels hinter jeder Karte - wireSwipeGestures(): Scroll/Swipe-Erkennung via Touch-Events · SWIPE_THRESHOLD = 80px für Aktion, frühe Scroll-Erkennung ab 12px vertikal · Dämpfung nach Threshold (elastischer Überschuss) · Reveal-Panels blenden proportional ein (0 → 1 über Threshold-Weg) · Haptic Feedback via navigator.vibrate (40ms links, 20ms rechts) - tasks.css: .swipe-row, .swipe-reveal--done/--edit, .swipe-row--swiping Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -153,6 +153,67 @@
|
||||
border-radius: var(--radius-full);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------
|
||||
* Swipe-Wrapper (Mobil-Gesten)
|
||||
* -------------------------------------------------------- */
|
||||
.swipe-row {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
border-radius: var(--radius-md);
|
||||
margin-bottom: var(--space-2);
|
||||
/* Verhindert ungewolltes Flackern auf iOS */
|
||||
-webkit-backface-visibility: hidden;
|
||||
}
|
||||
|
||||
/* Kein Margin mehr am Task-Card selbst (übernimmt swipe-row) */
|
||||
.swipe-row .task-card {
|
||||
margin-bottom: 0;
|
||||
border-radius: var(--radius-md);
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
will-change: transform;
|
||||
}
|
||||
|
||||
/* Reveal-Panels hinter der Karte */
|
||||
.swipe-reveal {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
width: 50%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: var(--space-1);
|
||||
font-size: var(--text-xs);
|
||||
font-weight: var(--font-weight-semibold);
|
||||
opacity: 0;
|
||||
pointer-events: none;
|
||||
z-index: 0;
|
||||
transition: opacity 0.05s linear;
|
||||
}
|
||||
|
||||
/* Links hinter der Karte = Erledigt (Swipe nach links) */
|
||||
.swipe-reveal--done {
|
||||
right: 0;
|
||||
background-color: var(--color-success);
|
||||
color: #fff;
|
||||
border-radius: 0 var(--radius-md) var(--radius-md) 0;
|
||||
}
|
||||
|
||||
/* Rechts hinter der Karte = Bearbeiten (Swipe nach rechts) */
|
||||
.swipe-reveal--edit {
|
||||
left: 0;
|
||||
background-color: var(--color-accent);
|
||||
color: #fff;
|
||||
border-radius: var(--radius-md) 0 0 var(--radius-md);
|
||||
}
|
||||
|
||||
/* Touch-Feedback: leichte Hervorhebung während Swipe */
|
||||
.swipe-row--swiping .task-card {
|
||||
box-shadow: var(--shadow-lg);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------
|
||||
* Task-Card
|
||||
* -------------------------------------------------------- */
|
||||
|
||||
Reference in New Issue
Block a user