Skip to content

Commit

Permalink
Rule offTwo
Browse files Browse the repository at this point in the history
  • Loading branch information
barchakuz committed May 12, 2024
1 parent ae6c502 commit 9a7e1b6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
9 changes: 5 additions & 4 deletions app/components/ui/3d-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,7 @@ export const CardItem = ({
const ref = useRef<HTMLDivElement>(null);
const [isMouseEntered] = useMouseEnter();

useEffect(() => {
handleAnimations();
}, [isMouseEntered]);


const handleAnimations = () => {
if (!ref.current) return;
if (isMouseEntered) {
Expand All @@ -133,6 +130,10 @@ export const CardItem = ({
ref.current.style.transform = `translateX(0px) translateY(0px) translateZ(0px) rotateX(0deg) rotateY(0deg) rotateZ(0deg)`;
}
};

useEffect(() => {
handleAnimations();
}, [isMouseEntered, handleAnimations]); // Include handleAnimations in the dependency array

return (
<Tag
Expand Down
5 changes: 4 additions & 1 deletion app/components/ui/infinite-moving-cards.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const InfiniteMovingCards = ({

useEffect(() => {
addAnimation();
}, []);
}, [addAnimation]);
const [start, setStart] = useState(false);
function addAnimation() {
if (containerRef.current && scrollerRef.current) {
Expand All @@ -44,6 +44,9 @@ export const InfiniteMovingCards = ({
setStart(true);
}
}



const getDirection = () => {
if (containerRef.current) {
if (direction === "left") {
Expand Down

0 comments on commit 9a7e1b6

Please sign in to comment.