Parallax Floating Demo
fancy/parallax-floating-demoFreeBlock
A block component.
Install it
npx shadcn@latest add https://www.fancycomponents.dev/r/parallax-floating-demo.jsonSource
1"use client"23import { useEffect } from "react"4import { exampleImages } from "@/utils/demo-images"5import { motion, stagger, useAnimate } from "motion/react"67import Floating, {8 FloatingElement,9} from "@/components/fancy/image/parallax-floating"1011const Preview = () => {12 const [scope, animate] = useAnimate()1314 useEffect(() => {15 animate("img", { opacity: [0, 1] }, { duration: 0.5, delay: stagger(0.15) })16 }, [])1718 return (19 <div20 className="flex w-dvw h-dvh justify-center items-center bg-black overflow-hidden"21 ref={scope}22 >23 <motion.div24 className="z-50 text-center space-y-4 items-center flex flex-col"25 initial={{ opacity: 0, y: 10 }}26 animate={{ opacity: 1, y: 0 }}27 transition={{ duration: 0.88, delay: 1.5 }}28 >29 <p className="text-5xl md:text-7xl z-50 text-white font-calendas italic">30 fancy.31 </p>32 <p className="text-xs z-50 hover:scale-110 transition-transform bg-white text-black rounded-full py-2 w-20 cursor-pointer">33 Download34 </p>35 </motion.div>3637 <Floating sensitivity={-1} className="overflow-hidden">38 <FloatingElement depth={0.5} className="top-[8%] left-[11%]">39 <motion.img40 initial={{ opacity: 0 }}41 src={exampleImages[0].url}42 className="w-16 h-16 md:w-24 md:h-24 object-cover hover:scale-105 duration-200 cursor-pointer transition-transform"43 />44 </FloatingElement>45 <FloatingElement depth={1} className="top-[10%] left-[32%]">46 <motion.img47 initial={{ opacity: 0 }}48 src={exampleImages[1].url}49 className="w-20 h-20 md:w-28 md:h-28 object-cover hover:scale-105 duration-200 cursor-pointer transition-transform"50 />51 </FloatingElement>52 <FloatingElement depth={2} className="top-[2%] left-[53%]">53 <motion.img54 initial={{ opacity: 0 }}55 src={exampleImages[2].url}56 className="w-28 h-40 md:w-40 md:h-52 object-cover hover:scale-105 duration-200 cursor-pointer transition-transform"57 />58 </FloatingElement>59 <FloatingElement depth={1} className="top-[0%] left-[83%]">60 <motion.img61 initial={{ opacity: 0 }}62 src={exampleImages[3].url}63 className="w-24 h-24 md:w-32 md:h-32 object-cover hover:scale-105 duration-200 cursor-pointer transition-transform"64 />65 </FloatingElement>6667// … truncated
What it pulls in
npm packages
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 |
