✨ 统一公开页面并实现生命周期真实高度动画
This commit is contained in:
1 parent
b10ac07970
commit
5e71cde60e
3 files changed
+32
-8
No files matched your search
@@ -4,7 +4,7 @@
|
|||||||
>
|
>
|
||||||
<div class="relative z-10 w-full max-w-md">
|
<div class="relative z-10 w-full max-w-md">
|
||||||
<div
|
<div
|
||||||
class="public-page-card rounded-3xl shadow-2xl overflow-hidden border transform transition-all duration-300"
|
class="public-page-card theme-2026-card theme-2026-card-hover rounded-[30px] overflow-hidden border shadow-2xl transition-all duration-300"
|
||||||
:class="[
|
:class="[
|
||||||
isDarkMode
|
isDarkMode
|
||||||
? 'bg-gray-800 bg-opacity-50 backdrop-filter backdrop-blur-xl border-gray-700'
|
? 'bg-gray-800 bg-opacity-50 backdrop-filter backdrop-blur-xl border-gray-700'
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
@paste.prevent="handlePaste"
|
@paste.prevent="handlePaste"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="public-page-card rounded-3xl shadow-2xl overflow-hidden border w-full max-w-md transition-colors duration-300"
|
class="public-page-card theme-2026-card theme-2026-card-hover rounded-[30px] overflow-hidden border shadow-2xl w-full max-w-md transition-all duration-300"
|
||||||
:class="[
|
:class="[
|
||||||
isDarkMode
|
isDarkMode
|
||||||
? 'bg-white bg-opacity-10 backdrop-filter backdrop-blur-xl border-gray-700'
|
? 'bg-white bg-opacity-10 backdrop-filter backdrop-blur-xl border-gray-700'
|
||||||
@@ -54,7 +54,7 @@
|
|||||||
<button
|
<button
|
||||||
type="submit"
|
type="submit"
|
||||||
:disabled="isSubmitting"
|
: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-[#5f8796] hover:bg-[#527887] text-white font-bold py-4 px-6 rounded-xl focus:outline-none focus:ring-2 focus:ring-[#8fb2bf] focus:ring-opacity-60 transition-all duration-300 hover:-translate-y-0.5 hover:shadow-lg relative overflow-hidden group disabled:opacity-50 disabled:cursor-not-allowed disabled:transform-none"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
class="absolute top-0 left-0 w-full h-full bg-white opacity-0 group-hover:opacity-20 transition-opacity duration-300"
|
class="absolute top-0 left-0 w-full h-full bg-white opacity-0 group-hover:opacity-20 transition-opacity duration-300"
|
||||||
|
|||||||
@@ -1219,9 +1219,8 @@
|
|||||||
}}
|
}}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<Transition name="fcb-lifecycle-shell" mode="out-in">
|
|
||||||
<div
|
<div
|
||||||
:key="isLifecycleExpanded ? 'lifecycle-expanded' : 'lifecycle-collapsed'"
|
ref="lifecycleShell"
|
||||||
class="fcb-lifecycle-shell rounded-[24px] border px-3 py-3 shadow-md sm:px-4 sm:py-4"
|
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']"
|
||||||
>
|
>
|
||||||
@@ -1305,7 +1304,6 @@
|
|||||||
</template>
|
</template>
|
||||||
</TransitionGroup>
|
</TransitionGroup>
|
||||||
</div>
|
</div>
|
||||||
</Transition>
|
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section
|
<section
|
||||||
@@ -1707,7 +1705,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<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 { useI18n } from 'vue-i18n'
|
||||||
import { useRoute, useRouter } from 'vue-router'
|
import { useRoute, useRouter } from 'vue-router'
|
||||||
import type {
|
import type {
|
||||||
@@ -1993,6 +1991,31 @@ watch(
|
|||||||
isRetrievalHistoryExpanded.value = false
|
isRetrievalHistoryExpanded.value = false
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
const lifecycleShell = ref<HTMLElement | null>(null)
|
||||||
|
let lifecycleShellAnimation: Animation | null = null
|
||||||
|
const animateLifecycleShell = async () => {
|
||||||
|
const shell = lifecycleShell.value
|
||||||
|
if (!shell || reducedMotionQuery.matches) return
|
||||||
|
lifecycleShellAnimation?.cancel()
|
||||||
|
const currentHeight = shell.getBoundingClientRect().height
|
||||||
|
shell.style.height = `${currentHeight}px`
|
||||||
|
shell.style.overflow = 'hidden'
|
||||||
|
await nextTick()
|
||||||
|
const targetHeight = shell.scrollHeight
|
||||||
|
lifecycleShellAnimation = shell.animate(
|
||||||
|
[{ height: `${currentHeight}px` }, { height: `${targetHeight}px` }],
|
||||||
|
{ duration: 460, easing: lifecycleEasing, fill: 'both' }
|
||||||
|
)
|
||||||
|
try { await lifecycleShellAnimation.finished } catch { return }
|
||||||
|
shell.style.height = ''
|
||||||
|
shell.style.overflow = ''
|
||||||
|
lifecycleShellAnimation = null
|
||||||
|
}
|
||||||
|
|
||||||
|
watch([isLifecycleExpanded, isRetrievalHistoryExpanded], () => {
|
||||||
|
void animateLifecycleShell()
|
||||||
|
})
|
||||||
|
|
||||||
const filterBodyVisible = computed(() => isFilterPanelOpen.value || hasActiveFilters.value)
|
const filterBodyVisible = computed(() => isFilterPanelOpen.value || hasActiveFilters.value)
|
||||||
|
|
||||||
watch(hasSelectedFiles, (selected) => {
|
watch(hasSelectedFiles, (selected) => {
|
||||||
@@ -2526,7 +2549,8 @@ onUnmounted(() => {
|
|||||||
.fcb-lifecycle-card {
|
.fcb-lifecycle-card {
|
||||||
position: relative;
|
position: relative;
|
||||||
overflow: visible;
|
overflow: visible;
|
||||||
border-top-width: 1px;
|
border: 1px solid rgba(191, 208, 211, 0.78) !important;
|
||||||
|
border-top: 1px solid rgba(191, 208, 211, 0.78) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.fcb-lifecycle-shell {
|
.fcb-lifecycle-shell {
|
||||||
|
|||||||
Reference in new issue
Block a user