From 4833a29e574268faeb529b0e24e0486f5e0dba3a Mon Sep 17 00:00:00 2001 From: Donald Zou Date: Fri, 4 Oct 2024 17:27:25 +0800 Subject: [PATCH] Adjusted some transition between routes --- src/static/app/src/router/index.js | 9 +++++++++ src/static/css/dashboard.css | 8 +++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/static/app/src/router/index.js b/src/static/app/src/router/index.js index 7df462e..25f8493 100644 --- a/src/static/app/src/router/index.js +++ b/src/static/app/src/router/index.js @@ -27,6 +27,15 @@ const checkAuth = async () => { const router = createRouter({ history: createWebHashHistory(), + scrollBehavior(){ + if (document.querySelector("main") !== null){ + document.querySelector("main").scrollTo({ + top: 0 + }) + } + + + }, routes: [ { name: "Index", diff --git a/src/static/css/dashboard.css b/src/static/css/dashboard.css index 7903a65..f2a9671 100644 --- a/src/static/css/dashboard.css +++ b/src/static/css/dashboard.css @@ -1051,16 +1051,18 @@ pre.index-alert { .fade2-enter-active, .fade2-leave-active { - transition: all 0.15s ease-in-out; + transition: all 0.2s cubic-bezier(0.82, 0.58, 0.17, 0.9); } .fade2-enter-from{ - transform: translateX(20px); + transform: translateY(30px); + filter: blur(3px); opacity: 0; } .fade2-leave-to { - transform: translateX(-20px); + transform: translateY(-30px); + filter: blur(3px); opacity: 0; }