MCPcopy Create free account
hub / github.com/Roy3838/Observer / draw

Method draw

app/src/utils/browserStreamCapture.ts:42–122  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

40 let frame = 0;
41
42 const draw = () => {
43 frame++;
44 ctx.clearRect(0, 0, W, H);
45
46 const ACCENT = '#6366f1'; // single color for everything
47 const BG = '#eef2ff'; // indigo-50 — tinted to match
48
49 // Background
50 ctx.fillStyle = BG;
51 ctx.fillRect(0, 0, W, H);
52
53 const cx = W / 2, cy = H / 2 - 10;
54
55 // Pulse rings — crisp, same accent at low opacity
56 for (let i = 0; i < 2; i++) {
57 const phase = (frame / 100 + i * 0.5) % 1;
58 const radius = 70 + phase * 90;
59 const alpha = (1 - phase) * 0.12;
60 ctx.beginPath();
61 ctx.arc(cx, cy, radius, 0, Math.PI * 2);
62 ctx.strokeStyle = `rgba(99, 102, 241, ${alpha})`;
63 ctx.lineWidth = 1.5;
64 ctx.stroke();
65 }
66
67 // Person figure — same accent color
68 ctx.fillStyle = ACCENT;
69
70 // Head
71 ctx.beginPath();
72 ctx.arc(cx, cy - 38, 28, 0, Math.PI * 2);
73 ctx.fill();
74
75 // Body
76 const bw = 52, bh = 62, bx = cx - bw / 2, by = cy - 6;
77 const r = 14;
78 ctx.beginPath();
79 ctx.moveTo(bx + r, by);
80 ctx.lineTo(bx + bw - r, by);
81 ctx.quadraticCurveTo(bx + bw, by, bx + bw, by + r);
82 ctx.lineTo(bx + bw, by + bh - r);
83 ctx.quadraticCurveTo(bx + bw, by + bh, bx + bw - r, by + bh);
84 ctx.lineTo(bx + r, by + bh);
85 ctx.quadraticCurveTo(bx, by + bh, bx, by + bh - r);
86 ctx.lineTo(bx, by + r);
87 ctx.quadraticCurveTo(bx, by, bx + r, by);
88 ctx.fill();
89
90 // "a person" label above with arrow pointing down
91 const labelY = cy - 105;
92 ctx.fillStyle = ACCENT;
93 ctx.font = 'italic 600 13px -apple-system, BlinkMacSystemFont, sans-serif';
94 ctx.textAlign = 'center';
95 ctx.textBaseline = 'middle';
96 ctx.fillText('a person', cx, labelY);
97
98 const arrowTipY = cy - 70;
99 ctx.strokeStyle = ACCENT;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected