✨ 增加生命周期外层卡片丝滑展开动画

This commit is contained in:
orion committed 2026-09-11 09:23:52 +08:00
1 parent 5ed1141b06
commit b10ac07970
1 file changed
+33 -1
+33 -1
View File
@@ -1219,8 +1219,10 @@
}} }}
</button> </button>
</div> </div>
<Transition name="fcb-lifecycle-shell" mode="out-in">
<div <div
class="rounded-[24px] border px-3 py-3 shadow-md sm:px-4 sm:py-4" :key="isLifecycleExpanded ? 'lifecycle-expanded' : 'lifecycle-collapsed'"
class="fcb-lifecycle-shell rounded-[24px] border px-3 py-3 shadow-md sm:px-4 sm:py-4"
:class="[isDarkMode ? 'border-gray-700 bg-gray-700/30' : 'border-gray-200 bg-white']" :class="[isDarkMode ? 'border-gray-700 bg-gray-700/30' : 'border-gray-200 bg-white']"
> >
<TransitionGroup <TransitionGroup
@@ -1303,6 +1305,7 @@
</template> </template>
</TransitionGroup> </TransitionGroup>
</div> </div>
</Transition>
</section> </section>
<section <section
@@ -2526,6 +2529,30 @@ onUnmounted(() => {
border-top-width: 1px; border-top-width: 1px;
} }
.fcb-lifecycle-shell {
transform-origin: top center;
}
.fcb-lifecycle-shell-enter-active,
.fcb-lifecycle-shell-leave-active {
overflow: hidden;
transition: opacity 420ms cubic-bezier(0.2, 0.8, 0.2, 1), transform 420ms cubic-bezier(0.2, 0.8, 0.2, 1), max-height 420ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.fcb-lifecycle-shell-enter-from,
.fcb-lifecycle-shell-leave-to {
max-height: 12rem;
opacity: 0;
transform: scaleY(0.72) translate3d(0, -0.5rem, 0);
}
.fcb-lifecycle-shell-enter-to,
.fcb-lifecycle-shell-leave-from {
max-height: 80rem;
opacity: 1;
transform: scaleY(1) translate3d(0, 0, 0);
}
.fcb-expand-content { .fcb-expand-content {
overflow: clip; overflow: clip;
will-change: grid-template-rows, opacity, transform; will-change: grid-template-rows, opacity, transform;
@@ -2557,5 +2584,10 @@ onUnmounted(() => {
.fcb-expand-120-leave-active { .fcb-expand-120-leave-active {
transition-duration: 1ms; transition-duration: 1ms;
} }
.fcb-lifecycle-shell-enter-active,
.fcb-lifecycle-shell-leave-active {
transition-duration: 1ms;
}
} }
</style> </style>