动态页脚特效

<!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;
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            font-family: Arial, sans-serif;
        }
        
        .content {
            flex: 1;
            padding: 20px;
        }
        
        .dynamic-footer {
            background: linear-gradient(135deg, #2c3e50, #4ca1af);
            color: white;
            padding: 30px 0;
            text-align: center;
            position: relative;
            overflow: hidden;
        }
        
        .footer-content {
            position: relative;
            z-index: 2;
        }
        
        .footer-links {
            display: flex;
            justify-content: center;
            flex-wrap: wrap;
            gap: 20px;
            margin-bottom: 20px;
        }
        
        .footer-links a {
            color: white;
            text-decoration: none;
            transition: all 0.3s ease;
        }
        
        .footer-links a:hover {
            color: #f1c40f;
            transform: translateY(-3px);
        }
        
        .copyright {
            font-size: 14px;
            opacity: 0.8;
        }
        
        /* 动态背景元素 */
        .footer-bubbles {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: 1;
            overflow: hidden;
        }
        
        .bubble {
            position: absolute;
            bottom: -100px;
            background: rgba(255, 255, 255, 0.1);
            border-radius: 50%;
            animation: rise 15s infinite ease-in;
        }
        
        .bubble:nth-child(1) {
            width: 40px;
            height: 40px;
            left: 10%;
            animation-duration: 8s;
        }
        
        .bubble:nth-child(2) {
            width: 20px;
            height: 20px;
            left: 20%;
            animation-duration: 5s;
            animation-delay: 1s;
        }
        
        .bubble:nth-child(3) {
            width: 50px;
            height: 50px;
            left: 35%;
            animation-duration: 7s;
            animation-delay: 2s;
        }
        
        .bubble:nth-child(4) {
            width: 30px;
            height: 30px;
            left: 50%;
            animation-duration: 11s;
            animation-delay: 0s;
        }
        
        .bubble:nth-child(5) {
            width: 25px;
            height: 25px;
            left: 65%;
            animation-duration: 6s;
            animation-delay: 1s;
        }
        
        .bubble:nth-child(6) {
            width: 45px;
            height: 45px;
            left: 75%;
            animation-duration: 8s;
            animation-delay: 3s;
        }
        
        .bubble:nth-child(7) {
            width: 15px;
            height: 15px;
            left: 90%;
            animation-duration: 9s;
            animation-delay: 2s;
        }
        
        @keyframes rise {
            0% {
                bottom: -100px;
                transform: translateX(0);
            }
            50% {
                transform: translateX(100px);
            }
            100% {
                bottom: 100%;
                transform: translateX(-100px);
            }
        }
        
        /* 心跳动画 */
        .heartbeat {
            display: inline-block;
            animation: heartbeat 1.5s infinite;
        }
        
        @keyframes heartbeat {
            0% { transform: scale(1); }
            25% { transform: scale(1.1); }
            50% { transform: scale(1); }
            75% { transform: scale(1.1); }
            100% { transform: scale(1); }
        }
    </style>
</head>
<body>
    <div class="content">
        <h1>网页主要内容</h1>
        <p>这里是网页的主要内容区域。</p>
    </div>
    
    <footer class="dynamic-footer">
        <div class="footer-bubbles">
            <div class="bubble"></div>
            <div class="bubble"></div>
            <div class="bubble"></div>
            <div class="bubble"></div>
            <div class="bubble"></div>
            <div class="bubble"></div>
            <div class="bubble"></div>
        </div>
        
        <div class="footer-content">
            <div class="footer-links">
                <a href="#">首页</a>
                <a href="#">关于我们</a>
                <a href="#">服务</a>
                <a href="#">产品</a>
                <a href="#">联系我们</a>
            </div>
            
            <p class="copyright">
                © <span class="heartbeat">2023</span> 公司名称. 保留所有权利.
            </p>
        </div>
    </footer>
    
    <script>
        // 动态添加更多气泡
        document.addEventListener('DOMContentLoaded', function() {
            const bubblesContainer = document.querySelector('.footer-bubbles');
            
            for (let i = 0; i < 5; i++) {
                const bubble = document.createElement('div');
                bubble.classList.add('bubble');
                
                // 随机大小
                const size = Math.random() * 30 + 10;
                bubble.style.width = `${size}px`;
                bubble.style.height = `${size}px`;
                
                // 随机位置
                bubble.style.left = `${Math.random() * 100}%`;
                
                // 随机动画时间和延迟
                const duration = Math.random() * 10 + 5;
                const delay = Math.random() * 5;
                bubble.style.animationDuration = `${duration}s`;
                bubble.style.animationDelay = `${delay}s`;
                
                bubblesContainer.appendChild(bubble);
            }
            
            // 鼠标移动效果
            const footer = document.querySelector('.dynamic-footer');
            footer.addEventListener('mousemove', (e) => {
                const x = e.clientX / window.innerWidth;
                const y = e.clientY / window.innerHeight;
                
                footer.style.background = `linear-gradient(${x * 360}deg, #2c3e50, #4ca1af)`;
            });
        });
    </script>
</body>
</html>

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值