feat: hero stat

This commit is contained in:
TrèsAbhi committed 2024-03-25 18:00:07 -05:00
1 parent 9717f153cd
commit ebb7618f2d
10 files changed
+238 -43

No files matched your search

@@ -1,7 +1,11 @@
export interface GlowProps {
import { ComponentProps } from 'react';
export interface GlowProps extends ComponentProps<'div'> {
color: string;
direction?: 'default' | 'reverse';
rotation?: number;
startOpacity?: number;
endOpacity?: number;
}
const width = 16;
@@ -10,9 +14,17 @@ export function Glow({
color,
direction = 'default',
rotation = 0,
style,
startOpacity = 0,
endOpacity = 1,
...props
}: GlowProps) {
const color1 = color;
const color2 = `${color}00`;
const color1 = `${color}${Math.round(endOpacity * 255)
.toString(16)
.padStart(2, '0')}`;
const color2 = `${color}${Math.round(startOpacity * 255)
.toString(16)
.padStart(2, '0')}`;
const background = `linear-gradient(${
direction === 'default' ? 0 : 180
}deg, ${color1} 0%, ${color2} 100%)`;
@@ -24,7 +36,9 @@ export function Glow({
alignItems: direction === 'default' ? 'flex-end' : 'flex-start',
justifyContent: 'center',
transform: `rotate(${rotation}deg)`,
...style,
}}
{...props}
>
<div style={{ height: 54, width, background }} />
<div style={{ height: 72, width, background }} />
@@ -1,9 +0,0 @@
import { amber, brown, purple, sandDark, slate } from '@radix-ui/colors';
export const LEAGUE_COLORS = [
purple.purple9,
sandDark.sand11,
amber.amber10,
slate.slate9,
brown.brown9,
];