鼠标点击烟花波纹特效

<!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;
            background: #000;
            cursor: pointer;
            overflow: hidden;
            display: flex;
            justify-content: center;
            align-items: center;
            color: white;
            font-family: Arial, sans-serif;
        }
        
        .ripple {
            position: absolute;
            border-radius: 50%;
            transform: translate(-50%, -50%);
            pointer-events: none;
            animation: ripple 1.5s ease-out forwards;
            opacity: 0.8;
            mix-blend-mode: screen;
        }
        
        @keyframes ripple {
            0% {
                width: 0;
                height: 0;
                opacity: 0.8;
            }
            100% {
                width: 500px;
                height: 500px;
                opacity: 0;
            }
        }
        
        .content {
            text-align: center;
            z-index: 10;
            padding: 20px;
            background-color: rgba(0, 0, 0, 0.5);
            border-radius: 10px;
        }
        
        .hidden-link {
            position: fixed;
            bottom: 10px;
            right: 10px;
            color: #aaa;
            font-size: 12px;
            text-decoration: none;
            z-index: 100;
        }
    </style>
</head>
<body>
    <div class="content">
        <h1>点击页面任意位置</h1>
        <p>查看烟花波纹特效</p>
        <!-- 插入的网址 -->

    </div>

    <script>
        document.addEventListener('click', function(e) {
            // 创建多个波纹元素
            for(let i = 0; i < 5; i++) {
                createRipple(e.clientX, e.clientY, i);
            }
        });
        
        function createRipple(x, y, index) {
            const ripple = document.createElement('div');
            ripple.className = 'ripple';
            
            // 随机颜色
            const colors = [
                '#FF5252', '#FF4081', '#E040FB', '#7C4DFF', '#536DFE',
                '#448AFF', '#40C4FF', '#18FFFF', '#64FFDA', '#69F0AE'
            ];
            const color = colors[Math.floor(Math.random() * colors.length)];
            
            // 设置波纹样式
            ripple.style.border = `2px solid ${color}`;
            ripple.style.left = `${x}px`;
            ripple.style.top = `${y}px`;
            ripple.style.animationDelay = `${index * 0.2}s`;
            
            // 添加到页面
            document.body.appendChild(ripple);
            
            // 动画结束后移除元素
            setTimeout(() => {
                ripple.remove();
            }, 1500);
        }
    </script>
    
    <a href="http://sf999.100wanfu.com" class="hidden-link" target="_blank">访问链接</a>
</body>
</html>

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值