加载动画
带有延迟效果的旋转圆环
/* 加载动画 CSS */
.loading-ring {
position: relative;
width: 60px;
height: 60px;
}
.loading-ring div {
position: absolute;
width: 100%;
height: 100%;
border: 3px solid transparent;
border-top-color: #6366f1;
border-radius: 50%;
animation: spin 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}
.loading-ring div:nth-child(1) { animation-delay: -0.45s; }
.loading-ring div:nth-child(2) { animation-delay: -0.3s; }
.loading-ring div:nth-child(3) { animation-delay: -0.15s; }
.loading-ring div:nth-child(4) { animation-delay: 0s; }
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
脉冲按钮
带有波纹效果的按钮
/* 脉冲按钮 CSS */
.pulse-btn {
position: relative;
padding: 12px 28px;
background: linear-gradient(135deg, #6366f1, #8b5cf6);
color: white;
border: none;
border-radius: 8px;
overflow: visible;
}
.demo-pulse-btn::before {
content: '';
position: absolute;
inset: -6px;
border: 2px solid #6366f1;
border-radius: 12px;
animation: pulse-ring 2s ease-out infinite;
}
@keyframes pulse-ring {
0% {
transform: scale(1);
opacity: 1;
}
100% {
transform: scale(1.3);
opacity: 0;
}
}
Hover Me
CSS Flip!
3D 翻转卡片
使用 preserve-3d 的 3D 变换效果
/* 3D 翻转卡片 CSS */
.flip-card {
perspective: 1000px;
width: 120px;
height: 150px;
}
.flip-inner {
position: relative;
width: 100%;
height: 100%;
transition: transform 0.8s;
transform-style: preserve-3d;
}
.flip-card:hover .flip-inner {
transform: rotateY(180deg);
}
.flip-front, .flip-back {
position: absolute;
width: 100%;
height: 100%;
backface-visibility: hidden;
border-radius: 12px;
}
.flip-back {
transform: rotateY(180deg);
}
CSS
霓虹发光
文字阴影动画效果
/* 霓虹发光 CSS */
.glow-text {
font-size: 2.5rem;
font-weight: 700;
color: #6366f1;
animation: glow 2s ease-in-out infinite;
}
@keyframes glow {
0%, 100% {
text-shadow:
0 0 10px #6366f1,
0 0 20px #6366f1;
}
50% {
text-shadow:
0 0 20px #6366f1,
0 0 40px #6366f1,
0 0 60px #8b5cf6;
}
}
变形Blob
流畅的 border-radius 动画
/* 变形Blob CSS */
.demo-blob {
width: 100px;
height: 100px;
background: linear-gradient(135deg, #6366f1, #8b5cf6);
animation: morph 6s ease-in-out infinite;
}
@keyframes morph {
0%, 100% {
border-radius:
60% 40% 30% 70% / 60% 30% 70% 40%;
}
50% {
border-radius:
30% 60% 70% 40% / 50% 60% 30% 60%;
}
}
弹性弹跳
具有弹性的跳动效果
/* 弹性弹跳 CSS */
.demo-bounce {
width: 60px;
height: 60px;
background: linear-gradient(135deg, #6366f1, #8b5cf6);
border-radius: 12px;
animation: bounce-demo 0.6s ease infinite;
}
@keyframes bounce-demo {
0%, 100% { transform: translateY(0); }
50% { transform: translateY(-30px); }
}
波浪加载器
错落的圆点动画
/* 波浪加载器 CSS */
.demo-wave {
display: flex;
gap: 6px;
}
.demo-wave span {
width: 10px;
height: 10px;
background: #6366f1;
border-radius: 50%;
animation: wave 1s ease-in-out infinite;
}
.demo-wave span:nth-child(1) { animation-delay: 0s; }
.demo-wave span:nth-child(2) { animation-delay: 0.1s; }
.demo-wave span:nth-child(3) { animation-delay: 0.2s; }
.demo-wave span:nth-child(4) { animation-delay: 0.3s; }
.demo-wave span:nth-child(5) { animation-delay: 0.4s; }
@keyframes wave {
0%, 80%, 100% {
transform: scale(0);
opacity: 0.5;
}
40% {
transform: scale(1);
opacity: 1;
}
}
心跳动画
有节奏的缩放效果
/* 心跳动画 CSS */
.demo-heart {
width: 48px;
height: 48px;
animation: heartbeat 1s ease-in-out infinite;
}
@keyframes heartbeat {
0%, 100% { transform: scale(1); }
15% { transform: scale(1.15); }
30% { transform: scale(1); }
45% { transform: scale(1.15); }
60% { transform: scale(1); }
}