Marquee Along Svg Path Mapping Demo
fancy/marquee-along-svg-path-mapping-demoFreeBlock
A block component.
Install it
npx shadcn@latest add https://www.fancycomponents.dev/r/marquee-along-svg-path-mapping-demo.jsonSource
1import MarqueeAlongSvgPath from "@/components/fancy/blocks/marquee-along-svg-path"23function generateSpiralPath(turns = 5, centerX = 500, centerY = 137) {4 const points = []5 const numPoints = turns * 300 // number of points to create smooth spiral6 const spacing = 18 // controls how far apart the spiral arms are78 for (let i = 0; i < numPoints; i++) {9 const angle = (i / numPoints) * turns * 2 * Math.PI10 const radius = spacing * angle // radius increases with angle11 const x = centerX + radius * Math.cos(angle)12 const y = centerY + radius * Math.sin(angle)13 points.push(`${i === 0 ? "M" : "L"} ${x} ${y}`)14 }1516 return points.join(" ")17}1819const path = generateSpiralPath(4)2021export default function MarqueeAlongSvgPathDemo() {22 return (23 <div className="w-dvw h-dvh bg-zinc-50 flex items-center justify-center">24 <h2 className="text-black text-6xl sm:text-8xl z-10">fancy</h2>25 <MarqueeAlongSvgPath26 path={path}27 viewBox="0 0 400 474"28 baseVelocity={1}29 showPath={false}30 slowdownOnHover={true}31 repeat={8}32 enableRollingZIndex={false}33 dragSensitivity={0.01}34 className="absolute w-full h-full transform-3d will-change-transform"35 responsive36 cssVariableInterpolation={[37 { property: "opacity", from: 0, to: 1.5 },38 { property: "scale", from: 0.1, to: 1 },39 ]}40 grabCursor41 >42 {imgs.map((img, i) => (43 <a44 href={img.link}45 target="_blank"46 rel="noopener noreferrer"47 className="pointer-events-auto"48 >49 <div50 key={i}51 className="w-14 h-full cursor-pointer hover:rotate-y-0 duration-300 ease-in-out hover:scale-200 will-change-transform"52 >53 <img54 src={img.src}55 alt={`Example ${i}`}56 className="w-full h-full object-cover"57 draggable={false}58 />59 </div>60 </a>61 ))}62 </MarqueeAlongSvgPath>63 </div>64 )65}6667// EXAMPLE IMAGES68const imgs = [69 {70 src: "https://cdn.cosmos.so/b9909337-7a53-48bc-9672-33fbd0f040a1?format=jpeg",71 link: "https://www.instagram.com/p/DCOl6YTS85e/?igsh=MXNvdHhyczl1djJ6ZA%3D%3D",72 },73 {74 src: "https://cdn.cosmos.so/ecdc9dd7-2862-4c28-abb1-dcc0947390f3?format=jpeg",75 link: "https://www.instagram.com/p/C4RTJvVpP4R/?igsh=MWZwOTNlYTVodGszMw%3D%3D",76 },77 {78// … truncated
What it pulls in
Other registry items
Files it writes
More from fancy
All 158 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Animated Gradient Demoanimated-gradient-demo | fancy | Blocks | Free | no deps | |
| Basic Number Ticker Demobasic-number-ticker-demo | fancy | Blocks | Free | no deps | |
| Box Carousel Autoplay Demobox-carousel-autoplay-demo | fancy | Blocks | Free | 1 dep | |
| Box Carousel Demobox-carousel-demo | fancy | Blocks | Free | 1 dep | |
| Box Carousel Video Demobox-carousel-video-demo | fancy | Blocks | Free | 1 dep | |
| Breathing Text Demobreathing-text-demo | fancy | Blocks | Free | no deps | |
| Circling Elements Democircling-elements-demo | fancy | Blocks | Free | no deps | |
| Circling Elements Easing Democircling-elements-easing-demo | fancy | Blocks | Free | no deps |
