💄 style: 重构 2026 主题轻拟态视觉与丝滑动效
- 统一轻马卡龙配色、柔和阴影和卡片悬浮反馈 - 为生命周期和筛选面板增加真实高度连续展开收起动画 - 统一页面切换、列表、通知和发送内容切换动效 - 支持减少动态效果并保持键盘焦点和响应式布局
This commit is contained in:
1 parent
c76d4d9f64
commit
dec682becc
13 files changed
+128
-74
No files matched your search
@@ -18,7 +18,7 @@
|
||||
<div
|
||||
v-for="card in summaryCards"
|
||||
:key="card.label"
|
||||
class="theme-2026-card theme-2026-card-hover group rounded-[24px] border p-3.5 shadow-md transition-all duration-200 hover:-translate-y-0.5 hover:shadow-lg sm:rounded-[30px] sm:p-4"
|
||||
class="theme-2026-card theme-2026-card-hover group rounded-[24px] border p-3.5 shadow-md transition-all duration-200 hover:shadow-lg sm:rounded-[30px] sm:p-4"
|
||||
:class="[panelClass, cardHoverClass]"
|
||||
>
|
||||
<div class="flex items-start justify-between gap-3">
|
||||
@@ -29,7 +29,7 @@
|
||||
</p>
|
||||
</div>
|
||||
<div
|
||||
class="rounded-lg p-2 transition-transform duration-200 group-hover:scale-105 max-sm:p-1.5"
|
||||
class="rounded-lg p-2 transition-transform duration-200 group-max-sm:p-1.5"
|
||||
:class="[card.iconClass]"
|
||||
>
|
||||
<component :is="card.icon" class="h-5 w-5" />
|
||||
@@ -40,7 +40,7 @@
|
||||
|
||||
<section
|
||||
v-if="!hasSelectedFiles"
|
||||
class="theme-2026-card theme-2026-card-hover mb-4 rounded-[24px] border p-3 shadow-md transition-all duration-200 hover:-translate-y-0.5 hover:shadow-lg sm:mb-6 sm:rounded-[30px] sm:p-4"
|
||||
class="theme-2026-card theme-2026-card-hover mb-4 rounded-[24px] border p-3 shadow-md transition-all duration-200 hover:shadow-lg sm:mb-6 sm:rounded-[30px] sm:p-4"
|
||||
:class="[panelClass, cardHoverClass]"
|
||||
>
|
||||
<div class="flex items-center justify-between gap-3 sm:flex-row">
|
||||
@@ -71,7 +71,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<Transition name="fcb-expand-120">
|
||||
<Transition name="fcb-expand-120" @before-enter="beforeExpandPanelEnter" @enter="enterExpandPanel" @after-enter="afterExpandPanelEnter" @before-leave="beforeExpandPanelLeave" @leave="leaveExpandPanel">
|
||||
<div id="file-filter-panel" v-if="filterBodyVisible" class="fcb-expand-content mt-4 grid gap-4">
|
||||
<div class="flex flex-col gap-3 lg:flex-row lg:items-center">
|
||||
<label class="min-w-0 flex-1">
|
||||
@@ -793,7 +793,7 @@
|
||||
</div>
|
||||
|
||||
<section
|
||||
class="theme-2026-card theme-2026-card-hover mt-6 rounded-[30px] border p-4 shadow-md transition-all duration-200 hover:-translate-y-0.5 hover:shadow-lg"
|
||||
class="theme-2026-card theme-2026-card-hover mt-6 rounded-[30px] border p-4 shadow-md transition-all duration-200 hover:shadow-lg"
|
||||
:class="[panelClass, cardHoverClass]"
|
||||
>
|
||||
<div class="mb-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between">
|
||||
@@ -1010,7 +1010,7 @@
|
||||
</div>
|
||||
|
||||
<div
|
||||
class="theme-2026-card-hover rounded-[24px] border px-3 py-2.5 shadow-md transition-all duration-200 hover:-translate-y-0.5 hover:shadow-lg sm:px-4 sm:py-3"
|
||||
class="theme-2026-card-hover rounded-[24px] border px-3 py-2.5 shadow-md transition-all duration-200 hover:shadow-lg sm:px-4 sm:py-3"
|
||||
:class="[isDarkMode ? 'border-gray-700 bg-gray-700/30' : 'border-gray-200 bg-gray-50']"
|
||||
>
|
||||
<div class="grid gap-2.5 lg:grid-cols-[minmax(0,1fr)_auto] lg:items-center">
|
||||
@@ -1091,7 +1091,7 @@
|
||||
</div>
|
||||
|
||||
<section
|
||||
class="theme-2026-card-hover rounded-[24px] border px-3 py-3 shadow-md transition-all duration-200 hover:-translate-y-0.5 hover:shadow-lg sm:px-4 sm:py-4"
|
||||
class="theme-2026-card-hover rounded-[24px] border px-3 py-3 shadow-md transition-all duration-200 hover:shadow-lg sm:px-4 sm:py-4"
|
||||
:class="getInsightPanelClass(selectedFileDetail.statusInsightSeverity)"
|
||||
>
|
||||
<div class="flex flex-col gap-2.5 md:flex-row md:items-start md:justify-between">
|
||||
@@ -1135,7 +1135,7 @@
|
||||
v-for="action in detailPolicyActionOptions"
|
||||
:key="action.action"
|
||||
type="button"
|
||||
class="theme-2026-card-hover flex min-h-14 items-start gap-2 rounded-[22px] border px-3 py-2 text-left shadow-md transition-all duration-200 hover:-translate-y-0.5 hover:shadow-lg disabled:cursor-not-allowed disabled:opacity-60 disabled:hover:translate-y-0 disabled:hover:shadow-md"
|
||||
class="theme-2026-card-hover flex min-h-14 items-start gap-2 rounded-[22px] border px-3 py-2 text-left shadow-md transition-all duration-200 hover:shadow-lg disabled:cursor-not-allowed disabled:opacity-60 disabled:hover:translate-y-0 disabled:hover:shadow-md"
|
||||
:class="[detailPolicyActionClass, cardHoverClass]"
|
||||
:disabled="isDetailPolicyActionRunning || isDetailLoading || action.disabled"
|
||||
:title="action.description"
|
||||
@@ -1168,7 +1168,7 @@
|
||||
<div
|
||||
v-for="item in detailOverviewItems"
|
||||
:key="item.label"
|
||||
class="theme-2026-card-hover rounded-[18px] border px-3 py-2 shadow-md transition-all duration-200 hover:-translate-y-0.5 hover:shadow-lg sm:rounded-[22px] sm:px-3.5 sm:py-2.5"
|
||||
class="theme-2026-card-hover rounded-[18px] border px-3 py-2 shadow-md transition-all duration-200 hover:shadow-lg sm:rounded-[22px] sm:px-3.5 sm:py-2.5"
|
||||
:class="[isDarkMode ? 'border-gray-700 bg-gray-700/30' : 'border-gray-200 bg-white']"
|
||||
>
|
||||
<p class="text-xs leading-4" :class="[mutedTextClass]">{{ item.label }}</p>
|
||||
@@ -1187,7 +1187,7 @@
|
||||
<div
|
||||
v-for="item in detailPolicyItems"
|
||||
:key="item.label"
|
||||
class="theme-2026-card-hover rounded-[18px] border px-3 py-2 shadow-md transition-all duration-200 hover:-translate-y-0.5 hover:shadow-lg sm:rounded-[22px] sm:px-3.5 sm:py-2.5"
|
||||
class="theme-2026-card-hover rounded-[18px] border px-3 py-2 shadow-md transition-all duration-200 hover:shadow-lg sm:rounded-[22px] sm:px-3.5 sm:py-2.5"
|
||||
:class="[isDarkMode ? 'border-gray-700 bg-gray-700/30' : 'border-gray-200 bg-white']"
|
||||
>
|
||||
<p class="text-xs leading-4" :class="[mutedTextClass]">{{ item.label }}</p>
|
||||
@@ -1226,7 +1226,7 @@
|
||||
<TransitionGroup
|
||||
:css="false"
|
||||
tag="div"
|
||||
class="fcb-lifecycle-list"
|
||||
ref="lifecycleListRef" class="fcb-lifecycle-list"
|
||||
@before-enter="beforeLifecycleRowEnter"
|
||||
@enter="enterLifecycleRow"
|
||||
@leave="leaveLifecycleRow"
|
||||
@@ -1245,7 +1245,7 @@
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class="fcb-lifecycle-card theme-2026-card-hover mb-2.5 rounded-[16px] border px-3 py-2 shadow-sm transition-all duration-200 hover:-translate-y-0.5 hover:shadow-md last:mb-0 sm:rounded-[20px]"
|
||||
class="fcb-lifecycle-card theme-2026-card-hover mb-2.5 rounded-[16px] border px-3 py-2 shadow-sm transition-all duration-200 hover:shadow-md last:mb-0 sm:rounded-[20px]"
|
||||
:class="[
|
||||
isDarkMode ? 'border-gray-700 bg-gray-800/60' : 'border-gray-100 bg-gray-50'
|
||||
]"
|
||||
@@ -1306,7 +1306,7 @@
|
||||
</section>
|
||||
|
||||
<section
|
||||
class="theme-2026-card-hover space-y-2.5 rounded-[24px] border px-3 py-3 shadow-md transition-all duration-200 hover:-translate-y-0.5 hover:shadow-lg sm:px-4 sm:py-4"
|
||||
class="theme-2026-card-hover space-y-2.5 rounded-[24px] border px-3 py-3 shadow-md transition-all duration-200 hover:shadow-lg sm:px-4 sm:py-4"
|
||||
:class="[subtleSectionClass, cardHoverClass]"
|
||||
>
|
||||
<div class="flex flex-col gap-2.5 sm:flex-row sm:items-start sm:justify-between">
|
||||
@@ -1377,7 +1377,7 @@
|
||||
<div
|
||||
v-for="item in detailStorageItems"
|
||||
:key="item.label"
|
||||
class="theme-2026-card-hover grid gap-1 rounded-[22px] border px-3 py-2.5 shadow-md transition-all duration-200 hover:-translate-y-0.5 hover:shadow-lg sm:grid-cols-[160px_minmax(0,1fr)] sm:items-center"
|
||||
class="theme-2026-card-hover grid gap-1 rounded-[22px] border px-3 py-2.5 shadow-md transition-all duration-200 hover:shadow-lg sm:grid-cols-[160px_minmax(0,1fr)] sm:items-center"
|
||||
:class="[isDarkMode ? 'border-gray-700 bg-gray-700/30' : 'border-gray-200 bg-white']"
|
||||
>
|
||||
<p class="text-xs leading-4" :class="[mutedTextClass]">{{ item.label }}</p>
|
||||
@@ -1704,7 +1704,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed, onMounted, onUnmounted, ref, watch, type Component } from 'vue'
|
||||
import { computed, nextTick, onMounted, onUnmounted, ref, watch, type Component } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import type {
|
||||
@@ -1857,6 +1857,8 @@ const syncMobileViewport = (event: MediaQueryListEvent) => {
|
||||
isMobileViewport.value = event.matches
|
||||
}
|
||||
const isLifecycleExpanded = ref(false)
|
||||
const lifecycleListRef = ref<HTMLElement | null>(null)
|
||||
let lifecycleHeightAnimation: Animation | null = null
|
||||
const isRetrievalHistoryExpanded = ref(false)
|
||||
const retrievalTimelineEvents = computed(() =>
|
||||
(selectedFileDetail.value?.detailTimeline || []).filter((item) => item.key === 'retrieved_event')
|
||||
@@ -1870,17 +1872,32 @@ const visibleDetailTimeline = computed(() =>
|
||||
isLifecycleExpanded.value ? detailTimelineRows.value : detailTimelineRows.value.slice(0, 3)
|
||||
)
|
||||
|
||||
const animateLifecycleHeight = async () => {
|
||||
await nextTick()
|
||||
const list = lifecycleListRef.value
|
||||
if (!list || reducedMotionQuery.matches) return
|
||||
const currentHeight = list.getBoundingClientRect().height
|
||||
list.style.height = `${currentHeight}px`
|
||||
await nextTick()
|
||||
const targetHeight = list.scrollHeight
|
||||
lifecycleHeightAnimation?.cancel()
|
||||
lifecycleHeightAnimation = list.animate(
|
||||
[{ height: `${currentHeight}px` }, { height: `${targetHeight}px` }],
|
||||
{ duration: 420, easing: 'cubic-bezier(0.22, 1, 0.36, 1)', fill: 'forwards' }
|
||||
)
|
||||
lifecycleHeightAnimation.addEventListener('finish', () => {
|
||||
list.style.height = ''
|
||||
lifecycleHeightAnimation = null
|
||||
}, { once: true })
|
||||
}
|
||||
|
||||
const LIFECYCLE_ENTER_MS = 160
|
||||
const LIFECYCLE_LEAVE_MS = 120
|
||||
const lifecycleEasing = 'cubic-bezier(0.22, 1, 0.36, 1)'
|
||||
const lifecycleExitEasing = 'cubic-bezier(0.4, 0, 1, 1)'
|
||||
const reducedMotionQuery = window.matchMedia('(prefers-reduced-motion: reduce)')
|
||||
watch(isLifecycleExpanded, animateLifecycleHeight)
|
||||
|
||||
const getAnimationDelay = (element: Element) => {
|
||||
const row = element as HTMLElement
|
||||
const siblingIndex = Array.from(row.parentElement?.children || []).indexOf(row)
|
||||
return Math.min(Math.max(siblingIndex, 0) * 12, 36)
|
||||
}
|
||||
const reducedMotionQuery = window.matchMedia('(prefers-reduced-motion: reduce)')
|
||||
|
||||
const playDetailAnimation = (
|
||||
element: HTMLElement,
|
||||
@@ -1902,17 +1919,17 @@ const playDetailAnimation = (
|
||||
|
||||
const beforeLifecycleRowEnter = (element: Element) => {
|
||||
const row = element as HTMLElement
|
||||
row.style.willChange = 'transform, opacity'
|
||||
row.style.willChange = 'opacity'
|
||||
}
|
||||
const enterLifecycleRow = (element: Element, done: () => void) => {
|
||||
const row = element as HTMLElement
|
||||
playDetailAnimation(
|
||||
row,
|
||||
[
|
||||
{ opacity: 0, transform: 'translate3d(0, -6px, 0) scale(0.985)' },
|
||||
{ opacity: 1, transform: 'translate3d(0, 0, 0) scale(1)' }
|
||||
{ opacity: 0 },
|
||||
{ opacity: 1 }
|
||||
],
|
||||
{ duration: LIFECYCLE_ENTER_MS, delay: getAnimationDelay(row), easing: lifecycleEasing },
|
||||
{ duration: LIFECYCLE_ENTER_MS, delay: 0, easing: lifecycleEasing },
|
||||
() => {
|
||||
row.style.willChange = ''
|
||||
done()
|
||||
@@ -1921,12 +1938,12 @@ const enterLifecycleRow = (element: Element, done: () => void) => {
|
||||
}
|
||||
const leaveLifecycleRow = (element: Element, done: () => void) => {
|
||||
const row = element as HTMLElement
|
||||
row.style.willChange = 'transform, opacity'
|
||||
row.style.willChange = 'opacity'
|
||||
playDetailAnimation(
|
||||
row,
|
||||
[
|
||||
{ opacity: 1, transform: 'translate3d(0, 0, 0) scale(1)' },
|
||||
{ opacity: 0, transform: 'translate3d(0, -4px, 0) scale(0.99)' }
|
||||
{ opacity: 1 },
|
||||
{ opacity: 0 }
|
||||
],
|
||||
{ duration: LIFECYCLE_LEAVE_MS, easing: lifecycleExitEasing },
|
||||
() => {
|
||||
@@ -1935,6 +1952,32 @@ const leaveLifecycleRow = (element: Element, done: () => void) => {
|
||||
}
|
||||
)
|
||||
}
|
||||
const beforeExpandPanelEnter = (element: Element) => {
|
||||
const panel = element as HTMLElement
|
||||
panel.style.height = '0px'
|
||||
panel.style.overflow = 'hidden'
|
||||
}
|
||||
const enterExpandPanel = (element: Element, done: () => void) => {
|
||||
const panel = element as HTMLElement
|
||||
const targetHeight = panel.scrollHeight
|
||||
playDetailAnimation(panel, [{ height: '0px', opacity: 0 }, { height: `${targetHeight}px`, opacity: 1 }], { duration: 420, easing: 'cubic-bezier(0.22, 1, 0.36, 1)' }, done)
|
||||
}
|
||||
const afterExpandPanelEnter = (element: Element) => {
|
||||
const panel = element as HTMLElement
|
||||
panel.style.height = ''
|
||||
panel.style.overflow = ''
|
||||
}
|
||||
const beforeExpandPanelLeave = (element: Element) => {
|
||||
const panel = element as HTMLElement
|
||||
panel.style.height = `${panel.scrollHeight}px`
|
||||
panel.style.overflow = 'hidden'
|
||||
}
|
||||
const leaveExpandPanel = (element: Element, done: () => void) => {
|
||||
const panel = element as HTMLElement
|
||||
const currentHeight = panel.scrollHeight
|
||||
playDetailAnimation(panel, [{ height: `${currentHeight}px`, opacity: 1 }, { height: '0px', opacity: 0 }], { duration: 320, easing: 'cubic-bezier(0.4, 0, 0.8, 0.2)' }, done)
|
||||
}
|
||||
|
||||
const beforeRetrievalPanelEnter = (element: Element) => {
|
||||
const panel = element as HTMLElement
|
||||
panel.style.height = '0px'
|
||||
@@ -2517,7 +2560,7 @@ onUnmounted(() => {
|
||||
overflow: visible;
|
||||
/* Keep transformed lifecycle cards from being clipped at their top border. */
|
||||
contain: layout;
|
||||
will-change: opacity, transform;
|
||||
will-change: opacity;
|
||||
}
|
||||
|
||||
.fcb-lifecycle-card {
|
||||
@@ -2533,24 +2576,13 @@ onUnmounted(() => {
|
||||
|
||||
.fcb-expand-120-enter-active,
|
||||
.fcb-expand-120-leave-active {
|
||||
overflow: clip;
|
||||
will-change: opacity, transform;
|
||||
transition:
|
||||
opacity 180ms cubic-bezier(0.22, 1, 0.36, 1),
|
||||
transform 180ms cubic-bezier(0.22, 1, 0.36, 1);
|
||||
overflow: hidden;
|
||||
will-change: height, opacity;
|
||||
}
|
||||
|
||||
.fcb-expand-120-enter-from,
|
||||
.fcb-expand-120-leave-to {
|
||||
opacity: 0;
|
||||
transform: translate3d(0, -0.35rem, 0) scale(0.985);
|
||||
}
|
||||
|
||||
.fcb-expand-120-leave-to { opacity: 0; }
|
||||
.fcb-expand-120-enter-to,
|
||||
.fcb-expand-120-leave-from {
|
||||
opacity: 1;
|
||||
transform: translate3d(0, 0, 0) scale(1);
|
||||
}
|
||||
.fcb-expand-120-leave-from { opacity: 1; }
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.fcb-expand-120-enter-active,
|
||||
|
||||
Reference in new issue
Block a user