<!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>
body {
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background: #1a0033;
overflow: hidden;
font-family: Arial, sans-serif;
}
.ghost {
position: relative;
width: 120px;
height: 150px;
animation: float 3s ease-in-out infinite;
}
.ghost-body {
position: absolute;
width: 120px;
height: 120px;
background: rgba(255, 255, 255, 0.9);
border-radius: 60px 60px 0 0;
box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}
.ghost-body::before,
.ghost-body::after {
content: '';
position: absolute;
width: 25px;
height: 25px;
background: rgba(255, 255, 255, 0.9);
border-radius: 50%;
top: 70px;
}
.ghost-body::before {
left: -15px;
}
.ghost-body::after {
right: -15px;
}
.ghost-bottom {
position: absolute;
width: 120px;
height: 30px;
top: 120px;
display: flex;
justify-content: space-between;
}
.ghost-bottom::before,
.ghost-bottom::after,
.ghost-bottom div {
content: '';
width: 20px;
height: 30px;
background: rgba(255, 255, 255, 0.9);
border-radius: 0 0 20px 20px;
animation: wave 2s ease-in-out infinite;
}
.ghost-bottom div:nth-child(1) {
animation-delay: 0.1s;
}
.ghost-bottom div:nth-child(2) {
animation-delay: 0.2s;
}
.ghost-bottom div:nth-child(3) {
animation-delay: 0.3s;
}
.ghost-face {
position: absolute;
width: 100%;
top: 40px;
display: flex;
justify-content: center;
gap: 15px;
}
.ghost-eye {
width: 15px;
height: 15px;
background: #333;
border-radius: 50%;
animation: blink 4s ease-in-out infinite;
}
.ghost-mouth {
position: absolute;
width: 30px;
height: 15px;
border-bottom: 3px solid #333;
border-radius: 0 0 50% 50%;
top: 70px;
left: 45px;
animation: mouth 5s ease-in-out infinite;
}
@keyframes float {
0%, 100% {
transform: translateY(0);
}
50% {
transform: translateY(-30px);
}
}
@keyframes wave {
0%, 100% {
height: 30px;
transform: translateY(0);
}
50% {
height: 20px;
transform: translateY(10px);
}
}
@keyframes blink {
0%, 48%, 52%, 100% {
height: 15px;
}
50% {
height: 5px;
}
}
@keyframes mouth {
0%, 50%, 100% {
width: 30px;
left: 45px;
}
25%, 75% {
width: 20px;
left: 50px;
}
}
/* 幽灵发光效果 */
.ghost-glow {
position: absolute;
width: 180px;
height: 180px;
background: radial-gradient(circle, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0) 70%);
top: -30px;
left: -30px;
border-radius: 50%;
animation: pulse 3s ease-in-out infinite;
z-index: -1;
}
@keyframes pulse {
0%, 100% {
transform: scale(1);
opacity: 0.7;
}
50% {
transform: scale(1.1);
opacity: 0.4;
}
}
/* 插入的链接样式 */
.custom-link {
position: fixed;
bottom: 20px;
right: 20px;
color: rgba(255,255,255,0.7);
text-decoration: none;
font-size: 14px;
background: rgba(0,0,0,0.3);
padding: 8px 15px;
border-radius: 20px;
z-index: 10;
transition: all 0.3s ease;
}
.custom-link:hover {
color: white;
background: rgba(0,0,0,0.5);
}
</style>
</head>
<body>
<div class="ghost">
<div class="ghost-glow"></div>
<div class="ghost-body"></div>
<div class="ghost-bottom">
<div></div>
<div></div>
<div></div>
</div>
<div class="ghost-face">
<div class="ghost-eye"></div>
<div class="ghost-eye"></div>
</div>
<div class="ghost-mouth"></div>
</div>
</body>
</html>
18

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



