Skip to content

Commit 16e526b

Browse files
authored
πŸ› FIX: Logo Overlapping and Content Spacing Fix (#95)
* οΏ½ Logo Overlapping and Content Spacing Fix * πŸ› FIX: WebGL Code Cleanup
1 parent 6c0ef62 commit 16e526b

File tree

3 files changed

+13
-47
lines changed

3 files changed

+13
-47
lines changed

β€Žapps/baseai.dev/src/components/home/hero.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ function Content() {
4545
<div className="col-span-2 flex w-full flex-col-reverse items-center justify-between lg:flex-row lg:items-start">
4646
<div className={cn('self-end lg:max-w-[60%]', inter.className)}>
4747
<div
48-
className="text-center text-sm text-sm lg:text-left lg:text-left
48+
className="text-center text-sm lg:text-left
4949
50-
2xl:text-[1vw] 2xl:text-[1vw] 2xl:leading-[1.5vw] 2xl:leading-[1.5vw]"
50+
2xl:text-[1vw] 2xl:leading-[1.5vw]"
5151
>
5252
<div className="flex items-center justify-center lg:justify-start">
5353
<div className="mr-4 hidden size-4 rounded-full bg-muted-foreground/70 sm:block"></div>
@@ -245,4 +245,4 @@ function CopyableCommand({ command }: CopyableCommandProps) {
245245
</div>
246246
</div>
247247
);
248-
}
248+
}

β€Žapps/baseai.dev/src/components/home/webgl.tsx

