Files
u-desktop/docs/wallpaper-test.html
绝尘 196d59269d 初始提交
Win11 动态壁纸引擎:WebView2 + systray + 和风天气
- WebGL 极光背景动画
- 实时天气(24h/7d预报)
- 星座运势(托盘切换)
- 暂停/继续控制
- 单实例互斥锁防双开
- vendor systray 修复 ClickedCh 静默丢弃
2026-05-25 19:03:21 +08:00

97 lines
2.4 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<title>测试</title>
<style>
body { margin: 0; overflow: hidden; background: #000; }
#test {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
color: #fff;
font-family: sans-serif;
font-size: 24px;
text-align: center;
}
button {
background: #5865f2;
color: #fff;
border: none;
padding: 15px 30px;
font-size: 18px;
border-radius: 8px;
cursor: pointer;
margin: 10px;
}
#result {
margin-top: 20px;
padding: 15px;
background: rgba(76, 175, 80, 0.3);
border-radius: 8px;
font-size: 16px;
}
</style>
</head>
<body>
<div id="test">
<div>🧪 WebView2 测试页面</div>
<button id="btn1">测试按钮1</button>
<button id="btn2">测试按钮2</button>
<div id="result">等待点击...</div>
<div id="time"></div>
</div>
<script>
console.log('=== 页面已加载 ===');
document.addEventListener('DOMContentLoaded', function() {
console.log('DOM loaded');
// 方法1addEventListener推荐
const btn1 = document.getElementById('btn1');
btn1.addEventListener('click', function() {
console.log('按钮1被点击');
document.getElementById('result').innerHTML = '✅ 按钮1点击成功<br>时间: ' + new Date().toLocaleTimeString();
document.getElementById('result').style.background = 'rgba(76, 175, 80, 0.6)';
});
// 方法2addEventListener
const btn2 = document.getElementById('btn2');
btn2.addEventListener('click', function() {
console.log('按钮2被点击');
document.getElementById('result').innerHTML = '✅ 按钮2点击成功<br>时间: ' + new Date().toLocaleTimeString();
document.getElementById('result').style.background = 'rgba(33, 150, 243, 0.6)';
});
// 全局点击测试
document.addEventListener('click', function(e) {
console.log('全局点击事件:', e.target.tagName, e.target.id);
});
console.log('事件监听器已设置');
});
// 更新时间
setInterval(() => {
const timeEl = document.getElementById('time');
if (timeEl) {
timeEl.textContent = '时间: ' + new Date().toLocaleTimeString();
}
}, 1000);
// 鼠标移动测试
let moveCount = 0;
document.addEventListener('mousemove', function() {
moveCount++;
if (moveCount % 60 === 0) {
console.log('鼠标移动计数:', moveCount);
}
});
console.log('=== 初始化完成 ===');
</script>
</body>
</html>