-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
178 lines (160 loc) · 5.8 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
166
167
168
169
170
171
172
173
174
175
176
177
178
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>eliezersouzareis' github page</title>
<link rel="stylesheet" href="css/main.css" />
<link rel="icon" type="image/png" href="images/favicon.png" sizes="32x32" />
<meta name="referrer" content="origin" />
<meta name="theme-color" content="#383838" />
<meta name="title" content="eliezersouzareis' github page" />
<meta
name="description"
content="Hello there! My name is Eliezer and this is my github page!"
/>
<meta name="author" content="eliezersouzareis" />
<meta name="keywords" content="webdeveloper tinkerer freelancer" />
<meta name="og:site_name" content="eliezersouzareis' github page" />
<meta name="og:url" content="https://eliezersouzareis.github.io/" />
<meta name="og:title" content="eliezersouzareis' github page" />
<meta
name="og:image"
content="https://avatars2.githubusercontent.com/u/1019538?v=4&s=400"
/>
<meta
name="og:description"
content="Hello there! My name is Eliezer and this is my github page!"
/>
<meta name="twitter:site" content="@eliezersreis" />
<meta
name="twitter:description"
content="Hello there! My name is Eliezer and this is my github page!"
/>
<meta
name="twitter:image:src"
content="https://avatars2.githubusercontent.com/u/1019538?v=4&s=400"
/>
<script>
(function (i, s, o, g, r, a, m) {
i["GoogleAnalyticsObject"] = r;
(i[r] =
i[r] ||
function () {
(i[r].q = i[r].q || []).push(arguments);
}),
(i[r].l = 1 * new Date());
(a = s.createElement(o)), (m = s.getElementsByTagName(o)[0]);
a.async = 1;
a.src = g;
m.parentNode.insertBefore(a, m);
})(
window,
document,
"script",
"https://www.google-analytics.com/analytics.js",
"ga"
);
ga("create", "UA-16639699-5", "auto");
ga("send", "pageview");
</script>
</head>
<body>
<script
type="text/javascript"
src="https://cdnjs.cloudflare.com/ajax/libs/three.js/88/three.min.js"
></script>
<script type="text/javascript" src="js/Projector.js"></script>
<script type="text/javascript" src="js/CanvasRenderer.js"></script>
<script type="text/javascript">
// this is slightly modified three.js example, https://threejs.org/examples/#canvas_interactive_particles
// just a placeholder for actual content(if i ever had some to put in here)
// so credit goes to whomever did it;
// the author most probably is mrdoob http://mrdoob.com/
// since he authored CanvasRenderer.js, and this example is a nice
// proof of concept of its use
var container, camera, scene, renderer;
var TAU = Math.PI * 2;
var radius = 600;
var theta = 0;
var bubbleProgramStroke = function (context) {
context.lineWidth = 0.025;
context.beginPath();
context.arc(0, 0, 0.5, 0, TAU, true);
context.stroke();
};
var createParticle = function (_program) {
var particle = new THREE.Sprite(
new THREE.SpriteCanvasMaterial({
color: Math.random() * 0x808080 + 0x808080,
program: _program,
})
);
particle.position.x = Math.random() * 800 - 400;
particle.position.y = Math.random() * 800 - 400;
particle.position.z = Math.random() * 800 - 400;
particle.scale.x = particle.scale.y = Math.random() * 2 + 20;
return particle;
};
var createFish = function (type) {
let fishProgramStroke = function (context) {
let fish = "🐟";
if (type % 3 == 1) fish = "🐠";
if (type % 3 == 2) fish = "🐡";
context.scale(1, -1);
context.rotate(
(Math.sin(theta / (1 + ((type % 4) + 1) / 10)) * Math.PI) / 48
);
context.fillText(fish, 0, 0);
};
let particle = createParticle(fishProgramStroke);
particle.scale.x = particle.scale.y = Math.random() * 2 + 16;
return particle;
};
init();
animate();
function init() {
container = document.body;
camera = new THREE.PerspectiveCamera(
70,
window.innerWidth / window.innerHeight,
1,
10000
);
camera.position.set(0, 300, 500);
scene = new THREE.Scene();
scene.background = new THREE.Color(0xfafafa);
for (var i = 0; i < 30; i++) {
scene.add(createParticle(bubbleProgramStroke));
}
for (var i = 0; i < 10; i++) {
scene.add(createFish(i));
}
renderer = new THREE.CanvasRenderer();
renderer.setPixelRatio(window.devicePixelRatio);
renderer.setSize(window.innerWidth, window.innerHeight);
container.appendChild(renderer.domElement);
window.addEventListener("resize", onWindowResize, false);
}
function onWindowResize() {
camera.aspect = window.innerWidth / window.innerHeight;
camera.updateProjectionMatrix();
renderer.setSize(window.innerWidth, window.innerHeight);
}
function animate() {
requestAnimationFrame(animate);
render();
}
function render() {
theta += 0.1;
camera.position.x = radius * Math.sin(THREE.Math.degToRad(theta));
camera.position.y = radius * Math.sin(THREE.Math.degToRad(theta));
camera.position.z = radius * Math.cos(THREE.Math.degToRad(theta));
camera.lookAt(scene.position);
camera.updateMatrixWorld();
renderer.render(scene, camera);
}
</script>
</body>
</html>