-
Notifications
You must be signed in to change notification settings - Fork 53
/
index.html
165 lines (142 loc) · 4.21 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"/>
<title>A trip under the moonlight</title>
<style type="text/css">
body {
margin: 0px;
overflow: hidden;
}
#env-selector {
position: absolute;
left: 5px;
top: 10px;
z-index: 1;
}
#env-selector, #env-selector ul {
padding: 0px;
margin: 0px;
}
#env-selector ul li {
display: inline;
padding: 0px;
margin:0px;
}
#env-selector ul li a {
display: inline;
text-decoration: none;
background-color: #000;
color: #fff;
opacity: 0.6;
padding: 5px;
font-family: Arial;
font-size: medium;
cursor: pointer;
margin-right: 5px;
transition: all 1s;
}
#env-selector ul li a:hover {
background-color: #fff;
color: #000;
}
#env-selector ul li.selected a {
background-color: #3333cc;
color: #fff;
}
</style>
<link href="js/libs/messg.css" rel="stylesheet">
</head>
<body>
<div id="env-selector">
<ul>
<li key="night">Night</li>
<li key="morning">Morning</li>
<li key="day">Day</li>
<li key="cloudy">Cloudy</li>
<li key="sunset">Sunset</li>
<li key="interstellar">Interstellar</li>
<li key="apocalypse">Apocalypse</li>
</ul>
</div>
<script src="js/libs/three.min.js"></script>
<script src="js/libs/dat.gui.min.js"></script>
<script src="js/libs/jquery-2.1.4.min.js"></script>
<script src="js/libs/messg.min.js"></script>
<script src="js/controls/OrbitControls.js"></script>
<script src="js/shaders/ScreenSpaceShader.js"></script>
<script src="js/shaders/FFTOceanShader.js"></script>
<script src="js/shaders/OceanShader.js"></script>
<script src="js/effects/MirrorRenderer.js"></script>
<script src="js/shaders/CloudShader2.js"></script>
<script src="js/shaders/RainShader.js"></script>
<script src="js/loaders/OBJMTLLoader.js"></script>
<script src="js/loaders/MTLLoader.js"></script>
<script src="js/effects/Ocean.js"></script>
<script src="js/demo.js"></script>
<script>
var lastTime = ( new Date() ).getTime();
var WINDOW = {
ms_Width : 0,
ms_Height : 0,
ms_Callbacks : {
70: "WINDOW.ToggleFullScreen()", // Toggle fullscreen
},
Initialize : function () {
this.UpdateSize();
// Create callbacks from keyboard
document.onkeydown = function ( inEvent ) { WINDOW.CallAction( inEvent.keyCode ); };
window.onresize = function ( inEvent ) {
WINDOW.UpdateSize();
WINDOW.ResizeCallback( WINDOW.ms_Width, WINDOW.ms_Height );
};
},
UpdateSize : function () {
this.ms_Width = window.innerWidth ;
this.ms_Height = window.innerHeight;
},
CallAction : function ( inId ) {
if ( inId in this.ms_Callbacks ) {
eval( this.ms_Callbacks[inId] );
return false;
}
},
ToggleFullScreen : function () {
if ( !document.fullscreenElement && !document.mozFullScreenElement && !document.webkitFullscreenElement ) {
if ( document.documentElement.requestFullscreen ) {
document.documentElement.requestFullscreen();
}
else if ( document.documentElement.mozRequestFullScreen ) {
document.documentElement.mozRequestFullScreen();
}
else if (document.documentElement.webkitRequestFullscreen) {
document.documentElement.webkitRequestFullscreen( Element.ALLOW_KEYBOARD_INPUT );
}
}
else {
if ( document.cancelFullScreen ) {
document.cancelFullScreen();
}
else if ( document.mozCancelFullScreen ) {
document.mozCancelFullScreen();
}
else if ( document.webkitCancelFullScreen ) {
document.webkitCancelFullScreen();
}
}
},
ResizeCallback : function ( inWidth, inHeight ) { },
};
WINDOW.Initialize();
DEMO.Initialize();
WINDOW.ResizeCallback = function ( inWidth, inHeight ) { DEMO.Resize( inWidth, inHeight ); };
DEMO.Resize( WINDOW.ms_Width, WINDOW.ms_Height );
var render = function () {
requestAnimationFrame( render );
DEMO.Update();
};
render();
</script>
</body>
</html>