import React, { useRef, useState, useEffect, useId } from 'react';
import { motion } from 'framer-motion';
import * as THREE from 'three';
import {
Zap,
Github,
Twitter,
ArrowRight,
Sparkles,
Layers,
Cpu
} from 'lucide-react';
// --- UTILS ---
function cn(...inputs) {
return inputs.filter(Boolean).join(" ");
}
// --- 1. NATIVE SPARKLES COMPONENT (Zero-Dependency) ---
const SparklesCore = ({
id,
className,
minSize = 0.6,
maxSize = 1.4,
speed = 1,
particleColor = "#ffffff",
particleDensity = 100
}) => {
const canvasRef = useRef(null);
const generatedId = useId();
const actualId = id || generatedId;
useEffect(() => {
const canvas = canvasRef.current;
if (!canvas) return;
const ctx = canvas.getContext('2d');
let animationFrameId;
let particles = [];
const resize = () => {
const parent = canvas.parentElement;
if (parent) {
canvas.width = parent.offsetWidth;
canvas.height = parent.offsetHeight;
}
};
class Particle {
constructor() { this.reset(); }
reset() {
this.x = Math.random() * canvas.width;
this.y = Math.random() * canvas.height;
this.size = Math.random() * (maxSize - minSize) + minSize;
this.vx = (Math.random() - 0.5) * speed * 0.5;
this.vy = (Math.random() - 0.5) * speed * 0.5;
this.opacity = Math.random();
this.opacitySpeed = (Math.random() * 0.02 + 0.01) * speed;
}
update() {
this.x += this.vx;
this.y += this.vy;
this.opacity += this.opacitySpeed;
if (this.opacity > 1 || this.opacity < 0) this.opacitySpeed *= -1;
if (this.x < 0 || this.x > canvas.width || this.y < 0 || this.y > canvas.height) this.reset();
}
draw() {
ctx.beginPath();
ctx.arc(this.x, this.y, this.size, 0, Math.PI * 2);
ctx.fillStyle = particleColor;
ctx.globalAlpha = Math.max(0, this.opacity);
ctx.fill();
}
}
const init = () => {
resize();
particles = [];
const count = (canvas.width * canvas.height) / (100000 / particleDensity);
for (let i = 0; i < count; i++) particles.push(new Particle());
};
const animate = () => {
ctx.clearRect(0, 0, canvas.width, canvas.height);
particles.forEach(p => { p.update(); p.draw(); });
animationFrameId = requestAnimationFrame(animate);
};
window.addEventListener('resize', init);
init();
animate();
return () => {
window.removeEventListener('resize', init);
cancelAnimationFrame(animationFrameId);
};
}, [maxSize, minSize, particleColor, particleDensity, speed]);
return (
);
};
// --- 2. GLOBAL SHADER BACKGROUND ---
const ShaderBackground = () => {
const canvasRef = useRef(null);
const vsSource = `attribute vec4 aVertexPosition; void main() { gl_Position = aVertexPosition; }`;
const fsSource = `
precision highp float;
uniform vec2 iResolution;
uniform float iTime;
const float scale = 5.0;
const vec4 lineColor = vec4(0.4, 0.2, 0.8, 1.0);
const int linesPerGroup = 16;
float random(float t) { return (cos(t) + cos(t * 1.3 + 1.3) + cos(t * 1.4 + 1.4)) / 3.0; }
void main() {
vec2 uv = gl_FragCoord.xy / iResolution.xy;
vec2 space = (gl_FragCoord.xy - iResolution.xy / 2.0) / iResolution.x * 2.0 * scale;
float verticalFade = 1.0 - (cos(uv.y * 6.28) * 0.5 + 0.5);
vec4 lines = vec4(0.0);
for(int l = 0; l < linesPerGroup; l++) {
float rand = random(float(l) + space.x * 0.5 + iTime * 0.2) * 0.5 + 0.5;
float linePos = random(space.x * 0.2 + iTime * 0.2) * (1.0 - (cos(uv.x * 6.28)*0.5+0.5)) + float(l)*0.1;
float line = smoothstep(0.05, 0.0, abs(linePos - space.y));
lines += line * lineColor * rand;
}
gl_FragColor = vec4(0.02, 0.02, 0.05, 1.0) * verticalFade + lines * 0.3;
}
`;
useEffect(() => {
const canvas = canvasRef.current;
if (!canvas) return;
const gl = canvas.getContext('webgl');
if (!gl) return;
const loadS = (t, s) => { const sh = gl.createShader(t); gl.shaderSource(sh, s); gl.compileShader(sh); return sh; };
const program = gl.createProgram();
gl.attachShader(program, loadS(gl.VERTEX_SHADER, vsSource));
gl.attachShader(program, loadS(gl.FRAGMENT_SHADER, fsSource));
gl.linkProgram(program);
const posBuf = gl.createBuffer();
gl.bindBuffer(gl.ARRAY_BUFFER, posBuf);
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([-1,-1, 1,-1, -1,1, 1,1]), gl.STATIC_DRAW);
const render = (time) => {
canvas.width = window.innerWidth; canvas.height = window.innerHeight;
gl.viewport(0, 0, canvas.width, canvas.height);
gl.useProgram(program);
gl.uniform2f(gl.getUniformLocation(program, 'iResolution'), canvas.width, canvas.height);
gl.uniform1f(gl.getUniformLocation(program, 'iTime'), time * 0.001);
const loc = gl.getAttribLocation(program, 'aVertexPosition');
gl.enableVertexAttribArray(loc);
gl.vertexAttribPointer(loc, 2, gl.FLOAT, false, 0, 0);
gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);
requestAnimationFrame(render);
};
render(0);
}, []);
return ;
};
// --- 3. INLINE SHADER ANIMATION CARD ---
function ShaderAnimation({ className }) {
const containerRef = useRef(null)
const sceneRef = useRef(null)
useEffect(() => {
if (!containerRef.current) return
const container = containerRef.current
const vertexShader = `void main() { gl_Position = vec4( position, 1.0 ); }`
const fragmentShader = `
precision highp float;
uniform vec2 resolution;
uniform float time;
void main(void) {
vec2 uv = (gl_FragCoord.xy * 2.0 - resolution.xy) / min(resolution.x, resolution.y);
float t = time*0.05;
float lineWidth = 0.002;
vec3 color = vec3(0.0);
for(int j = 0; j < 3; j++){
for(int i=0; i < 5; i++){
color[j] += lineWidth*float(i*i) / abs(fract(t - 0.01*float(j)+float(i)*0.01)*5.0 - length(uv) + mod(uv.x+uv.y, 0.2));
}
}
gl_FragColor = vec4(color[0],color[1],color[2],1.0);
}
`
const camera = new THREE.Camera(); camera.position.z = 1;
const scene = new THREE.Scene(); const geometry = new THREE.PlaneGeometry(2, 2);
const uniforms = { time: { type: "f", value: 1.0 }, resolution: { type: "v2", value: new THREE.Vector2() } };
const material = new THREE.ShaderMaterial({ uniforms, vertexShader, fragmentShader });
const mesh = new THREE.Mesh(geometry, material); scene.add(mesh);
const renderer = new THREE.WebGLRenderer({ antialias: true, alpha: true });
renderer.setPixelRatio(window.devicePixelRatio); container.appendChild(renderer.domElement);
const onWindowResize = () => {
const width = container.clientWidth; const height = container.clientHeight;
renderer.setSize(width, height);
uniforms.resolution.value.x = renderer.domElement.width; uniforms.resolution.value.y = renderer.domElement.height;
}
onWindowResize(); window.addEventListener("resize", onWindowResize, false);
const animate = () => {
const animationId = requestAnimationFrame(animate);
uniforms.time.value += 0.05; renderer.render(scene, camera);
if (sceneRef.current) sceneRef.current.animationId = animationId;
}
sceneRef.current = { camera, scene, renderer, uniforms, animationId: 0 }; animate();
return () => {
window.removeEventListener("resize", onWindowResize);
if (sceneRef.current) {
cancelAnimationFrame(sceneRef.current.animationId);
if(container && renderer.domElement) container.removeChild(renderer.domElement);
renderer.dispose(); geometry.dispose(); material.dispose();
}
}
}, [])
return
}
// --- 4. SPLINE SCENE ---
const SplineScene = ({ scene, className }) => {
const [isLoaded, setIsLoaded] = useState(false);
useEffect(() => {
const script = document.createElement('script');
script.type = 'module';
script.src = 'https://unpkg.com/@splinetool/viewer@1.0.93/build/spline-viewer.js';
script.onload = () => setIsLoaded(true);
document.head.appendChild(script);
}, []);
return (
);
};
// --- UI HELPERS ---
const Card = React.forwardRef(({ className, ...props }, ref) => (
))
Card.displayName = "Card"
const Spotlight = ({ className, fill }) => {
return (
);
};
// --- MAIN APP ---
export default function App() {
return (
{/* CSS for animations & Spline watermark hiding */}
{/* Global Background Layer */}
{/* HERO: Spline + Spotlight Integration */}
Enterprise Solutions Active
DIGITAL ECOSYSTEMS.
At EmjayAitchco, we merge breathtaking website design with robust systems integration. We don't just build digital storefronts; we architect scalable technological ecosystems that drive your business forward.
Initiate Project
{/* Gradient fade to seamlessly blend Spline into card */}
{/* SHOWCASE: Shader Animation Integration */}
Architected for Scale
Behind every captivating interface is a complex network of data. We specialize in untangling your tech stack—connecting disparate systems, automating complex workflows, and engineering custom APIs that synchronize your operations flawlessly.
SYSTEM SYNC
Data Flow: Optimized
Integrations: Active
Status: Verified
{/* GRID: Feature Highlights */}
{[
{
title: 'Immersive Web Design',
icon: Layers,
desc: 'We craft bespoke, high-performance websites that captivate your audience and convert visitors into loyal clients. Every pixel is optimized for aesthetic brilliance and intuitive UX.'
},
{
title: 'Systems Integration',
icon: Zap,
desc: 'Siloed data is the enemy of growth. We seamlessly connect your CRM, ERP, and third-party platforms into a unified powerhouse, eliminating friction and automating the mundane.'
},
{
title: 'Scalable Architecture',
icon: Cpu,
desc: 'Future-proof your business with modern tech stacks. From complex web applications to headless commerce, we deploy secure, high-speed solutions engineered for tomorrow\'s demands.'
}
].map((item, i) => (
{item.title}
{item.desc}
))}
{/* CTA: Sparkles Integration */}
READY TO EVOLVE?
Stop wrestling with fragmented technology. Partner with EmjayAitchco to build a cohesive, high-performance digital presence that scales with your ambition.
Schedule Consultation
)
}