refactor: simplify infinite-moving-cards and redesign agents page layout

- Removed getDirection callback in favor of inline style calculation for cleaner animation control
- Replaced BentoSection and AgentComponents with unified AgentBento component featuring video backgrounds and updated card structure
- Standardized border styling across CallToAction components (gray-700 → gray-800) for consistent visual hierarchy
This commit is contained in:
2025-11-07 23:56:54 +01:00
parent f46482e0f4
commit 61cbaae7e0
15 changed files with 257 additions and 116 deletions

View File

@@ -20,15 +20,6 @@ export const InfiniteMovingCards = ({
const scrollerRef = React.useRef<HTMLUListElement>(null);
const [start, setStart] = useState(false);
const getDirection = useCallback(() => {
if (containerRef.current) {
if (direction === "left") {
containerRef.current.style.setProperty("--animation-direction", "forwards");
} else {
containerRef.current.style.setProperty("--animation-direction", "reverse");
}
}
}, [direction]);
const getSpeed = useCallback(() => {
if (containerRef.current) {
@@ -53,11 +44,10 @@ export const InfiniteMovingCards = ({
}
});
getDirection();
getSpeed();
setStart(true);
}
}, [getDirection, getSpeed]);
}, [getSpeed]);
useEffect(() => {
addAnimation();
@@ -75,6 +65,9 @@ export const InfiniteMovingCards = ({
start && "animate-scroll",
pauseOnHover && "hover:[animation-play-state:paused]",
)}
style={{
"--animation-direction": direction === "left" ? "forwards" : "reverse",
} as React.CSSProperties}
>
{items.map((item, idx) => (
<li className="relative flex-shrink-0" key={idx}>