Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 'Live' badge animation #229

Merged
merged 4 commits into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/components/events/EventBadges/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ const EventBadges = ({ event, attended, className }: EventBadgesProps) => {
return (
<div className={`${styles.badges} ${className || ''}`}>
{!isOrderPickupEvent(event) && ongoing ? (
<div className={`${styles.badge} ${styles.badgeLive}`}>• Live</div>
<div className={`${styles.badge} ${styles.badgeLive}`}>
<span>•</span> Live
</div>
) : null}
{committee ? (
<div className={`${styles.badge} ${styles[`badge${community}`]}`}>
Expand Down
32 changes: 32 additions & 0 deletions src/components/events/EventBadges/style.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,38 @@
background-color: vars.$danger-1;
border-color: vars.$danger-1;
color: #fff;
position: relative;

> span {
animation: pulse 1s ease-in-out infinite alternate;

@keyframes pulse {
0% { opacity: 0 }
100% {opacity: 1 }
}
}

&::before {
animation: pulse2 2s ease-out forwards infinite;
border: 2px solid vars.$danger-1;
border-radius: 5px;
content: '';
position: absolute;

@keyframes pulse2 {
0% {
filter: blur(0);
inset: 0;
opacity: 1;
}

100% {
filter: blur(2px);
inset: -0.75rem;
opacity: 0;
}
}
}
}

&.badgeGeneral {
Expand Down
2 changes: 2 additions & 0 deletions src/components/events/EventBadges/style.module.scss.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ export type Styles = {
badgeLive: string;
badgePoints: string;
badges: string;
pulse: string;
pulse2: string;
};

export type ClassNames = keyof Styles;
Expand Down
1 change: 1 addition & 0 deletions src/styles/pages/Home.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
'progress upcoming'
'attended attended';
grid-template-columns: 28rem 1fr;
grid-template-rows: auto 1fr 1fr auto;
raymosun marked this conversation as resolved.
Show resolved Hide resolved
margin: auto;
max-width: 1920px;

Expand Down
Loading