<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>纯CSS3双螺旋动画特效</title>
<style>
body {
margin: 0;
padding: 0;
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
background: #000;
overflow: hidden;
}
.spiral-container {
position: relative;
width: 300px;
height: 500px;
}
.spiral {
position: absolute;
width: 100%;
height: 100%;
}
.spiral::before {
content: "";
position: absolute;
top: 0;
left: 50%;
width: 20px;
height: 20px;
border-radius: 50%;
transform: translate(-50%, 0);
animation: spiral-animation 4s linear infinite;
}
.spiral.left::before {
background: linear-gradient(45deg, #ff00cc, #3333ff);
box-shadow: 0 0 15px #ff00cc;
}
.spiral.right::before {
background: linear-gradient(45deg, #00ffcc, #ff3399);
box-shadow: 0 0 15px #00ffcc;
animation-delay: 2s;
}
@keyframes spiral-animation {
0% {
top: 0;
opacity: 1;
transform: translate(-50%, 0) scale(1);
}
50% {
opacity: 0.5;
transform: translate(-50%, 250px) scale(0.5);
}
100% {
top: 100%;
opacity: 0;
transform: translate(-50%, 0) scale(0.1);
}
}
.spiral.left {
animation: rotate-left 16s linear infinite;
}
.spiral.right {
animation: rotate-right 16s linear infinite;
}
@keyframes rotate-left {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(-360deg);
}
}
@keyframes rotate-right {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
.spiral span {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
color: white;
font-family: Arial, sans-serif;
font-size: 14px;
opacity: 0.7;
}
/* 插入链接样式 */
.hidden-link {
position: absolute;
bottom: 20px;
left: 50%;
transform: translateX(-50%);
color: rgba(255,255,255,0.3);
font-family: Arial, sans-serif;
font-size: 12px;
text-decoration: none;
}
</style>
</head>
<body>
<div class="spiral-container">
<div class="spiral left"></div>
<div class="spiral right"></div>
</div>
</body>
</html>
纯CSS3双螺旋动画特效
于 2025-06-14 13:03:35 首次发布
449

被折叠的 条评论
为什么被折叠?



