-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.vue
More file actions
497 lines (433 loc) · 15.1 KB
/
Copy pathapp.vue
File metadata and controls
497 lines (433 loc) · 15.1 KB
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
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
<template>
<div class="top-section" id="page-start">
<div class="navbar">
<a class="nav-title" href="#page-start">./HOME</a>
<a class="nav-title" href="#card-section">./PROJECTS</a>
<a class="nav-title" href="#about-section">./ABOUT</a>
</div>
<div class="text-container">
<h1 class="main-title">
BE<span class="lit-l">N</span> <span class="lit-r">F</span>ORD
</h1>
<h2 class="description">
DEVELOPER SOMETIMES
</h2>
</div>
<ClientOnly>
<Renderer ref="renderer" class="trois" resize="window">
<Camera ref="camera" :position="{z: 17}"/>
<Scene ref="scene" :background="0x232226">
<SpotLight color="#FB4A3F" :intensity="0.25" :position="{x: 0, y: 10, z: 0}"/>
<PointLight ref="pointLight" :scale="{x: 0.25, y: 0.25, z: 0.25}" :intensity="0.75" :color="0xFFAF0F">
<Mesh>
<SphereGeometry />
<LambertMaterial :props="{emissive: '#FFAF0F', emissiveIntensity: 3}"/>
</Mesh>
</PointLight>
<Mesh ref="icosahedron" >
<IcosahedronGeometry />
<BasicMaterial color="#FFAF0F" :props="{wireframe: true}"/>
</Mesh>
<!-- left side large -->
<Sphere v-for="i in 2"
:ref="`ballLarge${i}`"
:position="{
x: (largeVarianceX * Math.random()) - largeOriginX,
y: (largeVarianceY * Math.random()) - largeOriginY,
z: (largeVarianceZ * Math.random())
}"
:scale="getScale(
1.25 - (0.5 * Math.random())
)"
>
<PhongMaterial :props="{
shininess: 60,
specular: 0x756565
}"/>
</Sphere>
<!-- right side large -->
<Sphere v-for="i in 2"
:ref="`ballLarge${i + 2}`"
:position="{
x: (-1 * largeVarianceX * Math.random()) + largeOriginX,
y: (-1 * largeVarianceY * Math.random()) + largeOriginY,
z: (-1 * largeVarianceZ * Math.random())
}"
:scale="getScale(
1.5 - (0.5 * Math.random())
)"
>
<PhongMaterial :props="{
shininess: 60,
specular: 0x756565
}"/>
</Sphere>
<!-- left side medium -->
<Sphere v-for="i in 4"
:ref="`ballMedium${i}`"
:position="{
x: (mediumVarianceX * Math.random()) - mediumOriginX,
y: (mediumVarianceY * Math.random()) - mediumOriginY,
z: (mediumVarianceZ * Math.random())
}"
:scale="getScale(
(0.5 * Math.random() + 0.25)
)"
>
<PhongMaterial :props="{
shininess: 60,
specular: 0x756565
}"/>
</Sphere>
<!-- right side medium -->
<Sphere v-for="i in 4"
:ref="`ballMedium${i + 4}`"
:position="{
x: (-1 * mediumVarianceX * Math.random()) + mediumOriginX,
y: (-1 * mediumVarianceY * Math.random()) + mediumOriginY,
z: (-1 * mediumVarianceZ * Math.random())
}"
:scale="getScale(
(0.75 * Math.random() + 0.15)
)"
>
<PhongMaterial :props="{
shininess: 60,
specular: 0x756565
}" />
</Sphere>
</Scene>
<EffectComposer >
<RenderPass />
<SMAAPass />
<HalftonePass ref="halftone" :scatter="3" :rotate-r="1"/>
<UnrealBloomPass :strength="1.5" :threshold="0.63"/>
<BokehPass ref="bokeh" :maxblur="0.001" :aperture="50"/>
</EffectComposer>
</Renderer>
</ClientOnly>
</div>
<div class="card-container" id="card-section">
<Card v-for="post in posts" :post="post"></Card>
</div>
<div class="cards-curve-layer"></div>
<div class="skills-container" id="about-section">
<h1 class="relative top-32 left-24 text-[10vw] lg:text-[4rem] text-zinc-200">
# INTERESTS / ABOUT
</h1>
<div class="flex flex-wrap sm:flex-col md:flex-col lg:flex-row justify-center place-items-start pt-48">
<p class="inline-block top-64 px-24 text-lg text-zinc-200 sm:w-fit md:w-fit lg:w-1/2 break-words">
Chartreuse intelligentsia mlkshk, la croix echo park hella meggings bespoke vibecession hashtag air plant four loko. Stumptown mixtape kale chips, sus meh bruh same live-edge tumblr woke snackwave knausgaard ennui health goth semiotics. Copper mug freegan listicle coloring book 3 wolf moon snackwave hella portland farm-to-table. Coloring book banjo quinoa heirloom hoodie cloud bread.
Banjo praxis XOXO, cred readymade cray austin stumptown hammock food truck vinyl farm-to-table offal. Shabby chic waistcoat bespoke typewriter, meggings thundercats ascot lumbersexual DIY kinfolk master cleanse enamel pin swag. Occupy pork belly hammock vaporware waistcoat JOMO.
</p>
<div class="flex flex-row invisible sm:visible sm:gap-10 md:gap-10 lg:gap-6 sm:justify-center md:justify-between place-items-start h-1/2 sm:p-0 md:p-0 lg:pr-16 sm:w-screen md:w-screen lg:w-1/2">
<div class="flex flex-col justify-start gap-8 sm:w-fit lg:w-[15rem] h-full ">
<div class="w-full outline h-fit">
<div class="h-1/4 outline flex justify-center place-items-center">
<h1 class=" text-left">
DATABASES
</h1>
</div>
<div class="h-3/4 place-items-center flex flex-col">
<p class="skill">FaunaDB</p>
<p class="skill">Redis</p>
<p class="skill">SurrealDB</p>
</div>
</div>
</div>
<div class="flex flex-col justify-start gap-8 sm:w-fit lg:w-[15rem] h-full ">
<div class="w-full outline h-fit">
<div class="h-1/4 outline flex justify-center place-items-center">
<h1 class=" text-left">
LANGUAGES
</h1>
</div>
<div class="h-3/4 place-items-center grid grid-cols-2">
<p class="skill">Python</p>
<p class="skill">JavaScript</p>
<p class="skill">Rust</p>
<p class="skill">Faust</p>
<p class="skill">C#</p>
<p class="skill">Kotlin</p>
</div>
</div>
<div class="w-fit outline h-1/3">
<div class="h-1/4 outline flex justify-center place-items-center">
<h1 class=" text-left">
FRAMEWORKS
</h1>
</div>
<div class="h-3/4 place-items-center grid grid-cols-3">
<p class="skill">Unity</p>
<p class="skill">FastAPI</p>
<p class="skill">KTor</p>
<p class="skill">Three</p>
<p class="skill">Vue</p>
<p class="skill">Nuxt3</p>
</div>
</div>
</div>
<div class="flex flex-col justify-start gap-8 sm:w-fit lg:w-[15rem] h-full ">
<div class="w-full outline h-1/3">
<div class="h-1/4 outline flex justify-center place-items-center">
<h1 class=" text-left">
COMPUTER SCIENCE
</h1>
</div>
<div class="h-3/4 place-items-center flex flex-col">
<p class="skill">Cryptography</p>
<p class="skill">Blockchain</p>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<style>
@import 'styles.scss';
@import "https://fonts.googleapis.com/css?family=JetBrains Mono";
</style>
<script>
import {
Renderer,
Camera,
PointLight,
SpotLight,
Sphere,
Box,
Mesh,
IcosahedronGeometry,
SphereGeometry,
Group,
Plane,
PhongMaterial,
SubSurfaceMaterial,
BasicMaterial,
StandardMaterial,
LambertMaterial,
EffectComposer,
UnrealBloomPass,
RenderPass,
Scene,
MatcapMaterial,
AmbientLight,
HalftonePass,
SMAAPass,
BokehPass
} from 'troisjs'
import { gsap } from 'gsap';
import { ScrollTrigger } from 'gsap/ScrollTrigger';
import Card from './components/card.vue'
gsap.registerPlugin(ScrollTrigger)
export default {
setup() {
useHead({
titleTemplate: (titleChunk) => {
return titleChunk ? `${titleChunk} | Studio Treble` : "Studio Treble";
},
});
},
data() {
return {
largeSpheres: [],
mediumSpheres: [],
mediumOriginX: 6,
mediumVarianceX: 2,
mediumOriginY: 3,
mediumVarianceY: 5,
mediumVarianceZ: 2,
largeOriginX: 6,
largeVarianceX: 2,
largeOriginY: 0,
largeVarianceY: 2,
largeVarianceZ: 3,
animMediumMagX: 0.02,
animMediumMagY: 0.01,
animMediumMagZ: 0.01,
animMediumFreqX: 1,
animMediumFreqY: 1,
animMediumFreqZ: 0.5,
animMediumVarianceX: 5,
animMediumVarianceY: 5,
animMediumVarianceZ: 2,
animLargeMagX: 0.005,
animLargeMagY: 0.0075,
animLargeMagZ: 0.002,
animLargeFreqX: 0.5,
animLargeFreqY: 0.25,
animLargeFreqZ: 0.125,
animLargeVarianceX: 5,
animLargeVarianceY: 8,
animLargeVarianceZ: 1,
yRotationScale: 100,
xRotationScale: 200,
zStart: 17,
posts: [
{
title: 'PORTFOLIO SITE',
content_1: 'This website. Made using Nuxt3 for work experience at Studio Treble.',
content_2: 'Styles are from Tailwind and the top section feautres a 3D scene usign TroisJS, a wrapper for ThreeJS.',
tech: 'NUXT3, VUE, TAILWIND, TroisJS',
link: 'http://localhost:3000/#page-start'
},
{
title: 'PROJECT 2',
content_1: 'baby kitsch actually beard 90s, mustache pickled cardigan letterpress mixtape bitters tacos.',
content_2: 'Subway tile knausgaard ascot blue bottle. Put a bird on it yes plz wolf marfa leggings flannel, bodega boys cornhole fingerstache af listicle',
tech: 'RUST',
link: ''
},
{
title: 'ONE VOICE / SINGER SIMULATOR',
content_1: 'A game made using unity and C# based on my computer science teacher as an end of year gift.',
content_2: 'It is an action game based on waves of enemies and features 2 areas and a final boss. Made in 2 weeks with my friend Cole.',
tech: 'UNITY, C#',
link: 'https://left-hand-gang.itch.io/one-voice'
}
]
}
},
components: {
Renderer,
Camera,
PointLight,
SpotLight,
Sphere,
Box,
Mesh,
IcosahedronGeometry,
SphereGeometry,
Group,
Plane,
PhongMaterial,
SubSurfaceMaterial,
BasicMaterial,
StandardMaterial,
LambertMaterial,
EffectComposer,
UnrealBloomPass,
RenderPass,
Scene,
MatcapMaterial,
AmbientLight,
Card,
HalftonePass,
BokehPass,
SMAAPass
},
mounted() {
const cards = gsap.utils.toArray('.card');
cards.forEach(card => {
gsap.from(card, {
x: -800,
ease: 'power3',
duration: 2,
scrollTrigger: {
trigger: card,
start: 'centre centre'
}
})
});
let t = 0;
let tPeriodic = 0;
let x = 0;
let y = 0;
let mx = 0;
let my = 0;
const sceneArea = document.querySelector(".top-section")
const text = document.querySelector(".text-container")
setTimeout(() => {
const renderer = this.$refs.renderer;
const ico = this.$refs.icosahedron;
const cam = this.$refs.camera.camera;
const light = this.$refs.pointLight.light;
const half = this.$refs.halftone;
half.pass.material.blending = 2;
for (let i = 1; i < 9; i++){
let refName = 'ballMedium' + i
this.mediumSpheres.push(
{
offset: Math.random(),
mesh: this.$refs[refName]
}
);
}
for (let i = 1; i < 5; i++){
let refName = 'ballLarge' + i
this.largeSpheres.push(
{
offset: Math.random(),
mesh: this.$refs[refName]
}
);
}
sceneArea.addEventListener("mousemove",
(e) => {
mx = (window.innerWidth / 2 - e.pageX) / 25;
my = (window.innerHeight / 2 - e.pageY) / 25;
})
sceneArea.addEventListener("mouseleave",
(e) => {
text.style.transition = 'all 2s ease';
mx = 0;
my = 0;
})
sceneArea.addEventListener("mouseenter",
async (e) => {
text.style.transition = 'all 0.5s ease';
x = 0;
y = 0;
await this.sleep(1000)
text.style.transition = '';
})
let lastFrame = Date.now();
renderer.onBeforeRender(
() => {
let now = Date.now();
let dTime = (now - lastFrame) / 1000;
cam.position.x = x / this.xRotationScale * this.zStart;
cam.rotation.y = x / this.xRotationScale;
cam.position.y = - y / this.yRotationScale * this.zStart;
cam.rotation.x = y / this.yRotationScale;
half.pass.uniforms.radius = {value: (2 * Math.sin(t / 40)) + 1}
text.style.transform = `rotateX(${y / 1.5}deg) rotateY(${-(x / 2)}deg) translateX(4vw) translateY(4vh)`
for (const ball of this.mediumSpheres){
ball.mesh[0].mesh.position.y += this.animMediumMagY * Math.sin(this.animMediumFreqY * t + (this.animMediumVarianceY * ball.offset));
ball.mesh[0].mesh.position.z += this.animMediumMagZ * Math.cos(this.animMediumFreqZ * t + (this.animMediumVarianceZ * ball.offset));
ball.mesh[0].mesh.position.x += this.animMediumMagX * Math.sin(this.animMediumFreqX * t + (this.animMediumVarianceX * ball.offset));
}
for (const ball of this.largeSpheres){
ball.mesh[0].mesh.position.y += this.animLargeMagY * Math.sin(this.animLargeFreqY * t + (this.animLargeVarianceY * ball.offset));
ball.mesh[0].mesh.position.z += this.animLargeMagZ * Math.cos(this.animLargeFreqZ * t + (this.animLargeVarianceZ * ball.offset));
ball.mesh[0].mesh.position.x += this.animLargeMagX * Math.sin(this.animLargeFreqX * t + (this.animLargeVarianceX * ball.offset));
}
ico.mesh.rotation.x += 0.08 * Math.abs( (t / 12) - Math.floor( (t / 12) + 0.5 ));
ico.mesh.rotation.y += 0.08 * Math.abs( (t / 12) - Math.floor( (t / 12) + 0.5 ));
ico.mesh.rotation.z += 0.005;
light.position.y = 0.25 * Math.sin(0.25 * t);
ico.mesh.position.y = light.position.y;
t += 0.025
tPeriodic = (t % 8)
x = this.lerp(x, mx, (t / 4) * dTime);
y = this.lerp(y, my, (t / 4) * dTime);
lastFrame = Date.now();
}
)
}, 100);
},
methods: {
getScale(value) {
return {x: value, y: value, z: value};
},
lerp(a, b, time) {
return (1 - time) * a + time * b;
},
sleep(time) {
return new Promise(
resolve => setTimeout(resolve, time)
);
}
}
}
</script>