From a98b3b0c98546d4b99b2fe27d35a34be76376449 Mon Sep 17 00:00:00 2001 From: DerEchteAlec Date: Thu, 13 Aug 2026 03:10:40 +0200 Subject: [PATCH] ENH - add swipe-to-clear lock-screen notifications --- frontend/src/assets/main.css | 69 ++++-- frontend/src/components/PhoneLockScreen.vue | 223 ++++++++++++++++--- frontend/src/utils/notificationSwipe.test.ts | 31 +++ frontend/src/utils/notificationSwipe.ts | 46 ++++ 4 files changed, 317 insertions(+), 52 deletions(-) create mode 100644 frontend/src/utils/notificationSwipe.test.ts create mode 100644 frontend/src/utils/notificationSwipe.ts diff --git a/frontend/src/assets/main.css b/frontend/src/assets/main.css index 2769c81..ee5b045 100644 --- a/frontend/src/assets/main.css +++ b/frontend/src/assets/main.css @@ -734,17 +734,65 @@ button { backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); } +.lock-screen__notification-row { + position: relative; + overflow: hidden; + min-height: 76px; + border-radius: 18px; + background: transparent; + isolation: isolate; +} +.lock-screen__notification-clear { + position: absolute; + z-index: 0; + top: 0; + right: 0; + bottom: 0; + display: flex; + width: 76px; + flex-direction: column; + align-items: center; + justify-content: center; + gap: 3px; + border: 0; + padding: 0; + color: #fff; + background: #ff3b30; + font-size: 10px; + font-weight: 650; + cursor: pointer; + opacity: 0; + transition: opacity 0.12s ease-out; +} +.lock-screen__notification-row.is-action-visible { + background: #ff3b30; +} +.lock-screen__notification-row.is-action-visible + .lock-screen__notification-clear { + opacity: 1; +} .lock-screen__notification { position: relative; + z-index: 1; display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 10px; - min-height: 72px; + width: 100%; + min-height: 76px; border-radius: 18px; - padding: 11px 38px 11px 11px; + padding: 11px; color: #fff; - background-color: rgb(28 28 32 / 72%); + background-color: rgb(38 36 40 / 76%); text-shadow: 0 1px 3px #0009; + touch-action: pan-y; + transform: translate3d(var(--notification-swipe), 0, 0); + transition: transform 0.28s cubic-bezier(0.22, 0.78, 0.24, 1); + will-change: transform; + backdrop-filter: blur(22px) saturate(1.18); + -webkit-backdrop-filter: blur(22px) saturate(1.18); +} +.lock-screen__notification-row.is-swiping .lock-screen__notification { + transition: none; } .phone-notification.is-actionable { cursor: pointer; @@ -800,21 +848,6 @@ button { -webkit-box-orient: vertical; -webkit-line-clamp: 2; } -.lock-screen__notification-close { - position: absolute; - top: 8px; - right: 8px; - display: grid; - width: 24px; - height: 24px; - place-items: center; - border: 0; - border-radius: 50%; - padding: 0; - color: #fff; - background: #0007; - cursor: pointer; -} .lock-screen__footer { position: absolute; z-index: 3; diff --git a/frontend/src/components/PhoneLockScreen.vue b/frontend/src/components/PhoneLockScreen.vue index f7e7a78..d1dd7c4 100644 --- a/frontend/src/components/PhoneLockScreen.vue +++ b/frontend/src/components/PhoneLockScreen.vue @@ -1,12 +1,19 @@