Spaces:
Build error
Build error
Upload components/LabNotes.jsx with huggingface_hub
Browse files- components/LabNotes.jsx +133 -0
components/LabNotes.jsx
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { useEffect, useRef, useState } from 'react';
|
| 2 |
+
import { gsap } from 'gsap';
|
| 3 |
+
import { ScrollTrigger } from 'gsap/dist/ScrollTrigger';
|
| 4 |
+
import { BookOpen, Clock, ArrowRight, Sparkles, Target, Lightbulb, TrendingUp } from 'lucide-react';
|
| 5 |
+
|
| 6 |
+
gsap.registerPlugin(ScrollTrigger);
|
| 7 |
+
|
| 8 |
+
const articles = [
|
| 9 |
+
{
|
| 10 |
+
id: 1,
|
| 11 |
+
title: 'The Sub-Millisecond API: Architecture Patterns for Extreme Performance',
|
| 12 |
+
excerpt: 'How we achieved 0.3ms p99 latency in a distributed system handling 10M RPS. Lessons from rethinking every layer of the stack.',
|
| 13 |
+
readTime: '12 min',
|
| 14 |
+
category: 'Architecture',
|
| 15 |
+
featured: true,
|
| 16 |
+
insights: ['Edge caching strategies', 'Protocol buffers optimization', 'Kernel bypass networking'],
|
| 17 |
+
},
|
| 18 |
+
{
|
| 19 |
+
id: 2,
|
| 20 |
+
title: 'Quantum-Resistant Cryptography: A Practical Migration Guide',
|
| 21 |
+
excerpt: 'NIST has finalized post-quantum algorithms. Here is how to migrate your existing PKI infrastructure without downtime.',
|
| 22 |
+
readTime: '8 min',
|
| 23 |
+
category: 'Security',
|
| 24 |
+
featured: false,
|
| 25 |
+
insights: ['CRYSTALS-Kyber implementation', 'Hybrid key exchange', 'Certificate lifecycle'],
|
| 26 |
+
},
|
| 27 |
+
{
|
| 28 |
+
id: 3,
|
| 29 |
+
title: 'The Hidden Cost of JavaScript: Memory Profiling Deep Dive',
|
| 30 |
+
excerpt: 'V8 internals exposed. Understanding hidden classes, shape transitions, and why your "simple" function allocates 2MB.',
|
| 31 |
+
readTime: '15 min',
|
| 32 |
+
category: 'Performance',
|
| 33 |
+
featured: false,
|
| 34 |
+
insights: ['V8 heap snapshots', 'Hidden class optimization', 'Memory leak patterns'],
|
| 35 |
+
},
|
| 36 |
+
{
|
| 37 |
+
id: 4,
|
| 38 |
+
title: 'Building Unstoppable Systems: Chaos Engineering in Production',
|
| 39 |
+
excerpt: 'Netflix taught us to embrace failure. Here is the playbook for designing systems that thrive under extreme conditions.',
|
| 40 |
+
readTime: '10 min',
|
| 41 |
+
category: 'Reliability',
|
| 42 |
+
featured: false,
|
| 43 |
+
insights: ['Game day exercises', 'Fault injection', 'Circuit breaker patterns'],
|
| 44 |
+
},
|
| 45 |
+
{
|
| 46 |
+
id: 5,
|
| 47 |
+
title: 'The Compiler You Did Not Know You Had: SQL Query Planning',
|
| 48 |
+
excerpt: 'PostgreSQL query planner demystified. How to read EXPLAIN ANALYZE output like a database engineer.',
|
| 49 |
+
readTime: '11 min',
|
| 50 |
+
category: 'Database',
|
| 51 |
+
featured: false,
|
| 52 |
+
insights: ['Cost-based optimization', 'Index selection', 'Join strategies'],
|
| 53 |
+
},
|
| 54 |
+
{
|
| 55 |
+
id: 6,
|
| 56 |
+
title: 'WebAssembly at Scale: Lessons from Figma and Shopify',
|
| 57 |
+
excerpt: 'When to WASM, when to stay native. Real-world performance data from production deployments.',
|
| 58 |
+
readTime: '9 min',
|
| 59 |
+
category: 'WebAssembly',
|
| 60 |
+
featured: false,
|
| 61 |
+
insights: ['WASM vs JS benchmarks', 'Module loading', 'Memory management'],
|
| 62 |
+
},
|
| 63 |
+
];
|
| 64 |
+
|
| 65 |
+
export default function LabNotes() {
|
| 66 |
+
const sectionRef = useRef(null);
|
| 67 |
+
const [activeFilter, setActiveFilter] = useState('All');
|
| 68 |
+
const [hoveredCard, setHoveredCard] = useState(null);
|
| 69 |
+
|
| 70 |
+
const categories = ['All', ...new Set(articles.map(a => a.category))];
|
| 71 |
+
const filteredArticles = activeFilter === 'All'
|
| 72 |
+
? articles
|
| 73 |
+
: articles.filter(a => a.category === activeFilter);
|
| 74 |
+
|
| 75 |
+
useEffect(() => {
|
| 76 |
+
const ctx = gsap.context(() => {
|
| 77 |
+
gsap.from('.lab-note-card', {
|
| 78 |
+
scrollTrigger: {
|
| 79 |
+
trigger: '#lab-notes',
|
| 80 |
+
start: 'top 80%',
|
| 81 |
+
},
|
| 82 |
+
y: 50,
|
| 83 |
+
opacity: 0,
|
| 84 |
+
duration: 0.6,
|
| 85 |
+
stagger: 0.1,
|
| 86 |
+
ease: 'power2.out'
|
| 87 |
+
});
|
| 88 |
+
}, sectionRef);
|
| 89 |
+
|
| 90 |
+
return () => ctx.revert();
|
| 91 |
+
}, [filteredArticles]);
|
| 92 |
+
|
| 93 |
+
return (
|
| 94 |
+
<section id="lab-notes" ref={sectionRef} className="py-24 relative bg-iron-900/50">
|
| 95 |
+
{/* Background Pattern */}
|
| 96 |
+
<div className="absolute inset-0 grid-pattern opacity-30" />
|
| 97 |
+
|
| 98 |
+
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 relative z-10">
|
| 99 |
+
{/* Section Header */}
|
| 100 |
+
<div className="flex flex-col lg:flex-row lg:items-end lg:justify-between mb-12 gap-6">
|
| 101 |
+
<div>
|
| 102 |
+
<div className="inline-flex items-center gap-2 px-4 py-2 rounded-full bg-iron-800/80 border border-iron-600/50 mb-6">
|
| 103 |
+
<BookOpen className="w-4 h-4 text-magma-500" />
|
| 104 |
+
<span className="font-mono text-sm text-iron-300">LAB NOTES // KNOWLEDGE_BASE</span>
|
| 105 |
+
</div>
|
| 106 |
+
<h2 className="text-4xl sm:text-5xl font-bold mb-4">
|
| 107 |
+
<span className="text-iron-100">Deep Dives & </span>
|
| 108 |
+
<span className="text-gradient">Field Reports</span>
|
| 109 |
+
</h2>
|
| 110 |
+
<p className="max-w-xl text-iron-400 font-mono">
|
| 111 |
+
Extended analysis from the trenches of production systems.
|
| 112 |
+
Theory meets battle-tested implementation.
|
| 113 |
+
</p>
|
| 114 |
+
</div>
|
| 115 |
+
|
| 116 |
+
{/* Filter Tabs */}
|
| 117 |
+
<div className="flex flex-wrap gap-2">
|
| 118 |
+
{categories.map(cat => (
|
| 119 |
+
<button
|
| 120 |
+
key={cat}
|
| 121 |
+
onClick={() => setActiveFilter(cat)}
|
| 122 |
+
className={`px-4 py-2 rounded-lg font-mono text-sm transition-all ${activeFilter === cat ? 'bg-electric-500 text-iron-900' : 'bg-iron-800 text-iron-300 hover:bg-iron-700'}`}
|
| 123 |
+
>
|
| 124 |
+
{cat}
|
| 125 |
+
</button>
|
| 126 |
+
))}
|
| 127 |
+
</div>
|
| 128 |
+
</div>
|
| 129 |
+
|
| 130 |
+
{/* Featured Article */}
|
| 131 |
+
{filteredArticles.find(a => a.featured) && (
|
| 132 |
+
<div className="mb-8 p-8 rounded-2xl bg-gradient-to-br from-iron-800 to-iron-900 border border-iron-600/50 relative overflow-hidden group">
|
| 133 |
+
<
|