💄 style: 重构 2026 主题轻拟态视觉与丝滑动效

- 统一轻马卡龙配色、柔和阴影和卡片悬浮反馈

- 为生命周期和筛选面板增加真实高度连续展开收起动画

- 统一页面切换、列表、通知和发送内容切换动效

- 支持减少动态效果并保持键盘焦点和响应式布局
This commit is contained in:
orion committed 2026-09-11 10:03:49 +08:00
1 parent c76d4d9f64
commit dec682becc
13 files changed
+128 -74

No files matched your search

+3 -4
View File
@@ -73,13 +73,12 @@ const {
.transfer-fade-enter-active,
.transfer-fade-leave-active {
transition:
opacity 0.2s ease,
transform 0.2s ease;
opacity 0.28s ease;
}
.transfer-fade-enter-from {
opacity: 0;
transform: translateY(8px);
}
.transfer-fade-leave-active {
@@ -91,7 +90,7 @@ const {
.transfer-fade-leave-to {
opacity: 0;
transform: translateY(-6px);
}
.loading-overlay {
+27
View File
@@ -407,3 +407,30 @@ textarea {
.to-pink-600 {
--tw-gradient-to: #6f9688 var(--tw-gradient-to-position) !important;
}
/* Serenity-inspired soft pastel motion and surfaces. */
:root {
--fcb-pastel-sage: #9fc9bd;
--fcb-pastel-blue: #a9c7d8;
--fcb-pastel-lavender: #c5bddb;
--fcb-surface: #f2f6f8;
--fcb-shadow-soft: 0 12px 28px rgba(112, 137, 151, 0.16), -8px -8px 20px rgba(255,255,255,.72);
}
body { background: var(--fcb-surface); }
.theme-2026-card,
.theme-2026-card-hover {
border-color: rgba(170, 194, 201, .62) !important;
box-shadow: var(--fcb-shadow-soft) !important;
}
.theme-2026-card-hover:hover {
transform: translateY(-2px);
box-shadow: 0 16px 34px rgba(112, 137, 151, .22), -8px -8px 20px rgba(255,255,255,.78) !important;
}
button, a { -webkit-tap-highlight-color: transparent; }
button:not(:disabled), a { transition: color 220ms ease, background-color 220ms ease, border-color 220ms ease, box-shadow 220ms ease, opacity 220ms ease !important; }
.fcb-lifecycle-list { overflow: visible; will-change: height; }
.fcb-lifecycle-row { will-change: opacity; }
.fcb-lifecycle-card { transform: none !important; }
@media (prefers-reduced-motion: reduce) {
.theme-2026-card-hover:hover { transform: none; }
}
+2 -2
View File
@@ -78,11 +78,11 @@ const alertIcons = {
<style scoped>
.alert-fade-enter-active,
.alert-fade-leave-active {
transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
transition: opacity 280ms cubic-bezier(0.22, 1, 0.36, 1), transform 280ms cubic-bezier(0.22, 1, 0.36, 1);
}
.alert-fade-enter-from,
.alert-fade-leave-to {
opacity: 0;
transform: translateX(-50px) scale(0.95);
transform: translateY(-6px);
}
</style>
+1 -1
View File
@@ -1,6 +1,6 @@
<template>
<div
class="data-table-2026 theme-2026-card theme-2026-card-hover overflow-hidden rounded-[30px] shadow-md transition-all duration-300 hover:-translate-y-0.5 hover:shadow-lg"
class="data-table-2026 theme-2026-card theme-2026-card-hover overflow-hidden rounded-[30px] shadow-md transition-all duration-300 hover:shadow-lg"
>
<div
class="border-b px-6 py-4"
+1 -1
View File
@@ -98,7 +98,7 @@
<button
@click="$emit('close')"
class="mt-6 w-full rounded-[30px] bg-gradient-to-r from-indigo-500 to-purple-600 px-5 py-3 font-medium text-white transition duration-200 transform hover:scale-[1.01] hover:from-indigo-600 hover:to-purple-700 focus:outline-none focus:ring-2 focus:ring-purple-500 focus:ring-opacity-50 sm:mt-8 sm:px-6"
class="mt-6 w-full rounded-[30px] bg-gradient-to-r from-indigo-500 to-purple-600 px-5 py-3 font-medium text-white transition duration-200 transform hover:from-indigo-600 hover:to-purple-700 focus:outline-none focus:ring-2 focus:ring-purple-500 focus:ring-opacity-50 sm:mt-8 sm:px-6"
>
{{ t('common.close') }}
</button>
+2 -2
View File
@@ -47,6 +47,6 @@ const actionClass = computed(() => isDarkMode ? 'bg-gray-700 text-gray-200 hover
</script>
<style scoped>
.list-enter-active, .list-leave-active, .list-move { transition: all 0.24s ease; }
.list-enter-from, .list-leave-to { opacity: 0; transform: translateX(20px); }
.list-enter-active, .list-leave-active, .list-move { transition: opacity 240ms ease, transform 240ms cubic-bezier(0.22, 1, 0.36, 1); }
.list-enter-from, .list-leave-to { opacity: 0; transform: translateY(-4px); }
</style>
+1 -1
View File
@@ -45,7 +45,7 @@
</div>
<button
type="submit"
class="group relative w-full overflow-hidden rounded-lg bg-gradient-to-r from-indigo-500 via-purple-500 to-pink-500 px-4 py-3 font-bold text-white transition duration-300 hover:from-indigo-600 hover:via-purple-600 hover:to-pink-600 hover:shadow-lg focus:outline-none focus:ring-2 focus:ring-purple-500 focus:ring-opacity-50 disabled:cursor-not-allowed disabled:opacity-50 motion-safe:hover:scale-[1.02] disabled:hover:scale-100"
class="group relative w-full overflow-hidden rounded-lg bg-gradient-to-r from-indigo-500 via-purple-500 to-pink-500 px-4 py-3 font-bold text-white transition duration-300 hover:from-indigo-600 hover:via-purple-600 hover:to-pink-600 hover:shadow-lg focus:outline-none focus:ring-2 focus:ring-purple-500 focus:ring-opacity-50 disabled:cursor-not-allowed disabled:opacity-50 motion-safe:disabled:hover:scale-100"
:disabled="inputStatus.loading || code.trim().length !== 5"
>
<span class="flex items-center justify-center relative z-10">
+2 -2
View File
@@ -51,6 +51,6 @@ const actionClass = computed(() => isDarkMode ? 'bg-gray-700 text-gray-200 hover
</script>
<style scoped>
.list-enter-active, .list-leave-active { transition: all 0.24s ease; }
.list-enter-from, .list-leave-to { opacity: 0; transform: translateX(20px); }
.list-enter-active, .list-leave-active { transition: opacity 240ms ease, transform 240ms cubic-bezier(0.22, 1, 0.36, 1); }
.list-enter-from, .list-leave-to { opacity: 0; transform: translateY(-4px); }
</style>
+2 -2
View File
@@ -1,6 +1,6 @@
<template>
<div
class="theme-2026-card theme-2026-card-hover group rounded-[24px] p-4 shadow-md transition-all duration-300 hover:-translate-y-0.5 hover:shadow-lg sm:rounded-[30px] sm:p-6"
class="theme-2026-card theme-2026-card-hover group rounded-[24px] p-4 shadow-md transition-all duration-300 hover:shadow-lg sm:rounded-[30px] sm:p-6"
:class="[
isDarkMode
? 'hover:bg-gray-800 hover:shadow-black/20'
@@ -17,7 +17,7 @@
</h3>
</div>
<div
class="shrink-0 rounded-full p-2.5 transition-transform duration-300 group-hover:scale-105 sm:p-3"
class="shrink-0 rounded-full p-2.5 transition-transform duration-300 group-sm:p-3"
:class="iconBgClass"
>
<component :is="icon" class="h-5 w-5 sm:h-6 sm:w-6" :class="iconClass" aria-hidden="true" />
+2 -6
View File
@@ -49,7 +49,7 @@
<button
type="submit"
:disabled="isSubmitting"
class="w-full bg-gradient-to-r from-indigo-500 via-purple-500 to-pink-500 text-white font-bold py-4 px-6 rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-500 focus:ring-opacity-50 transition-all duration-300 transform hover:scale-105 hover:shadow-lg relative overflow-hidden group disabled:opacity-50 disabled:cursor-not-allowed disabled:transform-none disabled:hover:scale-100"
class="w-full bg-gradient-to-r from-indigo-500 via-purple-500 to-pink-500 text-white font-bold py-4 px-6 rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-500 focus:ring-opacity-50 transition-all duration-300 transform hover:shadow-lg relative overflow-hidden group disabled:opacity-50 disabled:cursor-not-allowed disabled:transform-none disabled:hover:scale-100"
>
<span
class="absolute top-0 left-0 w-full h-full bg-white opacity-0 group-hover:opacity-20 transition-opacity duration-300"
@@ -191,21 +191,17 @@ const toRetrieve = () => {
<style scoped>
.fade-enter-active,
.fade-leave-active {
transition:
opacity 0.3s ease,
transform 0.3s ease;
transition: opacity 280ms cubic-bezier(0.22, 1, 0.36, 1);
}
.fade-enter-from,
.fade-leave-to {
opacity: 0;
transform: translateY(10px);
}
.fade-enter-to,
.fade-leave-from {
opacity: 1;
transform: translateY(0);
}
:deep(.payload-panel) {
+8 -8
View File
@@ -85,7 +85,7 @@
<div v-if="dashboardData.hasExtendedStats" class="mt-6 grid grid-cols-1 gap-6 2xl:grid-cols-3">
<section
class="theme-2026-card theme-2026-card-hover rounded-[24px] p-4 shadow-md transition-all duration-200 hover:-translate-y-0.5 hover:shadow-lg sm:rounded-[30px] sm:p-5 2xl:col-span-2"
class="theme-2026-card theme-2026-card-hover rounded-[24px] p-4 shadow-md transition-all duration-200 hover:shadow-lg sm:rounded-[30px] sm:p-5 2xl:col-span-2"
:class="[panelClass, cardHoverClass]"
>
<div class="mb-4 flex items-center justify-between sm:mb-5">
@@ -129,7 +129,7 @@
v-for="action in healthActions"
:key="action.key"
type="button"
class="theme-2026-card-hover group flex min-h-20 flex-col justify-between rounded-[20px] border p-3 text-left shadow-sm transition-all duration-200 hover:-translate-y-0.5 hover:shadow-md sm:min-h-24 sm:rounded-[30px] sm:p-4"
class="theme-2026-card-hover group flex min-h-20 flex-col justify-between rounded-[20px] border p-3 text-left shadow-sm transition-all duration-200 hover:shadow-md sm:min-h-24 sm:rounded-[30px] sm:p-4"
:class="getHealthActionClass(action.tone)"
@click="openHealthQueue(action.health)"
>
@@ -151,7 +151,7 @@
<div class="mt-4 grid grid-cols-2 gap-2 sm:mt-6 sm:gap-4">
<div
class="theme-2026-card-hover rounded-[20px] border p-3 shadow-sm transition-all duration-200 hover:-translate-y-0.5 hover:shadow-md sm:rounded-[30px] sm:p-4 sm:shadow-md"
class="theme-2026-card-hover rounded-[20px] border p-3 shadow-sm transition-all duration-200 hover:shadow-md sm:rounded-[30px] sm:p-4 sm:shadow-md"
:class="[subtlePanelClass, cardHoverClass]"
>
<p class="text-sm" :class="[mutedTextClass]">
@@ -168,7 +168,7 @@
</div>
<div
class="theme-2026-card-hover rounded-[20px] border p-3 shadow-sm transition-all duration-200 hover:-translate-y-0.5 hover:shadow-md sm:rounded-[30px] sm:p-4 sm:shadow-md"
class="theme-2026-card-hover rounded-[20px] border p-3 shadow-sm transition-all duration-200 hover:shadow-md sm:rounded-[30px] sm:p-4 sm:shadow-md"
:class="[subtlePanelClass, cardHoverClass]"
>
<p class="text-sm" :class="[mutedTextClass]">
@@ -187,7 +187,7 @@
</section>
<section
class="theme-2026-card theme-2026-card-hover rounded-[24px] p-4 shadow-md transition-all duration-200 hover:-translate-y-0.5 hover:shadow-lg sm:rounded-[30px] sm:p-5"
class="theme-2026-card theme-2026-card-hover rounded-[24px] p-4 shadow-md transition-all duration-200 hover:shadow-lg sm:rounded-[30px] sm:p-5"
:class="[panelClass, cardHoverClass]"
>
<div class="mb-5">
@@ -235,7 +235,7 @@
<div class="mt-6 grid grid-cols-1 gap-6 xl:grid-cols-2">
<section
class="theme-2026-card theme-2026-card-hover rounded-[24px] p-4 shadow-md transition-all duration-200 hover:-translate-y-0.5 hover:shadow-lg sm:rounded-[30px] sm:p-5"
class="theme-2026-card theme-2026-card-hover rounded-[24px] p-4 shadow-md transition-all duration-200 hover:shadow-lg sm:rounded-[30px] sm:p-5"
:class="[panelClass, cardHoverClass]"
>
<div class="mb-5 flex flex-col gap-4">
@@ -317,7 +317,7 @@
</section>
<section
class="theme-2026-card theme-2026-card-hover rounded-[24px] p-4 shadow-md transition-all duration-200 hover:-translate-y-0.5 hover:shadow-lg sm:rounded-[30px] sm:p-5"
class="theme-2026-card theme-2026-card-hover rounded-[24px] p-4 shadow-md transition-all duration-200 hover:shadow-lg sm:rounded-[30px] sm:p-5"
:class="[panelClass, cardHoverClass]"
>
<div class="mb-5 flex items-center justify-between">
@@ -640,7 +640,7 @@ const MetricProgress = defineComponent({
'div',
{
class:
'theme-2026-card-hover rounded-[18px] border border-[#d4e0e3] bg-[#f6faf9] p-2.5 shadow-sm transition-all duration-200 hover:-translate-y-0.5 hover:border-[#8fb2bf] hover:shadow-md sm:rounded-[30px] sm:p-4 sm:shadow-md dark:border-[#40545c] dark:bg-[#17252c]/50 dark:hover:border-[#7199a8] dark:hover:bg-[#263941] dark:hover:shadow-black/25'
'theme-2026-card-hover rounded-[18px] border border-[#d4e0e3] bg-[#f6faf9] p-2.5 shadow-sm transition-all duration-200 hover:border-[#8fb2bf] hover:shadow-md sm:rounded-[30px] sm:p-4 sm:shadow-md dark:border-[#40545c] dark:bg-[#17252c]/50 dark:hover:border-[#7199a8] dark:hover:bg-[#263941] dark:hover:shadow-black/25'
},
[
h('div', { class: 'mb-2 flex items-center justify-between gap-3 text-sm' }, [
+76 -44
View File
@@ -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,
+1 -1
View File
@@ -90,7 +90,7 @@
<button
type="submit"
:class="[
'group relative w-full flex justify-center py-3 px-4 border border-transparent text-sm font-medium rounded-[30px] text-white transition-all duration-300 transform hover:scale-[1.02] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-[#8fb2bf] shadow-lg',
'group relative w-full flex justify-center py-3 px-4 border border-transparent text-sm font-medium rounded-[30px] text-white transition-all duration-300 transform focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-[#8fb2bf] shadow-lg',
isDarkMode
? 'bg-gradient-to-r from-[#5f8796] to-[#6f9688] hover:from-[#527887] hover:to-[#5f8377] hover:shadow-[#6f98a6]/35'
: 'bg-gradient-to-r from-[#5f8796] to-[#6f9688] hover:from-[#527887] hover:to-[#5f8377] hover:shadow-[#9fb8bf]/45',