add animation for page change

This commit is contained in:
LouisLam 2021-08-20 02:37:59 +08:00
parent 209e44c2e1
commit f21937b197
6 changed files with 514 additions and 478 deletions

View File

@ -183,3 +183,20 @@ h2 {
background-color: $dark-bg; background-color: $dark-bg;
} }
} }
/*
* Transitions
*/
// page-change
.slide-fade-enter-active {
transition: all 0.20s $easing-in;
}
.slide-fade-leave-active {
transition: all 0.20s $easing-in;
}
.slide-fade-enter-from,
.slide-fade-leave-to {
transform: translateY(50px);
opacity: 0;
}

View File

@ -12,3 +12,7 @@ $dark-font-color2: #020b05;
$dark-bg: #0D1117; $dark-bg: #0D1117;
$dark-bg2: #070A10; $dark-bg2: #070A10;
$dark-border-color: #1d2634; $dark-border-color: #1d2634;
$easing-in: cubic-bezier(0.54,0.78,0.55,0.97);
$easing-out: cubic-bezier(0.25, 0.46, 0.45, 0.94);
$easing-in-out: cubic-bezier(0.79, 0.14, 0.15, 0.86);

View File

@ -1,4 +1,5 @@
<template> <template>
<transition name="slide-fade" appear>
<div v-if="$route.name === 'DashboardHome'"> <div v-if="$route.name === 'DashboardHome'">
<h1 class="mb-3"> <h1 class="mb-3">
Quick Stats Quick Stats
@ -72,7 +73,7 @@
</div> </div>
</div> </div>
</div> </div>
</transition>
<router-view ref="child" /> <router-view ref="child" />
</template> </template>

View File

@ -1,4 +1,6 @@
<template> <template>
<transition name="slide-fade" appear>
<div>
<h1> {{ monitor.name }}</h1> <h1> {{ monitor.name }}</h1>
<p class="url"> <p class="url">
<a v-if="monitor.type === 'http' || monitor.type === 'keyword' " :href="monitor.url" target="_blank">{{ monitor.url }}</a> <a v-if="monitor.type === 'http' || monitor.type === 'keyword' " :href="monitor.url" target="_blank">{{ monitor.url }}</a>
@ -74,14 +76,7 @@
</div> </div>
</div> </div>
<div v-if="showPingChartBox" class="shadow-box big-padding text-center ping-chart-wrapper"> <transition name="slide-fade" appear>
<div class="row">
<div class="col">
<PingChart :monitor-id="monitor.id" />
</div>
</div>
</div>
<div v-if="showCertInfoBox" class="shadow-box big-padding text-center"> <div v-if="showCertInfoBox" class="shadow-box big-padding text-center">
<div class="row"> <div class="row">
<div class="col"> <div class="col">
@ -123,6 +118,15 @@
</div> </div>
</div> </div>
</div> </div>
</transition>
<div v-if="showPingChartBox" class="shadow-box big-padding text-center ping-chart-wrapper">
<div class="row">
<div class="col">
<PingChart :monitor-id="monitor.id" />
</div>
</div>
</div>
<div class="shadow-box"> <div class="shadow-box">
<table class="table table-borderless table-hover"> <table class="table table-borderless table-hover">
@ -164,6 +168,8 @@
<Confirm ref="confirmDelete" btn-style="btn-danger" @yes="deleteMonitor"> <Confirm ref="confirmDelete" btn-style="btn-danger" @yes="deleteMonitor">
Are you sure want to delete this monitor? Are you sure want to delete this monitor?
</Confirm> </Confirm>
</div>
</transition>
</template> </template>
<script> <script>

View File

@ -1,4 +1,6 @@
<template> <template>
<transition name="slide-fade" appear>
<div>
<h1 class="mb-3">{{ pageName }}</h1> <h1 class="mb-3">{{ pageName }}</h1>
<form @submit.prevent="submit"> <form @submit.prevent="submit">
<div class="shadow-box"> <div class="shadow-box">
@ -145,6 +147,8 @@
</form> </form>
<NotificationDialog ref="notificationDialog" /> <NotificationDialog ref="notificationDialog" />
</div>
</transition>
</template> </template>
<script> <script>
@ -181,7 +185,7 @@ export default {
}, },
}, },
watch: { watch: {
"$route.fullPath" () { "$route.fullPath"() {
this.init(); this.init();
}, },
}, },

View File

@ -1,5 +1,7 @@
<template> <template>
<h1 class="mb-3"> <transition name="slide-fade" appear>
<div>
<h1 v-show="show" class="mb-3">
Settings Settings
</h1> </h1>
@ -150,6 +152,8 @@
<p>It is for <strong>someone who have 3rd-party auth</strong> in front of Uptime Kuma such as Cloudflare Access.</p> <p>It is for <strong>someone who have 3rd-party auth</strong> in front of Uptime Kuma such as Cloudflare Access.</p>
<p>Please use it carefully.</p> <p>Please use it carefully.</p>
</Confirm> </Confirm>
</div>
</transition>
</template> </template>
<script> <script>
@ -174,7 +178,7 @@ export default {
return { return {
timezoneList: timezoneList(), timezoneList: timezoneList(),
guessTimezone: dayjs.tz.guess(), guessTimezone: dayjs.tz.guess(),
show: true,
invalidPassword: false, invalidPassword: false,
password: { password: {
currentPassword: "", currentPassword: "",