From 4cb3fd2128aa869cf237225f85d7ad569b5f18e1 Mon Sep 17 00:00:00 2001 From: sk1982 Date: Thu, 14 Mar 2024 21:22:17 -0400 Subject: [PATCH] chuni: change badge/rating font --- .../fonts/HelveticaNowDisplay-ExtraBold.woff2 | Bin 0 -> 8896 bytes src/app/font.scss | 14 ++++++-- src/app/layout.tsx | 1 + src/components/chuni/music-list.tsx | 10 ++---- src/components/chuni/music-playlog.tsx | 21 +++++------- src/components/chuni/playlog-card.tsx | 9 +++-- src/components/chuni/rating.tsx | 2 +- src/components/chuni/score-badge.tsx | 31 ++++++++++++++++-- 8 files changed, 58 insertions(+), 30 deletions(-) create mode 100644 public/assets/fonts/HelveticaNowDisplay-ExtraBold.woff2 diff --git a/public/assets/fonts/HelveticaNowDisplay-ExtraBold.woff2 b/public/assets/fonts/HelveticaNowDisplay-ExtraBold.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..353ed45192ae4c4793c0e50fbfaa07f875b1966a GIT binary patch literal 8896 zcmV;xB0t@CPew8T0RR9103yHu4gdfE083Z^03vGu0RR9100000000000000000000 z0000QP8+#i9E3y$U;s1`2nxw0wqgM`0we>3A`5~P00bZfgJK6D8w)^12V&42fS6yF zf<;j#Ie!cOza)2vWnW<&f+4bllu;@YC7DceXHY1-sTs~%Z>3*PWH%N|+o3WN90?ui zV8T6k_dbk%*2O;jp|JF!#bQTCXzY_*f?$m{yLT_*n1`Zfk><%mu|)DjC1jHlsGR>f z?cZ~+CCf!?dA+V%UhVDU6qE@HOK?z7aASdCu+mnB=eOA-jKpbUVK$P&ND1YuC|IZ< z^gt9as#fNrZo`$!bQ|3Dc2VUbz0j3vijH8=yOcUixwrY|%r7Z3u(ekq{cr5WotKba zz`nuewzU?4a?L5Howv>U!|A#w{i5$KW?j>+7-PyPTV)t%9m+Hf)`m2JBxFOun&jk2 za^xF0TFSdnVJdZnRds#~;GbxlKaEo;ghUb7fB*^t|4(PxYN8{W;BnAF?Ds-lDr}QB zuOEGRtR4NGNNWc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~q#4pMnYn%Xrk{nvD(hXc6jHQ)+wg5DHrLES0%b z4LACg!~|b|FrnlbMl9aTKUBP;fp_qrq7}0}xHpuj2!$k*6hb2e!Y2s?Th_)7uX>;H zy?_mYU*Zj=UnCnzpYt-}VNG=K2#US^5P^HFPa7aXAg~Ak)VYH|r3-)?02U#0K8mow zcM;3Su1AEqz(u4y>e0^Q`iFGV`eJFRX;@%<3uDZPQL|bcGOA-_(W;&j#x4UHHLW^o z&sfQ&4z)@T3u8#pj0zH zQc`Oy%r?m|WF!jDJ5&G~Cj`04uu_mbzM3&(cxGC5 O9n2sJ%j@8(A7cP%4 + diff --git a/src/components/chuni/music-list.tsx b/src/components/chuni/music-list.tsx index 9591af8..1d7aa4f 100644 --- a/src/components/chuni/music-list.tsx +++ b/src/components/chuni/music-list.tsx @@ -9,7 +9,7 @@ import { worldsEndStars } from '@/helpers/chuni/worlds-end-stars'; import { ChuniDifficultyContainer } from '@/components/chuni/difficulty-container'; import { getJacketUrl } from '@/helpers/assets'; import { ChuniLevelBadge } from '@/components/chuni/level-badge'; -import { ChuniScoreBadge, getVariantFromLamp, getVariantFromRank } from '@/components/chuni/score-badge'; +import { ChuniScoreBadge, ChuniLampSuccessBadge, getVariantFromLamp, getVariantFromRank, ChuniLampComboBadge } from '@/components/chuni/score-badge'; import { ChuniRating } from '@/components/chuni/rating'; import Link from 'next/link'; import { Squares2X2Icon } from '@heroicons/react/24/outline'; @@ -103,9 +103,7 @@ const MusicGrid = ({ music, size }: ChuniMusicListProps & { size: 'sm' | 'lg' })
{size === 'lg' &&
- {item.isSuccess ? - {CHUNI_LAMPS.get(item.isSuccess)} - : null} + {item.isSuccess ? : null}
}
@@ -115,9 +113,7 @@ const MusicGrid = ({ music, size }: ChuniMusicListProps & { size: 'sm' | 'lg' })
- {(item.isFullCombo || item.isAllJustice) ? - {item.isAllJustice ? 'All Justice' : 'Full Combo'} - : null} +
return (
{difficulties.map((data, i) => { + const rank = CHUNI_SCORE_RANKS[data.scoreRank!]; const badges = [ - !!data.scoreRank && - {CHUNI_SCORE_RANKS[data.scoreRank]} + !!data.scoreRank && + {rank.endsWith('+') ? <> + {rank.slice(0, -1)} +
+
+ : rank}
, - !!data.isSuccess && - {CHUNI_LAMPS.get(data.isSuccess)} - , - !!data.isFullCombo && !data.isAllJustice && - Full Combo - , - !!data.isAllJustice && - All Justice - , + data.isSuccess ? : null, + ].filter(x => x); const toggleExpanded = () => expanded[i] && setExpanded(e => diff --git a/src/components/chuni/playlog-card.tsx b/src/components/chuni/playlog-card.tsx index dfa3181..eae540b 100644 --- a/src/components/chuni/playlog-card.tsx +++ b/src/components/chuni/playlog-card.tsx @@ -2,7 +2,7 @@ import { getPlaylog } from '@/actions/chuni/playlog'; import { getJacketUrl } from '@/helpers/assets'; import Link from 'next/link'; import { ChuniRating } from '@/components/chuni/rating'; -import { ChuniScoreBadge, getVariantFromRank } from '@/components/chuni/score-badge'; +import { ChuniScoreBadge, ChuniLampSuccessBadge, getVariantFromRank, ChuniLampComboBadge } from '@/components/chuni/score-badge'; import { ChuniLevelBadge } from '@/components/chuni/level-badge'; import { ChuniDifficultyContainer } from '@/components/chuni/difficulty-container'; import { formatJst } from '@/helpers/format-jst'; @@ -56,10 +56,9 @@ export const ChuniPlaylogCard = ({ playlog, className }: ChuniPlaylogCardProps) {playlog.score?.toLocaleString()} - {!!playlog.isClear && Clear} - {!!playlog.isAllJustice && All Justice} - {!!playlog.isFullCombo && !playlog.isAllJustice && Full Combo} - {!!playlog.isNewRecord && New Record} + {!!playlog.isClear && } + + {!!playlog.isNewRecord && NEW RECORD}
Justice Critical: { playlog.judgeHeaven }
diff --git a/src/components/chuni/rating.tsx b/src/components/chuni/rating.tsx index 97c59ea..190eb26 100644 --- a/src/components/chuni/rating.tsx +++ b/src/components/chuni/rating.tsx @@ -31,7 +31,7 @@ export const ChuniRating = ({ children, rating, className }: ChuniRatingProps) = else bg = 'bg-[linear-gradient(180deg,rgba(255,0,0,1)_0%,rgba(255,64,0,1)_25%,rgba(255,255,0,1)_50%,rgba(0,255,0,1)_60%,rgba(0,64,255,1)_80%)]' - return (
+ return (
{children ?? (ratingNum / 100).toFixed(2)}
) } diff --git a/src/components/chuni/score-badge.tsx b/src/components/chuni/score-badge.tsx index e9e2331..9f1c86c 100644 --- a/src/components/chuni/score-badge.tsx +++ b/src/components/chuni/score-badge.tsx @@ -1,4 +1,5 @@ import { ReactNode } from 'react'; +import { CHUNI_LAMPS } from '@/helpers/chuni/lamps'; const BACKGROUNDS = [ 'bg-[linear-gradient(135deg,rgba(120,120,120,1)_30%,rgba(90,91,90,1)_50%,rgba(172,170,170,1)_50%,rgba(115,114,114,1)_63%,rgba(98,98,98,1)_80%,rgba(129,129,129,1)_100%)]', @@ -53,14 +54,38 @@ export type ChuniScoreBadgeProps = { children: ReactNode, variant: Variant, className?: string, + fontSize?: 'xs' | 'sm' | 'md' }; -export const ChuniScoreBadge = ({ children, variant, className }: ChuniScoreBadgeProps) => { - return (
+const sizes = { + xs: 'text-[52cqh]', + sm: 'text-[59cqh]', + md: 'text-[70cqh]' +} + +export const ChuniScoreBadge = ({ children, variant, className, fontSize }: ChuniScoreBadgeProps) => { + const size = sizes[fontSize ?? 'md']; + + return (
- { children } + { children }
) }; + +export const ChuniLampSuccessBadge = ({ success, className }: { className?: string, success: number }) => { + const text = CHUNI_LAMPS.get(success)?.toUpperCase(); + const fontSize = text?.length! > 5 ? text?.length! > 10 ? 'xs' : 'sm' : 'md'; + return ( + {text} + ) +} + +export const ChuniLampComboBadge = ({ className, isFullCombo, isAllJustice }: { className?: string, isFullCombo: number | null, isAllJustice: number | null }) => { + if (!isFullCombo && !isAllJustice) return null; + return ( + {isAllJustice ? 'ALL JUSTICE' : 'FULL COMBO'} + ) +}