forked from Hunterdii/AN-ANIMATED-MASk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
252 lines (202 loc) · 9.14 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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Miro Leon Bucher</title>
<style>
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,300;1,400;1,500;1,600;1,700;1,800&display=swap');
html, body {
margin: 0;
overflow: hidden;
background-color: #11151c;
}
a {
color: rgba(255, 255, 255, 0.5);
text-decoration: none;
transition: all 0.5s ease-in-out;
}
a:hover {
filter: drop-shadow(0px 0px 10px rgba(255, 255, 255, 0.9));
}
.canvas-container {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 0;
}
#canvas {
width: 100%;
height: 100%;
}
.text-container {
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: center;
height: 100%;
position: fixed;
left: 0;
z-index: 1;
}
.title {
font-family: 'Open Sans', sans-serif;
font-size: 1rem;
text-align: center;
text-transform: uppercase;
letter-spacing: 0.3rem;
font-weight: 500;
color: rgba(255, 255, 255, 0.5);
}
.socials {
display: flex;
align-items: center;
justify-content: center;
margin-top: 20px;
}
.socials a {
margin: 0 15px;
transition: all 0.5s ease-in-out;
}
.socials a:hover {
transform: scale(1.2);
filter: drop-shadow(0px 0px 5px rgba(255, 255, 255, 1));
}
</style>
</head>
<body>
<div class="canvas-container">
<canvas id="canvas"></canvas>
</div>
<div class="text-container">
<div class="title">(HUNTER) <br> <a href="https://github.com/Hunterdii" target="_blank">MaSk BrO</a> </div>
<div class="socials">
<a href="https://www.linkedin.com/in/het-patel-8b110525a/" target="_blank">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24">
<path fill="currentColor" d="M22 4.5A2.5 2.5 0 0 0 19.5 2h-15A2.5 2.5 0 0 0 2 4.5v15A2.5 2.5 0 0 0 4.5 22h15A2.5 2.5 0 0 0 22 19.5v-15zm-5 14h-1.5V11H16v7zm-1.5-8.875A1.624 1.624 0 0 1 16.75 6.5a1.628 1.628 0 0 1 1.625 1.625 1.628 1.628 0 0 1-1.625 1.625A1.628 1.628 0 0 1 15.5 9.625zm7 8.875h-1.5V14.5c0-1.094-.844-1.969-1.875-1.969s-1.875.875-1.875 1.969v3.125H9V11h1.5v1.094c.594-.875 1.656-1.875 3.656-1.875 2.969 0 5.344 1.938 5.344 5.938v5.844z"/>
</svg>
</a>
<a href="mailto:[email protected]" target="_blank">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24">
<path fill="currentColor" d="M12 2c-4.417 0-8 3.582-8 8c0 2.133.867 4.061 2.271 5.469L2.828 20c-.586.586-.586 1.535 0 2.121c.586.586 1.535.586 2.121 0l4.531-4.531C9.939 18.133 11.867 19 14 19c4.418 0 8-3.582 8-8s-3.582-8-8-8zm0 2c3.314 0 6 2.686 6 6s-2.686 6-6 6s-6-2.686-6-6s2.686-6 6-6zm1 6c.554 0 1 .446 1 1v4c0 .554-.446 1-1 1s-1-.446-1-1v-4c0-.554.446-1 1-1zm-1.799 6c-.071.028-.13.071-.197.104c-.65.416-1.417.628-2.304.628c-.888 0-1.655-.212-2.304-.628c-.066-.033-.124-.076-.197-.104C5.56 16.477 5 15.301 5 14c0-1.301.56-2.477 1.465-3.274c.071-.028.13-.071.197-.104c.65-.416 1.417-.628 2.304-.628c.888 0 1.655.212 2.304.628c.066.033.124.076.197.104c.905.797 1.465 1.973 1.465 3.274c0 1.301-.56 2.477-1.465 3.274z"/>
</svg>
</a>
<a href="https://instagram.com/het9778?igshid=MzNlNGNkZWQ4Mg==" target="_blank">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24">
<path fill="currentColor" d="M12 2c-4.418 0-8 3.582-8 8c0 4.418 3.582 8 8 8c4.418 0 8-3.582 8-8c0-4.418-3.582-8-8-8zm0 14c-2.206 0-4-1.794-4-4s1.794-4 4-4s4 1.794 4 4s-1.794 4-4 4zm7.051-11.97a1.25 1.25 0 0 0-1.051-.581c-3.052-.005-6.103-.005-9.155 0a1.25 1.25 0 0 0-1.05.58C6.56 5.375 6.5 6.544 6.5 7.75s.06 2.375.146 3.22a1.25 1.25 0 0 0 1.051.58c3.05.005 6.1.005 9.151 0a1.25 1.25 0 0 0 1.051-.58c.085-.846.145-2.016.145-3.22s-.06-2.375-.146-3.22zM12 15a3 3 0 1 0 0-6a3 3 0 0 0 0 6z"/>
</svg>
</a>
</div>
</div>
<script type="module">
// Your Three.js and animation code here
import * as THREE from 'https://cdn.skypack.dev/[email protected]';
import { RGBELoader } from 'https://cdn.skypack.dev/[email protected]/examples/jsm/loaders/RGBELoader.js';
import { EffectComposer } from 'https://cdn.skypack.dev/[email protected]/examples/jsm/postprocessing/EffectComposer.js';
import { RenderPass } from 'https://cdn.skypack.dev/[email protected]/examples/jsm/postprocessing/RenderPass.js';
import { AfterimagePass } from 'https://cdn.skypack.dev/[email protected]/examples/jsm/postprocessing/AfterimagePass.js';
import { UnrealBloomPass } from 'https://cdn.skypack.dev/[email protected]/examples/jsm/postprocessing/UnrealBloomPass.js';
import { ShaderPass } from 'https://cdn.skypack.dev/[email protected]/examples/jsm/postprocessing/ShaderPass.js';
import { PixelShader } from 'https://cdn.skypack.dev/[email protected]/examples/jsm/shaders/PixelShader.js';
import { FBXLoader } from 'https://cdn.skypack.dev/[email protected]/examples/jsm/loaders/FBXLoader.js';
var renderer = new THREE.WebGLRenderer({ canvas : document.getElementById('canvas'), antialias:true});
// default bg canvas color //
renderer.setClearColor(0x11151c);
// use device aspect ratio //
renderer.setPixelRatio(window.devicePixelRatio);
// set size of canvas within window //
renderer.setSize(window.innerWidth, window.innerHeight);
var scene = new THREE.Scene();
const hdrEquirect = new RGBELoader()
.setPath( 'https://miroleon.github.io/daily-assets/' )
.load( 'gradient_13.hdr', function () {
hdrEquirect.mapping = THREE.EquirectangularReflectionMapping;
} );
scene.environment = hdrEquirect;
scene.fog = new THREE.Fog( 0x11151c, 1, 100 );
scene.fog = new THREE.FogExp2(0x11151c, 0.14);
var camera = new THREE.PerspectiveCamera( 45, window.innerWidth/window.innerHeight, 0.1, 1000 );
camera.position.z = 10;
camera.position.y = 0.2;
const pointlight = new THREE.PointLight (0x85ccb8, 2, 20);
pointlight.position.set (0,3,2);
scene.add (pointlight);
const pointlight2 = new THREE.PointLight (0x85ccb8, 2, 20);
pointlight2.position.set (0,3,2);
scene.add (pointlight2);
const textureLoader = new THREE.TextureLoader();
var surf_imp = textureLoader.load( 'https://miroleon.github.io/daily-assets/surf_imp_02.jpg' );
surf_imp.wrapT = THREE.RepeatWrapping;
surf_imp.wrapS = THREE.RepeatWrapping;
var mask_mat = new THREE.MeshPhysicalMaterial({
color: 0xffffff,
roughness: 1,
metalness: 1,
roughnessMap: surf_imp});
let mask;
const loaderFBX1 = new FBXLoader().setPath( 'https://miroleon.github.io/daily-assets/' );
loaderFBX1.load( 'MASK_02.fbx', function ( object ) {
mask = object.children[ 0 ];
mask.position.set( 0, -0.2, 0 );
mask.scale.setScalar( 2 );
mask.material = mask_mat;
scene.add( mask );
} );
let composer;
const renderScene = new RenderPass( scene, camera );
const afterimagePass = new AfterimagePass();
afterimagePass.uniforms[ 'damp' ].value = 0.95;
const bloomparams = {
exposure: 1,
bloomStrength: 1,
bloomThreshold: 0.1,
bloomRadius: 1
};
const bloomPass = new UnrealBloomPass( new THREE.Vector2( window.innerWidth, window.innerHeight ), 1.5, 0.4, 0.85 );
bloomPass.threshold = bloomparams.bloomThreshold;
bloomPass.strength = bloomparams.bloomStrength;
bloomPass.radius = bloomparams.bloomRadius;
const pixelPass = new ShaderPass( PixelShader );
pixelPass.uniforms[ 'resolution' ].value = new THREE.Vector2( window.innerWidth, window.innerHeight );
pixelPass.uniforms[ 'resolution' ].value.multiplyScalar( window.devicePixelRatio );
pixelPass.uniforms[ 'pixelSize' ].value = 20;
composer = new EffectComposer( renderer );
composer.addPass( renderScene );
composer.addPass( afterimagePass );
composer.addPass( bloomPass );
window.addEventListener( 'resize', onWindowResize );
var theta1 = 0;
var update = function() {
theta1 += 0.007;
camera.position.x = Math.sin( theta1 ) * 2;
camera.position.y = 2.5
* Math.cos(theta1) + 1;
pointlight.position.x = Math.sin(theta1 + 1) * 11;
pointlight.position.z = Math.cos(theta1 + 1) * 11;
pointlight.position.y = 2 * Math.cos(theta1 - 3) + 3;
pointlight2.position.x = -Math.sin(theta1 + 1) * 11;
pointlight2.position.z = -Math.cos(theta1 + 1) * 11;
pointlight2.position.y = 2 * -Math.cos(theta1 - 3) - 6;
// Rotation animation for the mask
if (mask) {
mask.rotation.y += 0.02; // Adjust the rotation speed as needed
}
camera.lookAt(0, 0, 0);
};
function onWindowResize() {
camera.aspect = window.innerWidth / window.innerHeight;
camera.updateProjectionMatrix();
renderer.setSize(window.innerWidth, window.innerHeight);
}
function animate() {
update();
composer.render();
requestAnimationFrame(animate);
}
requestAnimationFrame(animate);
</script>
</body>
</html>
//this code is implementing model which is already made so use by giving credits