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

Method draw

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected