-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
43 lines (42 loc) · 1.59 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
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image" href="/texture/logo_white.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Orillusion学习</title>
<link rel="stylesheet" href="index.css">
</head>
<body>
<div class="menu">
<a class="sample active" target="01-rotatebox">Rotate Box</a>
<a class="sample" target="02-dat.gui">Dat.gui</a>
<a class="sample" target="03-moveableLight">MoveableLight</a>
<a class="sample" target="04-shootBox">ShootBox</a>
<a class="sample" target="05-shootBox2">ShootBox2</a>
<a class="sample" target="06-eatBox">EatBox</a>
<a class="sample" target="07-cameraAndController">CameraAndController</a>
<a class="sample" target="08-uiAndInteraction">UIAndInteraction</a>
<a class="sample" target="09-geojson">GeoJson</a>
</div>
<iframe></iframe>
<script>
const iframe = document.querySelector('iframe');
const buttons = document.querySelectorAll('.sample');
buttons.forEach(button => {
button.addEventListener('click', () => {
location.hash = button.target;
iframe.src = './samples/'+button.target+'.html'
document.querySelector('.active')?.classList.remove('active');
button.classList.add('active');
});
});
if(window.location.hash){
document.querySelector(`[target='${window.location.hash.slice(1)}']`).click()
}
else{
document.querySelector('.active').click();
}
</script>
</body>
</html>