Installation
npx kinetic-ui-cli@latest add interactive-pipelineMechanics
This component uses Framer Motion's useScroll and useTransform hooks.
- Scroll Tracking:
useScrollcreates aMotionValue(scrollYProgress) ranging from0to1as the target container passes through the viewport. - Path Tracing: We map
scrollYProgressdirectly to thescaleYCSS transform of an absolutely positioned vertical div to create the glowing pipe line. - Milestone Activation: Each milestone node has a hardcoded
yPositionthreshold. We useuseTransformto convert the globalscrollYProgressinto boolean activation flags. When the line crosses the node's threshold, it triggers opacity, scale, and color spring animations.
Usage Guide
1. Import the Component
Import the component into your React or Next.js page:
import { InteractivePipeline } from "@/components/creative/interactive-pipeline";
2. Implementation Example
Render the component and customize its behavior by passing props:
import { InteractivePipeline } from "@/components/creative/interactive-pipeline";
export default function Example() {
return (
<div className="w-full flex items-center justify-center p-8">
<InteractivePipeline
/>
</div>
);
}