流体交互层:按压反馈 + 真半透明材质 + 主题交叉过渡 + 弹层材质化

按 apple-design(Designing Fluid Interfaces)审查落地:
- 全站补 :active 按压缩放反馈(按钮/tab/链接/命令面板/前后栏导航),交互元素加 touch-action
- TopBar、首页标题栏、浮动主题钮改 color-mix 半透明 + blur 真材质,配 reduced-transparency 回退
- 主题切换 250ms 交叉过渡(theme-anim 瞬时类),消除亮度突变
- CommandPalette/ShortcutsPanel 过 <Transition name="pop">:scrim 淡入 + 面板自顶部锚点 scale 进入,退出原路返回
- 首页标题栏收缩由二值跳变改为滚动进度 --sq 连续插值(16–56px)
- reduced-motion 例外:弹层保留短交叉淡入,禁位移与主题过渡
- 触控目标增大(主题钮 40/44px、tab、后台导航项),文章大标题负字距 + 收紧行高
This commit is contained in:
Sakurasan
2026-09-22 00:45:51 +08:00
parent dd2994189a
commit 2b53eb976b
7 changed files with 150 additions and 44 deletions
+76 -1
View File
@@ -620,7 +620,7 @@ h4 {
display: flex;
align-items: center;
gap: 10px;
padding: 8px 12px;
padding: 10px 12px;
border-radius: 6px;
font-size: 14px;
color: var(--admin-ink-soft);
@@ -1825,3 +1825,78 @@ body:not(.admin-shell-active) :where(a, button, input, select, textarea, [tabind
.cmd-overlay {
overscroll-behavior: contain;
}
/* ============================================================
流体交互层(apple-design 审查落地)
============================================================ */
/* 按压反馈:从按下瞬间就有反应,而不是 hover 或松手 */
button:active:not(:disabled),
a.btn:active,
a.pill:active,
.tab:active,
.tag-chip:active,
.rail-left .item:active,
.admin-side .item:active,
.cmd-panel .row:active {
transform: scale(0.97);
}
/* 触屏:去掉浏览器对双击缩放的猜测延迟 */
button,
a.btn,
a.pill,
.tab,
.tag-chip,
.rail-left .item,
.admin-side .item {
touch-action: manipulation;
}
/* 主题切换:亮度突变改为一次性的 250ms 交叉过渡(仅切换瞬间挂载) */
html.theme-anim,
html.theme-anim * {
transition: background-color 250ms ease, color 250ms ease, border-color 250ms ease !important;
}
/* 弹层材质化:从触发源方向 scale+fade 进入,退出走同一条路径 */
.cmd-panel {
transform-origin: top center;
}
.pop-enter-active {
transition: opacity 160ms ease-out;
}
.pop-enter-active .cmd-panel {
transition: transform 240ms cubic-bezier(0.2, 0.8, 0.25, 1), opacity 160ms ease-out;
}
.pop-enter-from {
opacity: 0;
}
.pop-enter-from .cmd-panel {
transform: scale(0.96) translateY(-10px);
opacity: 0;
}
.pop-leave-active {
transition: opacity 130ms ease-in;
}
.pop-leave-to {
opacity: 0;
}
/* reduce ≠ 无反馈:保留短交叉淡入,去掉位移/缩放与主题过渡 */
@media (prefers-reduced-motion: reduce) {
.pop-enter-active,
.pop-leave-active {
transition: opacity 150ms ease !important;
}
.pop-enter-active .cmd-panel {
transition: opacity 150ms ease !important;
}
.pop-enter-from .cmd-panel {
transform: none;
}
html.theme-anim,
html.theme-anim * {
transition: none !important;
}
}