File size: 1,998 Bytes
bbb6398 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
/* 动画与过渡效果
* 包含网站中所有动画相关样式,如展开/收起、淡入等效果
*/
/* 折叠面板动画 - 使用will-change提高性能 */
.accordion-content {
will-change: transform, opacity, max-height;
transform-origin: top;
backface-visibility: hidden;
}
.accordion-icon {
will-change: transform;
transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1); /* 弹性过渡 */
}
/* 平滑展开/收起的时间函数 */
.accordion-expand {
animation-timing-function: cubic-bezier(0.17, 0.84, 0.44, 1);
}
.accordion-collapse {
animation-timing-function: cubic-bezier(0.6, 0.04, 0.98, 0.34);
}
/* 展开动画:从0高度逐渐展开到全高 */
@keyframes smoothExpand {
0% {
max-height: 0;
opacity: 0;
transform: scaleY(0.95);
}
50% {
opacity: 0.5;
}
100% {
max-height: 2000px;
opacity: 1;
transform: scaleY(1);
}
}
/* 收起动画:从全高逐渐收起到0高度 */
@keyframes smoothCollapse {
0% {
max-height: 2000px;
opacity: 1;
transform: scaleY(1);
}
30% {
opacity: 0.7;
}
100% {
max-height: 0;
opacity: 0;
transform: scaleY(0.95);
}
}
/* 淡入动画 - 用于元素出现时的平滑过渡 */
@keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}
.fade-in {
animation: fadeIn 0.15s ease-in-out;
}
/* 单次弹跳动画 - 用于吸引注意力 */
@keyframes ping-once {
0% {
transform: scale(0.95);
opacity: 0.8;
}
30% {
transform: scale(1.2);
opacity: 0.5;
}
70% {
transform: scale(0.95);
opacity: 0.3;
}
100% {
transform: scale(1);
opacity: 0;
}
}
.animate-ping-once {
animation: ping-once 0.8s cubic-bezier(0, 0, 0.2, 1) forwards;
}
|