Skip to content

Commit

Permalink
feat: Add hover animations to 'Join the AsyncAPI Conf in Paris' button
Browse files Browse the repository at this point in the history
  • Loading branch information
Vedant Damedhar committed Jan 10, 2025
1 parent 75491f7 commit 42feaab
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 4 deletions.
8 changes: 5 additions & 3 deletions components/announcement.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import Link from 'next/link';
export default function Announcement() {
return (
<Link href="/venue/Paris">
<div className='cursor-pointer border text-white min-w-[300px] rounded-lg p-1 text-center text-lg'>Join the AsyncAPI Conf in Paris!</div>
<div className="announcement">
<span>Join the AsyncAPI Conf in Paris!</span>
</div>
</Link>
)
}
);
}
73 changes: 72 additions & 1 deletion styles/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -225,4 +225,75 @@ mix-blend-mode: lighten;

.hoverEffect:hover {
transform: scale(1.1); /* Scale the image by 10% on hover */
}
}

.announcement {
background: linear-gradient(to right, #8b5cf6, #ec4899);
color: white;
padding: 0.3rem 0.6rem;
text-align: center;
font-size: 0.9rem;
font-weight: 500;
border-radius: 0.5rem;
cursor: pointer;
transition: all 0.3s ease-in-out;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
transform: scale(1);
max-width: 200px;
margin: 0 auto;
position: relative;
overflow: hidden;
}

.announcement::before {
content: '';
position: absolute;
top: 50%;
left: 50%;
width: 300%;
height: 300%;
background: radial-gradient(circle, rgba(255, 255, 255, 0.3), transparent 70%);
transform: translate(-50%, -50%) scale(0);
transition: transform 0.5s ease-in-out;
pointer-events: none;
}

.announcement:hover {
background: linear-gradient(to right, #ec4899, #8b5cf6);
transform: scale(1.05);
box-shadow: 0 8px 12px rgba(0, 0, 0, 0.2), 0 0 20px rgba(255, 255, 255, 0.5);
}

.announcement:hover::before {
transform: translate(-50%, -50%) scale(1);
}

.announcement span {
display: inline-block;
transition: transform 0.3s ease-in-out;
}

.announcement:hover span {
transform: scale(1.1);
}

@media (min-width: 768px) {
.announcement {
padding: 0.4rem 0.7rem;
max-width: 220px;
}
}

@media (min-width: 1024px) {
.announcement {
padding: 0.5rem 0.8rem;
max-width: 240px;
}
}

@media (min-width: 1280px) {
.announcement {
padding: 0.6rem 1rem;
max-width: 260px;
}
}

0 comments on commit 42feaab

Please sign in to comment.