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

Method draw

app/src/utils/tauriStreamCapture.ts:186–242  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

184 const ctx = canvas.getContext('2d')!;
185 let frame = 0;
186 const draw = () => {
187 frame++;
188 ctx.clearRect(0, 0, W, H);
189 const ACCENT = '#6366f1';
190 const BG = '#eef2ff';
191 ctx.fillStyle = BG;
192 ctx.fillRect(0, 0, W, H);
193 const cx = W / 2, cy = H / 2 - 10;
194 for (let i = 0; i < 2; i++) {
195 const phase = (frame / 100 + i * 0.5) % 1;
196 const radius = 70 + phase * 90;
197 const alpha = (1 - phase) * 0.12;
198 ctx.beginPath();
199 ctx.arc(cx, cy, radius, 0, Math.PI * 2);
200 ctx.strokeStyle = `rgba(99, 102, 241, ${alpha})`;
201 ctx.lineWidth = 1.5;
202 ctx.stroke();
203 }
204 ctx.fillStyle = ACCENT;
205 ctx.beginPath();
206 ctx.arc(cx, cy - 38, 28, 0, Math.PI * 2);
207 ctx.fill();
208 const bw = 52, bh = 62, bx = cx - bw / 2, by = cy - 6, r = 14;
209 ctx.beginPath();
210 ctx.moveTo(bx + r, by);
211 ctx.lineTo(bx + bw - r, by);
212 ctx.quadraticCurveTo(bx + bw, by, bx + bw, by + r);
213 ctx.lineTo(bx + bw, by + bh - r);
214 ctx.quadraticCurveTo(bx + bw, by + bh, bx + bw - r, by + bh);
215 ctx.lineTo(bx + r, by + bh);
216 ctx.quadraticCurveTo(bx, by + bh, bx, by + bh - r);
217 ctx.lineTo(bx, by + r);
218 ctx.quadraticCurveTo(bx, by, bx + r, by);
219 ctx.fill();
220 ctx.fillStyle = ACCENT;
221 ctx.font = 'italic 600 13px -apple-system, BlinkMacSystemFont, sans-serif';
222 ctx.textAlign = 'center';
223 ctx.textBaseline = 'middle';
224 ctx.fillText('a person', cx, cy - 105);
225 ctx.strokeStyle = ACCENT;
226 ctx.lineWidth = 1.5;
227 ctx.beginPath();
228 ctx.moveTo(cx, cy - 95);
229 ctx.lineTo(cx, cy - 78);
230 ctx.stroke();
231 ctx.fillStyle = ACCENT;
232 ctx.beginPath();
233 ctx.moveTo(cx, cy - 70);
234 ctx.lineTo(cx - 5, cy - 79);
235 ctx.lineTo(cx + 5, cy - 79);
236 ctx.closePath();
237 ctx.fill();
238 ctx.fillStyle = `rgba(99, 102, 241, 0.45)`;
239 ctx.font = '500 13px -apple-system, BlinkMacSystemFont, sans-serif';
240 ctx.fillText('No camera access', cx, H / 2 + 115);
241 requestAnimationFrame(draw);
242 };
243 requestAnimationFrame(draw);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected