-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
54 lines (43 loc) · 1.48 KB
/
index.html
File metadata and controls
54 lines (43 loc) · 1.48 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>The Book Of Shaders Gallery</title>
<link href="css/style-add.css" rel="stylesheet" />
<link rel="icon" type="image/svg+xml" href="favicon.svg">
</head>
<body>
<div class="sidebar">
<div class="logo">
<img src="logo.svg" alt="Shader Gallery Logo" />
<div class="logo-text">hello shader</div>
</div>
<button onclick="loadPage('about.html', this)">About</button>
<button onclick="loadPage('group1.html', this)">1 - 6</button>
<button onclick="loadPage('group2.html', this)">7 - 14</button>
<button onclick="loadPage('group3.html', this)">15 - 23</button>
<button onclick="loadPage('group4.html', this)">24 - 31</button>
<div class="spacer"></div>
<a href="https://libregd.pages.dev/" target="_blank" class="github-link">
<img src="avatar.svg" alt="libregd avatar" class="avatar-icon" />
</a>
</div>
<div class="content">
<iframe id="shaderFrame" src="about.html"></iframe>
</div>
<script>
function loadPage(page, button) {
document.getElementById('shaderFrame').src = page;
// 清除所有按钮的激活状态
const buttons = document.querySelectorAll('.sidebar button');
buttons.forEach(btn => btn.classList.remove('active'));
// 设置当前按钮为激活状态
button.classList.add('active');
}
// 页面加载时默认激活第一个按钮
window.onload = function () {
document.querySelector('.sidebar button').classList.add('active');
};
</script>
</body>
</html>