mirror of
https://github.com/jekip/naive-ui-admin.git
synced 2026-03-01 00:23:11 +08:00
Add animation less back
This commit is contained in:
@@ -81,3 +81,7 @@
|
|||||||
document.removeEventListener('mousedown', timekeeping);
|
document.removeEventListener('mousedown', timekeeping);
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<style lang="less">
|
||||||
|
@import 'styles/index.less';
|
||||||
|
</style>
|
||||||
|
|||||||
1
src/styles/index.less
Normal file
1
src/styles/index.less
Normal file
@@ -0,0 +1 @@
|
|||||||
|
@import 'transition/index.less';
|
||||||
18
src/styles/transition/base.less
Normal file
18
src/styles/transition/base.less
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
.transition-default() {
|
||||||
|
&-enter-active,
|
||||||
|
&-leave-active {
|
||||||
|
transition: 0.3s cubic-bezier(0.25, 0.8, 0.5, 1) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-move {
|
||||||
|
transition: transform 0.4s;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.expand-transition {
|
||||||
|
.transition-default();
|
||||||
|
}
|
||||||
|
|
||||||
|
.expand-x-transition {
|
||||||
|
.transition-default();
|
||||||
|
}
|
||||||
81
src/styles/transition/fade.less
Normal file
81
src/styles/transition/fade.less
Normal file
@@ -0,0 +1,81 @@
|
|||||||
|
.fade-enter-active,
|
||||||
|
.fade-leave-active {
|
||||||
|
transition: opacity 0.2s ease-in-out;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fade-enter-from,
|
||||||
|
.fade-leave-to {
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* fade-slide */
|
||||||
|
.fade-slide-leave-active,
|
||||||
|
.fade-slide-enter-active {
|
||||||
|
transition: all 0.3s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fade-slide-enter-from {
|
||||||
|
opacity: 0;
|
||||||
|
transform: translateX(-30px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.fade-slide-leave-to {
|
||||||
|
opacity: 0;
|
||||||
|
transform: translateX(30px);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ///////////////////////////////////////////////
|
||||||
|
// Fade Bottom
|
||||||
|
// ///////////////////////////////////////////////
|
||||||
|
|
||||||
|
// Speed: 1x
|
||||||
|
.fade-bottom-enter-active,
|
||||||
|
.fade-bottom-leave-active {
|
||||||
|
transition: opacity 0.25s, transform 0.3s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fade-bottom-enter-from {
|
||||||
|
opacity: 0;
|
||||||
|
transform: translateY(-10%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.fade-bottom-leave-to {
|
||||||
|
opacity: 0;
|
||||||
|
transform: translateY(10%);
|
||||||
|
}
|
||||||
|
|
||||||
|
// fade-scale
|
||||||
|
.fade-scale-leave-active,
|
||||||
|
.fade-scale-enter-active {
|
||||||
|
transition: all 0.28s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fade-scale-enter-from {
|
||||||
|
opacity: 0;
|
||||||
|
transform: scale(1.2);
|
||||||
|
}
|
||||||
|
|
||||||
|
.fade-scale-leave-to {
|
||||||
|
opacity: 0;
|
||||||
|
transform: scale(0.8);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ///////////////////////////////////////////////
|
||||||
|
// Fade Top
|
||||||
|
// ///////////////////////////////////////////////
|
||||||
|
|
||||||
|
// Speed: 1x
|
||||||
|
.fade-top-enter-active,
|
||||||
|
.fade-top-leave-active {
|
||||||
|
transition: opacity 0.2s, transform 0.25s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fade-top-enter-from {
|
||||||
|
opacity: 0;
|
||||||
|
transform: translateY(8%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.fade-top-leave-to {
|
||||||
|
opacity: 0;
|
||||||
|
transform: translateY(-8%);
|
||||||
|
}
|
||||||
10
src/styles/transition/index.less
Normal file
10
src/styles/transition/index.less
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
@import './base.less';
|
||||||
|
@import './fade.less';
|
||||||
|
@import './scale.less';
|
||||||
|
@import './slide.less';
|
||||||
|
@import './scroll.less';
|
||||||
|
@import './zoom.less';
|
||||||
|
|
||||||
|
.collapse-transition {
|
||||||
|
transition: 0.2s height ease-in-out, 0.2s padding-top ease-in-out, 0.2s padding-bottom ease-in-out;
|
||||||
|
}
|
||||||
21
src/styles/transition/scale.less
Normal file
21
src/styles/transition/scale.less
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
.scale-transition {
|
||||||
|
.transition-default();
|
||||||
|
|
||||||
|
&-enter-from,
|
||||||
|
&-leave,
|
||||||
|
&-leave-to {
|
||||||
|
opacity: 0;
|
||||||
|
transform: scale(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.scale-rotate-transition {
|
||||||
|
.transition-default();
|
||||||
|
|
||||||
|
&-enter-from,
|
||||||
|
&-leave,
|
||||||
|
&-leave-to {
|
||||||
|
opacity: 0;
|
||||||
|
transform: scale(0) rotate(-45deg);
|
||||||
|
}
|
||||||
|
}
|
||||||
67
src/styles/transition/scroll.less
Normal file
67
src/styles/transition/scroll.less
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
.scroll-y-transition {
|
||||||
|
.transition-default();
|
||||||
|
|
||||||
|
&-enter-from,
|
||||||
|
&-leave-to {
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-enter-from {
|
||||||
|
transform: translateY(-15px);
|
||||||
|
}
|
||||||
|
|
||||||
|
&-leave-to {
|
||||||
|
transform: translateY(15px);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.scroll-y-reverse-transition {
|
||||||
|
.transition-default();
|
||||||
|
|
||||||
|
&-enter-from,
|
||||||
|
&-leave-to {
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-enter-from {
|
||||||
|
transform: translateY(15px);
|
||||||
|
}
|
||||||
|
|
||||||
|
&-leave-to {
|
||||||
|
transform: translateY(-15px);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.scroll-x-transition {
|
||||||
|
.transition-default();
|
||||||
|
|
||||||
|
&-enter-from,
|
||||||
|
&-leave-to {
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-enter-from {
|
||||||
|
transform: translateX(-15px);
|
||||||
|
}
|
||||||
|
|
||||||
|
&-leave-to {
|
||||||
|
transform: translateX(15px);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.scroll-x-reverse-transition {
|
||||||
|
.transition-default();
|
||||||
|
|
||||||
|
&-enter-from,
|
||||||
|
&-leave-to {
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-enter-from {
|
||||||
|
transform: translateX(15px);
|
||||||
|
}
|
||||||
|
|
||||||
|
&-leave-to {
|
||||||
|
transform: translateX(-15px);
|
||||||
|
}
|
||||||
|
}
|
||||||
39
src/styles/transition/slide.less
Normal file
39
src/styles/transition/slide.less
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
.slide-y-transition {
|
||||||
|
.transition-default();
|
||||||
|
|
||||||
|
&-enter-from,
|
||||||
|
&-leave-to {
|
||||||
|
opacity: 0;
|
||||||
|
transform: translateY(-15px);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.slide-y-reverse-transition {
|
||||||
|
.transition-default();
|
||||||
|
|
||||||
|
&-enter-from,
|
||||||
|
&-leave-to {
|
||||||
|
opacity: 0;
|
||||||
|
transform: translateY(15px);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.slide-x-transition {
|
||||||
|
.transition-default();
|
||||||
|
|
||||||
|
&-enter-from,
|
||||||
|
&-leave-to {
|
||||||
|
opacity: 0;
|
||||||
|
transform: translateX(-15px);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.slide-x-reverse-transition {
|
||||||
|
.transition-default();
|
||||||
|
|
||||||
|
&-enter-from,
|
||||||
|
&-leave-to {
|
||||||
|
opacity: 0;
|
||||||
|
transform: translateX(15px);
|
||||||
|
}
|
||||||
|
}
|
||||||
27
src/styles/transition/zoom.less
Normal file
27
src/styles/transition/zoom.less
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
// zoom-out
|
||||||
|
.zoom-out-enter-active,
|
||||||
|
.zoom-out-leave-active {
|
||||||
|
transition: opacity 0.1 ease-in-out, transform 0.15s ease-out;
|
||||||
|
}
|
||||||
|
|
||||||
|
.zoom-out-enter-from,
|
||||||
|
.zoom-out-leave-to {
|
||||||
|
opacity: 0;
|
||||||
|
transform: scale(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
// zoom-fade
|
||||||
|
.zoom-fade-enter-active,
|
||||||
|
.zoom-fade-leave-active {
|
||||||
|
transition: transform 0.2s, opacity 0.3s ease-out;
|
||||||
|
}
|
||||||
|
|
||||||
|
.zoom-fade-enter-from {
|
||||||
|
opacity: 0;
|
||||||
|
transform: scale(0.92);
|
||||||
|
}
|
||||||
|
|
||||||
|
.zoom-fade-leave-to {
|
||||||
|
opacity: 0;
|
||||||
|
transform: scale(1.06);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user