MCPcopy Create free account
hub / github.com/DavidHDev/react-bits / updateLoop

Function updateLoop

src/tailwind/TextAnimations/FallingText/FallingText.jsx:137–146  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

135 Render.run(render);
136
137 const updateLoop = () => {
138 wordBodies.forEach(({ body, elem }) => {
139 const { x, y } = body.position;
140 elem.style.left = `${x}px`;
141 elem.style.top = `${y}px`;
142 elem.style.transform = `translate(-50%, -50%) rotate(${body.angle}rad)`;
143 });
144 Matter.Engine.update(engine);
145 requestAnimationFrame(updateLoop);
146 };
147 updateLoop();
148
149 return () => {

Callers 1

FallingTextFunction · 0.70

Calls 1

updateMethod · 0.45

Tested by

no test coverage detected