Lines changed: 10 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,6 @@ const WebGLInitializer = () => {
2929
canvas.width = window.innerWidth;
3030
canvas.height = window.innerHeight;
3131

32-
// const fontFace = new FontFace(
33-
// 'Grotesk',
34-
// 'url(/AlteHaasGroteskBold.ttf)'
35-
// );
36-
// document.fonts.add(fontFace);
37-
38-
// const style = document.createElement('style');
39-
// style.innerHTML = `
40-
// @import url(/AlteHaasGroteskBold.ttf);
41-
// body {
42-
// font-family: 'Grotesk', sans-serif;
43-
// }
44-
// `;
45-
// document.head.appendChild(style);
46-
4732
const textDiv = document.createElement('div');
4833
textDiv.style.position = 'absolute';
4934
textDiv.style.left = '0';
@@ -54,7 +39,6 @@ const WebGLInitializer = () => {
5439
textDiv.style.fontFamily = 'Grotesk';
5540
textDiv.style.color = 'rgba(255,255,255,1)';
5641
textDiv.style.display = 'flex';
57-
// textDiv.style.lineHeight = '0px';
5842
textDiv.style.justifyContent = 'center';
5943
textDiv.style.alignItems = 'center';
6044
textDiv.textContent = 'BASE AI';
@@ -73,7 +57,7 @@ const WebGLInitializer = () => {
7357
await document.fonts.ready;
7458
document.body.appendChild(textDiv);
7559

76-
const lineHeight = window.getComputedStyle(textDiv).lineHeight; // e.g., "20px"
60+
const lineHeight = window.getComputedStyle(textDiv).lineHeight;
7761
const y = parseFloat(lineHeight);
7862

7963
const canvas = await html2canvas(textDiv, {
@@ -84,7 +68,6 @@ const WebGLInitializer = () => {
8468
logging: false,
8569
y: y * 0,
8670
x: 0,
87-
// foreignObjectRendering: true,
8871
onclone: document => {
8972
Array.from(document.querySelectorAll('*')).forEach(e => {
9073
let existingStyle = e.getAttribute('style') || '';
@@ -133,7 +116,6 @@ const WebGLInitializer = () => {
133116
}
134117
);
135118

136-
// Custom shader material for the enhanced liquid wavy effect
137119
const material = new THREE.ShaderMaterial({
138120
transparent: true,
139121
uniforms: {
@@ -409,7 +391,6 @@ const WebGLInitializer = () => {
409391
`
410392
});
411393

412-
// Create a mesh with the geometry and material
413394
const sphere = new THREE.Mesh(geometry, material);
414395
scene.add(sphere);
415396

@@ -418,7 +399,7 @@ const WebGLInitializer = () => {
418399
function calculateCameraZ(screenWidth: number, screenHeight: number) {
419400
let cameraZ;
420401

421-
// Breakpoints based on screen width and height
402+
422403
if (screenWidth <= 768) {
423404
if (screen.availWidth < screen.availHeight) {
424405
cameraZ = 4.5;
@@ -427,46 +408,41 @@ const WebGLInitializer = () => {
427408
}
428409
} else if (screenWidth > 768 && screenWidth <= 1920) {
429410
if (screenHeight <= 1080) {
430-
cameraZ = 2; // Full HD screens (1920x1080)
411+
cameraZ = 2;
431412
} else {
432-
cameraZ = 1.9; // Higher aspect ratio or larger height
413+
cameraZ = 1.9;
433414
}
434415
} else if (screenWidth > 1920 && screenWidth <= 2440) {
435416
if (screenHeight <= 1080) {
436-
cameraZ = 1.75; // Wide screens with Full HD height
417+
cameraZ = 1.75;
437418
} else {
438-
cameraZ = 1.65; // Taller screens with higher resolutions
419+
cameraZ = 1.65;
439420
}
440421
} else if (screenWidth > 2440) {
441422
if (screenHeight <= 1440) {
442-
cameraZ = 1.5; // Ultra-wide or larger 2K displays
423+
cameraZ = 1.5;
443424
} else {
444-
cameraZ = 1.4; // 4K and above
425+
cameraZ = 1.4;
445426
}
446427
}
447428

448429
return cameraZ;
449430
}
450431

451-
// Get screen width and height
452432
const screenWidth = window.innerWidth;
453433
const screenHeight = window.innerHeight;
454434

455-
// Calculate camera Z position based on breakpoints
456435
const cameraZ = calculateCameraZ(screenWidth, screenHeight);
457436
if (cameraZ) camera.position.z = cameraZ;
458437

459-
// Raycaster setup
460438
const raycaster = new THREE.Raycaster();
461439
const mouse = new THREE.Vector2();
462440

463-
// Animation loop
464441
const animate = () => {
465442
requestAnimationFrame(animate);
466-
material.uniforms.u_time.value += 0.02; // Update time for animation
443+
material.uniforms.u_time.value += 0.02;
467444
material.uniforms.u_viewVector.value = camera.position;
468445

469-
// Update mouse position in the shader
470446
raycaster.setFromCamera(mouse, camera);
471447
const intersects = raycaster.intersectObject(sphere);
472448
if (intersects.length > 0) {
@@ -501,13 +477,6 @@ const WebGLInitializer = () => {
501477

502478
updateCameraPosition();
503479

504-
// Update background texture with new dimensions
505-
createHighResBackgroundTexture(width, height).then(texture => {
506-
scene.background = texture;
507-
if (material.uniforms && material.uniforms.u_background) {
508-
material.uniforms.u_background.value = texture;
509-
}
510-
});
511480
createHighResBackgroundTexture(width, height).then(texture => {
512481
scene.background = texture;
513482
if (material.uniforms && material.uniforms.u_background) {
@@ -529,4 +498,4 @@ const WebGLInitializer = () => {
529498
return <div ref={mountRef} />;
530499
};
531500

532-
export default WebGLInitializer;
501+
export default WebGLInitializer;

β€Žapps/baseai.dev/src/styles/global.css

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,6 @@
7575
body {
7676
@apply bg-background text-foreground;
7777
}
78-
img {
79-
display: inline-block !important;
80-
}
8178
}
8279

8380
::selection {

0 commit comments

Comments
Β (0)