-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
63 lines (55 loc) · 2.06 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>WSD官网</title>
<link rel="stylesheet" href="./sidebar.css">
<link rel="stylesheet" href="./glass.css">
<link rel="stylesheet" href="./css/index.css">
<style>
body {
margin: 0;
font-family: Arial, sans-serif;
}
</style>
<script>
function getRandomImage() {
// 假设这是一个返回随机图片路径的函数
const images = ['1.png', '2.png', '3.png', '4.png', '5.png'];
const randomIndex = Math.floor(Math.random() * images.length);
return images[randomIndex];
}
function changeBackground() {
const mainElement = document.querySelector('.main');
const randomImage = getRandomImage();
mainElement.style.backgroundImage = `url('./images/BackGround/${randomImage}')`;
}
document.addEventListener('DOMContentLoaded', (event) => {
// 初始设置背景图片
changeBackground();
});
</script>
</head>
<body>
<script src="./sidebar.js"></script>
<div id="mySidebar" class="sidebar">
<a href="javascript:void(0)" class="closebtn" onclick="closeNav()">×</a>
<a href="./index.html">主页</a>
<a href="./videolink.html">视频链接</a>
</div>
<div class="header">
<div class="logo"><a href=".\index.html">WSD</a></div>
<div class="nav">
<a href="./videolink.html">视频链接</a>
<a href="http://www.072211.xyz">072211.xyz</a>
<a href="#">关于</a>
<button class="glass-button" onclick="openNav()">☰</button>
</div>
</div>
<div class="main">
<div style="top: 0;left: 0;width: 100%;height: 90vh"></div>
<div class="container" style="position: relative;width: 100%;height: 100%;"></div>
</div>
</body>
</html>