feat(router): add GSAP page transition animations

This commit is contained in:
LTbinglingfeng
2026-01-02 00:01:25 +08:00
parent 3a66dc225d
commit 946ed36af0
8 changed files with 234 additions and 30 deletions

View File

@@ -0,0 +1,34 @@
@use '@/styles/variables.scss' as *;
.page-transition {
position: relative;
flex: 1 0 auto;
display: flex;
flex-direction: column;
min-height: 0;
overflow: hidden;
&__layer {
display: flex;
flex-direction: column;
gap: $spacing-lg;
min-height: 0;
flex: 1;
will-change: transform, opacity;
// During animation, exit layer uses absolute positioning
&--exit {
position: absolute;
inset: 0;
z-index: 1;
overflow: hidden;
pointer-events: none;
}
}
// When both layers exist, current layer also needs positioning
&--animating &__layer:not(&__layer--exit) {
position: relative;
z-index: 0;
}
}