Add /before route: restore original v1 design for Before/After record
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
fa68169ca0
commit
5ba653cfdf
21 files changed
+1277
-97
No files matched your search
@@ -0,0 +1,23 @@
|
||||
import type { Outcome, Match } from "./types";
|
||||
|
||||
export function outcomeLabel(match: Match, o: Outcome): string {
|
||||
if (o === "TEAM_A_WIN") return `${match.teamA.shortName} 승`;
|
||||
if (o === "TEAM_B_WIN") return `${match.teamB.shortName} 승`;
|
||||
return "무승부";
|
||||
}
|
||||
|
||||
export function kickoffDisplay(iso: string): string {
|
||||
// iso는 KST(+09:00). 런타임 TZ에 무관하게 ISO 문자열을 직접 파싱한다.
|
||||
const days = ["일", "월", "화", "수", "목", "금", "토"];
|
||||
const dm = iso.match(/(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})/);
|
||||
if (!dm) return iso;
|
||||
const [, y, mo, d, hh, mm] = dm;
|
||||
// 요일은 달력 날짜 기준(UTC Date로 계산하면 TZ 무관)
|
||||
const dow = days[new Date(Date.UTC(+y, +mo - 1, +d)).getUTCDay()];
|
||||
return `${+mo}.${+d}(${dow}) ${hh}:${mm} KST`;
|
||||
}
|
||||
|
||||
export function pct(part: number, total: number): number {
|
||||
if (!total) return 0;
|
||||
return Math.round((part / total) * 100);
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
// 1차 mock 데이터 — Firebase 연결 전까지 사용.
|
||||
// ⚠️ AI 예측은 플레이스홀더. 발행 전 GPT/Claude/Gemini 실제 출력(JSON)으로 교체할 것.
|
||||
// 경기 일정은 lib/schedule.ts(Group A 정식 일정, KST)에서 자동 반영.
|
||||
import type { AIPrediction, CrowdStats } from "./types";
|
||||
import { FEATURED } from "./schedule";
|
||||
|
||||
export const MATCH = FEATURED; // 대표 경기 = 한국 vs 체코 (schedule SSOT)
|
||||
|
||||
export const AI_PREDICTIONS: AIPrediction[] = [
|
||||
{
|
||||
matchId: MATCH.matchId,
|
||||
model: "GPT",
|
||||
outcome: "TEAM_A_WIN",
|
||||
scoreA: 2,
|
||||
scoreB: 1,
|
||||
confidencePct: 62,
|
||||
reasonShort: "한국의 측면 공격 우위와 세트피스 강점",
|
||||
generatedAt: "2026-06-08",
|
||||
},
|
||||
{
|
||||
matchId: MATCH.matchId,
|
||||
model: "Claude",
|
||||
outcome: "DRAW",
|
||||
scoreA: 1,
|
||||
scoreB: 1,
|
||||
confidencePct: 41,
|
||||
reasonShort: "중원 밸런스가 팽팽한 접전 예상",
|
||||
generatedAt: "2026-06-08",
|
||||
},
|
||||
{
|
||||
matchId: MATCH.matchId,
|
||||
model: "Gemini",
|
||||
outcome: "TEAM_B_WIN",
|
||||
scoreA: 0,
|
||||
scoreB: 2,
|
||||
confidencePct: 28,
|
||||
reasonShort: "체코의 전환 속도와 결정력 우세",
|
||||
generatedAt: "2026-06-08",
|
||||
},
|
||||
];
|
||||
|
||||
export const CROWD: CrowdStats = {
|
||||
matchId: MATCH.matchId,
|
||||
total: 1284,
|
||||
teamAWin: 616, // 48%
|
||||
draw: 347, // 27%
|
||||
teamBWin: 321, // 25%
|
||||
};
|
||||
|
||||
export const LANDING_URL = "https://triplepick.ai/predict/korea-vs-czechia";
|
||||
+103
@@ -0,0 +1,103 @@
|
||||
// 2026 FIFA World Cup Group A 정식 일정 (출처: Wikipedia/FIFA, KST 변환 검증 2026-06-08)
|
||||
// 모든 kickoffKst는 한국시간(+09:00). lockAt = 킥오프 -10분.
|
||||
import type { Match, Team } from "./types";
|
||||
|
||||
const KOR: Team = { name: "Korea Republic", shortName: "한국", code: "KOR", flag: "🇰🇷" };
|
||||
const CZE: Team = { name: "Czechia", shortName: "체코", code: "CZE", flag: "🇨🇿" };
|
||||
const MEX: Team = { name: "Mexico", shortName: "멕시코", code: "MEX", flag: "🇲🇽" };
|
||||
const RSA: Team = { name: "South Africa", shortName: "남아공", code: "RSA", flag: "🇿🇦" };
|
||||
|
||||
function lock(iso: string): string {
|
||||
return new Date(new Date(iso).getTime() - 10 * 60000).toISOString();
|
||||
}
|
||||
|
||||
// Group A 전체 6경기 — 경기별 정확 일시 자동 반영용 SSOT
|
||||
export const GROUP_A: Match[] = [
|
||||
{
|
||||
matchId: "A_MEX_RSA_20260612",
|
||||
roundLabel: "Match 01 · 개막전",
|
||||
group: "A",
|
||||
teamA: MEX,
|
||||
teamB: RSA,
|
||||
kickoffKst: "2026-06-12T04:00:00+09:00",
|
||||
venue: "Estadio Azteca · Mexico City",
|
||||
lockAt: lock("2026-06-12T04:00:00+09:00"),
|
||||
status: "upcoming",
|
||||
hookText: "월드컵 개막전, AI는 개최국을 믿을까",
|
||||
result: null,
|
||||
},
|
||||
{
|
||||
matchId: "A_KOR_CZE_20260612",
|
||||
roundLabel: "Match 01",
|
||||
group: "A",
|
||||
teamA: KOR,
|
||||
teamB: CZE,
|
||||
kickoffKst: "2026-06-12T11:00:00+09:00",
|
||||
venue: "Estadio Guadalajara (Akron)",
|
||||
lockAt: lock("2026-06-12T11:00:00+09:00"),
|
||||
status: "upcoming",
|
||||
hookText: "한국 첫 경기, AI의 선택은 갈렸다",
|
||||
result: null,
|
||||
},
|
||||
{
|
||||
matchId: "A_CZE_RSA_20260619",
|
||||
roundLabel: "Match 02",
|
||||
group: "A",
|
||||
teamA: CZE,
|
||||
teamB: RSA,
|
||||
kickoffKst: "2026-06-19T01:00:00+09:00",
|
||||
venue: "USA (TBD)",
|
||||
lockAt: lock("2026-06-19T01:00:00+09:00"),
|
||||
status: "upcoming",
|
||||
hookText: "체코 vs 남아공, AI의 예측은",
|
||||
result: null,
|
||||
},
|
||||
{
|
||||
matchId: "A_MEX_KOR_20260619",
|
||||
roundLabel: "Match 02",
|
||||
group: "A",
|
||||
teamA: MEX,
|
||||
teamB: KOR,
|
||||
kickoffKst: "2026-06-19T10:00:00+09:00",
|
||||
venue: "Estadio Guadalajara (Akron)",
|
||||
lockAt: lock("2026-06-19T10:00:00+09:00"),
|
||||
status: "upcoming",
|
||||
hookText: "개최국 멕시코 vs 한국, AI는 누구 편",
|
||||
result: null,
|
||||
},
|
||||
{
|
||||
matchId: "A_CZE_MEX_20260625",
|
||||
roundLabel: "Match 03",
|
||||
group: "A",
|
||||
teamA: CZE,
|
||||
teamB: MEX,
|
||||
kickoffKst: "2026-06-25T10:00:00+09:00",
|
||||
venue: "Estadio Azteca · Mexico City",
|
||||
lockAt: lock("2026-06-25T10:00:00+09:00"),
|
||||
status: "upcoming",
|
||||
hookText: "체코 vs 멕시코, 운명의 최종전",
|
||||
result: null,
|
||||
},
|
||||
{
|
||||
matchId: "A_RSA_KOR_20260625",
|
||||
roundLabel: "Match 03",
|
||||
group: "A",
|
||||
teamA: RSA,
|
||||
teamB: KOR,
|
||||
kickoffKst: "2026-06-25T10:00:00+09:00",
|
||||
venue: "Estadio BBVA · Monterrey",
|
||||
lockAt: lock("2026-06-25T10:00:00+09:00"),
|
||||
status: "upcoming",
|
||||
hookText: "한국 16강의 갈림길, AI의 마지막 예측",
|
||||
result: null,
|
||||
},
|
||||
];
|
||||
|
||||
// 현재 노출할 대표 경기
|
||||
export const FEATURED_MATCH_ID = "A_KOR_CZE_20260612";
|
||||
|
||||
export function getMatch(id: string): Match {
|
||||
return GROUP_A.find((m) => m.matchId === id) ?? GROUP_A[1];
|
||||
}
|
||||
|
||||
export const FEATURED = getMatch(FEATURED_MATCH_ID);
|
||||
@@ -0,0 +1,52 @@
|
||||
// TriplePick 도메인 타입 — 기능정의서 데이터모델과 정합
|
||||
// Firebase 연결 시 이 타입을 Firestore 변환기(converter)에 그대로 사용한다.
|
||||
|
||||
export type Outcome = "TEAM_A_WIN" | "DRAW" | "TEAM_B_WIN";
|
||||
export type ModelName = "GPT" | "Claude" | "Gemini";
|
||||
export type MatchStatus = "upcoming" | "locked" | "live" | "finished";
|
||||
|
||||
export interface Team {
|
||||
name: string; // 표시명 (예: Korea Republic)
|
||||
shortName: string; // 짧은 표시 (예: 한국)
|
||||
code: string; // KOR / CZE
|
||||
flag: string; // 이모지 국기 (1차), 추후 에셋 교체 가능
|
||||
}
|
||||
|
||||
export interface Match {
|
||||
matchId: string;
|
||||
roundLabel: string; // "Match 01"
|
||||
group: string; // "A"
|
||||
teamA: Team;
|
||||
teamB: Team;
|
||||
kickoffKst: string; // ISO with +09:00
|
||||
venue: string;
|
||||
lockAt: string; // ISO (킥오프 -10분)
|
||||
status: MatchStatus;
|
||||
hookText: string; // "한국 첫 경기, AI의 선택은 갈렸다"
|
||||
result?: { scoreA: number; scoreB: number; outcome: Outcome } | null;
|
||||
}
|
||||
|
||||
export interface AIPrediction {
|
||||
matchId: string;
|
||||
model: ModelName;
|
||||
outcome: Outcome;
|
||||
scoreA: number;
|
||||
scoreB: number;
|
||||
confidencePct: number; // 0-100
|
||||
reasonShort: string;
|
||||
generatedAt: string; // 데이터 기준일
|
||||
}
|
||||
|
||||
export interface CrowdStats {
|
||||
matchId: string;
|
||||
total: number;
|
||||
teamAWin: number;
|
||||
draw: number;
|
||||
teamBWin: number;
|
||||
}
|
||||
|
||||
export interface UserPick {
|
||||
outcome: Outcome;
|
||||
scoreA: number;
|
||||
scoreB: number;
|
||||
}
|
||||
Reference in new issue
Block a user