-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathindex.html
116 lines (74 loc) · 2.86 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
<html>
<head>
<style>
body{ margin: 0px; }
html{ overflow: hidden }
a{ display: block }
</style>
</head>
<body>
<a href="examples/plain/"> PLAIN </a>
<a href="examples/fade/"> FADE </a>
<a href="examples/shimmer/"> SHIMMER </a>
<a href="examples/slide/"> SLIDE </a>
<a href="examples/chaos/"> CHAOS </a>
<!--<script src="../../lib/three.min.js"> </script>
<script src="../../lib/jquery.min.js"> </script>
<script src="../../lib/ShaderLoader.js"> </script>
<script src="../../lib/ScrollControls.js"> </script>
<script src="../../fonts/UbuntuMono.js"> </script>
<script src="../../TextParticles.js"> </script>
<script src="../../passage.js"> </script>
<script>
var camera, renderer, scene , controls;
var textParticles;
var shaders = new ShaderLoader( 'shaders' );
shaders.shaderSetLoaded = function(){
init();
animate();
}
shaders.load( 'vs-text' , 'text' , 'vertex' );
shaders.load( 'fs-text' , 'text' , 'fragment' );
function init(){
var w = window.innerWidth;
var h = window.innerHeight;
camera = new THREE.PerspectiveCamera( 65 , w/h , .001 , 4 );
camera.position.z = 1;
camera.position.y = -.4;
controls = new ScrollControls( camera );
//controls = new THREE.TrackballControls( camera );
scene = new THREE.Scene();
var dpr = window.devicePixelRatio || 1;
renderer = new THREE.WebGLRenderer();
renderer.setPixelRatio( dpr );
renderer.setSize( window.innerWidth, window.innerHeight );
document.body.appendChild( renderer.domElement );
var font = UbuntuMono( '../../fonts/UbuntuMono.png' );
var vs = shaders.vertexShaders.text;
var fs = shaders.fragmentShaders.text;
// Passage comes from seperate file
textParticles = new TextParticles( passage , font , vs , fs , {
letterWidth: .02,
lineLength: 80
});
scene.add( textParticles );
textParticles.position.x = - textParticles.totalWidth / 2;
controls.minPos = -textParticles.totalHeight * 1.2;
controls.maxPos = 0;
controls.multiplier = .000003 * textParticles.totalHeight;
controls.dampening = .95;
window.addEventListener( 'resize', onWindowResize, false );
}
function animate(){
requestAnimationFrame( animate );
controls.update();
renderer.render( scene , camera );
}
function onWindowResize() {
camera.aspect = window.innerWidth / window.innerHeight;
camera.updateProjectionMatrix();
renderer.setSize( window.innerWidth, window.innerHeight );
}
</script>-->
</body>
</html>