<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>无害病毒模拟</title>
<style>
body {
margin: 0;
padding: 0;
background-color: black;
color: lime;
font-family: 'Courier New', monospace;
overflow: hidden;
}
#virus-screen {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1000;
}
#message {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
text-align: center;
font-size: 24px;
}
.matrix-char {
position: absolute;
color: lime;
font-size: 16px;
opacity: 0;
animation: fall linear infinite;
}
@keyframes fall {
to {
top: 100%;
opacity: 1;
}
}
#countdown {
font-size: 48px;
margin: 20px 0;
}
#warning {
color: red;
font-weight: bold;
animation: blink 0.5s infinite alternate;
}
@keyframes blink {
from { opacity: 0.2; }
to { opacity: 1; }
}
#final-message {
display: none;
margin-top: 30px;
}
button {
background: lime;
color: black;
border: none;
padding: 10px 20px;
font-size: 18px;
cursor: pointer;
margin-top: 20px;
}
</style>
</head>
<body>
<div id="virus-screen">
<div id="message">
<div id="warning">警告!检测到病毒入侵!</div>
<div id="countdown">5</div>
<div>您的系统正在被攻击...</div>
<div id="final-message">
哈哈,这只是个玩笑!<br>
这个页面完全无害,不会对您的设备造成任何影响。<br>
<button onclick="closeVirus()">关闭这个玩笑</button>
</div>
</div>
</div>
<script>
// 创建矩阵雨效果
function createMatrixRain() {
const chars = "01アイウエオABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
const screenWidth = window.innerWidth;
const screenHeight = window.innerHeight;
for (let i = 0; i < 100; i++) {
setTimeout(() => {
const char = document.createElement('div');
char.className = 'matrix-char';
char.textContent = chars.charAt(Math.floor(Math.random() * chars.length));
char.style.left = Math.random() * screenWidth + 'px';
char.style.top = -20 + 'px';
char.style.animationDuration = (Math.random() * 3 + 2) + 's';
document.getElementById('virus-screen').appendChild(char);
// 移除DOM元素以避免内存泄漏
setTimeout(() => {
char.remove();
}, 5000);
}, Math.random() * 3000);
}
}
// 倒计时效果
function startCountdown() {
let count = 5;
const countdownElement = document.getElementById('countdown');
const timer = setInterval(() => {
count--;
countdownElement.textContent = count;
if (count <= 0) {
clearInterval(timer);
document.getElementById('final-message').style.display = 'block';
document.getElementById('warning').textContent = "只是个玩笑!";
document.getElementById('warning').style.animation = 'none';
document.getElementById('warning').style.color = 'lime';
}
}, 1000);
}
// 关闭病毒效果
function closeVirus() {
document.getElementById('virus-screen').style.display = 'none';
}
// 初始化
window.onload = function() {
createMatrixRain();
startCountdown();
// 持续创建矩阵雨效果
setInterval(createMatrixRain, 2000);
};
</script>
</body>
</html>