feat(web): refresh the app with Astryx and coral branding
This commit is contained in:
1 parent
f649490cd2
commit
da7b502936
140 files changed
+4531
-2368
No files matched your search
@@ -1,4 +1,5 @@
|
||||
import { useState } from "react";
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import { ChevronLeft, ChevronRight } from "lucide-react";
|
||||
import { Link, useLocation, useParams } from "react-router";
|
||||
import {
|
||||
Area,
|
||||
@@ -52,6 +53,15 @@ import {
|
||||
SummonerSpellIcon,
|
||||
} from "../components/ItemTooltip";
|
||||
|
||||
import {
|
||||
Btn,
|
||||
EmptyNote,
|
||||
LoadingNote,
|
||||
MetaDot,
|
||||
PageBody,
|
||||
PageHero,
|
||||
PlainPage,
|
||||
} from "../ui";
|
||||
type MatchGameDetail = ApiInternalMatchDetailResponse["games"][number];
|
||||
type MatchGameTeam = MatchGameDetail["teams"][number];
|
||||
type MatchGameParticipant = MatchGameTeam["participants"][number];
|
||||
@@ -185,16 +195,16 @@ function sideLabel(side: TeamSide) {
|
||||
function sideTone(side: TeamSide) {
|
||||
return side === "blue"
|
||||
? {
|
||||
border: "border-blue-500/20",
|
||||
bg: "bg-blue-500/5",
|
||||
text: "text-blue-400",
|
||||
bar: "bg-blue-500",
|
||||
border: "border-win-line",
|
||||
bg: "bg-win-tint",
|
||||
text: "text-win",
|
||||
bar: "bg-win",
|
||||
}
|
||||
: {
|
||||
border: "border-red-500/20",
|
||||
bg: "bg-red-500/5",
|
||||
text: "text-red-400",
|
||||
bar: "bg-red-500",
|
||||
border: "border-loss-line",
|
||||
bg: "bg-loss-tint",
|
||||
text: "text-loss",
|
||||
bar: "bg-loss",
|
||||
};
|
||||
}
|
||||
|
||||
@@ -405,7 +415,7 @@ function PlayerIdentityCell({
|
||||
<div className="mt-0.5 flex items-center gap-1.5">
|
||||
<span className="text-xs text-base-content/35">{lane}</span>
|
||||
{(participant.firstBloodKill || participant.firstBloodAssist) && (
|
||||
<span className="inline-flex border border-amber-400/30 bg-amber-400/10 px-1 text-[10px] font-black text-amber-400">
|
||||
<span className="inline-flex border border-amber-400/30 bg-amber-400/10 px-1 text-[10px] font-black text-gold">
|
||||
{participant.firstBloodKill ? "FB" : "FBA"}
|
||||
</span>
|
||||
)}
|
||||
@@ -438,7 +448,7 @@ function PlayerRow({
|
||||
<div className="text-sm font-black tabular-nums text-base-content">
|
||||
{participant.kills}
|
||||
<span className="text-base-content/25"> / </span>
|
||||
<span className="text-red-400">{participant.deaths}</span>
|
||||
<span className="text-loss">{participant.deaths}</span>
|
||||
<span className="text-base-content/25"> / </span>
|
||||
{participant.assists}
|
||||
</div>
|
||||
@@ -519,7 +529,7 @@ function PlayerCard({
|
||||
<div className="text-sm font-black tabular-nums text-base-content">
|
||||
{participant.kills}
|
||||
<span className="text-base-content/25"> / </span>
|
||||
<span className="text-red-400">{participant.deaths}</span>
|
||||
<span className="text-loss">{participant.deaths}</span>
|
||||
<span className="text-base-content/25"> / </span>
|
||||
{participant.assists}
|
||||
</div>
|
||||
@@ -830,7 +840,7 @@ function ObjectiveComparisonStrip({
|
||||
<span
|
||||
className={`text-right font-black ${
|
||||
objective.blue > objective.red
|
||||
? "text-blue-400"
|
||||
? "text-win"
|
||||
: "text-base-content/50"
|
||||
}`}
|
||||
>
|
||||
@@ -842,7 +852,7 @@ function ObjectiveComparisonStrip({
|
||||
<span
|
||||
className={`font-black ${
|
||||
objective.red > objective.blue
|
||||
? "text-red-400"
|
||||
? "text-loss"
|
||||
: "text-base-content/50"
|
||||
}`}
|
||||
>
|
||||
@@ -851,10 +861,10 @@ function ObjectiveComparisonStrip({
|
||||
</div>
|
||||
{objective.key === "dragon" ? (
|
||||
<div className="mt-1 grid grid-cols-2 gap-2 text-[9px] font-bold leading-tight">
|
||||
<span className="text-right text-blue-400/70">
|
||||
<span className="text-right text-win">
|
||||
{objective.blueDetail}
|
||||
</span>
|
||||
<span className="text-red-400/70">{objective.redDetail}</span>
|
||||
<span className="text-loss">{objective.redDetail}</span>
|
||||
</div>
|
||||
) : null}
|
||||
</div>
|
||||
@@ -892,7 +902,7 @@ function GoldComparisonStrip({
|
||||
return (
|
||||
<div className="border-t border-base-content/8 bg-base-content/[0.01] px-4 py-3">
|
||||
<div className="grid gap-3 md:grid-cols-[minmax(0,1fr)_11rem_minmax(0,1fr)] md:items-center">
|
||||
<div className="min-w-0 text-blue-400">
|
||||
<div className="min-w-0 text-win">
|
||||
<div className="flex items-center justify-between gap-3 text-xs font-black">
|
||||
<span className="truncate">
|
||||
{getTeamName(detail, blueTeam.teamIndex)}
|
||||
@@ -903,7 +913,7 @@ function GoldComparisonStrip({
|
||||
</div>
|
||||
<div className="mt-1 h-1.5 bg-base-content/8">
|
||||
<div
|
||||
className="h-full bg-blue-500"
|
||||
className="h-full bg-win"
|
||||
style={{ width: barWidth(blueTotals.gold, maxGold) }}
|
||||
/>
|
||||
</div>
|
||||
@@ -915,9 +925,9 @@ function GoldComparisonStrip({
|
||||
<div
|
||||
className={`mt-1 text-lg font-black tabular-nums ${
|
||||
goldDiff > 0
|
||||
? "text-blue-400"
|
||||
? "text-win"
|
||||
: goldDiff < 0
|
||||
? "text-red-400"
|
||||
? "text-loss"
|
||||
: "text-base-content/55"
|
||||
}`}
|
||||
>
|
||||
@@ -927,7 +937,7 @@ function GoldComparisonStrip({
|
||||
{leaderName}
|
||||
</div>
|
||||
</div>
|
||||
<div className="min-w-0 text-red-400">
|
||||
<div className="min-w-0 text-loss">
|
||||
<div className="flex items-center justify-between gap-3 text-xs font-black">
|
||||
<span className="tabular-nums">{formatNumber(redTotals.gold)}</span>
|
||||
<span className="truncate text-right">
|
||||
@@ -936,7 +946,7 @@ function GoldComparisonStrip({
|
||||
</div>
|
||||
<div className="mt-1 h-1.5 bg-base-content/8">
|
||||
<div
|
||||
className="ml-auto h-full bg-red-500"
|
||||
className="ml-auto h-full bg-loss"
|
||||
style={{ width: barWidth(redTotals.gold, maxGold) }}
|
||||
/>
|
||||
</div>
|
||||
@@ -986,13 +996,13 @@ function TimelineTooltip({
|
||||
{leaderName} {formatSignedCompactNumber(point.value)}
|
||||
</div>
|
||||
<div className="mt-2 grid grid-cols-2 gap-3 tabular-nums">
|
||||
<div className="text-blue-400">
|
||||
<div className="text-win">
|
||||
{blueTeamName}
|
||||
<span className="block font-black">
|
||||
{formatNumber(point.blueTotal)}
|
||||
</span>
|
||||
</div>
|
||||
<div className="text-red-400">
|
||||
<div className="text-loss">
|
||||
{redTeamName}
|
||||
<span className="block font-black">
|
||||
{formatNumber(point.redTotal)}
|
||||
@@ -1308,9 +1318,9 @@ function TimelineGraph({
|
||||
</ResponsiveContainer>
|
||||
</div>
|
||||
<div className="mt-2 flex items-center justify-between gap-3 text-[11px] font-black uppercase tracking-wider">
|
||||
<span className="text-blue-400">{blueTeamName}</span>
|
||||
<span className="text-win">{blueTeamName}</span>
|
||||
<span className="text-base-content/25">0</span>
|
||||
<span className="text-red-400">{redTeamName}</span>
|
||||
<span className="text-loss">{redTeamName}</span>
|
||||
</div>
|
||||
</div>
|
||||
) : (
|
||||
@@ -1382,9 +1392,9 @@ function TimelineGraph({
|
||||
<span
|
||||
className={`text-[10px] font-black uppercase tracking-wider ${
|
||||
event.side === "blue"
|
||||
? "text-blue-400"
|
||||
? "text-win"
|
||||
: event.side === "red"
|
||||
? "text-red-400"
|
||||
? "text-loss"
|
||||
: "text-base-content/35"
|
||||
}`}
|
||||
>
|
||||
@@ -1513,54 +1523,88 @@ function GameTabs({
|
||||
currentGameNumber: number;
|
||||
navigationState: MatchGameNavigationState | undefined;
|
||||
}) {
|
||||
const currentRef = useRef<HTMLAnchorElement | null>(null);
|
||||
const currentIndex = detail.games.findIndex(
|
||||
(game) => game.gameNumber === currentGameNumber,
|
||||
);
|
||||
const previousGame = detail.games[currentIndex - 1];
|
||||
const nextGame = detail.games[currentIndex + 1];
|
||||
const pathFor = (gameNumber: number) =>
|
||||
internalMatchGamePath(communityId, detail.match.matchId, gameNumber);
|
||||
|
||||
useEffect(() => {
|
||||
currentRef.current?.scrollIntoView({ block: "nearest", inline: "center" });
|
||||
}, [currentGameNumber]);
|
||||
|
||||
const stepClass =
|
||||
"grid size-10 shrink-0 place-items-center rounded-[10px] text-content-muted transition-colors hover:bg-sunken hover:text-content aria-disabled:pointer-events-none aria-disabled:opacity-30";
|
||||
|
||||
return (
|
||||
<nav
|
||||
className="mt-4 flex overflow-x-auto border border-base-content/10 bg-base-100"
|
||||
className="lts-panel sticky top-[60px] z-30 flex items-center gap-1 p-1"
|
||||
aria-label="세트 선택"
|
||||
>
|
||||
{detail.games.map((game) => {
|
||||
const winnerTeam = game.teams.find((team) => team.win);
|
||||
const active = game.gameNumber === currentGameNumber;
|
||||
return (
|
||||
<Link
|
||||
key={game.gameNumber}
|
||||
to={internalMatchGamePath(
|
||||
communityId,
|
||||
detail.match.matchId,
|
||||
game.gameNumber,
|
||||
)}
|
||||
state={navigationState}
|
||||
className={`min-w-[8rem] border-r border-base-content/8 px-4 py-3 text-xs transition-colors last:border-r-0 ${
|
||||
active
|
||||
? "bg-primary/8 text-primary"
|
||||
: "text-base-content/45 hover:bg-base-content/[0.03] hover:text-base-content"
|
||||
}`}
|
||||
>
|
||||
<span className="block font-black">{game.gameNumber}세트</span>
|
||||
<span className="mt-1 block truncate">
|
||||
{winnerTeam
|
||||
? `${getTeamName(detail, winnerTeam.teamIndex)} 승`
|
||||
: "결과 대기"}
|
||||
</span>
|
||||
</Link>
|
||||
);
|
||||
})}
|
||||
<Link
|
||||
to={previousGame ? pathFor(previousGame.gameNumber) : "#"}
|
||||
state={navigationState}
|
||||
aria-disabled={!previousGame}
|
||||
tabIndex={previousGame ? undefined : -1}
|
||||
aria-label="이전 세트"
|
||||
className={stepClass}
|
||||
>
|
||||
<ChevronLeft className="size-4" aria-hidden="true" />
|
||||
</Link>
|
||||
<div className="no-scrollbar flex min-w-0 flex-1 gap-1 overflow-x-auto">
|
||||
{detail.games.map((game) => {
|
||||
const winnerTeam = game.teams.find((team) => team.win);
|
||||
const active = game.gameNumber === currentGameNumber;
|
||||
return (
|
||||
<Link
|
||||
key={game.gameNumber}
|
||||
ref={active ? currentRef : undefined}
|
||||
to={pathFor(game.gameNumber)}
|
||||
state={navigationState}
|
||||
aria-current={active ? "page" : undefined}
|
||||
className={`flex h-10 shrink-0 items-center gap-2 rounded-[10px] px-3.5 text-sm transition-colors ${
|
||||
active
|
||||
? "bg-secondary text-secondary-content dark:bg-white dark:text-[#14161b]"
|
||||
: "text-content-muted hover:bg-sunken hover:text-content"
|
||||
}`}
|
||||
>
|
||||
<span className="font-bold">{game.gameNumber}세트</span>
|
||||
<span
|
||||
className={`max-w-28 truncate text-xs ${active ? "opacity-80" : "text-content-subtle"}`}
|
||||
>
|
||||
{winnerTeam
|
||||
? `${getTeamName(detail, winnerTeam.teamIndex)} 승`
|
||||
: "결과 대기"}
|
||||
</span>
|
||||
</Link>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
<Link
|
||||
to={nextGame ? pathFor(nextGame.gameNumber) : "#"}
|
||||
state={navigationState}
|
||||
aria-disabled={!nextGame}
|
||||
tabIndex={nextGame ? undefined : -1}
|
||||
aria-label="다음 세트"
|
||||
className={stepClass}
|
||||
>
|
||||
<ChevronRight className="size-4" aria-hidden="true" />
|
||||
</Link>
|
||||
</nav>
|
||||
);
|
||||
}
|
||||
|
||||
function MatchScoreHero({
|
||||
detail,
|
||||
communityId,
|
||||
selectedGame,
|
||||
backTarget,
|
||||
navigationState,
|
||||
}: {
|
||||
detail: ApiInternalMatchDetailResponse;
|
||||
communityId: string;
|
||||
selectedGame: MatchGameDetail;
|
||||
backTarget: MatchGameBackTarget;
|
||||
navigationState: MatchGameNavigationState | undefined;
|
||||
}) {
|
||||
const selectedSeries = resolveSelectedSeries(detail, selectedGame);
|
||||
const [leftTeam, rightTeam] = selectedGame.teams;
|
||||
@@ -1572,77 +1616,78 @@ function MatchScoreHero({
|
||||
selectedSeries?.teamBIndex === rightTeam?.teamIndex
|
||||
? selectedSeries?.teamBWins
|
||||
: selectedSeries?.teamAWins;
|
||||
const sideTone = (side: TeamSide) =>
|
||||
side === "blue" ? "text-[#8fb6ff]" : "text-[#ff99a5]";
|
||||
|
||||
return (
|
||||
<section className="mt-5 border border-base-content/10 bg-base-content/[0.02] p-5">
|
||||
<div className="flex flex-col gap-5 lg:flex-row lg:items-center lg:justify-between">
|
||||
<div className="min-w-0">
|
||||
<Link
|
||||
to={backTarget.to}
|
||||
className="text-xs text-base-content/40 hover:text-base-content"
|
||||
>
|
||||
← {backTarget.label}
|
||||
</Link>
|
||||
<h1 className="mt-4 text-2xl font-black text-base-content">
|
||||
{detail.match.title} · {selectedGame.gameNumber}세트
|
||||
</h1>
|
||||
<p className="mt-2 text-sm text-base-content/45">
|
||||
{formatDateTime(selectedGame.gameCreation)} ·{" "}
|
||||
{formatDuration(selectedGame.gameDuration)} ·{" "}
|
||||
<span className="font-mono">{selectedGame.riotMatchId}</span>
|
||||
</p>
|
||||
</div>
|
||||
{leftTeam && rightTeam && (
|
||||
<div className="grid min-w-full grid-cols-[1fr_auto_1fr] items-center gap-4 lg:min-w-[440px]">
|
||||
<div
|
||||
className={`min-w-0 text-right ${
|
||||
leftTeam.win
|
||||
? teamIndexColorClasses(leftTeam.teamIndex).text
|
||||
: "text-base-content/30"
|
||||
}`}
|
||||
>
|
||||
<div className="truncate text-sm font-black">
|
||||
<PageHero
|
||||
width="xl"
|
||||
crumbs={[
|
||||
{ label: backTarget.label, to: backTarget.to },
|
||||
{ label: `${selectedGame.gameNumber}세트` },
|
||||
]}
|
||||
title={
|
||||
<>
|
||||
{detail.match.title}
|
||||
<span className="ml-2 text-on-ink-muted">
|
||||
{selectedGame.gameNumber}세트
|
||||
</span>
|
||||
</>
|
||||
}
|
||||
meta={
|
||||
<>
|
||||
<span>{formatDateTime(selectedGame.gameCreation)}</span>
|
||||
<MetaDot />
|
||||
<span className="tabular">
|
||||
{formatDuration(selectedGame.gameDuration)}
|
||||
</span>
|
||||
<MetaDot />
|
||||
<span className="font-mono text-xs">{selectedGame.riotMatchId}</span>
|
||||
</>
|
||||
}
|
||||
actions={
|
||||
leftTeam && rightTeam ? (
|
||||
<div className="grid w-full grid-cols-[1fr_auto_1fr] items-center gap-4 sm:w-auto sm:min-w-[400px]">
|
||||
<div className="min-w-0 text-right">
|
||||
<div
|
||||
className={`truncate text-[15px] font-bold ${leftTeam.win ? "text-on-ink" : "text-on-ink-muted"}`}
|
||||
>
|
||||
{getTeamName(detail, leftTeam.teamIndex)}
|
||||
</div>
|
||||
<div className="mt-1 text-xs font-bold text-base-content/35">
|
||||
<div
|
||||
className={`mt-0.5 text-xs font-semibold ${sideTone(leftTeam.side)}`}
|
||||
>
|
||||
{sideLabel(leftTeam.side)}
|
||||
{leftTeam.win && " · 세트 승"}
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex items-center gap-3 text-center">
|
||||
<span className="text-4xl font-black tabular-nums text-base-content">
|
||||
{leftScore ?? (leftTeam.win ? 1 : 0)}
|
||||
</span>
|
||||
<span className="text-xs font-black text-base-content/15">
|
||||
VS
|
||||
</span>
|
||||
<span className="text-4xl font-black tabular-nums text-base-content">
|
||||
{rightScore ?? (rightTeam.win ? 1 : 0)}
|
||||
</span>
|
||||
<div className="text-center">
|
||||
<div className="tabular flex items-baseline gap-2.5 text-4xl font-extrabold">
|
||||
<span>{leftScore ?? (leftTeam.win ? 1 : 0)}</span>
|
||||
<span className="text-xl text-on-ink-muted">:</span>
|
||||
<span>{rightScore ?? (rightTeam.win ? 1 : 0)}</span>
|
||||
</div>
|
||||
<div className="mt-0.5 text-[11px] font-semibold text-on-ink-muted">
|
||||
시리즈 스코어
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
className={`min-w-0 ${
|
||||
rightTeam.win
|
||||
? teamIndexColorClasses(rightTeam.teamIndex).text
|
||||
: "text-base-content/30"
|
||||
}`}
|
||||
>
|
||||
<div className="truncate text-sm font-black">
|
||||
<div className="min-w-0">
|
||||
<div
|
||||
className={`truncate text-[15px] font-bold ${rightTeam.win ? "text-on-ink" : "text-on-ink-muted"}`}
|
||||
>
|
||||
{getTeamName(detail, rightTeam.teamIndex)}
|
||||
</div>
|
||||
<div className="mt-1 text-xs font-bold text-base-content/35">
|
||||
<div
|
||||
className={`mt-0.5 text-xs font-semibold ${sideTone(rightTeam.side)}`}
|
||||
>
|
||||
{sideLabel(rightTeam.side)}
|
||||
{rightTeam.win && " · 세트 승"}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
<GameTabs
|
||||
detail={detail}
|
||||
communityId={communityId}
|
||||
currentGameNumber={selectedGame.gameNumber}
|
||||
navigationState={navigationState}
|
||||
/>
|
||||
</section>
|
||||
) : undefined
|
||||
}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1665,20 +1710,20 @@ export default function MatchGameDetailPage() {
|
||||
|
||||
if (detailQuery.isLoading) {
|
||||
return (
|
||||
<main className="mx-auto max-w-6xl px-4 py-20 text-center text-sm text-base-content/40">
|
||||
세트 상세 기록을 불러오는 중...
|
||||
</main>
|
||||
<PlainPage>
|
||||
<LoadingNote label="세트 기록을 불러오는 중" />
|
||||
</PlainPage>
|
||||
);
|
||||
}
|
||||
|
||||
if (detailQuery.error || !detail) {
|
||||
return (
|
||||
<main className="mx-auto max-w-6xl px-4 py-20 text-center">
|
||||
<h1 className="text-lg font-bold">세트 기록을 찾을 수 없습니다</h1>
|
||||
<Link to={backTarget.to} className="btn btn-ghost btn-sm mt-4">
|
||||
{backTarget.label}
|
||||
</Link>
|
||||
</main>
|
||||
<PlainPage>
|
||||
<EmptyNote
|
||||
title="세트 기록을 찾을 수 없습니다"
|
||||
action={<Btn to={backTarget.to}>{backTarget.label}</Btn>}
|
||||
/>
|
||||
</PlainPage>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1694,36 +1739,38 @@ export default function MatchGameDetailPage() {
|
||||
? `${requestedGameNumber}경기`
|
||||
: "요청한 경기";
|
||||
return (
|
||||
<main className="mx-auto max-w-6xl px-4 py-20 text-center">
|
||||
<h1 className="text-lg font-bold">
|
||||
{hasRecordedGames
|
||||
? "해당 경기 기록을 찾을 수 없습니다"
|
||||
: "수집된 세트 기록이 없습니다"}
|
||||
</h1>
|
||||
{hasRecordedGames && (
|
||||
<p className="mt-2 text-sm text-content-muted">
|
||||
{requestedGameLabel}가 현재 상세 기록에 없습니다.
|
||||
</p>
|
||||
)}
|
||||
<Link
|
||||
to={backTarget.to}
|
||||
className="btn btn-ghost btn-sm mt-4"
|
||||
>
|
||||
{backTarget.label}
|
||||
</Link>
|
||||
</main>
|
||||
<PlainPage>
|
||||
<EmptyNote
|
||||
title={
|
||||
hasRecordedGames
|
||||
? "해당 경기 기록을 찾을 수 없습니다"
|
||||
: "수집된 세트 기록이 없습니다"
|
||||
}
|
||||
description={
|
||||
hasRecordedGames
|
||||
? `${requestedGameLabel}가 현재 상세 기록에 없습니다.`
|
||||
: undefined
|
||||
}
|
||||
action={<Btn to={backTarget.to}>{backTarget.label}</Btn>}
|
||||
/>
|
||||
</PlainPage>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<main className="mx-auto max-w-6xl px-4 py-6 sm:px-6">
|
||||
<>
|
||||
<MatchScoreHero
|
||||
detail={detail}
|
||||
communityId={communityId}
|
||||
selectedGame={selectedGame}
|
||||
backTarget={backTarget}
|
||||
navigationState={navigationState}
|
||||
/>
|
||||
<PageBody width="xl">
|
||||
<GameTabs
|
||||
detail={detail}
|
||||
communityId={communityId}
|
||||
currentGameNumber={selectedGame.gameNumber}
|
||||
navigationState={navigationState}
|
||||
/>
|
||||
|
||||
<PostgameBreakdown
|
||||
selectedGame={selectedGame}
|
||||
@@ -1757,6 +1804,7 @@ export default function MatchGameDetailPage() {
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
</main>
|
||||
</PageBody>
|
||||
</>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user