Merge pull request 'feat: animated gradient for huge zaps' (#28) from big-zaps into main

Reviewed-on: Kieran/stream#28
This commit is contained in:
2023-07-07 09:54:12 +00:00
2 changed files with 22 additions and 1 deletions

View File

@ -226,6 +226,24 @@
color: #FF8D2B; color: #FF8D2B;
} }
.zap-container.big-zap:before {
background: linear-gradient(60deg, #2BD9FF, #8C8DED, #F838D9, #F83838, #FF902B, #DDF838);
animation: animatedgradient 3s ease alternate infinite;
background-size: 300% 300%;
}
@keyframes animatedgradient {
0% {
background-position: 0% 50%;
}
50% {
background-position: 100% 50%;
}
100% {
background-position: 0% 50%;
}
}
.zap-content { .zap-content {
margin-top: 8px; margin-top: 8px;
} }

View File

@ -169,13 +169,16 @@ export function LiveChat({
); );
} }
const BIG_ZAP_THRESHOLD = 100_000;
function ChatZap({ zap }: { zap: ParsedZap }) { function ChatZap({ zap }: { zap: ParsedZap }) {
if (!zap.valid) { if (!zap.valid) {
return null; return null;
} }
const isBig = zap.amount >= BIG_ZAP_THRESHOLD;
return ( return (
<div className="zap-container"> <div className={`zap-container ${isBig ? "big-zap" : ""}`}>
<div className="zap"> <div className="zap">
<Icon name="zap-filled" className="zap-icon" /> <Icon name="zap-filled" className="zap-icon" />
<Profile <Profile