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

Function refreshMoving

packages/shared/src/components/shell/ReadingDrawer.tsx:377–408  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

375 echoes.push(echo);
376 };
377 const refreshMoving = () => {
378 const next = [...flowParts(page), headElement];
379 if (
380 next.length === moving.length &&
381 next.every((element, index) => element === moving[index])
382 ) {
383 return;
384 }
385 moving
386 .filter((element) => !next.includes(element))
387 .forEach((element) =>
388 applyStyle(element, {
389 transform: null,
390 transition: null,
391 'will-change': null,
392 }),
393 );
394 const added = next.filter((element) => !moving.includes(element));
395 moving = next;
396 if (!shown.transform) {
397 added.forEach((element) => applyStyle(element, shown));
398 return;
399 }
400 added.forEach((element) =>
401 applyStyle(element, { ...shown, transition: 'none' }),
402 );
403 headElement.getBoundingClientRect();
404 added.forEach((element) => {
405 applyStyle(element, { transition: shown.transition ?? null });
406 followHead(element);
407 });
408 };
409 refreshMoving();
410 const isStanding = (node: Node) =>
411 node instanceof Element &&

Callers 3

ReadingDrawerFunction · 0.85
glideToFunction · 0.85
onTouchStartFunction · 0.85

Calls 3

flowPartsFunction · 0.90
applyStyleFunction · 0.85
followHeadFunction · 0.85

Tested by

no test coverage detected