From f21937b19715f579c8020f7409627258f1ae5d8e Mon Sep 17 00:00:00 2001 From: LouisLam Date: Fri, 20 Aug 2021 02:37:59 +0800 Subject: [PATCH] add animation for page change --- src/assets/app.scss | 17 ++ src/assets/vars.scss | 4 + src/pages/DashboardHome.vue | 135 ++++++++-------- src/pages/Details.vue | 306 ++++++++++++++++++------------------ src/pages/EditMonitor.vue | 270 +++++++++++++++---------------- src/pages/Settings.vue | 260 +++++++++++++++--------------- 6 files changed, 514 insertions(+), 478 deletions(-) diff --git a/src/assets/app.scss b/src/assets/app.scss index 57e1dee9e..2dbddd3df 100644 --- a/src/assets/app.scss +++ b/src/assets/app.scss @@ -183,3 +183,20 @@ h2 { 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; +} diff --git a/src/assets/vars.scss b/src/assets/vars.scss index 6d331370b..58ad677c8 100644 --- a/src/assets/vars.scss +++ b/src/assets/vars.scss @@ -12,3 +12,7 @@ $dark-font-color2: #020b05; $dark-bg: #0D1117; $dark-bg2: #070A10; $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); diff --git a/src/pages/DashboardHome.vue b/src/pages/DashboardHome.vue index 955358080..5c14eb356 100644 --- a/src/pages/DashboardHome.vue +++ b/src/pages/DashboardHome.vue @@ -1,78 +1,79 @@ diff --git a/src/pages/Details.vue b/src/pages/Details.vue index fca03e3ca..b723def2e 100644 --- a/src/pages/Details.vue +++ b/src/pages/Details.vue @@ -1,169 +1,175 @@