-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
97 lines (96 loc) · 3 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Orillusion Shader Samples</title>
<style>
html,
body {
font-family: Avenir,Helvetica,Arial,sans-serif;
-webkit-font-smoothing: antialiased;
margin: 0;
width: 100%;
height: 100%;
display: flex;
}
.menu{
width: 200px;
height: 100%;
border-right: 1px solid #888;
overflow: auto;
padding: 0 10px;
}
.menu > a{
display: block;
margin: 5px 0;
color: #045b88;
text-decoration: none;
cursor: pointer;
}
a:hover{
text-decoration: underline;
}
a.active{
color: red;
}
iframe{
flex-grow: 1;
border: none;
}
.src{
position: fixed;
right: 10px;
bottom: 10px;
height: 40px;
width: 40px;
background: #fff;
text-align: center;
font-size: 16px;
line-height: 40px;
border-radius: 50%;
border:none;
opacity: 0.6;
cursor: pointer;
text-decoration: none !important;
}
.src:hover{
opacity: 1;
}
</style>
</head>
<body>
<div class="menu">
<h3>Orillusion Shader</h3>
<a href="https://github.com/OriIIusion/ORI_Shader" target="_blank">Github</a>
<hr>
<a class="sample active" target="MyUnLit">MyUnLit</a>
<a class="sample" target="ModelNormal">ModelNormal</a>
<a class="sample" target="ScreenCoord">ScreenCoord</a>
<a class="sample" target="MouseAndTime">MouseAndTime</a>
<a class="sample" target="MyLambert">MyLambert</a>
<a class="sample" target="test">test</a>
<a class="sample" target="CityPulse">CityPulse</a>
</div>
<iframe></iframe>
<a class="src" target="_blank">< ></a>
<script>
const iframe = document.querySelector('iframe')
const button = document.querySelector('.src')
const samples = document.querySelectorAll('.sample')
for(let sample of samples){
sample.addEventListener('click', ()=>{
window.location.hash = sample.target
iframe.src = './samples/' + sample.target + '.html'
button.href = 'https://github.com/OriIIusion/ORI_Shader/tree/main/src/scripts/' + sample.target + '.ts'
document.querySelector('.active').classList.remove('active')
sample.classList.add('active')
})
}
if(window.location.hash)
document.querySelector(`[target=${window.location.hash.slice(1)}]`).click()
else
document.querySelector('.sample.active').click()
</script>
</body>
</html>