diff --git a/frontend/src/app/(main)/auctions/auctions.css b/frontend/src/app/(main)/auctions/auctions.css index 5b14e6ab..911d9564 100644 --- a/frontend/src/app/(main)/auctions/auctions.css +++ b/frontend/src/app/(main)/auctions/auctions.css @@ -215,9 +215,6 @@ color: var(--au-red); animation: fq-beat 1s infinite; } -.fq-au-row.is-closed { - opacity: 0.6; -} .fq-au-go { font-size: 20px; font-weight: 800; diff --git a/frontend/src/app/(main)/auctions/page.tsx b/frontend/src/app/(main)/auctions/page.tsx index 965c6f52..4e8a8378 100644 --- a/frontend/src/app/(main)/auctions/page.tsx +++ b/frontend/src/app/(main)/auctions/page.tsx @@ -10,6 +10,7 @@ import { IntroGate } from "@/lib/intro"; import Chip from "@/components/casino/Chip"; import Odometer from "@/components/casino/Odometer"; import LoadError from "@/components/LoadError"; +import PastToggle from "@/components/PastToggle"; import Tabs from "@/components/Tabs"; import { api } from "@/lib/api"; import { useAuth } from "@/lib/auth"; @@ -19,13 +20,14 @@ import { nextBoundary, useRefreshAt } from "@/lib/schedule"; import type { AuctionDetail, AuctionPage, AuctionStatus, AuctionSummary, MyBidPage } from "@/lib/types"; import "./auctions.css"; -type F = "ALL" | "MINE" | AuctionStatus; -const ORDER: Record = { OPEN: 0, SCHEDULED: 1, CLOSED: 2 }; +type F = "ALL" | "MINE" | Exclude; export default function AuctionsPage() { const now = useNow(); const [f, setF] = useState("ALL"); + const [showPast, setShowPast] = useState(false); const { profile } = useAuth(); + // 상태를 넘기지 않으면 서버가 등록 순서의 역순(최신순)으로 준다. 화면에서는 순서를 바꾸지 않는다 const load = () => api("/api/auctions?size=40").then((r) => r.items); const { data, error, setData } = useLoad(load); // 시작이나 마감 시각이 지나면 서버가 바꾼 상태를 다시 읽는다. 화면을 연 시점의 예정이 남지 않게 한다 @@ -38,26 +40,31 @@ export default function AuctionsPage() { ); const prices = { data: Object.fromEntries((liveDetails.data ?? []).map((d) => [d.auctionId, d.highestBid?.amount ?? d.startingPriceAmount])) as Record }; const mine = useLoad(() => (profile ? api("/api/me/bids?size=100").then((r) => r.items) : Promise.resolve([])), [profile?.memberId]); - const sorted = [...(data ?? [])].sort((a, b) => ORDER[a.status] - ORDER[b.status] || +new Date(a.endsAt) - +new Date(b.endsAt)); - const count = (x: F) => data?.filter((a) => x === "ALL" || a.status === x).length; + // 끝난 경매는 체크했을 때만 같은 최신순 자리에 어둡게 섞여 보인다 + const sorted = (data ?? []).filter((a) => showPast || a.status !== "CLOSED"); + const match = (x: F, a: AuctionSummary) => x === "ALL" || a.status === x; + const shown = sorted.filter((a) => match(f, a)); + const count = (x: F) => (data ? sorted.filter((a) => match(x, a)).length : undefined); return (
{data && liveDetails.data ? :
}
- +
+ + {f === "MINE" ? null : a.status === "CLOSED").length} />} +
{error ? ( @@ -95,14 +102,12 @@ export default function AuctionsPage() { ) ) : data ? (
    - {sorted - .filter((a) => f === "ALL" || a.status === f) - .map((a, i) => ( -
  • - -
  • - ))} - {sorted.filter((a) => f === "ALL" || a.status === f).length === 0 ? ( + {shown.map((a, i) => ( +
  • + +
  • + ))} + {shown.length === 0 ? (
  • 해당하는 경매가 없어요.

    @@ -118,11 +123,11 @@ export default function AuctionsPage() { ); } -/** lot은 정렬된 전체 목록에서의 순번이다. 필터를 바꿔도 같은 경매는 같은 번호를 유지한다 */ +/** lot은 지금 보이는 전체 목록에서의 순번이다. 탭을 바꿔도 같은 경매는 같은 번호를 유지한다 */ function Row({ a, lot, now, price, delay }: { a: AuctionSummary; lot: string; now: number; price?: number; delay: number }) { const urgent = a.status === "OPEN" && msLeft(a.endsAt, now) < 15 * 60_000; return ( - + {lot}
    diff --git a/frontend/src/app/(main)/concerts/page.tsx b/frontend/src/app/(main)/concerts/page.tsx index a6303e8a..b765c0d6 100644 --- a/frontend/src/app/(main)/concerts/page.tsx +++ b/frontend/src/app/(main)/concerts/page.tsx @@ -1,8 +1,10 @@ "use client"; import DomainBox from "@/components/finale/DomainBox"; +import LineArt from "@/components/LineArt"; import { useState } from "react"; import { CardSkeletons, ConcertCard } from "@/components/Cards"; +import PastToggle from "@/components/PastToggle"; import Tabs from "@/components/Tabs"; import LoadError from "@/components/LoadError"; import { api } from "@/lib/api"; @@ -19,41 +21,68 @@ function splitTitle(title: string) { return { head: head || title, rest: rest.join(" ") }; } -type F = "ALL" | "ON_SALE" | "UPCOMING" | "ENDED"; +type F = "ALL" | "ON_SALE" | "UPCOMING"; + +/** 공연 기간 마지막 날이 오늘(이 기기 날짜)보다 앞이면 지난 공연이다 */ +function isPast(c: ConcertDetail, today: string) { + return !!c.periodEndDate && c.periodEndDate < today; +} +/** 이 기기 기준 오늘 날짜 (YYYY-MM-DD) */ +function localToday() { + const d = new Date(); + return `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, "0")}-${String(d.getDate()).padStart(2, "0")}`; +} export default function ConcertsPage() { const [f, setF] = useState("ALL"); + const [showPast, setShowPast] = useState(false); const now = useNow(); + // 서버가 등록일 최신순으로 준다. 화면에서는 순서를 바꾸지 않는다 const load = () => api("/api/concerts?size=40").then((r) => r.content); const { data, error, setData } = useLoad(load); // 예매 오픈과 마감은 시각으로 바로 바꾸고, 그 뒤 서버 판매 상태를 다시 읽는다 const sale = (c: ConcertDetail) => concertSale(c, now); useRefreshAt(nextBoundary((data ?? []).flatMap((c) => (c.saleStatus === "ENDED" ? [] : [c.saleStatus === "UPCOMING" ? c.bookingOpensAt : c.bookingClosesAt])), now), () => load().then(setData)); - // 연출에 세울 대표 공연: 예매 중인 공연이 있으면 그 공연, 없으면 첫 공연 - const star = data?.find((c) => sale(c) === "ON_SALE") ?? data?.[0]; + const today = localToday(); + const live = (data ?? []).filter((c) => !isPast(c, today)); + const past = (data ?? []).filter((c) => isPast(c, today)); + // 연출에 세울 대표 공연: 예매 중인 공연이 있으면 그 공연, 없으면 끝나지 않은 첫 공연 + const star = live.find((c) => sale(c) === "ON_SALE") ?? live[0] ?? data?.[0]; const perfs = useLoad(() => (star ? api(`/api/concerts/${star.concertId}/performances`) : Promise.resolve([])), [star?.concertId]); const starList = [...(perfs.data ?? [])].sort((a, b) => +new Date(a.startsAt) - +new Date(b.startsAt)); const starName = star ? splitTitle(star.title) : null; - const list = (data ?? []).filter((c) => f === "ALL" || sale(c) === f); - const count = (x: Exclude) => data?.filter((c) => sale(c) === x).length; + const match = (x: F, c: ConcertDetail) => x === "ALL" || sale(c) === x; + // 지난 공연은 전체 탭에서만, 체크했을 때 같은 최신순 자리에 어둡게 섞여 보인다 + const list = (data ?? []).filter((c) => (isPast(c, today) ? showPast && f === "ALL" : match(f, c))); + const count = (x: F) => (data ? live.filter((c) => match(x, c)).length + (x === "ALL" && showPast ? past.length : 0) : undefined); return ( <>

    좌석을 직접 골라 예매하는 지정석 공연이에요.

    - +
    + + +
    - {error ? : data ?
    {list.map((c) => )}
    : } + {error ? ( + + ) : !data ? ( + + ) : list.length === 0 ? ( +

    해당하는 공연이 없어요.

    + ) : ( +
    {list.map((c) => )}
    + )}
    diff --git a/frontend/src/app/(main)/drops/drops.css b/frontend/src/app/(main)/drops/drops.css index 8088f0ec..56c51d6e 100644 --- a/frontend/src/app/(main)/drops/drops.css +++ b/frontend/src/app/(main)/drops/drops.css @@ -431,16 +431,19 @@ opacity: clamp(0, var(--p) * 2.2 - 0.3, 1); transform: translateY(calc((1 - clamp(0, var(--p) * 2.2 - 0.3, 1)) * 30px)); } +/* 지난 드롭은 전원이 꺼진 화면처럼 흑백으로 어둡게. 가리키면 조금 켜진다 */ .fq-dl-archive-card .fq-poster { - filter: grayscale(1) brightness(0.8); + filter: grayscale(1) brightness(0.45); transition: filter 0.5s var(--ux-ease); } -.fq-dl-archive-card:hover .fq-poster { - filter: grayscale(0.2); +.fq-dl-archive-card:hover .fq-poster, +.fq-dl-archive-card:focus-visible .fq-poster { + filter: grayscale(0.7) brightness(0.75); } .fq-dl-archive-card b { font-size: 15px; font-weight: 800; + color: var(--ux-ink-3); } .fq-dl-archive-card small { font-size: 12.5px; diff --git a/frontend/src/app/(main)/drops/page.tsx b/frontend/src/app/(main)/drops/page.tsx index 6d8b2a18..9de68043 100644 --- a/frontend/src/app/(main)/drops/page.tsx +++ b/frontend/src/app/(main)/drops/page.tsx @@ -9,6 +9,7 @@ import { useEffect, useRef, useState } from "react"; import { firstWord } from "@/components/Cards"; import ChapterHud from "@/components/chapter/ChapterHud"; import LoadError from "@/components/LoadError"; +import PastToggle from "@/components/PastToggle"; import Poster, { PALETTES } from "@/components/Poster"; import Tabs from "@/components/Tabs"; import { api } from "@/lib/api"; @@ -20,8 +21,8 @@ import type { DropItem, DropPage } from "@/lib/types"; import { dropSale } from "@/lib/schedule"; import "./drops.css"; -type F = "ALL" | "ON_SALE" | "UPCOMING" | "ENDED"; -type State = Exclude; +type F = "ALL" | "ON_SALE" | "UPCOMING"; +type State = Exclude | "ENDED"; type Row = { d: DropItem; s: State }; /** 서버 상태와 시각으로 지금 상태를 정한다. 화면을 연 시점의 UPCOMING이 오픈 뒤에도 남지 않게 시각을 따른다 */ @@ -31,7 +32,6 @@ function productWord(title: string) { const words = (title.split(">").pop() ?? title).trim().split(/\s+/).filter((w) => !["공식", "투어", "한정판", "세트"].includes(w)); return words[0] ?? firstWord(title); } -const ORDER: Record = { ON_SALE: 0, UPCOMING: 1, ENDED: 2 }; const colorOf = (dropId: number) => PALETTES[(dropId + 1) % PALETTES.length]; /** @@ -39,18 +39,21 @@ const colorOf = (dropId: number) => PALETTES[(dropId + 1) % PALETTES.length]; * 1) 커튼: 화면이 고정된 채 물결 커튼이 끝까지 내려오고 제목이 커졌다가 걷힌다. * 2) 진열대: 카드마다 멈춰 서고, 멈춘 동안 무대가 그 카드 색으로 물들며 뒤로 큰 상품 이름이 흐른다. * 3) 다음 드롭: 오픈 예정 드롭을 화면 가득한 카운트다운으로 보여 준다. - * 4) 지난 드롭: 끝난 드롭을 흑백으로 모은다. + * 4) 지난 드롭: 지난 이벤트도 보기를 체크하면 끝난 드롭을 꺼진 것처럼 어둡게 모은다. */ export default function DropsPage() { const now = useNow(); const [f, setF] = useState("ALL"); - const { data, error } = useLoad(() => api("/api/drops").then((r) => r.items)); - const all: Row[] = (data ?? []).map((d) => ({ d, s: stateOf(d, now) })).sort((a, b) => ORDER[a.s] - ORDER[b.s] || +new Date(a.d.opensAt) - +new Date(b.d.opensAt)); - // 전체 보기에서는 끝난 드롭을 진열대 대신 아래 지난 드롭 장에 모은다 - const rail = f === "ALL" ? all.filter((x) => x.s !== "ENDED") : all.filter((x) => x.s === f); + const [showPast, setShowPast] = useState(false); + // 서버가 등록일 최신순으로 준다. 화면에서는 순서를 바꾸지 않는다 + const { data, error } = useLoad(() => api("/api/drops?sort=NEWEST").then((r) => r.items)); + const all: Row[] = (data ?? []).map((d) => ({ d, s: stateOf(d, now) })); + // 끝난 드롭은 진열대에 올리지 않고, 체크했을 때만 아래 지난 드롭 장에 모은다 + const rail = all.filter((x) => x.s !== "ENDED" && (f === "ALL" || x.s === f)); const ended = all.filter((x) => x.s === "ENDED"); - const next = all.find((x) => x.s === "UPCOMING"); - const count = (x: F) => (data ? (x === "ALL" ? all.length : all.filter((y) => y.s === x).length) : undefined); + // 다음 드롭은 목록 순서와 상관없이 가장 먼저 열리는 드롭이다 + const next = all.filter((x) => x.s === "UPCOMING").sort((a, b) => +new Date(a.d.opensAt) - +new Date(b.d.opensAt))[0]; + const count = (x: F) => (data ? all.filter((y) => y.s !== "ENDED" && (x === "ALL" || y.s === x)).length : undefined); const live = count("ON_SALE") ?? 0; return ( @@ -60,7 +63,7 @@ export default function DropsPage() { -
    +
    +
    {error ? ( @@ -91,7 +94,7 @@ export default function DropsPage() {
    {f === "ALL" && next ? : null} - {f === "ALL" && ended.length ? : null} + {showPast && ended.length ? : null}
    ); @@ -325,7 +328,7 @@ function NextDrop({ row, now }: { row: Row; now: number }) { ); } -/** 4장. 끝난 드롭을 흑백으로 모은다 */ +/** 4장. 끝난 드롭을 꺼진 것처럼 어둡게 모은다 */ function Archive({ rows }: { rows: Row[] }) { const ref = useRef(null); useScrollProgress(ref, undefined, "enter"); diff --git a/frontend/src/app/(main)/fan-meetings/page.tsx b/frontend/src/app/(main)/fan-meetings/page.tsx index 4d806e1e..6c7f9e04 100644 --- a/frontend/src/app/(main)/fan-meetings/page.tsx +++ b/frontend/src/app/(main)/fan-meetings/page.tsx @@ -5,6 +5,7 @@ import { useState } from "react"; import { CardSkeletons, FanMeetingCard } from "@/components/Cards"; import DomainBox from "@/components/finale/DomainBox"; import LoadError from "@/components/LoadError"; +import PastToggle from "@/components/PastToggle"; import Tabs from "@/components/Tabs"; import { api } from "@/lib/api"; import { useLoad, useNow } from "@/lib/hooks"; @@ -13,20 +14,23 @@ import type { FanMeetingPage, FanMeetingStatus } from "@/lib/types"; import LotteryShow from "@/components/lottery/LotteryShow"; import { IntroGate } from "@/lib/intro"; -type F = "ALL" | "OPEN" | "SCHEDULED" | "ENDED"; +type F = "ALL" | "OPEN" | "SCHEDULED"; +/** 응모가 끝난 상태. 목록에서는 지난 팬미팅으로 다룬다 */ const ENDED: FanMeetingStatus[] = ["CLOSED", "DRAWING", "PAYMENT_IN_PROGRESS", "RECRUITMENT_COMPLETED"]; -// 응모 중, 예정, 마감 순으로 보여 주고 취소된 행사는 목록에서 뺀다 -const ORDER: Partial> = { OPEN: 0, SCHEDULED: 1 }; export default function FanMeetingsPage() { const [f, setF] = useState("ALL"); + const [showPast, setShowPast] = useState(false); + // 서버가 등록 순서의 역순(최신순)으로 준다. 화면에서는 순서를 바꾸지 않고, 취소된 행사만 뺀다 const load = () => api("/api/fan-meetings?size=100").then((r) => r.items.filter((m) => m.status !== "CANCELLED")); const { data, error, setData } = useLoad(load); // 응모 시작이나 마감 시각이 지나면 서버가 바꾼 상태를 다시 읽는다. 게릴라 오픈은 시각을 모르니 제외된다 const now = useNow(5_000); useRefreshAt(nextBoundary((data ?? []).map((m) => (m.status === "SCHEDULED" ? m.entryOpensAt : m.status === "OPEN" ? m.entryClosesAt : null)), now), () => load().then(setData)); - const all = [...(data ?? [])].sort((a, b) => (ORDER[a.status] ?? 2) - (ORDER[b.status] ?? 2) || +new Date(a.meetingAt) - +new Date(b.meetingAt)); - const match = (x: F, s: FanMeetingStatus) => x === "ALL" || (x === "ENDED" ? ENDED.includes(s) : s === x); + const all = data ?? []; + const isPast = (s: FanMeetingStatus) => ENDED.includes(s); + // 지난 팬미팅은 전체 탭에서만, 체크했을 때 같은 최신순 자리에 어둡게 섞여 보인다 + const match = (x: F, s: FanMeetingStatus) => (isPast(s) ? showPast && x === "ALL" : x === "ALL" || s === x); const list = all.filter((m) => match(f, m.status)); const count = (x: F) => (data ? all.filter((m) => match(x, m.status)).length : undefined); return ( @@ -34,17 +38,19 @@ export default function FanMeetingsPage() {

    응모한 팬 중에서 추첨으로 참가자를 정해요. 당첨되면 결제 기한 안에 결제해 주세요.

    - +
    + + isPast(m.status)).length : undefined} /> +
    {error ? ( @@ -53,7 +59,7 @@ export default function FanMeetingsPage() { ) : list.length === 0 ? (

    해당하는 팬미팅이 없어요.

    ) : ( -
    {list.map((m) => )}
    +
    {list.map((m) => )}
    )}
    diff --git a/frontend/src/app/(main)/main.css b/frontend/src/app/(main)/main.css index af538f33..bbc3e6dc 100644 --- a/frontend/src/app/(main)/main.css +++ b/frontend/src/app/(main)/main.css @@ -176,6 +176,48 @@ font-size: 11.5px; } +/* ── 목록 위 막대: 필터 탭과 지난 이벤트 체크박스 ── */ +.fq-list-bar { + display: flex; + flex-wrap: wrap; + align-items: center; + gap: 12px 18px; +} +.fq-past-toggle { + display: inline-flex; + align-items: center; + gap: 8px; + font-size: 14px; + font-weight: 750; + color: var(--ux-ink-2); + cursor: pointer; + user-select: none; +} +.fq-past-toggle input { + width: 16px; + height: 16px; + margin: 0; + accent-color: var(--ux-accent); + cursor: pointer; +} +.fq-past-toggle small { + min-width: 20px; + padding: 2px 6px; + border-radius: 999px; + background: color-mix(in srgb, currentColor 16%, transparent); + font-size: 11.5px; + text-align: center; +} +/* 지난 이벤트: 전원이 꺼진 화면처럼 흑백으로 어둡게. 가리키면 조금 켜진다 */ +.fq-past { + filter: grayscale(1) brightness(0.45); + transition: filter 0.4s var(--ux-ease); +} +.fq-past:hover, +.fq-past:focus-visible { + filter: grayscale(0.7) brightness(0.75); +} + /* ── 상세 2단 ─────────────────────────────── */ .fq-detail-grid { display: grid; diff --git a/frontend/src/components/Cards.tsx b/frontend/src/components/Cards.tsx index 879f0178..32729902 100644 --- a/frontend/src/components/Cards.tsx +++ b/frontend/src/components/Cards.tsx @@ -63,12 +63,14 @@ export const CONCERT_SALE: Record +
    {s.label} @@ -88,11 +90,12 @@ export const FM_STATUS: Record = { RECRUITMENT_COMPLETED: { label: "모집 완료", tone: "is-mute" }, }; -export function FanMeetingCard({ f }: { f: FanMeetingSummary }) { +/** past는 응모가 끝난 팬미팅이다. 목록에서 꺼진 것처럼 어둡게 보인다 */ +export function FanMeetingCard({ f, past = false }: { f: FanMeetingSummary; past?: boolean }) { const now = useNow(); const s = FM_STATUS[f.status] ?? { label: f.status, tone: "" }; return ( - +
    diff --git a/frontend/src/components/PastToggle.tsx b/frontend/src/components/PastToggle.tsx new file mode 100644 index 00000000..0883f714 --- /dev/null +++ b/frontend/src/components/PastToggle.tsx @@ -0,0 +1,12 @@ +"use client"; + +/** 목록에 지난 이벤트를 함께 보여 줄지 고르는 체크박스. 기본은 꺼져 있다 */ +export default function PastToggle({ checked, onChange, count }: { checked: boolean; onChange: (v: boolean) => void; count?: number }) { + return ( + + ); +} diff --git a/frontend/src/lib/types.ts b/frontend/src/lib/types.ts index 2818359d..b6cda0ea 100644 --- a/frontend/src/lib/types.ts +++ b/frontend/src/lib/types.ts @@ -70,6 +70,8 @@ export type ConcertDetail = { /** 저장된 공연 상태. 예매가 열려도 SCHEDULED로 남으니 판매 표시는 saleStatus를 쓴다 */ status: string; createdAt: string; + /** 공연 기간 마지막 날 (YYYY-MM-DD). 정하지 않은 공연은 null */ + periodEndDate?: string | null; /** 회차 예매 기간으로 서버가 계산한 판매 상태 */ saleStatus: "UPCOMING" | "ON_SALE" | "ENDED"; /** 아직 마감되지 않은 회차 중 가장 이른 예매 오픈. 모두 마감이면 null */