MCPcopy Create free account
hub / github.com/dailydotdev/apps / moveLens

Function moveLens

packages/shared/src/components/shell/ShellCluster.tsx:305–322  ·  view source on GitHub ↗
(target: number)

Source from the content-addressed store, hash-verified

303 };
304
305 const moveLens = (target: number) => {
306 if (!lens.current) {
307 const pill = pillRef.current;
308 const start =
309 pill && typeof DOMMatrixReadOnly !== 'undefined'
310 ? new DOMMatrixReadOnly(getComputedStyle(pill).transform).e
311 : target;
312 lens.current = {
313 target,
314 pos: start,
315 vel: 0,
316 frame: 0,
317 last: performance.now(),
318 };
319 lens.current.frame = requestAnimationFrame(stepLens);
320 }
321 lens.current.target = target;
322 };
323
324 // The lens lets go: it settles onto the chosen tab on the light spring.
325 const settleLens = (index: number) => {

Callers 1

onPointerMoveFunction · 0.85

Calls 1

nowMethod · 0.80

Tested by

no test coverage detected