add frontend
This commit is contained in:
1 parent
bc57b358f9
commit
5cd5ec5649
44 files changed
+10081
No files matched your search
@@ -0,0 +1,88 @@
|
||||
"use client";
|
||||
|
||||
import { use, useEffect, useState } from "react";
|
||||
import Link from "next/link";
|
||||
import MetadataCard from "@/components/metadata-card";
|
||||
import { InternalOnlyWarning, LicenseBadge } from "@/components/license-badge";
|
||||
import { apiFetch, archiveKind, type ArchiveEntry } from "@/lib/api";
|
||||
|
||||
export default function ArchiveDetailPage({ params }: { params: Promise<{ slug: string }> }) {
|
||||
const { slug } = use(params);
|
||||
const [entry, setEntry] = useState<ArchiveEntry | null>(null);
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
|
||||
useEffect(() => {
|
||||
apiFetch<ArchiveEntry>(`/api/archive/${slug}`).then(setEntry).catch((e) => setError(e.message));
|
||||
}, [slug]);
|
||||
|
||||
if (error) return <p style={{ color: "rgb(255,122,122)" }}>{error}</p>;
|
||||
if (!entry) return <p style={{ color: "var(--text-teal-1)" }}>불러오는 중…</p>;
|
||||
|
||||
return (
|
||||
<div>
|
||||
<div style={{ display: "flex", alignItems: "flex-start", marginBottom: "1rem" }}>
|
||||
<Link href="/archive" className="btn-back">‹ 아카이브</Link>
|
||||
</div>
|
||||
<span className="tag" style={{ height: 20, padding: "0 8px", fontSize: "var(--text-xs)" }}>{archiveKind(entry)}</span>
|
||||
<h1 className="page-title" style={{ textAlign: "left", margin: "0.5rem 0 1.5rem" }}>
|
||||
{entry.metadata?.event_name ?? entry.name}
|
||||
</h1>
|
||||
|
||||
<div className="archive-detail">
|
||||
<div className="card" style={{ padding: "var(--s-4)" }}>
|
||||
{entry.video_url ? (
|
||||
<video src={entry.video_url} controls style={{ width: "100%", borderRadius: "var(--r-sm)", display: "block" }} />
|
||||
) : (
|
||||
// eslint-disable-next-line @next/next/no-img-element
|
||||
<img src={entry.poster_url} alt={entry.name} style={{ width: "100%", borderRadius: "var(--r-sm)" }} />
|
||||
)}
|
||||
{entry.video_url && (
|
||||
<div style={{ display: "flex", justifyContent: "center", marginTop: "var(--s-3)" }}>
|
||||
<a href={entry.video_url} download className="btn-tonal-mint">MP4 다운로드</a>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div style={{ display: "flex", flexDirection: "column", gap: "var(--s-5)" }}>
|
||||
{entry.metadata && <MetadataCard meta={entry.metadata} />}
|
||||
|
||||
{entry.narration && (
|
||||
<div className="card" style={{ padding: "var(--s-5)" }}>
|
||||
<p className="eyebrow" style={{ margin: "0 0 var(--s-3)" }}>
|
||||
나레이션
|
||||
</p>
|
||||
<ol style={{ margin: 0, paddingLeft: 18, fontSize: 15, lineHeight: 2 }}>
|
||||
{entry.narration.map((s, i) => <li key={i}>{s}</li>)}
|
||||
</ol>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{entry.f2_variants.length > 0 && (
|
||||
<div>
|
||||
<p className="eyebrow" style={{ margin: "0 0 var(--s-3)" }}>
|
||||
스타일 변형
|
||||
</p>
|
||||
{entry.f2_variants.some((v) => v.license === "internal-only") && (
|
||||
<InternalOnlyWarning />
|
||||
)}
|
||||
<div style={{ display: "grid", gridTemplateColumns: "repeat(auto-fill, minmax(140px, 1fr))", gap: "var(--s-3)", marginTop: "var(--s-3)" }}>
|
||||
{entry.f2_variants.map((v) => (
|
||||
<div key={v.template_id} className="card" style={{ overflow: "hidden" }}>
|
||||
{/* eslint-disable-next-line @next/next/no-img-element */}
|
||||
<img src={v.image_url} alt={v.name_ko ?? v.template_id} style={{ width: "100%", display: "block" }} />
|
||||
<div style={{ padding: "var(--s-2)", display: "flex", flexDirection: "column", alignItems: "center", gap: 4 }}>
|
||||
<p style={{ margin: 0, fontSize: 12, fontWeight: 600, color: "var(--text-teal-1)", textAlign: "center" }}>
|
||||
{v.name_ko ?? v.template_id}
|
||||
</p>
|
||||
<LicenseBadge license={v.license ?? "internal-only"} />
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect, useState } from "react";
|
||||
import Link from "next/link";
|
||||
import { apiFetch, archiveKind, type ArchiveEntry } from "@/lib/api";
|
||||
|
||||
export default function ArchivePage() {
|
||||
const [entries, setEntries] = useState<ArchiveEntry[] | null>(null);
|
||||
|
||||
useEffect(() => {
|
||||
apiFetch<ArchiveEntry[]>("/api/archive").then(setEntries).catch(() => setEntries([]));
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<div>
|
||||
<h1 className="page-title">포스터 숏폼 아카이브</h1>
|
||||
<p className="page-subtitle" style={{ marginBottom: "2rem" }}>
|
||||
만들어진 모든 포스터 숏폼이 메타태그와 함께 쌓입니다. 행사·지역·키워드로 축적되는 온라인 숏폼 광고판입니다.
|
||||
</p>
|
||||
|
||||
{entries === null && <p style={{ color: "var(--text-teal-1)" }}>불러오는 중…</p>}
|
||||
{entries?.length === 0 && <p style={{ color: "var(--text-teal-3)" }}>아직 아카이브된 영상이 없습니다.</p>}
|
||||
|
||||
<div style={{ display: "grid", gridTemplateColumns: "repeat(auto-fill, minmax(220px, 1fr))", gap: "var(--s-5)" }}>
|
||||
{entries?.map((e) => (
|
||||
<Link key={e.slug} href={`/archive/${e.slug}`} style={{ textDecoration: "none", color: "inherit" }}>
|
||||
<div className="card" style={{ overflow: "hidden" }}>
|
||||
{/* eslint-disable-next-line @next/next/no-img-element */}
|
||||
<img src={e.poster_url} alt={e.name}
|
||||
style={{ width: "100%", aspectRatio: "3/4", objectFit: "cover", display: "block" }} />
|
||||
<div style={{ padding: "var(--s-4)" }}>
|
||||
<span className="tag" style={{ height: 20, padding: "0 8px", fontSize: "var(--text-xs)", marginBottom: "var(--s-2)" }}>{archiveKind(e)}</span>
|
||||
<p style={{ margin: 0, fontSize: 15, fontWeight: 800 }}>{e.metadata?.event_name ?? e.name}</p>
|
||||
<p style={{ margin: "var(--s-1) 0 0", fontSize: 13, color: "var(--text-teal-1)" }}>
|
||||
{e.metadata?.place}{e.metadata?.category ? ` · ${e.metadata.category}` : ""}
|
||||
</p>
|
||||
<div style={{ marginTop: "var(--s-3)", display: "flex", flexWrap: "wrap", gap: "var(--s-1)" }}>
|
||||
{(e.metadata?.keywords ?? []).slice(0, 3).map((k) => (
|
||||
<span key={k} className="tag" style={{ fontSize: 12 }}>{k}</span>
|
||||
))}
|
||||
{(e.metadata?.keywords?.length ?? 0) > 3 && (
|
||||
<span className="tag" style={{ fontSize: 12 }}>+{(e.metadata!.keywords.length - 3)}</span>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Link>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
import type { Metadata } from "next";
|
||||
import Link from "next/link";
|
||||
import Ado2Logo from "@/components/ado2-logo";
|
||||
import NavLink from "@/components/nav-link";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "ADO2 무빙포스터",
|
||||
description: "포스터 한 장으로 세로 영상을 만듭니다",
|
||||
};
|
||||
|
||||
export default function Ado2Layout({ children }: { children: React.ReactNode }) {
|
||||
return (
|
||||
<>
|
||||
<aside className="sidebar">
|
||||
<div className="sidebar-logo">
|
||||
<Link href="/" style={{ color: "var(--color-text-white)", display: "inline-flex", alignItems: "baseline", gap: 8, textDecoration: "none" }}>
|
||||
<Ado2Logo height={20} />
|
||||
<span className="sidebar-product">MOVING POSTER</span>
|
||||
</Link>
|
||||
</div>
|
||||
<nav className="sidebar-menu">
|
||||
<NavLink href="/" icon="video">무빙포스터</NavLink>
|
||||
<NavLink href="/studio" icon="image">포스터 스타일링</NavLink>
|
||||
<NavLink href="/archive" icon="folder">아카이브</NavLink>
|
||||
</nav>
|
||||
<div className="sidebar-foot">무빙포스터 · 내부 빌드</div>
|
||||
</aside>
|
||||
<main className="main-content">
|
||||
<div style={{ maxWidth: 1080, margin: "0 auto" }}>{children}</div>
|
||||
</main>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect, useState } from "react";
|
||||
import Link from "next/link";
|
||||
import { apiFetch, type Job } from "@/lib/api";
|
||||
import { GATE_META, type PlayreelJob } from "@/lib/playreel";
|
||||
|
||||
/* 무빙포스터 진입 — 두 갈래 (MOVING_POSTER_ENTRY_PLAN.md §1·§5) */
|
||||
|
||||
const ENTRIES = [
|
||||
{
|
||||
href: "/poster", icon: "IMG", title: "이미지로 시작하기",
|
||||
desc: "포스터 한 장이 첫 프레임 그대로 살아나는 8~15초 무빙포스터",
|
||||
flow: ["포스터 원본이 첫 프레임", "불꽃·물결·조명 등 요소만 움직임", "제목·일시 나레이션 + 음악"],
|
||||
facts: [["필요한 것", "이미지 1장"], ["확인", "1회"], ["시간", "약 3분"], ["비용", "14크레딧"]],
|
||||
cta: "포스터 올리기", hot: false, badge: null,
|
||||
},
|
||||
{
|
||||
href: "/playreel", icon: "URL", title: "공연상품페이지로 시작하기",
|
||||
desc: "상품페이지 주소 하나로 캐스팅·일정·줄거리까지 담긴 30초 예고편",
|
||||
flow: ["포스터 무빙 훅 8초", "상세페이지 스크롤 (줄거리·캐스트·캐스팅 스케줄·할인)", "예매 안내 밴드 + QR"],
|
||||
facts: [["필요한 것", "상품페이지 URL"], ["확인", "5회"], ["시간", "약 15분"], ["비용", "16크레딧"]],
|
||||
cta: "주소 넣기", hot: true, badge: "상세페이지까지",
|
||||
},
|
||||
] as const;
|
||||
|
||||
type Recent = { id: string; name: string; href: string; kind: "이미지" | "상품페이지"; label: string; tone: string };
|
||||
|
||||
const F1_STATUS: Record<string, string> = {
|
||||
queued: "대기 중", running: "만드는 중", awaiting_review: "검수 대기", failed: "실패", done: "완료",
|
||||
};
|
||||
|
||||
function tone(status: string) {
|
||||
return status === "failed" ? "#ff7a7a" : status === "done" ? "var(--color-mint)" : status === "awaiting_review" ? "#ffd27a" : "var(--color-text-gray-400)";
|
||||
}
|
||||
|
||||
export default function HomePage() {
|
||||
const [recent, setRecent] = useState<Recent[]>([]);
|
||||
|
||||
useEffect(() => {
|
||||
// 두 갈래의 최근 작업을 합쳐 최신순 6개. 한쪽 API가 없어도(playreel 미구현) 다른 쪽은 보인다.
|
||||
Promise.all([
|
||||
apiFetch<Job[]>("/api/f1/jobs").catch(() => [] as Job[]),
|
||||
apiFetch<PlayreelJob[]>("/api/playreel/jobs").catch(() => [] as PlayreelJob[]),
|
||||
]).then(([f1, pr]) => {
|
||||
const a: (Recent & { t: number })[] = [
|
||||
...f1.map((j) => ({ id: j.id, name: j.name, href: `/poster/${j.id}`, kind: "이미지" as const, label: F1_STATUS[j.status] ?? j.status, tone: tone(j.status), t: j.created_at })),
|
||||
...pr.map((j) => ({ id: j.id, name: j.name, href: `/playreel/${j.id}`, kind: "상품페이지" as const,
|
||||
label: j.status === "awaiting_review" && j.gate ? `${GATE_META[j.gate].name} 대기` : (F1_STATUS[j.status] ?? j.status), tone: tone(j.status), t: j.created_at })),
|
||||
];
|
||||
setRecent(a.sort((x, y) => y.t - x.t).slice(0, 6));
|
||||
});
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<div style={{ display: "flex", flexDirection: "column", alignItems: "center", paddingTop: "1.5rem" }}>
|
||||
<h1 className="page-title">어떻게 시작할까요?</h1>
|
||||
<p className="page-subtitle">가진 것에 따라 고르세요. 둘 다 9:16 세로 영상으로 완성됩니다.</p>
|
||||
|
||||
<div className="entry-stack">
|
||||
{ENTRIES.map((e) => (
|
||||
<div key={e.href} className={`card entry${e.hot ? " entry--hot" : ""}`}>
|
||||
{e.badge && <span className="entry-badge">{e.badge}</span>}
|
||||
<div className="entry-head">
|
||||
<div className="entry-icon">{e.icon}</div>
|
||||
<div>
|
||||
<h2 className="entry-title">{e.title}</h2>
|
||||
<p className="entry-desc">{e.desc}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div className="entry-flow">
|
||||
{e.flow.map((f, i) => (
|
||||
<span key={f} style={{ display: "contents" }}>
|
||||
{i > 0 && <em>→</em>}
|
||||
<span>{f}</span>
|
||||
</span>
|
||||
))}
|
||||
</div>
|
||||
<div className="entry-facts">
|
||||
{e.facts.map(([k, v]) => (
|
||||
<div key={k}><b>{k}</b><span>{v}</span></div>
|
||||
))}
|
||||
</div>
|
||||
<Link href={e.href} className="btn-cta btn-lg" style={{ textDecoration: "none" }}>{e.cta}</Link>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
|
||||
{recent.length > 0 && (
|
||||
<div style={{ width: "100%", maxWidth: 560, marginTop: "2.5rem" }}>
|
||||
<p className="field-label" style={{ margin: "0 0 0.75rem" }}>최근 작업</p>
|
||||
<div style={{ display: "grid", gridTemplateColumns: "repeat(auto-fill, minmax(160px, 1fr))", gap: "0.75rem" }}>
|
||||
{recent.map((j) => (
|
||||
<Link key={j.href} href={j.href} style={{ textDecoration: "none", color: "inherit" }}>
|
||||
<div className="card-inner" style={{ padding: "1rem" }}>
|
||||
<span className="tag" style={{ height: 20, padding: "0 8px", fontSize: "var(--text-xs)" }}>{j.kind}</span>
|
||||
<p style={{ margin: "0.5rem 0 0", fontSize: "var(--text-sm)", fontWeight: 700, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>{j.name}</p>
|
||||
<p style={{ margin: "0.35rem 0 0", fontSize: "var(--text-xs)", fontWeight: 600, color: j.tone }}>{j.label}</p>
|
||||
</div>
|
||||
</Link>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,333 @@
|
||||
"use client";
|
||||
|
||||
import { use, useEffect, useState } from "react";
|
||||
import Link from "next/link";
|
||||
import { useRouter } from "next/navigation";
|
||||
import StageStepper, { stageProgress } from "@/components/stage-stepper";
|
||||
import MetadataCard from "@/components/metadata-card";
|
||||
import { apiFetch, useJob } from "@/lib/api";
|
||||
|
||||
const SUBTITLES: Record<string, string> = {
|
||||
queued: "대기 중입니다. 앞선 작업이 끝나면 자동으로 시작됩니다",
|
||||
running: "AI 분석 및 편집을 통해 콘텐츠를 만들고 있습니다",
|
||||
awaiting_review: "나레이션과 모션을 확인하고 승인하면 음성·음악·렌더가 이어집니다",
|
||||
failed: "작업이 중단되었습니다. 오류를 확인하고 다시 시도해 주세요",
|
||||
done: "AI 분석 및 편집을 통해 최적화된 콘텐츠가 완성되었습니다",
|
||||
};
|
||||
|
||||
// scripts/motion_plan.py의 MOTION_PHRASE 화이트리스트와 1:1. 여기 없는 키는 서버가 422로 거른다.
|
||||
const MOTION_LABELS: Record<string, string> = {
|
||||
firework: "불꽃놀이", water: "물살", wave: "파도", cloud: "구름", smoke: "연기",
|
||||
moon: "달", sun: "해", star: "별", light: "조명", flag: "깃발·천",
|
||||
foliage: "나뭇잎·풀", wheel: "바퀴·관람차", vessel: "배", crowd: "사람 무리",
|
||||
};
|
||||
|
||||
export default function JobPage({ params }: { params: Promise<{ id: string }> }) {
|
||||
const { id } = use(params);
|
||||
const router = useRouter();
|
||||
const { job, error, refresh } = useJob("f1", id);
|
||||
const [lines, setLines] = useState<string[]>([]);
|
||||
const [motions, setMotions] = useState<string[] | null>(null);
|
||||
const [meta, setMeta] = useState({ event_name: "", date_text: "", place: "" });
|
||||
const [metaLoaded, setMetaLoaded] = useState(false);
|
||||
const [busy, setBusy] = useState(false);
|
||||
const [actionError, setActionError] = useState<string | null>(null);
|
||||
|
||||
// 아래 3개 effect: 서버 잡이 처음 도착했을 때 편집 상태를 한 번 시딩한다(이후 사용자 편집 우선).
|
||||
useEffect(() => {
|
||||
// eslint-disable-next-line react-hooks/set-state-in-effect -- 최초 1회 시딩
|
||||
if (job?.narration && lines.length === 0) setLines(job.narration);
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [job?.narration]);
|
||||
|
||||
useEffect(() => {
|
||||
// 0종([])도 유효한 초기값이므로 null(미로딩)로만 판별한다
|
||||
if (job && motions === null && job.motion_elements !== undefined && job.motion_elements !== null)
|
||||
// eslint-disable-next-line react-hooks/set-state-in-effect -- 최초 1회 시딩
|
||||
setMotions(job.motion_elements);
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [job?.motion_elements]);
|
||||
|
||||
useEffect(() => {
|
||||
if (job?.metadata && !metaLoaded) {
|
||||
// eslint-disable-next-line react-hooks/set-state-in-effect -- 최초 1회 시딩
|
||||
setMeta({
|
||||
event_name: job.metadata.event_name ?? "",
|
||||
date_text: job.metadata.date_text ?? "",
|
||||
place: job.metadata.place ?? "",
|
||||
});
|
||||
setMetaLoaded(true);
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [job?.metadata]);
|
||||
|
||||
if (error) return <p style={{ color: "#ff7a7a" }}>{error}</p>;
|
||||
if (!job) return <p style={{ color: "var(--color-text-gray-400)" }}>불러오는 중…</p>;
|
||||
|
||||
const approve = async () => {
|
||||
setBusy(true);
|
||||
setActionError(null);
|
||||
try {
|
||||
if (JSON.stringify(lines) !== JSON.stringify(job.narration)) {
|
||||
await apiFetch(`/api/f1/jobs/${id}/narration`, {
|
||||
method: "PUT",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({ narration: lines }),
|
||||
});
|
||||
}
|
||||
const md = job.metadata;
|
||||
if (md && (md.event_name !== meta.event_name || md.date_text !== meta.date_text || md.place !== meta.place)) {
|
||||
await apiFetch(`/api/f1/jobs/${id}/metadata`, {
|
||||
method: "PUT",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify(meta),
|
||||
});
|
||||
}
|
||||
const motionsChanged = motions !== null &&
|
||||
JSON.stringify([...motions].sort()) !== JSON.stringify([...(job.motion_elements ?? [])].sort());
|
||||
await apiFetch(`/api/f1/jobs/${id}/approve`, {
|
||||
method: "POST",
|
||||
...(motionsChanged ? {
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({ motions }),
|
||||
} : {}),
|
||||
});
|
||||
refresh();
|
||||
} catch (e) {
|
||||
setActionError((e as Error).message);
|
||||
} finally {
|
||||
setBusy(false);
|
||||
}
|
||||
};
|
||||
|
||||
const retry = async () => {
|
||||
setBusy(true);
|
||||
setActionError(null);
|
||||
try {
|
||||
const motionsChanged = motions !== null &&
|
||||
JSON.stringify([...motions].sort()) !== JSON.stringify([...(job!.motion_elements ?? [])].sort());
|
||||
await apiFetch(`/api/f1/jobs/${id}/retry`, {
|
||||
method: "POST",
|
||||
...(motionsChanged ? {
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({ motions }),
|
||||
} : {}),
|
||||
});
|
||||
refresh();
|
||||
} catch (e) {
|
||||
setActionError((e as Error).message);
|
||||
} finally {
|
||||
setBusy(false);
|
||||
}
|
||||
};
|
||||
|
||||
const remove = async () => {
|
||||
if (!confirm(`"${job.name}" 작업과 만들어진 영상·음성·분석 파일을 모두 지웁니다. 되돌릴 수 없습니다.`)) return;
|
||||
setBusy(true);
|
||||
setActionError(null);
|
||||
try {
|
||||
await apiFetch(`/api/f1/jobs/${id}`, { method: "DELETE" });
|
||||
router.push("/");
|
||||
} catch (e) {
|
||||
setActionError((e as Error).message);
|
||||
setBusy(false);
|
||||
}
|
||||
};
|
||||
|
||||
const pct = stageProgress(job);
|
||||
|
||||
return (
|
||||
<div>
|
||||
<div style={{ display: "flex", alignItems: "flex-start" }}>
|
||||
<Link href="/" className="btn-back">‹ 뒤로가기</Link>
|
||||
{job.status !== "running" && (
|
||||
<button onClick={remove} disabled={busy} className="btn-back"
|
||||
style={{ marginLeft: "auto", color: "#ff8c8c", borderColor: "rgba(255,140,140,0.4)" }}>
|
||||
작업 삭제
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className="stepper-scroll"><StageStepper job={job} /></div>
|
||||
|
||||
<h1 className="page-title">
|
||||
{job.status === "done" ? "콘텐츠 제작 완료" : job.name}
|
||||
</h1>
|
||||
<p className="page-subtitle">{SUBTITLES[job.status]}</p>
|
||||
|
||||
<div className="card" style={{ marginTop: "2rem", padding: "var(--spacing-page-md)" }}>
|
||||
|
||||
{(job.status === "running" || job.status === "queued") && (
|
||||
<div style={{ display: "flex", flexDirection: "column", alignItems: "center", padding: "3rem 0", gap: "1.5rem" }}>
|
||||
<div className="gen-spinner" />
|
||||
<p style={{ margin: 0, fontSize: "var(--text-base)", color: "var(--color-text-gray-300)" }}>
|
||||
생성 중 (음악 단계는 몇 분 걸릴 수 있습니다)
|
||||
</p>
|
||||
<div style={{ width: 320 }}>
|
||||
<div className="progress-bar-container">
|
||||
<div className="progress-bar-fill" style={{ width: `${pct}%` }} />
|
||||
</div>
|
||||
<p style={{ textAlign: "center", margin: "0.5rem 0 0", fontSize: "var(--text-sm)", color: "var(--color-text-gray-400)" }}>{pct}%</p>
|
||||
</div>
|
||||
{job.narration && (
|
||||
<div className="card-inner" style={{ maxWidth: 520, width: "100%" }}>
|
||||
<p className="field-label" style={{ margin: "0 0 0.5rem" }}>나레이션</p>
|
||||
{job.narration.map((s, i) => (
|
||||
<p key={i} style={{ margin: "0.25rem 0", fontSize: "var(--text-base)", color: "var(--color-text-gray-300)" }}>{s}</p>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{job.status === "awaiting_review" && (
|
||||
<div style={{ display: "grid", gridTemplateColumns: "1fr 1fr", gap: "var(--spacing-page-md)", alignItems: "start" }}>
|
||||
<div>
|
||||
<p className="eyebrow" style={{ margin: "0 0 1rem" }}>나레이션 검수</p>
|
||||
<p style={{ fontSize: "var(--text-base)", color: "var(--color-text-gray-400)", margin: "0 0 1rem", lineHeight: 1.6 }}>
|
||||
자동 작성된 3문장을 확인하고 필요하면 고쳐주세요.
|
||||
</p>
|
||||
{lines.map((s, i) => (
|
||||
<input key={i} className="input" value={s} style={{ marginBottom: "0.5rem" }}
|
||||
onChange={(e) => setLines(lines.map((v, j) => (j === i ? e.target.value : v)))} />
|
||||
))}
|
||||
|
||||
<p className="eyebrow" style={{ margin: "1.5rem 0 0.5rem" }}>움직일 요소</p>
|
||||
<p style={{ fontSize: "var(--text-sm)", color: "var(--color-text-gray-400)", margin: "0 0 0.75rem", lineHeight: 1.6 }}>
|
||||
{motions !== null && motions.length === 0
|
||||
? "포스터에서 움직일 요소를 찾지 못했습니다. 직접 골라 추가하거나, 비워두면 애니메이션 없이 중단됩니다."
|
||||
: "AI가 포스터에서 찾은 요소입니다. 빼거나 더할 수 있습니다."}
|
||||
</p>
|
||||
<div style={{ display: "flex", flexWrap: "wrap", gap: "0.5rem" }}>
|
||||
{Object.entries(MOTION_LABELS).map(([key, label]) => {
|
||||
const on = motions?.includes(key) ?? false;
|
||||
return (
|
||||
<button key={key} type="button"
|
||||
onClick={() => setMotions(on ? (motions ?? []).filter((m) => m !== key)
|
||||
: [...(motions ?? []), key])}
|
||||
style={{
|
||||
padding: "0.35rem 0.8rem", borderRadius: 999, cursor: "pointer",
|
||||
fontSize: "var(--text-sm)",
|
||||
border: on ? "1px solid var(--color-mint)" : "1px solid var(--color-border-white-10)",
|
||||
background: on ? "var(--color-mint-20)" : "transparent",
|
||||
color: on ? "var(--color-mint)" : "var(--color-text-gray-400)",
|
||||
}}>
|
||||
{on ? "✓ " : "+ "}{label}
|
||||
</button>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
|
||||
<p className="eyebrow" style={{ margin: "1.5rem 0 0.5rem" }}>메타태그</p>
|
||||
<p style={{ fontSize: "var(--text-sm)", color: "var(--color-text-gray-400)", margin: "0 0 0.75rem", lineHeight: 1.6 }}>
|
||||
아카이브에 영구 저장됩니다. 연도나 지명이 잘못 읽혔는지 포스터와 대조해 주세요.
|
||||
</p>
|
||||
{([
|
||||
["event_name", "행사명"],
|
||||
["date_text", "일시"],
|
||||
["place", "장소"],
|
||||
] as const).map(([key, label]) => (
|
||||
<div key={key} style={{ display: "flex", alignItems: "center", gap: "0.75rem", marginBottom: "0.5rem" }}>
|
||||
<span style={{ width: 52, flexShrink: 0, fontSize: "var(--text-sm)", color: "var(--color-text-gray-400)" }}>{label}</span>
|
||||
<input className="input" value={meta[key]}
|
||||
onChange={(e) => setMeta({ ...meta, [key]: e.target.value })} />
|
||||
</div>
|
||||
))}
|
||||
|
||||
<button className="btn-cta btn-lg" style={{ marginTop: "1rem" }} disabled={busy} onClick={approve}>
|
||||
승인하고 계속
|
||||
</button>
|
||||
{actionError && <p style={{ color: "#ff7a7a", fontSize: "var(--text-sm)", marginTop: "0.75rem" }}>{actionError}</p>}
|
||||
</div>
|
||||
<div>
|
||||
<p className="eyebrow" style={{ margin: "0 0 1rem" }}>포스터 분석 결과</p>
|
||||
{job.artifacts.check_jpg && (
|
||||
// eslint-disable-next-line @next/next/no-img-element
|
||||
<img src={job.artifacts.check_jpg} alt="영역 분석 확인 이미지" className="card-inner"
|
||||
style={{ width: "100%", padding: 0, display: "block" }} />
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{job.status === "failed" && job.error && (
|
||||
<div style={{ maxWidth: 640, margin: "0 auto" }}>
|
||||
<p className="eyebrow" style={{ color: "#ff8c8c", margin: "0 0 1rem" }}>
|
||||
실패 · {job.error.stage}
|
||||
</p>
|
||||
<pre className="card-inner" style={{
|
||||
fontSize: "var(--text-sm)", whiteSpace: "pre-wrap", wordBreak: "break-all",
|
||||
maxHeight: 280, overflow: "auto", color: "var(--color-text-gray-400)", margin: 0,
|
||||
}}>{job.error.detail}</pre>
|
||||
{job.error.stage === "i2v" && motions !== null && (
|
||||
<div style={{ marginTop: "1.25rem" }}>
|
||||
<p style={{ fontSize: "var(--text-sm)", color: "var(--color-text-gray-400)", margin: "0 0 0.6rem" }}>
|
||||
움직일 요소를 바꿔 다시 시도할 수 있습니다:
|
||||
</p>
|
||||
<div style={{ display: "flex", flexWrap: "wrap", gap: "0.5rem" }}>
|
||||
{Object.entries(MOTION_LABELS).map(([key, label]) => {
|
||||
const on = motions.includes(key);
|
||||
return (
|
||||
<button key={key} type="button"
|
||||
onClick={() => setMotions(on ? motions.filter((m) => m !== key) : [...motions, key])}
|
||||
style={{
|
||||
padding: "0.35rem 0.8rem", borderRadius: 999, cursor: "pointer",
|
||||
fontSize: "var(--text-sm)",
|
||||
border: on ? "1px solid var(--color-mint)" : "1px solid var(--color-border-white-10)",
|
||||
background: on ? "var(--color-mint-20)" : "transparent",
|
||||
color: on ? "var(--color-mint)" : "var(--color-text-gray-400)",
|
||||
}}>
|
||||
{on ? "✓ " : "+ "}{label}
|
||||
</button>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
<div style={{ display: "flex", justifyContent: "center", marginTop: "1.5rem" }}>
|
||||
<button className="btn-outline" disabled={busy} onClick={retry}>재시도</button>
|
||||
</div>
|
||||
{actionError && <p style={{ color: "#ff7a7a", fontSize: "var(--text-sm)", marginTop: "0.75rem", textAlign: "center" }}>{actionError}</p>}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{job.status === "done" && job.artifacts.video && (
|
||||
<div style={{ display: "grid", gridTemplateColumns: "1fr 1fr", gap: "var(--spacing-page-md)", alignItems: "stretch" }}>
|
||||
<div className="card-inner" style={{ display: "flex", alignItems: "center", justifyContent: "center" }}>
|
||||
<video src={job.artifacts.video} controls
|
||||
style={{ width: "100%", maxHeight: 560, borderRadius: "var(--radius-md)", display: "block" }} />
|
||||
</div>
|
||||
<div style={{ display: "flex", flexDirection: "column", borderLeft: "2px solid var(--color-mint-20)", paddingLeft: "var(--spacing-page)" }}>
|
||||
<p className="field-label" style={{ margin: 0 }}>파일명</p>
|
||||
<p style={{ margin: "0.25rem 0 1rem", fontSize: "var(--text-xl)", fontWeight: 700, lineHeight: 1.35 }}>
|
||||
{job.name}.mp4
|
||||
</p>
|
||||
{job.metadata && (
|
||||
<div style={{ borderTop: "1px solid var(--color-border-white-10)", paddingTop: "1rem" }}>
|
||||
<MetadataCard meta={job.metadata} bare />
|
||||
</div>
|
||||
)}
|
||||
{job.narration && (
|
||||
<div style={{ borderTop: "1px solid var(--color-border-white-10)", marginTop: "1rem", paddingTop: "1rem" }}>
|
||||
<p className="field-label" style={{ margin: "0 0 0.5rem" }}>나레이션</p>
|
||||
{job.narration.map((s, i) => (
|
||||
<p key={i} style={{ margin: "0.35rem 0", fontSize: "var(--text-base)", color: "var(--color-text-gray-300)" }}>{s}</p>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
<div style={{ marginTop: "auto", paddingTop: "1.5rem", display: "grid", gridTemplateColumns: "1fr 1fr", gap: "0.75rem" }}>
|
||||
{job.artifacts.thumbnail ? (
|
||||
<a href={job.artifacts.thumbnail} download className="btn-tonal-mint">정지 컷 JPG</a>
|
||||
) : <span />}
|
||||
<a href={job.artifacts.video} download className="btn-cta"
|
||||
style={{ padding: "0.75rem 1rem", fontSize: "var(--text-base)", borderRadius: "var(--radius-xl)", textDecoration: "none" }}>
|
||||
MP4 다운로드
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
"use client";
|
||||
|
||||
import { useState } from "react";
|
||||
import Link from "next/link";
|
||||
import { useRouter } from "next/navigation";
|
||||
import PosterDropzone from "@/components/poster-dropzone";
|
||||
import { apiFetch } from "@/lib/api";
|
||||
|
||||
export default function HomePage() {
|
||||
const router = useRouter();
|
||||
const [file, setFile] = useState<File | null>(null);
|
||||
const [name, setName] = useState("");
|
||||
const [busy, setBusy] = useState(false);
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
|
||||
const submit = async () => {
|
||||
if (!file) return;
|
||||
setBusy(true);
|
||||
setError(null);
|
||||
try {
|
||||
const fd = new FormData();
|
||||
fd.append("poster", file);
|
||||
fd.append("name", name);
|
||||
const { id } = await apiFetch<{ id: string }>("/api/f1/jobs", { method: "POST", body: fd });
|
||||
router.push(`/poster/${id}`);
|
||||
} catch (e) {
|
||||
setError((e as Error).message);
|
||||
setBusy(false);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div style={{ display: "flex", flexDirection: "column", alignItems: "center", paddingTop: "0.5rem" }}>
|
||||
<Link href="/" className="btn-back" style={{ alignSelf: "flex-start" }}>‹ 시작 방법 고르기</Link>
|
||||
<h1 className="page-title" style={{ marginTop: "1.25rem" }}>포스터를 올려주세요</h1>
|
||||
<p className="page-subtitle">나레이션·음악·연출까지 자동으로 만들어 9:16 숏폼으로 완성합니다</p>
|
||||
|
||||
<div style={{ width: "100%", maxWidth: 480, marginTop: "2.5rem", display: "flex", flexDirection: "column", gap: "1rem" }}>
|
||||
<PosterDropzone file={file} onFile={setFile} />
|
||||
<input
|
||||
className="input input--center"
|
||||
placeholder="행사 이름을 입력하세요 (비우면 자동 추출)"
|
||||
value={name}
|
||||
onChange={(e) => setName(e.target.value)}
|
||||
/>
|
||||
{error && <p style={{ color: "#ff7a7a", fontSize: "var(--text-sm)", textAlign: "center", margin: 0 }}>{error}</p>}
|
||||
<button className="btn-cta btn-lg" disabled={!file || busy} onClick={submit}>
|
||||
{busy ? "업로드 중…" : <>숏폼 만들기 <span className="btn-sub">14크레딧</span></>}
|
||||
</button>
|
||||
<p className="note">공연 상품페이지 주소가 있나요? <Link href="/playreel">상품페이지로 시작하면 캐스팅·일정까지 담깁니다 →</Link></p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,303 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import PosterDropzone from "@/components/poster-dropzone";
|
||||
import {
|
||||
InternalOnlyWarning, LicenseBadge, UserReferenceNotice,
|
||||
} from "@/components/license-badge";
|
||||
import { apiFetch, useJob, type F2Category, type F2Template } from "@/lib/api";
|
||||
|
||||
interface F2Format { id: string; label: string }
|
||||
interface UploadHint { enabled: boolean; min_long_edge: number }
|
||||
|
||||
const USER_CATEGORY = "user";
|
||||
|
||||
export default function StudioPage() {
|
||||
const [templates, setTemplates] = useState<F2Template[]>([]);
|
||||
const [categories, setCategories] = useState<F2Category[]>([]);
|
||||
const [formats, setFormats] = useState<F2Format[]>([]);
|
||||
const [file, setFile] = useState<File | null>(null);
|
||||
const [selected, setSelected] = useState<string | null>(null);
|
||||
const [format, setFormat] = useState("poster");
|
||||
const [jobId, setJobId] = useState<string | null>(null);
|
||||
const [busy, setBusy] = useState(false);
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
const [tplOpen, setTplOpen] = useState(true);
|
||||
const [hint, setHint] = useState<UploadHint | null>(null);
|
||||
const [refBusy, setRefBusy] = useState(false);
|
||||
const refInput = useRef<HTMLInputElement>(null);
|
||||
const { job } = useJob("f2", jobId);
|
||||
|
||||
const selectedTpl = templates.find((t) => t.id === selected) ?? null;
|
||||
|
||||
const loadTemplates = () =>
|
||||
apiFetch<F2Template[]>("/api/f2/templates").then(setTemplates);
|
||||
|
||||
useEffect(() => {
|
||||
loadTemplates().catch((e) => setError(e.message));
|
||||
apiFetch<F2Category[]>("/api/f2/categories").then(setCategories).catch(() => {});
|
||||
apiFetch<F2Format[]>("/api/f2/formats").then(setFormats).catch(() => {});
|
||||
apiFetch<UploadHint>("/api/f2/upload-hint").then(setHint).catch(() => {});
|
||||
}, []);
|
||||
|
||||
/** 레퍼런스 업로드 — 저장 + vision 분석까지 서버가 동기로 끝낸다(10초 안팎) */
|
||||
const uploadReference = async (f: File) => {
|
||||
setRefBusy(true);
|
||||
setError(null);
|
||||
try {
|
||||
const fd = new FormData();
|
||||
fd.append("reference", f);
|
||||
fd.append("name", f.name.replace(/\.[^.]+$/, "").slice(0, 40));
|
||||
const t = await apiFetch<F2Template>("/api/f2/templates", { method: "POST", body: fd });
|
||||
await loadTemplates();
|
||||
setSelected(t.id); // 방금 올린 것을 바로 고른 상태로
|
||||
} catch (e) {
|
||||
setError((e as Error).message);
|
||||
} finally {
|
||||
setRefBusy(false);
|
||||
if (refInput.current) refInput.current.value = "";
|
||||
}
|
||||
};
|
||||
|
||||
const removeReference = async (id: string) => {
|
||||
if (!confirm("이 레퍼런스를 삭제할까요? 되돌릴 수 없습니다.")) return;
|
||||
try {
|
||||
await apiFetch(`/api/f2/templates/${id}`, { method: "DELETE" });
|
||||
if (selected === id) setSelected(null);
|
||||
await loadTemplates();
|
||||
} catch (e) {
|
||||
setError((e as Error).message);
|
||||
}
|
||||
};
|
||||
|
||||
const submit = async () => {
|
||||
if (!file || !selected) return;
|
||||
setBusy(true);
|
||||
setError(null);
|
||||
try {
|
||||
const fd = new FormData();
|
||||
fd.append("poster", file);
|
||||
fd.append("template_id", selected);
|
||||
fd.append("format", format);
|
||||
const { id } = await apiFetch<{ id: string }>("/api/f2/jobs", { method: "POST", body: fd });
|
||||
setJobId(id);
|
||||
} catch (e) {
|
||||
setError((e as Error).message);
|
||||
} finally {
|
||||
setBusy(false);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
const renderCard = (t: F2Template) => (
|
||||
<div key={t.id} style={{ position: "relative" }}>
|
||||
<button onClick={() => setSelected(t.id)}
|
||||
className={selected === t.id ? "btn-select selected" : "btn-select"}
|
||||
style={{ width: "100%", height: "100%", padding: "0.5rem", display: "flex", flexDirection: "column", gap: "0.5rem", alignItems: "stretch" }}>
|
||||
{/* 명화는 가로 그림도 있다. cover로 자르면 파도가 잘려 무엇인지 알 수 없다 */}
|
||||
{/* eslint-disable-next-line @next/next/no-img-element */}
|
||||
<img src={t.thumb_url} alt={t.name_ko}
|
||||
style={{
|
||||
width: "100%", aspectRatio: "2/3", objectFit: "contain", display: "block",
|
||||
borderRadius: "var(--radius-md)", background: "var(--color-bg-darker)",
|
||||
}} />
|
||||
<span style={{ fontSize: "var(--text-sm)", fontWeight: 700, whiteSpace: "normal", lineHeight: 1.3 }}>
|
||||
{t.name_ko}
|
||||
</span>
|
||||
{/* 제목이 1줄인 카드와 2줄인 카드가 섞인다. 그리드가 높이를 맞춰주므로
|
||||
배지를 아래로 밀어붙이면 한 행의 배지가 같은 선에 선다 */}
|
||||
<span style={{ display: "flex", marginTop: "auto" }}>
|
||||
<LicenseBadge license={t.license} />
|
||||
</span>
|
||||
</button>
|
||||
{t.removable && (
|
||||
<button onClick={() => removeReference(t.id)} title="레퍼런스 삭제"
|
||||
style={{
|
||||
position: "absolute", top: 10, right: 10, width: 26, height: 26,
|
||||
borderRadius: "var(--radius-full)", border: "1px solid var(--color-border-white-10)",
|
||||
background: "rgba(0,0,0,0.62)", color: "var(--color-text-gray-300)",
|
||||
cursor: "pointer", fontSize: 15, lineHeight: 1, fontFamily: "var(--font)",
|
||||
}}>×</button>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
|
||||
const running = job && (job.status === "queued" || job.status === "running");
|
||||
|
||||
return (
|
||||
<div>
|
||||
<h1 className="page-title">포스터 스타일링</h1>
|
||||
<p className="page-subtitle">
|
||||
내 포스터를 명화·고전화·영화 포스터의 화법으로 재해석합니다. 행사명·날짜·장소 텍스트는 그대로 유지됩니다.
|
||||
</p>
|
||||
|
||||
<div className="card" style={{ maxWidth: 880, margin: "1.5rem auto 0", padding: "var(--spacing-page-md)" }}>
|
||||
{/* 스타일 템플릿 — 접이식, 종류가 늘어나도 접어둘 수 있다 */}
|
||||
<button
|
||||
onClick={() => setTplOpen(!tplOpen)}
|
||||
style={{
|
||||
width: "100%", display: "flex", alignItems: "center", gap: "0.75rem",
|
||||
background: "none", border: "none", cursor: "pointer", padding: 0,
|
||||
fontFamily: "var(--font)", color: "var(--color-text-white)", textAlign: "left",
|
||||
}}
|
||||
>
|
||||
<span className="eyebrow">스타일 템플릿</span>
|
||||
{!tplOpen && selectedTpl && (
|
||||
<span style={{ display: "inline-flex", alignItems: "center", gap: "0.5rem" }}>
|
||||
{/* eslint-disable-next-line @next/next/no-img-element */}
|
||||
<img src={selectedTpl.thumb_url} alt="" style={{ width: 22, height: 30, objectFit: "cover", borderRadius: 4 }} />
|
||||
<span style={{ fontSize: "var(--text-base)", fontWeight: 700, color: "var(--color-mint)" }}>{selectedTpl.name_ko}</span>
|
||||
<LicenseBadge license={selectedTpl.license} />
|
||||
</span>
|
||||
)}
|
||||
{!tplOpen && !selectedTpl && (
|
||||
<span style={{ fontSize: "var(--text-base)", color: "var(--color-text-gray-500)" }}>템플릿을 선택하세요</span>
|
||||
)}
|
||||
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5"
|
||||
strokeLinecap="round" strokeLinejoin="round"
|
||||
style={{ marginLeft: "auto", color: "var(--color-text-gray-400)", transition: "transform 0.2s", transform: tplOpen ? "rotate(180deg)" : "none" }}>
|
||||
<path d="m6 9 6 6 6-6" />
|
||||
</svg>
|
||||
</button>
|
||||
{tplOpen && categories.filter((c) => c.id !== USER_CATEGORY).map((c) => {
|
||||
const items = templates.filter((t) => t.category === c.id);
|
||||
if (items.length === 0) return null;
|
||||
return (
|
||||
<div key={c.id} style={{ marginTop: "1.25rem" }}>
|
||||
<p style={{
|
||||
margin: "0 0 0.6rem", fontSize: "var(--text-sm)", fontWeight: 700,
|
||||
color: "var(--color-text-gray-400)",
|
||||
}}>
|
||||
{c.label}
|
||||
<span style={{ marginLeft: "0.5rem", fontWeight: 500, color: "var(--color-text-gray-500)" }}>
|
||||
{items.length}종
|
||||
</span>
|
||||
</p>
|
||||
<div style={{ display: "grid", gridTemplateColumns: "repeat(5, 1fr)", gap: "0.75rem" }}>
|
||||
{items.map(renderCard)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
|
||||
{/* 내 레퍼런스 — 목록이 비어도 업로드 타일은 보여야 하므로 /categories가 아니라
|
||||
upload-hint의 enabled로 렌더한다 */}
|
||||
{tplOpen && hint?.enabled && (
|
||||
<div style={{ marginTop: "1.25rem" }}>
|
||||
<p style={{
|
||||
margin: "0 0 0.6rem", fontSize: "var(--text-sm)", fontWeight: 700,
|
||||
color: "var(--color-text-gray-400)",
|
||||
}}>
|
||||
내 레퍼런스
|
||||
<span style={{ marginLeft: "0.5rem", fontWeight: 500, color: "var(--color-text-gray-500)" }}>
|
||||
직접 올린 이미지의 화법으로 변환합니다
|
||||
</span>
|
||||
</p>
|
||||
<div style={{ display: "grid", gridTemplateColumns: "repeat(5, 1fr)", gap: "0.75rem" }}>
|
||||
{templates.filter((t) => t.category === USER_CATEGORY).map(renderCard)}
|
||||
<button onClick={() => refInput.current?.click()} disabled={refBusy}
|
||||
className="btn-select"
|
||||
style={{
|
||||
padding: "0.5rem", display: "flex", flexDirection: "column",
|
||||
alignItems: "center", justifyContent: "center", gap: "0.6rem",
|
||||
minHeight: 200, borderStyle: "dashed",
|
||||
}}>
|
||||
{refBusy ? (
|
||||
<>
|
||||
<div className="gen-spinner" style={{ width: 26, height: 26, borderWidth: 3 }} />
|
||||
<span style={{ fontSize: "var(--text-sm)", fontWeight: 600 }}>화풍 분석 중…</span>
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<span style={{ fontSize: 26, lineHeight: 1, fontWeight: 300 }}>+</span>
|
||||
<span style={{ fontSize: "var(--text-sm)", fontWeight: 700 }}>레퍼런스 추가</span>
|
||||
<span style={{ fontSize: "var(--text-xs)", color: "var(--color-text-gray-500)", whiteSpace: "normal", lineHeight: 1.4 }}>
|
||||
긴 변 {hint.min_long_edge}px 이상 권장
|
||||
</span>
|
||||
</>
|
||||
)}
|
||||
</button>
|
||||
<input ref={refInput} type="file" accept="image/jpeg,image/png,image/webp,image/gif"
|
||||
style={{ display: "none" }}
|
||||
onChange={(e) => { const f = e.target.files?.[0]; if (f) uploadReference(f); }} />
|
||||
</div>
|
||||
<div style={{ marginTop: "0.75rem" }}><UserReferenceNotice /></div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* 경고는 실제로 고른 순간에만. 항상 떠 있으면 아무도 안 읽는다 */}
|
||||
{selectedTpl && selectedTpl.license === "internal-only" && (
|
||||
<div style={{ marginTop: "1.25rem" }}>
|
||||
<InternalOnlyWarning note={selectedTpl.license_note} />
|
||||
</div>
|
||||
)}
|
||||
{selectedTpl?.attribution && (
|
||||
<p style={{
|
||||
margin: "0.75rem 0 0", fontSize: "var(--text-xs)",
|
||||
color: "var(--color-text-gray-500)", lineHeight: 1.6,
|
||||
}}>
|
||||
레퍼런스 출처 · {selectedTpl.attribution}
|
||||
</p>
|
||||
)}
|
||||
|
||||
{/* 입력(=원본)과 결과, 같은 크기의 4:5 박스 */}
|
||||
<div style={{ display: "grid", gridTemplateColumns: "1fr 1fr", gap: "var(--spacing-page-md)", marginTop: "2rem" }}>
|
||||
<div>
|
||||
<p className="eyebrow" style={{ margin: "0 0 0.75rem" }}>내 포스터</p>
|
||||
<PosterDropzone file={file} onFile={setFile} />
|
||||
</div>
|
||||
<div>
|
||||
<p className="eyebrow" style={{ margin: "0 0 0.75rem" }}>결과</p>
|
||||
{job?.status === "done" && job.artifacts.image ? (
|
||||
<div className="card-inner" style={{
|
||||
aspectRatio: "4 / 5", maxWidth: 400, margin: "0 auto", overflow: "hidden",
|
||||
display: "flex", alignItems: "center", justifyContent: "center", padding: 0,
|
||||
}}>
|
||||
{/* eslint-disable-next-line @next/next/no-img-element */}
|
||||
<img src={job.artifacts.image} alt="변환 결과" style={{ width: "100%", height: "100%", objectFit: "contain" }} />
|
||||
</div>
|
||||
) : (
|
||||
<div className="card-inner" style={{
|
||||
aspectRatio: "4 / 5", maxWidth: 400, margin: "0 auto",
|
||||
display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", gap: "1rem",
|
||||
}}>
|
||||
{running && <div className="gen-spinner" style={{ width: 48, height: 48, borderWidth: 4 }} />}
|
||||
<span style={{ fontSize: "var(--text-base)", color: running ? "var(--color-text-gray-300)" : "var(--color-text-gray-500)" }}>
|
||||
{running ? "변환 중 (30초 안팎)" : "변환 결과가 여기에 표시됩니다"}
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
{job?.status === "done" && job.artifacts.image && (
|
||||
<div style={{ display: "flex", justifyContent: "center", marginTop: "0.75rem" }}>
|
||||
<a href={job.artifacts.image} download className="btn-tonal-mint">PNG 다운로드</a>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p className="eyebrow" style={{ margin: "1.5rem 0 0.75rem" }}>출력 포맷</p>
|
||||
<div style={{ display: "grid", gridTemplateColumns: "repeat(4, 1fr)", gap: "0.75rem" }}>
|
||||
{formats.map((f) => (
|
||||
<button key={f.id} onClick={() => setFormat(f.id)}
|
||||
className={format === f.id ? "btn-select selected" : "btn-select"}>
|
||||
{f.label}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
|
||||
<div style={{ display: "flex", justifyContent: "center", marginTop: "2rem" }}>
|
||||
<button className="btn-cta" disabled={!file || !selected || busy || !!running} onClick={submit}>
|
||||
{running ? "변환 중…" : busy ? "업로드 중…" : "스타일 변환"}
|
||||
</button>
|
||||
</div>
|
||||
{error && <p style={{ color: "#ff7a7a", fontSize: "var(--text-sm)", marginTop: "0.75rem", textAlign: "center" }}>{error}</p>}
|
||||
{job?.status === "failed" && job.error && (
|
||||
<pre className="card-inner" style={{
|
||||
fontSize: "var(--text-sm)", whiteSpace: "pre-wrap", color: "var(--color-text-gray-400)",
|
||||
marginTop: "1rem", maxHeight: 200, overflow: "auto",
|
||||
}}>{job.error.detail}</pre>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
import type { Metadata } from "next";
|
||||
import Link from "next/link";
|
||||
import Ado2Logo from "@/components/ado2-logo";
|
||||
import NavLink from "@/components/nav-link";
|
||||
|
||||
/* Playreel 자체 셸.
|
||||
* ADO2 BI 는 넣는다 — Playreel 은 별도 URL 로 나가지만 ADO2 제품이고,
|
||||
* 서브도메인(playreel.o2osolution.ai)을 권한 이유도 소속이 드러나는 편이 B2B 에 유리해서다.
|
||||
* 하우스 락업 문법은 (ado2) 셸과 같다: ADO2 로고 + 제품 워드마크.
|
||||
* 다만 여기서는 Playreel 이 서비스 이름이라 워드마크에 더 무게를 준다.
|
||||
*
|
||||
* ADO2 "화면"으로 건너가는 링크는 두지 않는다 — 별도 서비스가 자기 화면에서
|
||||
* 남의 서비스를 광고할 이유가 없다. 소속 표기와 이동 링크는 다른 문제다. */
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "Playreel — 공연 예고편 · ADO2",
|
||||
description: "공연 상품페이지 주소 하나로 30초 세로 예고편을 만듭니다",
|
||||
};
|
||||
|
||||
export default function PlayreelLayout({ children }: { children: React.ReactNode }) {
|
||||
return (
|
||||
<>
|
||||
<aside className="sidebar">
|
||||
<div className="sidebar-logo">
|
||||
<Link href="/playreel" className="pr-wordmark">
|
||||
<Ado2Logo height={24} />
|
||||
<span className="pr-line">
|
||||
<span className="pr-mark">PLAYREEL</span>
|
||||
<span className="pr-mark-ko">플레이릴</span>
|
||||
</span>
|
||||
</Link>
|
||||
</div>
|
||||
<nav className="sidebar-menu">
|
||||
<NavLink href="/playreel" icon="video">예고편 만들기</NavLink>
|
||||
<NavLink href="/playreel/archive" icon="folder">아카이브</NavLink>
|
||||
</nav>
|
||||
<div className="sidebar-foot">Playreel · an ADO2 product · 내부 빌드</div>
|
||||
</aside>
|
||||
<main className="main-content">
|
||||
<div style={{ maxWidth: 1080, margin: "0 auto" }}>{children}</div>
|
||||
</main>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,181 @@
|
||||
"use client";
|
||||
|
||||
import { use, useEffect, useRef, useState } from "react";
|
||||
import Link from "next/link";
|
||||
import { useRouter, useSearchParams } from "next/navigation";
|
||||
import StageStepper, { stageProgress } from "@/components/stage-stepper";
|
||||
import { GateBody, GateShell } from "@/components/gate-card";
|
||||
import { apiFetch } from "@/lib/api";
|
||||
import { GATE_META, PLAYREEL_STAGE_LABELS, usePlayreelJob } from "@/lib/playreel";
|
||||
import { useAutoApprove } from "@/lib/prefs";
|
||||
import { isAutoApprovable } from "@/components/auto-approve";
|
||||
|
||||
const RUNNING_COPY: Record<string, string> = {
|
||||
fetch: "상세페이지에서 포스터와 정보를 가져오는 중", split: "상세페이지를 섹션으로 나누는 중",
|
||||
upscale: "포스터 화질을 보정하는 중 (약 1분)", analyze: "포스터에서 움직일 요소를 찾는 중",
|
||||
motion: "연출 프롬프트를 쓰는 중", narration: "나레이션 문장을 쓰는 중",
|
||||
tts: "나레이션을 읽는 중", bgm: "배경음악을 만드는 중 (몇 분 걸릴 수 있습니다)",
|
||||
i2v: "포스터를 움직이는 중 (5~8분)", hybrid: "원본 글자를 다시 덮는 중",
|
||||
compose: "상세페이지 스크롤과 함께 조립하는 중", review: "자동 검사 중",
|
||||
};
|
||||
|
||||
export default function PlayreelJobPage({ params }: { params: Promise<{ id: string }> }) {
|
||||
const { id } = use(params);
|
||||
const router = useRouter();
|
||||
const mock = useSearchParams().get("mock");
|
||||
const { job, error, refresh } = usePlayreelJob(id, mock);
|
||||
const edits = useRef<unknown>(null);
|
||||
const [busy, setBusy] = useState(false);
|
||||
const [actionError, setActionError] = useState<string | null>(null);
|
||||
const prefs = useAutoApprove();
|
||||
const autoFired = useRef<Set<string>>(new Set()); // 같은 게이트에 두 번 보내지 않는다
|
||||
const [autoNote, setAutoNote] = useState<string | null>(null);
|
||||
|
||||
// 게이트 ①·③ 자동 승인 — 폴링이 awaiting_review 를 보는 순간 한 번만 approve. mock 은 화면 확인용이라 제외.
|
||||
const autoGate = !mock && job?.status === "awaiting_review" && isAutoApprovable(job.gate) && prefs[job.gate] ? job.gate : null;
|
||||
useEffect(() => {
|
||||
if (!autoGate || autoFired.current.has(autoGate)) return;
|
||||
autoFired.current.add(autoGate);
|
||||
const g = GATE_META[autoGate];
|
||||
apiFetch(`/api/playreel/jobs/${id}/approve`, {
|
||||
method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ gate: autoGate }),
|
||||
}).then(() => {
|
||||
setAutoNote(`${g.step}단계 ${g.name}을 자동 승인했습니다.`);
|
||||
refresh();
|
||||
}).catch((e) => {
|
||||
autoFired.current.delete(autoGate); // 실패하면 사람이 누를 수 있게 카드가 그대로 남는다
|
||||
setActionError(`자동 승인 실패 — 직접 확인해 주세요. ${(e as Error).message}`);
|
||||
});
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [autoGate, id]);
|
||||
|
||||
if (error) return <p style={{ color: "#ff7a7a" }}>{error}</p>;
|
||||
if (!job) return <p style={{ color: "var(--color-text-gray-400)" }}>불러오는 중…</p>;
|
||||
|
||||
const post = async (path: string, body?: unknown) => {
|
||||
setBusy(true);
|
||||
setActionError(null);
|
||||
try {
|
||||
if (mock) {
|
||||
// 서버 없이 화면만 볼 때 — 다음 게이트로 넘긴다
|
||||
const i = job.gate ? Object.keys(GATE_META).indexOf(job.gate) : -1;
|
||||
const next = Object.keys(GATE_META)[i + 1] ?? "done";
|
||||
router.push(`/playreel/mock?mock=${path.endsWith("back") ? Object.keys(GATE_META)[Math.max(0, i - 1)] : next}`);
|
||||
return;
|
||||
}
|
||||
await apiFetch(`/api/playreel/jobs/${id}/${path}`, {
|
||||
method: "POST",
|
||||
...(body ? { headers: { "Content-Type": "application/json" }, body: JSON.stringify(body) } : {}),
|
||||
});
|
||||
edits.current = null;
|
||||
refresh();
|
||||
} catch (e) {
|
||||
setActionError((e as Error).message);
|
||||
} finally {
|
||||
setBusy(false);
|
||||
}
|
||||
};
|
||||
|
||||
const remove = async () => {
|
||||
if (!confirm(`"${job.name}" 작업과 만들어진 파일을 모두 지웁니다. 되돌릴 수 없습니다.`)) return;
|
||||
await apiFetch(`/api/playreel/jobs/${id}`, { method: "DELETE" }).catch((e) => setActionError((e as Error).message));
|
||||
router.push("/");
|
||||
};
|
||||
|
||||
const pct = stageProgress(job);
|
||||
const gate = job.gate ? GATE_META[job.gate] : null;
|
||||
|
||||
return (
|
||||
<div>
|
||||
<div style={{ display: "flex", alignItems: "flex-start" }}>
|
||||
<Link href="/" className="btn-back">‹ 뒤로가기</Link>
|
||||
{job.status !== "running" && !mock && (
|
||||
<button onClick={remove} disabled={busy} className="btn-back" style={{ marginLeft: "auto", color: "#ff8c8c", borderColor: "rgba(255,140,140,0.4)" }}>작업 삭제</button>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className="stepper-scroll"><StageStepper job={job} labels={PLAYREEL_STAGE_LABELS} /></div>
|
||||
|
||||
<h1 className="page-title">{job.status === "done" ? "예고편 완성" : job.name}</h1>
|
||||
<p className="page-subtitle">
|
||||
{job.status === "awaiting_review" && gate ? `확인 ${gate.step}/5 · ${gate.name}이 필요합니다` :
|
||||
job.status === "running" ? (RUNNING_COPY[job.stage ?? ""] ?? "만드는 중") :
|
||||
job.status === "queued" ? `대기 중 · 앞에 ${job.queue_size ?? 0}편` :
|
||||
job.status === "failed" ? "작업이 중단되었습니다" : "아카이브에 저장되었습니다"}
|
||||
{job.credits_used > 0 && <span style={{ color: "var(--color-text-gray-500)" }}> · 사용 {job.credits_used}크레딧</span>}
|
||||
</p>
|
||||
|
||||
<div className="card" style={{ marginTop: "2rem", padding: "var(--spacing-page-md)" }}>
|
||||
{(job.status === "running" || job.status === "queued") && (
|
||||
<div style={{ display: "flex", flexDirection: "column", alignItems: "center", padding: "3rem 0", gap: "1.5rem" }}>
|
||||
<div className="gen-spinner" />
|
||||
<p style={{ margin: 0, color: "var(--color-text-gray-300)" }}>{RUNNING_COPY[job.stage ?? ""] ?? "준비 중"}</p>
|
||||
<div style={{ width: 320 }}>
|
||||
<div className="progress-bar-container"><div className="progress-bar-fill" style={{ width: `${pct}%` }} /></div>
|
||||
<p style={{ textAlign: "center", margin: "0.5rem 0 0", fontSize: "var(--text-sm)", color: "var(--color-text-gray-400)" }}>{pct}%</p>
|
||||
</div>
|
||||
<p style={{ margin: 0, fontSize: "var(--text-sm)", color: "var(--color-text-gray-500)" }}>
|
||||
다음 확인 요청이 오면 이 화면에 나타납니다. 창을 닫아도 작업은 계속됩니다.
|
||||
</p>
|
||||
{autoNote && <p style={{ margin: 0, fontSize: "var(--text-sm)", color: "var(--color-mint)" }}>{autoNote} <Link href="/playreel" style={{ color: "inherit" }}>설정 바꾸기 ›</Link></p>}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{autoGate && !actionError && (
|
||||
<div style={{ display: "flex", flexDirection: "column", alignItems: "center", padding: "3rem 0", gap: "1rem" }}>
|
||||
<div className="gen-spinner" />
|
||||
<p style={{ margin: 0, color: "var(--color-text-gray-300)" }}>{GATE_META[autoGate].step}단계 {GATE_META[autoGate].name}을 자동 승인하는 중</p>
|
||||
<p style={{ margin: 0, fontSize: "var(--text-sm)", color: "var(--color-text-gray-500)" }}>시작 화면에서 끌 수 있습니다.</p>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{job.status === "awaiting_review" && job.gate && job.review && !(autoGate && !actionError) && (
|
||||
<GateShell gate={job.gate} busy={busy} error={actionError}
|
||||
onApprove={() => post("approve", { gate: job.gate, edits: edits.current })}
|
||||
onBack={gate?.canBack ? () => post("back") : undefined}
|
||||
approveLabel={job.gate === "final_confirm" ? "승인하고 저장" : job.gate === "clip_confirm" ? "이 클립으로 계속" : undefined}>
|
||||
<GateBody review={job.review} onEdits={(e) => { edits.current = e; }} />
|
||||
{job.gate === "clip_confirm" && (
|
||||
<button className="btn-outline btn-lg" style={{ marginTop: "0.75rem" }} disabled={busy} onClick={() => post("retry")}>
|
||||
다시 만들기 (재과금)
|
||||
</button>
|
||||
)}
|
||||
</GateShell>
|
||||
)}
|
||||
|
||||
{job.status === "failed" && job.error && (
|
||||
<div style={{ maxWidth: 640, margin: "0 auto" }}>
|
||||
<p className="eyebrow" style={{ color: "#ff8c8c", margin: "0 0 1rem" }}>실패 · {PLAYREEL_STAGE_LABELS[job.error.stage] ?? job.error.stage}</p>
|
||||
<pre className="card-inner" style={{ fontSize: "var(--text-sm)", whiteSpace: "pre-wrap", wordBreak: "break-all", maxHeight: 280, overflow: "auto", color: "var(--color-text-gray-400)", margin: 0 }}>{job.error.detail}</pre>
|
||||
<div className="fail-actions">
|
||||
<button className="btn-outline" disabled={busy} onClick={() => post("retry")}>다시 시도</button>
|
||||
{job.error.stage === "i2v" && (
|
||||
<button className="btn-tonal-mint" disabled={busy} onClick={() => post("force")}>클립은 쓸 만함 — 이대로 진행</button>
|
||||
)}
|
||||
</div>
|
||||
{actionError && <p style={{ color: "#ff7a7a", fontSize: "var(--text-sm)", marginTop: "0.75rem", textAlign: "center" }}>{actionError}</p>}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{job.status === "done" && (
|
||||
<div className="result-grid">
|
||||
<div className="card-inner result-video">
|
||||
{job.artifacts.video
|
||||
? <video src={job.artifacts.video} controls style={{ width: "100%", maxHeight: 560, borderRadius: "var(--radius-md)", display: "block" }} />
|
||||
: <p style={{ color: "var(--color-text-gray-500)", fontSize: "var(--text-sm)" }}>영상</p>}
|
||||
</div>
|
||||
<div className="result-meta">
|
||||
<p className="field-label" style={{ margin: 0 }}>파일명</p>
|
||||
<p style={{ margin: "0.25rem 0 1rem", fontSize: "var(--text-xl)", fontWeight: 700 }}>{job.source.slug}_30_v{job.version}.mp4</p>
|
||||
<p style={{ margin: 0, fontSize: "var(--text-sm)", color: "var(--color-text-gray-400)" }}>출처 · <a href={job.source.url} target="_blank" rel="noreferrer" style={{ color: "var(--color-mint)" }}>공연 상품페이지 열기 →</a></p>
|
||||
<div className="result-actions">
|
||||
<Link href="/" className="btn-tonal-mint" style={{ textDecoration: "none", textAlign: "center" }}>새 버전 만들기</Link>
|
||||
<a href={job.artifacts.video} download className="btn-cta" style={{ padding: "0.75rem 1rem", fontSize: "var(--text-base)", borderRadius: "var(--radius-xl)", textDecoration: "none" }}>MP4 다운로드</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect, useState } from "react";
|
||||
import Link from "next/link";
|
||||
import { apiFetch } from "@/lib/api";
|
||||
|
||||
/* Playreel 전용 아카이브.
|
||||
* (ado2) 그룹의 /archive 로 보내면 독립 셸이 깨진다 — 같은 데이터를 여기서 보여주고
|
||||
* playreel 갈래만 걸러낸다. 저장소는 공유다(요금 기획서 §8-⑤ 권장: 통합 유지). */
|
||||
|
||||
type Entry = {
|
||||
slug: string;
|
||||
kind?: string;
|
||||
name: string;
|
||||
poster_url?: string | null;
|
||||
video_url?: string | null;
|
||||
thumbnail_url?: string | null;
|
||||
version?: number | null;
|
||||
credits_used?: number | null;
|
||||
source?: { url?: string } | null;
|
||||
created_at?: number;
|
||||
};
|
||||
|
||||
export default function PlayreelArchivePage() {
|
||||
const [items, setItems] = useState<Entry[] | null>(null);
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
|
||||
useEffect(() => {
|
||||
apiFetch<Entry[]>("/api/archive")
|
||||
// kind 가 없던 옛 엔트리는 source 유무로 추정한다(프론트 archiveKind 와 같은 규칙)
|
||||
.then((all) => setItems(all.filter((e) => e.kind === "playreel" || (!e.kind && e.source))))
|
||||
.catch((e) => setError((e as Error).message));
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<div style={{ paddingTop: "0.5rem" }}>
|
||||
<h1 className="page-title">아카이브</h1>
|
||||
<p className="page-subtitle">완성한 예고편이 여기 쌓입니다. 버전은 덮어쓰지 않습니다.</p>
|
||||
|
||||
{error && <p style={{ color: "#ff7a7a", textAlign: "center", marginTop: "1.5rem" }}>{error}</p>}
|
||||
{items && items.length === 0 && (
|
||||
<p className="page-subtitle" style={{ marginTop: "2.5rem" }}>
|
||||
아직 완성한 예고편이 없습니다. <Link href="/playreel">첫 예고편 만들기 →</Link>
|
||||
</p>
|
||||
)}
|
||||
|
||||
{items && items.length > 0 && (
|
||||
<div className="pr-archive">
|
||||
{items.map((e) => (
|
||||
<div key={e.slug} className="card-inner" style={{ padding: "0.85rem" }}>
|
||||
{e.video_url ? (
|
||||
<video
|
||||
src={e.video_url}
|
||||
poster={e.thumbnail_url ?? undefined}
|
||||
controls
|
||||
preload="none"
|
||||
style={{ width: "100%", borderRadius: "var(--radius-md)", display: "block", background: "#000" }}
|
||||
/>
|
||||
) : (
|
||||
<div className="pr-archive-blank">영상 없음</div>
|
||||
)}
|
||||
<p style={{ margin: "0.6rem 0 0", fontSize: "var(--text-sm)", fontWeight: 700, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>
|
||||
{e.name}
|
||||
</p>
|
||||
<p style={{ margin: "0.3rem 0 0", fontSize: "var(--text-xs)", color: "var(--color-text-gray-500)" }}>
|
||||
{e.version ? `v${e.version}` : "—"}
|
||||
{e.credits_used != null && ` · ${e.credits_used}크레딧`}
|
||||
</p>
|
||||
{e.video_url && (
|
||||
<a href={e.video_url} download className="btn-outline" style={{ display: "block", textAlign: "center", marginTop: "0.6rem", padding: "0.5rem", fontSize: "var(--text-sm)", textDecoration: "none" }}>
|
||||
MP4 다운로드
|
||||
</a>
|
||||
)}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect, useMemo, useState } from "react";
|
||||
import Link from "next/link";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { apiFetch } from "@/lib/api";
|
||||
import { GATE_META, parseGoodsId, type PlayreelJob } from "@/lib/playreel";
|
||||
import { AutoApprovePanel } from "@/components/auto-approve";
|
||||
|
||||
const STATUS_LABEL: Record<string, string> = {
|
||||
queued: "대기 중", running: "만드는 중", awaiting_review: "검수 대기", failed: "실패", done: "완료",
|
||||
};
|
||||
|
||||
function statusTone(s: string) {
|
||||
return s === "failed" ? "#ff7a7a"
|
||||
: s === "done" ? "var(--color-mint)"
|
||||
: s === "awaiting_review" ? "#ffd27a"
|
||||
: "var(--color-text-gray-400)";
|
||||
}
|
||||
|
||||
export default function PlayreelStartPage() {
|
||||
const router = useRouter();
|
||||
const [url, setUrl] = useState("");
|
||||
const [busy, setBusy] = useState(false);
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
const goodsId = useMemo(() => parseGoodsId(url), [url]);
|
||||
// 독립 서비스가 되면서 ADO2 홈의 "최근 작업"을 잃는다. 여기서 대신 보여준다.
|
||||
const [recent, setRecent] = useState<PlayreelJob[]>([]);
|
||||
useEffect(() => {
|
||||
apiFetch<PlayreelJob[]>("/api/playreel/jobs")
|
||||
.then((j) => setRecent(j.slice(0, 6)))
|
||||
.catch(() => setRecent([]));
|
||||
}, []);
|
||||
|
||||
const submit = async () => {
|
||||
if (!goodsId) return;
|
||||
setBusy(true);
|
||||
setError(null);
|
||||
try {
|
||||
const { id } = await apiFetch<{ id: string }>("/api/playreel/jobs", {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({ url: url.trim() }),
|
||||
});
|
||||
router.push(`/playreel/${id}`);
|
||||
} catch (e) {
|
||||
setError((e as Error).message);
|
||||
setBusy(false);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div style={{ display: "flex", flexDirection: "column", alignItems: "center", paddingTop: "0.5rem" }}>
|
||||
<h1 className="page-title">공연 상세페이지 주소만 넣으세요</h1>
|
||||
<p className="page-subtitle" style={{ lineHeight: 1.7 }}>
|
||||
포스터 · 캐스팅 · 일정 · 줄거리를 읽어<br />
|
||||
30초 세로 예고 영상을 만듭니다. 중요한 순간마다 확인을 요청합니다.
|
||||
</p>
|
||||
|
||||
<div style={{ width: "100%", maxWidth: 560, marginTop: "2rem", display: "flex", flexDirection: "column", gap: "0.75rem" }}>
|
||||
<div style={{ position: "relative" }}>
|
||||
<input
|
||||
className="input"
|
||||
placeholder="공연 상품페이지 주소를 붙여넣으세요"
|
||||
value={url}
|
||||
onChange={(e) => setUrl(e.target.value)}
|
||||
onKeyDown={(e) => { if (e.key === "Enter") submit(); }}
|
||||
style={{ paddingRight: goodsId ? 150 : undefined }}
|
||||
autoFocus
|
||||
/>
|
||||
{goodsId && (
|
||||
<span className="tag" style={{ position: "absolute", right: 14, top: "50%", transform: "translateY(-50%)", background: "var(--color-mint)", color: "var(--color-bg-dark)" }}>
|
||||
상품 {goodsId} 인식됨
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
{url.trim() && !goodsId && (
|
||||
<p style={{ margin: 0, textAlign: "center", fontSize: "var(--text-sm)", color: "#ffb37a" }}>
|
||||
아직 지원하지 않는 주소입니다. 공연 상품페이지 주소를 넣어주세요.
|
||||
</p>
|
||||
)}
|
||||
{error && <p style={{ color: "#ff7a7a", fontSize: "var(--text-sm)", textAlign: "center", margin: 0 }}>{error}</p>}
|
||||
<button className="btn-cta btn-lg" disabled={!goodsId || busy} onClick={submit}>
|
||||
{busy ? "상세페이지 읽는 중…" : "예고편 만들기"}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{/* 게이트 ①·③ 자동 승인 — 시작 전에 정하고, 되돌리는 자리도 여기 */}
|
||||
<div style={{ width: "100%", maxWidth: 720, marginTop: "3rem" }}>
|
||||
<AutoApprovePanel />
|
||||
</div>
|
||||
|
||||
{/* 어떻게 진행되나 — ICP가 처음 볼 때 확인 5회를 미리 알게 한다 */}
|
||||
<div style={{ width: "100%", maxWidth: 720, marginTop: "2rem" }}>
|
||||
<p className="field-label" style={{ margin: "0 0 0.75rem" }}>진행 순서 · 확인이 필요한 순간 5번</p>
|
||||
<div className="playreel-steps">
|
||||
{(Object.keys(GATE_META) as (keyof typeof GATE_META)[]).map((k) => {
|
||||
const g = GATE_META[k];
|
||||
return (
|
||||
<div key={k} className="card-inner" style={{ padding: "0.85rem" }}>
|
||||
<p style={{ margin: 0, fontSize: "var(--text-xs)", color: "var(--color-mint)", fontWeight: 700 }}>{g.step}단계</p>
|
||||
<p style={{ margin: "0.25rem 0 0", fontSize: "var(--text-sm)", fontWeight: 700 }}>{g.name}</p>
|
||||
<p style={{ margin: "0.35rem 0 0", fontSize: "var(--text-xs)", color: "var(--color-text-gray-500)" }}>
|
||||
{g.credits > 0 ? `${g.credits}크레딧` : "무료"} · {g.eta}
|
||||
</p>
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{recent.length > 0 && (
|
||||
<div style={{ width: "100%", maxWidth: 720, marginTop: "2.5rem" }}>
|
||||
<p className="field-label" style={{ margin: "0 0 0.75rem" }}>최근 작업</p>
|
||||
<div className="playreel-recent">
|
||||
{recent.map((j) => {
|
||||
const label = j.status === "awaiting_review" && j.gate
|
||||
? `${GATE_META[j.gate].name} 대기`
|
||||
: STATUS_LABEL[j.status] ?? j.status;
|
||||
return (
|
||||
<Link key={j.id} href={`/playreel/${j.id}`} style={{ textDecoration: "none", color: "inherit" }}>
|
||||
<div className="card-inner" style={{ padding: "0.85rem" }}>
|
||||
<p style={{ margin: 0, fontSize: "var(--text-sm)", fontWeight: 700, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>{j.name}</p>
|
||||
<p style={{ margin: "0.35rem 0 0", fontSize: "var(--text-xs)", fontWeight: 600, color: statusTone(j.status) }}>{label}</p>
|
||||
</div>
|
||||
</Link>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 25 KiB |
@@ -0,0 +1,517 @@
|
||||
@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css");
|
||||
@import "tailwindcss";
|
||||
|
||||
/* ADO2 실제 프로덕트 토큰 — ado2.o2osolution.ai/assets/index.*.css 에서 추출 (2026-08-12) */
|
||||
:root {
|
||||
--color-bg-darker: #001a1c;
|
||||
--color-bg-dark: #002224;
|
||||
--color-bg-card: #003538;
|
||||
--color-bg-card-inner: #004548;
|
||||
--color-mint: #a6ffea;
|
||||
--color-mint-hover: #8affda;
|
||||
--color-mint-10: rgba(166, 255, 234, 0.1);
|
||||
--color-mint-20: rgba(166, 255, 234, 0.2);
|
||||
--color-mint-30: rgba(166, 255, 234, 0.3);
|
||||
--color-mint-glow: rgba(166, 255, 234, 0.6);
|
||||
--color-purple: #a682ff;
|
||||
--color-purple-hover: #9570f0;
|
||||
--color-purple-glow: rgba(166, 130, 255, 0.2);
|
||||
--color-text-white: #ffffff;
|
||||
--color-text-gray-300: #d1d5db;
|
||||
--color-text-gray-400: #9ca3af;
|
||||
--color-text-gray-500: #6b7280;
|
||||
--color-border-white-5: rgba(255, 255, 255, 0.05);
|
||||
--color-border-white-10: rgba(255, 255, 255, 0.1);
|
||||
--color-border-gray-600: #4b5563;
|
||||
--color-border-gray-700: #374151;
|
||||
|
||||
--radius-sm: 0.5rem;
|
||||
--radius-md: 0.75rem;
|
||||
--radius-xl: 1.25rem;
|
||||
--radius-2xl: 1rem;
|
||||
--radius-3xl: 1.5rem;
|
||||
--radius-full: 9999px;
|
||||
|
||||
--text-xs: 0.75rem;
|
||||
--text-sm: 0.875rem;
|
||||
--text-base: 1rem;
|
||||
--text-lg: 1.125rem;
|
||||
--text-xl: 1.25rem;
|
||||
--text-2xl: 1.5rem;
|
||||
--text-3xl: 1.875rem;
|
||||
--text-4xl: 2.25rem;
|
||||
|
||||
--shadow-mint-glow: 0 0 10px rgba(166, 255, 234, 0.6);
|
||||
--shadow-purple: 0 10px 15px -3px rgba(166, 130, 255, 0.2);
|
||||
--shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
|
||||
|
||||
--spacing-page: 1.5rem;
|
||||
--spacing-page-md: 2rem;
|
||||
--transition-fast: 0.15s;
|
||||
--transition-normal: 0.2s;
|
||||
--transition-slow: 0.3s;
|
||||
|
||||
/* 기존 코드 호환 별칭 */
|
||||
--bg-0: var(--color-bg-darker);
|
||||
--bg-1: var(--color-bg-darker);
|
||||
--bg-2: var(--color-bg-dark);
|
||||
--bg-3: var(--color-bg-card);
|
||||
--bg-4: var(--color-bg-card-inner);
|
||||
--stroke-1: var(--color-border-gray-700);
|
||||
--stroke-2: var(--color-border-white-5);
|
||||
--ado-mint: var(--color-mint);
|
||||
--ado-mint-2: var(--color-mint);
|
||||
--ado-mint-11: var(--color-mint-10);
|
||||
--ado-purple: var(--color-purple);
|
||||
--ado-purple-light: var(--color-purple);
|
||||
--text-white: var(--color-text-white);
|
||||
--text-mint-soft: var(--color-text-gray-300);
|
||||
--text-mint-mid: var(--color-text-gray-300);
|
||||
--text-teal-1: var(--color-text-gray-400);
|
||||
--text-teal-2: var(--color-text-gray-400);
|
||||
--text-teal-3: var(--color-text-gray-500);
|
||||
--text-mute-1: var(--color-text-gray-400);
|
||||
--text-onpurple: var(--color-text-white);
|
||||
--r-xs: 0.25rem; --r-sm: var(--radius-sm); --r-md: var(--radius-md);
|
||||
--r-lg: var(--radius-3xl); --r-pill: var(--radius-full);
|
||||
--s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px; --s-7: 48px;
|
||||
--font: "Pretendard", "Apple SD Gothic Neo", -apple-system, BlinkMacSystemFont,
|
||||
"Helvetica Neue", "Segoe UI", system-ui, sans-serif;
|
||||
--shadow-card: var(--shadow-xl);
|
||||
}
|
||||
|
||||
html, body {
|
||||
background: var(--color-bg-darker);
|
||||
color: var(--color-text-white);
|
||||
font-family: var(--font);
|
||||
font-size: 16px;
|
||||
}
|
||||
body { margin: 0; -webkit-font-smoothing: antialiased; letter-spacing: -0.006em; }
|
||||
* { box-sizing: border-box; }
|
||||
|
||||
/* ── 레이아웃: 사이드바 (프로덕트 .sidebar / .sidebar-item) ── */
|
||||
.sidebar {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 240px;
|
||||
height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background-color: var(--color-bg-dark);
|
||||
border-right: 1px solid var(--color-border-white-5);
|
||||
z-index: 50;
|
||||
}
|
||||
.sidebar-logo { padding: 1.5rem 1.5rem 0.5rem; }
|
||||
.sidebar-menu { flex: 1; padding: 0 0.75rem; margin-top: 1rem; overflow-y: auto; }
|
||||
.sidebar-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.75rem;
|
||||
padding: 0.75rem 1rem;
|
||||
border-radius: var(--radius-xl);
|
||||
transition: all var(--transition-normal);
|
||||
cursor: pointer;
|
||||
margin-bottom: 0.25rem;
|
||||
text-decoration: none;
|
||||
color: var(--color-text-gray-400);
|
||||
font-size: 16px;
|
||||
font-weight: 700;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.sidebar-item:not(.active):hover { background-color: rgba(255, 255, 255, 0.05); color: var(--color-text-white); }
|
||||
.sidebar-item.active { background-color: var(--color-mint); color: var(--color-bg-dark); }
|
||||
.sidebar-foot { padding: 1rem 1.5rem; font-size: var(--text-xs); color: var(--color-text-gray-500); }
|
||||
.main-content { margin-left: 240px; min-height: 100vh; padding: var(--spacing-page-md); }
|
||||
|
||||
/* ── 카드 패널 (프로덕트 .card / .card-inner) ── */
|
||||
.card {
|
||||
background-color: var(--color-bg-card);
|
||||
border-radius: var(--radius-3xl);
|
||||
padding: var(--spacing-page);
|
||||
border: 1px solid var(--color-border-white-5);
|
||||
box-shadow: var(--shadow-xl);
|
||||
}
|
||||
.card-inner {
|
||||
background-color: rgba(18, 26, 29, 0.5);
|
||||
border-radius: var(--radius-2xl);
|
||||
border: 1px solid var(--color-border-white-5);
|
||||
padding: 1rem;
|
||||
}
|
||||
|
||||
/* ── 타이틀 (프로덕트 .page-title) ── */
|
||||
.page-title {
|
||||
font-size: var(--text-3xl);
|
||||
font-weight: 700;
|
||||
margin: 0 0 0.5rem;
|
||||
letter-spacing: -0.025em;
|
||||
text-align: center;
|
||||
}
|
||||
.page-subtitle {
|
||||
font-size: var(--text-base);
|
||||
color: var(--color-text-gray-400);
|
||||
text-align: center;
|
||||
margin: 0;
|
||||
}
|
||||
/* 섹션 라벨 — 굵은 흰색, 장식 없음 */
|
||||
.eyebrow {
|
||||
font-size: var(--text-lg);
|
||||
font-weight: 700;
|
||||
color: var(--color-text-white);
|
||||
display: block;
|
||||
}
|
||||
.field-label { font-size: var(--text-base); font-weight: 600; color: var(--color-text-gray-300); }
|
||||
|
||||
/* ── 버튼 (프로덕트 .btn-*) ── */
|
||||
.btn-cta {
|
||||
background-color: var(--color-purple);
|
||||
color: var(--color-text-white);
|
||||
font-weight: 700;
|
||||
padding: 1rem 4rem;
|
||||
border-radius: var(--radius-full);
|
||||
transition: all var(--transition-normal);
|
||||
box-shadow: var(--shadow-purple);
|
||||
font-size: var(--text-lg);
|
||||
font-family: var(--font);
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.btn-cta:hover:not(:disabled) { background-color: var(--color-purple-hover); }
|
||||
.btn-cta:disabled { opacity: 0.45; cursor: default; }
|
||||
|
||||
.btn-mint {
|
||||
background-color: var(--color-mint);
|
||||
color: var(--color-bg-dark);
|
||||
font-weight: 700;
|
||||
padding: 1rem;
|
||||
border-radius: var(--radius-xl);
|
||||
transition: all var(--transition-normal);
|
||||
font-size: var(--text-base);
|
||||
font-family: var(--font);
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.btn-mint:hover:not(:disabled) { background-color: var(--color-mint-hover); }
|
||||
.btn-mint:disabled { opacity: 0.45; cursor: default; }
|
||||
|
||||
/* 보조 행동 (프로덕트 .btn-regenerate 계열: mint tonal) */
|
||||
.btn-tonal-mint {
|
||||
background-color: var(--color-mint-20);
|
||||
color: var(--color-mint);
|
||||
border: 1px solid var(--color-mint-30);
|
||||
font-weight: 700;
|
||||
padding: 0.75rem 1.25rem;
|
||||
border-radius: var(--radius-xl);
|
||||
transition: background-color var(--transition-normal);
|
||||
font-size: var(--text-base);
|
||||
font-family: var(--font);
|
||||
cursor: pointer;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
white-space: nowrap;
|
||||
text-decoration: none;
|
||||
}
|
||||
.btn-tonal-mint:hover { background-color: var(--color-mint-30); }
|
||||
|
||||
.btn-outline {
|
||||
background-color: transparent;
|
||||
border: 1px solid var(--color-border-gray-600);
|
||||
color: var(--color-text-white);
|
||||
font-weight: 700;
|
||||
padding: 0.75rem 2rem;
|
||||
border-radius: var(--radius-full);
|
||||
transition: all var(--transition-normal);
|
||||
font-size: var(--text-base);
|
||||
font-family: var(--font);
|
||||
cursor: pointer;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.btn-outline:hover:not(:disabled) { background-color: rgba(255, 255, 255, 0.05); }
|
||||
.btn-outline:disabled { opacity: 0.45; cursor: default; }
|
||||
|
||||
.btn-back {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
padding: 0.5rem 1.25rem;
|
||||
border-radius: var(--radius-full);
|
||||
border: 1px solid var(--color-border-gray-600);
|
||||
background-color: transparent;
|
||||
color: var(--color-text-gray-300);
|
||||
font-size: var(--text-base);
|
||||
font-family: var(--font);
|
||||
font-weight: 600;
|
||||
transition: background-color var(--transition-normal);
|
||||
cursor: pointer;
|
||||
text-decoration: none;
|
||||
}
|
||||
.btn-back:hover { background-color: rgba(255, 255, 255, 0.05); }
|
||||
|
||||
/* 선택 옵션 (프로덕트 .btn-select) */
|
||||
.btn-select {
|
||||
padding: 0.75rem;
|
||||
border-radius: var(--radius-xl);
|
||||
border: 1px solid var(--color-border-gray-700);
|
||||
background-color: rgba(18, 26, 29, 0.4);
|
||||
color: var(--color-text-gray-400);
|
||||
font-size: var(--text-sm);
|
||||
font-weight: 700;
|
||||
font-family: var(--font);
|
||||
transition: all var(--transition-normal);
|
||||
cursor: pointer;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.btn-select:hover { color: var(--color-text-white); }
|
||||
.btn-select.selected {
|
||||
border: 1.5px solid var(--color-mint);
|
||||
color: var(--color-text-white);
|
||||
background-color: var(--color-mint-10);
|
||||
}
|
||||
|
||||
/* 정보 태그 — 클릭 안 됨 */
|
||||
.tag {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
height: 26px;
|
||||
padding: 0 12px;
|
||||
border-radius: var(--radius-full);
|
||||
background: var(--color-mint-10);
|
||||
color: var(--color-mint);
|
||||
font-size: var(--text-sm);
|
||||
font-weight: 600;
|
||||
letter-spacing: -0.006em;
|
||||
}
|
||||
|
||||
/* ── 입력 (프로덕트 흰 pill 입력) ── */
|
||||
.input {
|
||||
height: 56px;
|
||||
background: var(--color-text-white);
|
||||
color: var(--color-bg-dark);
|
||||
border: 1.5px solid transparent;
|
||||
border-radius: var(--radius-full);
|
||||
padding: 0 1.5rem;
|
||||
font: 600 var(--text-base)/1 var(--font);
|
||||
letter-spacing: -0.006em;
|
||||
width: 100%;
|
||||
}
|
||||
.input::placeholder { color: #3a8f86; font-weight: 700; }
|
||||
.input--center { text-align: center; }
|
||||
.input--center::placeholder { text-align: center; }
|
||||
.input:focus { outline: none; border-color: var(--color-mint); }
|
||||
|
||||
/* ── 위저드 스텝퍼 (프로덕트 .wizard-*) ── */
|
||||
.wizard-stepper {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
padding: 1.5rem 2rem 3rem;
|
||||
width: 100%;
|
||||
max-width: 720px;
|
||||
margin: 0 auto;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.wizard-step { flex: none; width: 2rem; position: relative; display: flex; justify-content: center; z-index: 1; }
|
||||
.wizard-step-line {
|
||||
flex: 1;
|
||||
height: 1.5px;
|
||||
background-color: rgba(255, 255, 255, 0.15);
|
||||
margin-top: calc(1rem - 0.75px);
|
||||
transition: background-color 0.3s;
|
||||
}
|
||||
.wizard-step-line.done { background-color: var(--color-mint); opacity: 0.8; }
|
||||
.wizard-stepper-node {
|
||||
width: 2rem;
|
||||
height: 2rem;
|
||||
flex-shrink: 0;
|
||||
border-radius: var(--radius-full);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 15px;
|
||||
font-weight: 600;
|
||||
transition: background-color 0.3s, box-shadow 0.3s, color 0.3s;
|
||||
}
|
||||
.wizard-step.pending .wizard-stepper-node {
|
||||
background-color: rgba(255, 255, 255, 0.08);
|
||||
color: rgba(255, 255, 255, 0.35);
|
||||
border: 1.5px solid rgba(255, 255, 255, 0.15);
|
||||
}
|
||||
.wizard-step.current .wizard-stepper-node {
|
||||
background-color: transparent;
|
||||
color: var(--color-mint);
|
||||
border: 2px solid var(--color-mint);
|
||||
box-shadow: 0 0 10px rgba(166, 255, 234, 0.45);
|
||||
}
|
||||
.wizard-step.done .wizard-stepper-node {
|
||||
background-color: var(--color-mint);
|
||||
color: var(--color-bg-dark);
|
||||
border: none;
|
||||
}
|
||||
.wizard-step.failed .wizard-stepper-node {
|
||||
background-color: transparent;
|
||||
color: #ff7a7a;
|
||||
border: 2px solid #ff7a7a;
|
||||
}
|
||||
.wizard-stepper-label {
|
||||
position: absolute;
|
||||
top: 2.5rem;
|
||||
left: 50%;
|
||||
transform: translate(-50%);
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
color: rgba(255, 255, 255, 0.35);
|
||||
white-space: nowrap;
|
||||
text-align: center;
|
||||
transition: color 0.3s, font-weight 0.3s;
|
||||
}
|
||||
.wizard-step.current .wizard-stepper-label { color: var(--color-mint); font-weight: 600; }
|
||||
.wizard-step.done .wizard-stepper-label { color: rgba(255, 255, 255, 0.55); }
|
||||
.wizard-step.failed .wizard-stepper-label { color: #ff7a7a; font-weight: 600; }
|
||||
|
||||
/* ── 진행 바 (프로덕트 .progress-bar-*) ── */
|
||||
.progress-bar-container {
|
||||
width: 100%;
|
||||
height: 0.375rem;
|
||||
background-color: #1f2937;
|
||||
border-radius: var(--radius-full);
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
.progress-bar-fill {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
height: 100%;
|
||||
background-color: var(--color-mint);
|
||||
border-radius: var(--radius-full);
|
||||
transition: width 0.5s ease;
|
||||
}
|
||||
|
||||
/* 생성 중 원형 스피너 */
|
||||
.gen-spinner {
|
||||
width: 72px;
|
||||
height: 72px;
|
||||
border-radius: 50%;
|
||||
border: 5px solid rgba(166, 130, 255, 0.18);
|
||||
border-top-color: var(--color-purple);
|
||||
animation: spin 1.1s linear infinite;
|
||||
}
|
||||
@keyframes spin { to { transform: rotate(360deg); } }
|
||||
|
||||
@keyframes pulse-dot {
|
||||
0%, 100% { opacity: 1; }
|
||||
50% { opacity: 0.35; }
|
||||
}
|
||||
.dot-running { animation: pulse-dot 1.2s ease-in-out infinite; }
|
||||
|
||||
/* ── 무빙포스터 진입 분기 (2026-08-28) — 버튼 한 규격 · 진입 카드 · 모바일 ── */
|
||||
.btn-lg { height: 52px; width: 100%; padding: 0 1.5rem; font-size: var(--text-base); border-radius: var(--radius-full); gap: 0.5rem; }
|
||||
.btn-sub { font-weight: 500; opacity: 0.8; font-size: var(--text-sm); }
|
||||
.note { color: var(--color-text-gray-500); font-size: var(--text-sm); margin: 0; text-align: center; }
|
||||
.note a { color: var(--color-mint); }
|
||||
.sidebar-product { font-size: 10px; font-weight: 800; letter-spacing: 0.1em; color: var(--color-mint); white-space: nowrap; }
|
||||
|
||||
.entry-stack { display: flex; flex-direction: column; gap: 0.75rem; width: 100%; max-width: 560px; margin-top: 1.5rem; }
|
||||
.entry { display: flex; flex-direction: column; gap: 0.85rem; padding: 1.25rem; position: relative; }
|
||||
.entry--hot { border-color: var(--color-mint-30); }
|
||||
.entry-badge { align-self: flex-start; background: var(--color-mint); color: var(--color-bg-dark); font-size: 11px; font-weight: 800; padding: 3px 10px; border-radius: var(--radius-full); letter-spacing: 0.04em; margin-bottom: -0.35rem; }
|
||||
.entry-head { display: flex; align-items: center; gap: 0.75rem; }
|
||||
.entry-icon { width: 44px; height: 44px; flex: none; border-radius: var(--radius-md); background: var(--color-mint-10); color: var(--color-mint); display: grid; place-items: center; font-weight: 800; font-size: 12px; letter-spacing: 0.04em; }
|
||||
.entry-title { margin: 0; font-size: var(--text-lg); font-weight: 800; letter-spacing: -0.02em; }
|
||||
.entry-desc { margin: 0.15rem 0 0; color: var(--color-text-gray-400); font-size: var(--text-sm); }
|
||||
.entry-flow { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; font-size: var(--text-xs); color: var(--color-text-gray-300); }
|
||||
.entry-flow span { background: var(--color-bg-card-inner); border: 1px solid var(--color-border-white-5); padding: 0.3rem 0.6rem; border-radius: var(--radius-full); }
|
||||
.entry-flow em { font-style: normal; color: var(--color-text-gray-500); }
|
||||
.entry-facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; }
|
||||
.entry-facts div { background: rgba(18, 26, 29, 0.5); border: 1px solid var(--color-border-white-5); border-radius: var(--radius-md); padding: 0.5rem 0.6rem; }
|
||||
.entry-facts b { display: block; font-size: var(--text-xs); color: var(--color-text-gray-500); font-weight: 600; }
|
||||
.entry-facts span { font-size: var(--text-sm); font-weight: 700; font-variant-numeric: tabular-nums; }
|
||||
|
||||
.gate-actions { display: grid; grid-template-columns: 1fr; gap: 0.75rem; margin-top: 1.75rem; }
|
||||
@media (min-width: 640px) { .gate-actions { grid-template-columns: 1fr auto; } .gate-actions .btn-outline { width: auto; grid-row: 1; } .gate-actions .btn-cta { grid-column: 2; } }
|
||||
|
||||
/* 결과·실패·나레이션 레이아웃 기본값(데스크톱) */
|
||||
.playreel-steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.5rem; }
|
||||
.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--spacing-page-md); align-items: stretch; }
|
||||
.result-grid .result-video { display: flex; align-items: center; justify-content: center; min-height: 420px; }
|
||||
.result-grid .result-meta { display: flex; flex-direction: column; border-left: 2px solid var(--color-mint-20); padding-left: var(--spacing-page); }
|
||||
.result-actions { margin-top: auto; padding-top: 1.5rem; display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
|
||||
.fail-actions { display: flex; justify-content: center; gap: 0.75rem; margin-top: 1.5rem; }
|
||||
.narr-row { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.45rem; }
|
||||
.archive-detail { display: grid; grid-template-columns: 300px 1fr; gap: var(--s-6); align-items: start; }
|
||||
.narr-row .narr-slot { width: 84px; flex-shrink: 0; font-size: var(--text-xs); font-weight: 700; }
|
||||
|
||||
/* 스테퍼: 좁은 화면에서 가로 스크롤 */
|
||||
.stepper-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
|
||||
.stepper-scroll::-webkit-scrollbar { display: none; }
|
||||
.stepper-scroll .wizard-stepper { min-width: 560px; }
|
||||
|
||||
@media (max-width: 767px) {
|
||||
.sidebar { position: sticky; top: 0; width: 100%; height: auto; flex-direction: row; align-items: center; border-right: none; border-bottom: 1px solid var(--color-border-white-5); }
|
||||
.sidebar-logo { padding: 0.75rem 1rem; }
|
||||
.sidebar-menu { display: flex; margin: 0; padding: 0 0.5rem; gap: 0.25rem; }
|
||||
.sidebar-item { padding: 0.5rem 0.75rem; font-size: 14px; margin: 0; }
|
||||
.sidebar-item svg { display: none; }
|
||||
.sidebar-foot { display: none; }
|
||||
.main-content { margin-left: 0; padding: var(--spacing-page); }
|
||||
.entry-facts { grid-template-columns: repeat(2, 1fr); }
|
||||
.page-title { font-size: var(--text-2xl); }
|
||||
.stepper-scroll .wizard-stepper { padding: 1rem 1rem 2.5rem; }
|
||||
/* 상단 메뉴 행: 로고는 고정, 메뉴는 가로 스크롤(넘치는 항목이 잘리지 않게) */
|
||||
.sidebar { overflow: hidden; }
|
||||
.sidebar-logo { flex: none; }
|
||||
.sidebar-menu { flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
|
||||
.sidebar-menu::-webkit-scrollbar { display: none; }
|
||||
.sidebar-product { display: none; }
|
||||
.playreel-steps { grid-template-columns: repeat(2, 1fr); }
|
||||
.result-grid { grid-template-columns: 1fr; }
|
||||
.result-grid .result-video { min-height: 240px; }
|
||||
.result-grid .result-meta { border-left: none; padding-left: 0; }
|
||||
.result-actions { grid-template-columns: 1fr; }
|
||||
.fail-actions { flex-direction: column; }
|
||||
.fail-actions .btn-outline, .fail-actions .btn-tonal-mint { width: 100%; }
|
||||
.narr-row { flex-direction: column; align-items: stretch; gap: 0.25rem; }
|
||||
.narr-row .input { padding: 0 1rem; }
|
||||
.archive-detail { grid-template-columns: 1fr; }
|
||||
}
|
||||
|
||||
/* 자동 승인 환경설정 — /playreel 패널·게이트 카드 체크 */
|
||||
.pref-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.7rem 0; }
|
||||
.pref-row + .pref-row { border-top: 1px solid var(--color-border-white-5); }
|
||||
.switch { flex: none; width: 42px; height: 24px; border-radius: 9999px; border: 1px solid var(--color-border-white-10); background: var(--color-border-white-10); position: relative; cursor: pointer; padding: 0; transition: background-color 0.15s; }
|
||||
.switch-knob { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--color-text-gray-400); transition: transform 0.15s, background-color 0.15s; }
|
||||
.switch.on { background: var(--color-mint); border-color: var(--color-mint); }
|
||||
.switch.on .switch-knob { transform: translateX(18px); background: var(--color-bg-dark); }
|
||||
.switch:focus-visible { outline: 2px solid var(--color-mint); outline-offset: 2px; }
|
||||
@media (prefers-reduced-motion: reduce) { .switch, .switch-knob { transition: none; } }
|
||||
|
||||
/* ── Playreel 자체 셸 워드마크 (별도 서비스 URL — 2026-09-01) ── */
|
||||
/* ADO2 로고 위 · Playreel 워드마크 아래. (ado2) 셸의 락업과 같은 문법이되
|
||||
여기서는 Playreel 이 서비스 이름이라 아래쪽에 무게를 준다. */
|
||||
.pr-wordmark { display: inline-flex; flex-direction: column; gap: 6px; text-decoration: none; align-items: flex-start; }
|
||||
/* 두 번째 줄을 가로로 — 로고 폭과 맞춰 락업이 사각형으로 앉는다 */
|
||||
.pr-line { display: flex; align-items: baseline; gap: 7px; }
|
||||
.pr-wordmark svg { color: var(--color-text-gray-300); }
|
||||
.pr-mark {
|
||||
font-size: 18px; font-weight: 800; letter-spacing: 0.14em;
|
||||
color: var(--color-text-white); line-height: 1;
|
||||
}
|
||||
.pr-mark-ko {
|
||||
font-size: 10px; font-weight: 700; letter-spacing: 0.22em;
|
||||
color: var(--color-mint);
|
||||
}
|
||||
.playreel-recent { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.75rem; }
|
||||
.pr-archive { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; margin-top: 2rem; }
|
||||
.pr-archive-blank {
|
||||
aspect-ratio: 9 / 16; display: flex; align-items: center; justify-content: center;
|
||||
background: var(--color-bg-dark); border-radius: var(--radius-md);
|
||||
font-size: var(--text-xs); color: var(--color-text-gray-500);
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
import "./globals.css";
|
||||
|
||||
/* 루트 레이아웃은 html/body 만 든다.
|
||||
* 셸(사이드바·워드마크)은 라우트 그룹이 각자 가진다 —
|
||||
* (ado2) ADO2 무빙포스터 · 포스터 스타일링 · 아카이브
|
||||
* (playreel) Playreel — 별도 서비스 URL 로 나가므로 자기 이름을 쓴다
|
||||
* 2026-09-01 결정. MOVING_POSTER_ENTRY_PLAN.md §5 의 "Playreel 워드마크 노출 금지"는
|
||||
* 폐기됐다 — 주소창에 뜨는 이름을 화면에서 숨길 수는 없다. */
|
||||
|
||||
export default function RootLayout({ children }: { children: React.ReactNode }) {
|
||||
return (
|
||||
<html lang="ko">
|
||||
<body>{children}</body>
|
||||
</html>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user