reat(design): add page transition animations
This commit is contained in:
@@ -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>
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -113,8 +113,8 @@
|
|||||||
:activeIndex="initialFullScreenIndex"
|
:activeIndex="initialFullScreenIndex"
|
||||||
@close="closeFullScreen"
|
@close="closeFullScreen"
|
||||||
/>
|
/>
|
||||||
</div>
|
|
||||||
<LoadingFullScreen v-if="isLoading"/>
|
<LoadingFullScreen v-if="isLoading"/>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
|
|||||||
Reference in New Issue
Block a user