()
| 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') { |
no test coverage detected