bar-wave-animation
pixel-perfect/bar-wave-animationFreeBlock
Bar Wave Animation component.
Install it
npx shadcn@latest add https://www.pixel-perfect.space/r/bar-wave-animation.jsonSource
1"use client";23import { motion } from "framer-motion";4import { useState } from "react";56const TOTAL = 15;78const BarWaveAnimation = () => {9 const [hovered, setHovered] = useState<number | null>(null);1011 return (12 <svg13 className=" dark:invert-100 invert-0 cursor-pointer w-full h-full m-10"14 viewBox="0 0 350 130"15 overflow={"visible"}16 >17 <g transform="rotate(180, 175, 65)">18 {Array.from({ length: TOTAL }).map((_, i) => {19 const baseHeight = 41.5199;20 const distance = hovered === null ? Infinity : Math.abs(hovered - i);21 const influence = Math.max(0, 1 - distance * 0.25);22 const height = baseHeight + influence * 150;23 const opacity = hovered === null ? 1 : 0.2 + influence * 0.8;2425 return (26 <motion.rect27 key={i}28 animate={{ height, filter: `brightness(${opacity})` }}29 transition={{30 type: "spring",31 stiffness: 200,32 damping: 20,33 }}34 onHoverStart={() => setHovered(i)}35 onHoverEnd={() => setHovered(null)}36 x={0.4 + i * 15}37 y={0.75 + i * -15}38 width="183.071"39 height={baseHeight}40 rx="6.5"41 transform="matrix(0.866025 0.5 0 1 0.0580127 -2.88838)"42 fill="#171717"43 stroke="#626262"44 />45 );46 })}47 </g>48 </svg>49 );50};5152export default BarWaveAnimation;
What it pulls in
npm packages
Files it writes
More from pixel-perfect
All 60 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| 3d-button3d-button | pixel-perfect | Blocks | Unverified | 2 deps | |
| abhinav-bento-buttonabhinav-bento-button | pixel-perfect | Blocks | Unverified | no deps | |
| accordion-carouselaccordion-carousel | pixel-perfect | Blocks | Free | 1 dep | |
| accordion-foldaccordion-fold | pixel-perfect | Blocks | Free | 1 dep | |
| activity-wheel-motionactivity-wheel-motion | pixel-perfect | Blocks | Free | 2 deps | |
| animated-textureanimated-texture | pixel-perfect | Blocks | Free | 1 dep | |
| aperture-mask-revealaperture-mask-reveal | pixel-perfect | Blocks | Free | 1 dep | |
| aurora-curtainaurora-curtain | pixel-perfect | Blocks | Free | no deps |
