Skip to content

Commit

Permalink
Update Projects.tsx
Browse files Browse the repository at this point in the history
Enhancements:
Shake Range Increased: The shake range has been increased to x: ["0%", "-15%", "15%", "0%"] for a more pronounced effect.
Smooth Easing with easeInOut: The transition now uses easeInOut, making the shake start and end gently.
Scale Up on Hover: Added a subtle scale: 1.05 to the card during hover, making the effect a bit more dynamic and visually engaging.
Longer Shake Duration: The duration of the shake has been increased to 0.6 seconds for a more graceful animation.
Soft Rounded Corners: The design of the cards is kept smooth and polished with rounded corners and a box-shadow effect to enhance visual appeal.
  • Loading branch information
aniruddhaadak80 authored Nov 9, 2024
1 parent 08754f9 commit ea8242f
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/components/Projects.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,15 @@ const Projects: React.FC = () => {
className="bg-gray-100 rounded-lg overflow-hidden shadow-lg transition-transform duration-300 hover:scale-105"
onClick={() => setSelectedProject(project.id)}
whileHover={{
x: ["0%", "-10%", "10%", "0%"], // Shaking effect on X axis
transition: { type: "spring", stiffness: 100, damping: 10 }
x: ["0%", "-15%", "15%", "0%"], // Increased shake range
scale: 1.05, // Slight scale up for emphasis
transition: {
type: "spring",
stiffness: 100,
damping: 20,
duration: 0.6, // Smoother and longer shake
ease: "easeInOut" // Smooth easing for better effect
}
}}
whileTap={{ scale: 0.95 }}
>
Expand Down

0 comments on commit ea8242f

Please sign in to comment.