Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

feat: [screenpipe] title + geometry-filled button on hover

Louis Beaumontd9e742824c75
diff --git a/apps/screenpipe-app-tauri/components/onboarding/login-gate.tsx b/apps/screenpipe-app-tauri/components/onboarding/login-gate.tsx
index 6b3451a52..45ce23ffd 100644
--- a/apps/screenpipe-app-tauri/components/onboarding/login-gate.tsx
+++ b/apps/screenpipe-app-tauri/components/onboarding/login-gate.tsx
@@ -13,142 +13,230 @@ interface OnboardingLoginProps {
handleNextSlide: () => void;
}
-// ─── geometric background animation ─────────────────────
-function useGeometricCanvas(
- canvasRef: React.RefObject<HTMLCanvasElement | null>,
- width: number,
- height: number
+// ─── background canvas ──────────────────────────────────
+function useBackgroundCanvas(
+ ref: React.RefObject<HTMLCanvasElement | null>,
+ w: number,
+ h: number,
) {
- const animRef = useRef(0);
- const frameRef = useRef(0);
+ const anim = useRef(0);
+ const frame = useRef(0);
useEffect(() => {
- const canvas = canvasRef.current;
- if (!canvas) return;
- const ctx = canvas.getContext("2d");
+ const c = ref.current;
+ if (!c) return;
+ const ctx = c.getContext("2d")!;
if (!ctx) return;
-
const dpr = window.devicePixelRatio || 1;
- canvas.width = width * dpr;
- canvas.height = height * dpr;
+ c.width = w * dpr;
+ c.height = h * dpr;
ctx.scale(dpr, dpr);
+ const cx = w / 2, cy = h / 2;
+
+ const dots: { x: number; y: number; p: number }[] = [];
+ for (let x = 16; x < w; x += 30) for (let y = 16; y < h; y += 30)
+ dots.push({ x, y, p: Math.random() * Math.PI * 2 });
+
+ const sqs = [
+ { s: 55, sp: 0.002, o: 0 },
+ { s: 85, sp: -0.0015, o: Math.PI / 6 },
+ { s: 125, sp: 0.001, o: Math.PI / 4 },
+ { s: 175, sp: -0.0008, o: Math.PI / 3 },
+ ];
+
+ const lines: { a: number; len: number; sp: number }[] = [];
+ for (let i = 0; i < 12; i++)
+ lines.push({ a: (i / 12) * Math.PI * 2, len: 40 + Math.random() * 100, sp: 0.0005 + Math.random() * 0.001 });
- const cx = width / 2;
- const cy = height / 2;
+ function draw() {
+ const f = ++frame.current;
+ ctx.clearRect(0, 0, w, h);
+
+ for (const d of dots) {
+ const wave = Math.sin(f * 0.015 + d.p + Math.hypot(d.x - cx, d.y - cy) * 0.01);
+ const a = 0.04 + wave * 0.03;
+ const sz = 0.5 + wave * 0.3;
+ ctx.fillStyle = `rgba(150,150,150,${Math.max(0, a)})`;
+ ctx.fillRect(d.x - sz / 2, d.y - sz / 2, sz, sz);
+ }
+
+ ctx.lineWidth = 0.5;
+ for (const l of lines) {
+ const ang = l.a + f * l.sp;
+ const r1 = 30 + Math.sin(f * 0.01 + l.a) * 10;
+ ctx.strokeStyle = `rgba(140,140,140,${0.04 + Math.sin(f * 0.02 + l.a * 2) * 0.03})`;
+ ctx.beginPath();
+ ctx.moveTo(cx + Math.cos(ang) * r1, cy + Math.sin(ang) * r1);
+ ctx.lineTo(cx + Math.cos(ang) * (r1 + l.len), cy + Math.sin(ang) * (r1 + l.len));
+ ctx.stroke();
+ }
- // Grid of dots
- const dots: { x: number; y: number; phase: number }[] = [];
- const spacing = 32;
- for (let x = spacing / 2; x < width; x += spacing) {
- for (let y = spacing / 2; y < height; y += spacing) {
- dots.push({ x, y, phase: Math.random() * Math.PI * 2 });
+ ctx.save();
+ ctx.translate(cx, cy);
+ for (const sq of sqs) {
+ const rot = f * sq.sp + sq.o;
+ const sz = sq.s * (1 + Math.sin(f * 0.008 + sq.o) * 0.05);
+ ctx.save();
+ ctx.rotate(rot);
+ ctx.strokeStyle = `rgba(160,160,160,${0.06 + Math.sin(f * 0.01 + sq.o) * 0.02})`;
+ ctx.lineWidth = 0.5;
+ ctx.strokeRect(-sz / 2, -sz / 2, sz, sz);
+ ctx.restore();
}
+ ctx.restore();
+
+ const ga = 0.06 + Math.sin(f * 0.012) * 0.03;
+ const g = ctx.createRadialGradient(cx, cy, 0, cx, cy, 60);
+ g.addColorStop(0, `rgba(180,180,180,${ga})`);
+ g.addColorStop(1, "rgba(0,0,0,0)");
+ ctx.fillStyle = g;
+ ctx.fillRect(cx - 80, cy - 80, 160, 160);
+
+ ctx.fillStyle = "rgba(150,150,150,0.03)";
+ ctx.fillRect(0, (f * 0.3) % (h + 4) - 2, w, 1);
+
+ anim.current = requestAnimationFrame(draw);
}
+ draw();
+ return () => cancelAnimationFrame(anim.current);
+ }, [w, h]);
+}
- // Rotating squares around center
- const squares = [
- { size: 60, speed: 0.002, offset: 0 },
- { size: 90, speed: -0.0015, offset: Math.PI / 6 },
- { size: 130, speed: 0.001, offset: Math.PI / 4 },
- { size: 180, speed: -0.0008, offset: Math.PI / 3 },
- ];
+// ─── button inner canvas (geometry on hover) ─────────────
+function useButtonCanvas(
+ ref: React.RefObject<HTMLCanvasElement | null>,
+ w: number,
+ h: number,
+ hovered: boolean,
+) {
+ const anim = useRef(0);
+ const frame = useRef(0);
+ const intensity = useRef(0);
+
+ useEffect(() => {
+ const c = ref.current;
+ if (!c) return;
+ const ctx = c.getContext("2d")!;
+ if (!ctx) return;
+ const dpr = window.devicePixelRatio || 1;
+ c.width = w * dpr;
+ c.height = h * dpr;
+ ctx.scale(dpr, dpr);
+ }, [w, h]);
+
+ useEffect(() => {
+ const c = ref.current;
+ if (!c) return;
+ const ctx = c.getContext("2d")!;
+ if (!ctx) return;
+ const cx = w / 2, cy = h / 2;
- // Lines that converge to center
- const lines: { angle: number; length: number; speed: number }[] = [];
- for (let i = 0; i < 12; i++) {
- lines.push({
- angle: (i / 12) * Math.PI * 2,
- length: 40 + Math.random() * 100,
- speed: 0.0005 + Math.random() * 0.001,
+ // Particles that live inside the button
+ const particles: { x: number; y: number; vx: number; vy: number; phase: number }[] = [];
+ for (let i = 0; i < 40; i++) {
+ particles.push({
+ x: Math.random() * w,
+ y: Math.random() * h,
+ vx: (Math.random() - 0.5) * 0.8,
+ vy: (Math.random() - 0.5) * 0.8,
+ phase: Math.random() * Math.PI * 2,
});
}
function draw() {
- const f = ++frameRef.current;
- ctx!.clearRect(0, 0, width, height);
-
- // Layer 1: Dot grid — subtle breathing
- for (const dot of dots) {
- const dist = Math.hypot(dot.x - cx, dot.y - cy);
- const wave = Math.sin(f * 0.015 + dot.phase + dist * 0.01);
- const alpha = 0.04 + wave * 0.03;
- const size = 0.5 + wave * 0.3;
- ctx!.fillStyle = `rgba(150,150,150,${Math.max(0, alpha)})`;
- ctx!.fillRect(dot.x - size / 2, dot.y - size / 2, size, size);
+ const f = ++frame.current;
+ const target = hovered ? 1 : 0;
+ intensity.current += (target - intensity.current) * 0.08;
+ const t = intensity.current;
+
+ ctx.clearRect(0, 0, w, h);
+ if (t < 0.01) {
+ anim.current = requestAnimationFrame(draw);
+ return;
}
- // Layer 2: Converging lines
- ctx!.lineWidth = 0.5;
- for (const line of lines) {
- const a = line.angle + f * line.speed;
- const innerR = 30 + Math.sin(f * 0.01 + line.angle) * 10;
- const outerR = innerR + line.length;
- const x1 = cx + Math.cos(a) * innerR;
- const y1 = cy + Math.sin(a) * innerR;
- const x2 = cx + Math.cos(a) * outerR;
- const y2 = cy + Math.sin(a) * outerR;
- const alpha = 0.04 + Math.sin(f * 0.02 + line.angle * 2) * 0.03;
- ctx!.strokeStyle = `rgba(140,140,140,${alpha})`;
- ctx!.beginPath();
- ctx!.moveTo(x1, y1);
- ctx!.lineTo(x2, y2);
- ctx!.stroke();
+ // Move particles
+ for (const p of particles) {
+ p.x += p.vx * (0.5 + t * 2);
+ p.y += p.vy * (0.5 + t * 2);
+ // Wrap
+ if (p.x < 0) p.x = w;
+ if (p.x > w) p.x = 0;
+ if (p.y < 0) p.y = h;
+ if (p.y > h) p.y = 0;
}
- // Layer 3: Rotating squares
- ctx!.save();
- ctx!.translate(cx, cy);
- for (const sq of squares) {
- const rotation = f * sq.speed + sq.offset;
- const breathe = 1 + Math.sin(f * 0.008 + sq.offset) * 0.05;
- const size = sq.size * breathe;
- const alpha = 0.06 + Math.sin(f * 0.01 + sq.offset) * 0.02;
- ctx!.save();
- ctx!.rotate(rotation);
- ctx!.strokeStyle = `rgba(160,160,160,${alpha})`;
- ctx!.lineWidth = 0.5;
- ctx!.strokeRect(-size / 2, -size / 2, size, size);
- ctx!.restore();
+ // Draw connections between nearby particles
+ ctx.lineWidth = 0.5;
+ for (let i = 0; i < particles.length; i++) {
+ for (let j = i + 1; j < particles.length; j++) {
+ const dx = particles[i].x - particles[j].x;
+ const dy = particles[i].y - particles[j].y;
+ const dist = Math.sqrt(dx * dx + dy * dy);
+ if (dist < 50) {
+ const a = (1 - dist / 50) * t * 0.3;
+ // Inverted: when hovered bg is black, lines are white
+ ctx.strokeStyle = `rgba(255,255,255,${a})`;
+ ctx.beginPath();
+ ctx.moveTo(particles[i].x, particles[i].y);
+ ctx.lineTo(particles[j].x, particles[j].y);
+ ctx.stroke();
+ }
+ }
+ }
+
+ // Dots at particle positions
+ for (const p of particles) {
+ const pulse = 0.6 + Math.sin(f * 0.03 + p.phase) * 0.4;
+ const sz = 1 + t * 1.5 * pulse;
+ ctx.fillStyle = `rgba(255,255,255,${t * 0.4 * pulse})`;
+ ctx.fillRect(p.x - sz / 2, p.y - sz / 2, sz, sz);
}
- ctx!.restore();
-
- // Layer 4: Center glow
- const glowAlpha = 0.06 + Math.sin(f * 0.012) * 0.03;
- const grad = ctx!.createRadialGradient(cx, cy, 0, cx, cy, 60);
- grad.addColorStop(0, `rgba(180,180,180,${glowAlpha})`);
- grad.addColorStop(1, "rgba(0,0,0,0)");
- ctx!.fillStyle = grad;
- ctx!.fillRect(cx - 80, cy - 80, 160, 160);
-
- // Layer 5: Scan line
- const scanY = (f * 0.3) % (height + 4) - 2;
- ctx!.fillStyle = "rgba(150,150,150,0.03)";
- ctx!.fillRect(0, scanY, width, 1);
-
- animRef.current = requestAnimationFrame(draw);
- }
+ // Small rotating squares in center
+ ctx.save();
+ ctx.translate(cx, cy);
+ for (let i = 0; i < 2; i++) {
+ const sz = 8 + i * 8;
+ const rot = f * (0.01 + i * 0.005) * (i % 2 === 0 ? 1 : -1);
+ ctx.save();
+ ctx.rotate(rot);
+ ctx.strokeStyle = `rgba(255,255,255,${t * 0.15})`;
+ ctx.lineWidth = 0.5;
+ ctx.strokeRect(-sz / 2, -sz / 2, sz, sz);
+ ctx.restore();
+ }
+ ctx.restore();
+
+ // Scan line across button
+ const scanX = (f * 0.8) % (w + 4) - 2;
+ ctx.fillStyle = `rgba(255,255,255,${t * 0.06})`;
+ ctx.fillRect(scanX, 0, 1, h);
+
+ anim.current = requestAnimationFrame(draw);
+ }
draw();
- return () => cancelAnimationFrame(animRef.current);
- }, [width, height]);
+ return () => cancelAnimationFrame(anim.current);
+ }, [w, h, hovered]);
}
+// ─── component ───────────────────────────────────────────
const OnboardingLogin: React.FC<OnboardingLoginProps> = ({ handleNextSlide }) => {
const { settings } = useSettings();
const hasAdvanced = useRef(false);
const [showSkip, setShowSkip] = useState(false);
const [isHovered, setIsHovered] = useState(false);
- const canvasRef = useRef<HTMLCanvasElement>(null);
+ const bgRef = useRef<HTMLCanvasElement>(null);
+ const btnRef = useRef<HTMLCanvasElement>(null);
- useGeometricCanvas(canvasRef, 500, 480);
+ useBackgroundCanvas(bgRef, 500, 480);
+ useButtonCanvas(btnRef, 200, 52, isHovered);
- // Show skip after 8 seconds
useEffect(() => {
const timer = setTimeout(() => setShowSkip(true), 8000);
return () => clearTimeout(timer);
}, []);
- // Auto-advance when user logs in
useEffect(() => {
if (settings.user?.token && !hasAdvanced.current) {
hasAdvanced.current = true;
@@ -171,26 +259,37 @@ const OnboardingLogin: React.FC<OnboardingLoginProps> = ({ handleNextSlide }) =>
return (
<div className="w-full flex flex-col items-center justify-center min-h-[400px] relative">
- {/* Geometric background */}
<canvas
- ref={canvasRef}
+ ref={bgRef}
className="absolute inset-0 pointer-events-none"
style={{ width: 500, height: 480 }}
/>
- {/* Content */}
<motion.div
className="relative z-10 flex flex-col items-center"
initial={{ opacity: 0 }}
animate={{ opacity: 1 }}
transition={{ duration: 0.6, delay: 0.2 }}
>
+ {/* Title: [screenpipe] */}
+ <motion.h1
+ className="text-2xl font-bold tracking-tight text-foreground mb-2"
+ style={{ fontFamily: "var(--font-sans), 'Space Grotesk', system-ui, sans-serif" }}
+ initial={{ opacity: 0, y: -8 }}
+ animate={{ opacity: 1, y: 0 }}
+ transition={{ duration: 0.5, delay: 0.3 }}
+ >
+ <span className="text-foreground/30 font-light">[</span>
+ screenpipe
+ <span className="text-foreground/30 font-light">]</span>
+ </motion.h1>
+
{/* Tagline */}
<motion.p
- className="font-mono text-[10px] tracking-[0.3em] uppercase text-muted-foreground/60 mb-8"
- initial={{ opacity: 0, y: -5 }}
- animate={{ opacity: 1, y: 0 }}
- transition={{ duration: 0.5, delay: 0.4 }}
+ className="font-mono text-[10px] tracking-[0.3em] uppercase text-muted-foreground/50 mb-10"
+ initial={{ opacity: 0 }}
+ animate={{ opacity: 1 }}
+ transition={{ duration: 0.5, delay: 0.5 }}
>
24/7 memory for your desktop
</motion.p>
@@ -207,41 +306,49 @@ const OnboardingLogin: React.FC<OnboardingLoginProps> = ({ handleNextSlide }) =>
</motion.div>
) : (
<>
- {/* Sign in button — line-style, sharp, brand-correct */}
+ {/* Button with internal geometry canvas */}
<motion.button
onClick={handleLogin}
onMouseEnter={() => setIsHovered(true)}
onMouseLeave={() => setIsHovered(false)}
- className="relative group px-12 py-4 border border-foreground/80 transition-all duration-150 hover:bg-foreground hover:text-background"
+ className="relative overflow-hidden border border-foreground/70 bg-transparent hover:bg-foreground transition-colors duration-150 group"
initial={{ opacity: 0, y: 10 }}
animate={{ opacity: 1, y: 0 }}
- transition={{ duration: 0.4, delay: 0.6 }}
- whileTap={{ scale: 0.98 }}
+ transition={{ duration: 0.4, delay: 0.7 }}
+ whileTap={{ scale: 0.97 }}
+ style={{ width: 200, height: 52 }}
>
- <span className="font-mono text-sm tracking-[0.2em] uppercase font-medium">
- Sign in
+ {/* Geometry canvas inside button */}
+ <canvas
+ ref={btnRef}
+ className="absolute inset-0 pointer-events-none"
+ style={{ width: 200, height: 52 }}
+ />
+
+ {/* Text */}
+ <span className="relative z-10 font-mono text-sm tracking-[0.25em] uppercase font-medium text-foreground group-hover:text-background transition-colors duration-150">
+ sign in
</span>
- {/* Corner accents */}
- <span className="absolute top-0 left-0 w-2 h-2 border-t border-l border-foreground/40 group-hover:border-background/40 transition-colors duration-150" />
- <span className="absolute top-0 right-0 w-2 h-2 border-t border-r border-foreground/40 group-hover:border-background/40 transition-colors duration-150" />
- <span className="absolute bottom-0 left-0 w-2 h-2 border-b border-l border-foreground/40 group-hover:border-background/40 transition-colors duration-150" />
- <span className="absolute bottom-0 right-0 w-2 h-2 border-b border-r border-foreground/40 group-hover:border-background/40 transition-colors duration-150" />
+ {/* Corner marks */}
+ <span className="absolute top-0 left-0 w-2.5 h-2.5 border-t border-l border-foreground/30 group-hover:border-background/30 transition-colors duration-150" />
+ <span className="absolute top-0 right-0 w-2.5 h-2.5 border-t border-r border-foreground/30 group-hover:border-background/30 transition-colors duration-150" />
+ <span className="absolute bottom-0 left-0 w-2.5 h-2.5 border-b border-l border-foreground/30 group-hover:border-background/30 transition-colors duration-150" />
+ <span className="absolute bottom-0 right-0 w-2.5 h-2.5 border-b border-r border-foreground/30 group-hover:border-background/30 transition-colors duration-150" />
</motion.button>
- {/* Single benefit line */}
+ {/* Benefit */}
<motion.p
- className="font-mono text-[10px] text-muted-foreground/50 mt-6 tracking-wide"
+ className="font-mono text-[10px] text-muted-foreground/40 mt-6 tracking-wide"
initial={{ opacity: 0 }}
animate={{ opacity: 1 }}
- transition={{ duration: 0.5, delay: 0.9 }}
+ transition={{ duration: 0.5, delay: 1.0 }}
>
free access to claude haiku ai assistant
</motion.p>
</>
)}
- {/* Skip — tiny, delayed, subtle */}
<AnimatePresence>
{showSkip && !isLoggedIn && (
<motion.button
@@ -249,7 +356,7 @@ const OnboardingLogin: React.FC<OnboardingLoginProps> = ({ handleNextSlide }) =>
animate={{ opacity: 1 }}
transition={{ duration: 2 }}
onClick={handleSkip}
- className="font-mono text-[9px] text-muted-foreground/30 hover:text-muted-foreground/50 transition-colors mt-8 tracking-wide"
+ className="font-mono text-[9px] text-muted-foreground/25 hover:text-muted-foreground/45 transition-colors mt-8 tracking-wide"
>
skip
</motion.button>