-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.html
More file actions
260 lines (220 loc) · 9.55 KB
/
Copy pathmain.html
File metadata and controls
260 lines (220 loc) · 9.55 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
import React, { useRef, useEffect, useState } from 'react';
import * as THREE from 'three';
import { EffectComposer } from 'three/examples/jsm/postprocessing/EffectComposer.js';
import { RenderPass } from 'three/examples/jsm/postprocessing/RenderPass.js';
import { ShaderPass } from 'three/examples/jsm/postprocessing/ShaderPass.js';
import { UnrealBloomPass } from 'three/examples/jsm/postprocessing/UnrealBloomPass.js';
import { RGBShiftShader } from 'three/examples/jsm/shaders/RGBShiftShader.js';
const BeamBackground: React.FC = () => {
const containerRef = useRef<HTMLDivElement>(null);
useEffect(() => {
if (typeof window === 'undefined') return;
const container = containerRef.current;
if (!container) return;
while (container.firstChild) {
container.removeChild(container.firstChild);
}
const renderer = new THREE.WebGLRenderer({
antialias: false,
alpha: false,
powerPreference: 'high-performance'
});
renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));
renderer.setSize(container.clientWidth, container.clientHeight);
renderer.setClearColor(0x0d0d0d, 1);
container.appendChild(renderer.domElement);
const scene = new THREE.Scene();
scene.background = new THREE.Color(0x0d0d0d);
const camera = new THREE.OrthographicCamera();
let composer: EffectComposer, rgbShift: ShaderPass, bloom: UnrealBloomPass;
const renderPass = new RenderPass(scene, camera);
bloom = new UnrealBloomPass(
new THREE.Vector2(container.clientWidth, container.clientHeight),
0.5,
0.9,
0.2
);
rgbShift = new ShaderPass(RGBShiftShader);
rgbShift.uniforms['amount'].value = 0.002;
rgbShift.uniforms['angle'].value = Math.PI / 4;
composer = new EffectComposer(renderer);
composer.addPass(renderPass);
composer.addPass(bloom);
composer.addPass(rgbShift);
const GRID = {
cols: 100,
rows: 100,
jitter: 0.25,
hexOffset: 0.5,
dotRadius: 0.025,
spacing: 0.55
};
const total = GRID.cols * GRID.rows;
const geometry = new THREE.CircleGeometry(GRID.dotRadius, 8);
const material = new THREE.MeshBasicMaterial({ color: 0xe77d22 });
const dots = new THREE.InstancedMesh(geometry, material, total);
dots.instanceMatrix.setUsage(THREE.DynamicDrawUsage);
scene.add(dots);
const basePos = new Float32Array(total * 2);
const distArr = new Float32Array(total);
let xOffset = (GRID.cols - 1) * GRID.spacing * 0.5;
let yOffset = (GRID.rows - 1) * GRID.spacing * 0.5;
let idx = 0;
const dummy = new THREE.Object3D();
for (let r = 0; r < GRID.rows; r++) {
for (let c = 0; c < GRID.cols; c++, idx++) {
let x = c * GRID.spacing - xOffset;
let y = r * GRID.spacing - yOffset;
y += (c % 2) * GRID.hexOffset * GRID.spacing;
x += (Math.random() - 0.5) * GRID.jitter;
y += (Math.random() - 0.5) * GRID.jitter;
basePos[idx * 2 + 0] = x;
basePos[idx * 2 + 1] = y;
const len = Math.hypot(x, y);
const ang = Math.atan2(y, x);
const oct = 0.5 * Math.cos(ang * 8.0);
distArr[idx] = len + oct * 0.75;
dummy.position.set(x, y, 0);
dummy.updateMatrix();
dots.setMatrixAt(idx, dummy.matrix);
}
}
function roundedSquareWave(t: number, delta: number, a: number, f: number) {
return ((2 * a) / Math.PI) * Math.atan(Math.sin(2 * Math.PI * t * f) / delta);
}
const clock = new THREE.Clock();
let animationFrameId: number;
function animate() {
animationFrameId = requestAnimationFrame(animate);
const t = clock.getElapsedTime();
const speed = 0.4;
const amp = 0.8;
const freq = 0.25;
const falloff = 0.04;
const phase = (Math.sin(2 * Math.PI * t * freq) + 1) * 0.5;
rgbShift.uniforms['amount'].value = 0.0015 + phase * 0.003;
const mat = new THREE.Matrix4();
const pos = new THREE.Vector3();
for (let i = 0; i < total; i++) {
const x0 = basePos[i * 2 + 0];
const y0 = basePos[i * 2 + 1];
const dist = distArr[i];
const localDelta = THREE.MathUtils.lerp(0.05, 0.2, Math.min(1.0, dist / 70.0));
const tt = t * speed - dist * falloff;
const k = 1 + roundedSquareWave(tt, localDelta, amp, freq);
pos.set(x0 * k, y0 * k, 0);
mat.set(1, 0, 0, pos.x, 0, 1, 0, pos.y, 0, 0, 1, 0, 0, 0, 0, 1);
dots.setMatrixAt(i, mat);
}
dots.instanceMatrix.needsUpdate = true;
composer.render();
}
const resizeCamera = () => {
if (!container) return;
const w = container.clientWidth;
const h = container.clientHeight;
const aspect = w / h;
const worldHeight = 10;
const worldWidth = worldHeight * aspect;
camera.left = -worldWidth / 2;
camera.right = worldWidth / 2;
camera.top = worldHeight / 2;
camera.bottom = -worldHeight / 2;
camera.near = -100;
camera.far = 100;
camera.position.set(0, 0, 10);
camera.updateProjectionMatrix();
renderer.setSize(w, h);
composer.setSize(w, h);
if (rgbShift.uniforms['resolution']) {
rgbShift.uniforms['resolution'].value.set(w, h);
}
bloom.setSize(w, h);
};
const observer = new ResizeObserver(() => {
resizeCamera();
});
observer.observe(container);
resizeCamera();
animate();
return () => {
observer.disconnect();
window.cancelAnimationFrame(animationFrameId);
if (container) {
while (container.firstChild) {
container.removeChild(container.firstChild);
}
}
geometry.dispose();
material.dispose();
};
}, []);
return <div ref={containerRef} className="absolute inset-0 z-0 pointer-events-none" />;
};
const HeroComponent: React.FC = () => {
const [textIndex, setTextIndex] = useState(0);
const [displayText, setDisplayText] = useState('');
const [isDeleting, setIsDeleting] = useState(false);
const skills = ['Python', 'AWS', 'Security', 'Operations'];
useEffect(() => {
const fullText = skills[textIndex];
const handleTyping = () => {
if (isDeleting) {
setDisplayText((prev) => prev.substring(0, prev.length - 1));
} else {
setDisplayText((prev) => fullText.substring(0, prev.length + 1));
}
};
const typingSpeed = isDeleting ? 75 : 150;
const typeInterval = setInterval(handleTyping, typingSpeed);
if (!isDeleting && displayText === fullText) {
setTimeout(() => setIsDeleting(true), 2000);
} else if (isDeleting && displayText === '') {
setIsDeleting(false);
setTextIndex((prev) => (prev + 1) % skills.length);
}
return () => clearInterval(typeInterval);
}, [displayText, isDeleting, textIndex, skills]);
return (
<div className="relative w-full min-h-screen bg-[#0D0D0D] overflow-hidden">
<BeamBackground />
<div className="relative z-10 flex flex-col items-center justify-center min-h-screen px-6 text-center">
<div className="max-w-5xl mx-auto space-y-8">
<div className="space-y-4">
<h1 className="text-5xl md:text-6xl lg:text-7xl xl:text-8xl font-bold text-[#F0EDE4] leading-tight">
DevOps Engineer
</h1>
<div className="flex items-center justify-center gap-4 text-4xl md:text-5xl lg:text-6xl xl:text-7xl font-bold">
<span className="text-[#F0EDE4]">Specializing in</span>
<span className="text-[#E77D22] min-w-[300px] text-left">
{displayText}
<span className="animate-pulse">|</span>
</span>
</div>
</div>
<p className="text-lg md:text-xl lg:text-2xl text-[#F0EDE4]/80 font-light leading-relaxed max-w-3xl mx-auto">
Building scalable infrastructure and automating workflows with cutting-edge cloud technologies and security best practices.
</p>
<div className="flex flex-col sm:flex-row gap-4 justify-center mt-12">
<button className="px-8 py-4 bg-[#E77D22] hover:bg-[#E77D22]/90 text-[#0D0D0D] rounded-lg font-semibold text-lg transition-all duration-300 hover:scale-105 hover:shadow-xl hover:shadow-[#E77D22]/25">
View Projects
</button>
<button className="px-8 py-4 bg-transparent border-2 border-[#E77D22]/30 hover:border-[#E77D22] text-[#F0EDE4] rounded-lg font-semibold text-lg transition-all duration-300 hover:scale-105 backdrop-blur-sm">
Contact Me
</button>
</div>
<div className="flex items-center justify-center gap-6 text-[#E77D22]/40 text-sm uppercase tracking-[0.3em] mt-16">
<div className="w-12 h-px bg-gradient-to-r from-transparent to-[#E77D22]/30"></div>
<span className="animate-pulse">Scroll to Explore</span>
<div className="w-12 h-px bg-gradient-to-l from-transparent to-[#E77D22]/30"></div>
</div>
</div>
</div>
<div className="absolute inset-0 pointer-events-none overflow-hidden">
<div className="absolute top-20 left-20 w-80 h-80 bg-[#E77D22]/5 rounded-full blur-3xl animate-pulse"></div>
<div className="absolute bottom-20 right-20 w-96 h-96 bg-[#E77D22]/5 rounded-full blur-3xl animate-pulse" style={{ animationDelay: '2s' }}></div>
</div>
</div>
);
};
export default HeroComponent;