<!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>
298

被折叠的 条评论
为什么被折叠?



