mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-25 11:39:51 +01:00
feat: somethings
This commit is contained in:
1 parent
cd77d24dc6
commit
f4d58015f5
3 files changed
+44
-25
No files matched your search
@@ -0,0 +1,16 @@
|
|||||||
|
import { Flex, Heading } from '@radix-ui/themes';
|
||||||
|
import { HeroStat } from '../../../components/AllStatsOverview/components/HeroStat';
|
||||||
|
import PageWrapper from '../../../components/PageWrapper';
|
||||||
|
|
||||||
|
export default function Page() {
|
||||||
|
return (
|
||||||
|
<PageWrapper>
|
||||||
|
<Flex gap="2">
|
||||||
|
<Heading>TresAbhi</Heading>
|
||||||
|
<Heading color="gray">[OPTML]</Heading>
|
||||||
|
</Flex>
|
||||||
|
|
||||||
|
<HeroStat color="#00b1ff" subtitle="Super Unicum" value={3112} />
|
||||||
|
</PageWrapper>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1,26 +1,13 @@
|
|||||||
import { Locale } from 'discord.js';
|
|
||||||
import { Percentile } from '../../../../constants/percentiles';
|
|
||||||
import { SupplementaryStats } from '../../../../core/blitz/getAccountInfo';
|
|
||||||
import { translator } from '../../../../core/localization/translator';
|
|
||||||
import getWN8Percentile from '../../../../core/statistics/getWN8Percentile';
|
|
||||||
import { theme } from '../../../../stitches.config';
|
import { theme } from '../../../../stitches.config';
|
||||||
import { PERCENTILE_COLORS } from '../../../PercentileIndicator/constants';
|
|
||||||
import { Glow } from './components/Glow';
|
import { Glow } from './components/Glow';
|
||||||
|
|
||||||
export interface WN8DisplayProps {
|
export interface WN8DisplayProps {
|
||||||
stats: SupplementaryStats;
|
subtitle: string;
|
||||||
locale: Locale;
|
color: string;
|
||||||
|
value: string | number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function HeroStat({ stats, locale }: WN8DisplayProps) {
|
export function HeroStat({ color, subtitle, value }: WN8DisplayProps) {
|
||||||
const { translate } = translator(locale);
|
|
||||||
|
|
||||||
const percentile =
|
|
||||||
stats.WN8 === undefined ? Percentile.VeryBad : getWN8Percentile(stats.WN8);
|
|
||||||
const color = PERCENTILE_COLORS[percentile];
|
|
||||||
const heroStat = stats.WN8 === undefined ? '--' : stats.WN8.toFixed(0);
|
|
||||||
const subtitle = translate(`common.wn8_percentile.${percentile}`);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
@@ -29,10 +16,9 @@ export function HeroStat({ stats, locale }: WN8DisplayProps) {
|
|||||||
flexDirection: 'column',
|
flexDirection: 'column',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
justifyContent: 'center',
|
justifyContent: 'center',
|
||||||
gap: -16,
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Glow color={color} />
|
<Glow color={color} style={{ marginBottom: -16 }} />
|
||||||
|
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
@@ -44,7 +30,6 @@ export function HeroStat({ stats, locale }: WN8DisplayProps) {
|
|||||||
flexDirection: 'column',
|
flexDirection: 'column',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
justifyContent: 'center',
|
justifyContent: 'center',
|
||||||
gap: -4,
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
@@ -53,20 +38,22 @@ export function HeroStat({ stats, locale }: WN8DisplayProps) {
|
|||||||
flexDirection: 'column',
|
flexDirection: 'column',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
justifyContent: 'center',
|
justifyContent: 'center',
|
||||||
gap: -4,
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
style={{
|
style={{
|
||||||
|
display: 'block',
|
||||||
fontWeight: 900,
|
fontWeight: 900,
|
||||||
fontSize: 32,
|
fontSize: 32,
|
||||||
color: theme.colors.textHighContrast,
|
color: theme.colors.textHighContrast,
|
||||||
|
lineHeight: '26px',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{heroStat}
|
{value}
|
||||||
</span>
|
</span>
|
||||||
<span
|
<span
|
||||||
style={{
|
style={{
|
||||||
|
display: 'block',
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
color: theme.colors.textHighContrast,
|
color: theme.colors.textHighContrast,
|
||||||
}}
|
}}
|
||||||
@@ -76,7 +63,7 @@ export function HeroStat({ stats, locale }: WN8DisplayProps) {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Glow color={color} direction="reverse" />
|
<Glow color={color} direction="reverse" style={{ marginTop: -16 }} />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,9 @@
|
|||||||
import { Locale } from 'discord.js';
|
import { Locale } from 'discord.js';
|
||||||
|
import { Percentile } from '../../constants/percentiles';
|
||||||
import { SupplementaryStats } from '../../core/blitz/getAccountInfo';
|
import { SupplementaryStats } from '../../core/blitz/getAccountInfo';
|
||||||
import { translator } from '../../core/localization/translator';
|
import { translator } from '../../core/localization/translator';
|
||||||
|
import getWN8Percentile from '../../core/statistics/getWN8Percentile';
|
||||||
|
import { PERCENTILE_COLORS } from '../PercentileIndicator/constants';
|
||||||
import { HeroStat } from './components/HeroStat';
|
import { HeroStat } from './components/HeroStat';
|
||||||
import {
|
import {
|
||||||
WN8SurroundingStat,
|
WN8SurroundingStat,
|
||||||
@@ -27,7 +30,16 @@ export default function AllStatsOverview({
|
|||||||
locale,
|
locale,
|
||||||
supplementaryStats,
|
supplementaryStats,
|
||||||
}: AllStatsOverviewProps) {
|
}: AllStatsOverviewProps) {
|
||||||
const { t } = translator(locale);
|
const { t, translate } = translator(locale);
|
||||||
|
const percentile =
|
||||||
|
supplementaryStats.WN8 === undefined
|
||||||
|
? Percentile.VeryBad
|
||||||
|
: getWN8Percentile(supplementaryStats.WN8);
|
||||||
|
const color = PERCENTILE_COLORS[percentile];
|
||||||
|
const heroStat =
|
||||||
|
supplementaryStats.WN8 === undefined
|
||||||
|
? '--'
|
||||||
|
: supplementaryStats.WN8.toFixed(0);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
@@ -73,7 +85,11 @@ export default function AllStatsOverview({
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<HeroStat locale={locale} stats={supplementaryStats} />
|
<HeroStat
|
||||||
|
value={heroStat}
|
||||||
|
subtitle={translate(`common.wn8_percentile.${percentile}`)}
|
||||||
|
color={color}
|
||||||
|
/>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
|
|||||||
Reference in new issue
Block a user