reat(design): add page transition animations

This commit is contained in:
2025-09-24 17:46:33 +03:00
parent b7b255887d
commit 750da61587
3 changed files with 32 additions and 3 deletions

View File

@@ -1,7 +1,11 @@
<template> <template>
<div class="app-container h-full"> <div class="app-container h-full">
<FullscreenViewport v-if="platform === 'ios' || platform === 'android'"/> <FullscreenViewport v-if="platform === 'ios' || platform === 'android'"/>
<router-view/> <RouterView v-slot="{ Component, route }">
<Transition name="route" mode="out-in" appear>
<component :is="Component" :key="route.fullPath" />
</Transition>
</RouterView>
<CartButton/> <CartButton/>
</div> </div>
</template> </template>
@@ -40,3 +44,29 @@ watch(
{immediate: true} {immediate: true}
); );
</script> </script>
<style scoped>
/* очень мягкий fade+slide */
.route-enter-from,
.route-leave-to {
opacity: 0;
transform: translateY(6px);
}
.route-enter-active,
.route-leave-active {
transition: opacity .18s ease, transform .18s ease;
}
/* уважение к reduced motion */
@media (prefers-reduced-motion: reduce) {
.route-enter-active,
.route-leave-active {
transition: opacity .12s linear;
}
.route-enter-from,
.route-leave-to {
transform: none;
}
}
</style>

View File

@@ -9,7 +9,6 @@
<p class="text-sm text-muted">Мы на перерыве, скоро всё снова заработает 🛠</p> <p class="text-sm text-muted">Мы на перерыве, скоро всё снова заработает 🛠</p>
</div> </div>
</div> </div>
</template> </template>
<script setup> <script setup>

View File

@@ -113,8 +113,8 @@
:activeIndex="initialFullScreenIndex" :activeIndex="initialFullScreenIndex"
@close="closeFullScreen" @close="closeFullScreen"
/> />
<LoadingFullScreen v-if="isLoading"/>
</div> </div>
<LoadingFullScreen v-if="isLoading"/>
</template> </template>
<script setup> <script setup>