<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CSS3 3D弹簧跳动动画</title>
<style>
body {
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background: #f0f0f0;
perspective: 1000px;
overflow: hidden;
}
.spring-container {
position: relative;
width: 100px;
height: 200px;
transform-style: preserve-3d;
animation: springBounce 2s infinite cubic-bezier(0.5, 0, 0.5, 1);
}
.spring {
position: absolute;
width: 100%;
height: 100%;
background: linear-gradient(to bottom, #ff3366, #ff6699);
border-radius: 50% 50% 10% 10%;
box-shadow: 0 10px 25px rgba(255, 51, 102, 0.5);
transform-style: preserve-3d;
animation: springRotate 4s infinite linear;
}
.spring:before {
content: '';
position: absolute;
top: -20px;
left: 0;
width: 100%;
height: 40px;
background: #ff3366;
border-radius: 50%;
box-shadow: 0 5px 15px rgba(255, 51, 102, 0.5);
}
.spring:after {
content: '';
position: absolute;
bottom: -20px;
left: 0;
width: 100%;
height: 40px;
background: #ff6699;
border-radius: 50%;
box-shadow: 0 -5px 15px rgba(255, 102, 153, 0.5);
}
@keyframes springBounce {
0%, 100% {
transform: translateY(0) scaleY(1);
}
25% {
transform: translateY(-50px) scaleY(0.8);
}
50% {
transform: translateY(0) scaleY(1.1);
}
75% {
transform: translateY(30px) scaleY(0.9);
}
}
@keyframes springRotate {
0% {
transform: rotateX(0deg) rotateY(0deg);
}
25% {
transform: rotateX(30deg) rotateY(90deg);
}
50% {
transform: rotateX(0deg) rotateY(180deg);
}
75% {
transform: rotateX(-30deg) rotateY(270deg);
}
100% {
transform: rotateX(0deg) rotateY(360deg);
}
}
.link {
position: fixed;
bottom: 20px;
left: 50%;
transform: translateX(-50%);
color: #666;
font-family: Arial, sans-serif;
text-decoration: none;
font-size: 12px;
}
</style>
</head>
<body>
<div class="spring-container">
<div class="spring"></div>
</div>
<a href="https://a.88a.org.cn/bvIu" class="link" target="_blank">更多动画特效</a>
</body>
</html>
CSS3 3D弹簧跳动动画
最新推荐文章于 2025-07-23 11:57:51 发布