@nutui/nutui-react
Version:
京东风格的轻量级移动端 React 组件库,支持一套代码生成 H5 和小程序
246 lines (245 loc) • 5.4 kB
CSS
:root,
page {
--nut-scale-f: 1;
--nut-scale-font: var(--nut-scale-f, 1);
--nut-scale-icon: var(--nut-scale-f, 1);
--nut-icon-height: calc(16px * var(--nut-scale-icon, var(--nut-scale-f, 1))) ;
--nut-icon-width: calc(16px * var(--nut-scale-icon, var(--nut-scale-f, 1))) ;
--nut-icon-line-height: calc(16px * var(--nut-scale-icon, var(--nut-scale-f, 1))) ;
}
/* #ifdef harmony */
/* #endif */
/* #ifndef harmony */
/* #endif */
.nut-animate {
/* Animation CSS */
/* Slide Animations */
/* Shake Animation */
/* Ripple Animation */
/* Breath Animation */
/* Twinkle Animation */
/* Flicker Animation */
/* Jump Animation */
/* Float Animation */
/* Loop Animation */
}
.nut-animate [class*=nut-animate-] {
animation-duration: 0.5s;
animation-timing-function: ease-out;
animation-fill-mode: both;
}
@keyframes slide-right {
0% {
opacity: 0;
transform: translateX(100%);
}
100% {
opacity: 1;
transform: translateX(0);
}
}
@keyframes slide-left {
0% {
opacity: 0;
transform: translateX(-100%);
}
100% {
opacity: 1;
transform: translateX(0);
}
}
@keyframes slide-top {
0% {
opacity: 0;
transform: translateY(-100%);
}
100% {
opacity: 1;
transform: translateY(0);
}
}
@keyframes slide-bottom {
0% {
opacity: 0;
transform: translateY(100%);
}
100% {
opacity: 1;
transform: translateY(0);
}
}
.nut-animate .nut-animate-slide-right {
animation-name: slide-right;
}
.nut-animate .nut-animate-slide-left {
animation-name: slide-left;
}
.nut-animate .nut-animate-slide-top {
animation-name: slide-top;
}
.nut-animate .nut-animate-slide-bottom {
animation-name: slide-bottom;
}
@keyframes shake {
0%, 100% {
transform: translateX(0);
}
10% {
transform: translateX(calc(-9px * var(--nut-scale-f, 1)));
}
20% {
transform: translateX(calc(8px * var(--nut-scale-f, 1)));
}
30% {
transform: translateX(calc(-7px * var(--nut-scale-f, 1)));
}
40% {
transform: translateX(calc(6px * var(--nut-scale-f, 1)));
}
50% {
transform: translateX(calc(-5px * var(--nut-scale-f, 1)));
}
60% {
transform: translateX(calc(4px * var(--nut-scale-f, 1)));
}
70% {
transform: translateX(calc(-3px * var(--nut-scale-f, 1)));
}
80% {
transform: translateX(calc(2px * var(--nut-scale-f, 1)));
}
90% {
transform: translateX(calc(-1px * var(--nut-scale-f, 1)));
}
}
.nut-animate .nut-animate-shake {
animation-name: shake;
}
@keyframes ripple {
0% {
transform: scale(1);
}
50% {
transform: scale(1.1);
}
}
.nut-animate .nut-animate-ripple {
animation-name: ripple;
}
@keyframes breath {
0%, 100% {
transform: scale(1);
}
50% {
transform: scale(1.1);
}
}
.nut-animate .nut-animate-breath {
animation-name: breath;
animation-duration: 2700ms;
animation-timing-function: ease-in-out;
animation-direction: alternate;
}
.nut-animate .nut-animate-twinkle {
position: relative;
}
.nut-animate .nut-animate-twinkle::after, .nut-animate .nut-animate-twinkle::before {
width: calc(60px * var(--nut-scale-f, 1));
height: calc(60px * var(--nut-scale-f, 1));
content: "";
box-sizing: border-box;
border: calc(4px * var(--nut-scale-f, 1)) solid rgba(255, 255, 255, 0.6);
position: absolute;
border-radius: calc(30px * var(--nut-scale-f, 1));
right: 50%;
margin-top: calc(-30px * var(--nut-scale-f, 1));
margin-right: calc(-30px * var(--nut-scale-f, 1));
z-index: 1;
transform: scale(0);
animation: twinkle 2s ease-out infinite;
}
.nut-animate .nut-animate-twinkle::after {
animation-delay: 0.4s;
}
@keyframes twinkle {
0% {
transform: scale(0);
}
20% {
opacity: 1;
}
50%, 100% {
transform: scale(1.4);
opacity: 0;
}
}
.nut-animate .nut-animate-flicker {
position: relative;
overflow: hidden;
}
.nut-animate .nut-animate-flicker::after {
width: calc(100px * var(--nut-scale-f, 1));
height: calc(60px * var(--nut-scale-f, 1));
position: absolute;
left: 0;
top: 0;
opacity: 0.73;
content: "";
background-image: linear-gradient(106deg, rgba(232, 224, 255, 0) 24%, #e8e0ff 91%);
animation: flicker 1.5s linear infinite;
transform: skewX(-20deg);
filter: blur(calc(3px * var(--nut-scale-f, 1)));
}
@keyframes flicker {
0% {
transform: translateX(calc(-100px * var(--nut-scale-f, 1))) skewX(-20deg);
}
40%, 100% {
transform: translateX(calc(150px * var(--nut-scale-f, 1))) skewX(-20deg);
}
}
@keyframes jump {
0% {
transform: rotate(0) translateY(0);
}
25% {
transform: rotate(10deg) translateY(calc(20px * var(--nut-scale-f, 1)));
}
50% {
transform: rotate(0) translateY(calc(-10px * var(--nut-scale-f, 1)));
}
75% {
transform: rotate(-10deg) translateY(calc(20px * var(--nut-scale-f, 1)));
}
100% {
transform: rotate(0) translateY(0);
}
}
.nut-animate .nut-animate-jump {
transform-origin: center center;
animation: jump 0.7s linear;
}
@keyframes float-pop {
0% {
top: 0;
}
25% {
top: calc(1px * var(--nut-scale-f, 1));
}
50% {
top: calc(4px * var(--nut-scale-f, 1));
}
75% {
top: calc(1px * var(--nut-scale-f, 1));
}
100% {
top: 0;
}
}
.nut-animate .nut-animate-float {
position: relative;
animation-name: float-pop;
}
.nut-animate .loop {
animation-iteration-count: infinite;
}