跳动的幽灵动画特效

<!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>

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值