fix: prevent content shaking during animation

This commit is contained in:
Hakadao
2023-10-02 17:09:50 +08:00
parent 8b7ce1ff0d
commit ae9e10d755

View File

@@ -507,8 +507,7 @@ function handleAdaptToOtherPageStylesChange() {
<main
v-if="isHomePage"
p="t-70px" m-auto
relative
p="t-80px" m-auto
:w="isVideoPage ? '[calc(100%-160px)]' : 'lg:85% md:[calc(90%-60px)] [calc(100%-140px)]'"
>
<!-- control button group -->
@@ -537,7 +536,7 @@ function handleAdaptToOtherPageStylesChange() {
</div>
<Transition name="fade">
<Component :is="pages[activatedPage]" :key="dynamicComponentKey" :style="{ position: 'absolute', width: '100%' }" />
<Component :is="pages[activatedPage]" :key="dynamicComponentKey" />
</Transition>
</main>
</div>
@@ -632,11 +631,13 @@ function handleAdaptToOtherPageStylesChange() {
.fade-leave-active {
transition: opacity 0.5s ease;
}
.fade-enter-from,
.fade-leave-to {
--at-apply: opacity-0;
}
.fade-leave-to {
--at-apply: hidden
}
.list-enter-active,
.list-leave-active {
@@ -646,4 +647,7 @@ function handleAdaptToOtherPageStylesChange() {
.list-leave-to {
--at-apply: opacity-0 transform translate-y-6 transform-gpu;
}
.list-leave-to {
--at-apply: hidden
}
</style>