From dffc85a24b41f766e2e559a33959f6efc42c4871 Mon Sep 17 00:00:00 2001 From: "d.a.kolesov" Date: Thu, 30 Jul 2026 08:43:33 +0700 Subject: [PATCH] material3 --- src/renderer/src/assets/styles/base.css | 3 +++ .../components/accounts/AddAccountDialog.vue | 4 ++++ .../components/accounts/EditAccountDialog.vue | 2 ++ .../components/calendar/EventDetailPopup.vue | 6 ++++++ .../src/components/messages/MessageList.vue | 18 ++++++++++++++++-- .../notifications/NotificationContainer.vue | 8 ++++++++ .../notifications/NotificationToast.vue | 3 +++ .../src/components/preview/MessageHeader.vue | 12 ++++++++++++ .../src/components/sidebar/FolderTreeItem.vue | 8 +++++++- src/renderer/src/views/CalendarView.vue | 2 ++ src/renderer/src/views/ComposeView.vue | 7 +++++++ 11 files changed, 70 insertions(+), 3 deletions(-) diff --git a/src/renderer/src/assets/styles/base.css b/src/renderer/src/assets/styles/base.css index 4359fbe..af62e49 100644 --- a/src/renderer/src/assets/styles/base.css +++ b/src/renderer/src/assets/styles/base.css @@ -236,4 +236,7 @@ html[data-design='material3'] .app-tooltip { font-size: var(--md-sys-typescale-body-small-size); font-weight: var(--md-sys-typescale-body-small-weight); line-height: var(--md-sys-typescale-body-small-line); + transition: + opacity var(--md-sys-motion-duration-short2) var(--md-sys-motion-easing-standard), + transform var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-emphasized-decelerate); } diff --git a/src/renderer/src/components/accounts/AddAccountDialog.vue b/src/renderer/src/components/accounts/AddAccountDialog.vue index fb630b3..f1c0a48 100644 --- a/src/renderer/src/components/accounts/AddAccountDialog.vue +++ b/src/renderer/src/components/accounts/AddAccountDialog.vue @@ -903,6 +903,8 @@ html[data-design='material3'] .dialog { background: var(--md-sys-color-surface-container-high); border-radius: var(--md-sys-shape-corner-extra-large); box-shadow: var(--md-sys-elevation-3); + animation-duration: var(--md-sys-motion-duration-medium4); + animation-timing-function: var(--md-sys-motion-easing-emphasized-decelerate); } html[data-design='material3'] .dialog::before { @@ -1108,6 +1110,8 @@ html[data-design='material3'] .success-check { border: none; box-shadow: none; color: var(--md-sys-color-on-primary-container); + animation-duration: var(--md-sys-motion-duration-medium1); + animation-timing-function: var(--md-sys-motion-easing-emphasized-decelerate); } html[data-design='material3'] .success-title { diff --git a/src/renderer/src/components/accounts/EditAccountDialog.vue b/src/renderer/src/components/accounts/EditAccountDialog.vue index 82b1626..c449b2a 100644 --- a/src/renderer/src/components/accounts/EditAccountDialog.vue +++ b/src/renderer/src/components/accounts/EditAccountDialog.vue @@ -708,6 +708,8 @@ html[data-design='material3'] .dialog { background: var(--md-sys-color-surface-container-high); border-radius: var(--md-sys-shape-corner-extra-large); box-shadow: var(--md-sys-elevation-3); + animation-duration: var(--md-sys-motion-duration-medium4); + animation-timing-function: var(--md-sys-motion-easing-emphasized-decelerate); } html[data-design='material3'] .dialog::before { diff --git a/src/renderer/src/components/calendar/EventDetailPopup.vue b/src/renderer/src/components/calendar/EventDetailPopup.vue index bcf5c84..47b85fc 100644 --- a/src/renderer/src/components/calendar/EventDetailPopup.vue +++ b/src/renderer/src/components/calendar/EventDetailPopup.vue @@ -571,6 +571,12 @@ html[data-design='material3'] .popup { border: 1px solid var(--md-sys-color-outline-variant); box-shadow: var(--md-sys-elevation-3); scrollbar-color: var(--md-sys-color-outline-variant) transparent; + animation-duration: var(--md-sys-motion-duration-medium2); + animation-timing-function: var(--md-sys-motion-easing-emphasized-decelerate); +} + +html[data-design='material3'] .chevron-btn > :deep(svg) { + transition: transform var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard); } html[data-design='material3'] .popup::-webkit-scrollbar-thumb { diff --git a/src/renderer/src/components/messages/MessageList.vue b/src/renderer/src/components/messages/MessageList.vue index 34be746..310d010 100644 --- a/src/renderer/src/components/messages/MessageList.vue +++ b/src/renderer/src/components/messages/MessageList.vue @@ -191,13 +191,20 @@ async function handleMarkThreadRead(seen: boolean): Promise { } // ── Thread expand animation ─────────────────────────────── +// В Material 3 у переходов нет "пружинного" перелёта — используем emphasized-кривые вместо cubic-bezier с overshoot +function isMaterial3(): boolean { + return document.documentElement.dataset.design === 'material3' +} + function onExpandEnter(el: Element, done: () => void): void { const h = el as HTMLElement h.style.overflow = 'hidden' h.style.height = '0' h.style.opacity = '0' requestAnimationFrame(() => { - h.style.transition = 'height 300ms cubic-bezier(0.34, 1.05, 0.64, 1), opacity 220ms ease' + h.style.transition = isMaterial3() + ? 'height var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-emphasized-decelerate), opacity var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-standard)' + : 'height 300ms cubic-bezier(0.34, 1.05, 0.64, 1), opacity 220ms ease' h.style.height = h.scrollHeight + 'px' h.style.opacity = '1' setTimeout(done, 300) @@ -217,7 +224,9 @@ function onExpandLeave(el: Element, done: () => void): void { h.style.overflow = 'hidden' h.style.height = h.scrollHeight + 'px' void h.offsetHeight - h.style.transition = 'height 240ms cubic-bezier(0.4, 0, 0.2, 1), opacity 180ms ease' + h.style.transition = isMaterial3() + ? 'height var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-emphasized-accelerate), opacity var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard)' + : 'height 240ms cubic-bezier(0.4, 0, 0.2, 1), opacity 180ms ease' h.style.height = '0' h.style.opacity = '0' setTimeout(done, 240) @@ -1494,6 +1503,11 @@ html[data-design='material3'] .search-pill { background: var(--md-sys-color-surface-container-high); border: 1px solid var(--md-sys-color-outline-variant); box-shadow: none; + transition: + width var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-emphasized), + background var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard), + border-color var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard), + box-shadow var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard); } html[data-design='material3'] .search-pill:hover:not(.search-pill--open) { background: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, var(--md-sys-color-surface-container-high)); diff --git a/src/renderer/src/components/notifications/NotificationContainer.vue b/src/renderer/src/components/notifications/NotificationContainer.vue index 4382ccf..7ef0279 100644 --- a/src/renderer/src/components/notifications/NotificationContainer.vue +++ b/src/renderer/src/components/notifications/NotificationContainer.vue @@ -140,4 +140,12 @@ onUnmounted(() => { opacity: 0; transform: translateX(20px) scale(0.96); } + +/* ── Material 3 ── */ +html[data-design='material3'] .toast-enter-active, +html[data-design='material3'] .toast-leave-active { + transition: + opacity var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-emphasized-decelerate), + transform var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-emphasized-decelerate); +} diff --git a/src/renderer/src/components/notifications/NotificationToast.vue b/src/renderer/src/components/notifications/NotificationToast.vue index d38cea3..c4c3640 100644 --- a/src/renderer/src/components/notifications/NotificationToast.vue +++ b/src/renderer/src/components/notifications/NotificationToast.vue @@ -156,6 +156,9 @@ html[data-design='material3'] .toast { border: none; border-radius: var(--md-sys-shape-corner-extra-small); box-shadow: var(--md-sys-elevation-3); + transition: + opacity var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-emphasized-decelerate), + transform var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-emphasized-decelerate); } html[data-design='material3'] .toast:hover { diff --git a/src/renderer/src/components/preview/MessageHeader.vue b/src/renderer/src/components/preview/MessageHeader.vue index a18dce3..a38fe10 100644 --- a/src/renderer/src/components/preview/MessageHeader.vue +++ b/src/renderer/src/components/preview/MessageHeader.vue @@ -774,4 +774,16 @@ html[data-design='material3'] .action-btn.danger:hover { border-color: transparent; box-shadow: none; } + +html[data-design='material3'] .popup-enter-active { + transition: + opacity var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard), + transform var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-emphasized-decelerate); +} + +html[data-design='material3'] .popup-leave-active { + transition: + opacity var(--md-sys-motion-duration-short2) var(--md-sys-motion-easing-standard), + transform var(--md-sys-motion-duration-short2) var(--md-sys-motion-easing-emphasized-accelerate); +} diff --git a/src/renderer/src/components/sidebar/FolderTreeItem.vue b/src/renderer/src/components/sidebar/FolderTreeItem.vue index 51a9211..6a14ef0 100644 --- a/src/renderer/src/components/sidebar/FolderTreeItem.vue +++ b/src/renderer/src/components/sidebar/FolderTreeItem.vue @@ -235,12 +235,15 @@ function handleMarkAllRead(): void { /* ── Бейдж непрочитанных ─────────────────────────────────── */ .unread-badge { + display: inline-flex; + align-items: center; + justify-content: center; font-size: 10px; font-weight: 700; color: rgba(255, 255, 255, 0.92); padding: 0 6px; min-height: 18px; - line-height: 18px; + line-height: 1; border-radius: var(--radius-full); background: rgba(200, 40, 40, 0.55); border: 1px solid rgba(255, 100, 100, 0.25); @@ -293,6 +296,9 @@ function handleMarkAllRead(): void { /* ── Material 3 (Navigation Drawer list item) ── */ html[data-design='material3'] .folder-item { border-radius: var(--md-sys-shape-corner-full); + /* Полная пилюля круче скругляется у краёв, чем прежний shape/medium — + без доп. отступа справа бейдж непрочитанных вылезает за скруглённый край */ + padding-right: 12px; } html[data-design='material3'] .folder-item:hover { diff --git a/src/renderer/src/views/CalendarView.vue b/src/renderer/src/views/CalendarView.vue index f225015..8de159e 100644 --- a/src/renderer/src/views/CalendarView.vue +++ b/src/renderer/src/views/CalendarView.vue @@ -922,6 +922,8 @@ html[data-design='material3'] .color-picker-popover { background: var(--md-sys-color-surface-container-high); border: 1px solid var(--md-sys-color-outline-variant); box-shadow: var(--md-sys-elevation-3); + animation-duration: var(--md-sys-motion-duration-short4); + animation-timing-function: var(--md-sys-motion-easing-emphasized-decelerate); } html[data-design='material3'] .color-swatch.selected { diff --git a/src/renderer/src/views/ComposeView.vue b/src/renderer/src/views/ComposeView.vue index b275f14..5784fce 100644 --- a/src/renderer/src/views/ComposeView.vue +++ b/src/renderer/src/views/ComposeView.vue @@ -1490,4 +1490,11 @@ html[data-design='material3'] .spinner-sm { border-color: color-mix(in srgb, var(--md-sys-color-on-primary) 30%, transparent); border-top-color: var(--md-sys-color-on-primary); } + +html[data-design='material3'] .drag-enter-active, +html[data-design='material3'] .drag-leave-active { + transition: + opacity var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard), + transform var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-emphasized-decelerate); +}