<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>超酷吉普车动画特效</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
background: linear-gradient(to bottom, #1a2a6c, #b21f1f, #fdbb2d);
height: 100vh;
overflow: hidden;
font-family: 'Arial', sans-serif;
}
.scene {
position: relative;
height: 100vh;
perspective: 1000px;
transform-style: preserve-3d;
}
.ground {
position: absolute;
bottom: 0;
width: 100%;
height: 200px;
background: linear-gradient(to bottom, #654321, #3e2723);
transform: rotateX(80deg) translateZ(-100px);
transform-origin: bottom;
}
.jeep {
position: absolute;
bottom: 150px;
left: 50%;
transform: translateX(-50%);
width: 300px;
height: 150px;
animation: drive 8s linear infinite;
}
.jeep-body {
position: relative;
width: 100%;
height: 100%;
background-color: #e74c3c;
border-radius: 20px 20px 0 0;
box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}
.jeep-top {
position: absolute;
top: 10px;
left: 50%;
transform: translateX(-50%);
width: 80%;
height: 60px;
background-color: #3498db;
border-radius: 10px 10px 0 0;
}
.jeep-windshield {
position: absolute;
top: 10px;
left: 50%;
transform: translateX(-50%);
width: 70%;
height: 40px;
background-color: rgba(52, 152, 219, 0.3);
border-radius: 5px;
}
.jeep-grill {
position: absolute;
bottom: 10px;
left: 50%;
transform: translateX(-50%);
width: 60%;
height: 30px;
background-color: #2c3e50;
border-radius: 5px;
}
.jeep-headlight {
position: absolute;
bottom: 20px;
width: 20px;
height: 20px;
border-radius: 50%;
background-color: #f1c40f;
box-shadow: 0 0 10px 5px #f1c40f;
}
.jeep-headlight.left {
left: 30px;
}
.jeep-headlight.right {
right: 30px;
}
.wheel {
position: absolute;
bottom: -25px;
width: 50px;
height: 50px;
border-radius: 50%;
background-color: #2c3e50;
border: 5px solid #7f8c8d;
animation: rotate 1s linear infinite;
}
.wheel.left {
left: 30px;
}
.wheel.right {
right: 30px;
}
.wheel::before {
content: '';
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 15px;
height: 15px;
border-radius: 50%;
background-color: #ecf0f1;
}
.mud {
position: absolute;
bottom: -10px;
width: 60px;
height: 30px;
background-color: #5d4037;
border-radius: 50%;
opacity: 0.8;
animation: mud 8s linear infinite;
}
.mud.left {
left: 20px;
animation-delay: 0s;
}
.mud.right {
right: 20px;
animation-delay: 0.2s;
}
.sun {
position: absolute;
top: 100px;
right: 100px;
width: 80px;
height: 80px;
border-radius: 50%;
background: radial-gradient(circle, #f1c40f, #e67e22);
box-shadow: 0 0 50px #f1c40f;
}
.cloud {
position: absolute;
background-color: rgba(255, 255, 255, 0.8);
border-radius: 50px;
animation: cloudMove 20s linear infinite;
}
.cloud1 {
top: 100px;
left: -200px;
width: 150px;
height: 60px;
animation-delay: 0s;
}
.cloud2 {
top: 180px;
left: -300px;
width: 200px;
height: 80px;
animation-delay: 5s;
}
.cloud3 {
top: 250px;
left: -250px;
width: 180px;
height: 70px;
animation-delay: 10s;
}
.title {
position: absolute;
top: 30px;
left: 50%;
transform: translateX(-50%);
color: white;
font-size: 2.5rem;
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
text-align: center;
}
.sponsor {
position: absolute;
bottom: 20px;
left: 50%;
transform: translateX(-50%);
color: white;
font-size: 1rem;
text-align: center;
}
.sponsor a {
color: #f1c40f;
text-decoration: none;
}
@keyframes drive {
0% {
transform: translateX(-50%) translateY(0);
}
25% {
transform: translateX(-50%) translateY(-10px);
}
50% {
transform: translateX(-50%) translateY(0);
}
75% {
transform: translateX(-50%) translateY(10px);
}
100% {
transform: translateX(-50%) translateY(0);
}
}
@keyframes rotate {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
@keyframes mud {
0% {
transform: scale(0.5);
opacity: 0;
}
10% {
transform: scale(1);
opacity: 0.8;
}
100% {
transform: scale(0.5) translateY(-100px) translateX(50px);
opacity: 0;
}
}
@keyframes cloudMove {
0% {
transform: translateX(0);
}
100% {
transform: translateX(calc(100vw + 300px));
}
}
/* 响应式调整 */
@media (max-width: 768px) {
.jeep {
width: 200px;
height: 100px;
bottom: 100px;
}
.wheel {
width: 30px;
height: 30px;
bottom: -15px;
}
.title {
font-size: 1.8rem;
}
}
</style>
</head>
<body>
<div class="scene">
<h1 class="title">超酷吉普车动画</h1>
<div class="sun"></div>
<div class="cloud cloud1"></div>
<div class="cloud cloud2"></div>
<div class="cloud cloud3"></div>
<div class="jeep">
<div class="jeep-body">
<div class="jeep-top"></div>
<div class="jeep-windshield"></div>
<div class="jeep-grill"></div>
<div class="jeep-headlight left"></div>
<div class="jeep-headlight right"></div>
<div class="wheel left"></div>
<div class="wheel right"></div>
<div class="mud left"></div>
<div class="mud right"></div>
</div>
</div>
<div class="ground"></div>
</div>
</body>
</html>