<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>DesignSync | Unified Review Platform</title>
<!-- Tailwind CSS -->
<script src="https://cdn.tailwindcss.com"></script>
<!-- Google Fonts -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Space+Grotesk:wght@500;700&display=swap" rel="stylesheet">
<!-- GSAP -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.2/gsap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.2/ScrollTrigger.min.js"></script>
<!-- Lenis -->
<script src="https://cdn.jsdelivr.net/gh/studio-freight/lenis@1.0.29/bundled/lenis.min.js"></script>
<!-- Three.js -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js"></script>
<script>
tailwind.config = {
theme: {
extend: {
fontFamily: {
sans: ['Inter', 'sans-serif'],
display: ['Space Grotesk', 'sans-serif'],
},
colors: {
brand: {
blue: '#3b82f6',
glow: 'rgba(59, 130, 246, 0.5)',
dark: '#0a0a0a',
surface: '#121212',
'surface-light': '#1E1E1E',
border: 'rgba(255, 255, 255, 0.08)'
}
},
backgroundImage: {
'gradient-radial': 'radial-gradient(var(--tw-gradient-stops))',
}
}
}
}
</script>
<style>
:root {
--accent-glow: 59, 130, 246; /* RGB for blue */
}
body {
background-color: #050505; /* Very dark */
color: #ffffff;
overflow-x: hidden;
-webkit-font-smoothing: antialiased;
}
/* Noise grain overlay */
.noise-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
pointer-events: none;
z-index: 9998;
opacity: 0.05;
background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}
/* Glassmorphism utilities */
.glass-panel {
background: rgba(20, 20, 20, 0.6);
backdrop-filter: blur(16px);
-webkit-backdrop-filter: blur(16px);
border: 1px solid rgba(255, 255, 255, 0.08);
box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}
.card-surface {
transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
box-shadow 0.4s ease,
border-color 0.4s ease;
will-change: transform;
}
.card-surface:hover {
border-color: rgba(59, 130, 246, 0.4);
transform: translateY(-5px) scale(1.01);
box-shadow: 0 20px 40px -10px rgba(0,0,0,0.5),
0 0 20px -5px rgba(59, 130, 246, 0.3);
}
/* Magnetic Button Effect */
.magnetic-btn {
transition: transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
/* Custom scrollbar hidden */
html.lenis {
height: auto;
}
.lenis.lenis-smooth {
scroll-behavior: auto;
}
.lenis.lenis-smooth [data-lenis-prevent] {
overscroll-behavior: contain;
}
.lenis.lenis-stopped {
overflow: hidden;
}
/* Syntax Highlight Colors */
.diff-add { color: #4ade80; background: rgba(74, 222, 128, 0.1); }
.diff-remove { color: #f87171; background: rgba(248, 113, 113, 0.1); }
.diff-context { color: #9ca3af; }
/* Loader */
#loader {
position: fixed;
top: 0; left: 0; width: 100%; height: 100%;
background: #000;
z-index: 10000;
display: flex;
justify-content: center;
align-items: center;
transition: opacity 0.8s ease;
}
.loader-text {
font-family: 'Space Grotesk', sans-serif;
font-size: 2rem;
letter-spacing: 0.2em;
text-transform: uppercase;
background: linear-gradient(90deg, #fff, #3b82f6);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
</style>
</head>
<body class="selection:bg-brand-blue selection:text-white">
<!-- Noise Texture -->
<div class="noise-overlay"></div>
<!-- Loader -->
<div id="loader">
<div class="loader-text">DesignSync</div>
</div>
<!-- 3D Background Container -->
<canvas id="bg-canvas" class="fixed top-0 left-0 w-full h-full -z-10"></canvas>
<!-- Main Content -->
<main id="smooth-wrapper" class="relative z-10">
<div id="smooth-content" class="overflow-x-hidden">
<!-- Navigation -->
<nav class="fixed top-0 w-full z-50 glass-panel border-b-0 border-white/5">
<div class="max-w-7xl mx-auto px-6 lg:px-8">
<div class="flex items-center justify-between h-20">
<div class="flex items-center gap-2">
<div class="w-8 h-8 rounded bg-gradient-to-br from-brand-blue to-purple-600 flex items-center justify-center">
<span class="font-display font-bold text-white">S</span>
</div>
<span class="font-display text-xl font-bold tracking-tight">DesignSync</span>
</div>
<div class="hidden md:flex items-center space-x-8">
<a href="#" class="text-sm font-medium text-gray-300 hover:text-white transition-colors">Dashboard</a>
<a href="#" class="text-sm font-medium text-gray-300 hover:text-white transition-colors">Components</a>
<a href="#" class="text-sm font-medium text-gray-300 hover:text-white transition-colors">Workflows</a>
<a href="#" class="text-sm font-medium text-gray-300 hover:text-white transition-colors">Audit Trail</a>
</div>
<div class="flex items-center gap-4">
<button class="magnetic-btn px-4 py-2 text-xs font-semibold text-white border border-white/20 rounded-full hover:bg-white/5 transition-colors">
Integrations
</button>
<div class="w-8 h-8 rounded-full bg-gradient-to-r from-emerald-400 to-cyan-400"></div>
</div>
</div>
</div>
</nav>
<!-- Hero Section -->
<section class="pt-32 pb-20 px-6 lg:px-8 max-w-7xl mx-auto">
<div class="grid grid-cols-1 lg:grid-cols-12 gap-12 items-end">
<div class="lg:col-span-8 space-y-6">
<div class="inline-flex items-center gap-2 px-3 py-1 rounded-full border border-brand-blue/30 bg-brand-blue/10 backdrop-blur-sm">
<span class="w-2 h-2 rounded-full bg-brand-blue animate-pulse"></span>
<span class="text-xs font-medium text-brand-blue">v2.0 Platform Live</span>
</div>
<h1 class="text-5xl md:text-7xl font-display font-bold leading-[0.9] tracking-tight">
Design <br>
<span class="text-transparent bg-clip-text bg-gradient-to-r from-gray-100 to-gray-500">without friction.</span>
</h1>
<p class="text-lg md:text-xl text-gray-400 max-w-2xl leading-relaxed">
Unify Figma prototypes, Storybook components, and Git diffs into a single source of truth.
Capture approvals asynchronously and maintain immutable audit trails.
</p>
<div class="pt-4 flex gap-4">
<button class="magnetic-btn group px-8 py-4 bg-white text-black font-semibold rounded-full shadow-[0_0_20px_rgba(255,255,255,0.3)] hover:shadow-[0_0_30px_rgba(255,255,255,0.5)] transition-all">
Start Review
<svg class="w-4 h-4 inline-block ml-2 group-hover:translate-x-1 transition-transform" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M14 5l7 7m0 0l-7 7m7-7H3"></path></svg>
</button>
<button class="magnetic-btn px-8 py-4 border border-white/20 rounded-full hover:bg-white/5 transition-colors">
View Demo
</button>
</div>
</div>
<!-- Bento Card Previews (Floating visual) -->
<div class="lg:col-span-4 hidden lg:block">
<div class="relative w-full aspect-[3/4]">
<div class="card-surface absolute inset-0 glass-panel rounded-2xl p-6 transform rotate-3 origin-bottom-left overflow-hidden flex flex-col gap-4">
<div class="flex justify-between items-center">
<span class="text-xs font-mono text-brand-blue">FIGMA_LINK</span>
<span class="w-2 h-2 rounded-full bg-green-500"></span>
</div>
<div class="flex-1 bg-white/5 rounded-xl flex items-center justify-center">
<span class="text-sm text-gray-500">Preview Area</span>
</div>
<div class="h-20 bg-white/5 rounded-xl"></div>
</div>
<div class="card-surface absolute inset-0 glass-panel rounded-2xl p-6 transform -rotate-3 origin-top-right overflow-hidden flex flex-col gap-4">
<div class="flex justify-between items-center">
<span class="text-xs font-mono text-brand-blue">STORYBOOK_IFRAME</span>
<div class="flex gap-1">
<div class="w-2 h-2 rounded-full bg-blue-500"></div>
<div class="w-2 h-2 rounded-full bg-yellow-500"></div>
<div class="w-2 h-2 rounded-full bg-red-500"></div>
</div>
</div>
<div class="flex-1 bg-white/5 rounded-xl flex items-center justify-center">
<span class="text-sm text-gray-500">Interactive Component</span>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- Main Dashboard Grid -->
<section class="pb-32 px-6 lg:px-8 max-w-7xl mx-auto">
<div class="flex justify-between items-end mb-12">
<div>
<h2 class="text-3xl font-display font-bold mb-2">Active Reviews</h2>
<p class="text-gray-400">Five components awaiting approval this sprint.</p>
</div>
<div class="flex gap-2">
<button class="px-3 py-1 text-sm rounded-md bg-white/5 border border-white/10">All</button>
<button class="px-3 py-1 text-sm rounded-md hover:bg-white/5 text-gray-400">In Progress</button>
<button class="px-3 py-1 text-sm rounded-md hover:bg-white/5 text-gray-400">Changes Requested</button>
</div>
</div>
<!-- Bento Grid -->
<div class="grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-6" id="card-grid">
<!-- Cards will be injected by JS for cleaner code structure, but we can hardcode the first few as a seed -->
</div>
</section>
</div>
</main>
<!-- Full Screen Overlay for Detail View -->
<div id="detail-overlay" class="fixed inset-0 z-[100] bg-[#0a0a0a] hidden opacity-0">
<!-- Close Button -->
<button id="close-detail" class="absolute top-6 right-6 z-50 p-2 rounded-full hover:bg-white/10 transition-colors">
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path></svg>
</button>
<div class="grid grid-cols-1 lg:grid-cols-12 h-full">
<!-- Left: Preview Area (Figma + Storybook Tabs) -->
<div class="lg:col-span-7 h-full border-r border-white/10 flex flex-col bg-brand-surface">
<div class="flex items-center justify-between px-6 py-4 border-b border-white/5">
<div class="flex items-center gap-3">
<img src="https://picsum.photos/seed/figma/40/40" alt="Icon" class="w-6 h-6 rounded opacity-80">
<span class="font-display font-medium" id="detail-title">Button Component</span>
</div>
<div class="flex gap-2">
<span class="px-2 py-1 text-xs rounded bg-gray-800 text-gray-300 font-mono border border-white/10">Button.tsx</span>
</div>
</div>
<!-- Tabs -->
<div class="flex px-6 py-2 gap-6 border-b border-white/5">
<button class="pb-2 text-sm font-medium text-brand-blue border-b-2 border-brand-blue">Storybook</button>
<button class="pb-2 text-sm font-medium text-gray-500 hover:text-white">Figma Design</button>
</div>
<!-- Preview Content (Simulated) -->
<div class="flex-1 relative bg-[#0a0a0a] flex items-center justify-center p-8 overflow-hidden">
<div class="w-full max-w-xl aspect-video bg-white rounded-lg shadow-2xl flex items-center justify-center relative transform transition-transform duration-500 ease-out">
<!-- Simulated Component -->
<div class="flex flex-col items-center gap-4">
<div class="w-48 h-12 bg-gradient-to-r from-blue-500 to-indigo-600 rounded-md shadow-lg flex items-center justify-center text-white font-medium">
Primary Action
</div>
<div class="flex gap-2">
<div class="px-4 py-2 border border-gray-300 rounded text-gray-700 font-medium">Secondary</div>
<div class="px-4 py-2 border border-gray-300 rounded text-gray-700 font-medium">Ghost</div>
</div>
</div>
</div>
</div>
</div>
<!-- Right: Control Panel (Git Diff + Audit Trail) -->
<div class="lg:col-span-5 h-full flex flex-col bg-[#0a0a0a]">
<!-- Git Diff Section -->
<div class="flex-1 min-h-[40%] border-b border-white/10 flex flex-col p-6 overflow-y-auto">
<div class="flex justify-between items-center mb-4">
<h3 class="text-sm font-bold uppercase tracking-wider text-gray-400">Latest Changes</h3>
<span class="text-xs text-gray-500 font-mono" id="diff-commit-id">feat: add loading state</span>
</div>
<div class="font-mono text-sm leading-relaxed space-y-1">
<div class="flex">
<span class="w-8 text-center text-gray-600 select-none">12</span>
<span class="diff-context">export interface ButtonProps {</span>
</div>
<div class="flex">
<span class="w-8 text-center text-gray-600 select-none">13</span>
<span class="diff-context"> children: React.ReactNode;</span>
</div>
<div class="flex bg-green-900/20">
<span class="w-8 text-center text-gray-600 select-none">14</span>
<span class="diff-add">+ isLoading?: boolean;</span>
</div>
<div class="flex">
<span class="w-8 text-center text-gray-600 select-none">15</span>
<span class="diff-context">}</span>
</div>
<div class="flex">
<span class="w-8 text-center text-gray-600 select-none">16</span>
<span class="diff-context"> </span>
</div>
<div class="flex">
<span class="w-8 text-center text-gray-600 select-none">17</span>
<span class="diff-context">const Button = ({ children, isLoading }) => {</span>
</div>
<div class="flex bg-red-900/20">
<span class="w-8 text-center text-gray-600 select-none">18</span>
<span class="diff-remove">- return <button className="btn">{children}</button>;</span>
</div>
<div class="flex bg-green-900/20">
<span class="w-8 text-center text-gray-600 select-none">19</span>
<span class="diff-add">+ return (</span>
</div>
<div class="flex bg-green-900/20 pl-4">
<span class="w-8 text-center text-gray-600 select-none"></span>
<span class="diff-add">+ <button className="btn" disabled={isLoading}></span>
</div>
<div class="flex bg-green-900/20 pl-4">
<span class="w-8 text-center text-gray-600 select-none"></span>
<span class="diff-add">+ {isLoading ? 'Loading...' : children}</span>
</div>
<div class="flex bg-green-900/20">
<span class="w-8 text-center text-gray-600 select-none">20</span>
<span class="diff-add">+ </button></span>
</div>
<div class="flex bg-green-900/20">
<span class="w-8 text-center text-gray-600 select-none"></span>
<span class="diff-add">+ );</span>
</div>
</div>
</div>
<!-- Approvals / Async Queue -->
<div class="flex-1 flex flex-col p-6 overflow-y-auto relative">
<div class="flex justify-between items-center mb-6">
<h3 class="text-sm font-bold uppercase tracking-wider text-gray-400">Async Approvals</h3>
<span class="text-xs text-brand-blue cursor-pointer hover:underline">Request review</span>
</div>
<!-- Approver List -->
<div class="space-y-4 mb-8" id="approver-list">
<!-- Item 1: Approved -->
<div class="flex items-start gap-3 p-3 rounded-lg bg-white/5 border border-white/5">
<div class="relative">
<img src="https://i.pravatar.cc/150?img=1" class="w-10 h-10 rounded-full ring-2 ring-green-500/30">
<div class="absolute -bottom-1 -right-1 w-4 h-4 bg-green-500 rounded-full border-2 border-[#0a0a0a]"></div>
</div>
<div class="flex-1">
<div class="flex justify-between">
<h4 class="text-sm font-semibold">Sarah Connor</h4>
<span class="text-xs text-gray-500">2h ago</span>
</div>
<p class="text-xs text-gray-400 mt-1">Looks good to me. The loading state is clear.</p>
</div>
</div>
<!-- Item 2: Pending -->
<div class="flex items-start gap-3 p-3 rounded-lg bg-white/5 border border-white/5 animate-pulse-slow">
<div class="relative">
<div class="w-10 h-10 rounded-full ring-2 ring-gray-600/30 bg-gray-600 flex items-center justify-center text-gray-300 text-xs font-bold">?</div>
</div>
<div class="flex-1 opacity-60">
<div class="flex justify-between">
<h4 class="text-sm font-semibold">John Doe</h4>
<span class="text-xs text-gray-500">–</span>
</div>
<div class="h-2 w-32 bg-gray-700/50 rounded mt-2"></div>
</div>
</div>
<!-- Item 3: Action Block -->
<div class="flex items-start gap-3 p-3 rounded-lg bg-brand-blue/10 border border-brand-blue/20">
<div class="w-10 h-10 rounded-full bg-gray-700 flex items-center justify-center text-gray-300 text-sm">+</div>
<div class="flex-1">
<input type="text" placeholder="Add comment..." class="w-full bg-transparent border-b border-white/20 mb-2 py-1 text-sm focus:outline-none focus:border-brand-blue text-white">
<div class="flex justify-end">
<button class="magnetic-btn bg-brand-blue text-white text-xs px-3 py-1.5 rounded-full shadow-lg shadow-brand-blue/20 hover:bg-blue-600 transition-colors">
Approve
</button>
</div>
</div>
</div>
</div>
<!-- Audit Trail Section -->
<div class="mt-auto border-t border-white/10 pt-6">
<h4 class="text-xs font-bold text-gray-500 uppercase mb-4">Audit Trail</h4>
<ul class="space-y-3 text-xs font-mono text-gray-400">
<li class="flex items-center gap-2">
<span class="w-1.5 h-1.5 bg-green-500 rounded-full"></span>
<span>Deploy to production - <span class="text-gray-200">10d ago</span></span>
</li>
<li class="flex items-center gap-2">
<span class="w-1.5 h-1.5 bg-blue-500 rounded-full"></span>
<span>Figma update merged - <span class="text-gray-200">2d ago</span></span>
</li>
<li class="flex items-center gap-2">
<span class="w-1.5 h-5 bg-gray-700 vertical-border"></span> <!-- fake variance -->
<span>Review requested - <span class="text-gray-200">3d ago</span></span>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
<!-- Logic -->
<script>
// --- 1. Loader ---
window.addEventListener('load', () => {
const loader = document.getElementById('loader');
gsap.to(loader, {
opacity: 0,
duration: 0.8,
onComplete: () => {
loader.style.display = 'none';
initAnimations(); // Start GSAP after load
}
});
});
// --- 2. Three.js Background (Organic Particles) ---
const initThreeJS = () => {
const canvas = document.getElementById('bg-canvas');
const scene = new THREE.Scene();
const camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000);
camera.position.z = 30;
const renderer = new THREE.WebGLRenderer({ canvas, alpha: true, antialias: true });
renderer.setSize(window.innerWidth, window.innerHeight);
renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));
// Particles
const geometry = new THREE.BufferGeometry();
const count = 1500;
const positions = new Float32Array(count * 3);
const sizes = new Float32Array(count);
for(let i = 0; i < count; i++) {
positions[i*3] = (Math.random() - 0.5) * 80;
positions[i*3+1] = (Math.random() - 0.5) * 80;
positions[i*3+2] = (Math.random() - 0.5) * 80;
sizes[i] = Math.random() * 2;
}
geometry.setAttribute('position', new THREE.BufferAttribute(positions, 3));
geometry.setAttribute('size', new THREE.BufferAttribute(sizes, 1));
// Material - custom shader for soft glow
const material = new THREE.PointsMaterial({
color: 0x3b82f6,
size: 0.5,
transparent: true,
opacity: 0.6,
sizeAttenuation: true,
blending: THREE.AdditiveBlending
});
// Custom shader alternative for richer look
const vertexShader = `
attribute float size;
varying float vAlpha;
void main() {
vAlpha = 1.0 - (position.z + 50.0) / 100.0;
gl_PointSize = size * (300.0 / -mvPosition.z);
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
}
`;
const fragmentShader = `
varying float vAlpha;
void main() {
float r = distance(gl_PointCoord, vec2(0.5));
if (r > 0.5) discard;
vec3 glow = vec3(0.3, 0.6, 1.0); // Blue glow
gl_FragColor = vec4(glow, vAlpha * 0.8);
}
`;
const shaderMaterial = new THREE.ShaderMaterial({
uniforms: {},
vertexShader: vertexShader,
fragmentShader: fragmentShader,
blending: THREE.AdditiveBlending,
depthTest: false,
transparent: true,
vertexColors: false
});
const particles = new THREE.Points(geometry, shaderMaterial);
scene.add(particles);
// Mouse interaction
let mouseX = 0, mouseY = 0;
document.addEventListener('mousemove', (e) => {
mouseX = (e.clientX - window.innerWidth/2) / 50;
mouseY = (e.clientY - window.innerHeight/2) / 50;
});
// animate
const animate = () => {
requestAnimationFrame(animate);
const time = Date.now() * 0.0005;
particles.rotation.x += 0.0005;
particles.rotation.y += 0.0008;
// Move based on mouse (parallax)
particles.rotation.x += mouseY * 0.00001;
particles.rotation.y += mouseX * 0.00001;
// Wave motion for particles
const posAttribute = geometry.attributes.position;
for(let i = 0; i < count; i++) {
const x = posAttribute.getX(i);
const y = posAttribute.getY(i);
// Subtle undulation
// posAttribute.setZ(i, (Math.sin(x * 0.1 + time) * 2) + (Math.cos(y * 0.1 + time) * 2));
}
posAttribute.needsUpdate = true;
renderer.render(scene, camera);
};
animate();
// Resize
window.addEventListener('resize', () => {
camera.aspect = window.innerWidth / window.innerHeight;
camera.updateProjectionMatrix();
renderer.setSize(window.innerWidth, window.innerHeight);
});
};
// --- 3. Mock Data & Card Generation ---
const reviews = [
{ id: 1, title: 'Button Primary', status: 'approved', figma: 'Figma/Buttons/Primary', storybook: 'Button/Playground', diff: 'feat: add loading state', author: 'Sarah Connor', img: 'https://picsum.photos/seed/btn1/400/300' },
{ id: 2, title: 'Navigation Bar', status: 'changes', figma: 'Layout/Header', storybook: 'Navbar/Full', diff: 'fix: mobile menu overflow', author: 'Mike Ross', img: 'https://picsum.photos/seed/nav2/400/300' },
{ id: 3, title: 'Login Form', status: 'pending', figma: 'Auth/Login', storybook: 'Form/Login', diff: 'refactor: validate email', author: 'Rachel Green', img: 'https://picsum.photos/seed/form3/400/300' },
{ id: 4, title: 'Data Table', status: 'pending', figma: 'Data/Table', storybook: 'Table/Basic', diff: 'style: sticky header', author: 'Harvey Specter', img: 'https://picsum.photos/seed/table4/400/300' },
{ id: 5, title: 'Modal Dialog', status: 'approved', figma: 'Overlay/Modal', storybook: 'Modal/Standard', diff: 'feat: add close on escape', author: 'Jessica Pearson', img: 'https://picsum.photos/seed/modal5/400/300' },
{ id: 6, title: 'Profile Card', status: 'pending', figma: 'Components/Card', storybook: 'Card/Patient', diff: 'new: avatar upload', author: 'Louis Litt', img: 'https://picsum.photos/seed/card6/400/300' },
];
const grid = document.getElementById('card-grid');
const renderCards = () => {
grid.innerHTML = reviews.map((r, idx) => {
// Status badges
let badge, badgeStyle;
if(r.status === 'approved') { badge = 'Approved'; badgeStyle = 'bg-green-500/10 text-green-500 border-green-500/20'; }
else if(r.status === 'changes') { badge = 'Changes'; badgeStyle = 'bg-red-500/10 text-red-500 border-red-500/20'; }
else { badge = 'Pending'; badgeStyle = 'bg-yellow-500/10 text-yellow-500 border-yellow-500/20'; }
return `
<div class="card-surface glass-panel rounded-2xl overflow-hidden flex flex-col cursor-pointer group group" onclick="openDetail(${r.id})">
<!-- Card Header -->
<div class="p-5 border-b border-white/5 flex justify-between items-start">
<div>
<h3 class="font-display font-semibold text-lg group-hover:text-brand-blue transition-colors">${r.title}</h3>
<p class="text-xs text-gray-500 mt-1 font-mono">${r.figma}</p>
</div>
<span class="px-2 py-1 text-[10px] uppercase font-bold tracking-wider rounded border ${badgeStyle}">${badge}</span>
</div>
<!-- Card Preview Image (Figma snapshot style) -->
<div class="h-40 overflow-hidden relative bg-black/20">
<div class="absolute inset-0 bg-gradient-to-t from-black/60 to-transparent opacity-0 group-hover:opacity-100 transition-opacity z-10 flex items-end p-4">
<span class="text-xs font-bold text-white bg-brand-blue px-2 py-1 rounded">View Details</span>
</div>
<img src="${r.img}" class="w-full h-full object-cover transform group-hover:scale-110 transition-transform duration-700 ease-out" alt="${r.title}">
</div>
<!-- Card Body: Stats -->
<div class="p-5 flex-1 flex flex-col justify-between">
<div class="space-y-2">
<div class="flex items-center gap-2 text-xs text-gray-400 font-mono">
<svg class="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"></path></svg>
Last commit: 2d ago
</div>
<div class="flex items-center gap-2 text-xs text-gray-400 font-mono">
<svg class="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4"></path></svg>
<span>${r.diff}</span>
</div>
</div>
<!-- Approvers Avatars -->
<div class="flex items-center mt-4">
<div class="flex -space-x-2">
<!-- We'll randomize avatars for variety in a real app -->
<img class="w-6 h-6 rounded-full border border-[#0a0a0a]" src="https://i.pravatar.cc/150?img=5" alt="">
<img class="w-6 h-6 rounded-full border border-[#0a0a0a]" src="https://i.pravatar.cc/150?img=8" alt="">
<img class="w-6 h-6 rounded-full border border-[#0a0a0a] bg-gray-600 flex items-center justify-center text-[10px]">+2
</div>
<button class="ml-auto text-xs text-brand-blue font-medium hover:underline">Review</button>
</div>
</div>
</div>
`;
}).join('');
};
renderCards();
// --- 4. Lenis + Smooth Scroll ---
const lenis = new Lenis({
duration: 1.2,
easing: (t) => Math.min(1, 1.001 - Math.pow(2, -10 * t)),
direction: 'vertical',
gestureDirection: 'vertical',
smooth: true,
mouseMultiplier: 1,
smoothTouch: false,
touchMultiplier: 2,
});
function raf(time) {
lenis.raf(time);
requestAnimationFrame(raf);
}
requestAnimationFrame(raf);
// --- 5. GSAP Animations ---
gsap.registerPlugin(ScrollTrigger);
function initAnimations() {
// Animate Grid Items Stagger
gsap.from('.card-surface', {
scrollTrigger: {
trigger: '#card-grid',
start: 'top 80%',
},
y: 50,
opacity: 0,
duration: 0.8,
stagger: 0.1,
ease: 'power3.out'
});
// Hero text animation
gsap.from('section h1', {
y: 50,
opacity: 0,
duration: 1,
ease: 'power3.out',
delay: 0.2
});
gsap.from('section p', {
y: 30,
opacity: 0,
duration: 1,
ease: 'power3.out',
delay: 0.4
});
}
// --- 6. Detail View Interactions ---
const overlay = document.getElementById('detail-overlay');
const closeBtn = document.getElementById('close-detail');
window.openDetail = (id) => {
const review = reviews.find(r => r.id === id);
if(!review) return;
// Update content (simplified)
document.getElementById('detail-title').textContent = review.title;
document.getElementById('diff-commit-id').textContent = review.diff;
// Show overlay
overlay.classList.remove('hidden');
// Reset opacity for transition
gsap.set(overlay, { opacity: 0 });
// Animate in
gsap.to(overlay, {
opacity: 1,
duration: 0.4,
ease: 'power2.out'
});
// Stop Lenis scrolling behind overlay
lenis.stop();
};
closeBtn.addEventListener('click', () => {
gsap.to(overlay, {
opacity: 0,
duration: 0.3,
onComplete: () => {
overlay.classList.add('hidden');
lenis.start();
}
});
});
// Escape key closes
document.addEventListener('keydown', (e) => {
if (e.key === 'Escape' && !overlay.classList.contains('hidden')) {
closeBtn.click();
}
});
// Initialize ThreeJS after page load
initThreeJS();
</script>
</body>
</html>