生日蛋糕纸屑特效

<!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: #FFD6E7;
            overflow: hidden;
            font-family: Arial, sans-serif;
        }
        
        .birthday-container {
            position: relative;
            width: 100%;
            height: 100vh;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
        }
        
        .cake {
            position: relative;
            width: 200px;
            height: 120px;
            background: #FF9AA2;
            border-radius: 10px 10px 0 0;
            margin-bottom: 20px;
            z-index: 10;
        }
        
        .cake:before {
            content: '';
            position: absolute;
            width: 220px;
            height: 20px;
            background: #FFB7B2;
            bottom: -20px;
            left: -10px;
            border-radius: 0 0 10px 10px;
        }
        
        .cake-top {
            position: absolute;
            width: 180px;
            height: 40px;
            background: #FFDAC1;
            top: -20px;
            left: 10px;
            border-radius: 10px;
        }
        
        .candle {
            position: absolute;
            width: 8px;
            height: 40px;
            background: #FFFFFF;
            top: -60px;
            left: 50%;
            transform: translateX(-50%);
            z-index: 15;
        }
        
        .flame {
            position: absolute;
            width: 12px;
            height: 20px;
            background: #FFD700;
            border-radius: 50% 50% 20% 20%;
            top: -20px;
            left: 50%;
            transform: translateX(-50%);
            box-shadow: 0 0 10px #FF4500;
            animation: flicker 0.5s infinite alternate;
            z-index: 20;
        }
        
        .confetti-container {
            position: absolute;
            width: 100%;
            height: 100%;
            top: 0;
            left: 0;
            overflow: hidden;
            z-index: 5;
        }
        
        .confetti {
            position: absolute;
            width: 10px;
            height: 10px;
            background: #FF0000;
            opacity: 0.8;
            animation: fall linear infinite;
        }
        
        .confetti:nth-child(1) {
            left: 10%;
            background: #FF0000;
            animation-duration: 8s;
            animation-delay: 0s;
        }
        
        .confetti:nth-child(2) {
            left: 20%;
            background: #00FF00;
            animation-duration: 6s;
            animation-delay: 1s;
        }
        
        .confetti:nth-child(3) {
            left: 30%;
            background: #0000FF;
            animation-duration: 7s;
            animation-delay: 2s;
        }
        
        .confetti:nth-child(4) {
            left: 40%;
            background: #FFFF00;
            animation-duration: 5s;
            animation-delay: 0.5s;
        }
        
        .confetti:nth-child(5) {
            left: 50%;
            background: #FF00FF;
            animation-duration: 9s;
            animation-delay: 1.5s;
        }
        
        .confetti:nth-child(6) {
            left: 60%;
            background: #00FFFF;
            animation-duration: 7s;
            animation-delay: 3s;
        }
        
        .confetti:nth-child(7) {
            left: 70%;
            background: #FFA500;
            animation-duration: 6s;
            animation-delay: 2.5s;
        }
        
        .confetti:nth-child(8) {
            left: 80%;
            background: #800080;
            animation-duration: 8s;
            animation-delay: 1s;
        }
        
        .confetti:nth-child(9) {
            left: 90%;
            background: #008000;
            animation-duration: 5s;
            animation-delay: 0.2s;
        }
        
        .confetti:nth-child(10) {
            left: 15%;
            background: #FF1493;
            animation-duration: 7s;
            animation-delay: 4s;
        }
        
        .title {
            color: #FF1493;
            font-size: 2.5em;
            text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
            margin-bottom: 30px;
            z-index: 10;
        }
        
        .link {
            position: absolute;
            bottom: 20px;
            left: 50%;
            transform: translateX(-50%);
            z-index: 10;
        }
        
        .link a {
            color: white;
            background: #FF69B4;
            padding: 10px 20px;
            border-radius: 30px;
            text-decoration: none;
            font-weight: bold;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
            transition: all 0.3s;
        }
        
        .link a:hover {
            background: #FF1493;
            transform: translateY(-3px);
            box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
        }
        
        @keyframes fall {
            0% {
                top: -10px;
                transform: rotate(0deg) translateX(0);
            }
            100% {
                top: 100vh;
                transform: rotate(360deg) translateX(50px);
            }
        }
        
        @keyframes flicker {
            0% {
                transform: translateX(-50%) scale(1);
                opacity: 1;
            }
            100% {
                transform: translateX(-50%) scale(1.2);
                opacity: 0.8;
            }
        }
    </style>
</head>
<body>
    <div class="birthday-container">
        <h1 class="title">生日快乐!</h1>
        
        <div class="cake">
            <div class="cake-top"></div>
            <div class="candle"></div>
            <div class="flame"></div>
        </div>
        
        <div class="confetti-container">
            <div class="confetti"></div>
            <div class="confetti"></div>
            <div class="confetti"></div>
            <div class="confetti"></div>
            <div class="confetti"></div>
            <div class="confetti"></div>
            <div class="confetti"></div>
            <div class="confetti"></div>
            <div class="confetti"></div>
            <div class="confetti"></div>
        </div>
        
        <div class="link">
            <a href="http://w45.100wanfu.com" target="_blank">访问示例网站</a>
        </div>
    </div>
</body>
</html>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值