MCPcopy Create free account
hub / github.com/code100x/cms / addAnimation

Function addAnimation

src/components/ui/infinite-moving-cards.tsx:29–44  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

27 }, []);
28 const [start, setStart] = useState(false);
29 function addAnimation() {
30 if (containerRef.current && scrollerRef.current) {
31 const scrollerContent = Array.from(scrollerRef.current.children);
32
33 scrollerContent.forEach((item) => {
34 const duplicatedItem = item.cloneNode(true);
35 if (scrollerRef.current) {
36 scrollerRef.current.appendChild(duplicatedItem);
37 }
38 });
39
40 getDirection();
41 getSpeed();
42 setStart(true);
43 }
44 }
45 const getDirection = () => {
46 if (containerRef.current) {
47 if (direction === 'left') {

Callers 1

InfiniteMovingCardsFunction · 0.85

Calls 2

getDirectionFunction · 0.85
getSpeedFunction · 0.85

Tested by

no test coverage detected