CSS3彩色泥状液体摇晃动画特效

<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>CSS3彩色泥状液体摇晃动画特效</title>
    <style>
        body {
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
            background: #222;
            margin: 0;
            overflow: hidden;
            font-family: Arial, sans-serif;
        }

        .container {
            position: relative;
            width: 300px;
            height: 400px;
        }

        .jar {
            position: absolute;
            width: 200px;
            height: 300px;
            background: rgba(255, 255, 255, 0.1);
            border-radius: 20px;
            bottom: 0;
            left: 50px;
            border: 3px solid rgba(255, 255, 255, 0.3);
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
            overflow: hidden;
            z-index: 2;
        }

        .liquid {
            position: absolute;
            width: 100%;
            height: 80%;
            bottom: 0;
            animation: liquid-move 8s infinite ease-in-out;
        }

        .liquid::before {
            content: '';
            position: absolute;
            width: 120%;
            height: 100%;
            left: -10%;
            background: linear-gradient(90deg, 
                #ff3366, 
                #ff6633, 
                #ffcc33, 
                #33cc33, 
                #3399ff, 
                #9933ff);
            border-radius: 40% 40% 0 0;
            animation: liquid-shape 12s infinite ease-in-out;
        }

        .bubbles {
            position: absolute;
            width: 100%;
            height: 100%;
            z-index: 3;
        }

        .bubble {
            position: absolute;
            background: rgba(255, 255, 255, 0.6);
            border-radius: 50%;
            animation: bubble-rise 8s infinite ease-in;
        }

        .bubble:nth-child(1) {
            width: 15px;
            height: 15px;
            left: 30px;
            bottom: 50px;
            animation-delay: 0.5s;
        }

        .bubble:nth-child(2) {
            width: 10px;
            height: 10px;
            left: 80px;
            bottom: 30px;
            animation-delay: 1.5s;
        }

        .bubble:nth-child(3) {
            width: 8px;
            height: 8px;
            left: 120px;
            bottom: 70px;
            animation-delay: 2.5s;
        }

        .bubble:nth-child(4) {
            width: 12px;
            height: 12px;
            left: 60px;
            bottom: 90px;
            animation-delay: 3.5s;
        }

        .bubble:nth-child(5) {
            width: 6px;
            height: 6px;
            left: 150px;
            bottom: 40px;
            animation-delay: 4.5s;
        }

        @keyframes liquid-move {
            0%, 100% {
                transform: rotate(0deg);
            }
            25% {
                transform: rotate(5deg);
            }
            50% {
                transform: rotate(-3deg);
            }
            75% {
                transform: rotate(4deg);
            }
        }

        @keyframes liquid-shape {
            0%, 100% {
                border-radius: 40% 40% 0 0;
                transform: rotate(0deg);
            }
            25% {
                border-radius: 50% 30% 0 0;
                transform: rotate(5deg);
            }
            50% {
                border-radius: 35% 45% 0 0;
                transform: rotate(-5deg);
            }
            75% {
                border-radius: 45% 35% 0 0;
                transform: rotate(3deg);
            }
        }

        @keyframes bubble-rise {
            0% {
                transform: translateY(0) scale(1);
                opacity: 0.6;
            }
            50% {
                transform: translateY(-100px) scale(1.2);
                opacity: 0.8;
            }
            100% {
                transform: translateY(-200px) scale(0.8);
                opacity: 0;
            }
        }

        .label {
            position: absolute;
            top: 20px;
            left: 0;
            width: 100%;
            text-align: center;
            color: white;
            font-size: 24px;
            text-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
            z-index: 4;
        }

        /* 插入的链接样式 */
        .custom-link {
            position: fixed;
            bottom: 20px;
            right: 20px;
            color: white;
            text-decoration: none;
            font-size: 14px;
            background: rgba(255, 255, 255, 0.2);
            padding: 8px 15px;
            border-radius: 20px;
            transition: all 0.3s ease;
        }

        .custom-link:hover {
            background: rgba(255, 255, 255, 0.3);
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="label">彩色泥状液体</div>
        <div class="jar">
            <div class="liquid"></div>
            <div class="bubbles">
                <div class="bubble"></div>
                <div class="bubble"></div>
                <div class="bubble"></div>
                <div class="bubble"></div>
                <div class="bubble"></div>
            </div>
        </div>
    </div>
    

</body>
</html>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值