Skip to content

Commit

Permalink
Add 'Live' badge animation
Browse files Browse the repository at this point in the history
  • Loading branch information
raymosun committed Apr 13, 2024
1 parent 03e88bf commit 874d0b2
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 1 deletion.
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;
margin: auto;
max-width: 1920px;

Expand Down

0 comments on commit 874d0b2

Please sign in to comment.