万圣节动画场景特效

<!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;
            height: 100vh;
            overflow: hidden;
            background: linear-gradient(to bottom, #1a0033, #000);
            font-family: Arial, sans-serif;
            display: flex;
            justify-content: center;
            align-items: center;
        }

        /* 月亮 */
        .moon {
            position: absolute;
            width: 100px;
            height: 100px;
            background: #f5f5dc;
            border-radius: 50%;
            top: 50px;
            right: 100px;
            box-shadow: 0 0 40px #f5f5dc;
            animation: pulse 4s infinite alternate;
        }

        /* 幽灵 */
        .ghost {
            position: absolute;
            width: 120px;
            height: 150px;
            left: 30%;
            bottom: 100px;
            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 div {
            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;
        }

        /* 南瓜灯 */
        .pumpkin {
            position: absolute;
            width: 100px;
            height: 120px;
            right: 30%;
            bottom: 80px;
            animation: float 4s ease-in-out infinite 1s;
        }

        .pumpkin-body {
            position: absolute;
            width: 100px;
            height: 120px;
            background: #ff8c00;
            border-radius: 50% 50% 40% 40%;
            box-shadow: 0 0 10px #ff8c00;
        }

        .pumpkin-ridge {
            position: absolute;
            width: 10px;
            height: 120px;
            background: #e67300;
            left: 45px;
            border-radius: 5px;
        }

        .pumpkin-ridge::before,
        .pumpkin-ridge::after {
            content: '';
            position: absolute;
            width: 10px;
            height: 120px;
            background: #e67300;
            border-radius: 5px;
        }

        .pumpkin-ridge::before {
            transform: rotate(30deg);
            transform-origin: left top;
        }

        .pumpkin-ridge::after {
            transform: rotate(-30deg);
            transform-origin: right top;
        }

        .pumpkin-face {
            position: absolute;
            width: 60px;
            height: 40px;
            background: #1a0033;
            top: 40px;
            left: 20px;
            border-radius: 50% 50% 0 0;
            clip-path: polygon(
                0% 100%, 20% 60%, 40% 100%, 
                60% 60%, 80% 100%, 100% 60%,
                100% 100%
            );
        }

        .pumpkin-face::before,
        .pumpkin-face::after {
            content: '';
            position: absolute;
            width: 15px;
            height: 15px;
            background: #1a0033;
            border-radius: 50%;
            top: 10px;
        }

        .pumpkin-face::before {
            left: 5px;
            clip-path: polygon(
                0% 100%, 50% 0%, 100% 100%
            );
        }

        .pumpkin-face::after {
            right: 5px;
            clip-path: polygon(
                0% 100%, 50% 0%, 100% 100%
            );
        }

        /* 蝙蝠 */
        .bat {
            position: absolute;
            width: 40px;
            height: 20px;
            background: #333;
            border-radius: 50%;
            animation: fly 10s linear infinite;
        }

        .bat::before, 
        .bat::after {
            content: '';
            position: absolute;
            width: 30px;
            height: 50px;
            background: #333;
            border-radius: 50% 50% 0 0;
            top: -15px;
        }

        .bat::before {
            left: -25px;
            transform: rotate(-30deg);
        }

        .bat::after {
            right: -25px;
            transform: rotate(30deg);
        }

        .bat:nth-child(1) {
            top: 50px;
            left: -50px;
            animation-delay: 0s;
        }

        .bat:nth-child(2) {
            top: 100px;
            left: -50px;
            animation-delay: 2s;
        }

        .bat:nth-child(3) {
            top: 150px;
            left: -50px;
            animation-delay: 4s;
        }

        .bat:nth-child(4) {
            top: 200px;
            left: -50px;
            animation-delay: 6s;
        }

        .bat:nth-child(5) {
            top: 250px;
            left: -50px;
            animation-delay: 8s;
        }

        /* 动画关键帧 */
        @keyframes float {
            0%, 100% {
                transform: translateY(0);
            }
            50% {
                transform: translateY(-20px);
            }
        }

        @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 pulse {
            0%, 100% {
                box-shadow: 0 0 40px #f5f5dc;
            }
            50% {
                box-shadow: 0 0 60px #f5f5dc;
            }
        }

        @keyframes fly {
            0% {
                transform: translateX(-100px);
            }
            100% {
                transform: translateX(calc(100vw + 100px));
            }
        }

        /* 插入的链接样式 */
        .custom-link {
            position: fixed;
            bottom: 20px;
            right: 20px;
            color: rgba(255, 200, 50, 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: rgba(255, 200, 50, 1);
            background: rgba(0, 0, 0, 0.5);
        }
    </style>
</head>
<body>
    <div class="moon"></div>
    
    <div class="ghost">
        <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>
    
    <div class="pumpkin">
        <div class="pumpkin-body"></div>
        <div class="pumpkin-ridge"></div>
        <div class="pumpkin-face"></div>
    </div>
    
    <div class="bat"></div>
    <div class="bat"></div>
    <div class="bat"></div>
    <div class="bat"></div>
    <div class="bat"></div>
    
</body>
</html>

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值