-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
102 lines (80 loc) · 2.43 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
<!DOCTYPE html>
<html>
<head>
<style>
html, body {
width: 100%;
height: 100%;
margin: 0px;
padding: 0px;
}
#overscroll canvas {
background-color: black;
vertical-align: bottom;
}
</style>
</head>
<body>
<div id="overscroll"></div>
<script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
<script src="js/three.js"></script>
<script src="js/OrbitControls.js"></script>
<script src="js/stats.min.js"></script>
<script src="js/tween.min.js"></script>
<script src="js/overscroll.js"></script>
<script>
var overscroller;
window.requestAnimFrame = function() {
return window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
function( callback ) {
window.setTimeout( callback, 1000 / 60 );
};
}();
$(document).ready(function () {
var container = document.getElementById('overscroll');
overscroller = new Overscroll.UI.create({container: container,
height: window.innerHeight,
width: window.innerWidth,
widthSegments: 2,
heightSegments: 2,
image: 'images/example1.png',
enableStats: true}
);
$('body').keyup(function(e){
overscroller.keyUp(e);
});
$('body').on('mousemove', function(e) {
overscroller.mouseMove(e);
});
$( window ).resize(function(e) {
overscroller.scene.setSize({width: window.innerWidth, height: window.innerHeight});
});
$( window ).resize(function(e) {
overscroller.scene.setSize({width: window.innerWidth, height: window.innerHeight});
});
$(window).bind('orientationchange', function(e) {
overscroller.scene.setSize({width: window.innerWidth, height: window.innerHeight});
});
overscroller.start();
});
</script>
<script id="vertexShader" type="x-shader/x-vertex">
varying vec2 vUv;
void main() {
vUv = uv;
gl_Position = projectionMatrix *
modelViewMatrix *
vec4(position,1.0);
}
</script>
<script id="fragmentShader" type="x-shader/x-fragment">
uniform sampler2D texture1;
varying vec2 vUv;
void main() {
gl_FragColor = texture2D(texture1, vUv);
}
</script>
</body>
</html>