Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
63e9e18719 | ||
|
|
487a8ade11 | ||
|
|
9fc8bdbbbd | ||
|
|
78cf43d7ff | ||
|
|
ef08b9f433 | ||
|
|
49b4178453 | ||
|
|
d59304f833 | ||
|
|
e6c839dd08 | ||
|
|
ffaa512aee | ||
|
|
c6c84a10ff | ||
|
|
c4efd6406d | ||
|
|
b27a7b528a | ||
|
|
364616ec0f | ||
|
|
a2543e19d4 | ||
|
|
3ee1c3bdfc | ||
|
|
2140f7d5c8 | ||
|
|
3555fa05a2 | ||
|
|
ca9e40f43d | ||
|
|
7a667d8a5f | ||
|
|
2c13e75a92 | ||
|
|
9bb46f7004 | ||
|
|
a18f7a5c8b | ||
|
|
5cd5ec5649 |
No files matched your search
@@ -13,6 +13,11 @@ COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# 가상환경을 만들지 않고 이미지의 python에 바로 깐다.
|
||||
# compose가 소스를 /app에 물리면 그 안의 .venv가 가려지고, 가려진 자리를 볼륨으로 되살리면
|
||||
# 컨테이너를 다시 만들어도 옛 볼륨이 따라붙어 이미지를 새로 구워도 패키지가 안 바뀐다
|
||||
ENV UV_PROJECT_ENVIRONMENT=/usr/local
|
||||
|
||||
# 의존성만 먼저 깔아 레이어를 캐시한다
|
||||
COPY pyproject.toml uv.lock ./
|
||||
RUN uv sync --frozen --no-install-project
|
||||
@@ -20,8 +25,7 @@ RUN uv sync --frozen --no-install-project
|
||||
COPY . .
|
||||
RUN uv sync --frozen
|
||||
|
||||
ENV PATH="/app/.venv/bin:$PATH" \
|
||||
PYTHONUNBUFFERED=1
|
||||
ENV PYTHONUNBUFFERED=1
|
||||
|
||||
# CLI 토큰은 컨테이너가 켜질 때 호스트의 것을 참조한다:
|
||||
# -v ~/.config/higgsfield:/root/.config/higgsfield
|
||||
|
||||
@@ -26,8 +26,29 @@ uv sync
|
||||
| `TYPECAST_API_KEY` | 롱컷 tts (축제는 OpenAI를 써서 필요 없다) |
|
||||
| `SUNO_API_KEY` · `SUNO_CALLBACK_URL` | bgm |
|
||||
| `HIGGSFIELD_ACCOUNT` | upscale · i2v 계정 가드 |
|
||||
| `MYSQL_URL` | DB 세션 |
|
||||
| `MYSQL_HOST` · `MYSQL_PORT` · `MYSQL_USER` · `MYSQL_PASSWORD` · `MYSQL_DB` | DB 세션 |
|
||||
| `AZURE_BLOB_BASE_URL` · `AZURE_BLOB_SAS_TOKEN` | blob 업로드 |
|
||||
| `GOOGLE_CLIENT_ID` | 구글 로그인. 비면 로그인만 꺼지고 서버는 뜬다 |
|
||||
| `JWT_SECRET` | 세션 쿠키 서명. 바뀌면 로그인된 사람이 전부 풀린다 |
|
||||
|
||||
### 구글 로그인
|
||||
|
||||
구글 클라우드 콘솔에서 **웹 애플리케이션** OAuth 클라이언트를 만들고 승인된 자바스크립트
|
||||
원본에 서비스 주소를 넣는다. 발급된 client id를 `GOOGLE_CLIENT_ID`에 넣는다.
|
||||
`client_secret`은 쓰지 않는다 — 코드 교환 없이 ID 토큰만 검증한다.
|
||||
|
||||
`JWT_SECRET`은 아무 긴 임의 문자열이면 된다.
|
||||
|
||||
```bash
|
||||
python3 -c "import secrets; print(secrets.token_urlsafe(48))"
|
||||
```
|
||||
|
||||
사용자는 처음 로그인할 때 만들어지고 잡을 `job_limit`(기본 3)개까지 만들 수 있다.
|
||||
무제한으로 둘 계정은 `user` 테이블의 그 값을 올린다.
|
||||
|
||||
```sql
|
||||
UPDATE user SET job_limit = 100000 WHERE email = 'jhyeu@o2o.kr';
|
||||
```
|
||||
|
||||
### Docker
|
||||
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
"""스타일링 ① — 포스터에 인쇄된 글자 판독 응답 스키마
|
||||
|
||||
이미지 생성 모델이 한글을 다시 그리며 자모를 바꾸므로(맥주축제 → 백주축제)
|
||||
읽기 잘하는 모델에 먼저 읽히고 그 문자열을 생성 프롬프트에 못 박는다.
|
||||
"""
|
||||
from pydantic import BaseModel
|
||||
|
||||
MAX_EXTRA_LINES = 3
|
||||
|
||||
|
||||
class PosterTextAnswer(BaseModel):
|
||||
title: str
|
||||
slogan: str
|
||||
date: str
|
||||
time: str
|
||||
place: str
|
||||
extra: list[str]
|
||||
@@ -0,0 +1,21 @@
|
||||
"""스타일링 ② — 레퍼런스 화풍 분석 응답 스키마
|
||||
|
||||
무드 형용사는 픽셀로 번역되지 않아 팔레트·조명·질감·타이포·구도 다섯을 요구한다.
|
||||
짧게 나오면 다섯 중 빠진 것이 있다는 뜻이라 통과시키지 않는다.
|
||||
"""
|
||||
from pydantic import BaseModel, field_validator
|
||||
|
||||
MIN_STYLE_PROMPT_CHARS = 200
|
||||
|
||||
|
||||
class StylePromptAnswer(BaseModel):
|
||||
style_prompt: str
|
||||
|
||||
@field_validator("style_prompt")
|
||||
@classmethod
|
||||
def must_cover_five_elements(cls, style_prompt: str) -> str:
|
||||
text = style_prompt.strip()
|
||||
if len(text) < MIN_STYLE_PROMPT_CHARS:
|
||||
raise ValueError(f"style_prompt가 {len(text)}자로 너무 짧음 "
|
||||
f"({MIN_STYLE_PROMPT_CHARS}자 이상) — 5요소가 다 안 나옴")
|
||||
return text
|
||||
@@ -3,7 +3,7 @@ from contextlib import asynccontextmanager
|
||||
from fastapi import FastAPI
|
||||
|
||||
from pipelines import worker
|
||||
from routers import f1, playreel
|
||||
from routers import archive, auth, f1, playreel
|
||||
from utils import blob
|
||||
from utils.database import close_engine, create_missing_tables
|
||||
|
||||
@@ -21,8 +21,10 @@ async def lifespan(app: FastAPI):
|
||||
|
||||
app = FastAPI(title="poster-alive", lifespan=lifespan)
|
||||
|
||||
app.include_router(auth.router)
|
||||
app.include_router(f1.router)
|
||||
app.include_router(playreel.router)
|
||||
app.include_router(archive.router)
|
||||
|
||||
|
||||
@app.get("/api/health")
|
||||
|
||||
@@ -11,7 +11,8 @@ class DetailSection:
|
||||
index: int # 그 원본 안에서의 순번
|
||||
y0: int
|
||||
y1: int
|
||||
image: Image.Image
|
||||
# compose는 좌표만 쓴다 — 조각 그림 없이 만들어도 된다
|
||||
image: Image.Image | None = None
|
||||
tag: str = UNTAGGED
|
||||
|
||||
@property
|
||||
|
||||
@@ -11,8 +11,12 @@ class Scene(BaseModel):
|
||||
"""나레이션 큐 하나에 대응하는 화면."""
|
||||
cue: int
|
||||
kind: SceneKind
|
||||
section: str | None = None # scroll일 때 쓸 섹션 이름
|
||||
section: str | None = None # scroll 시작점이 된 섹션 이름
|
||||
tag: str | None = None # 그 섹션의 태그. 왜 골랐는지 남긴다
|
||||
# scroll은 조각이 아니라 롱이미지 위에서 일어난다. 아래 셋이 그 좌표다
|
||||
source: str | None = None # 훑을 롱이미지 (detail_01 …)
|
||||
y0: float | None = None # 시작 위치. 롱이미지 높이 대비 0~1
|
||||
y1: float | None = None # 끝 위치
|
||||
|
||||
|
||||
class LongcutPlan(BaseModel):
|
||||
@@ -28,6 +32,7 @@ class EndBandInfo(BaseModel):
|
||||
@dataclass
|
||||
class LongcutResult:
|
||||
video: bytes
|
||||
thumbnail: bytes # 첫 프레임. 0초가 포스터 원본이라 그대로 정지컷이 된다
|
||||
duration: float
|
||||
frames: int
|
||||
plan: LongcutPlan
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
"""포스터 스타일링 — 화풍 레퍼런스로 포스터를 다시 그린다"""
|
||||
from dataclasses import dataclass
|
||||
from enum import StrEnum
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
||||
class TemplateLicense(StrEnum):
|
||||
"""끄는 조건이 달라 등급을 나눈다
|
||||
PUBLIC은 보호기간이 끝나 외부 공개가 되고
|
||||
INTERNAL은 번들 레퍼런스의 권리가 남아 배포 시 감추며
|
||||
USER는 올린 사람 책임이라 막지 않고 고지만 한다
|
||||
"""
|
||||
PUBLIC = "public-domain"
|
||||
INTERNAL = "internal-only"
|
||||
USER = "user-uploaded"
|
||||
|
||||
|
||||
class TemplateCategory(StrEnum):
|
||||
FINE_ART = "fine_art"
|
||||
ORIENTAL = "oriental"
|
||||
FILM = "film"
|
||||
USER = "user"
|
||||
|
||||
|
||||
class StyleTemplate(BaseModel):
|
||||
"""번들과 사용자 레퍼런스가 같은 모양을 쓴다"""
|
||||
id: str
|
||||
name_ko: str
|
||||
category: TemplateCategory
|
||||
license: TemplateLicense
|
||||
style_prompt: str
|
||||
reference_url: str # 전이에 넣는 고해상본
|
||||
thumbnail_url: str
|
||||
attribution: str = ""
|
||||
license_note: str = ""
|
||||
small_reference: bool = False # 레퍼런스가 작아 결과가 나빠질 수 있음
|
||||
|
||||
|
||||
class OutputFormat(BaseModel):
|
||||
"""gpt-image가 내는 크기로 만든 뒤 필요하면 센터 크롭한다"""
|
||||
id: str
|
||||
label: str
|
||||
generated_size: str
|
||||
crop: tuple[int, int] | None = None
|
||||
|
||||
|
||||
@dataclass
|
||||
class ReferenceVariants:
|
||||
reference: bytes # 긴 변 REFERENCE_LONG_EDGE
|
||||
thumbnail: bytes
|
||||
size: tuple[int, int]
|
||||
|
||||
|
||||
@dataclass
|
||||
class TransferResult:
|
||||
image: bytes
|
||||
format_id: str
|
||||
style_prompt: str
|
||||
has_info_band: bool # 날짜·장소를 밴드로 얹었는가
|
||||
@@ -9,13 +9,24 @@ from utils import blob
|
||||
|
||||
JPEG_QUALITY = 90
|
||||
|
||||
# 이름이 고정된 산출물. 경로가 정해져 있어 컬럼에 다시 적지 않고 만들어 쓴다
|
||||
THUMBNAIL = "thumbnail.jpg"
|
||||
|
||||
|
||||
def artifact_path(pipeline: str, task_id: str, name: str) -> str:
|
||||
return f"{pipeline}/{task_id}/{name}"
|
||||
|
||||
|
||||
async def store_bytes(pipeline: str, task_id: str, name: str, data: bytes) -> str:
|
||||
return await blob.upload_bytes(data, artifact_path(pipeline, task_id, name))
|
||||
def artifact_url(pipeline: str, task_id: str, name: str) -> str:
|
||||
return blob.public_url(artifact_path(pipeline, task_id, name))
|
||||
|
||||
|
||||
async def store_bytes(pipeline: str, task_id: str, name: str, data: bytes, *,
|
||||
download_as: str | None = None) -> str:
|
||||
"""download_as를 주면 브라우저가 그 주소를 열 때 그 이름으로 내려받는다"""
|
||||
return await blob.upload_bytes(
|
||||
data, artifact_path(pipeline, task_id, name),
|
||||
disposition=blob.as_attachment(download_as) if download_as else None)
|
||||
|
||||
|
||||
async def store_image(pipeline: str, task_id: str, name: str, image: Image.Image) -> str:
|
||||
|
||||
@@ -135,17 +135,21 @@ def clip_review(task: PlayreelTask) -> dict:
|
||||
|
||||
|
||||
def final_checks(task: PlayreelTask) -> list[dict]:
|
||||
"""컬럼으로 확인되는 것만 낸다 — 완성본을 다시 열어 본 결과가 아니다."""
|
||||
verdict = TitleGateVerdict.model_validate(task.title_gate or {"passed": True})
|
||||
"""컬럼으로 확인되는 것만 낸다 — 완성본을 다시 열어 본 결과가 아니다.
|
||||
|
||||
제목 훼손 검사는 넣지 않는다. 비교 기준이 되는 좌표를 detect가 만드는데
|
||||
playreel에는 그 단계가 없어 검사 자체가 돌지 않는다.
|
||||
"""
|
||||
plan = LongcutPlan.model_validate(task.scene_plan or {"scenes": []})
|
||||
scroll_tags = {scene.tag for scene in plan.scenes if scene.kind == "scroll"}
|
||||
scrolls = [scene for scene in plan.scenes if scene.kind == "scroll"]
|
||||
scroll_tags = {scene.tag for scene in scrolls}
|
||||
return [
|
||||
{"key": "hybrid", "label": "원본 글자 합성",
|
||||
"ok": bool(task.hybrid_clip_url)},
|
||||
{"key": "title", "label": "제목 훼손 검사",
|
||||
"ok": verdict.passed and not verdict.skip},
|
||||
# 씬 종류가 scroll이라고 적힌 것만으로는 부족하다 — 실제로 훑은 거리를 본다.
|
||||
# 조각이 화면보다 짧아 한 픽셀도 안 움직인 채 통과한 적이 있다
|
||||
{"key": "scroll", "label": "상세페이지 스크롤",
|
||||
"ok": any(scene.kind == "scroll" for scene in plan.scenes)},
|
||||
"ok": any((scene.y1 or 0.0) > (scene.y0 or 0.0) for scene in scrolls)},
|
||||
{"key": "schedule", "label": "캐스팅 스케줄 포함",
|
||||
"ok": REQUIRED_SECTION_TAG in scroll_tags},
|
||||
{"key": "bgm", "label": "배경음악",
|
||||
@@ -156,7 +160,8 @@ def final_checks(task: PlayreelTask) -> list[dict]:
|
||||
def final_review(task: PlayreelTask) -> dict:
|
||||
return {
|
||||
"video_url": task.video_url or "",
|
||||
"proof_url": task.compose_proof_url or task.hybrid_proof_url or "",
|
||||
# hybrid 시트는 앞 8초짜리라 완성본 검수 자리에 대신 세우지 않는다
|
||||
"proof_url": task.compose_proof_url or "",
|
||||
"duration": task.video_duration or 0.0,
|
||||
"checks": final_checks(task),
|
||||
"version": task.version + 1,
|
||||
|
||||
@@ -17,8 +17,8 @@ from models.motion import MotionPlan
|
||||
from models.nol import NolMeta
|
||||
from models.pipeline_state import PlayreelState, initial_timings
|
||||
from models.tts import NarrationTimeline, TypecastVoice
|
||||
from pipelines.artifact import (contact_sheet, load_image, load_optional, store_bytes,
|
||||
store_image)
|
||||
from pipelines.artifact import (THUMBNAIL, artifact_url, contact_sheet, load_image,
|
||||
load_optional, store_bytes, store_image)
|
||||
from services.analyze_poster import analyze_poster
|
||||
from services.bgm import DEFAULT_BGM_STYLE, generate_bgm
|
||||
from services.build_layer_config import build_layer_config
|
||||
@@ -33,6 +33,7 @@ from services.split_detail import split_details
|
||||
from services.tts import synthesize
|
||||
from services.upscale_poster import as_png_path, upscale_poster
|
||||
from tables.task import PlayreelTask
|
||||
from tables.user import UNASSIGNED_USER_ID
|
||||
from utils import blob
|
||||
from utils.higgsfield import KLING_3_0
|
||||
from utils.video import frames_at
|
||||
@@ -55,15 +56,34 @@ async def load_sections(entries: list[dict]) -> list[DetailSection]:
|
||||
for entry in entries]
|
||||
|
||||
|
||||
def section_specs(entries: list[dict]) -> list[DetailSection]:
|
||||
"""compose용 — 조각 그림은 안 받는다. 스크롤은 롱이미지 위에서 일어나고
|
||||
섹션은 어디부터 훑을지를 정하는 좌표로만 쓰인다"""
|
||||
return [DetailSection(source=entry["source"], index=entry["index"],
|
||||
y0=entry["y0"], y1=entry["y1"], tag=entry["tag"])
|
||||
for entry in entries]
|
||||
|
||||
|
||||
async def load_details(task: PlayreelTask) -> dict[str, Image.Image]:
|
||||
"""상세페이지 롱이미지. 이름은 split이 붙인 source와 같아야 한다"""
|
||||
return {f"detail_{order:02d}": Image.open(io.BytesIO(await blob.download_bytes(url)))
|
||||
for order, url in enumerate(task.detail_image_urls or [], 1)}
|
||||
|
||||
|
||||
def working_poster_url(task: PlayreelTask) -> str:
|
||||
"""업스케일이 있으면 그것이 이후 단계의 원본이 됨"""
|
||||
return task.upscaled_poster_url or task.poster_url
|
||||
|
||||
|
||||
async def create_task(session: AsyncSession, url: str, goods_id: str,
|
||||
slug: str) -> PlayreelTask:
|
||||
def thumbnail_url(task: PlayreelTask) -> str | None:
|
||||
"""compose가 끝났으면 정지컷이 정해진 경로에 있다"""
|
||||
return artifact_url(PIPELINE, task.id, THUMBNAIL) if task.video_url else None
|
||||
|
||||
|
||||
async def create_task(session: AsyncSession, url: str, goods_id: str, slug: str, *,
|
||||
user_id: str = UNASSIGNED_USER_ID) -> PlayreelTask:
|
||||
task = PlayreelTask(source_url=url, goods_id=goods_id, slug=slug,
|
||||
name=f"공연 {goods_id}",
|
||||
name=f"공연 {goods_id}", user_id=user_id,
|
||||
stage_timings=initial_timings(PlayreelState))
|
||||
session.add(task)
|
||||
await session.commit()
|
||||
@@ -229,7 +249,8 @@ async def run_compose(session: AsyncSession, task: PlayreelTask) -> None:
|
||||
meta = NolMeta.model_validate(task.nol_meta)
|
||||
timeline = NarrationTimeline.model_validate(task.narration_timeline)
|
||||
selected = [entry for entry in task.detail_sections or [] if entry["selected"]]
|
||||
sections = await load_sections(selected)
|
||||
sections = section_specs(selected)
|
||||
details = await load_details(task)
|
||||
|
||||
# 하이브리드 합성을 못 거친 클립은 제목이 흔들림
|
||||
clip = await blob.download_bytes(task.hybrid_clip_url or task.clip_url)
|
||||
@@ -240,10 +261,14 @@ async def run_compose(session: AsyncSession, task: PlayreelTask) -> None:
|
||||
|
||||
result = await asyncio.to_thread(
|
||||
compose_longcut, poster, clip, timeline, narration, sections, band_info(meta),
|
||||
bgm_mp3=bgm, qr=Image.open(qr_path) if qr_path.exists() else None)
|
||||
details=details, bgm_mp3=bgm,
|
||||
qr=Image.open(qr_path) if qr_path.exists() else None, preview=True)
|
||||
|
||||
task.video_url = await store_bytes(PIPELINE, task.id,
|
||||
f"longcut_v{task.version + 1}.mp4", result.video)
|
||||
filename = f"{task.slug}_30_v{task.version + 1}.mp4"
|
||||
task.video_url = await store_bytes(PIPELINE, task.id, filename, result.video,
|
||||
download_as=filename)
|
||||
# 경로가 고정이라 URL은 남기지 않는다. 읽는 쪽이 thumbnail_url()로 만든다
|
||||
await store_bytes(PIPELINE, task.id, THUMBNAIL, result.thumbnail)
|
||||
task.scene_plan = result.plan.model_dump()
|
||||
task.video_duration = result.duration
|
||||
task.video_frames = result.frames
|
||||
|
||||
@@ -23,7 +23,8 @@ from services.narration import generate_narration
|
||||
from services.render import render
|
||||
from services.tts import synthesize
|
||||
from services.upscale_poster import as_png_path
|
||||
from tables.task import PosterAliveTask
|
||||
from tables.task import PosterAliveTask, new_task_id
|
||||
from tables.user import UNASSIGNED_USER_ID
|
||||
from utils import blob
|
||||
from utils.image import sniff_extension
|
||||
|
||||
@@ -31,17 +32,21 @@ PIPELINE = "poster_alive"
|
||||
|
||||
|
||||
async def create_task(session: AsyncSession, name: str, poster: bytes, *,
|
||||
skip_review: bool = False) -> PosterAliveTask:
|
||||
task = PosterAliveTask(name=name, skip_review=skip_review,
|
||||
skip_review: bool = False,
|
||||
user_id: str = UNASSIGNED_USER_ID) -> PosterAliveTask:
|
||||
# poster_url이 NOT NULL이라 blob에 올린 뒤에야 행을 넣을 수 있다.
|
||||
# 그 경로에 id가 필요하므로 여기서 미리 만든다
|
||||
task = PosterAliveTask(id=new_task_id(), name=name, skip_review=skip_review,
|
||||
user_id=user_id,
|
||||
stage_timings=initial_timings(PosterAliveState))
|
||||
with Image.open(io.BytesIO(poster)) as image:
|
||||
task.poster_width, task.poster_height = image.size
|
||||
# i2v만 거절하는 하드 게이트라 여기서는 기록만 함
|
||||
task.is_low_resolution = max(image.size) < MIN_LONG_EDGE_PX
|
||||
session.add(task)
|
||||
await session.flush() # blob 경로에 쓸 id를 확정
|
||||
|
||||
task.poster_url = await store_bytes(PIPELINE, task.id,
|
||||
f"poster.{sniff_extension(poster)}", poster)
|
||||
session.add(task)
|
||||
await session.commit()
|
||||
return task
|
||||
|
||||
@@ -65,6 +70,9 @@ async def run_narration_text(session: AsyncSession, task: PosterAliveTask) -> No
|
||||
task.narration_voice = answer.voice
|
||||
task.bgm_style = answer.bgm_style.model_dump()
|
||||
task.poster_metadata = answer.metadata.model_dump()
|
||||
# 올릴 때 이름을 안 줬으면 포스터에서 읽은 행사명이 이름이 된다
|
||||
if not task.name:
|
||||
task.name = answer.metadata.event_name
|
||||
task.state = PosterAliveState.MOTION
|
||||
await session.commit()
|
||||
|
||||
@@ -129,9 +137,11 @@ async def run_render(session: AsyncSession, task: PosterAliveTask) -> None:
|
||||
result = await asyncio.to_thread(render, clip, poster, narration=narration, bgm=bgm,
|
||||
timeline=timeline)
|
||||
|
||||
task.video_url = await store_bytes(PIPELINE, task.id, "final.mp4", result.video)
|
||||
task.video_url = await store_bytes(PIPELINE, task.id, "final.mp4", result.video,
|
||||
download_as=f"{task.name}.mp4")
|
||||
task.thumbnail_url = await store_bytes(PIPELINE, task.id, "thumbnail.jpg",
|
||||
result.thumbnail)
|
||||
result.thumbnail,
|
||||
download_as=f"{task.name}.jpg")
|
||||
task.video_duration = result.duration
|
||||
task.video_frames = result.frames
|
||||
task.video_width = result.width
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
"""현재 state부터 다음 게이트까지 단계를 이어 돌림
|
||||
어느 잡을 언제 돌릴지는 worker가 정하고 여기는 실행만 함
|
||||
"""
|
||||
import re
|
||||
import time
|
||||
import traceback
|
||||
|
||||
@@ -69,6 +70,16 @@ def reset_from(task, stage: str) -> None:
|
||||
task.state = state_type(stage)
|
||||
|
||||
|
||||
URL_IN_TEXT = re.compile(r"https?://\S+")
|
||||
MAX_ERROR_DETAIL = 500
|
||||
|
||||
|
||||
def safe_detail(failure: BaseException) -> str:
|
||||
"""검수 화면까지 가는 값이라 트레이스백과 스토리지 주소는 뺀다"""
|
||||
message = f"{type(failure).__name__}: {failure}"
|
||||
return URL_IN_TEXT.sub("<url>", message)[:MAX_ERROR_DETAIL]
|
||||
|
||||
|
||||
def stops_here(task, stage) -> str | None:
|
||||
"""이 단계 뒤에 사람이 볼 게이트가 서는가. playreel은 게이트 이름을 돌려준다"""
|
||||
if isinstance(task, PlayreelTask):
|
||||
@@ -115,14 +126,15 @@ async def run_until_gate(session: AsyncSession, task) -> None:
|
||||
while task.state != state_type.COMPLETED:
|
||||
if not await step(session, task):
|
||||
return
|
||||
except Exception:
|
||||
except Exception as failure:
|
||||
failed_stage = str(task.state)
|
||||
traceback.print_exc() # 전문은 서버 로그에만 남긴다
|
||||
await session.rollback()
|
||||
await session.refresh(task)
|
||||
mark(task, failed_stage, FAILED)
|
||||
task.status = FAILED
|
||||
task.error_stage = failed_stage
|
||||
task.error_detail = traceback.format_exc()[-2000:]
|
||||
task.error_detail = safe_detail(failure)
|
||||
await session.commit()
|
||||
return
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ dependencies = [
|
||||
"openai>=3.6.0",
|
||||
"pillow>=12.3.0",
|
||||
"pydantic-settings>=2.15.0",
|
||||
"python-jose[cryptography]>=3.5.0",
|
||||
"python-multipart>=0.0.32",
|
||||
"scipy>=1.18.1",
|
||||
"sqlalchemy>=2.0.52",
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
포스터에 인쇄된 글자를 정확히 읽어라.
|
||||
|
||||
주의:
|
||||
- 장식 서체는 획이 붙거나 끊겨 다른 글자로 보인다. `맥주축제`를 `백주축제`로 읽는 실수가 실제로 났다.
|
||||
ㅁ/ㅂ, ㅈ/ㅊ, ㅌ/ㄷ을 한 자씩 확인하라.
|
||||
- 영문·로마자 병기가 있으면 대조해 검산하라.
|
||||
- 읽어낸 말이 한국어로 뜻이 통하지 않으면 오독이다. 이미지 내용과도 맞는지 확인하라
|
||||
(맥주잔이 그려져 있으면 `백주축제`가 아니라 `맥주축제`다).
|
||||
- 없는 항목은 빈 문자열로 둔다. 지어내지 마라.
|
||||
|
||||
각 항목:
|
||||
- title — 행사명. 가장 크게 인쇄된 제목 글자 그대로
|
||||
- slogan — 따옴표 안 슬로건 등 부제
|
||||
- date — 날짜 표기 그대로
|
||||
- time — 시간 표기 그대로
|
||||
- place — 장소 표기 그대로
|
||||
- extra — 그 밖에 포스터에 크게 박힌 문구 최대 3개
|
||||
@@ -0,0 +1,30 @@
|
||||
You write style specifications for an image-generation model.
|
||||
|
||||
You will see one reference artwork. Produce an English spec that another model can follow to
|
||||
REDRAW an unrelated poster in this exact visual language. The spec must be executable — every
|
||||
clause has to translate into pixels.
|
||||
|
||||
Cover all five elements, in this order, in one flowing paragraph of 5-7 sentences:
|
||||
|
||||
1. PALETTE — name 3-5 actual colours as a painter would ("cobalt blue, chrome yellow, deep
|
||||
viridian"), plus how they are distributed (dominant / accent / shadow).
|
||||
2. LIGHTING — direction, hardness and contrast of the light. If the work has no single light
|
||||
source, say so and say what carries the luminance instead.
|
||||
3. TEXTURE / MEDIUM — the physical medium and mark-making: brush size and direction, impasto,
|
||||
woodblock keyline, glaze, film grain, canvas or paper weave.
|
||||
4. TYPOGRAPHY TREATMENT — how a title would be lettered IN THIS IDIOM **while remaining fully
|
||||
legible in Korean Hangul**. Derive the colour, the surface it sits on and its placement from
|
||||
the medium (the reference may contain no lettering at all — derive it anyway; never omit this).
|
||||
But the letterforms themselves are constrained, because Hangul stacks two to four jamo inside
|
||||
one square and a lost stroke turns it into a different word: demand EVEN, UNBROKEN stroke
|
||||
weight, open counters, and generous spacing between characters. Explicitly forbid tapering or
|
||||
dry-brush stroke ends, hand-brushed irregularity, hairline serifs, distressed or eroded edges,
|
||||
and lettering that blends into the artwork. Say the title must read as clean, solid shapes
|
||||
even though the rest of the image is in this medium.
|
||||
5. COMPOSITION MOTIF — horizon placement, dominant shape and its direction of movement, figure
|
||||
scale relative to frame, use of empty space, any repeating pattern.
|
||||
|
||||
BANNED: mood adjectives standing alone ("epic", "dreamy", "haunting", "vibrant", "unsettling",
|
||||
"atmospheric"). A mood word is only allowed if the same sentence names the colour, direction,
|
||||
medium or shape that produces it. Do not name the artwork, the artist or the art movement —
|
||||
describe what is on the surface, because the generating model may not know the reference.
|
||||
@@ -1,9 +1,14 @@
|
||||
포스터 영상의 서로 다른 시점에서 잘라낸 '제목 영역' 이미지들이다.
|
||||
질문은 하나다: **각 시점에서 제목 글자가 온전히 읽히는가.**
|
||||
포스터 영상의 서로 다른 시점에서 같은 자리를 잘라낸 '제목 영역' 이미지들이다.
|
||||
[0]은 생성 전 원본이고 [1]부터가 생성된 프레임이다.
|
||||
|
||||
질문은 하나다: **[0]에 보이는 글자가 각 시점에서도 그대로 읽히는가.**
|
||||
|
||||
판정 기준:
|
||||
- 글자 자체가 온전하면 legible=true. 배경이 변한 것(불꽃·구름·빛이 글자 **뒤로** 지나감)은
|
||||
훼손이 아니다.
|
||||
- 글자가 다른 그림에 **가려짐**, 획이 지워짐·뭉개짐, 다른 글자로 변형, 재작화됐으면 legible=false.
|
||||
- 기대 제목의 일부 글자만 훼손돼도 false다. broken에 어떤 글자가 어떻게 됐는지 짧게 쓴다.
|
||||
- [0]에 없는 글자는 판정 대상이 아니다. 상자가 제목의 일부만 덮고 있을 수 있고,
|
||||
잘려 나간 글자를 '없어졌다'고 하면 안 된다.
|
||||
- [0]에 있던 글자가 다른 그림에 가려짐, 획이 지워짐·뭉개짐, 다른 글자로 변형,
|
||||
재작화됐으면 legible=false.
|
||||
- 배경만 변한 것은 훼손이 아니다. 불꽃·구름·빛이 글자 뒤로 지나가는 것은 그대로 통과다.
|
||||
- [0]은 원본이므로 항상 legible=true다.
|
||||
- index는 이미지에 붙은 번호 그대로 쓴다. 훼손이 없으면 broken은 빈 문자열.
|
||||
- broken에는 [0]의 어떤 글자가 어떻게 됐는지 짧게 쓴다.
|
||||
@@ -0,0 +1,82 @@
|
||||
"""/api/archive — 완료된 잡을 한 목록으로 보여준다
|
||||
|
||||
별도 저장소를 두지 않는다. 두 잡 테이블에서 끝난 것만 골라 그때그때 만든다.
|
||||
필드는 web/lib/api.ts 의 ArchiveEntry 와 맞춘다.
|
||||
"""
|
||||
from fastapi import APIRouter, Depends, HTTPException
|
||||
from sqlalchemy import select
|
||||
from sqlalchemy.ext.asyncio import AsyncSession
|
||||
|
||||
from models.nol import NolMeta
|
||||
from pipelines.gate import period_text
|
||||
from pipelines.playreel import thumbnail_url
|
||||
from pipelines.runner import DONE
|
||||
from routers.view import UNNAMED
|
||||
from tables.task import PlayreelTask, PosterAliveTask
|
||||
from utils.database import get_session
|
||||
|
||||
# 완성본 구경은 로그인 없이 연다
|
||||
router = APIRouter(prefix="/api/archive", tags=["archive"])
|
||||
|
||||
|
||||
def poster_alive_entry(task: PosterAliveTask) -> dict:
|
||||
return {
|
||||
"slug": task.id,
|
||||
"kind": "f1",
|
||||
"name": task.name or UNNAMED,
|
||||
"source": None,
|
||||
"metadata": task.poster_metadata,
|
||||
"narration": task.narration_lines,
|
||||
"poster_url": task.poster_url,
|
||||
"video_url": task.video_url,
|
||||
"thumbnail_url": task.thumbnail_url,
|
||||
"version": None,
|
||||
"credits_used": task.credits_used,
|
||||
"f2_variants": [],
|
||||
"created_at": task.created_at.timestamp(),
|
||||
}
|
||||
|
||||
|
||||
def playreel_entry(task: PlayreelTask) -> dict:
|
||||
meta = NolMeta.model_validate(task.nol_meta) if task.nol_meta else None
|
||||
return {
|
||||
"slug": task.id,
|
||||
"kind": "playreel",
|
||||
"name": task.name or UNNAMED,
|
||||
"source": {"url": task.source_url, "goods_id": task.goods_id, "slug": task.slug},
|
||||
"metadata": None if meta is None else {
|
||||
"event_name": meta.goods_name or "",
|
||||
"date_text": period_text(meta),
|
||||
"place": meta.place_name or "",
|
||||
"category": meta.genre_name or "",
|
||||
"keywords": [],
|
||||
},
|
||||
"narration": [line["text"] for line in task.narration_lines or []] or None,
|
||||
"poster_url": task.upscaled_poster_url or task.poster_url,
|
||||
"video_url": task.video_url,
|
||||
"thumbnail_url": thumbnail_url(task),
|
||||
"version": task.version,
|
||||
"credits_used": task.credits_used,
|
||||
"f2_variants": [],
|
||||
"created_at": task.created_at.timestamp(),
|
||||
}
|
||||
|
||||
|
||||
@router.get("")
|
||||
async def list_entries(session: AsyncSession = Depends(get_session)):
|
||||
entries = [playreel_entry(task) for task in await session.scalars(
|
||||
select(PlayreelTask).where(PlayreelTask.status == DONE))]
|
||||
entries += [poster_alive_entry(task) for task in await session.scalars(
|
||||
select(PosterAliveTask).where(PosterAliveTask.status == DONE))]
|
||||
return sorted(entries, key=lambda entry: entry["created_at"], reverse=True)
|
||||
|
||||
|
||||
@router.get("/{slug}")
|
||||
async def get_entry(slug: str, session: AsyncSession = Depends(get_session)):
|
||||
playreel = await session.get(PlayreelTask, slug)
|
||||
if playreel is not None:
|
||||
return playreel_entry(playreel)
|
||||
poster_alive = await session.get(PosterAliveTask, slug)
|
||||
if poster_alive is not None:
|
||||
return poster_alive_entry(poster_alive)
|
||||
raise HTTPException(404, "아카이브에 없는 항목입니다")
|
||||
@@ -0,0 +1,113 @@
|
||||
"""/api/auth — 구글 로그인과 세션
|
||||
|
||||
브라우저가 구글에서 받아온 credential을 한 번 검증하고, 그 뒤로는 자체 쿠키를 쓴다.
|
||||
"""
|
||||
from fastapi import APIRouter, Depends, HTTPException, Request, Response
|
||||
from pydantic import BaseModel
|
||||
from sqlalchemy.ext.asyncio import AsyncSession
|
||||
|
||||
from tables.user import User
|
||||
from utils import session_token
|
||||
from utils.database import get_session
|
||||
from utils.google_identity import (GoogleLoginDisabled, GoogleTokenInvalid, is_enabled,
|
||||
verify_id_token)
|
||||
|
||||
router = APIRouter(prefix="/api/auth", tags=["auth"])
|
||||
|
||||
|
||||
class GoogleLoginBody(BaseModel):
|
||||
credential: str
|
||||
|
||||
|
||||
def user_view(user: User) -> dict:
|
||||
"""구글 sub는 내보내지 않는다 — 화면이 쓸 일이 없다"""
|
||||
return {
|
||||
"email": user.email,
|
||||
"name": user.name,
|
||||
"picture": user.picture_url,
|
||||
"jobs_created": user.jobs_created,
|
||||
"job_limit": user.job_limit,
|
||||
"jobs_left": user.jobs_left,
|
||||
}
|
||||
|
||||
|
||||
async def find_or_create(session: AsyncSession, account) -> User:
|
||||
user = await session.get(User, account.sub)
|
||||
if user is None:
|
||||
user = User(id=account.sub, email=account.email, name=account.name,
|
||||
picture_url=account.picture)
|
||||
session.add(user)
|
||||
else:
|
||||
# 이메일·이름·사진은 구글 쪽에서 바뀔 수 있어 로그인할 때마다 맞춘다
|
||||
user.email, user.name, user.picture_url = (account.email, account.name,
|
||||
account.picture)
|
||||
await session.commit()
|
||||
return user
|
||||
|
||||
|
||||
@router.get("/config")
|
||||
async def config():
|
||||
"""프론트가 버튼을 그릴지 정하는 데 쓴다. client_id는 비밀이 아니다"""
|
||||
from settings import settings
|
||||
return {"enabled": is_enabled(), "client_id": settings.google_client_id}
|
||||
|
||||
|
||||
@router.post("/google")
|
||||
async def google_login(body: GoogleLoginBody, response: Response,
|
||||
session: AsyncSession = Depends(get_session)):
|
||||
try:
|
||||
account = await verify_id_token(body.credential)
|
||||
except GoogleLoginDisabled:
|
||||
raise HTTPException(503, "구글 로그인이 설정되지 않았습니다")
|
||||
except GoogleTokenInvalid as failure:
|
||||
raise HTTPException(401, str(failure))
|
||||
|
||||
user = await find_or_create(session, account)
|
||||
response.set_cookie(
|
||||
session_token.COOKIE_NAME, session_token.issue(user.id),
|
||||
max_age=session_token.cookie_max_age(),
|
||||
httponly=True, samesite="lax", path="/",
|
||||
)
|
||||
return user_view(user)
|
||||
|
||||
|
||||
@router.get("/me")
|
||||
async def me(request: Request, session: AsyncSession = Depends(get_session)):
|
||||
user = await optional_user(request, session)
|
||||
if user is None:
|
||||
raise HTTPException(401, "로그인이 필요합니다")
|
||||
return user_view(user)
|
||||
|
||||
|
||||
@router.post("/logout")
|
||||
async def logout(response: Response):
|
||||
response.delete_cookie(session_token.COOKIE_NAME, path="/")
|
||||
return {"ok": True}
|
||||
|
||||
|
||||
async def optional_user(request: Request, session: AsyncSession) -> User | None:
|
||||
token = request.cookies.get(session_token.COOKIE_NAME)
|
||||
if not token:
|
||||
return None
|
||||
try:
|
||||
user_id = session_token.read(token)
|
||||
except session_token.SessionInvalid:
|
||||
return None
|
||||
return await session.get(User, user_id)
|
||||
|
||||
|
||||
async def current_user(request: Request,
|
||||
session: AsyncSession = Depends(get_session)) -> User:
|
||||
"""로그인이 필요한 엔드포인트가 의존성으로 받는다"""
|
||||
user = await optional_user(request, session)
|
||||
if user is None:
|
||||
raise HTTPException(401, "로그인이 필요합니다")
|
||||
return user
|
||||
|
||||
|
||||
async def creating_user(user: User = Depends(current_user)) -> User:
|
||||
"""잡을 만드는 엔드포인트용 — 한도를 여기서 막는다"""
|
||||
if not user.can_create_job:
|
||||
raise HTTPException(
|
||||
403, f"만들 수 있는 개수를 다 썼습니다 ({user.jobs_created}/{user.job_limit})")
|
||||
return user
|
||||
@@ -11,12 +11,17 @@ from models.pipeline_state import PosterAliveState
|
||||
from pipelines import poster_alive
|
||||
from pipelines.artifact import load_image
|
||||
from pipelines.runner import AWAITING_REVIEW, FAILED, QUEUED, RUNNING, reset_from
|
||||
from routers.auth import creating_user, current_user
|
||||
from routers.view import motion_elements, poster_alive_view
|
||||
from tables.user import User
|
||||
from services.i2v import MIN_LONG_EDGE_PX
|
||||
from services.motion import plan_motion
|
||||
from tables.task import PosterAliveTask
|
||||
from utils.database import get_session
|
||||
|
||||
router = APIRouter(prefix="/api/f1", tags=["f1"])
|
||||
# 이 라우터의 모든 경로가 로그인을 요구한다. 잡 생성만 한도 검사를 더 받는다
|
||||
router = APIRouter(prefix="/api/f1", tags=["f1"],
|
||||
dependencies=[Depends(current_user)])
|
||||
|
||||
ACCEPTED_TYPES = {"image/jpeg", "image/png", "image/webp", "image/gif"}
|
||||
MAX_UPLOAD_BYTES = 30 * 1024 * 1024
|
||||
@@ -59,6 +64,7 @@ async def rewrite_motion_plan(task: PosterAliveTask, motions: list[str]) -> None
|
||||
@router.post("/jobs")
|
||||
async def create(poster: UploadFile = File(...), name: str = Form(""),
|
||||
auto: bool = Form(False),
|
||||
user: User = Depends(creating_user),
|
||||
session: AsyncSession = Depends(get_session)):
|
||||
if poster.content_type not in ACCEPTED_TYPES:
|
||||
raise HTTPException(415, f"지원 형식: JPG/PNG/WEBP/GIF (받은 것: {poster.content_type})")
|
||||
@@ -66,19 +72,35 @@ async def create(poster: UploadFile = File(...), name: str = Form(""),
|
||||
if len(raw) > MAX_UPLOAD_BYTES:
|
||||
raise HTTPException(413, "30MB 이하만 올릴 수 있습니다")
|
||||
try:
|
||||
Image.open(io.BytesIO(raw)).verify()
|
||||
with Image.open(io.BytesIO(raw)) as image:
|
||||
width, height = image.size
|
||||
image.verify()
|
||||
except Exception:
|
||||
raise HTTPException(422, "이미지 파일을 열 수 없습니다")
|
||||
|
||||
task = await poster_alive.create_task(session, name.strip() or "이름 없는 행사", raw,
|
||||
skip_review=auto)
|
||||
# i2v가 확대 시 뭉개져 거절한다. 거기까지 가면 나레이션·TTS·BGM을 다 쓰고 터지므로
|
||||
# 같은 기준을 업로드에서 먼저 건다
|
||||
if max(width, height) < MIN_LONG_EDGE_PX:
|
||||
raise HTTPException(
|
||||
422, f"포스터 긴 변이 {MIN_LONG_EDGE_PX}px 이상이어야 합니다 "
|
||||
f"(받은 것: {width}x{height}). 고해상 원본으로 올려주세요.")
|
||||
|
||||
# 이름을 비워 두면 narration_text 가 포스터에서 읽은 행사명으로 채운다
|
||||
task = await poster_alive.create_task(session, name.strip(), raw, skip_review=auto,
|
||||
user_id=user.id)
|
||||
# 잡을 지워도 회복되지 않게 누적값을 올린다
|
||||
user.jobs_created += 1
|
||||
await session.commit()
|
||||
return {"id": task.id, "ahead": 0}
|
||||
|
||||
|
||||
@router.get("/jobs")
|
||||
async def list_jobs(session: AsyncSession = Depends(get_session)):
|
||||
async def list_jobs(user: User = Depends(current_user),
|
||||
session: AsyncSession = Depends(get_session)):
|
||||
"""자기가 만든 것만 돌려준다"""
|
||||
found = await session.scalars(
|
||||
select(PosterAliveTask).order_by(PosterAliveTask.created_at.desc()))
|
||||
select(PosterAliveTask).where(PosterAliveTask.user_id == user.id)
|
||||
.order_by(PosterAliveTask.created_at.desc()))
|
||||
return [poster_alive_view(task) for task in found]
|
||||
|
||||
|
||||
@@ -120,6 +142,8 @@ async def edit_metadata(task_id: str, body: MetadataBody,
|
||||
if body.keywords is not None:
|
||||
metadata["keywords"] = [word.strip() for word in body.keywords if word.strip()]
|
||||
task.poster_metadata = metadata
|
||||
# 잡 이름이 곧 내려받는 파일명이라 고친 행사명을 따라간다
|
||||
task.name = metadata["event_name"]
|
||||
await session.commit()
|
||||
return poster_alive_view(task)
|
||||
|
||||
|
||||
@@ -10,15 +10,21 @@ from models.pipeline_state import PlayreelState
|
||||
from pipelines import playreel
|
||||
from pipelines.gate import (REVERSIBLE_GATES, PlayreelGate, apply_playreel_edits,
|
||||
previous_gate, resume_stage)
|
||||
from pipelines.runner import AWAITING_REVIEW, FAILED, QUEUED, RUNNING, reset_from
|
||||
from pipelines.runner import AWAITING_REVIEW, DONE, FAILED, QUEUED, RUNNING, reset_from
|
||||
from routers.auth import creating_user, current_user
|
||||
from routers.view import playreel_view
|
||||
from tables.task import PlayreelTask
|
||||
from tables.user import User
|
||||
from utils.database import get_session
|
||||
|
||||
router = APIRouter(prefix="/api/playreel", tags=["playreel"])
|
||||
# 이 라우터의 모든 경로가 로그인을 요구한다. 잡 생성만 한도 검사를 더 받는다
|
||||
router = APIRouter(prefix="/api/playreel", tags=["playreel"],
|
||||
dependencies=[Depends(current_user)])
|
||||
|
||||
# 프론트 parseGoodsId와 같은 규칙. 프론트 검사는 입력 도중의 안내이고 판정은 여기서 한다
|
||||
GOODS_ID_PATTERNS = (
|
||||
# 인터파크 주소는 야놀자로 리다이렉트된다. 상품 번호는 양쪽이 같다
|
||||
r"nol\.yanolja\.com/ticket/products/(\d{5,})",
|
||||
r"tickets\.interpark\.com/goods/(\d{5,})",
|
||||
r"nol\.interpark\.com/[^?]*?(\d{8,})",
|
||||
r"[?&]goodsCode=(\d{5,})",
|
||||
@@ -54,7 +60,8 @@ async def find_task(session: AsyncSession, task_id: str) -> PlayreelTask:
|
||||
|
||||
|
||||
@router.post("/jobs")
|
||||
async def create(body: CreateBody, session: AsyncSession = Depends(get_session)):
|
||||
async def create(body: CreateBody, user: User = Depends(creating_user),
|
||||
session: AsyncSession = Depends(get_session)):
|
||||
goods_id = parse_goods_id(body.url)
|
||||
if not goods_id:
|
||||
raise HTTPException(400, "지원하지 않는 주소입니다. 공연 상품페이지 주소를 넣어 주세요.")
|
||||
@@ -62,14 +69,21 @@ async def create(body: CreateBody, session: AsyncSession = Depends(get_session))
|
||||
if not SLUG_PATTERN.fullmatch(slug):
|
||||
raise HTTPException(400, "slug는 영문 소문자·숫자·밑줄만 씁니다")
|
||||
|
||||
task = await playreel.create_task(session, body.url.strip(), goods_id, slug)
|
||||
task = await playreel.create_task(session, body.url.strip(), goods_id, slug,
|
||||
user_id=user.id)
|
||||
# 잡을 지워도 회복되지 않게 누적값을 올린다
|
||||
user.jobs_created += 1
|
||||
await session.commit()
|
||||
return {"id": task.id}
|
||||
|
||||
|
||||
@router.get("/jobs")
|
||||
async def list_jobs(session: AsyncSession = Depends(get_session)):
|
||||
async def list_jobs(user: User = Depends(current_user),
|
||||
session: AsyncSession = Depends(get_session)):
|
||||
"""자기가 만든 것만 돌려준다"""
|
||||
found = await session.scalars(
|
||||
select(PlayreelTask).order_by(PlayreelTask.created_at.desc()))
|
||||
select(PlayreelTask).where(PlayreelTask.user_id == user.id)
|
||||
.order_by(PlayreelTask.created_at.desc()))
|
||||
return [playreel_view(task) for task in found]
|
||||
|
||||
|
||||
@@ -119,6 +133,9 @@ async def back(task_id: str, session: AsyncSession = Depends(get_session)):
|
||||
async def retry(task_id: str, session: AsyncSession = Depends(get_session)):
|
||||
"""실패 재시도와 클립 재생성. i2v를 다시 돌리면 크레딧이 다시 든다"""
|
||||
task = await find_task(session, task_id)
|
||||
# 끝난 것을 다시 돌리면 크레딧만 나간다. 새로 만들 거면 새 잡이다
|
||||
if task.status == DONE:
|
||||
raise HTTPException(409, "이미 끝난 작업입니다")
|
||||
restart = (PlayreelState.I2V.value if task.gate == PlayreelGate.CLIP_CONFIRM
|
||||
else task.error_stage or PlayreelState.FETCH.value)
|
||||
reset_from(task, restart)
|
||||
|
||||
@@ -2,8 +2,9 @@
|
||||
필드는 web/lib/api.ts 의 Job, web/lib/playreel.ts 의 PlayreelJob 과 맞춤
|
||||
"""
|
||||
from models.motion import MotionPlan
|
||||
from models.pipeline_state import PlayreelState, PosterAliveState, initial_timings
|
||||
from models.pipeline_state import PlayreelState, PosterAliveState, stage_keys
|
||||
from pipelines.gate import build_review
|
||||
from pipelines.playreel import thumbnail_url
|
||||
from tables.task import PlayreelTask, PosterAliveTask
|
||||
|
||||
|
||||
@@ -24,13 +25,26 @@ def motion_elements(motion_plan: dict | None) -> list[str] | None:
|
||||
return [item.motion for item in MotionPlan.model_validate(motion_plan).kept]
|
||||
|
||||
|
||||
IDLE = {"status": "idle", "started": None, "ended": None}
|
||||
# 이름은 narration_text 가 포스터에서 읽어 채운다. 그 전까지 화면에 쓸 말
|
||||
UNNAMED = "이름 없는 행사"
|
||||
|
||||
|
||||
def ordered_stages(task, state_type) -> dict:
|
||||
"""스테퍼가 키 순서대로 그리므로 실행 순서로 다시 세운다.
|
||||
JSON 객체는 순서를 담는 자리가 아니고, 순서의 정본은 state enum이다.
|
||||
"""
|
||||
stored = task.stage_timings or {}
|
||||
return {key: stored.get(key, IDLE) for key in stage_keys(state_type)}
|
||||
|
||||
|
||||
def base_view(task, state_type) -> dict:
|
||||
return {
|
||||
"id": task.id,
|
||||
"name": task.name,
|
||||
"name": task.name or UNNAMED,
|
||||
"status": task.status,
|
||||
"stage": current_stage(task),
|
||||
"stages": task.stage_timings or initial_timings(state_type),
|
||||
"stages": ordered_stages(task, state_type),
|
||||
"error": error_view(task),
|
||||
"created_at": task.created_at.timestamp(),
|
||||
"credits_used": task.credits_used,
|
||||
@@ -68,6 +82,6 @@ def playreel_view(task: PlayreelTask) -> dict:
|
||||
"metadata": None,
|
||||
"artifacts": {key: url for key, url in (
|
||||
("video", task.video_url),
|
||||
("thumbnail", task.analysis_grid_url),
|
||||
("thumbnail", thumbnail_url(task)),
|
||||
) if url},
|
||||
}
|
||||
@@ -1,8 +1,9 @@
|
||||
"""⑪ compose — 무빙포스터 훅 + 상세페이지 스크롤로 30초 롱컷을 조립한다.
|
||||
|
||||
씬 경계는 나레이션 큐다. 0초는 포스터 원본이라 첫 프레임이 곧 썸네일이 된다.
|
||||
상세페이지는 잘라 붙이지 않고 롱이미지를 실제로 스크롤한다.
|
||||
포스터·롱이미지는 세로 롱이라 9:16을 못 채워서 포스터 블러판 위에 얹는다.
|
||||
상세페이지는 잘라 붙이지 않고 롱이미지를 실제로 스크롤한다 — 조각은 "어디부터 읽을지"를
|
||||
정하는 시작점일 뿐이고, 화면에 흐르는 것은 언제나 원본 롱이미지다.
|
||||
포스터는 세로 롱이라 9:16을 못 채워서 포스터 블러판 위에 얹는다.
|
||||
|
||||
텍스트 오버레이는 넣지 않는다. 남는 글자는 엔드밴드뿐이다.
|
||||
"""
|
||||
@@ -12,7 +13,7 @@ from collections.abc import Iterator, Sequence
|
||||
from pathlib import Path
|
||||
|
||||
import numpy as np
|
||||
from PIL import Image, ImageDraw, ImageFilter
|
||||
from PIL import Image, ImageDraw, ImageFilter, ImageOps
|
||||
|
||||
from models.detail_section import DetailSection
|
||||
from models.longcut import EndBandInfo, LongcutPlan, LongcutResult, Scene
|
||||
@@ -30,9 +31,20 @@ DUCK_THRESHOLD = 0.03
|
||||
DUCK_ATTACK_MS, DUCK_RELEASE_MS = 60, 500
|
||||
BGM_FADE_OUT = 1.2
|
||||
|
||||
# 큐 1초당 화면 높이의 몇 배를 훑을지. 원본은 사람이 구간을 골랐다(known_issue 참조).
|
||||
# 큐 1초당 화면 높이의 몇 배를 훑을지. 5초 씬에 이미지 높이의 15~30%가 읽기 좋은 속도다
|
||||
SCROLL_SCREENS_PER_SECOND = 0.35
|
||||
|
||||
# 프레임보다 짧은 롱이미지를 늘릴 때 쓰는 값. 글자 없는 배경 띠를 거울 타일링한다
|
||||
INK_DEVIATION = 32 # 배경색에서 이만큼 벗어난 픽셀을 잉크로 본다
|
||||
INK_ROW_RATIO = 0.003 # 행의 잉크 비율이 이 미만이면 글자 없는 행
|
||||
EXTEND_FEATHER = 40 # 이음매를 이만큼 겹쳐 섞는다
|
||||
MIN_BLANK_BAND = 24 # 늘리기에 쓸 배경 띠의 최소 높이
|
||||
|
||||
PROOF_COUNT = 8 # 완성본 전체에서 고르게 뽑는 시점 수
|
||||
PROOF_SIZE = (180, 320)
|
||||
PROOF_GAP = 10
|
||||
THUMBNAIL_QUALITY = 90
|
||||
|
||||
BAND_HEIGHT = 300
|
||||
BAND_RISE_SECONDS = 0.6
|
||||
NOL_BLUE = (0x41, 0x54, 0xFF)
|
||||
@@ -41,7 +53,9 @@ NOL_WORDMARK = ASSET_DIR / "nol_wordmark_white.png"
|
||||
|
||||
# 큐 순서대로 채울 씬. 앞 둘은 클립, 마지막은 포스터, 나머지는 이 태그 우선순위로 고른다.
|
||||
CLIP_CUES = 2
|
||||
SCROLL_TAG_PRIORITY = ("synopsis", "still", "cast", "schedule", "discount", "event", "notice")
|
||||
# 여기 없는 태그는 시작점이 안 된다 — 유의사항·제작진·타 공연 배너·조각은 읽힐 내용이
|
||||
# 아니고, 키비주얼은 앞 큐의 포스터와 겹친다. 관람 정보는 러닝타임·관람등급이라 남긴다
|
||||
SCROLL_TAG_PRIORITY = ("synopsis", "still", "cast", "schedule", "discount", "event", "info")
|
||||
REQUIRED_TAGS = ("schedule",) # 캐스팅 스케줄은 예매 전에 확인하는 정보라 빠지면 안 된다
|
||||
|
||||
|
||||
@@ -56,20 +70,78 @@ def blurred_bg(poster: Image.Image) -> Image.Image:
|
||||
return Image.eval(blurred, lambda v: int(v * 0.45))
|
||||
|
||||
|
||||
def trim_blank(image: Image.Image, threshold: int = 235) -> Image.Image:
|
||||
"""상하단 흰·균일 여백 제거. split이 남긴 12px 여백이 화면에 흰 줄로 보인다."""
|
||||
pixels = np.asarray(image.convert("RGB")).astype(int)
|
||||
white = (pixels.min(axis=2) > threshold).mean(axis=1) > 0.98
|
||||
uniform = pixels.std(axis=1).max(axis=1) < 4
|
||||
content = np.where(~(white | uniform))[0]
|
||||
if len(content) == 0:
|
||||
def ink_rows(image: Image.Image) -> np.ndarray:
|
||||
"""행마다 글자·그림이 있는지. 배경 중앙값에서 벗어난 픽셀의 비율로 본다."""
|
||||
pixels = np.asarray(image.convert("L")).astype(np.int16)
|
||||
background = np.median(pixels)
|
||||
return (np.abs(pixels - background) > INK_DEVIATION).mean(axis=1) > INK_ROW_RATIO
|
||||
|
||||
|
||||
def blank_band(image: Image.Image) -> tuple[int, int]:
|
||||
"""늘리기에 쓸, 글자 없는 가장 긴 행 구간. 없으면 맨 아래 띠를 쓴다."""
|
||||
blank = ~ink_rows(image)
|
||||
best = (0, 0)
|
||||
start = None
|
||||
for y, empty in enumerate(np.append(blank, False)):
|
||||
if empty and start is None:
|
||||
start = y
|
||||
elif not empty and start is not None:
|
||||
if y - start > best[1] - best[0]:
|
||||
best = (start, y)
|
||||
start = None
|
||||
if best[1] - best[0] >= MIN_BLANK_BAND:
|
||||
return best
|
||||
return max(0, image.height - MIN_BLANK_BAND), image.height
|
||||
|
||||
|
||||
def extend_to_height(image: Image.Image, height: int = H) -> Image.Image:
|
||||
"""프레임보다 짧은 롱이미지를 배경 띠의 거울 타일링으로 늘린다.
|
||||
|
||||
짧다고 블러 배경 위에 얹으면 화면 절반이 포스터로 남는다. 배경만 이어 붙여
|
||||
풀프레임을 채우고, 이음매는 페더로 지운다.
|
||||
"""
|
||||
if image.height >= height:
|
||||
return image
|
||||
return image.crop((0, int(content[0]), image.width, int(content[-1]) + 1))
|
||||
|
||||
top, bottom = blank_band(image)
|
||||
band = image.crop((0, top, image.width, bottom))
|
||||
canvas = Image.new("RGB", (image.width, height))
|
||||
canvas.paste(image, (0, 0))
|
||||
|
||||
y, flipped = image.height, True
|
||||
while y < height:
|
||||
tile = ImageOps.flip(band) if flipped else band
|
||||
tile = tile.crop((0, 0, tile.width, min(tile.height, height - y)))
|
||||
canvas.paste(tile, (0, y))
|
||||
_feather_seam(canvas, y, image.width)
|
||||
y += tile.height
|
||||
flipped = not flipped
|
||||
return canvas
|
||||
|
||||
|
||||
def fit_width(image: Image.Image) -> Image.Image:
|
||||
image = trim_blank(image)
|
||||
return image.resize((W, max(1, round(image.height * W / image.width))), Image.LANCZOS)
|
||||
def _feather_seam(canvas: Image.Image, seam: int, width: int,
|
||||
feather: int = EXTEND_FEATHER) -> None:
|
||||
"""이음매 위아래를 선형 혼합해 가로줄이 보이지 않게 한다."""
|
||||
top, bottom = max(0, seam - feather), min(canvas.height, seam + feather)
|
||||
if bottom - top < 2:
|
||||
return
|
||||
patch = np.asarray(canvas.crop((0, top, width, bottom))).astype(np.float32)
|
||||
blurred = np.asarray(
|
||||
canvas.crop((0, top, width, bottom)).filter(ImageFilter.GaussianBlur(6))
|
||||
).astype(np.float32)
|
||||
weight = 1.0 - np.abs(np.linspace(-1.0, 1.0, bottom - top))
|
||||
mixed = patch + (blurred - patch) * weight[:, None, None]
|
||||
canvas.paste(Image.fromarray(mixed.clip(0, 255).astype(np.uint8)), (0, top))
|
||||
|
||||
|
||||
def to_surface(image: Image.Image) -> Image.Image:
|
||||
"""롱이미지를 폭 1080에 맞추고 프레임 높이까지 늘린다.
|
||||
|
||||
자르지 않는다 — 섹션 y좌표가 이 이미지 기준이라 위를 깎으면 시작점이 어긋난다.
|
||||
"""
|
||||
scaled = image.convert("RGB").resize(
|
||||
(W, max(1, round(image.height * W / image.width))), Image.LANCZOS)
|
||||
return extend_to_height(scaled, H)
|
||||
|
||||
|
||||
def still_scene(still: Image.Image, progress: float, index: int) -> Image.Image:
|
||||
@@ -90,15 +162,17 @@ def still_scene(still: Image.Image, progress: float, index: int) -> Image.Image:
|
||||
return frame
|
||||
|
||||
|
||||
def scroll_scene(image: Image.Image, background: Image.Image, progress: float,
|
||||
duration: float) -> Image.Image:
|
||||
"""읽는 속도로 훑는다. 이미지가 길면 위쪽만 보여준다."""
|
||||
span = max(0, image.height - H)
|
||||
reach = min(span, round(duration * SCROLL_SCREENS_PER_SECOND * H))
|
||||
top = int(reach * ease_sine(progress))
|
||||
frame = background.copy()
|
||||
frame.paste(image.crop((0, top, W, min(image.height, top + H))), (0, 0))
|
||||
return frame
|
||||
def scroll_top(surface: Image.Image, fraction: float) -> int:
|
||||
"""이미지 높이 대비 비율을 실제 crop 시작 y로. 끝을 넘지 않게 묶는다."""
|
||||
span = max(0, surface.height - H)
|
||||
return min(max(0, round(surface.height * fraction)), span)
|
||||
|
||||
|
||||
def scroll_scene(surface: Image.Image, progress: float, y0: float, y1: float) -> Image.Image:
|
||||
"""롱이미지를 y0~y1 구간까지 훑는다. 프레임을 가득 채운다 — 배경이 비지 않는다."""
|
||||
start, end = scroll_top(surface, y0), scroll_top(surface, y1)
|
||||
top = start + round((end - start) * ease_sine(progress))
|
||||
return surface.crop((0, top, W, top + H))
|
||||
|
||||
|
||||
def poster_scene(poster: Image.Image, background: Image.Image, progress: float) -> Image.Image:
|
||||
@@ -144,10 +218,19 @@ def end_band(frame: Image.Image, info: EndBandInfo, seconds: float,
|
||||
draw.text((60, top + offset + slide), text, font=font(weight, size), fill=fill)
|
||||
|
||||
|
||||
def build_scene_plan(sections: Sequence[DetailSection], cue_count: int) -> LongcutPlan:
|
||||
"""큐 앞 둘은 클립, 마지막은 포스터, 사이는 태그 우선순위로 채운다."""
|
||||
def cue_spans(timeline: NarrationTimeline) -> list[tuple[float, float]]:
|
||||
"""큐마다 (시작, 끝). 0번은 0초에서 시작해야 첫 프레임이 포스터가 된다."""
|
||||
starts = [0.0] + [cue.start for cue in timeline.cues[1:]]
|
||||
ends = [cue.start for cue in timeline.cues[1:]] + [timeline.total]
|
||||
return list(zip(starts, ends, strict=True))
|
||||
|
||||
|
||||
def scroll_starts(sections: Sequence[DetailSection],
|
||||
surfaces: dict[str, Image.Image]) -> list[DetailSection]:
|
||||
"""훑기 시작점이 될 섹션을 태그 우선순위대로. 롱이미지가 없는 섹션은 뺀다."""
|
||||
usable = [section for section in sections if section.source in surfaces]
|
||||
by_tag: dict[str, list[DetailSection]] = {}
|
||||
for section in sections:
|
||||
for section in usable:
|
||||
by_tag.setdefault(section.tag, []).append(section)
|
||||
|
||||
ordered: list[DetailSection] = []
|
||||
@@ -157,18 +240,60 @@ def build_scene_plan(sections: Sequence[DetailSection], cue_count: int) -> Longc
|
||||
for section in by_tag.get(tag, []):
|
||||
if section not in ordered:
|
||||
ordered.append(section)
|
||||
return ordered
|
||||
|
||||
scenes = []
|
||||
scroll_index = 0
|
||||
for cue in range(cue_count):
|
||||
|
||||
def scroll_window(surface: Image.Image, start_px: int, seconds: float) -> tuple[float, float]:
|
||||
"""시작 픽셀과 큐 길이로 훑을 구간을 정한다. 롱이미지 높이 대비 비율로 돌려준다.
|
||||
|
||||
여기서 crop 가능한 범위로 묶는다 — 플랜에 남는 값이 곧 실제 이동량이어야
|
||||
게이트가 0픽셀 스크롤을 걸러낼 수 있다.
|
||||
"""
|
||||
span = max(0, surface.height - H)
|
||||
start = min(max(0, start_px), span)
|
||||
end = min(start + round(seconds * SCROLL_SCREENS_PER_SECOND * H), span)
|
||||
return start / surface.height, end / surface.height
|
||||
|
||||
|
||||
def section_start_px(section: DetailSection, source: Image.Image) -> int:
|
||||
"""섹션 y좌표는 원본 롱이미지 기준이라 폭 1080 환산 배율을 곱한다."""
|
||||
return round(section.y0 * W / source.width)
|
||||
|
||||
|
||||
def build_scene_plan(sections: Sequence[DetailSection], spans: Sequence[tuple[float, float]],
|
||||
sources: dict[str, Image.Image],
|
||||
surfaces: dict[str, Image.Image]) -> LongcutPlan:
|
||||
"""큐 앞 둘은 클립, 마지막은 포스터, 사이는 롱이미지를 훑는다."""
|
||||
ordered = scroll_starts(sections, surfaces)
|
||||
fallback = max(surfaces, key=lambda name: surfaces[name].height, default=None)
|
||||
|
||||
scenes: list[Scene] = []
|
||||
index = 0
|
||||
# 롱이미지마다 어디까지 읽었는지 픽셀로 따로 센다. 비율은 이미지 높이가 다르면
|
||||
# 서로 다른 자리를 가리키므로 이어 읽기 지점으로 쓸 수 없다
|
||||
read_to: dict[str, int] = {}
|
||||
for cue, (start, end) in enumerate(spans):
|
||||
if cue < CLIP_CUES:
|
||||
scenes.append(Scene(cue=cue, kind="clip"))
|
||||
elif cue == cue_count - 1:
|
||||
elif cue == len(spans) - 1:
|
||||
scenes.append(Scene(cue=cue, kind="poster"))
|
||||
elif scroll_index < len(ordered):
|
||||
section = ordered[scroll_index]
|
||||
scenes.append(Scene(cue=cue, kind="scroll", section=section.name, tag=section.tag))
|
||||
scroll_index += 1
|
||||
elif index < len(ordered):
|
||||
section = ordered[index]
|
||||
surface = surfaces[section.source]
|
||||
y0, y1 = scroll_window(surface,
|
||||
section_start_px(section, sources[section.source]),
|
||||
end - start)
|
||||
scenes.append(Scene(cue=cue, kind="scroll", section=section.name,
|
||||
tag=section.tag, source=section.source, y0=y0, y1=y1))
|
||||
index = index + 1
|
||||
read_to[section.source] = round(y1 * surface.height)
|
||||
elif fallback is not None:
|
||||
# 쓸 섹션이 떨어져도 포스터로 때우지 않는다. 그 롱이미지를 읽던 자리에서
|
||||
# 이어 읽어야 같은 화면이 두 번 나오지 않는다
|
||||
surface = surfaces[fallback]
|
||||
y0, y1 = scroll_window(surface, read_to.get(fallback, 0), end - start)
|
||||
scenes.append(Scene(cue=cue, kind="scroll", source=fallback, y0=y0, y1=y1))
|
||||
read_to[fallback] = round(y1 * surface.height)
|
||||
else:
|
||||
scenes.append(Scene(cue=cue, kind="poster"))
|
||||
return LongcutPlan(scenes=scenes)
|
||||
@@ -209,13 +334,11 @@ def mix_audio(narration_mp3: bytes, bgm_mp3: bytes | None, duration: float) -> n
|
||||
|
||||
|
||||
def compose_frames(timeline: NarrationTimeline, plan: LongcutPlan, poster: Image.Image,
|
||||
clip: bytes, sections: dict[str, Image.Image],
|
||||
clip: bytes, surfaces: dict[str, Image.Image],
|
||||
info: EndBandInfo, qr: Image.Image | None) -> Iterator[Image.Image]:
|
||||
background = blurred_bg(poster)
|
||||
starts = [0.0] + [cue.start for cue in timeline.cues[1:]]
|
||||
bounds = [cue.start for cue in timeline.cues[1:]] + [timeline.total]
|
||||
spans = cue_spans(timeline)
|
||||
clip_frames = list(decode_frames(clip))
|
||||
scroll_images = {name: fit_width(image) for name, image in sections.items()}
|
||||
scenes = {scene.cue: scene for scene in plan.scenes}
|
||||
|
||||
def frame_at(cue: int, at: float) -> Image.Image:
|
||||
@@ -226,43 +349,71 @@ def compose_frames(timeline: NarrationTimeline, plan: LongcutPlan, poster: Image
|
||||
frame = background.copy()
|
||||
frame.paste(fitted, (0, (H - fitted.height) // 2))
|
||||
return frame
|
||||
start, end = starts[cue], bounds[cue]
|
||||
start, end = spans[cue]
|
||||
progress = (at - start) / max(end - start, 0.01)
|
||||
if scene.kind == "scroll" and scene.section in scroll_images:
|
||||
return scroll_scene(scroll_images[scene.section], background, progress, end - start)
|
||||
if scene.kind == "scroll" and scene.source in surfaces:
|
||||
return scroll_scene(surfaces[scene.source], progress,
|
||||
scene.y0 or 0.0, scene.y1 or 0.0)
|
||||
return poster_scene(poster, background, progress)
|
||||
|
||||
total_frames = round(timeline.total * FPS)
|
||||
for index in range(total_frames):
|
||||
at = index / FPS
|
||||
cue = max(order for order in range(len(timeline.cues)) if at >= starts[order])
|
||||
cue = max(order for order, (start, _) in enumerate(spans) if at >= start)
|
||||
image = frame_at(cue, at)
|
||||
remaining = (bounds[cue] - at) * FPS
|
||||
if cue < len(timeline.cues) - 1 and remaining < CROSSFADE_FRAMES \
|
||||
remaining = (spans[cue][1] - at) * FPS
|
||||
if cue < len(spans) - 1 and remaining < CROSSFADE_FRAMES \
|
||||
and scenes[cue + 1].kind != "clip":
|
||||
image = Image.blend(image, frame_at(cue + 1, at), 1 - remaining / CROSSFADE_FRAMES)
|
||||
if scenes[cue].kind == "poster":
|
||||
end_band(image, info, at - starts[cue], qr)
|
||||
end_band(image, info, at - spans[cue][0], qr)
|
||||
yield image
|
||||
|
||||
|
||||
def proof_sheet(tiles: list[Image.Image]) -> Image.Image:
|
||||
width = (PROOF_SIZE[0] + PROOF_GAP) * len(tiles) - PROOF_GAP
|
||||
sheet = Image.new("RGB", (width, PROOF_SIZE[1]), "black")
|
||||
for order, tile in enumerate(tiles):
|
||||
sheet.paste(tile, (order * (PROOF_SIZE[0] + PROOF_GAP), 0))
|
||||
return sheet
|
||||
|
||||
|
||||
def compose_longcut(poster: bytes | Path | Image.Image, clip: bytes,
|
||||
timeline: NarrationTimeline, narration_mp3: bytes,
|
||||
sections: Sequence[DetailSection], info: EndBandInfo, *,
|
||||
details: dict[str, Image.Image] | None = None,
|
||||
bgm_mp3: bytes | None = None, qr: Image.Image | None = None,
|
||||
plan: LongcutPlan | None = None) -> LongcutResult:
|
||||
plan: LongcutPlan | None = None,
|
||||
preview: bool = False) -> LongcutResult:
|
||||
"""details는 source 이름(detail_01…) → 상세페이지 롱이미지. 스크롤은 이 위에서 일어난다."""
|
||||
if isinstance(poster, Image.Image):
|
||||
source = poster.convert("RGB")
|
||||
else:
|
||||
source = Image.open(poster if isinstance(poster, Path)
|
||||
else io.BytesIO(poster)).convert("RGB")
|
||||
|
||||
plan = plan or build_scene_plan(sections, len(timeline.cues))
|
||||
used = {scene.section for scene in plan.scenes if scene.section}
|
||||
images = {section.name: section.image for section in sections if section.name in used}
|
||||
sources = dict(details or {})
|
||||
surfaces = {name: to_surface(image) for name, image in sources.items()}
|
||||
spans = cue_spans(timeline)
|
||||
plan = plan or build_scene_plan(sections, spans, sources, surfaces)
|
||||
|
||||
frames = compose_frames(timeline, plan, source, clip, images, info, qr)
|
||||
video = encode_mp4(frames, (W, H), mix_audio(narration_mp3, bgm_mp3, timeline.total),
|
||||
total_frames = round(timeline.total * FPS)
|
||||
# 훅 구간만 보면 뒤쪽 스크롤과 엔드밴드를 검수할 수 없어 전체에서 고르게 뽑는다
|
||||
proof_at = {round(step * total_frames / PROOF_COUNT) for step in range(PROOF_COUNT)}
|
||||
tiles: list[Image.Image] = []
|
||||
thumbnail = io.BytesIO()
|
||||
|
||||
def frames() -> Iterator[Image.Image]:
|
||||
for index, frame in enumerate(
|
||||
compose_frames(timeline, plan, source, clip, surfaces, info, qr)):
|
||||
if index == 0:
|
||||
frame.save(thumbnail, "JPEG", quality=THUMBNAIL_QUALITY)
|
||||
if preview and index in proof_at:
|
||||
tiles.append(frame.resize(PROOF_SIZE))
|
||||
yield frame
|
||||
|
||||
video = encode_mp4(frames(), (W, H), mix_audio(narration_mp3, bgm_mp3, timeline.total),
|
||||
fps=FPS)
|
||||
return LongcutResult(video=video, duration=timeline.total,
|
||||
frames=round(timeline.total * FPS), plan=plan)
|
||||
return LongcutResult(video=video, thumbnail=thumbnail.getvalue(),
|
||||
duration=timeline.total, frames=total_frames,
|
||||
plan=plan, proof=proof_sheet(tiles) if tiles else None)
|
||||
@@ -30,6 +30,8 @@ POSTER_W = 1000 # 9:16 안에서 포스터가 차지할 폭 (좌우
|
||||
TOP_PAD = 86
|
||||
LOOP_OVERLAP = 16 # 겹침 프레임. 소재가 잔잔할수록 키워야 이음매가 죽는다
|
||||
MIN_LOOP_SECONDS = 3
|
||||
# 한 프레임 이내로 넘치는 것은 잘려도 들리지 않는다. 이게 없으면 같은 초에서 실패한다
|
||||
NARRATION_OVERFLOW_TOLERANCE = 1 / FPS
|
||||
|
||||
NARRATION_VOL, SFX_VOL, BGM_VOL = 1.45, 0.35, 0.20
|
||||
BGM_FADE_IN = 1.0
|
||||
@@ -260,8 +262,8 @@ def render(clip: bytes, poster: Path | Image.Image, *,
|
||||
raise RuntimeError(f"루프 길이가 너무 짧다 ({loop_length}프레임) — overlap을 줄일 것")
|
||||
duration = loop_length / FPS
|
||||
|
||||
if timeline and timeline.cues[-1].end > duration:
|
||||
raise RuntimeError(f"나레이션이 {timeline.cues[-1].end:.2f}초로 영상 {duration:.2f}초를 "
|
||||
if timeline and timeline.cues[-1].end > duration + NARRATION_OVERFLOW_TOLERANCE:
|
||||
raise RuntimeError(f"나레이션이 {timeline.cues[-1].end:.3f}초로 영상 {duration:.3f}초를 "
|
||||
"넘는다 — overlap을 줄이거나 나레이션을 짧게")
|
||||
|
||||
# 2회차 — 순서대로 합성해 인코더에 바로 밀어넣는다
|
||||
|
||||
@@ -0,0 +1,126 @@
|
||||
"""스타일링 ③ — 생성된 포스터 하단에 정보 밴드를 그린다
|
||||
|
||||
큰 제목은 생성 모델이 대체로 맞추지만 작은 글자에서 자모를 흘린다
|
||||
(동대문구 → 몽대문구, 체험존 → 채헐존). 프롬프트로는 더 못 밀어낸다.
|
||||
그래서 날짜·시간·장소는 모델에 맡기지 않고 실제 폰트로 직접 그린다.
|
||||
|
||||
밴드 색은 이미지 하단에서 뽑아 얹은 티를 줄인다.
|
||||
"""
|
||||
from PIL import Image, ImageDraw, ImageFilter, ImageFont
|
||||
|
||||
from answers.poster_text_answer import PosterTextAnswer
|
||||
from utils.font import font
|
||||
|
||||
PAD_RATIO = 0.055
|
||||
BAND_RATIO_WITH_SLOGAN = 0.165
|
||||
BAND_RATIO = 0.13
|
||||
FEATHER_RATIO = 0.42
|
||||
FEATHER_CURVE = 1.4
|
||||
FEATHER_BLUR = 3
|
||||
|
||||
DARK_LUMINANCE = 118 # 이보다 어두우면 밝은 글자를 얹는다
|
||||
DARK_BACKGROUND_GAIN = 0.42
|
||||
LIGHT_BACKGROUND_GAIN, LIGHT_BACKGROUND_LIFT = 1.06, 26
|
||||
LIGHT_INK = (245, 243, 238)
|
||||
DARK_INK = (26, 24, 22)
|
||||
|
||||
MIN_FONT_SIZE = 12
|
||||
FONT_STEP = 2
|
||||
ROW_GAP_RATIO = 0.085
|
||||
|
||||
QUOTE_MARKS = '"“”'
|
||||
|
||||
|
||||
def band_palette(image: Image.Image, band_top: int) -> tuple[tuple, tuple]:
|
||||
"""밴드 배경색과 글자색을 이미지 하단 평균색에서 뽑는다"""
|
||||
width, height = image.size
|
||||
strip = image.crop((0, band_top, width, height)).resize((1, 1), Image.LANCZOS)
|
||||
red, green, blue = strip.getpixel((0, 0))[:3]
|
||||
luminance = 0.299 * red + 0.587 * green + 0.114 * blue
|
||||
|
||||
if luminance < DARK_LUMINANCE:
|
||||
background = tuple(int(channel * DARK_BACKGROUND_GAIN)
|
||||
for channel in (red, green, blue))
|
||||
return background, LIGHT_INK
|
||||
background = tuple(min(255, int(channel * LIGHT_BACKGROUND_GAIN + LIGHT_BACKGROUND_LIFT))
|
||||
for channel in (red, green, blue))
|
||||
return background, DARK_INK
|
||||
|
||||
|
||||
def fit_font(draw: ImageDraw.ImageDraw, text: str, weight: str, max_width: int,
|
||||
start_size: int) -> ImageFont.FreeTypeFont:
|
||||
"""max_width 안에 들어가는 가장 큰 크기를 찾는다"""
|
||||
size = start_size
|
||||
while size > MIN_FONT_SIZE:
|
||||
candidate = font(weight, size)
|
||||
if draw.textlength(text, font=candidate) <= max_width:
|
||||
return candidate
|
||||
size -= FONT_STEP
|
||||
return font(weight, MIN_FONT_SIZE)
|
||||
|
||||
|
||||
def band_rows(text: PosterTextAnswer, band_height: int) -> list[tuple[str, str, int, float]]:
|
||||
"""슬로건 → 날짜+시간 → 장소 순. 날짜를 가장 크게 잡는다
|
||||
|
||||
슬로건은 원래 제목 근처에 놓이는 문구지만 생성 결과의 제목 위치가 매번 달라
|
||||
상단에 얹으면 아트워크와 부딪힌다. 밴드 첫 줄로 내려 항상 읽히게 한다.
|
||||
"""
|
||||
slogan = text.slogan.strip().strip(QUOTE_MARKS)
|
||||
datetime_line = text.date.strip() + (f" {text.time.strip()}" if text.time.strip() else "")
|
||||
|
||||
rows = []
|
||||
if slogan:
|
||||
rows.append((f"“{slogan}”", "SemiBold", round(band_height * 0.20), 0.72))
|
||||
if datetime_line:
|
||||
rows.append((datetime_line, "Bold", round(band_height * 0.33), 1.0))
|
||||
if text.place.strip():
|
||||
rows.append((text.place.strip(), "SemiBold", round(band_height * 0.21), 0.92))
|
||||
return rows
|
||||
|
||||
|
||||
def paint_scrim(image: Image.Image, band_top: int, band_height: int,
|
||||
background: tuple) -> None:
|
||||
"""위쪽 경계가 칼같이 잘리면 얹은 티가 난다. 그라데이션으로 이어 붙인다"""
|
||||
width = image.width
|
||||
scrim = Image.new("RGB", (width, band_height), background)
|
||||
mask = Image.new("L", (width, band_height), 255)
|
||||
mask_draw = ImageDraw.Draw(mask)
|
||||
feather = round(band_height * FEATHER_RATIO)
|
||||
for row in range(feather):
|
||||
mask_draw.line([(0, row), (width, row)],
|
||||
fill=int(255 * (row / feather) ** FEATHER_CURVE))
|
||||
image.paste(scrim, (0, band_top), mask.filter(ImageFilter.GaussianBlur(FEATHER_BLUR)))
|
||||
|
||||
|
||||
def compose_info_band(poster: Image.Image, text: PosterTextAnswer) -> Image.Image | None:
|
||||
"""밴드를 얹은 이미지를 돌려준다. 그릴 내용이 없으면 None"""
|
||||
if not (text.date.strip() or text.place.strip()):
|
||||
return None
|
||||
|
||||
image = poster.convert("RGB")
|
||||
width, height = image.size
|
||||
band_height = round(height * (BAND_RATIO_WITH_SLOGAN if text.slogan.strip()
|
||||
else BAND_RATIO))
|
||||
band_top = height - band_height
|
||||
background, ink = band_palette(image, band_top)
|
||||
paint_scrim(image, band_top, band_height, background)
|
||||
|
||||
draw = ImageDraw.Draw(image)
|
||||
inner_width = width - round(width * PAD_RATIO) * 2
|
||||
rows = band_rows(text, band_height)
|
||||
fitted = [(line, fit_font(draw, line, weight, inner_width, size), opacity)
|
||||
for line, weight, size, opacity in rows]
|
||||
|
||||
gap = round(band_height * ROW_GAP_RATIO)
|
||||
heights = [chosen.getbbox(line)[3] - chosen.getbbox(line)[1]
|
||||
for line, chosen, _ in fitted]
|
||||
top = band_top + (band_height - (sum(heights) + gap * (len(fitted) - 1))) // 2 \
|
||||
- round(band_height * 0.03)
|
||||
|
||||
for (line, chosen, opacity), line_height in zip(fitted, heights, strict=True):
|
||||
colour = ink if opacity >= 1.0 else tuple(
|
||||
round(channel * opacity + background[index] * (1 - opacity))
|
||||
for index, channel in enumerate(ink))
|
||||
draw.text((width // 2, top), line, font=chosen, fill=colour, anchor="ma")
|
||||
top += line_height + gap
|
||||
return image
|
||||
@@ -0,0 +1,37 @@
|
||||
"""스타일링 ① — 포스터에 인쇄된 글자를 읽는다
|
||||
|
||||
이미지 생성 모델은 한글을 다시 그리며 자모를 바꾼다(맥주축제 → 백주축제).
|
||||
프롬프트로는 못 막으므로 읽기를 먼저 하고 그 문자열을 생성 프롬프트에 못 박는다.
|
||||
"""
|
||||
from PIL import Image
|
||||
|
||||
from answers.poster_text_answer import PosterTextAnswer
|
||||
from settings import settings
|
||||
from utils.common_llm import StructuredLLM
|
||||
from utils.image import to_data_uri
|
||||
from utils.prompt import load_prompt
|
||||
|
||||
# 자모가 보일 만큼은 키워서 넣는다
|
||||
MIN_LONG_EDGE = 1400
|
||||
MAX_SIZE = (1536, 1536)
|
||||
|
||||
POSTER_TEXT_PROMPT = load_prompt("poster_text")
|
||||
|
||||
poster_text_llm = StructuredLLM("gpt-4o", settings.chatgpt_api_key)
|
||||
|
||||
|
||||
def readable_copy(poster: Image.Image) -> Image.Image:
|
||||
source = poster.convert("RGB")
|
||||
if max(source.size) < MIN_LONG_EDGE:
|
||||
scale = MIN_LONG_EDGE / max(source.size)
|
||||
source = source.resize((round(source.width * scale), round(source.height * scale)),
|
||||
Image.LANCZOS)
|
||||
source.thumbnail(MAX_SIZE, Image.LANCZOS)
|
||||
return source
|
||||
|
||||
|
||||
async def read_poster_text(poster: Image.Image) -> PosterTextAnswer:
|
||||
image = readable_copy(poster)
|
||||
return await poster_text_llm.ask_with_images(
|
||||
PosterTextAnswer, POSTER_TEXT_PROMPT, [("포스터", to_data_uri(image))],
|
||||
temperature=0.1)
|
||||
@@ -0,0 +1,57 @@
|
||||
"""스타일링 ② — 레퍼런스 이미지에서 화풍 명세를 뽑는다
|
||||
|
||||
번들 템플릿 빌드와 사용자 업로드가 같은 경로를 탄다.
|
||||
둘이 갈라지면 사용자 템플릿만 품질이 떨어지고 원인을 찾기 어려워진다.
|
||||
"""
|
||||
import io
|
||||
|
||||
from PIL import Image
|
||||
|
||||
from answers.style_prompt_answer import StylePromptAnswer
|
||||
from models.styling import ReferenceVariants
|
||||
from settings import settings
|
||||
from utils.common_llm import StructuredLLM
|
||||
from utils.image import to_data_uri
|
||||
from utils.prompt import load_prompt
|
||||
|
||||
REFERENCE_LONG_EDGE = 2400 # 붓질이 보이는 최소선
|
||||
THUMBNAIL_LONG_EDGE = 600 # 화면 카드
|
||||
VISION_SIZE = (1536, 1536)
|
||||
SMALL_REFERENCE_WARN = 600 # 이보다 작으면 결과가 나빠진다. 막지는 않는다
|
||||
|
||||
REFERENCE_QUALITY = 92
|
||||
THUMBNAIL_QUALITY = 88
|
||||
|
||||
STYLE_PROMPT_PROMPT = load_prompt("style_prompt")
|
||||
|
||||
style_llm = StructuredLLM("gpt-4o", settings.chatgpt_api_key)
|
||||
|
||||
|
||||
def encode(image: Image.Image, quality: int) -> bytes:
|
||||
buffer = io.BytesIO()
|
||||
image.save(buffer, "JPEG", quality=quality, optimize=True)
|
||||
return buffer.getvalue()
|
||||
|
||||
|
||||
def build_variants(raw: bytes) -> ReferenceVariants:
|
||||
"""올린 바이트에서 전이용 고해상본과 카드용 썸네일을 만든다"""
|
||||
Image.MAX_IMAGE_PIXELS = None
|
||||
source = Image.open(io.BytesIO(raw)).convert("RGB")
|
||||
source.thumbnail((REFERENCE_LONG_EDGE, REFERENCE_LONG_EDGE), Image.LANCZOS)
|
||||
|
||||
thumbnail = source.copy()
|
||||
thumbnail.thumbnail((THUMBNAIL_LONG_EDGE, THUMBNAIL_LONG_EDGE), Image.LANCZOS)
|
||||
|
||||
return ReferenceVariants(reference=encode(source, REFERENCE_QUALITY),
|
||||
thumbnail=encode(thumbnail, THUMBNAIL_QUALITY),
|
||||
size=source.size)
|
||||
|
||||
|
||||
async def analyze_style(reference: bytes) -> str:
|
||||
Image.MAX_IMAGE_PIXELS = None
|
||||
image = Image.open(io.BytesIO(reference)).convert("RGB")
|
||||
|
||||
answer = await style_llm.ask_with_images(
|
||||
StylePromptAnswer, STYLE_PROMPT_PROMPT,
|
||||
[("레퍼런스", to_data_uri(image, VISION_SIZE))], temperature=0.2)
|
||||
return answer.style_prompt
|
||||
@@ -0,0 +1,144 @@
|
||||
"""스타일링 ④ — 포스터를 레퍼런스 화풍으로 다시 그린다
|
||||
|
||||
내부 검토용이다. 번들 레퍼런스의 권리가 남아 있어 결과물을 그대로 밖에 내지 않는다.
|
||||
"""
|
||||
import base64
|
||||
import io
|
||||
|
||||
import httpx
|
||||
from PIL import Image
|
||||
|
||||
from answers.poster_text_answer import PosterTextAnswer
|
||||
from models.styling import OutputFormat, StyleTemplate, TransferResult
|
||||
from services.styling.info_band import compose_info_band
|
||||
from services.styling.poster_text import read_poster_text
|
||||
from settings import settings
|
||||
|
||||
IMAGES_EDIT_API = "https://api.openai.com/v1/images/edits"
|
||||
IMAGE_MODEL = "gpt-image-2" # gpt-image-1은 한글 제목 끝자를 흘렸다
|
||||
IMAGE_QUALITY = "high"
|
||||
REQUEST_TIMEOUT = httpx.Timeout(300.0, connect=10.0)
|
||||
|
||||
# gpt-image가 내는 크기로 생성한 뒤 필요하면 센터 크롭한다
|
||||
OUTPUT_FORMATS = (
|
||||
OutputFormat(id="poster", label="포스터 2:3", generated_size="1024x1536"),
|
||||
OutputFormat(id="story", label="스토리 9:16", generated_size="1024x1536",
|
||||
crop=(864, 1536)),
|
||||
OutputFormat(id="feed", label="피드 4:5", generated_size="1024x1536",
|
||||
crop=(1024, 1280)),
|
||||
OutputFormat(id="square", label="정방형 1:1", generated_size="1024x1024"),
|
||||
)
|
||||
FORMATS_BY_ID = {output.id: output for output in OUTPUT_FORMATS}
|
||||
|
||||
SQUARE_SIZE = "1024x1024"
|
||||
RESERVED_BOTTOM = "22%" # 정보 밴드가 들어갈 자리
|
||||
|
||||
# 성공한 프롬프트만 "그릴 수 있는 말"로 돼 있었다. 무드 형용사는 픽셀로 번역되지 않는다.
|
||||
# 또 하나 — 성공 사례는 스타일만 얹은 게 아니라 그 화법으로 장면을 다시 그렸다.
|
||||
TRANSFER_PROMPT = (
|
||||
"Redraw the first image as a brand-new movie-style poster, fully committing to the "
|
||||
"visual language described below. Do not merely apply a color filter — rebuild the "
|
||||
"illustration, lighting, texture and title lettering from scratch in that style.\n\n"
|
||||
"STYLE TO ADOPT: {style_prompt}\n\n"
|
||||
"KEEP FROM THE ORIGINAL: the event name and the subject matter of the artwork (what the "
|
||||
"event is about). The people, objects and scenery may be re-staged and re-drawn in the "
|
||||
"new style.\n\n"
|
||||
"{text_manifest}"
|
||||
"TEXT RULE: render Korean text sharp and legible. Do not swap visually similar jamo "
|
||||
"(ㅁ/ㅂ, ㅈ/ㅊ), do not drop trailing characters, and do not invent words. {orientation}"
|
||||
)
|
||||
|
||||
TITLE_MANIFEST = (
|
||||
"TEXT TO RENDER — the poster must contain exactly ONE piece of text, the main "
|
||||
"title, rendered character-for-character as written here. This is the correct "
|
||||
"reading; if the original image looks different, trust this line:\n"
|
||||
" Main title: 「{title}」\n"
|
||||
# 위치를 안 박으면 제목을 하단 예약 영역에 놓아 정보 밴드와 겹친다
|
||||
" Placement: put this title in the UPPER THIRD of the poster, near the top "
|
||||
"edge. It must not appear in the lower half.\n\n"
|
||||
)
|
||||
|
||||
# 작은 글자는 모델이 자모를 흘린다(주류 → 중류). 제목만 그리게 하고 나머지는 밴드로 얹는다.
|
||||
NO_OTHER_TEXT = (
|
||||
"DO NOT RENDER any other text. No tagline or slogan, no date, no time, no venue "
|
||||
"name, no programme or zone labels, no admission info, no phone numbers, no URLs, "
|
||||
"no organiser or sponsor credits, no logos with lettering. Apart from the single "
|
||||
f"title line the poster must be free of characters. Leave the bottom {RESERVED_BOTTOM} "
|
||||
"as artwork or background only — that area is reserved and will be filled in afterwards.\n\n"
|
||||
)
|
||||
|
||||
|
||||
def text_manifest(text: PosterTextAnswer) -> str:
|
||||
title = TITLE_MANIFEST.format(title=text.title) if text.title.strip() else ""
|
||||
return title + NO_OTHER_TEXT
|
||||
|
||||
|
||||
def build_prompt(template: StyleTemplate, text: PosterTextAnswer,
|
||||
output: OutputFormat) -> str:
|
||||
orientation = ("Square 1:1 poster." if output.generated_size == SQUARE_SIZE
|
||||
else "Vertical 2:3 poster.")
|
||||
return TRANSFER_PROMPT.format(style_prompt=template.style_prompt,
|
||||
text_manifest=text_manifest(text),
|
||||
orientation=orientation)
|
||||
|
||||
|
||||
def center_crop(image: Image.Image, size: tuple[int, int]) -> Image.Image:
|
||||
target_width, target_height = size
|
||||
scale = max(target_width / image.width, target_height / image.height)
|
||||
scaled = image.resize((round(image.width * scale), round(image.height * scale)),
|
||||
Image.LANCZOS)
|
||||
left = (scaled.width - target_width) // 2
|
||||
top = (scaled.height - target_height) // 2
|
||||
return scaled.crop((left, top, left + target_width, top + target_height))
|
||||
|
||||
|
||||
def encode_png(image: Image.Image) -> bytes:
|
||||
buffer = io.BytesIO()
|
||||
image.save(buffer, "PNG")
|
||||
return buffer.getvalue()
|
||||
|
||||
|
||||
async def request_edit(poster: bytes, reference: bytes, prompt: str,
|
||||
generated_size: str) -> bytes:
|
||||
files = [
|
||||
("image[]", ("poster.jpg", poster, "image/jpeg")),
|
||||
("image[]", ("reference.jpg", reference, "image/jpeg")),
|
||||
]
|
||||
data = {"model": IMAGE_MODEL, "prompt": prompt, "size": generated_size,
|
||||
"quality": IMAGE_QUALITY, "n": "1"}
|
||||
|
||||
async with httpx.AsyncClient(timeout=REQUEST_TIMEOUT) as client:
|
||||
response = await client.post(
|
||||
IMAGES_EDIT_API, files=files, data=data,
|
||||
headers={"Authorization": f"Bearer {settings.chatgpt_api_key}"})
|
||||
if response.status_code != 200:
|
||||
raise RuntimeError(f"{IMAGE_MODEL} 호출 실패 {response.status_code}: "
|
||||
f"{response.text[:400]}")
|
||||
|
||||
items = response.json().get("data") or []
|
||||
if not items or not items[0].get("b64_json"):
|
||||
raise RuntimeError(f"{IMAGE_MODEL} 빈 응답 — 거절되었을 수 있다")
|
||||
return base64.b64decode(items[0]["b64_json"])
|
||||
|
||||
|
||||
async def transfer_style(poster: bytes, template: StyleTemplate, reference: bytes, *,
|
||||
format_id: str = "poster",
|
||||
text: PosterTextAnswer | None = None) -> TransferResult:
|
||||
output = FORMATS_BY_ID.get(format_id)
|
||||
if output is None:
|
||||
raise ValueError(f"미지의 format: {format_id!r} (허용: {list(FORMATS_BY_ID)})")
|
||||
|
||||
text = text or await read_poster_text(Image.open(io.BytesIO(poster)))
|
||||
prompt = build_prompt(template, text, output)
|
||||
generated = Image.open(io.BytesIO(
|
||||
await request_edit(poster, reference, prompt, output.generated_size)))
|
||||
|
||||
if output.crop:
|
||||
generated = center_crop(generated, output.crop)
|
||||
# 날짜·시간·장소는 모델이 안 그렸다. 실제 폰트로 얹는다
|
||||
with_band = compose_info_band(generated, text)
|
||||
|
||||
return TransferResult(image=encode_png(with_band or generated),
|
||||
format_id=output.id,
|
||||
style_prompt=template.style_prompt,
|
||||
has_info_band=with_band is not None)
|
||||
@@ -3,6 +3,9 @@
|
||||
"파일이 존재하는가"만 보던 검증 탓에 구름이 제목을 덮은 클립이 검수대까지 간 적이 있다.
|
||||
픽셀 지표 하나로는 갈리지 않아서 — 영역 평균차는 제목 뒤 불꽃과 제목 위 구름을 구분 못 하고
|
||||
글리프 휘도차는 흰 구름이 흰 글자를 덮으면 0에 수렴한다 — 2단을 VLM 가독성 판정으로 둔다.
|
||||
|
||||
두 단 모두 첫 프레임을 기준으로 삼는다. detect가 읽은 제목 문자열과는 대조하지 않는다 —
|
||||
상자가 제목의 일부만 덮으면 잘려 나간 글자를 훼손으로 오인한다.
|
||||
"""
|
||||
import numpy as np
|
||||
from PIL import Image
|
||||
@@ -76,18 +79,20 @@ def pixel_score(crops: list[Image.Image]) -> float | None:
|
||||
for crop in crops[1:])
|
||||
|
||||
|
||||
async def ask_legibility(crops: list[Image.Image], times: list[float],
|
||||
title: str) -> TitleGateAnswer:
|
||||
images = [(f"[{index}] t={at}s:", to_data_uri(crop, CROP_MAX_SIZE))
|
||||
async def ask_legibility(crops: list[Image.Image], times: list[float]) -> TitleGateAnswer:
|
||||
"""[0]이 기준이다. 옮겨 적은 제목과 대조하지 않는다 —
|
||||
detect가 읽은 글자와 detect가 잡은 상자가 어긋나면 그 차이를 훼손으로 오인한다."""
|
||||
images = [(f"[{index}] t={at}s{' (원본)' if index == 0 else ''}:",
|
||||
to_data_uri(crop, CROP_MAX_SIZE))
|
||||
for index, (crop, at) in enumerate(zip(crops, times, strict=True))]
|
||||
return await title_gate_llm.ask_with_images(
|
||||
TitleGateAnswer,
|
||||
f"기대 제목: {title!r}\n시점 {len(crops)}장. 각 이미지를 순서대로 판정하라.",
|
||||
f"시점 {len(crops)}장. [0]을 기준으로 각 이미지를 순서대로 판정하라.",
|
||||
images, system=TITLE_GATE_PROMPT)
|
||||
|
||||
|
||||
async def check_title(clip: bytes, regions: Regions) -> TitleGateVerdict:
|
||||
"""판단 근거가 없으면(제목 상자·텍스트 없음) 통과시키고 사유를 남긴다."""
|
||||
"""제목 상자가 없으면 판단 근거가 없으므로 통과시키고 사유를 남긴다."""
|
||||
clip_seconds = duration(clip)
|
||||
times = [round(max(0.0, min(clip_seconds - 0.05, fraction * clip_seconds)), 2)
|
||||
for fraction in SAMPLE_FRACTIONS]
|
||||
@@ -99,26 +104,19 @@ async def check_title(clip: bytes, regions: Regions) -> TitleGateVerdict:
|
||||
crops = [frame.crop(box) for frame in frames]
|
||||
|
||||
score = pixel_score(crops)
|
||||
title = (regions.regions["title"].text or "").strip()
|
||||
verdict = TitleGateVerdict(passed=True, samples=times,
|
||||
pixel_score=round(score, 2) if score is not None else None)
|
||||
|
||||
if score is not None and score > PIXEL_HARD_FAIL:
|
||||
# 정렬 후에도 넘는 값은 대개 배경 통과라 즉시 실패시키지 않고 VLM으로 넘긴다
|
||||
verdict.pixel_hard = True
|
||||
if not title:
|
||||
verdict.passed = False
|
||||
verdict.reason = f"획변화 {score:.1f} > {PIXEL_HARD_FAIL}, title.text 없어 VLM 판정 불가"
|
||||
return verdict
|
||||
if not title:
|
||||
verdict.skip = "title.text 없음 — VLM 가독성 판정 불가"
|
||||
return verdict
|
||||
|
||||
answer = await ask_legibility(crops, times, title)
|
||||
answer = await ask_legibility(crops, times)
|
||||
verdict.frames = [FrameVerdict(index=frame.index, time=times[frame.index],
|
||||
legible=frame.legible, broken=frame.broken)
|
||||
for frame in answer.frames if frame.index < len(times)]
|
||||
broken = [frame for frame in verdict.frames if not frame.legible]
|
||||
# [0]은 원본이라 판정 대상이 아니다
|
||||
broken = [frame for frame in verdict.frames if not frame.legible and frame.index > 0]
|
||||
if broken:
|
||||
verdict.passed = False
|
||||
verdict.reason = "제목 가독 훼손: " + "; ".join(
|
||||
|
||||
@@ -21,6 +21,12 @@ class Settings(BaseSettings):
|
||||
azure_blob_base_url: str = ""
|
||||
azure_blob_sas_token: str = ""
|
||||
|
||||
# 비어 있으면 구글 로그인이 꺼진다. 값은 비밀이 아니라 프론트 번들에도 들어간다
|
||||
google_client_id: str = ""
|
||||
# 자체 세션 토큰 서명 키. 바뀌면 로그인된 사람이 전부 풀린다
|
||||
jwt_secret: str = ""
|
||||
jwt_days: int = 14
|
||||
|
||||
@property
|
||||
def mysql_url(self) -> str:
|
||||
password = quote_plus(self.mysql_password)
|
||||
|
||||
@@ -9,6 +9,7 @@ from sqlalchemy import JSON, Boolean, DateTime, Enum, Float, Integer, String, Te
|
||||
from sqlalchemy.orm import Mapped, mapped_column
|
||||
|
||||
from models.pipeline_state import PlayreelState, PosterAliveState
|
||||
from tables.user import UNASSIGNED_USER_ID, USER_ID_LENGTH
|
||||
from utils.database import Base
|
||||
|
||||
URL_LENGTH = 512
|
||||
@@ -31,6 +32,9 @@ class TaskBase(Base):
|
||||
|
||||
id: Mapped[str] = mapped_column(String(TASK_ID_LENGTH), primary_key=True,
|
||||
default=new_task_id)
|
||||
# 만든 사람의 구글 sub. 모르면 UNASSIGNED_USER_ID가 들어간다
|
||||
user_id: Mapped[str] = mapped_column(String(USER_ID_LENGTH), index=True,
|
||||
default=UNASSIGNED_USER_ID)
|
||||
name: Mapped[str] = mapped_column(String(255), default="")
|
||||
status: Mapped[str] = mapped_column(String(32), default="queued", index=True)
|
||||
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
"""구글 계정으로 로그인한 사람
|
||||
|
||||
id가 곧 구글 sub다. 이메일이 바뀌어도 유지되는 값이라 따로 발급하지 않는다.
|
||||
잡 생성 횟수는 행을 세지 않고 누적값을 올린다 — 잡을 지워도 회복되지 않는다.
|
||||
"""
|
||||
from datetime import datetime
|
||||
|
||||
from sqlalchemy import DateTime, Integer, String, func
|
||||
from sqlalchemy.orm import Mapped, mapped_column
|
||||
|
||||
from utils.database import Base
|
||||
|
||||
USER_ID_LENGTH = 64
|
||||
EMAIL_LENGTH = 320
|
||||
PICTURE_URL_LENGTH = 512
|
||||
DEFAULT_JOB_LIMIT = 3
|
||||
|
||||
# 소유자를 모르는 잡의 자리. 나중에 admin의 sub로 덮어쓴다
|
||||
UNASSIGNED_USER_ID = "0"
|
||||
|
||||
|
||||
class User(Base):
|
||||
__tablename__ = "user"
|
||||
|
||||
id: Mapped[str] = mapped_column(String(USER_ID_LENGTH), primary_key=True)
|
||||
email: Mapped[str] = mapped_column(String(EMAIL_LENGTH), index=True)
|
||||
name: Mapped[str] = mapped_column(String(255), default="")
|
||||
# 구글 프로필 사진. 토큰에만 들어오는 값이라 로그인할 때 받아 둔다
|
||||
picture_url: Mapped[str] = mapped_column(String(PICTURE_URL_LENGTH), default="")
|
||||
|
||||
# 만들 수 있는 총 잡 수. 무제한으로 둘 계정은 이 값을 크게 올린다
|
||||
job_limit: Mapped[int] = mapped_column(Integer, default=DEFAULT_JOB_LIMIT)
|
||||
jobs_created: Mapped[int] = mapped_column(Integer, default=0)
|
||||
|
||||
created_at: Mapped[datetime] = mapped_column(DateTime, server_default=func.now())
|
||||
last_login_at: Mapped[datetime] = mapped_column(DateTime, server_default=func.now(),
|
||||
onupdate=func.now())
|
||||
|
||||
@property
|
||||
def can_create_job(self) -> bool:
|
||||
return self.jobs_created < self.job_limit
|
||||
|
||||
@property
|
||||
def jobs_left(self) -> int:
|
||||
return max(0, self.job_limit - self.jobs_created)
|
||||
@@ -31,6 +31,16 @@ def load_sections(sections_dir: Path) -> list[DetailSection]:
|
||||
for item in json.loads(index_path.read_text(encoding="utf-8"))]
|
||||
|
||||
|
||||
def load_details(product_dir: Path) -> dict[str, Image.Image]:
|
||||
"""상세페이지 롱이미지. 스크롤은 조각이 아니라 이 위에서 일어난다."""
|
||||
details = {}
|
||||
for path in sorted((product_dir / "details").glob("detail_*.*")):
|
||||
details[path.stem] = Image.open(path)
|
||||
if not details:
|
||||
raise SystemExit(f"{product_dir / 'details'} 비었음 — test_fetch_nol 을 먼저 돌릴 것")
|
||||
return details
|
||||
|
||||
|
||||
def band_info(meta: NolMeta) -> EndBandInfo:
|
||||
period = f"{meta.play_start_date or ''} ~ {meta.play_end_date or ''}".strip(" ~")
|
||||
detail = " · ".join(part for part in (period.replace("-", "."), meta.place_name) if part)
|
||||
@@ -66,6 +76,7 @@ def main() -> None:
|
||||
product_dir / "upscaled.png", clip_path.read_bytes(), timeline,
|
||||
(product_dir / "narration.mp3").read_bytes(),
|
||||
load_sections(product_dir / "sections"), band_info(meta),
|
||||
details=load_details(product_dir),
|
||||
bgm_mp3=bgm_path.read_bytes() if bgm_path.exists() else None,
|
||||
qr=Image.open(qr_path) if qr_path.exists() else None)
|
||||
|
||||
@@ -75,7 +86,9 @@ def main() -> None:
|
||||
|
||||
for scene in result.plan.scenes:
|
||||
label = f"{scene.section} [{scene.tag}]" if scene.section else ""
|
||||
print(f" 큐{scene.cue} {scene.kind:7} {label}")
|
||||
span = (f" {scene.source} {scene.y0:.3f}→{scene.y1:.3f}"
|
||||
if scene.kind == "scroll" else "")
|
||||
print(f" 큐{scene.cue} {scene.kind:7} {label}{span}")
|
||||
if not qr_path.exists():
|
||||
print(f"※ {qr_path.name} 없음 — 엔드밴드에 QR을 안 넣는다")
|
||||
print(f"\n{result.frames}프레임 · {result.duration:.2f}초 · {len(result.video) / 1e6:.1f}MB")
|
||||
|
||||
@@ -5,6 +5,7 @@ SAS 토큰을 붙인 URL로 PUT 한 번. 경로 규칙은 부르는 쪽이 정
|
||||
"""
|
||||
import mimetypes
|
||||
from pathlib import Path
|
||||
from urllib.parse import quote
|
||||
|
||||
import httpx
|
||||
|
||||
@@ -60,15 +61,31 @@ def with_sas(url: str) -> str:
|
||||
return url
|
||||
|
||||
|
||||
async def upload_bytes(data: bytes, path: str, content_type: str | None = None) -> str:
|
||||
def as_attachment(filename: str) -> str:
|
||||
"""이 값이 붙은 blob은 브라우저가 열면 내려받기가 된다.
|
||||
|
||||
<a download>은 다른 출처에 안 먹어 완성본은 이 길로 간다.
|
||||
한글 파일명은 RFC 5987 형식이라야 온전히 건너간다.
|
||||
"""
|
||||
return f"attachment; filename*=UTF-8''{quote(filename)}"
|
||||
|
||||
|
||||
async def upload_bytes(data: bytes, path: str, content_type: str | None = None,
|
||||
disposition: str | None = None) -> str:
|
||||
"""path 예: playreel/nol_26007416/clip.mp4. 공개 URL을 돌려준다."""
|
||||
if not settings.azure_blob_base_url or not settings.azure_blob_sas_token:
|
||||
raise RuntimeError("AZURE_BLOB_BASE_URL / AZURE_BLOB_SAS_TOKEN 없음")
|
||||
|
||||
headers = {"Content-Type": content_type or guess_content_type(path), **BLOB_TYPE_HEADER}
|
||||
if disposition:
|
||||
# 헤더 이름이 Content-Disposition이면 이 요청 본문의 성격으로 읽힌다.
|
||||
# blob 속성으로 저장되는 것은 x-ms- 쪽이다
|
||||
headers["x-ms-blob-content-disposition"] = disposition
|
||||
response = await get_client().put(upload_url(path), content=data, headers=headers)
|
||||
if response.status_code not in (200, 201):
|
||||
raise RuntimeError(f"blob 업로드 실패 {response.status_code}: {response.text[:300]}")
|
||||
print(f"[blob] 업로드 실패 {response.status_code} {path}: {response.text[:300]}",
|
||||
flush=True)
|
||||
raise RuntimeError(f"blob 업로드 실패 {response.status_code}")
|
||||
return public_url(path)
|
||||
|
||||
|
||||
@@ -78,8 +95,13 @@ async def upload_file(file_path: Path, path: str, content_type: str | None = Non
|
||||
|
||||
|
||||
async def download_bytes(url: str) -> bytes:
|
||||
"""upload_bytes가 돌려준 URL을 그대로 받아 내용을 가져온다."""
|
||||
"""upload_bytes가 돌려준 URL을 그대로 받아 내용을 가져온다.
|
||||
|
||||
예외 메시지에 주소를 넣지 않는다 — 실패는 잡에 기록되어 화면까지 간다.
|
||||
어느 파일이었는지는 로그를 본다.
|
||||
"""
|
||||
response = await get_client().get(with_sas(url))
|
||||
if response.status_code != 200:
|
||||
raise RuntimeError(f"blob 다운로드 실패 {response.status_code}: {url}")
|
||||
print(f"[blob] 다운로드 실패 {response.status_code}: {url}", flush=True)
|
||||
raise RuntimeError(f"blob 다운로드 실패 {response.status_code}")
|
||||
return response.content
|
||||
@@ -1,6 +1,5 @@
|
||||
"""MySQL 비동기 세션.
|
||||
|
||||
FastAPI 의존성으로 쓴다:
|
||||
"""MySQL 비동기 세션
|
||||
FastAPI 의존성으로 받아 씀
|
||||
async def handler(session: AsyncSession = Depends(get_session)): ...
|
||||
"""
|
||||
from collections.abc import AsyncGenerator
|
||||
|
||||
@@ -0,0 +1,118 @@
|
||||
"""구글 ID 토큰 검증
|
||||
브라우저가 받아온 토큰이 구글이 우리 앱 앞으로 발급한 것인지만 본다
|
||||
|
||||
코드 교환을 하지 않아 client_secret이 없다 — 검증에 필요한 것은 공개키와 client_id뿐이다.
|
||||
검증을 통과하면 그 뒤로는 우리 토큰을 쓴다. 구글 토큰을 세션으로 들고 다니지 않는다.
|
||||
|
||||
빠지면 안 되는 검사 셋
|
||||
서명 — 구글 JWKS 공개키. 없으면 아무나 만든 JSON이 통과한다
|
||||
aud — 우리 client_id. 없으면 다른 앱 앞으로 발급된 진짜 구글 토큰이 통과한다
|
||||
iss — accounts.google.com
|
||||
"""
|
||||
import asyncio
|
||||
import time
|
||||
|
||||
import httpx
|
||||
from jose import JWTError, jwt
|
||||
|
||||
from settings import settings
|
||||
|
||||
JWKS_URL = "https://www.googleapis.com/oauth2/v3/certs"
|
||||
# 구글이 두 표기를 다 쓴다. 한쪽만 받으면 어느 날 전원 로그인 실패가 된다
|
||||
ISSUERS = ("accounts.google.com", "https://accounts.google.com")
|
||||
JWKS_TTL_SECONDS = 3600
|
||||
HTTP_TIMEOUT = 5.0
|
||||
|
||||
_jwks: dict | None = None
|
||||
_jwks_fetched_at = 0.0
|
||||
# 토큰이 동시에 여러 개 들어와도 JWKS는 한 번만 받는다
|
||||
_jwks_lock = asyncio.Lock()
|
||||
|
||||
|
||||
class GoogleLoginDisabled(RuntimeError):
|
||||
"""GOOGLE_CLIENT_ID 없음 — 구글 로그인만 꺼지고 서버는 뜬다"""
|
||||
|
||||
|
||||
class GoogleTokenInvalid(RuntimeError):
|
||||
"""서명·aud·iss·만료 중 하나가 어긋남"""
|
||||
|
||||
|
||||
class GoogleAccount:
|
||||
def __init__(self, sub: str, email: str, name: str, picture: str):
|
||||
self.sub = sub
|
||||
self.email = email
|
||||
self.name = name
|
||||
self.picture = picture
|
||||
|
||||
|
||||
def is_enabled() -> bool:
|
||||
return bool(settings.google_client_id)
|
||||
|
||||
|
||||
async def fetch_jwks() -> dict:
|
||||
async with httpx.AsyncClient(timeout=HTTP_TIMEOUT) as client:
|
||||
response = await client.get(JWKS_URL)
|
||||
response.raise_for_status()
|
||||
return response.json()
|
||||
|
||||
|
||||
async def get_jwks(*, force: bool = False) -> dict:
|
||||
global _jwks, _jwks_fetched_at
|
||||
async with _jwks_lock:
|
||||
fresh = _jwks is not None and (time.monotonic() - _jwks_fetched_at) < JWKS_TTL_SECONDS
|
||||
if fresh and not force:
|
||||
return _jwks
|
||||
try:
|
||||
_jwks = await fetch_jwks()
|
||||
_jwks_fetched_at = time.monotonic()
|
||||
except Exception as failure:
|
||||
print(f"[google] JWKS 조회 실패: {failure}", flush=True)
|
||||
# 낡은 캐시라도 있으면 그걸로 간다. 구글이 잠깐 안 될 때 로그인이 통째로 죽는 것보다 낫다
|
||||
if _jwks is None:
|
||||
raise GoogleTokenInvalid("구글 공개키를 받지 못했습니다") from failure
|
||||
return _jwks
|
||||
|
||||
|
||||
def has_key(jwks: dict, kid: str | None) -> bool:
|
||||
return any(key.get("kid") == kid for key in jwks.get("keys") or [])
|
||||
|
||||
|
||||
async def verify_id_token(credential: str) -> GoogleAccount:
|
||||
if not is_enabled():
|
||||
raise GoogleLoginDisabled("GOOGLE_CLIENT_ID 없음")
|
||||
if not credential:
|
||||
raise GoogleTokenInvalid("빈 토큰")
|
||||
|
||||
try:
|
||||
kid = jwt.get_unverified_header(credential).get("kid")
|
||||
except JWTError as failure:
|
||||
raise GoogleTokenInvalid("토큰 형식이 아님") from failure
|
||||
|
||||
jwks = await get_jwks()
|
||||
# 공개키는 주기적으로 바뀐다. 캐시에 없는 kid면 한 번만 다시 받는다
|
||||
if not has_key(jwks, kid):
|
||||
jwks = await get_jwks(force=True)
|
||||
|
||||
try:
|
||||
claims = jwt.decode(
|
||||
credential, jwks, algorithms=["RS256"],
|
||||
audience=settings.google_client_id, issuer=ISSUERS,
|
||||
# at_hash는 access_token과 짝일 때만 의미가 있다. 브라우저가 주는
|
||||
# 크리덴셜에는 access_token이 없어 켜 두면 정상 토큰이 거부된다
|
||||
options={"verify_at_hash": False},
|
||||
)
|
||||
except JWTError as failure:
|
||||
# 사유는 로그에만 남긴다
|
||||
print(f"[google] ID 토큰 거부: {failure}", flush=True)
|
||||
raise GoogleTokenInvalid("구글 토큰이 유효하지 않습니다") from failure
|
||||
|
||||
sub = str(claims.get("sub") or "")
|
||||
if not sub:
|
||||
raise GoogleTokenInvalid("sub 없음")
|
||||
# 미인증 이메일은 신원으로 쓸 수 없다
|
||||
if not claims.get("email_verified"):
|
||||
raise GoogleTokenInvalid("이메일이 인증되지 않은 계정입니다")
|
||||
|
||||
return GoogleAccount(sub=sub, email=str(claims.get("email") or ""),
|
||||
name=str(claims.get("name") or ""),
|
||||
picture=str(claims.get("picture") or ""))
|
||||
@@ -0,0 +1,41 @@
|
||||
"""자체 세션 토큰
|
||||
구글 검증을 통과한 뒤로는 이걸 HttpOnly 쿠키로 들고 다닌다
|
||||
|
||||
담는 것은 user.id 하나다. 이메일·이름은 바뀔 수 있어 토큰에 넣지 않고 매번 DB에서 읽는다.
|
||||
"""
|
||||
from datetime import datetime, timedelta, timezone
|
||||
|
||||
from jose import JWTError, jwt
|
||||
|
||||
from settings import settings
|
||||
|
||||
ALGORITHM = "HS256"
|
||||
COOKIE_NAME = "poster_alive_session"
|
||||
|
||||
|
||||
class SessionInvalid(RuntimeError):
|
||||
"""서명이 안 맞거나 만료됨"""
|
||||
|
||||
|
||||
def issue(user_id: str) -> str:
|
||||
if not settings.jwt_secret:
|
||||
raise RuntimeError("JWT_SECRET 없음 — 세션을 발급할 수 없습니다")
|
||||
expires = datetime.now(timezone.utc) + timedelta(days=settings.jwt_days)
|
||||
return jwt.encode({"sub": user_id, "exp": expires}, settings.jwt_secret,
|
||||
algorithm=ALGORITHM)
|
||||
|
||||
|
||||
def read(token: str) -> str:
|
||||
"""토큰에서 user.id를 꺼낸다"""
|
||||
try:
|
||||
claims = jwt.decode(token, settings.jwt_secret, algorithms=[ALGORITHM])
|
||||
except JWTError as failure:
|
||||
raise SessionInvalid("세션이 유효하지 않습니다") from failure
|
||||
user_id = str(claims.get("sub") or "")
|
||||
if not user_id:
|
||||
raise SessionInvalid("sub 없음")
|
||||
return user_id
|
||||
|
||||
|
||||
def cookie_max_age() -> int:
|
||||
return settings.jwt_days * 24 * 3600
|
||||
@@ -95,6 +95,7 @@ dependencies = [
|
||||
{ name = "openai" },
|
||||
{ name = "pillow" },
|
||||
{ name = "pydantic-settings" },
|
||||
{ name = "python-jose", extra = ["cryptography"] },
|
||||
{ name = "python-multipart" },
|
||||
{ name = "scipy" },
|
||||
{ name = "sqlalchemy" },
|
||||
@@ -111,6 +112,7 @@ requires-dist = [
|
||||
{ name = "openai", specifier = ">=3.6.0" },
|
||||
{ name = "pillow", specifier = ">=12.3.0" },
|
||||
{ name = "pydantic-settings", specifier = ">=2.15.0" },
|
||||
{ name = "python-jose", extras = ["cryptography"], specifier = ">=3.5.0" },
|
||||
{ name = "python-multipart", specifier = ">=0.0.32" },
|
||||
{ name = "scipy", specifier = ">=1.18.1" },
|
||||
{ name = "sqlalchemy", specifier = ">=2.0.52" },
|
||||
@@ -126,6 +128,65 @@ wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/0b/a7/71ac2cff56fec219ed242bb11b8efb69fcc4bec75db06fb7bfe35de520e6/certifi-2026.7.22-py3-none-any.whl", hash = "sha256:62f22742b58a1a33014a2b6b706588a8d7e2a88ae7bd1a6ebe8c992928483775", size = 136983, upload-time = "2026-07-22T03:35:11.276Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cffi"
|
||||
version = "2.1.1"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "pycparser", marker = "implementation_name != 'PyPy'" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/9e/ef/008a1939e372c06329a3fce4279c02f328488f3526744906eeec3da7ad5f/cffi-2.1.1.tar.gz", hash = "sha256:dd31f52ea1086513bb9df30f8fcee9b8918323ae067a3d5b78bc826a000712be", size = 530807, upload-time = "2026-08-03T21:21:18.939Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/d3/7b/d6bbf82b8b96e7391438898c42f5bd96dd02030fd5b64937d248220003e2/cffi-2.1.1-cp314-cp314-ios_13_0_arm64_iphoneos.whl", hash = "sha256:7dbb61fe3a7699468030f71bbe5f8a0e326a151daa91beb11a6fc1f980c55e1c", size = 194064, upload-time = "2026-08-03T21:20:17.148Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/94/e6/bcc91b283be94735e268487a054004f0aa19947b6348fa367db53230abc8/cffi-2.1.1-cp314-cp314-ios_13_0_arm64_iphonesimulator.whl", hash = "sha256:f24fb43132a4c6b4cb4eb029492919b2db645be6808d738f244fd146c03c32cb", size = 196720, upload-time = "2026-08-03T21:20:18.268Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/d9/99/c4b0c17cacdc9c3b8f280026286a9826d6a208c0f047591a3c3ce99b91fd/cffi-2.1.1-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:d28630f5854ab07ab1fd4aba756de52326c82e6be15d414b12793f1975048b54", size = 184964, upload-time = "2026-08-03T21:20:19.708Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/b3/a9/9db617d05d7367c1ad0ab00b3aa6e6f9281edd689b4ee9ea0e5a84e89c97/cffi-2.1.1-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:661c298b4821edebead0c91edd2b00374d67ad7c5a1f7a91d4442633b79d6a72", size = 184962, upload-time = "2026-08-03T21:20:20.833Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/67/b8/b42132ca113dc567d37684437b46ca1dafc885902b02a110a02d5b511857/cffi-2.1.1-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:58acb8ab8e295e6c5ea12f888cbb13cf21511ef2a3303a23f4325c29d17fe5c1", size = 222328, upload-time = "2026-08-03T21:20:22.118Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/80/10/c5c0cbf0a657aecf59ef511409734230bf556f05a0d6c9eed7aa5c0a0166/cffi-2.1.1-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:456a61fa52d579ebf9df2e9552ead5129855dbaff6c1e5a9b1bc408809bdc062", size = 209985, upload-time = "2026-08-03T21:20:23.401Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/d5/6c/bfa0b87b03b9238148beca990292843c9396ba069b54496596594173de7b/cffi-2.1.1-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:a4f00aa42f75d6e4595e8866e748cc1705adc0cddfeb2ca86d0d03993d63ba03", size = 208530, upload-time = "2026-08-03T21:20:24.628Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/e9/02/4e7d553a7ac4b4238b38b3c1b80d486e9d4436f8d2acbf87a0997fe3f402/cffi-2.1.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:b0431303acaea1089ad4b3e9ce4e6518193def1118d4073ca848635ee4ea2e96", size = 221525, upload-time = "2026-08-03T21:20:25.758Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/82/1d/a4aaf9babd75acb4d5f223bff71533bee748dd770a382619a798960ee9ba/cffi-2.1.1-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:64faea20f4e2613363a1a9b9c7dd73058f3ecd00133a511e72ad7c511658f527", size = 225053, upload-time = "2026-08-03T21:20:26.985Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/81/10/5dc0e7bdd18e22107054288283380fc97a06ae3f1656a106908d666a3c88/cffi-2.1.1-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:5c58fe613dc5e5336357eff555824a314d8e43282600435c8d1cb6a7a2fedd13", size = 223213, upload-time = "2026-08-03T21:20:28.277Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/0b/e9/d0061c364cde06ee43168a0d076ac1da512cbc380d44767b844ba34fe2b6/cffi-2.1.1-cp314-cp314-win32.whl", hash = "sha256:1a18a57b58cfb21fc28d72e876acf10eaed67a1ed96226f92af4df681d571c4c", size = 177682, upload-time = "2026-08-03T21:20:44.288Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/a7/06/1c3e01e3ba14c39f6d10bfbac52753b7e22259e38088e5cfe1d704918690/cffi-2.1.1-cp314-cp314-win_amd64.whl", hash = "sha256:3222ba5d678f80a030e6afbcc33dc1ae5cb45facabb61cee2c7016b8432fde48", size = 187949, upload-time = "2026-08-03T21:20:45.623Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/87/5b/da4e39efe18eeb89cf580ea9cfc66b6a7c3eadb808fc0cc1d3a295cb5a5d/cffi-2.1.1-cp314-cp314-win_arm64.whl", hash = "sha256:ab36d55f9ed2d067327667c2fea18dda018eb628dd6347aa01dda6cf1f5d3836", size = 182947, upload-time = "2026-08-03T21:20:46.955Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/23/59/40338bf421c5accea1d45158170c87006ef1cd371b05c077e76476949728/cffi-2.1.1-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:7750c6449dff7864bb9bb27ddfb0267756189201a3afc911d82b3caacd70dfc3", size = 188504, upload-time = "2026-08-03T21:20:29.495Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/7d/47/5ecf1023850036e674c77ec4de86182d309ae344e39e7cba984b7df5d647/cffi-2.1.1-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:0beceaabe56af686895136a2de78db54ecd8e4046b236b8fd6d6cb61389e9bf2", size = 188259, upload-time = "2026-08-03T21:20:31.291Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/2a/9c/92934c3bea9f785b23eba304538c0b4d37a2a96d2431eb3a1bc87a11aa19/cffi-2.1.1-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:49cbc70e6542d4ccccb936558d1064a8012541e78f821f955cff24e357776c94", size = 223864, upload-time = "2026-08-03T21:20:32.571Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/4d/45/ba4c93527bc38616a8bd36488acb69a2212d60486794f0c1f318949bbb76/cffi-2.1.1-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:e2d65b31f36619cda3999b78b2aa9632e76b78448e7a56fc4240824200e7c4fc", size = 211538, upload-time = "2026-08-03T21:20:33.808Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/80/e9/b6ef565e452acb932fb0cb5443f44a78efbd1233e566f02b5a83855e9115/cffi-2.1.1-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:28907ab9bfb6aa13184cfc17c6b8e1023c5ab6fd7076d8c20a35e59fe04f8f29", size = 210688, upload-time = "2026-08-03T21:20:34.974Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/9a/95/eff5f0cee78d2eabc7eebffec40d3fc1876b5f3c95582e018bb4b99601f2/cffi-2.1.1-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:51b31d1c98274844cfd7838ce00bfc27c7423a4dc00fc0772fc3331c2cc90676", size = 223803, upload-time = "2026-08-03T21:20:36.564Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/fa/01/579d39fb8bef00a335a23d83757b44feb24cd6345a2c451b64cb67b9c362/cffi-2.1.1-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:5e7cecbaadb83884793e05828cee59b210b24583b9c7425d0ba6a754fe22eb4e", size = 226763, upload-time = "2026-08-03T21:20:37.816Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/8d/b0/0b44f47c60b01b57b6e2bbd92343f13a85a1d93bc46ccf6e47e244acd99c/cffi-2.1.1-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:25792eac27877609e7bb06d42ff88278a6624fff2ba9bbb523c09616b117e80f", size = 225688, upload-time = "2026-08-03T21:20:38.959Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/eb/d2/3b7176cb570a1d3e27faf67b72f591af508036e0d8b2be2ef9af9e8c84bb/cffi-2.1.1-cp314-cp314t-win32.whl", hash = "sha256:8ef53b2de9bcb9197d31854256575d59dbac0cba72ac627bb291ef5eceb74be4", size = 182868, upload-time = "2026-08-03T21:20:40.388Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/56/78/31f00c1bcd97c9bbf55f1bfdf5bc809a5de8887473e90bb9960dca825e80/cffi-2.1.1-cp314-cp314t-win_amd64.whl", hash = "sha256:616f097f2fe415bc92a247f02e11f634e1f9e9a83d327e3c915c15089c87869e", size = 194104, upload-time = "2026-08-03T21:20:41.725Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/7b/1b/58496f2ed0a35de575250c02a43ab3cc2c04d494a88fed31c1cabc0fd176/cffi-2.1.1-cp314-cp314t-win_arm64.whl", hash = "sha256:ad2c86c495b899d862ea0f4b42891b8713a3bd45dd4105c7fd51c2a72f39f3a5", size = 186402, upload-time = "2026-08-03T21:20:43.042Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/c1/8f/9ebe220eab48a093d1a5a5e339ab0dc7316eef3bb04d63c42f0251b61f50/cffi-2.1.1-cp315-cp315-ios_13_0_arm64_iphoneos.whl", hash = "sha256:dddad92b554513a31f272570678ba307fb9f618f05e3d4a5eacafff9eae03e1d", size = 194043, upload-time = "2026-08-03T21:20:48.179Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/ff/69/844bad3ece306c4782c2ecb93597035b6690d48704b803914c199da1e8b3/cffi-2.1.1-cp315-cp315-ios_13_0_arm64_iphonesimulator.whl", hash = "sha256:da0e573f9f97159390c89d9f1a9e41908b66d408cc5b58d08cf3847d844c531b", size = 196737, upload-time = "2026-08-03T21:20:49.457Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/1b/8a/af668013284634733f02d683458a0728739c7d6ddb5e14cb0c20832266fe/cffi-2.1.1-cp315-cp315-macosx_10_15_x86_64.whl", hash = "sha256:fb92203a88b3d3053034db775110081c49d28be6551923805e039924093761e4", size = 184933, upload-time = "2026-08-03T21:20:50.639Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/0c/75/2f5207ff6d1a613133b23a5203cc0c2a628313b5eb3974d7956ae3c57950/cffi-2.1.1-cp315-cp315-macosx_11_0_arm64.whl", hash = "sha256:2ae64be792b8966f2c69538199728b290e34726562896df1e5dc8ffd8d8188e8", size = 185002, upload-time = "2026-08-03T21:20:52.173Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/e2/31/9e1313b0a6e30e91b3b3d3fff51ae99c857c07738e3afcce1f7334e1b7ab/cffi-2.1.1-cp315-cp315-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:507a24c282e0f42f8ed737cf048572cbf580468da5555764a8331735e9c736b6", size = 222271, upload-time = "2026-08-03T21:20:53.462Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/50/e3/f6234a833e6e08c7007003074723c406559eecf9b48dfc97471e5a8eb7a0/cffi-2.1.1-cp315-cp315-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:246fa40ce8645a614ff682e0b70f37134e460eaf93a775e0cbe3cca585a67a80", size = 209919, upload-time = "2026-08-03T21:20:54.783Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/0d/fc/5f74e293fced6edb51af3a46c4ccf6c23c9943774ecb375ddbd522c76add/cffi-2.1.1-cp315-cp315-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:471cee653ae88de62096552e6d24ccb4a5adb8c8c9f10b5054d0122c15bf2779", size = 208529, upload-time = "2026-08-03T21:20:56.066Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/44/16/29e6d01b388bef055ecd6ca8244b3f4d336bd09e92d5d892187b9601084e/cffi-2.1.1-cp315-cp315-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:aeae0e330c9f6acd681f647d46cefd30c29f93e3392882e792e82080c9691399", size = 221630, upload-time = "2026-08-03T21:20:57.336Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/a4/18/fa7f1f6857d5eb88a4ca99ffcbfb7c387a287ccc154c64a73e86314745d7/cffi-2.1.1-cp315-cp315-musllinux_1_2_aarch64.whl", hash = "sha256:42a494cee34437f05546455144f2b5d9ac09b1face62bcfce597d2e521066688", size = 225134, upload-time = "2026-08-03T21:20:58.675Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/e0/9f/e8e3dfa04a1b4c241f8c91faacad872b4d4efd051d49764ad4e2fd4b9fea/cffi-2.1.1-cp315-cp315-musllinux_1_2_x86_64.whl", hash = "sha256:cc572dace3f60ef98d7b12ff411d20f5362feb31a0439eab0085bbfd349982d7", size = 223197, upload-time = "2026-08-03T21:20:59.968Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/f8/7e/8debeb04f1ab9fe2a6963964cd6f1aaf7192627b83926586a6a4e089c9fa/cffi-2.1.1-cp315-cp315-win32.whl", hash = "sha256:4f42141fc14250de6dde5ee7ea4432be017252d91f19c5ad043c084cea629cac", size = 177683, upload-time = "2026-08-03T21:21:14.901Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/e0/31/5158704cc474ab65c1647932e88be78dc0873f47130e253be38bcaf13d01/cffi-2.1.1-cp315-cp315-win_amd64.whl", hash = "sha256:e6e8cff14d6fb0be70a09c0bdc58096f501952d04624ebf867e0e56da2df8960", size = 187897, upload-time = "2026-08-03T21:21:16.108Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/cc/4b/b3a2da8570c704ffc0f9762cdc3ec0f02c8573798e0b5cf7f11c82bbb70f/cffi-2.1.1-cp315-cp315-win_arm64.whl", hash = "sha256:27350daa11d4f10c540e6e89dada4c54feb7256ad03e9a4dc075ebad7ba360d1", size = 182935, upload-time = "2026-08-03T21:21:17.271Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/d0/ef/5443574510a1207e6f6bc38ba6e1f1de36cb48fef07b2728bb896a21f430/cffi-2.1.1-cp315-cp315t-macosx_10_15_x86_64.whl", hash = "sha256:c26608d2222fb1e94487e4a387d85f13eb55d5ed725cb25a0c589ac4ee60e7bc", size = 188464, upload-time = "2026-08-03T21:21:01.163Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/7e/ae/a56fa8c4686ad50e148fcbc8d3ae0d03915ff5c30d795058988c24118cef/cffi-2.1.1-cp315-cp315t-macosx_11_0_arm64.whl", hash = "sha256:4be96343e422f2dfcd12ab5c9f5aebe03f82f737c6bffeca6830b3875cb44aab", size = 188262, upload-time = "2026-08-03T21:21:02.382Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/53/b2/6187f46f2912276a3ae284076109cc5c8680482f11f766ccf26db4a86427/cffi-2.1.1-cp315-cp315t-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:937c0052c05a31ca1daf18de3158eed4dbfcb9cc107adbea227728d647be701e", size = 223779, upload-time = "2026-08-03T21:21:03.553Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/8a/f6/c3ad28bd19f77047a03084424fbd4cbe997303267c14423737324be0385d/cffi-2.1.1-cp315-cp315t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:df423d40ee8654634421812bc3b196da3f9bd7d32929da813f8394c4348a5358", size = 211520, upload-time = "2026-08-03T21:21:04.863Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/a0/cd/ccac9013a5bd9fd764de118674ab9c805b5ca10c19270d90ee273f8b2240/cffi-2.1.1-cp315-cp315t-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:a730a083190634c65cca36ba5f489531576ebd79bcd5c8e172130f6453127231", size = 210673, upload-time = "2026-08-03T21:21:06.223Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/52/86/2976131c639aead931c5bee5aba67e4b09fbeb8018b6f282f70803f923a7/cffi-2.1.1-cp315-cp315t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:363e05fa78e15116c3c32c210ee36884fd6b9afa6d440e47112c3bd511d64cb6", size = 223835, upload-time = "2026-08-03T21:21:07.539Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/ac/0c/33a7aeab2f9c76918c52e084beb39c570db3588133412929e8ec06fab90b/cffi-2.1.1-cp315-cp315t-musllinux_1_2_aarch64.whl", hash = "sha256:770de9db11e84213beec501cfcaa013b019820ca881e03344dea5844f7876d94", size = 226705, upload-time = "2026-08-03T21:21:08.774Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/e3/26/2cde30fdde421130bfc18f70395731a6e6b2053c6a1978a5258ff04e72fa/cffi-2.1.1-cp315-cp315t-musllinux_1_2_x86_64.whl", hash = "sha256:7da0c5eff80f0197f3b3d1232ec5a682a9325f4ae9016a78f5f5ca35f9ced1f5", size = 225539, upload-time = "2026-08-03T21:21:09.911Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/6d/cd/a361394c94b2129d604bb846f624a8e88255a3ee33129c434a00d715e64f/cffi-2.1.1-cp315-cp315t-win32.whl", hash = "sha256:06c72bb76605a4b0cd0aad6930b69d4baf7dd5d806cfc409b824191099700e66", size = 182707, upload-time = "2026-08-03T21:21:11.226Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/9b/b5/ba2b299993c26577d529b6ae29841f9e15b9fcf004d65f423f4fcf94ade9/cffi-2.1.1-cp315-cp315t-win_amd64.whl", hash = "sha256:d9c275eaacd24aa73f94ffd6de08fc3f932424d8b6c376f4bed7cde376fe7bc3", size = 193772, upload-time = "2026-08-03T21:21:12.39Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/aa/29/35e016098c814cd93de9cd320c66b5bfba14dc6ecedd3cb518fa7c408c69/cffi-2.1.1-cp315-cp315t-win_arm64.whl", hash = "sha256:d18e5ac0f2f03f4f518d3e23db0f0cad7faa1da8620e9c09461d443bbf6e6692", size = 186360, upload-time = "2026-08-03T21:21:13.636Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "click"
|
||||
version = "8.5.0"
|
||||
@@ -135,6 +196,68 @@ wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/58/50/6c0d534c5f134586a8e1ba4e330569e32f057e33372ae556463212fb4cd3/click-8.5.0-py3-none-any.whl", hash = "sha256:255bc9599cf7748b4b1a446ccc735421bd08a2ae529a8b88597d3de5664ee360", size = 125251, upload-time = "2026-08-26T13:33:12.928Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cryptography"
|
||||
version = "50.0.1"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "cffi", marker = "platform_python_implementation != 'PyPy'" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/bb/ad/5d6702db60b1e40b41ef513b6967ff5848f307d50f8449baf1634f5908f1/cryptography-50.0.1.tar.gz", hash = "sha256:5dd9bda1c12b4162f6ff568eeb5e0ff956c28d14406e875cfe8a63a2d414ff20", size = 880381, upload-time = "2026-08-25T19:45:45.499Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/ba/19/797e2aaac9df6a66f1550f49979dc1b1e39ecd2077501c30efa81e8d5d67/cryptography-50.0.1-cp311-abi3-macosx_11_0_arm64.whl", hash = "sha256:b8f852c65863251b9e3a1b8c150ce21e59b522dbb6a7d4bc80e680d38388e986", size = 4010153, upload-time = "2026-08-25T19:44:03.155Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/90/34/9ce9a62ed9dc82ca9fd6a34445b6904af56e5f38b3eae2ed32e49c36053d/cryptography-50.0.1-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:53e279950892dc102c6b4e52af03ae5ea92fac572a1ddab78ca73a997f62b69f", size = 4723133, upload-time = "2026-08-25T19:44:05.461Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/57/26/e6d4fc8512a51a5f9ee7bfdbfb853bce1197087df40c9ad993ad370b846f/cryptography-50.0.1-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:ff838d62ec1bfce4f9ba7fa16f4a7b554cd8d0c299e6be37502161a660c84eef", size = 4712478, upload-time = "2026-08-25T19:44:07.375Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/e6/de/d3cdc2815697aae84126cbd6a030ca7b6b452e28a88b501b836bd3aa7a86/cryptography-50.0.1-cp311-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:e74591e283fe6eb956416c929eb58262a719fe0311fd9054c62c3350ed8760d8", size = 4730726, upload-time = "2026-08-25T19:44:09.294Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/55/32/38c0d344b98c06d34b5df8946565a9c0d6dbf32c8e0730a7f05f0a3c6cab/cryptography-50.0.1-cp311-abi3-manylinux_2_28_ppc64le.whl", hash = "sha256:5fe002589592ed749ce77fe0695fcbd3500dd61d7d6db5858a7544c612fa8e45", size = 5353524, upload-time = "2026-08-25T19:44:11.96Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/e1/1b/82f0f0d8858d4432be1af790477edf62aef90324041aa07c57e57bef1af7/cryptography-50.0.1-cp311-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:51593d180cf6d179bde5c5d065bed81386b1f381656ae7d042b7ffc87a9895ad", size = 4746720, upload-time = "2026-08-25T19:44:14.051Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/29/ba/042ca458b8c64348c768284b5d23e69b92ed53d057ab779fee628564676d/cryptography-50.0.1-cp311-abi3-manylinux_2_31_armv7l.whl", hash = "sha256:359e62deae718bce96170e223fdcb6357e4fbd3bb7a3a75f4430763532560e49", size = 4361866, upload-time = "2026-08-25T19:44:16.167Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/39/3b/e96c1ef71edef71057c7e3c3d982ce8fda554e0c52d0cc19c18845cde3eb/cryptography-50.0.1-cp311-abi3-manylinux_2_34_aarch64.whl", hash = "sha256:e2ca8fd1b6b4b82a1c4cb02841d0837e3c12336c2e24b520ab8ab3b969733d8f", size = 4730028, upload-time = "2026-08-25T19:44:18.085Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/e3/38/45abd72ef63f2e7d0754a6cacf97bd8b69512ace7f6130d24c39ece65da2/cryptography-50.0.1-cp311-abi3-manylinux_2_34_ppc64le.whl", hash = "sha256:76de83fbd91ac49c0feaaa983d0748fd7a53176afac5fb3bf7478d244f0eb527", size = 5308405, upload-time = "2026-08-25T19:44:20.197Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/85/66/6ccca4722987ddedaa7fc9c3f4708af7431f5535666c174350830888c6b7/cryptography-50.0.1-cp311-abi3-manylinux_2_34_x86_64.whl", hash = "sha256:51afcfceb15597cf2635068e4ac9a56b2abde622edde17f37d85fd7b5306497a", size = 4746230, upload-time = "2026-08-25T19:44:22.376Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/13/0e/b1f92e013228111413f2e6743948b80bc24dfd3c1b87ba98ceea16f5df89/cryptography-50.0.1-cp311-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:be224a65493ec5b74a158ff22a5522ce4a5ca1e543c647a3a4730d4a09e5f959", size = 4862596, upload-time = "2026-08-25T19:44:24.472Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/7e/22/c3654cccc856e9d682817b04ac3ee79731cb09ca6f95996a95c904de2883/cryptography-50.0.1-cp311-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:9ebcdd5519be9b652a46f507817a74591774fc3d6923ac364e4dfa64e36b291b", size = 5014082, upload-time = "2026-08-25T19:44:26.709Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/42/8b/cb12b1b60c91b074ca6bf0fdd59aa8f10d8bc5f73af8faece86ef0421b37/cryptography-50.0.1-cp311-abi3-win_amd64.whl", hash = "sha256:aed8db4f6d71c51efb89530e12d9464e7bf2923d46c3205dc794a2a93f8c0648", size = 3842826, upload-time = "2026-08-25T19:44:28.784Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/5b/f0/424cb557d99aa86ac55da5e2add02e2882e44047b6264f93ade1b975a993/cryptography-50.0.1-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:30a125032e5642a21ff816e021152bd4e7e94f03eff3f4b7fca41cd22bc3110f", size = 3973525, upload-time = "2026-08-25T19:44:30.7Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/4d/72/3a2711d967977ab5fc80b782837c7e8d1ac7445e764c20c381a265c57ef3/cryptography-50.0.1-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:a0b1a59e3a089064a0ec309e9428c8e3ae4e161419d20ac33600767e83fc658a", size = 4708817, upload-time = "2026-08-25T19:44:32.773Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/b4/f2/bb1f56e10815b789df0b409a69fa4992ff3d3fef9c72747f4a6b26fed38e/cryptography-50.0.1-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:8921d58f426793c5f1b47f0b59575780de9a095214958d0eb37d909593db8367", size = 4697300, upload-time = "2026-08-25T19:44:35.144Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/08/bd/ed5396be499ffcf8807a585bfe38b71a1fbdd1c342b4f9b6d0ef5162a946/cryptography-50.0.1-cp314-cp314t-manylinux_2_28_aarch64.whl", hash = "sha256:a8f40ea47330e71b594a7e246898f93177c259490c63183dbaf9e571d71ed9a5", size = 4716039, upload-time = "2026-08-25T19:44:37.192Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/f6/6e/1cf405c5c8e8df7545378048e954792f00b7f2367af8863ce8b8f3e10607/cryptography-50.0.1-cp314-cp314t-manylinux_2_28_ppc64le.whl", hash = "sha256:a255449073358275b64b67d3f595f268bbef70e72b6edb65e0c70c735bf739c9", size = 5332388, upload-time = "2026-08-25T19:44:39.16Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/47/92/b4317e8c32c4f47b062f5398bd79106b220a124546f42be83bf32b761e2a/cryptography-50.0.1-cp314-cp314t-manylinux_2_28_x86_64.whl", hash = "sha256:8df2de9102026855887e4587084f6eabd80ed0f345b8ad8a7ac27ab9bf4723e0", size = 4730293, upload-time = "2026-08-25T19:44:41.298Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/39/0d/a1e7633e2c744d0f2983320a27e924ef2264c79c56e1a58d5fb0a1cfd413/cryptography-50.0.1-cp314-cp314t-manylinux_2_31_armv7l.whl", hash = "sha256:ac02b07824d4d1001bd4367599f839c19cb171924c796e52c23508ac14c2c0cc", size = 4346031, upload-time = "2026-08-25T19:44:43.245Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/88/dd/b215616f9bab3fc18510c78a4e5c9f362d77838503c363dc747c7d4f5c6f/cryptography-50.0.1-cp314-cp314t-manylinux_2_34_aarch64.whl", hash = "sha256:cbf74a81765ee67413503ca6e26dcc4f6f5a519822436cc0a1b97aab6c1b8a17", size = 4715344, upload-time = "2026-08-25T19:44:45.291Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/b1/1b/ec3ebd31741d0e963612c4fe43caa39341b9b1e031e469820e42e4c83918/cryptography-50.0.1-cp314-cp314t-manylinux_2_34_ppc64le.whl", hash = "sha256:16c5ecd954b3330ebfb6605eca4fd952da8bef376551d5cc264534e3770a9ee6", size = 5287201, upload-time = "2026-08-25T19:44:47.297Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/1a/01/0127d11a762b31a9ee0221894f540318761783f3fdc4bc5d057698caebd5/cryptography-50.0.1-cp314-cp314t-manylinux_2_34_x86_64.whl", hash = "sha256:79bf008d1f9af6071c797ad133e39915dfee7614f18f18f4db9072eb715064a3", size = 4730023, upload-time = "2026-08-25T19:44:49.435Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/9e/b9/e7425ebfb599241a0c1d7000f1b466c3062da66c19d9525031315dff7213/cryptography-50.0.1-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:330fbb252391c596f1ae42c5754449dc924e6ad012dca8efe0d703f9f2d12ec6", size = 4847362, upload-time = "2026-08-25T19:44:51.94Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/2d/fd/60d0ddf4defa12e482c9d5e0f554384d6e8ab25341fd15f060028fd92e6a/cryptography-50.0.1-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:42be3bb70596b3abe4ac097b75be223e8b3ab614a0e5de068e3dcc54d71d6149", size = 4999247, upload-time = "2026-08-25T19:44:53.876Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/4d/56/bc4f2b209e766c93372cfcd59b781a0b2b59700f62a969580415b699c2b2/cryptography-50.0.1-cp314-cp314t-win_amd64.whl", hash = "sha256:f74455bb086a85d5e81246412602aaa97ed095e504cd40dd261ef50be42205bf", size = 3825806, upload-time = "2026-08-25T19:44:56.209Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/84/a9/ee16a903f13755e914d1eecc482fe64d1f10761c3960e5d8fa6837377aff/cryptography-50.0.1-cp39-abi3-macosx_11_0_arm64.whl", hash = "sha256:ca83d00d9e69cd5eb63f2e69c3a5a59e0cecae5ae14c6ae0b35830fe3b37bad0", size = 4035307, upload-time = "2026-08-25T19:44:58.305Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/5e/a5/9ec7e81e8526c0d7a387d73386b2daed3f39e10d81a85930bd1b6bfba65c/cryptography-50.0.1-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:05ba322c4da95b262a212c345af888ef2c37c88c0509756ea00a0e6d68850f23", size = 4751900, upload-time = "2026-08-25T19:45:00.401Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/7e/3c/0e77bd5ffcf078e9dd27d3074aad6c030d9b10d0bf69329d573c927a188c/cryptography-50.0.1-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:e22dfed744bd4002e909464cb23d2f0b05c6f3113a79ef2e9864a53db737c733", size = 4738357, upload-time = "2026-08-25T19:45:02.786Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/27/3a/3c5f80daa4dcd47323c7af8a2fcb90de27a33564d4fcac69846c0972691a/cryptography-50.0.1-cp39-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:4c4188f7c0cf655be5c06342b817ed0f9595b69ffa2b12026e5353eed29dea88", size = 4758474, upload-time = "2026-08-25T19:45:04.889Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/6e/2b/214cf0cf93db9628c3c20c896b229f327f6fb1b20e4b3743d8ad3f00af8b/cryptography-50.0.1-cp39-abi3-manylinux_2_28_ppc64le.whl", hash = "sha256:2ebbfb0f1fed745e91796e3e1080a1440423fdae8ece1b995a1d80883a409054", size = 5375862, upload-time = "2026-08-25T19:45:07.163Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/d6/51/3f9701867a46b6c1740c9b52fc4d3bed6cbdcfedcc9b6e64305c07f39cff/cryptography-50.0.1-cp39-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:407fe2b6db00939c05c0e945e9914238f2f0a430974839429dafc82b1ee6bee5", size = 4772942, upload-time = "2026-08-25T19:45:09.396Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/0d/5c/13ea642e08e2544d0f5396122055f4820cfacb3203562197b5967125ea97/cryptography-50.0.1-cp39-abi3-manylinux_2_31_armv7l.whl", hash = "sha256:2b34d76a652ea2b6faf777c35df230c5637842cd904e04f16230c3f9f03e4361", size = 4383347, upload-time = "2026-08-25T19:45:11.659Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/84/d5/7d1fe1cb93f91c428093ff234e128c89ba8ea61a6f26aab406081f9b996e/cryptography-50.0.1-cp39-abi3-manylinux_2_34_aarch64.whl", hash = "sha256:01f41478cf33fc605a6a089cd56d28b45c6c0b45a1928b61797f2621a04bac71", size = 4758050, upload-time = "2026-08-25T19:45:13.745Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/dd/04/557fc5ead96a829e0bc812a3b9dc4a52a2f27e4f7f5950da7ff27653a805/cryptography-50.0.1-cp39-abi3-manylinux_2_34_ppc64le.whl", hash = "sha256:fc3ed7ebd2a8c96f5b166de0ab9b624996bef3b07bbeb19364dfb78222c22c80", size = 5332955, upload-time = "2026-08-25T19:45:16.193Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/8c/eb/5d7124083e8d8cda8f5b348f544b71ad6f707ad63193758ef4d8e569da02/cryptography-50.0.1-cp39-abi3-manylinux_2_34_x86_64.whl", hash = "sha256:9dde0a357190eb3b1da1bb9ab750e9c85cba82ca5977aa0836cbb94e92611239", size = 4772694, upload-time = "2026-08-25T19:45:18.315Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/63/8e/f1f955e0921dd2b6d22eae7e8d24a4c4b638d10735ffbf6a71f99eb0fcb8/cryptography-50.0.1-cp39-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:fd3718b960d0b5dd213cdf03f3bcb7000e69dda0de8b956061947ff6bcff5558", size = 4888413, upload-time = "2026-08-25T19:45:20.4Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/1f/ab/89e2b798d2c3925f82e2bb72d5979f3d2f6da2dd22ef4a8cd8b70d920039/cryptography-50.0.1-cp39-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:2a93d05e34d5f67fba6f891fe85d929999baa7195e853923ea6d7576c9e68c5e", size = 5044355, upload-time = "2026-08-25T19:45:22.353Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/99/89/87ef49ffe383ef4e147d27b7bf2088fb0b54ea409dd87b5a89442e5828a5/cryptography-50.0.1-cp39-abi3-win_amd64.whl", hash = "sha256:55d16b1ef3ee0958d893a977b19777887e546c9954ea81b200c3301a864013f2", size = 3875429, upload-time = "2026-08-25T19:45:24.418Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ecdsa"
|
||||
version = "0.19.2"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "six" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/25/ca/8de7744cb3bc966c85430ca2d0fcaeea872507c6a4cf6e007f7fe269ed9d/ecdsa-0.19.2.tar.gz", hash = "sha256:62635b0ac1ca2e027f82122b5b81cb706edc38cd91c63dda28e4f3455a2bf930", size = 202432, upload-time = "2026-03-26T09:58:17.675Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/51/79/119091c98e2bf49e24ed9f3ae69f816d715d2904aefa6a2baa039a2ba0b0/ecdsa-0.19.2-py2.py3-none-any.whl", hash = "sha256:840f5dc5e375c68f36c1a7a5b9caad28f95daa65185c9253c0c08dd952bb7399", size = 150818, upload-time = "2026-03-26T09:58:15.808Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "fastapi"
|
||||
version = "0.141.1"
|
||||
@@ -450,6 +573,24 @@ wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/3d/68/1f3066acedf37673694a7141381d8f811ae97f30d34413d236abe7d489f1/pillow-12.3.0-cp315-cp315t-win_arm64.whl", hash = "sha256:06ff022112bc9cbf83b60f8e028d94ad87b60621706487e65f673de61610ab59", size = 2567491, upload-time = "2026-07-01T11:56:23.506Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pyasn1"
|
||||
version = "0.6.4"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/a4/9a/23310166d960def5897e91fe20e5b724601b02a22e84ba1f94232c0b7f67/pyasn1-0.6.4.tar.gz", hash = "sha256:9c447d8431c947fe4c8febc4ed9e760bc29011a5b01e5c74b67025bd9fb8ce81", size = 151262, upload-time = "2026-07-09T01:12:33.988Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/9a/3b/6163796d69c3977d1e4287bea4a6979161cbbdd170ebb430511e8e1999ce/pyasn1-0.6.4-py3-none-any.whl", hash = "sha256:deda9277cfd454080ec40b207fb6df82206a3a2688735233cdcd8d3d565f088b", size = 84410, upload-time = "2026-07-09T01:12:32.92Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pycparser"
|
||||
version = "3.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/1b/7d/92392ff7815c21062bea51aa7b87d45576f649f16458d78b7cf94b9ab2e6/pycparser-3.0.tar.gz", hash = "sha256:600f49d217304a5902ac3c37e1281c9fe94e4d0489de643a9504c5cdfdfc6b29", size = 103492, upload-time = "2026-01-21T14:26:51.89Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/0c/c3/44f3fbbfa403ea2a7c779186dc20772604442dde72947e7d01069cbe98e3/pycparser-3.0-py3-none-any.whl", hash = "sha256:b727414169a36b7d524c1c3e31839a521725078d7b2ff038656844266160a992", size = 48172, upload-time = "2026-01-21T14:26:50.693Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pydantic"
|
||||
version = "2.13.4"
|
||||
@@ -529,6 +670,25 @@ wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/0d/17/c5c6b53ddc18f297992099b3d9ec16c855c0ccc83263a21fe4d1c625ec6c/python_dotenv-1.2.3-py3-none-any.whl", hash = "sha256:904552145e8bfed22162c09dab1c2b9b54fefa7b23ba780f4f26ca0316b0f0d9", size = 22780, upload-time = "2026-08-16T16:54:52.473Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "python-jose"
|
||||
version = "3.5.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "ecdsa" },
|
||||
{ name = "pyasn1" },
|
||||
{ name = "rsa" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/c6/77/3a1c9039db7124eb039772b935f2244fbb73fc8ee65b9acf2375da1c07bf/python_jose-3.5.0.tar.gz", hash = "sha256:fb4eaa44dbeb1c26dcc69e4bd7ec54a1cb8dd64d3b4d81ef08d90ff453f2b01b", size = 92726, upload-time = "2025-05-28T17:31:54.288Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/d9/c3/0bd11992072e6a1c513b16500a5d07f91a24017c5909b02c72c62d7ad024/python_jose-3.5.0-py2.py3-none-any.whl", hash = "sha256:abd1202f23d34dfad2c3d28cb8617b90acf34132c7afd60abd0b0b7d3cb55771", size = 34624, upload-time = "2025-05-28T17:31:52.802Z" },
|
||||
]
|
||||
|
||||
[package.optional-dependencies]
|
||||
cryptography = [
|
||||
{ name = "cryptography" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "python-multipart"
|
||||
version = "0.0.32"
|
||||
@@ -564,6 +724,18 @@ wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/f1/12/de94a39c2ef588c7e6455cfbe7343d3b2dc9d6b6b2f40c4c6565744c873d/pyyaml-6.0.3-cp314-cp314t-win_arm64.whl", hash = "sha256:ebc55a14a21cb14062aa4162f906cd962b28e2e9ea38f9b4391244cd8de4ae0b", size = 149341, upload-time = "2025-09-25T21:32:56.828Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rsa"
|
||||
version = "4.9.1"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "pyasn1" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/da/8a/22b7beea3ee0d44b1916c0c1cb0ee3af23b700b6da9f04991899d0c555d4/rsa-4.9.1.tar.gz", hash = "sha256:e7bdbfdb5497da4c07dfd35530e1a902659db6ff241e39d9953cad06ebd0ae75", size = 29034, upload-time = "2025-04-16T09:51:18.218Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/64/8d/0133e4eb4beed9e425d9a98ed6e081a55d195481b7632472be1af08d2f6b/rsa-4.9.1-py3-none-any.whl", hash = "sha256:68635866661c6836b8d39430f97a996acbd61bfa49406748ea243539fe239762", size = 34696, upload-time = "2025-04-16T09:51:17.142Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "scipy"
|
||||
version = "1.18.1"
|
||||
@@ -615,6 +787,15 @@ wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/63/ad/741c19fcb66755ff953daf9243af8480e4bf3d7fbe57583c178c7d2b6b51/scipy-1.18.1-cp315-cp315t-win_arm64.whl", hash = "sha256:eda632a7981f69730d6281f451db9c1c370993a2c0d7ddb43e2a809a2862b83a", size = 25319710, upload-time = "2026-08-21T23:28:45.713Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "six"
|
||||
version = "1.17.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/94/e7/b2c673351809dca68a0e064b6af791aa332cf192da575fd474ed7d6f16a2/six-1.17.0.tar.gz", hash = "sha256:ff70335d468e7eb6ec65b95b99d3a2836546063f63acc5171de367e834932a81", size = 34031, upload-time = "2024-12-04T17:35:28.174Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/b7/ce/149a00dd41f10bc29e5921b496af8b574d8413afcd5e30dfa0ed46c2cc5e/six-1.17.0-py2.py3-none-any.whl", hash = "sha256:4721f391ed90541fddacab5acf947aa0d3dc7d27b2e1e8eda2be8970586c3274", size = 11050, upload-time = "2024-12-04T17:35:26.475Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sniffio"
|
||||
version = "1.3.1"
|
||||
|
||||
@@ -1,14 +1,29 @@
|
||||
# 앞에 아파치가 선다 (playreel.o2o.kr → / 는 30100, /api 는 30101).
|
||||
# 아파치가 다른 장비라 포트는 열어두고, 그 장비만 오도록 막는 것은 방화벽이 맡는다.
|
||||
services:
|
||||
backend:
|
||||
build: ./backend
|
||||
ports:
|
||||
- "8765:8765"
|
||||
- "30101:30101"
|
||||
env_file:
|
||||
- backend/.env
|
||||
volumes:
|
||||
# 소스를 그대로 물린다 — 호스트에서 고치고 exec으로 바로 돌린다. 산출물도 호스트에 남는다.
|
||||
# 가상환경은 이미지의 /opt/venv에 있어 이 마운트에 가려지지 않는다.
|
||||
- ./backend:/app
|
||||
- /app/.venv # 컨테이너 안에서 만든 것을 덮지 않는다
|
||||
# Higgsfield CLI 토큰을 호스트에서 참조한다. 만료 시 갱신해야 해서 읽기 전용이 아니다.
|
||||
- ${HOME}/.config/higgsfield:/root/.config/higgsfield
|
||||
restart: unless-stopped
|
||||
|
||||
frontend:
|
||||
build: ./frontend
|
||||
ports:
|
||||
- "30100:30100"
|
||||
environment:
|
||||
# 아파치가 /api 를 백엔드로 바로 보내므로 운영에서는 안 쓰인다.
|
||||
# 아파치 없이 띄울 때 proxy.ts 가 이 값으로 넘긴다.
|
||||
API_ORIGIN: http://backend:30101
|
||||
depends_on:
|
||||
- backend
|
||||
restart: unless-stopped
|
||||
@@ -0,0 +1,14 @@
|
||||
# COPY . . 가 호스트 것을 가져오면 npm ci 로 깐 것을 덮어쓰고 빌드도 느려진다
|
||||
node_modules
|
||||
.next
|
||||
out
|
||||
build
|
||||
|
||||
.git
|
||||
.gitignore
|
||||
.env
|
||||
.env.*
|
||||
|
||||
npm-debug.log*
|
||||
*.tsbuildinfo
|
||||
.DS_Store
|
||||
@@ -0,0 +1,41 @@
|
||||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
||||
|
||||
# dependencies
|
||||
/node_modules
|
||||
/.pnp
|
||||
.pnp.*
|
||||
.yarn/*
|
||||
!.yarn/patches
|
||||
!.yarn/plugins
|
||||
!.yarn/releases
|
||||
!.yarn/versions
|
||||
|
||||
# testing
|
||||
/coverage
|
||||
|
||||
# next.js
|
||||
/.next/
|
||||
/out/
|
||||
|
||||
# production
|
||||
/build
|
||||
|
||||
# misc
|
||||
.DS_Store
|
||||
*.pem
|
||||
|
||||
# debug
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
.pnpm-debug.log*
|
||||
|
||||
# env files (can opt-in for committing if needed)
|
||||
.env*
|
||||
|
||||
# vercel
|
||||
.vercel
|
||||
|
||||
# typescript
|
||||
*.tsbuildinfo
|
||||
next-env.d.ts
|
||||
@@ -0,0 +1,9 @@
|
||||
<!-- BEGIN:nextjs-agent-rules -->
|
||||
|
||||
# This is NOT the Next.js you know
|
||||
|
||||
This version has breaking changes — APIs, conventions, and file structure may all differ from your training data. Read the relevant guide in `node_modules/next/dist/docs/` (resolved from this file's directory; in monorepos the `next` package may not be visible from the repo root) before writing any code. Heed deprecation notices.
|
||||
|
||||
This block is written and re-added by `next dev` — verify at `node_modules/next/dist/server/lib/generate-agent-files.js`. Removing it from a diff only re-creates the uncommitted change; committing it with your work keeps the tree clean.
|
||||
|
||||
<!-- END:nextjs-agent-rules -->
|
||||
@@ -0,0 +1 @@
|
||||
@AGENTS.md
|
||||
@@ -0,0 +1,23 @@
|
||||
# poster-alive — 웹 (Next.js)
|
||||
FROM node:22-slim AS deps
|
||||
WORKDIR /app
|
||||
COPY package.json package-lock.json ./
|
||||
RUN npm ci
|
||||
|
||||
FROM node:22-slim AS build
|
||||
WORKDIR /app
|
||||
COPY --from=deps /app/node_modules ./node_modules
|
||||
COPY . .
|
||||
RUN npm run build
|
||||
|
||||
FROM node:22-slim AS run
|
||||
WORKDIR /app
|
||||
ENV NODE_ENV=production
|
||||
COPY --from=build /app/.next ./.next
|
||||
COPY --from=build /app/public ./public
|
||||
COPY --from=build /app/node_modules ./node_modules
|
||||
COPY --from=build /app/package.json ./package.json
|
||||
COPY --from=build /app/next.config.ts ./next.config.ts
|
||||
|
||||
EXPOSE 30100
|
||||
CMD ["npx", "next", "start", "-p", "30100"]
|
||||
@@ -0,0 +1,28 @@
|
||||
# frontend
|
||||
|
||||
Next.js 16 · React 19 · TypeScript. `~/workspace/o2o-ado2-poster-to-video/product/web` 를 옮겨온 것이다.
|
||||
|
||||
## 실행
|
||||
|
||||
```bash
|
||||
npm ci
|
||||
npm run dev # http://localhost:30100
|
||||
```
|
||||
|
||||
백엔드는 `API_ORIGIN` 으로 지정한다. 기본값은 `http://localhost:30101` 이고,
|
||||
`next.config.ts` 의 리라이트가 `/api/*` 를 그리로 넘긴다. CORS는 쓰지 않는다.
|
||||
|
||||
docker compose 로 띄우면 `API_ORIGIN=http://backend:30101` 이 들어간다.
|
||||
|
||||
## 화면
|
||||
|
||||
| 경로 | 하는 일 |
|
||||
| --- | --- |
|
||||
| `/playreel` | 공연 상품페이지 주소 → 30초 롱컷. 게이트 5회 |
|
||||
| `/playreel/[id]` | 진행 상황과 게이트 검수 카드 |
|
||||
| `/` `/poster` `/poster/[id]` | 포스터 업로드 → 8초 숏폼 |
|
||||
| `/studio` | 포스터 스타일 변환 — **백엔드에 `/api/f2` 가 없다** |
|
||||
| `/archive` `/playreel/archive` | 아카이브 — **백엔드에 `/api/archive` 가 없다** |
|
||||
|
||||
`?mock=<gate>` 를 붙이면 서버 없이 게이트 화면만 볼 수 있다
|
||||
(`fetch_confirm` `analysis_confirm` `narration_confirm` `clip_confirm` `final_confirm`).
|
||||
@@ -0,0 +1,96 @@
|
||||
"use client";
|
||||
|
||||
import DisabledNotice from "@/components/disabled-notice";
|
||||
import { FEATURES } from "@/lib/features";
|
||||
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";
|
||||
|
||||
function ArchiveDetailPageInner({ 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>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
export default function ArchiveDetailPage(props: Parameters<typeof ArchiveDetailPageInner>[0]) {
|
||||
if (!FEATURES.archive) return <DisabledNotice title="아카이브" backHref="/" />;
|
||||
return <ArchiveDetailPageInner {...props} />;
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
"use client";
|
||||
|
||||
import DisabledNotice from "@/components/disabled-notice";
|
||||
import { FEATURES } from "@/lib/features";
|
||||
import { useEffect, useState } from "react";
|
||||
import Link from "next/link";
|
||||
import { apiFetch, archiveKind, type ArchiveEntry } from "@/lib/api";
|
||||
|
||||
function ArchivePageInner() {
|
||||
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>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
export default function ArchivePage() {
|
||||
if (!FEATURES.archive) return <DisabledNotice title="아카이브" backHref="/" />;
|
||||
return <ArchivePageInner />;
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
import type { Metadata } from "next";
|
||||
import Link from "next/link";
|
||||
import Ado2Logo from "@/components/ado2-logo";
|
||||
import AccountBadge from "@/components/account-badge";
|
||||
import AuthGate from "@/components/auth-gate";
|
||||
import NavLink from "@/components/nav-link";
|
||||
import { FEATURES } from "@/lib/features";
|
||||
|
||||
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>
|
||||
{FEATURES.styling && <NavLink href="/studio" icon="image">포스터 스타일링</NavLink>}
|
||||
{FEATURES.archive && <NavLink href="/archive" icon="folder">아카이브</NavLink>}
|
||||
</nav>
|
||||
<AccountBadge />
|
||||
<div className="sidebar-foot">무빙포스터 · 내부 빌드</div>
|
||||
</aside>
|
||||
<main className="main-content">
|
||||
<div style={{ maxWidth: 1080, margin: "0 auto" }}>
|
||||
<AuthGate>{children}</AuthGate>
|
||||
</div>
|
||||
</main>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,125 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect, useState } from "react";
|
||||
import Link from "next/link";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { apiFetch, type Job } from "@/lib/api";
|
||||
import { useMe } from "@/lib/auth";
|
||||
import { FEATURES } from "@/lib/features";
|
||||
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분"]],
|
||||
cta: "포스터 올리기", hot: false, badge: null,
|
||||
},
|
||||
{
|
||||
href: "/playreel", icon: "URL", title: "공연상품페이지로 시작하기",
|
||||
desc: "상품페이지 주소 하나로 캐스팅·일정·줄거리까지 담긴 30초 예고편",
|
||||
flow: ["포스터 무빙 훅 8초", "상세페이지 스크롤 (줄거리·캐스트·캐스팅 스케줄·할인)", "예매 안내 밴드 + QR"],
|
||||
facts: [["필요한 것", "상품페이지 URL"], ["확인", "5회"], ["시간", "약 15분"]],
|
||||
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 router = useRouter();
|
||||
const { me } = useMe();
|
||||
const [recent, setRecent] = useState<Recent[]>([]);
|
||||
|
||||
useEffect(() => {
|
||||
// 잡 목록은 로그인해야 볼 수 있다. 로그인 전에는 부르지 않는다
|
||||
if (!me) return;
|
||||
// 두 갈래의 최근 작업을 합쳐 최신순 6개. 한쪽이 비어도 다른 쪽은 보인다.
|
||||
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));
|
||||
});
|
||||
}, [me]);
|
||||
|
||||
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>
|
||||
{e.href === "/playreel" && !FEATURES.playreelEntry ? (
|
||||
<button className="btn-cta btn-lg" disabled>준비 중</button>
|
||||
) : (
|
||||
/* 여기서 처음으로 로그인이 필요해진다. Link 는 그대로 둬서
|
||||
새 탭으로 열거나 주소를 복사하는 동작은 살린다 */
|
||||
<Link href={e.href} className="btn-cta btn-lg" style={{ textDecoration: "none" }}
|
||||
onClick={(event) => {
|
||||
if (me !== false) return;
|
||||
event.preventDefault();
|
||||
router.push(`/login?next=${encodeURIComponent(e.href)}`);
|
||||
}}>{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,341 @@
|
||||
"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, type Job } 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) {
|
||||
// 실패 화면을 띄워둔 사이에 끝났을 수 있다. 그때는 에러 대신 결과를 보여준다
|
||||
const latest = await apiFetch<Job>(`/api/f1/jobs/${id}`).catch(() => null);
|
||||
if (latest?.status === "done") {
|
||||
refresh();
|
||||
return;
|
||||
}
|
||||
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" }}>
|
||||
{/* blob에 Content-Disposition이 박혀 있어 주소만 열면 내려받기가 된다.
|
||||
<a download>은 다른 출처에 안 먹으므로 이 속성에 기대지 않는다 */}
|
||||
{job.artifacts.thumbnail ? (
|
||||
<a href={job.artifacts.thumbnail} className="btn-tonal-mint">정지 컷 JPG</a>
|
||||
) : <span />}
|
||||
<a href={job.artifacts.video} 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,65 @@
|
||||
"use client";
|
||||
|
||||
import { useState } from "react";
|
||||
import Link from "next/link";
|
||||
import { useRouter } from "next/navigation";
|
||||
import PosterDropzone from "@/components/poster-dropzone";
|
||||
import { useRequireLogin } from "@/components/auth-gate";
|
||||
import { apiFetch } from "@/lib/api";
|
||||
import { refreshMe } from "@/lib/auth";
|
||||
import { FEATURES } from "@/lib/features";
|
||||
|
||||
export default function HomePage() {
|
||||
const router = useRouter();
|
||||
const requireLogin = useRequireLogin();
|
||||
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;
|
||||
// 여기서 처음으로 로그인이 필요해진다
|
||||
if (!requireLogin()) 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 });
|
||||
// 남은 개수가 하나 줄었다
|
||||
refreshMe();
|
||||
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 ? "업로드 중…" : "숏폼 만들기"}
|
||||
</button>
|
||||
{FEATURES.playreelEntry && (
|
||||
<p className="note">공연 상품페이지 주소가 있나요? <Link href="/playreel">상품페이지로 시작하면 캐스팅·일정까지 담깁니다 →</Link></p>
|
||||
)}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,311 @@
|
||||
"use client";
|
||||
|
||||
import DisabledNotice from "@/components/disabled-notice";
|
||||
import { FEATURES } from "@/lib/features";
|
||||
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";
|
||||
|
||||
function StudioPageInner() {
|
||||
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>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
export default function StudioPage() {
|
||||
if (!FEATURES.styling) return <DisabledNotice title="포스터 스타일링" backHref="/" />;
|
||||
return <StudioPageInner />;
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
import type { Metadata } from "next";
|
||||
import Link from "next/link";
|
||||
import Ado2Logo from "@/components/ado2-logo";
|
||||
import AuthGate from "@/components/auth-gate";
|
||||
import NavLink from "@/components/nav-link";
|
||||
import { FEATURES } from "@/lib/features";
|
||||
|
||||
/* 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>
|
||||
{FEATURES.archive && <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" }}>
|
||||
<AuthGate>{children}</AuthGate>
|
||||
</div>
|
||||
</main>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,188 @@
|
||||
"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, type PlayreelJob } 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) {
|
||||
// 실패 화면을 띄워둔 사이에 끝났을 수 있다. 그때는 에러 대신 결과를 보여준다
|
||||
const latest = await apiFetch<PlayreelJob>(`/api/playreel/jobs/${id}`).catch(() => null);
|
||||
if (latest?.status === "done") {
|
||||
refresh();
|
||||
return;
|
||||
}
|
||||
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" ? "작업이 중단되었습니다" : "아카이브에 저장되었습니다"}
|
||||
</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>
|
||||
{/* blob에 Content-Disposition이 박혀 있어 주소만 열면 내려받기가 된다.
|
||||
<a download>은 다른 출처에 안 먹으므로 이 속성에 기대지 않는다 */}
|
||||
<a href={job.artifacts.video} 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,87 @@
|
||||
"use client";
|
||||
|
||||
import DisabledNotice from "@/components/disabled-notice";
|
||||
import { FEATURES } from "@/lib/features";
|
||||
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;
|
||||
};
|
||||
|
||||
function PlayreelArchivePageInner() {
|
||||
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}` : "—"}
|
||||
</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>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
export default function PlayreelArchivePage() {
|
||||
if (!FEATURES.archive) return <DisabledNotice title="아카이브" backHref="/playreel" />;
|
||||
return <PlayreelArchivePageInner />;
|
||||
}
|
||||
@@ -0,0 +1,144 @@
|
||||
"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";
|
||||
import { useRequireLogin } from "@/components/auth-gate";
|
||||
import { refreshMe, useMe } from "@/lib/auth";
|
||||
|
||||
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 requireLogin = useRequireLogin();
|
||||
const { me } = useMe();
|
||||
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(() => {
|
||||
// 잡 목록은 로그인해야 볼 수 있다. 로그인 전에는 부르지 않는다
|
||||
if (!me) return;
|
||||
apiFetch<PlayreelJob[]>("/api/playreel/jobs")
|
||||
.then((j) => setRecent(j.slice(0, 6)))
|
||||
.catch(() => setRecent([]));
|
||||
}, [me]);
|
||||
|
||||
const submit = async () => {
|
||||
if (!goodsId) return;
|
||||
// 여기서 처음으로 로그인이 필요해진다
|
||||
if (!requireLogin()) 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() }),
|
||||
});
|
||||
// 남은 개수가 하나 줄었다
|
||||
refreshMe();
|
||||
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.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>
|
||||
);
|
||||
}
|
||||
|
After Width: | Height: | Size: 25 KiB |
@@ -0,0 +1,570 @@
|
||||
@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; }
|
||||
|
||||
/* 사이드바 맨 아래 계정 카드 */
|
||||
.account-card {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.6rem;
|
||||
margin: 0 0.75rem;
|
||||
padding: 0.7rem 0.8rem;
|
||||
border-radius: var(--radius-md);
|
||||
background: var(--color-bg-darker);
|
||||
border: 1px solid var(--color-border-white-10);
|
||||
min-width: 0;
|
||||
}
|
||||
.account-photo {
|
||||
flex: none;
|
||||
width: 34px;
|
||||
height: 34px;
|
||||
border-radius: var(--radius-full);
|
||||
object-fit: cover;
|
||||
background: var(--color-bg-dark);
|
||||
}
|
||||
.account-photo--blank {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-weight: 700;
|
||||
color: var(--color-mint);
|
||||
}
|
||||
.account-body { flex: 1; min-width: 0; }
|
||||
.account-name {
|
||||
margin: 0;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
font-size: var(--text-sm);
|
||||
font-weight: 700;
|
||||
}
|
||||
.account-credit {
|
||||
margin: 2px 0 0;
|
||||
font-size: var(--text-xs);
|
||||
color: var(--color-text-gray-400);
|
||||
}
|
||||
.account-link {
|
||||
flex: none;
|
||||
padding: 0;
|
||||
border: none;
|
||||
background: none;
|
||||
cursor: pointer;
|
||||
font-family: var(--font);
|
||||
font-size: var(--text-xs);
|
||||
color: var(--color-mint);
|
||||
}
|
||||
.account-link:hover { text-decoration: underline; }
|
||||
.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>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
"use client";
|
||||
|
||||
import { Suspense } from "react";
|
||||
import { useRouter, useSearchParams } from "next/navigation";
|
||||
import GoogleSignIn from "@/components/google-sign-in";
|
||||
import { setMe, signIn } from "@/lib/auth";
|
||||
import { useState } from "react";
|
||||
|
||||
function LoginForm() {
|
||||
const router = useRouter();
|
||||
// 로그인 전에 가려던 곳. 없으면 홈으로 보낸다
|
||||
const next = useSearchParams().get("next") || "/";
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
|
||||
return (
|
||||
<div style={{ display: "flex", flexDirection: "column", alignItems: "center",
|
||||
gap: "1.5rem", paddingTop: "8rem" }}>
|
||||
<h1 className="page-title">로그인</h1>
|
||||
<p className="page-subtitle">구글 계정으로 들어와 주세요.</p>
|
||||
<GoogleSignIn onCredential={(credential) => {
|
||||
setError(null);
|
||||
signIn(credential)
|
||||
// 사이드바 배지와 목록이 같은 값을 보므로 여기서 넣어줘야 같이 바뀐다
|
||||
.then(setMe)
|
||||
.then(() => router.replace(next))
|
||||
.catch((failure) => setError((failure as Error).message));
|
||||
}} />
|
||||
{error && <p style={{ color: "#ff7a7a", fontSize: "var(--text-sm)" }}>{error}</p>}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default function LoginPage() {
|
||||
return (
|
||||
<Suspense fallback={<p style={{ color: "var(--color-text-gray-400)" }}>불러오는 중…</p>}>
|
||||
<LoginForm />
|
||||
</Suspense>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
"use client";
|
||||
|
||||
/** 사이드바 맨 아래 계정 카드. 누구로 들어와 있는지, 남은 크레딧, 나가는 길 */
|
||||
|
||||
import { useRouter } from "next/navigation";
|
||||
import { signOut, useMe } from "@/lib/auth";
|
||||
|
||||
export default function AccountBadge() {
|
||||
const router = useRouter();
|
||||
const { me } = useMe();
|
||||
|
||||
if (me === null) return null;
|
||||
|
||||
if (me === false) {
|
||||
return (
|
||||
<div className="account-card">
|
||||
<button type="button" className="account-link" onClick={() => router.push("/login")}>
|
||||
로그인
|
||||
</button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="account-card">
|
||||
{me.picture ? (
|
||||
// eslint-disable-next-line @next/next/no-img-element
|
||||
<img className="account-photo" src={me.picture} alt="" referrerPolicy="no-referrer" />
|
||||
) : (
|
||||
<span className="account-photo account-photo--blank">
|
||||
{(me.name || me.email).slice(0, 1)}
|
||||
</span>
|
||||
)}
|
||||
<div className="account-body">
|
||||
<p className="account-name" title={me.email}>{me.name || me.email}</p>
|
||||
<p className="account-credit">보유 크레딧: {me.jobs_left}</p>
|
||||
</div>
|
||||
{/* 화면 여기저기 남의 계정 데이터가 남아 있어 통째로 새로 받는다 */}
|
||||
<button type="button" className="account-link"
|
||||
onClick={() => { signOut().finally(() => { window.location.href = "/"; }); }}>
|
||||
로그아웃
|
||||
</button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
/** ADO2 공식 워드마크 — higgsfield POC/ADO2 Design System/assets/logo.svg (currentColor) */
|
||||
export default function Ado2Logo({ height = 16 }: { height?: number }) {
|
||||
return (
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width={(149 / 22) * height}
|
||||
height={height}
|
||||
viewBox="0 0 149 22"
|
||||
fill="none"
|
||||
aria-label="ADO2"
|
||||
>
|
||||
<path
|
||||
d="M 8.85 21.647 L 11.455 18.754 L 26.244 18.754 L 19.042 3.985 L 4.064 21.654 L 0 21.654 L 17.329 1.378 C 17.902 0.712 18.755 0.072 19.804 0.072 C 20.852 0.072 21.484 0.647 21.836 1.378 L 31.864 21.654 L 8.857 21.654 L 8.85 21.647 Z M 34.052 21.647 L 36.371 8.374 L 39.829 8.374 L 38.018 18.754 L 47.761 18.754 C 53.153 18.754 57.724 14.867 57.724 9.837 C 57.724 5.983 54.84 3.279 50.489 3.279 L 37.289 3.279 L 40.018 0.353 L 50.997 0.353 C 57.151 0.353 61.182 3.985 61.182 9.269 C 61.182 16.18 54.833 21.654 47.253 21.654 L 34.052 21.654 L 34.052 21.647 Z M 75.848 22 C 67.499 22 63.279 19.198 63.279 13.116 C 63.279 4.298 68.645 0 79.716 0 C 88.065 0 92.285 2.77 92.285 8.851 C 92.285 17.669 86.951 22 75.848 22 Z M 79.215 2.9 C 70.072 2.9 66.776 5.735 66.776 12.77 C 66.776 17.388 69.824 19.106 76.363 19.106 C 85.473 19.106 88.801 16.239 88.801 9.204 C 88.801 4.586 85.753 2.9 79.215 2.9 Z M 92.865 21.647 L 93.978 15.344 C 94.642 11.523 97.599 9.681 102.418 9.681 L 111.685 9.681 C 115.586 9.681 117.175 8.341 117.175 6.049 C 117.175 3.945 115.078 3.279 111.079 3.279 L 97.338 3.279 L 100.1 0.353 L 113.013 0.353 C 118.438 0.353 120.568 2.358 120.568 5.35 C 120.568 9.262 118.028 12.228 111.555 12.228 L 102.288 12.228 C 99.37 12.228 97.716 13.149 97.306 15.318 L 96.733 18.754 L 118.601 18.754 L 115.872 21.647 L 92.865 21.647 Z M 121.688 21.504 C 121.141 21.504 120.73 21.184 120.73 20.667 C 120.73 19.955 121.349 19.55 122.039 19.55 C 122.606 19.55 123.029 19.851 123.029 20.367 C 123.029 21.079 122.411 21.504 121.681 21.504 L 121.688 21.504 Z M 129.769 21.347 L 131.222 19.727 L 139.479 19.727 L 135.455 11.477 L 127.086 21.347 L 124.82 21.347 L 134.497 10.02 C 134.816 9.648 135.292 9.289 135.878 9.289 C 136.464 9.289 136.816 9.609 137.011 10.02 L 142.611 21.347 L 129.763 21.347 L 129.769 21.347 Z M 144.975 21.347 L 147.085 9.452 L 149 9.452 L 146.89 21.347 L 144.975 21.347 Z"
|
||||
fill="currentColor"
|
||||
fillRule="nonzero"
|
||||
/>
|
||||
</svg>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
"use client";
|
||||
|
||||
/**
|
||||
* 로그인하지 않았으면 화면 대신 로그인만 보여준다.
|
||||
*
|
||||
* 들어오는 화면과 아카이브는 열어 둔다 — 로그인은 실제로 만들려고 누를 때 요구한다.
|
||||
* 그 요구는 여기가 아니라 시작 화면의 제출 버튼이 한다(useRequireLogin).
|
||||
*/
|
||||
|
||||
import { usePathname, useRouter } from "next/navigation";
|
||||
import GoogleSignIn from "@/components/google-sign-in";
|
||||
import { signIn, useMe } from "@/lib/auth";
|
||||
import { useState } from "react";
|
||||
|
||||
// 이 주소들은 그대로 보여준다. 하위 경로까지 여는 것은 아카이브뿐이다
|
||||
const OPEN_PAGES = ["/", "/poster", "/playreel", "/login"];
|
||||
const OPEN_TREES = ["/archive", "/playreel/archive"];
|
||||
|
||||
function isOpen(pathname: string): boolean {
|
||||
return OPEN_PAGES.includes(pathname)
|
||||
|| OPEN_TREES.some((open) => pathname === open || pathname.startsWith(`${open}/`));
|
||||
}
|
||||
|
||||
/** 시작 화면이 제출 직전에 부른다. 로그인 안 돼 있으면 로그인 화면으로 보낸다 */
|
||||
export function useRequireLogin() {
|
||||
const router = useRouter();
|
||||
const pathname = usePathname();
|
||||
const { me } = useMe();
|
||||
|
||||
return () => {
|
||||
if (me === false) {
|
||||
router.push(`/login?next=${encodeURIComponent(pathname)}`);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
}
|
||||
|
||||
export default function AuthGate({ children }: { children: React.ReactNode }) {
|
||||
const pathname = usePathname();
|
||||
const { me, setMe } = useMe();
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
|
||||
if (isOpen(pathname)) return <>{children}</>;
|
||||
|
||||
if (me === null) {
|
||||
return <p style={{ color: "var(--color-text-gray-400)" }}>확인하는 중…</p>;
|
||||
}
|
||||
|
||||
if (me === false) {
|
||||
return (
|
||||
<div style={{ display: "flex", flexDirection: "column", alignItems: "center",
|
||||
gap: "1.5rem", paddingTop: "6rem" }}>
|
||||
<h1 className="page-title">로그인이 필요합니다</h1>
|
||||
<p className="page-subtitle">구글 계정으로 들어와 주세요.</p>
|
||||
<GoogleSignIn onCredential={(credential) => {
|
||||
setError(null);
|
||||
signIn(credential).then(setMe).catch((failure) => setError((failure as Error).message));
|
||||
}} />
|
||||
{error && <p style={{ color: "#ff7a7a", fontSize: "var(--text-sm)" }}>{error}</p>}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
return <>{children}</>;
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
"use client";
|
||||
|
||||
/**
|
||||
* 게이트 ①·③ 자동 승인 — (a) 시작 화면 옵션으로 확정(2026-08-28).
|
||||
* <AutoApprovePanel /> /playreel 시작 화면: 스위치 2개 + 잠긴 2·4·5단계 안내. 되돌리는 자리도 여기.
|
||||
* 아이콘은 SVG만(이모지 금지).
|
||||
*/
|
||||
|
||||
import { GATE_META, type GateKey } from "@/lib/playreel";
|
||||
import { AUTO_APPROVABLE, setAutoApprove, useAutoApprove, type AutoApprovable } from "@/lib/prefs";
|
||||
|
||||
export const isAutoApprovable = (g: GateKey | null | undefined): g is AutoApprovable =>
|
||||
!!g && (AUTO_APPROVABLE as readonly string[]).includes(g);
|
||||
|
||||
const AUTO_COPY: Record<AutoApprovable, string> = {
|
||||
fetch_confirm: "상세페이지에서 읽은 정보와 기본 섹션을 그대로 사용",
|
||||
narration_confirm: "자동 생성 문장과 기본 목소리로 바로 진행",
|
||||
};
|
||||
|
||||
const Lock = () => (
|
||||
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round" aria-hidden style={{ flexShrink: 0 }}>
|
||||
<rect x="4" y="11" width="16" height="10" rx="2" /><path d="M8 11V7a4 4 0 0 1 8 0v4" />
|
||||
</svg>
|
||||
);
|
||||
|
||||
function Switch({ on, onChange, label }: { on: boolean; onChange: (v: boolean) => void; label: string }) {
|
||||
return (
|
||||
<button type="button" role="switch" aria-checked={on} aria-label={label} className={`switch${on ? " on" : ""}`} onClick={() => onChange(!on)}>
|
||||
<span className="switch-knob" />
|
||||
</button>
|
||||
);
|
||||
}
|
||||
|
||||
export function AutoApprovePanel() {
|
||||
const prefs = useAutoApprove();
|
||||
return (
|
||||
<div>
|
||||
<p className="field-label" style={{ margin: "0 0 0.75rem" }}>자동화 승인 단계 설정</p>
|
||||
<div className="card" style={{ padding: "0.5rem 1rem" }}>
|
||||
{AUTO_APPROVABLE.map((g) => {
|
||||
const m = GATE_META[g];
|
||||
return (
|
||||
<div key={g} className="pref-row">
|
||||
<div style={{ minWidth: 0 }}>
|
||||
<p style={{ margin: 0, fontSize: "var(--text-sm)", fontWeight: 600 }}>{m.step}단계 · {m.name}</p>
|
||||
<p style={{ margin: "2px 0 0", fontSize: "var(--text-xs)", color: "var(--color-text-gray-500)" }}>{AUTO_COPY[g]}</p>
|
||||
</div>
|
||||
<Switch on={!!prefs[g]} onChange={(v) => setAutoApprove(g, v)} label={`${m.name} 자동 승인`} />
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
<div className="pref-row" style={{ opacity: 0.55 }}>
|
||||
<div style={{ minWidth: 0 }}>
|
||||
<p style={{ margin: 0, fontSize: "var(--text-sm)", fontWeight: 600 }}>2 · 4 · 5단계</p>
|
||||
<p style={{ margin: "2px 0 0", fontSize: "var(--text-xs)", color: "var(--color-text-gray-500)" }}>되돌릴 수 없는 단계라 항상 확인합니다</p>
|
||||
</div>
|
||||
<span style={{ color: "var(--color-text-gray-500)" }}><Lock /></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
import Link from "next/link";
|
||||
|
||||
/** 꺼둔 화면의 자리. lib/features.ts 에서 켠다. */
|
||||
export default function DisabledNotice({ title, backHref = "/" }: {
|
||||
title: string; backHref?: string;
|
||||
}) {
|
||||
return (
|
||||
<div>
|
||||
<Link href={backHref} className="btn-back">‹ 뒤로가기</Link>
|
||||
<h1 className="page-title">{title}</h1>
|
||||
<p className="page-subtitle">이 화면은 아직 열지 않았습니다.</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,300 @@
|
||||
"use client";
|
||||
|
||||
/**
|
||||
* 컨펌 게이트 카드 — PLAYREEL_JOURNEY.md §2 의 공통 구조.
|
||||
* [eyebrow] n/5 · 이름 [title] [why] [body] [actions] [cost]
|
||||
* 게이트별 본문은 아래 5개 컴포넌트. 편집값은 `edits` 로 부모에게 올려 approve 시 함께 보낸다.
|
||||
*/
|
||||
|
||||
import { useState } from "react";
|
||||
import {
|
||||
GATE_META, type AnalysisReview, type ClipReview, type DetailSection, type FetchReview,
|
||||
type FinalReview, type GateKey, type GateReview, type NarrationReview,
|
||||
} from "@/lib/playreel";
|
||||
|
||||
// ── 공통 셸 ──────────────────────────────────────────────────────────
|
||||
export function GateShell({ gate, children, onApprove, onBack, busy, error, approveLabel }: {
|
||||
gate: GateKey; children: React.ReactNode;
|
||||
onApprove: () => void; onBack?: () => void; busy: boolean; error: string | null; approveLabel?: string;
|
||||
}) {
|
||||
const g = GATE_META[gate];
|
||||
return (
|
||||
<div>
|
||||
<p className="eyebrow" style={{ margin: 0, color: "var(--color-mint)", fontSize: "var(--text-sm)" }}>
|
||||
확인 {g.step} / 5 · {g.name}
|
||||
</p>
|
||||
<h2 style={{ margin: "0.4rem 0 0.5rem", fontSize: "var(--text-2xl)", fontWeight: 700, letterSpacing: "-0.02em" }}>{g.title}</h2>
|
||||
<p style={{ margin: "0 0 1.5rem", fontSize: "var(--text-base)", color: "var(--color-text-gray-400)", lineHeight: 1.6 }}>{g.why}</p>
|
||||
|
||||
{children}
|
||||
|
||||
<div className="gate-actions">
|
||||
<button className="btn-cta btn-lg" disabled={busy} onClick={onApprove}>
|
||||
{busy ? "처리 중…" : (approveLabel ?? "승인하고 계속")}
|
||||
</button>
|
||||
{g.canBack && onBack && (
|
||||
<button className="btn-outline btn-lg" disabled={busy} onClick={onBack}>‹ 이전 단계로</button>
|
||||
)}
|
||||
</div>
|
||||
<p style={{ margin: "0.75rem 0 0", fontSize: "var(--text-sm)", color: "var(--color-text-gray-500)" }}>
|
||||
다음 단계 · {g.next} · {g.eta}
|
||||
</p>
|
||||
{error && <p style={{ color: "#ff7a7a", fontSize: "var(--text-sm)", marginTop: "0.75rem" }}>{error}</p>}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
// ── 작은 공용 조각 (아이콘은 SVG만 — 이모지 금지) ─────────────────────
|
||||
const Ico = ({ d, size = 12 }: { d: string; size?: number }) => (
|
||||
<svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="3" strokeLinecap="round" strokeLinejoin="round" aria-hidden style={{ flexShrink: 0 }}>
|
||||
<path d={d} />
|
||||
</svg>
|
||||
);
|
||||
const CHECK = "M20 6 9 17l-5-5";
|
||||
const CROSS = "M18 6 6 18M6 6l12 12";
|
||||
const PLUS = "M12 5v14M5 12h14";
|
||||
const Lock = ({ size = 12 }: { size?: number }) => (
|
||||
<svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round" aria-hidden style={{ flexShrink: 0 }}>
|
||||
<rect x="4" y="11" width="16" height="10" rx="2" /><path d="M8 11V7a4 4 0 0 1 8 0v4" />
|
||||
</svg>
|
||||
);
|
||||
|
||||
function Chip({ on, onClick, children, locked }: { on: boolean; onClick?: () => void; children: React.ReactNode; locked?: boolean }) {
|
||||
return (
|
||||
<button type="button" onClick={locked ? undefined : onClick}
|
||||
style={{
|
||||
display: "inline-flex", alignItems: "center", gap: 6,
|
||||
padding: "0.35rem 0.8rem", borderRadius: 999, cursor: locked ? "default" : "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)", opacity: locked ? 0.85 : 1,
|
||||
}}>
|
||||
{locked ? <Lock /> : on ? <Ico d={CHECK} /> : <Ico d={PLUS} />}{children}
|
||||
</button>
|
||||
);
|
||||
}
|
||||
|
||||
function Warn({ children }: { children: React.ReactNode }) {
|
||||
return (
|
||||
<p style={{ margin: "0.75rem 0 0", padding: "0.6rem 0.9rem", borderRadius: "var(--radius-md)", background: "rgba(255,210,122,0.1)", border: "1px solid rgba(255,210,122,0.35)", color: "#ffd27a", fontSize: "var(--text-sm)", lineHeight: 1.5 }}>
|
||||
{children}
|
||||
</p>
|
||||
);
|
||||
}
|
||||
|
||||
const two = { display: "grid", gridTemplateColumns: "repeat(auto-fit, minmax(280px, 1fr))", gap: "var(--spacing-page-md)", alignItems: "start" } as const;
|
||||
|
||||
// 상세페이지 조각은 라벨이 겹친다 — "유의사항"만 일곱 개인 페이지가 흔하다.
|
||||
// 칩으로 그리면 같은 글자가 줄줄이 서서 무엇을 고르는지 알 수 없어 썸네일을 그린다.
|
||||
function SectionPicker({ sections, onToggle }: {
|
||||
sections: DetailSection[]; onToggle: (id: string) => void;
|
||||
}) {
|
||||
const chosen = sections.filter((s) => s.selected).length;
|
||||
return (
|
||||
<>
|
||||
<p className="field-label" style={{ margin: "1.5rem 0 0.35rem" }}>상세페이지에서 훑기 시작할 지점</p>
|
||||
<p style={{ margin: "0 0 0.7rem", fontSize: "var(--text-xs)", color: "var(--color-text-gray-500)", lineHeight: 1.5 }}>
|
||||
고른 지점부터 상세페이지를 이어서 훑습니다. 조각을 잘라 붙이는 것이 아닙니다.
|
||||
</p>
|
||||
<div style={{ display: "grid", gridTemplateColumns: "repeat(auto-fill, minmax(84px, 1fr))", gap: 8, maxHeight: 340, overflowY: "auto", paddingRight: 4 }}>
|
||||
{sections.map((s, i) => (
|
||||
<button key={s.id} type="button" title={`${s.label} · ${s.height.toLocaleString()}px`}
|
||||
onClick={s.required ? undefined : () => onToggle(s.id)}
|
||||
style={{
|
||||
position: "relative", padding: 0, borderRadius: "var(--radius-md)", overflow: "hidden",
|
||||
cursor: s.required ? "default" : "pointer", textAlign: "left", background: "transparent",
|
||||
border: s.selected ? "2px solid var(--color-mint)" : "2px solid var(--color-border-white-10)",
|
||||
opacity: s.selected ? 1 : 0.5,
|
||||
}}>
|
||||
{/* eslint-disable-next-line @next/next/no-img-element */}
|
||||
<img src={s.thumb_url} alt={s.label}
|
||||
style={{ width: "100%", aspectRatio: "3 / 4", objectFit: "cover", objectPosition: "top", display: "block", background: "#000" }} />
|
||||
<span style={{ position: "absolute", top: 4, left: 4, minWidth: 16, padding: "1px 4px", borderRadius: 4, background: "rgba(0,0,0,0.65)", color: "#fff", fontSize: 10, textAlign: "center" }}>{i + 1}</span>
|
||||
<span style={{ display: "flex", alignItems: "center", gap: 4, padding: "3px 5px", fontSize: 10, lineHeight: 1.3, background: "rgba(0,0,0,0.65)", color: s.selected ? "var(--color-mint)" : "var(--color-text-gray-400)" }}>
|
||||
{s.required ? <Lock size={10} /> : s.selected ? <Ico d={CHECK} size={10} /> : <Ico d={PLUS} size={10} />}
|
||||
<span style={{ overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>{s.label}</span>
|
||||
</span>
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
<p style={{ margin: "0.6rem 0 0", fontSize: "var(--text-xs)", color: "var(--color-text-gray-500)", display: "flex", alignItems: "center", gap: 6 }}>
|
||||
<Lock size={11} /> {sections.length}개 중 {chosen}개 선택 · 캐스팅 스케줄은 항상 포함됩니다.
|
||||
</p>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
// ── ① 수집 확인 ───────────────────────────────────────────────────────
|
||||
export function FetchGate({ data, onChange }: { data: FetchReview; onChange: (edits: { sections: string[]; meta: FetchReview["meta"] }) => void }) {
|
||||
const [sections, setSections] = useState(data.sections);
|
||||
const [meta, setMeta] = useState(data.meta);
|
||||
const emit = (s = sections, m = meta) => onChange({ sections: s.filter((x) => x.selected).map((x) => x.id), meta: m });
|
||||
|
||||
return (
|
||||
<div style={two}>
|
||||
<div>
|
||||
<p className="field-label" style={{ margin: "0 0 0.5rem" }}>공연 정보</p>
|
||||
{([["title", "공연명"], ["date_text", "일시"], ["place", "장소"]] as const).map(([k, label]) => (
|
||||
<div key={k} 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" style={{ height: 44 }} value={meta[k]}
|
||||
onChange={(e) => { const m = { ...meta, [k]: e.target.value }; setMeta(m); emit(sections, m); }} />
|
||||
</div>
|
||||
))}
|
||||
<p style={{ margin: "0.5rem 0 0", fontSize: "var(--text-sm)", color: "var(--color-text-gray-400)" }}>
|
||||
캐스트 · {meta.cast.join(", ")}
|
||||
</p>
|
||||
|
||||
<SectionPicker sections={sections}
|
||||
onToggle={(id) => {
|
||||
const n = sections.map((x) => x.id === id ? { ...x, selected: !x.selected } : x);
|
||||
setSections(n); emit(n);
|
||||
}} />
|
||||
{data.poster_width <= 800 && (
|
||||
<Warn>포스터가 {data.poster_width}px로 작습니다. 다음 단계에서 화질을 2배 보정합니다. 원본 파일이 있으면 무빙포스터 경로에서 직접 올리는 편이 더 선명합니다.</Warn>
|
||||
)}
|
||||
</div>
|
||||
<div>
|
||||
<p className="field-label" style={{ margin: "0 0 0.5rem" }}>포스터</p>
|
||||
{/* eslint-disable-next-line @next/next/no-img-element */}
|
||||
<img src={data.poster_url} alt="포스터" className="card-inner" style={{ width: "100%", maxWidth: 300, padding: 0, display: "block" }} />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
// ── ② 연출 확인 ───────────────────────────────────────────────────────
|
||||
export function AnalysisGate({ data, onChange }: { data: AnalysisReview; onChange: (edits: { movable: string[]; fixed: string[]; model: string }) => void }) {
|
||||
const [movable, setMovable] = useState(data.movable);
|
||||
const [fixed, setFixed] = useState(data.fixed);
|
||||
const emit = (m = movable, f = fixed) => onChange({ movable: m.filter((x) => x.on).map((x) => x.key), fixed: f.filter((x) => x.on).map((x) => x.key), model: data.model });
|
||||
|
||||
return (
|
||||
<div style={two}>
|
||||
<div>
|
||||
<p className="field-label" style={{ margin: "0 0 0.5rem" }}>움직일 요소</p>
|
||||
<p style={{ margin: "0 0 0.6rem", fontSize: "var(--text-sm)", color: "var(--color-text-gray-400)" }}>카메라는 움직이지 않습니다. 빛·안개·천 같은 요소만 살아납니다.</p>
|
||||
<div style={{ display: "flex", flexWrap: "wrap", gap: "0.5rem" }}>
|
||||
{movable.map((m) => (
|
||||
<Chip key={m.key} on={m.on} onClick={() => { const n = movable.map((x) => x.key === m.key ? { ...x, on: !x.on } : x); setMovable(n); emit(n); }}>{m.label}</Chip>
|
||||
))}
|
||||
</div>
|
||||
|
||||
<p className="field-label" style={{ margin: "1.5rem 0 0.5rem" }}>원본 그대로 고정</p>
|
||||
<p style={{ margin: "0 0 0.6rem", fontSize: "var(--text-sm)", color: "var(--color-text-gray-400)" }}>생성된 화면 위에 원본 픽셀을 다시 덮습니다. 제목은 한 픽셀도 바뀌지 않습니다.</p>
|
||||
<div style={{ display: "flex", flexWrap: "wrap", gap: "0.5rem" }}>
|
||||
{fixed.map((f) => (
|
||||
<Chip key={f.key} on={f.on} locked={f.key === "title"} onClick={() => { const n = fixed.map((x) => x.key === f.key ? { ...x, on: !x.on } : x); setFixed(n); emit(movable, n); }}>{f.label}</Chip>
|
||||
))}
|
||||
</div>
|
||||
|
||||
<p className="field-label" style={{ margin: "1.5rem 0 0.5rem" }}>생성 모델</p>
|
||||
<p style={{ margin: 0, fontSize: "var(--text-sm)", color: "var(--color-text-gray-300)" }}>Kling 3.0 pro · 8초</p>
|
||||
{data.ip_risk && <Warn>알려진 IP(디즈니 등) 작품입니다. 다른 모델은 저작권 필터로 거부된 이력이 있어 Kling으로만 진행합니다. 실패하면 아트워크 푸시인으로 대체됩니다.</Warn>}
|
||||
{!data.has_qr && <p style={{ margin: "0.6rem 0 0", fontSize: "var(--text-xs)", color: "var(--color-text-gray-500)" }}>포스터에 QR이 없어 엔딩 밴드 QR은 상품 페이지 링크로 자동 생성합니다.</p>}
|
||||
</div>
|
||||
<div>
|
||||
<p className="field-label" style={{ margin: "0 0 0.5rem" }}>요소 분석 (5% 격자)</p>
|
||||
{/* eslint-disable-next-line @next/next/no-img-element */}
|
||||
<img src={data.grid_url} alt="격자 오버레이" className="card-inner" style={{ width: "100%", maxWidth: 300, padding: 0, display: "block" }} />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
// ── ③ 나레이션·보이스 확인 ────────────────────────────────────────────
|
||||
export function NarrationGate({ data, onChange }: { data: NarrationReview; onChange: (edits: { lines: string[]; voice_id: string }) => void }) {
|
||||
const [lines, setLines] = useState(data.lines);
|
||||
const lenOk = data.est_seconds >= 28 && data.est_seconds <= 31;
|
||||
return (
|
||||
<div style={two}>
|
||||
<div>
|
||||
<p className="field-label" style={{ margin: "0 0 0.5rem" }}>나레이션 8문장</p>
|
||||
{lines.map((l, i) => (
|
||||
<div key={i} className="narr-row">
|
||||
<span className="narr-slot" style={{ color: l.slot === "캐스팅 스케줄" ? "var(--color-mint)" : "var(--color-text-gray-400)" }}>{l.slot}</span>
|
||||
<input className="input" style={{ height: 42, fontSize: "var(--text-sm)" }} value={l.text}
|
||||
onChange={(e) => { const n = lines.map((x, j) => j === i ? { ...x, text: e.target.value } : x); setLines(n); onChange({ lines: n.map((x) => x.text), voice_id: data.voice.id }); }} />
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
<div>
|
||||
<p className="field-label" style={{ margin: "0 0 0.5rem" }}>목소리</p>
|
||||
<div className="card-inner">
|
||||
<p style={{ margin: 0, fontWeight: 700 }}>{data.voice.name}</p>
|
||||
{data.voice.sample_url
|
||||
? <audio controls src={data.voice.sample_url} style={{ width: "100%", marginTop: "0.6rem" }} />
|
||||
: <p style={{ margin: "0.5rem 0 0", fontSize: "var(--text-sm)", color: "var(--color-text-gray-500)" }}>샘플 준비 중</p>}
|
||||
</div>
|
||||
<p className="field-label" style={{ margin: "1.25rem 0 0.5rem" }}>예상 길이</p>
|
||||
<p style={{ margin: 0, fontSize: "var(--text-2xl)", fontWeight: 700, color: lenOk ? "var(--color-mint)" : "#ffd27a" }}>
|
||||
{data.est_seconds.toFixed(1)}초
|
||||
</p>
|
||||
<p style={{ margin: "0.25rem 0 0", fontSize: "var(--text-sm)", color: "var(--color-text-gray-500)" }}>목표 28~31초{!lenOk && " — 문장을 줄이거나 늘려주세요"}</p>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
// ── ④ 클립 검수 ───────────────────────────────────────────────────────
|
||||
export function ClipGate({ data }: { data: ClipReview }) {
|
||||
return (
|
||||
<div style={two}>
|
||||
<div className="card-inner" style={{ display: "flex", alignItems: "center", justifyContent: "center", minHeight: 320 }}>
|
||||
{data.clip_url
|
||||
? <video src={data.clip_url} controls style={{ width: "100%", maxHeight: 520, borderRadius: "var(--radius-md)" }} />
|
||||
: <p style={{ color: "var(--color-text-gray-500)", fontSize: "var(--text-sm)" }}>생성 클립 8초</p>}
|
||||
</div>
|
||||
<div>
|
||||
<p className="field-label" style={{ margin: "0 0 0.5rem" }}>제목 훼손 검사</p>
|
||||
<div className="card-inner" style={{ borderColor: data.gate_passed ? "var(--color-mint-30)" : "rgba(255,122,122,0.4)" }}>
|
||||
<p style={{ margin: 0, fontSize: "var(--text-xl)", fontWeight: 700, color: data.gate_passed ? "var(--color-mint)" : "#ff8c8c" }}>
|
||||
{data.gate_passed ? "통과" : "실패"} · 제목대 편차 {data.title_mae.toFixed(2)}
|
||||
</p>
|
||||
<p style={{ margin: "0.35rem 0 0", fontSize: "var(--text-sm)", color: "var(--color-text-gray-400)" }}>기준 4.0 이하. 원본 제목과 픽셀 단위로 비교한 값입니다.</p>
|
||||
{data.gate_reason && <p style={{ margin: "0.5rem 0 0", fontSize: "var(--text-sm)", color: "#ffb37a" }}>{data.gate_reason}</p>}
|
||||
</div>
|
||||
<p className="field-label" style={{ margin: "1.25rem 0 0.5rem" }}>5시점 프레임</p>
|
||||
{/* eslint-disable-next-line @next/next/no-img-element */}
|
||||
<img src={data.frames_url} alt="프레임 시트" className="card-inner" style={{ width: "100%", padding: 0, display: "block" }} />
|
||||
<Warn>다시 만들기는 영상 생성을 처음부터 반복합니다. 이 클립 위에 원본 글자를 덮는 합성은 다시 만들지 않습니다.</Warn>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
// ── ⑤ 최종 검수 ───────────────────────────────────────────────────────
|
||||
export function FinalGate({ data }: { data: FinalReview }) {
|
||||
return (
|
||||
<div style={two}>
|
||||
<div className="card-inner" style={{ display: "flex", alignItems: "center", justifyContent: "center", minHeight: 420 }}>
|
||||
{data.video_url
|
||||
? <video src={data.video_url} controls style={{ width: "100%", maxHeight: 560, borderRadius: "var(--radius-md)" }} />
|
||||
: <p style={{ color: "var(--color-text-gray-500)", fontSize: "var(--text-sm)" }}>완성본 {data.duration.toFixed(1)}초</p>}
|
||||
</div>
|
||||
<div>
|
||||
<p className="field-label" style={{ margin: "0 0 0.5rem" }}>자동 확인 항목</p>
|
||||
{data.checks.map((c) => (
|
||||
<p key={c.key} style={{ margin: "0.3rem 0", fontSize: "var(--text-base)", color: c.ok ? "var(--color-text-gray-300)" : "#ff8c8c", display: "flex", alignItems: "center", gap: 8 }}>
|
||||
<span style={{ color: c.ok ? "var(--color-mint)" : "#ff8c8c", display: "inline-flex" }}><Ico d={c.ok ? CHECK : CROSS} size={14} /></span>{c.label}
|
||||
</p>
|
||||
))}
|
||||
<p className="field-label" style={{ margin: "1.25rem 0 0.5rem" }}>proof 시트</p>
|
||||
{/* eslint-disable-next-line @next/next/no-img-element */}
|
||||
<img src={data.proof_url} alt="proof" className="card-inner" style={{ width: "100%", padding: 0, display: "block" }} />
|
||||
<p style={{ margin: "0.75rem 0 0", fontSize: "var(--text-sm)", color: "var(--color-text-gray-500)" }}>승인하면 v{data.version}으로 고정됩니다.</p>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
/** review 페이로드 → 게이트 본문. edits 콜백은 승인 시 부모가 모아 보낸다. */
|
||||
export function GateBody({ review, onEdits }: { review: GateReview; onEdits: (e: unknown) => void }) {
|
||||
switch (review.gate) {
|
||||
case "fetch_confirm": return <FetchGate data={review.data} onChange={onEdits} />;
|
||||
case "analysis_confirm": return <AnalysisGate data={review.data} onChange={onEdits} />;
|
||||
case "narration_confirm": return <NarrationGate data={review.data} onChange={onEdits} />;
|
||||
case "clip_confirm": return <ClipGate data={review.data} />;
|
||||
case "final_confirm": return <FinalGate data={review.data} />;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
"use client";
|
||||
|
||||
/** 구글이 그려주는 버튼. 우리가 모양을 흉내 내면 브랜드 규정에 걸린다 */
|
||||
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import {
|
||||
fetchConfig, loadGoogleIdentity, type GoogleButtonOptions,
|
||||
} from "@/lib/auth";
|
||||
|
||||
export default function GoogleSignIn({ onCredential, text = "signin_with" }: {
|
||||
onCredential: (credential: string) => void;
|
||||
text?: GoogleButtonOptions["text"];
|
||||
}) {
|
||||
const host = useRef<HTMLDivElement>(null);
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
// 콜백이 매 렌더마다 바뀌어도 구글에 다시 등록하지 않게 최신 것만 들고 있는다
|
||||
const latest = useRef(onCredential);
|
||||
latest.current = onCredential;
|
||||
|
||||
useEffect(() => {
|
||||
let cancelled = false;
|
||||
|
||||
(async () => {
|
||||
const config = await fetchConfig();
|
||||
if (!config.enabled) throw new Error("구글 로그인이 설정되지 않았습니다");
|
||||
|
||||
const google = await loadGoogleIdentity();
|
||||
if (cancelled || !host.current) return;
|
||||
|
||||
google.initialize({
|
||||
client_id: config.client_id,
|
||||
callback: (response) => {
|
||||
if (response.credential) latest.current(response.credential);
|
||||
},
|
||||
auto_select: false,
|
||||
cancel_on_tap_outside: true,
|
||||
});
|
||||
google.renderButton(host.current, {
|
||||
type: "standard", theme: "filled_black", size: "large",
|
||||
shape: "pill", text, logo_alignment: "center", width: 320,
|
||||
});
|
||||
})().catch((failure) => {
|
||||
if (!cancelled) setError((failure as Error).message);
|
||||
});
|
||||
|
||||
return () => { cancelled = true; };
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [text]);
|
||||
|
||||
if (error) {
|
||||
return <p style={{ color: "#ff7a7a", fontSize: "var(--text-sm)", margin: 0 }}>{error}</p>;
|
||||
}
|
||||
return <div ref={host} style={{ display: "flex", justifyContent: "center" }} />;
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
/** 템플릿 배포 등급 표시.
|
||||
*
|
||||
* 페이지 전체 배너를 쓰던 때는 전 템플릿이 내부 전용이라 그걸로 충분했다.
|
||||
* 퍼블릭 도메인 명화가 섞이면 배너로는 어느 결과물이 공개 가능한지 구분이 안 되므로
|
||||
* 등급을 **카드 단위로** 붙이고, 경고는 내부 전용을 실제로 고른 순간에만 띄운다.
|
||||
*/
|
||||
|
||||
export type License = "public-domain" | "internal-only" | "user-uploaded";
|
||||
|
||||
const STYLES: Record<License, { label: string; fg: string; bg: string; bd: string }> = {
|
||||
"public-domain": {
|
||||
label: "공개 가능",
|
||||
fg: "var(--color-mint)",
|
||||
bg: "var(--color-mint-10)",
|
||||
bd: "var(--color-mint-30)",
|
||||
},
|
||||
"internal-only": {
|
||||
label: "내부 전용",
|
||||
fg: "#ffc9a3",
|
||||
bg: "rgba(255, 154, 90, 0.12)",
|
||||
bd: "rgba(255, 154, 90, 0.35)",
|
||||
},
|
||||
// 내부 전용과 색을 나눈다 — 끄는 조건이 다르고, 책임 주체도 다르다
|
||||
"user-uploaded": {
|
||||
label: "권리 미확인",
|
||||
fg: "#c9b6ff",
|
||||
bg: "rgba(166, 130, 255, 0.14)",
|
||||
bd: "rgba(166, 130, 255, 0.38)",
|
||||
},
|
||||
};
|
||||
|
||||
export function LicenseBadge({ license }: { license: License }) {
|
||||
const s = STYLES[license] ?? STYLES["internal-only"];
|
||||
return (
|
||||
<span style={{
|
||||
display: "inline-block",
|
||||
padding: "0.1rem 0.45rem",
|
||||
borderRadius: "var(--radius-full)",
|
||||
border: `1px solid ${s.bd}`,
|
||||
background: s.bg,
|
||||
color: s.fg,
|
||||
fontSize: "var(--text-xs)",
|
||||
fontWeight: 700,
|
||||
whiteSpace: "nowrap",
|
||||
lineHeight: 1.5,
|
||||
}}>
|
||||
{s.label}
|
||||
</span>
|
||||
);
|
||||
}
|
||||
|
||||
/** 내부 전용을 고른 순간에만 뜨는 경고. 항상 떠 있으면 아무도 안 읽는다. */
|
||||
export function InternalOnlyWarning({ note }: { note?: string }) {
|
||||
return (
|
||||
<div style={{
|
||||
background: STYLES["internal-only"].bg,
|
||||
border: `1px solid ${STYLES["internal-only"].bd}`,
|
||||
borderRadius: "var(--radius-xl)",
|
||||
padding: "0.75rem 1.25rem",
|
||||
fontSize: "var(--text-base)",
|
||||
color: "var(--color-text-gray-300)",
|
||||
lineHeight: 1.6,
|
||||
}}>
|
||||
<strong style={{ color: STYLES["internal-only"].fg }}>내부 전용 템플릿</strong>
|
||||
{" — "}
|
||||
{note || "이 레퍼런스로 만든 결과물은 외부 공개·상업 사용을 금합니다."}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
/** 사용자가 올린 레퍼런스에 대한 고지. 남의 저작물일 수 있다. */
|
||||
export function UserReferenceNotice() {
|
||||
return (
|
||||
<div style={{
|
||||
background: STYLES["user-uploaded"].bg,
|
||||
border: `1px solid ${STYLES["user-uploaded"].bd}`,
|
||||
borderRadius: "var(--radius-xl)",
|
||||
padding: "0.75rem 1.25rem",
|
||||
fontSize: "var(--text-sm)",
|
||||
color: "var(--color-text-gray-300)",
|
||||
lineHeight: 1.6,
|
||||
}}>
|
||||
직접 올린 레퍼런스는 <strong style={{ color: STYLES["user-uploaded"].fg }}>권리를 가진 이미지만</strong> 사용하세요.
|
||||
타인의 저작물을 올려 생긴 문제의 책임은 업로드한 사람에게 있습니다.
|
||||
결과물은 권리 미확인으로 분류됩니다. 긴 변 600px 이상이면 결과가 좋습니다.
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
import type { PosterMeta } from "@/lib/api";
|
||||
|
||||
/** bare=true면 카드 래핑 없이 내용만 (완료 화면 우측 정보 컬럼용) */
|
||||
export default function MetadataCard({ meta, bare = false }: { meta: PosterMeta; bare?: boolean }) {
|
||||
const body = (
|
||||
<>
|
||||
<p className="field-label" style={{ margin: 0 }}>메타태그</p>
|
||||
<h3 style={{ margin: "0.25rem 0 0", fontSize: "var(--text-lg)", fontWeight: 700 }}>{meta.event_name}</h3>
|
||||
<dl style={{
|
||||
margin: "0.75rem 0 0", display: "grid", gridTemplateColumns: "64px 1fr",
|
||||
rowGap: "0.4rem", fontSize: "var(--text-base)",
|
||||
}}>
|
||||
<dt style={{ color: "var(--color-text-gray-400)" }}>일시</dt>
|
||||
<dd style={{ margin: 0, whiteSpace: "pre-line" }}>{meta.date_text}</dd>
|
||||
<dt style={{ color: "var(--color-text-gray-400)" }}>장소</dt>
|
||||
<dd style={{ margin: 0 }}>{meta.place}</dd>
|
||||
<dt style={{ color: "var(--color-text-gray-400)" }}>분류</dt>
|
||||
<dd style={{ margin: 0 }}>{meta.category}{meta.region_guess ? ` · ${meta.region_guess}` : ""}</dd>
|
||||
</dl>
|
||||
<div style={{ marginTop: "0.75rem", display: "flex", flexWrap: "wrap", gap: "0.5rem" }}>
|
||||
{meta.keywords.map((k) => <span key={k} className="tag">{k}</span>)}
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
if (bare) return <div>{body}</div>;
|
||||
return <div className="card">{body}</div>;
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
"use client";
|
||||
|
||||
import Link from "next/link";
|
||||
import { usePathname } from "next/navigation";
|
||||
|
||||
const ICONS: Record<string, React.ReactNode> = {
|
||||
video: (
|
||||
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
|
||||
<rect x="2" y="5" width="14" height="14" rx="2" />
|
||||
<path d="M22 8.5 16 12l6 3.5v-7Z" />
|
||||
</svg>
|
||||
),
|
||||
image: (
|
||||
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
|
||||
<rect x="3" y="3" width="18" height="18" rx="2" />
|
||||
<circle cx="9" cy="9" r="2" />
|
||||
<path d="m21 15-4.5-4.5L7 20" />
|
||||
</svg>
|
||||
),
|
||||
folder: (
|
||||
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
|
||||
<path d="M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.7-.9L9.2 3.9A2 2 0 0 0 7.5 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z" />
|
||||
</svg>
|
||||
),
|
||||
};
|
||||
|
||||
export default function NavLink({ href, icon, children }: {
|
||||
href: string; icon?: string; children: React.ReactNode;
|
||||
}) {
|
||||
const pathname = usePathname();
|
||||
const active = href === "/" ? pathname === "/" || pathname.startsWith("/poster") || pathname.startsWith("/playreel") : pathname.startsWith(href);
|
||||
return (
|
||||
<Link href={href} className={active ? "sidebar-item active" : "sidebar-item"}>
|
||||
{icon && ICONS[icon]}
|
||||
<span>{children}</span>
|
||||
</Link>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
"use client";
|
||||
|
||||
import { useCallback, useRef, useState } from "react";
|
||||
|
||||
interface Props {
|
||||
file: File | null;
|
||||
onFile: (f: File | null) => void;
|
||||
}
|
||||
|
||||
/* 고해상도 원본 수급이 어려운 현실을 반영해 해상도는 차단하지 않는다.
|
||||
낮으면 알려만 주고 업로드는 그대로 진행시킨다. */
|
||||
const SOFT_LONG_EDGE = 1000;
|
||||
|
||||
export default function PosterDropzone({ file, onFile }: Props) {
|
||||
const inputRef = useRef<HTMLInputElement>(null);
|
||||
const [preview, setPreview] = useState<string | null>(null);
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
const [notice, setNotice] = useState<string | null>(null);
|
||||
const [dragging, setDragging] = useState(false);
|
||||
|
||||
const accept = useCallback((f: File) => {
|
||||
if (!/^image\/(jpeg|png|webp|gif)$/.test(f.type)) {
|
||||
setError("JPG / PNG / WEBP / GIF 파일만 올릴 수 있습니다.");
|
||||
return;
|
||||
}
|
||||
setError(null);
|
||||
const url = URL.createObjectURL(f);
|
||||
const img = new Image();
|
||||
img.onload = () => {
|
||||
const edge = Math.max(img.width, img.height);
|
||||
setNotice(edge < SOFT_LONG_EDGE
|
||||
? `긴 변 ${edge}px입니다. 그대로 진행할 수 있고, 깊은 줌 구간만 다소 부드럽게 보일 수 있습니다.`
|
||||
: null);
|
||||
setPreview(url);
|
||||
onFile(f);
|
||||
};
|
||||
img.src = url;
|
||||
}, [onFile]);
|
||||
|
||||
return (
|
||||
<div>
|
||||
<div
|
||||
className="card-inner"
|
||||
onClick={() => inputRef.current?.click()}
|
||||
onDragOver={(e) => { e.preventDefault(); setDragging(true); }}
|
||||
onDragLeave={() => setDragging(false)}
|
||||
onDrop={(e) => {
|
||||
e.preventDefault();
|
||||
setDragging(false);
|
||||
const f = e.dataTransfer.files?.[0];
|
||||
if (f) accept(f);
|
||||
}}
|
||||
style={{
|
||||
// 포스터는 세로물 — 입력창도 4:5 세로 비율이어야 직관적
|
||||
aspectRatio: "4 / 5",
|
||||
maxWidth: 400,
|
||||
margin: "0 auto",
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
overflow: "hidden",
|
||||
padding: preview ? 0 : "var(--s-5)",
|
||||
textAlign: "center",
|
||||
cursor: "pointer",
|
||||
borderStyle: preview ? "solid" : "dashed",
|
||||
borderColor: dragging ? "var(--color-mint)" : "var(--color-border-gray-700)",
|
||||
background: dragging ? "var(--color-mint-10)" : "rgba(18, 26, 29, 0.4)",
|
||||
}}
|
||||
>
|
||||
{preview ? (
|
||||
// eslint-disable-next-line @next/next/no-img-element
|
||||
<img src={preview} alt="포스터 미리보기" style={{ width: "100%", height: "100%", objectFit: "contain" }} />
|
||||
) : (
|
||||
<div>
|
||||
<p style={{ fontSize: 16, fontWeight: 700, margin: 0, lineHeight: 1.5 }}>
|
||||
포스터를 끌어다 놓거나<br />클릭해서 선택
|
||||
</p>
|
||||
<p style={{ fontSize: "var(--text-sm)", color: "var(--color-text-gray-400)", marginTop: "0.75rem" }}>
|
||||
JPG · PNG · WEBP · GIF<br />해상도 제한 없음
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
<input
|
||||
ref={inputRef}
|
||||
type="file"
|
||||
accept="image/jpeg,image/png,image/webp,image/gif"
|
||||
hidden
|
||||
onChange={(e) => { const f = e.target.files?.[0]; if (f) accept(f); }}
|
||||
/>
|
||||
</div>
|
||||
{error && (
|
||||
<p style={{ fontSize: "var(--text-sm)", color: "#ff7a7a", marginTop: "0.75rem" }}>{error}</p>
|
||||
)}
|
||||
{notice && (
|
||||
<p style={{ fontSize: "var(--text-sm)", color: "var(--color-text-gray-400)", marginTop: "0.75rem", lineHeight: 1.5 }}>
|
||||
{notice}
|
||||
</p>
|
||||
)}
|
||||
{file && (
|
||||
<p style={{ fontSize: "var(--text-sm)", color: "var(--color-text-gray-400)", marginTop: "0.5rem" }}>
|
||||
{file.name} · {(file.size / 1024 / 1024).toFixed(1)}MB
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
"use client";
|
||||
|
||||
import type { Job } from "@/lib/api";
|
||||
|
||||
/* 프로덕트 wizard-stepper 패턴: 완료=민트 체크, 현재=민트 링+글로우, 대기=회색 번호 */
|
||||
|
||||
const STAGE_LABELS: Record<string, string> = {
|
||||
detect: "분석",
|
||||
narration_text: "나레이션",
|
||||
tts: "음성",
|
||||
bgm: "음악",
|
||||
motion: "모션 선정",
|
||||
i2v: "애니메이션",
|
||||
render: "렌더",
|
||||
transfer: "변환",
|
||||
};
|
||||
|
||||
const Check = () => (
|
||||
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="3.5" strokeLinecap="round" strokeLinejoin="round">
|
||||
<path d="M20 6 9 17l-5-5" />
|
||||
</svg>
|
||||
);
|
||||
|
||||
export default function StageStepper({ job, labels }: { job: Pick<Job, "stages" | "status">; labels?: Record<string, string> }) {
|
||||
const L = labels ?? STAGE_LABELS;
|
||||
const entries = Object.entries(job.stages);
|
||||
// 검수 대기 중에는 "아직 끝나지 않은 첫 스테이지"가 현재다.
|
||||
// 스테이지명을 박아두면 게이트가 늘 때마다 여기가 조용히 틀어진다.
|
||||
const firstPending = entries.find(([, st]) => st.status !== "done")?.[0];
|
||||
|
||||
return (
|
||||
<div className="wizard-stepper">
|
||||
{entries.map(([key, st], i) => {
|
||||
const cls =
|
||||
st.status === "done" ? "done" :
|
||||
st.status === "failed" ? "failed" :
|
||||
st.status === "running" || (job.status === "awaiting_review" && key === firstPending) ? "current" :
|
||||
"pending";
|
||||
return (
|
||||
<div key={key} style={{ display: "contents" }}>
|
||||
{i > 0 && (
|
||||
<div className={entries[i - 1][1].status === "done" ? "wizard-step-line done" : "wizard-step-line"} />
|
||||
)}
|
||||
<div className={`wizard-step ${cls}`}>
|
||||
<div className="wizard-stepper-node">
|
||||
{st.status === "done" ? <Check /> : i + 1}
|
||||
</div>
|
||||
<div className="wizard-stepper-label">{L[key] ?? key}</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
/** 스테이지 진행률 (%) — 선형 진행바용 */
|
||||
export function stageProgress(job: Pick<Job, "stages">): number {
|
||||
const sts = Object.values(job.stages);
|
||||
const done = sts.filter((s) => s.status === "done").length;
|
||||
const running = sts.some((s) => s.status === "running") ? 0.5 : 0;
|
||||
return Math.round(((done + running) / sts.length) * 100);
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
import { defineConfig, globalIgnores } from "eslint/config";
|
||||
import nextVitals from "eslint-config-next/core-web-vitals";
|
||||
import nextTs from "eslint-config-next/typescript";
|
||||
|
||||
const eslintConfig = defineConfig([
|
||||
...nextVitals,
|
||||
...nextTs,
|
||||
// Override default ignores of eslint-config-next.
|
||||
globalIgnores([
|
||||
// Default ignores of eslint-config-next:
|
||||
".next/**",
|
||||
"out/**",
|
||||
"build/**",
|
||||
"next-env.d.ts",
|
||||
]),
|
||||
]);
|
||||
|
||||
export default eslintConfig;
|
||||
@@ -0,0 +1,141 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
|
||||
export interface StageState {
|
||||
status: "idle" | "running" | "done" | "failed";
|
||||
started: number | null;
|
||||
ended: number | null;
|
||||
}
|
||||
|
||||
export interface Job {
|
||||
id: string;
|
||||
kind: "f1" | "f2";
|
||||
name: string;
|
||||
status: "queued" | "running" | "awaiting_review" | "failed" | "done";
|
||||
stage: string | null;
|
||||
stages: Record<string, StageState>;
|
||||
narration: string[] | null;
|
||||
motion_elements?: string[] | null;
|
||||
metadata: PosterMeta | null;
|
||||
error: { stage: string; detail: string } | null;
|
||||
artifacts: Record<string, string>;
|
||||
created_at: number;
|
||||
queue_size?: number;
|
||||
template_id?: string | null;
|
||||
}
|
||||
|
||||
export interface PosterMeta {
|
||||
event_name: string;
|
||||
date_text: string;
|
||||
place: string;
|
||||
category: string;
|
||||
keywords: string[];
|
||||
region_guess?: string;
|
||||
}
|
||||
|
||||
export interface ArchiveEntry {
|
||||
slug: string;
|
||||
name: string;
|
||||
/** 갈래. 서버가 아직 안 주면(구 엔트리) archiveKind()가 source 유무로 추정한다 — 백엔드 요청 항목(PLAYREEL_JOURNEY §5) */
|
||||
kind?: "f1" | "playreel";
|
||||
/** 갈래 2(상품페이지)일 때만 존재 */
|
||||
source?: { url: string; goods_id: string; slug: string } | null;
|
||||
metadata: PosterMeta | null;
|
||||
narration: string[] | null;
|
||||
poster_url: string;
|
||||
video_url: string | null;
|
||||
f2_variants: {
|
||||
template_id: string;
|
||||
image_url: string;
|
||||
name_ko?: string;
|
||||
license?: "public-domain" | "internal-only" | "user-uploaded";
|
||||
attribution?: string;
|
||||
}[];
|
||||
created_at: number;
|
||||
}
|
||||
|
||||
/** 아카이브 카드 배지 — 홈 최근 작업과 같은 이름("이미지" / "상품페이지") */
|
||||
export function archiveKind(e: ArchiveEntry): "이미지" | "상품페이지" {
|
||||
if (e.kind) return e.kind === "playreel" ? "상품페이지" : "이미지";
|
||||
return e.source?.url ? "상품페이지" : "이미지";
|
||||
}
|
||||
|
||||
export interface F2Template {
|
||||
id: string;
|
||||
name_ko: string;
|
||||
thumb_url: string;
|
||||
category: string;
|
||||
/** 배포 등급 — public-domain만 외부 공개 가능 */
|
||||
license: "public-domain" | "internal-only" | "user-uploaded";
|
||||
attribution: string;
|
||||
license_note: string;
|
||||
/** 사용자가 올린 레퍼런스인가 (삭제 가능) */
|
||||
removable: boolean;
|
||||
/** 레퍼런스가 작아 결과가 나빠질 수 있음 */
|
||||
small_ref: boolean;
|
||||
}
|
||||
|
||||
export interface F2Category {
|
||||
id: string;
|
||||
label: string;
|
||||
}
|
||||
|
||||
/** 서버가 본문 없이 실패했을 때의 안내. Next 리라이트가 백엔드에 못 붙으면 500/502가 빈 본문으로 온다. */
|
||||
function friendlyStatus(status: number, path: string): string {
|
||||
if (status === 404) return `요청한 경로가 서버에 없습니다 (${path})`;
|
||||
if (status >= 500) return "API 서버(:30101)에 연결할 수 없습니다. 서버가 켜져 있는지 확인해 주세요.";
|
||||
return `요청 실패 (HTTP ${status})`;
|
||||
}
|
||||
|
||||
export async function apiFetch<T>(path: string, init?: RequestInit): Promise<T> {
|
||||
const res = await fetch(path, init);
|
||||
if (!res.ok) {
|
||||
let detail: string | null = null;
|
||||
try {
|
||||
const body = await res.json();
|
||||
detail = body.detail ?? JSON.stringify(body);
|
||||
} catch { /* 본문 없는 에러 — 아래 상태별 안내로 */ }
|
||||
// FastAPI 기본 404 본문("Not Found")은 안내가 안 되므로 상태별 문구로 대체
|
||||
throw new Error(detail && detail !== "Not Found" ? detail : friendlyStatus(res.status, path));
|
||||
}
|
||||
return res.json();
|
||||
}
|
||||
|
||||
const F1_ACTIVE = new Set(["queued", "running"]);
|
||||
|
||||
/** 잡 폴링 훅 — done/failed/awaiting_review에서 폴링 중단 (approve 후 재개는 refresh()) */
|
||||
export function useJob(kind: "f1" | "f2", id: string | null, intervalMs = 2500) {
|
||||
const [job, setJob] = useState<Job | null>(null);
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
const timer = useRef<ReturnType<typeof setInterval> | null>(null);
|
||||
|
||||
const refresh = async () => {
|
||||
if (!id) return;
|
||||
try {
|
||||
const j = await apiFetch<Job>(`/api/${kind}/jobs/${id}`);
|
||||
setJob(j);
|
||||
setError(null);
|
||||
if (!F1_ACTIVE.has(j.status) && timer.current) {
|
||||
clearInterval(timer.current);
|
||||
timer.current = null;
|
||||
}
|
||||
} catch (e) {
|
||||
setError((e as Error).message);
|
||||
}
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (!id) return;
|
||||
// eslint-disable-next-line react-hooks/set-state-in-effect -- 폴링 시작: setState는 fetch 완료 후 비동기로만 일어난다
|
||||
refresh();
|
||||
timer.current = setInterval(refresh, intervalMs);
|
||||
return () => { if (timer.current) clearInterval(timer.current); };
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [id]);
|
||||
|
||||
return { job, error, refresh: () => {
|
||||
refresh();
|
||||
if (!timer.current) timer.current = setInterval(refresh, intervalMs);
|
||||
} };
|
||||
}
|
||||
@@ -0,0 +1,142 @@
|
||||
"use client";
|
||||
|
||||
/**
|
||||
* 구글 로그인.
|
||||
* 브라우저가 구글에서 받은 credential 을 서버에 한 번 넘기면, 그 뒤로는 HttpOnly 쿠키가
|
||||
* 붙는다 — 토큰을 프론트가 들고 있지 않는다.
|
||||
*
|
||||
* GIS 스크립트는 여기서 붙인다. 로그인 화면에 오기 전에는 서드파티 요청을 만들지 않는다.
|
||||
*/
|
||||
|
||||
import { useEffect, useSyncExternalStore } from "react";
|
||||
import { apiFetch } from "@/lib/api";
|
||||
|
||||
const SCRIPT_URL = "https://accounts.google.com/gsi/client?hl=ko";
|
||||
const SCRIPT_ID = "google-identity-services";
|
||||
|
||||
export interface Me {
|
||||
email: string;
|
||||
name: string;
|
||||
picture: string;
|
||||
jobs_created: number;
|
||||
job_limit: number;
|
||||
jobs_left: number;
|
||||
}
|
||||
|
||||
export interface AuthConfig {
|
||||
enabled: boolean;
|
||||
client_id: string;
|
||||
}
|
||||
|
||||
type CredentialResponse = { credential?: string };
|
||||
|
||||
export type GoogleButtonOptions = {
|
||||
type?: "standard" | "icon";
|
||||
theme?: "outline" | "filled_blue" | "filled_black";
|
||||
size?: "small" | "medium" | "large";
|
||||
shape?: "rectangular" | "pill" | "circle" | "square";
|
||||
text?: "signin_with" | "signup_with" | "continue_with" | "signin";
|
||||
width?: number;
|
||||
logo_alignment?: "left" | "center";
|
||||
};
|
||||
|
||||
type GoogleIdApi = {
|
||||
initialize(config: {
|
||||
client_id: string;
|
||||
callback: (response: CredentialResponse) => void;
|
||||
auto_select?: boolean;
|
||||
cancel_on_tap_outside?: boolean;
|
||||
}): void;
|
||||
renderButton(parent: HTMLElement, options: GoogleButtonOptions): void;
|
||||
disableAutoSelect(): void;
|
||||
};
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
google?: { accounts?: { id?: GoogleIdApi } };
|
||||
}
|
||||
}
|
||||
|
||||
// 스크립트는 한 번만 받는다
|
||||
let loading: Promise<GoogleIdApi> | null = null;
|
||||
|
||||
export function loadGoogleIdentity(): Promise<GoogleIdApi> {
|
||||
const ready = window.google?.accounts?.id;
|
||||
if (ready) return Promise.resolve(ready);
|
||||
if (loading) return loading;
|
||||
|
||||
loading = new Promise<GoogleIdApi>((resolve, reject) => {
|
||||
const done = () => {
|
||||
const api = window.google?.accounts?.id;
|
||||
if (api) resolve(api);
|
||||
else reject(new Error("구글 스크립트에 accounts.id 가 없습니다"));
|
||||
};
|
||||
const fail = () => {
|
||||
// 다음 시도에서 다시 받을 수 있게 비운다 — 광고 차단기나 사내망에서 한 번 막히는 일이 흔하다
|
||||
loading = null;
|
||||
reject(new Error("구글 로그인 스크립트를 받지 못했습니다"));
|
||||
};
|
||||
|
||||
const existing = document.getElementById(SCRIPT_ID) as HTMLScriptElement | null;
|
||||
if (existing) {
|
||||
existing.addEventListener("load", done, { once: true });
|
||||
existing.addEventListener("error", fail, { once: true });
|
||||
return;
|
||||
}
|
||||
const script = document.createElement("script");
|
||||
script.id = SCRIPT_ID;
|
||||
script.src = SCRIPT_URL;
|
||||
script.async = true;
|
||||
script.defer = true;
|
||||
script.addEventListener("load", done, { once: true });
|
||||
script.addEventListener("error", fail, { once: true });
|
||||
document.head.appendChild(script);
|
||||
});
|
||||
return loading;
|
||||
}
|
||||
|
||||
export const fetchConfig = () => apiFetch<AuthConfig>("/api/auth/config");
|
||||
|
||||
export const signIn = (credential: string) =>
|
||||
apiFetch<Me>("/api/auth/google", {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({ credential }),
|
||||
});
|
||||
|
||||
export const signOut = () => apiFetch<{ ok: boolean }>("/api/auth/logout", { method: "POST" });
|
||||
|
||||
// 로그인 정보는 화면 여러 곳이 같이 본다 — 사이드바 배지와 페이지가 따로 들고 있으면
|
||||
// 한쪽에서 갱신해도 다른 쪽이 옛 값을 그린다. 한 군데 두고 나눠 쓴다
|
||||
let cached: Me | null | false = null;
|
||||
const listeners = new Set<() => void>();
|
||||
|
||||
function publish(next: Me | null | false) {
|
||||
cached = next;
|
||||
listeners.forEach((notify) => notify());
|
||||
}
|
||||
|
||||
function subscribe(notify: () => void) {
|
||||
listeners.add(notify);
|
||||
return () => { listeners.delete(notify); };
|
||||
}
|
||||
|
||||
/** 서버에 다시 물어본다. 잡을 만든 뒤처럼 남은 개수가 바뀌는 자리에서 부른다 */
|
||||
export function refreshMe(): Promise<void> {
|
||||
return apiFetch<Me>("/api/auth/me")
|
||||
.then((me) => publish(me))
|
||||
.catch(() => publish(false));
|
||||
}
|
||||
|
||||
export const setMe = publish;
|
||||
|
||||
/** 로그인 여부. null 이면 아직 확인 중, false 면 로그아웃 상태 */
|
||||
export function useMe() {
|
||||
const me = useSyncExternalStore(subscribe, () => cached, () => null);
|
||||
|
||||
useEffect(() => {
|
||||
if (cached === null) refreshMe();
|
||||
}, []);
|
||||
|
||||
return { me, refresh: refreshMe, setMe: publish };
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
/**
|
||||
* 화면 켜고 끄기.
|
||||
* 백엔드에 대응하는 API가 없는 화면을 여기서 끈다 — 페이지 코드는 그대로 두고
|
||||
* 네비게이션에서 감추고 본문 대신 안내를 띄운다.
|
||||
*
|
||||
* styling /studio — /api/f2 없음
|
||||
* playreelEntry — 무빙포스터 화면에서 롱컷으로 넘어가는 자리. 임시로 닫아둠
|
||||
*/
|
||||
export const FEATURES = {
|
||||
styling: false,
|
||||
archive: true,
|
||||
playreelEntry: false,
|
||||
} as const;
|
||||
@@ -0,0 +1,283 @@
|
||||
"use client";
|
||||
|
||||
/**
|
||||
* Playreel 잡 계약 — product/PLAYREEL_JOURNEY.md §3 과 1:1.
|
||||
* 서버(/api/playreel)가 아직 없으므로 `?mock=<gate>` 로 각 게이트 화면을 띄울 수 있다.
|
||||
*/
|
||||
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import { apiFetch, type Job, type StageState } from "./api";
|
||||
|
||||
export type GateKey =
|
||||
| "fetch_confirm"
|
||||
| "analysis_confirm"
|
||||
| "narration_confirm"
|
||||
| "clip_confirm"
|
||||
| "final_confirm";
|
||||
|
||||
export const GATE_ORDER: GateKey[] = [
|
||||
"fetch_confirm", "analysis_confirm", "narration_confirm", "clip_confirm", "final_confirm",
|
||||
];
|
||||
|
||||
/** 스테퍼 순서 — 롱컷 파이프라인 (product_integration.md) */
|
||||
export const PLAYREEL_STAGES = [
|
||||
"fetch", "split", "upscale", "analyze", "motion", "narration", "tts", "bgm", "i2v", "hybrid", "compose", "review",
|
||||
] as const;
|
||||
|
||||
export const PLAYREEL_STAGE_LABELS: Record<string, string> = {
|
||||
fetch: "수집", split: "섹션", upscale: "화질", analyze: "요소", motion: "연출",
|
||||
narration: "나레이션", tts: "음성", bgm: "음악", i2v: "생성", hybrid: "합성", compose: "조립", review: "검수",
|
||||
};
|
||||
|
||||
// ── 게이트별 검수 페이로드 ──────────────────────────────────────────
|
||||
export interface DetailSection {
|
||||
id: string;
|
||||
tag: string; // split_detail.py --tag 12태그 어휘
|
||||
label: string; // 한글 라벨
|
||||
thumb_url: string;
|
||||
height: number;
|
||||
required?: boolean; // 캐스팅 스케줄 = 항상 포함
|
||||
selected: boolean;
|
||||
}
|
||||
|
||||
export interface FetchReview {
|
||||
poster_url: string;
|
||||
poster_width: number; // 750이면 저해상 경고
|
||||
meta: { title: string; date_text: string; place: string; cast: string[]; genre: string };
|
||||
sections: DetailSection[];
|
||||
}
|
||||
|
||||
export interface AnalysisReview {
|
||||
grid_url: string; // 5% 격자 오버레이
|
||||
movable: { key: string; label: string; on: boolean }[]; // motion_plan MOTION_PHRASE 어휘
|
||||
fixed: { key: string; label: string; on: boolean }[]; // 제목·로고·인물 …
|
||||
model: "kling3_0" | "veo3_1";
|
||||
ip_risk: boolean; // 디즈니 등 — veo 거부 이력
|
||||
has_qr: boolean;
|
||||
}
|
||||
|
||||
export interface NarrationReview {
|
||||
lines: { slot: string; text: string }[]; // 8문장, slot = 훅1·훅2·수상·넘버·캐스팅스케줄·일시·CTA…
|
||||
voice: { id: string; name: string; sample_url: string };
|
||||
est_seconds: number; // 28~31 정상
|
||||
}
|
||||
|
||||
export interface ClipReview {
|
||||
clip_url: string;
|
||||
frames_url: string; // 5시점 프레임 시트
|
||||
title_mae: number; // ≤4 통과
|
||||
gate_passed: boolean;
|
||||
gate_reason: string | null; // VLM 2단 사유
|
||||
retry_credits: number; // 재생성 시 재과금
|
||||
}
|
||||
|
||||
export interface FinalReview {
|
||||
video_url: string;
|
||||
proof_url: string;
|
||||
duration: number;
|
||||
checks: { key: string; label: string; ok: boolean }[];
|
||||
version: number;
|
||||
}
|
||||
|
||||
export type GateReview =
|
||||
| { gate: "fetch_confirm"; data: FetchReview }
|
||||
| { gate: "analysis_confirm"; data: AnalysisReview }
|
||||
| { gate: "narration_confirm"; data: NarrationReview }
|
||||
| { gate: "clip_confirm"; data: ClipReview }
|
||||
| { gate: "final_confirm"; data: FinalReview };
|
||||
|
||||
export interface PlayreelJob extends Omit<Job, "kind"> {
|
||||
kind: "playreel";
|
||||
source: { url: string; goods_id: string; slug: string };
|
||||
gate: GateKey | null;
|
||||
review: GateReview | null;
|
||||
credits_used: number;
|
||||
version: number;
|
||||
}
|
||||
|
||||
// ── URL 인식 ────────────────────────────────────────────────────────
|
||||
/** NOL티켓/인터파크 상품 URL에서 goodsId를 뽑는다. 못 뽑으면 null. */
|
||||
export function parseGoodsId(url: string): string | null {
|
||||
const s = url.trim();
|
||||
if (!s) return null;
|
||||
const m =
|
||||
// 인터파크 주소는 야놀자로 리다이렉트된다. 상품 번호는 양쪽이 같다
|
||||
s.match(/nol\.yanolja\.com\/ticket\/products\/(\d{5,})/i) ??
|
||||
s.match(/tickets\.interpark\.com\/goods\/(\d{5,})/i) ??
|
||||
s.match(/nol\.interpark\.com\/[^?]*?(\d{8,})/i) ??
|
||||
s.match(/[?&]goodsCode=(\d{5,})/i) ??
|
||||
s.match(/^(\d{8,})$/);
|
||||
return m ? m[1] : null;
|
||||
}
|
||||
|
||||
// ── 게이트 메타 (카드 헤더 문구) ───────────────────────────────────
|
||||
export const GATE_META: Record<GateKey, {
|
||||
step: number; name: string; title: string; why: string; next: string; eta: string; canBack: boolean;
|
||||
}> = {
|
||||
fetch_confirm: {
|
||||
step: 1, name: "수집 확인", title: "이 공연이 맞는지, 어떤 부분을 넣을지 확인해 주세요",
|
||||
why: "상세페이지에서 가져온 정보로 영상의 뼈대를 만듭니다. 캐스팅 스케줄은 항상 들어갑니다.",
|
||||
next: "포스터 화질 보정 · 요소 분석", eta: "약 2분", canBack: false,
|
||||
},
|
||||
analysis_confirm: {
|
||||
step: 2, name: "연출 확인", title: "포스터에서 무엇을 움직일지 정해주세요",
|
||||
why: "승인하면 영상 생성이 시작되고 되돌릴 수 없습니다. 제목·로고·인물은 원본 그대로 고정됩니다.",
|
||||
next: "Kling 3.0 영상 생성", eta: "약 5~8분", canBack: true,
|
||||
},
|
||||
narration_confirm: {
|
||||
step: 3, name: "나레이션 확인", title: "나레이션 문장과 목소리를 확인해 주세요",
|
||||
why: "이 문장이 그대로 읽힙니다. 캐스팅 스케줄 안내와 일시·CTA 문장은 꼭 필요합니다.",
|
||||
next: "음성 합성 · 배경음악 생성", eta: "약 3분", canBack: true,
|
||||
},
|
||||
clip_confirm: {
|
||||
step: 4, name: "클립 검수", title: "생성된 장면을 확인해 주세요",
|
||||
why: "제목이 깨지지 않았는지 자동 검사한 결과입니다. 다시 만들면 처음부터 다시 만듭니다.",
|
||||
next: "원본 글자 합성 · 상세페이지 스크롤 조립", eta: "약 5분", canBack: false,
|
||||
},
|
||||
final_confirm: {
|
||||
step: 5, name: "최종 검수", title: "완성된 예고편을 확인해 주세요",
|
||||
why: "승인하면 이 버전이 고정되어 아카이브에 저장됩니다. 이후 수정은 새 버전으로 만들어집니다.",
|
||||
next: "아카이브 저장 · 다운로드", eta: "즉시", canBack: false,
|
||||
},
|
||||
};
|
||||
|
||||
// ── 목 데이터 — 서버 없이 게이트 화면을 보기 위한 것 ─────────────────
|
||||
function stages(doneUpTo: number, running?: string): Record<string, StageState> {
|
||||
const out: Record<string, StageState> = {};
|
||||
PLAYREEL_STAGES.forEach((k, i) => {
|
||||
out[k] = {
|
||||
status: i < doneUpTo ? "done" : k === running ? "running" : "idle",
|
||||
started: null, ended: null,
|
||||
};
|
||||
});
|
||||
return out;
|
||||
}
|
||||
|
||||
const PH = (w: number, h: number, text: string) =>
|
||||
`data:image/svg+xml;utf8,${encodeURIComponent(
|
||||
`<svg xmlns="http://www.w3.org/2000/svg" width="${w}" height="${h}"><rect width="100%" height="100%" fill="#003538"/><text x="50%" y="50%" fill="#a6ffea" font-size="20" font-family="sans-serif" text-anchor="middle" dominant-baseline="middle">${text}</text></svg>`,
|
||||
)}`;
|
||||
|
||||
// 실물이 오는 모양. 심규선 콘서트 상세페이지 실측 19조각이다 — 라벨이 겹치고 대부분 공지다.
|
||||
// 이 자리에 6개짜리 깔끔한 목을 두었다가 게이트 ①이 같은 글자 열아홉 개만 뱉는 걸 놓쳤다.
|
||||
const MOCK_SECTIONS: DetailSection[] = ([
|
||||
["keyvisual", "키비주얼", 1108], ["synopsis", "작품 소개", 313], ["fragment", "조각", 244],
|
||||
["info", "관람 정보", 270], ["notice", "유의사항", 608], ["info", "관람 정보", 346],
|
||||
["fragment", "조각", 270], ["notice", "유의사항", 887], ["schedule", "캐스팅 스케줄", 582],
|
||||
["notice", "유의사항", 1149], ["notice", "유의사항", 968], ["info", "관람 정보", 383],
|
||||
["discount", "할인 안내", 473], ["fragment", "조각", 285], ["notice", "유의사항", 875],
|
||||
["notice", "유의사항", 1063], ["fragment", "조각", 152], ["notice", "유의사항", 1068],
|
||||
["info", "관람 정보", 371],
|
||||
] as const).map(([tag, label, height], i) => ({
|
||||
id: `detail_01_s${String(i + 1).padStart(2, "0")}`,
|
||||
tag, label, height, thumb_url: PH(180, 240, String(i + 1)),
|
||||
required: tag === "schedule" || undefined,
|
||||
selected: tag !== "fragment",
|
||||
}));
|
||||
|
||||
export function mockJob(gate: GateKey | "running" | "done" | "failed"): PlayreelJob {
|
||||
const base: PlayreelJob = {
|
||||
id: "mock", kind: "playreel", name: "뮤지컬 〈겨울왕국〉", status: "awaiting_review", stage: null,
|
||||
stages: stages(0), narration: null, metadata: null, error: null, artifacts: {}, created_at: 0,
|
||||
source: { url: "https://tickets.interpark.com/goods/25012345", goods_id: "25012345", slug: "frozen" },
|
||||
gate: null, review: null, credits_used: 0, version: 0, queue_size: 0,
|
||||
};
|
||||
switch (gate) {
|
||||
case "running":
|
||||
return { ...base, status: "running", stage: "i2v", stages: stages(8, "i2v"), credits_used: 16, gate: null };
|
||||
case "failed":
|
||||
return { ...base, status: "failed", stages: { ...stages(8), i2v: { status: "failed", started: null, ended: null } },
|
||||
error: { stage: "i2v", detail: "제목 훼손 게이트 실패 — t=7.5s 제목 'N' 가려짐 (VLM 2단)" }, credits_used: 16 };
|
||||
case "done":
|
||||
return { ...base, status: "done", stages: stages(12), credits_used: 16, version: 1,
|
||||
artifacts: { video: "", thumbnail: "" } };
|
||||
case "fetch_confirm":
|
||||
return { ...base, gate, stages: stages(2), review: { gate, data: {
|
||||
poster_url: PH(300, 420, "포스터 750px"), poster_width: 750,
|
||||
meta: { title: "뮤지컬 〈겨울왕국〉", date_text: "2026.11.25 ~ 2027.03.01", place: "샤롯데씨어터", cast: ["박혜나", "정선아", "이지혜"], genre: "뮤지컬" },
|
||||
sections: MOCK_SECTIONS,
|
||||
} } };
|
||||
case "analysis_confirm":
|
||||
return { ...base, gate, stages: stages(4), credits_used: 2, review: { gate, data: {
|
||||
grid_url: PH(300, 420, "5% 격자"),
|
||||
movable: [
|
||||
{ key: "light", label: "빛줄기·조명", on: true }, { key: "smoke", label: "안개·연기", on: true },
|
||||
{ key: "star", label: "별·눈 결정", on: true }, { key: "cloud", label: "구름", on: false },
|
||||
{ key: "flag", label: "천·망토", on: false }, { key: "crowd", label: "인물", on: false },
|
||||
],
|
||||
fixed: [
|
||||
{ key: "title", label: "제목", on: true }, { key: "logo", label: "로고·후원바", on: true },
|
||||
{ key: "figure", label: "인물 실루엣", on: true }, { key: "date", label: "일시·장소", on: true },
|
||||
],
|
||||
model: "kling3_0", ip_risk: true, has_qr: false,
|
||||
} } };
|
||||
case "narration_confirm":
|
||||
return { ...base, gate, stages: stages(6), credits_used: 16, review: { gate, data: {
|
||||
lines: [
|
||||
{ slot: "훅 1", text: "얼어붙은 왕국이 무대 위에서 깨어납니다." },
|
||||
{ slot: "훅 2", text: "전 세계를 사로잡은 그 이야기, 이제 눈앞에서." },
|
||||
{ slot: "수상·세계관", text: "토니상 노미네이트, 브로드웨이 오리지널 프로덕션." },
|
||||
{ slot: "넘버·캐스트", text: "'Let It Go'를 박혜나, 정선아, 이지혜가 부릅니다." },
|
||||
{ slot: "캐스팅 스케줄", text: "회차별 캐스팅은 상세페이지 캐스팅 스케줄에서 확인하세요." },
|
||||
{ slot: "일시", text: "11월 25일부터 샤롯데씨어터에서." },
|
||||
{ slot: "할인", text: "얼리버드 예매 시 최대 30% 할인." },
|
||||
{ slot: "CTA", text: "지금 예매 페이지에서 예매하세요." },
|
||||
],
|
||||
voice: { id: "tc_61e748d0", name: "Yena (여성 · 또렷한 안내톤)", sample_url: "" },
|
||||
est_seconds: 30.4,
|
||||
} } };
|
||||
case "clip_confirm":
|
||||
return { ...base, gate, stages: stages(9), credits_used: 16, review: { gate, data: {
|
||||
clip_url: "", frames_url: PH(720, 200, "5시점 프레임 시트"),
|
||||
title_mae: 3.04, gate_passed: true, gate_reason: null, retry_credits: 14,
|
||||
} } };
|
||||
case "final_confirm":
|
||||
return { ...base, gate, stages: stages(11), credits_used: 16, review: { gate, data: {
|
||||
video_url: "", proof_url: PH(720, 240, "proof 시트"), duration: 30.6, version: 1,
|
||||
checks: [
|
||||
{ key: "first", label: "첫 프레임 = 포스터 원본", ok: true },
|
||||
{ key: "title", label: "제목 온전 (MAE 3.0)", ok: true },
|
||||
{ key: "scroll", label: "상세페이지 풀프레임 스크롤", ok: true },
|
||||
{ key: "schedule", label: "캐스팅 스케줄 포함", ok: true },
|
||||
{ key: "band", label: "예매 안내 밴드 + QR", ok: true },
|
||||
{ key: "duck", label: "BGM 덕킹", ok: true },
|
||||
],
|
||||
} } };
|
||||
}
|
||||
}
|
||||
|
||||
// ── 폴링 훅 (api.ts useJob 과 같은 규약, mock 지원) ───────────────────
|
||||
const ACTIVE = new Set(["queued", "running"]);
|
||||
|
||||
export function usePlayreelJob(id: string | null, mock: string | null, intervalMs = 2500) {
|
||||
const [job, setJob] = useState<PlayreelJob | null>(null);
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
const timer = useRef<ReturnType<typeof setInterval> | null>(null);
|
||||
|
||||
const refresh = async () => {
|
||||
if (!id) return;
|
||||
if (mock) { await Promise.resolve(); setJob(mockJob(mock as GateKey)); return; }
|
||||
try {
|
||||
const j = await apiFetch<PlayreelJob>(`/api/playreel/jobs/${id}`);
|
||||
setJob(j);
|
||||
setError(null);
|
||||
if (!ACTIVE.has(j.status) && timer.current) { clearInterval(timer.current); timer.current = null; }
|
||||
} catch (e) {
|
||||
setError((e as Error).message);
|
||||
}
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (!id) return;
|
||||
// eslint-disable-next-line react-hooks/set-state-in-effect -- 폴링 시작: api.ts useJob 과 같은 규약
|
||||
void refresh();
|
||||
if (!mock) timer.current = setInterval(refresh, intervalMs);
|
||||
return () => { if (timer.current) clearInterval(timer.current); };
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [id, mock]);
|
||||
|
||||
return { job, error, refresh: () => {
|
||||
refresh();
|
||||
if (!mock && !timer.current) timer.current = setInterval(refresh, intervalMs);
|
||||
} };
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
"use client";
|
||||
|
||||
/**
|
||||
* 브라우저 로컬 환경설정 — 게이트 자동 승인.
|
||||
* 키 `playreel.autoApprove` = { fetch_confirm?: true, narration_confirm?: true }
|
||||
* 대상은 되돌릴 수 있는 게이트(①·③)뿐. ②·④·⑤는 비가역이라 제외.
|
||||
* 서버에는 저장하지 않는다(사용자별 계정 개념이 아직 없음). 서버 `approve` 자동 호출은 /playreel/[id] 에서.
|
||||
*/
|
||||
|
||||
import { useSyncExternalStore } from "react";
|
||||
import type { GateKey } from "@/lib/playreel";
|
||||
|
||||
export const AUTO_APPROVABLE = ["fetch_confirm", "narration_confirm"] as const satisfies readonly GateKey[];
|
||||
export type AutoApprovable = (typeof AUTO_APPROVABLE)[number];
|
||||
export type AutoApprovePrefs = Partial<Record<AutoApprovable, boolean>>;
|
||||
|
||||
const KEY = "playreel.autoApprove";
|
||||
const EVT = "playreel:prefs";
|
||||
const EMPTY: AutoApprovePrefs = {};
|
||||
let cache: { raw: string | null; value: AutoApprovePrefs } = { raw: null, value: EMPTY };
|
||||
|
||||
export function readAutoApprove(): AutoApprovePrefs {
|
||||
if (typeof window === "undefined") return EMPTY;
|
||||
let raw: string | null = null;
|
||||
try { raw = window.localStorage.getItem(KEY); } catch { return EMPTY; }
|
||||
if (raw === cache.raw) return cache.value; // useSyncExternalStore 는 참조 안정성이 필요
|
||||
let value: AutoApprovePrefs = EMPTY;
|
||||
try {
|
||||
const parsed = raw ? JSON.parse(raw) : {};
|
||||
value = Object.fromEntries(AUTO_APPROVABLE.filter((g) => parsed?.[g] === true).map((g) => [g, true]));
|
||||
} catch { /* 깨진 값은 비활성으로 */ }
|
||||
cache = { raw, value };
|
||||
return value;
|
||||
}
|
||||
|
||||
export function setAutoApprove(gate: AutoApprovable, on: boolean) {
|
||||
if (typeof window === "undefined") return;
|
||||
const next = { ...readAutoApprove() };
|
||||
if (on) next[gate] = true; else delete next[gate];
|
||||
try { window.localStorage.setItem(KEY, JSON.stringify(next)); } catch { /* 프라이빗 모드 등 — 이 세션만 유지 안 됨 */ }
|
||||
window.dispatchEvent(new Event(EVT));
|
||||
}
|
||||
|
||||
function subscribe(cb: () => void) {
|
||||
window.addEventListener(EVT, cb);
|
||||
window.addEventListener("storage", cb); // 다른 탭에서 바꾼 경우
|
||||
return () => { window.removeEventListener(EVT, cb); window.removeEventListener("storage", cb); };
|
||||
}
|
||||
|
||||
/** 렌더 중 읽는 훅. SSR·하이드레이션 첫 렌더는 항상 비활성(EMPTY)으로 맞춘다. */
|
||||
export function useAutoApprove(): AutoApprovePrefs {
|
||||
return useSyncExternalStore(subscribe, readAutoApprove, () => EMPTY);
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
import type { NextConfig } from "next";
|
||||
|
||||
// /api/* 프록시는 proxy.ts 에 있다 — 목적지를 런타임에 정해야 해서다
|
||||
const nextConfig: NextConfig = {
|
||||
experimental: {
|
||||
// 기본 10MB에서는 포스터 업로드가 잘려 백엔드가 깨진 multipart를 받는다.
|
||||
// 백엔드 상한이 30MB라 multipart 오버헤드만큼 여유를 둔다
|
||||
proxyClientMaxBodySize: "32mb",
|
||||
},
|
||||
};
|
||||
|
||||
export default nextConfig;
|
||||
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"name": "frontend",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "next dev",
|
||||
"build": "next build",
|
||||
"start": "next start",
|
||||
"lint": "eslint"
|
||||
},
|
||||
"dependencies": {
|
||||
"next": "16.3.0",
|
||||
"react": "19.2.8",
|
||||
"react-dom": "19.2.8"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tailwindcss/postcss": "^4",
|
||||
"@types/node": "^20",
|
||||
"@types/react": "^19",
|
||||
"@types/react-dom": "^19",
|
||||
"eslint": "^9",
|
||||
"eslint-config-next": "16.3.0",
|
||||
"tailwindcss": "^4",
|
||||
"typescript": "^5"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
const config = {
|
||||
plugins: {
|
||||
"@tailwindcss/postcss": {},
|
||||
},
|
||||
};
|
||||
|
||||
export default config;
|
||||
@@ -0,0 +1,22 @@
|
||||
import { NextResponse } from "next/server";
|
||||
import type { NextRequest } from "next/server";
|
||||
|
||||
/**
|
||||
* /api/* 를 백엔드로 넘긴다. CORS를 쓰지 않는 이유가 이것이다.
|
||||
*
|
||||
* next.config.ts 의 rewrites 로는 안 된다 — Next가 빌드할 때 목적지를 평가해
|
||||
* routes-manifest.json 에 박아버려서, 이미지를 구운 뒤에는 환경변수를 바꿔도 안 먹는다.
|
||||
* proxy 는 Node 런타임에서 요청마다 돌아 그때 환경변수를 읽는다.
|
||||
*
|
||||
* 컨테이너에서는 서비스명(http://backend:30101), 로컬에서는 localhost.
|
||||
*/
|
||||
const API_ORIGIN = process.env.API_ORIGIN ?? "http://localhost:30101";
|
||||
|
||||
export function proxy(request: NextRequest) {
|
||||
const { pathname, search } = request.nextUrl;
|
||||
return NextResponse.rewrite(new URL(pathname + search, API_ORIGIN));
|
||||
}
|
||||
|
||||
export const config = {
|
||||
matcher: "/api/:path*",
|
||||
};
|
||||
|
After Width: | Height: | Size: 24 KiB |
@@ -0,0 +1,3 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="149" height="22" viewBox="0 0 149 22" fill="none">
|
||||
<path d="M 8.85 21.647 L 11.455 18.754 L 26.244 18.754 L 19.042 3.985 L 4.064 21.654 L 0 21.654 L 17.329 1.378 C 17.902 0.712 18.755 0.072 19.804 0.072 C 20.852 0.072 21.484 0.647 21.836 1.378 L 31.864 21.654 L 8.857 21.654 L 8.85 21.647 Z M 34.052 21.647 L 36.371 8.374 L 39.829 8.374 L 38.018 18.754 L 47.761 18.754 C 53.153 18.754 57.724 14.867 57.724 9.837 C 57.724 5.983 54.84 3.279 50.489 3.279 L 37.289 3.279 L 40.018 0.353 L 50.997 0.353 C 57.151 0.353 61.182 3.985 61.182 9.269 C 61.182 16.18 54.833 21.654 47.253 21.654 L 34.052 21.654 L 34.052 21.647 Z M 75.848 22 C 67.499 22 63.279 19.198 63.279 13.116 C 63.279 4.298 68.645 0 79.716 0 C 88.065 0 92.285 2.77 92.285 8.851 C 92.285 17.669 86.951 22 75.848 22 Z M 79.215 2.9 C 70.072 2.9 66.776 5.735 66.776 12.77 C 66.776 17.388 69.824 19.106 76.363 19.106 C 85.473 19.106 88.801 16.239 88.801 9.204 C 88.801 4.586 85.753 2.9 79.215 2.9 Z M 92.865 21.647 L 93.978 15.344 C 94.642 11.523 97.599 9.681 102.418 9.681 L 111.685 9.681 C 115.586 9.681 117.175 8.341 117.175 6.049 C 117.175 3.945 115.078 3.279 111.079 3.279 L 97.338 3.279 L 100.1 0.353 L 113.013 0.353 C 118.438 0.353 120.568 2.358 120.568 5.35 C 120.568 9.262 118.028 12.228 111.555 12.228 L 102.288 12.228 C 99.37 12.228 97.716 13.149 97.306 15.318 L 96.733 18.754 L 118.601 18.754 L 115.872 21.647 L 92.865 21.647 Z M 121.688 21.504 C 121.141 21.504 120.73 21.184 120.73 20.667 C 120.73 19.955 121.349 19.55 122.039 19.55 C 122.606 19.55 123.029 19.851 123.029 20.367 C 123.029 21.079 122.411 21.504 121.681 21.504 L 121.688 21.504 Z M 129.769 21.347 L 131.222 19.727 L 139.479 19.727 L 135.455 11.477 L 127.086 21.347 L 124.82 21.347 L 134.497 10.02 C 134.816 9.648 135.292 9.289 135.878 9.289 C 136.464 9.289 136.816 9.609 137.011 10.02 L 142.611 21.347 L 129.763 21.347 L 129.769 21.347 Z M 144.975 21.347 L 147.085 9.452 L 149 9.452 L 146.89 21.347 L 144.975 21.347 Z" fill="currentColor" fill-rule="nonzero"></path>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.0 KiB |
@@ -0,0 +1 @@
|
||||
<svg fill="none" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M14.5 13.5V5.41a1 1 0 0 0-.3-.7L9.8.29A1 1 0 0 0 9.08 0H1.5v13.5A2.5 2.5 0 0 0 4 16h8a2.5 2.5 0 0 0 2.5-2.5m-1.5 0v-7H8v-5H3v12a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1M9.5 5V2.12L12.38 5zM5.13 5h-.62v1.25h2.12V5zm-.62 3h7.12v1.25H4.5zm.62 3h-.62v1.25h7.12V11z" clip-rule="evenodd" fill="#666" fill-rule="evenodd"/></svg>
|
||||
|
After Width: | Height: | Size: 391 B |
@@ -0,0 +1 @@
|
||||
<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><g clip-path="url(#a)"><path fill-rule="evenodd" clip-rule="evenodd" d="M10.27 14.1a6.5 6.5 0 0 0 3.67-3.45q-1.24.21-2.7.34-.31 1.83-.97 3.1M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16m.48-1.52a7 7 0 0 1-.96 0H7.5a4 4 0 0 1-.84-1.32q-.38-.89-.63-2.08a40 40 0 0 0 3.92 0q-.25 1.2-.63 2.08a4 4 0 0 1-.84 1.31zm2.94-4.76q1.66-.15 2.95-.43a7 7 0 0 0 0-2.58q-1.3-.27-2.95-.43a18 18 0 0 1 0 3.44m-1.27-3.54a17 17 0 0 1 0 3.64 39 39 0 0 1-4.3 0 17 17 0 0 1 0-3.64 39 39 0 0 1 4.3 0m1.1-1.17q1.45.13 2.69.34a6.5 6.5 0 0 0-3.67-3.44q.65 1.26.98 3.1M8.48 1.5l.01.02q.41.37.84 1.31.38.89.63 2.08a40 40 0 0 0-3.92 0q.25-1.2.63-2.08a4 4 0 0 1 .85-1.32 7 7 0 0 1 .96 0m-2.75.4a6.5 6.5 0 0 0-3.67 3.44 29 29 0 0 1 2.7-.34q.31-1.83.97-3.1M4.58 6.28q-1.66.16-2.95.43a7 7 0 0 0 0 2.58q1.3.27 2.95.43a18 18 0 0 1 0-3.44m.17 4.71q-1.45-.12-2.69-.34a6.5 6.5 0 0 0 3.67 3.44q-.65-1.27-.98-3.1" fill="#666"/></g><defs><clipPath id="a"><path fill="#fff" d="M0 0h16v16H0z"/></clipPath></defs></svg>
|
||||
|
After Width: | Height: | Size: 1.0 KiB |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 394 80"><path fill="#000" d="M262 0h68.5v12.7h-27.2v66.6h-13.6V12.7H262V0ZM149 0v12.7H94v20.4h44.3v12.6H94v21h55v12.6H80.5V0h68.7zm34.3 0h-17.8l63.8 79.4h17.9l-32-39.7 32-39.6h-17.9l-23 28.6-23-28.6zm18.3 56.7-9-11-27.1 33.7h17.8l18.3-22.7z"/><path fill="#000" d="M81 79.3 17 0H0v79.3h13.6V17l50.2 62.3H81Zm252.6-.4c-1 0-1.8-.4-2.5-1s-1.1-1.6-1.1-2.6.3-1.8 1-2.5 1.6-1 2.6-1 1.8.3 2.5 1a3.4 3.4 0 0 1 .6 4.3 3.7 3.7 0 0 1-3 1.8zm23.2-33.5h6v23.3c0 2.1-.4 4-1.3 5.5a9.1 9.1 0 0 1-3.8 3.5c-1.6.8-3.5 1.3-5.7 1.3-2 0-3.7-.4-5.3-1s-2.8-1.8-3.7-3.2c-.9-1.3-1.4-3-1.4-5h6c.1.8.3 1.6.7 2.2s1 1.2 1.6 1.5c.7.4 1.5.5 2.4.5 1 0 1.8-.2 2.4-.6a4 4 0 0 0 1.6-1.8c.3-.8.5-1.8.5-3V45.5zm30.9 9.1a4.4 4.4 0 0 0-2-3.3 7.5 7.5 0 0 0-4.3-1.1c-1.3 0-2.4.2-3.3.5-.9.4-1.6 1-2 1.6a3.5 3.5 0 0 0-.3 4c.3.5.7.9 1.3 1.2l1.8 1 2 .5 3.2.8c1.3.3 2.5.7 3.7 1.2a13 13 0 0 1 3.2 1.8 8.1 8.1 0 0 1 3 6.5c0 2-.5 3.7-1.5 5.1a10 10 0 0 1-4.4 3.5c-1.8.8-4.1 1.2-6.8 1.2-2.6 0-4.9-.4-6.8-1.2-2-.8-3.4-2-4.5-3.5a10 10 0 0 1-1.7-5.6h6a5 5 0 0 0 3.5 4.6c1 .4 2.2.6 3.4.6 1.3 0 2.5-.2 3.5-.6 1-.4 1.8-1 2.4-1.7a4 4 0 0 0 .8-2.4c0-.9-.2-1.6-.7-2.2a11 11 0 0 0-2.1-1.4l-3.2-1-3.8-1c-2.8-.7-5-1.7-6.6-3.2a7.2 7.2 0 0 1-2.4-5.7 8 8 0 0 1 1.7-5 10 10 0 0 1 4.3-3.5c2-.8 4-1.2 6.4-1.2 2.3 0 4.4.4 6.2 1.2 1.8.8 3.2 2 4.3 3.4 1 1.4 1.5 3 1.5 5h-5.8z"/></svg>
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
@@ -0,0 +1 @@
|
||||
<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1155 1000"><path d="m577.3 0 577.4 1000H0z" fill="#fff"/></svg>
|
||||
|
After Width: | Height: | Size: 128 B |
@@ -0,0 +1 @@
|
||||
<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" clip-rule="evenodd" d="M1.5 2.5h13v10a1 1 0 0 1-1 1h-11a1 1 0 0 1-1-1zM0 1h16v11.5a2.5 2.5 0 0 1-2.5 2.5h-11A2.5 2.5 0 0 1 0 12.5zm3.75 4.5a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5M7 4.75a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0m1.75.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5" fill="#666"/></svg>
|
||||
|
After Width: | Height: | Size: 385 B |
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2017",
|
||||
"lib": ["dom", "dom.iterable", "esnext"],
|
||||
"allowJs": true,
|
||||
"skipLibCheck": true,
|
||||
"strict": true,
|
||||
"noEmit": true,
|
||||
"esModuleInterop": true,
|
||||
"module": "esnext",
|
||||
"moduleResolution": "bundler",
|
||||
"resolveJsonModule": true,
|
||||
"isolatedModules": true,
|
||||
"jsx": "react-jsx",
|
||||
"incremental": true,
|
||||
"plugins": [
|
||||
{
|
||||
"name": "next"
|
||||
}
|
||||
],
|
||||
"paths": {
|
||||
"@/*": ["./*"]
|
||||
}
|
||||
},
|
||||
"include": [
|
||||
"next-env.d.ts",
|
||||
"**/*.ts",
|
||||
"**/*.tsx",
|
||||
".next/types/**/*.ts",
|
||||
".next/dev/types/**/*.ts",
|
||||
"**/*.mts"
|
||||
],
|
||||
"exclude": ["node_modules"]
|
||||
}
|
||||
@@ -147,6 +147,18 @@ aspect_ratio·sound는 실질 문제가 아닐 수 있다. Kling은 9:16을 지
|
||||
이 머신에 higgsfield CLI가 없다. `result_url`·`credits` 정규식 파싱은 원본을 옮겼을 뿐
|
||||
실제 CLI 출력으로 확인한 것이 아니다.
|
||||
|
||||
## 잡 테이블
|
||||
|
||||
### is_low_resolution 컬럼이 항상 False다
|
||||
|
||||
저해상 거절이 ⑥ i2v에 있어서, 거기까지 가면 detect·나레이션·TTS·BGM을 다 쓰고 터졌다.
|
||||
같은 기준(`MIN_LONG_EDGE_PX = 1000`)을 업로드 시점으로 옮겨 422로 막는다.
|
||||
|
||||
그래서 저해상 포스터는 잡이 아예 안 만들어지고 컬럼은 켜질 일이 없다.
|
||||
`routers/view.py`가 `low_res`로 내보내지만 프론트는 읽지 않는다.
|
||||
|
||||
`i2v.reject_low_resolution`은 서비스를 직접 부르는 경로를 위해 남겨뒀다.
|
||||
|
||||
## [Playreel] ③ upscale
|
||||
|
||||
### CLI가 파일 경로만 받아 임시 파일이 생긴다
|
||||
@@ -173,6 +185,24 @@ CLI를 계속 쓰는 한 없앨 수 없다. Higgsfield HTTP API로 가면 presig
|
||||
CLI `generate create` 응답에 크레딧 필드가 없어서(⑥ i2v에서 확인) 원본이 쓰던 값 2를
|
||||
그대로 상수로 뒀다. 요금이 바뀌면 조용히 틀린 값이 기록된다.
|
||||
|
||||
## [Playreel] ⑥ narration
|
||||
|
||||
### 나레이션이 템플릿이라 작품이 달라도 문장이 같다
|
||||
|
||||
7문장 중 다섯이 고정 문자열이고, 값이 들어가는 자리는 공연명·장르·출연진·기간·장소뿐이다.
|
||||
축제 3문장은 VLM이 포스터를 보고 쓰는데 여기는 `meta`를 문자열에 끼워 넣는다.
|
||||
|
||||
슬롯 이름과 내용도 어긋난다. `수상` 자리에 장르 문장이, `넘버` 자리에 출연진 문장이 들어간다.
|
||||
|
||||
원본도 같다. `playreel_pipeline._narration_lines`가 문장까지 동일하다.
|
||||
다만 원본에는 데모용 `FAKE_LINES`가 따로 있고 거기에는 "브로드웨이가 사랑한 무대가
|
||||
서울에 옵니다", "렛 잇 고, 그 순간을 눈앞에서" 같은 문장이 손으로 적혀 있다.
|
||||
프론트 목 데이터도 그 톤이다. 슬롯 이름이 `수상`·`넘버`인 이유가 그것이고,
|
||||
그 문장을 만들어내는 코드는 원본에도 없다.
|
||||
|
||||
재료는 이미 있다. ② split이 `synopsis`·`cast`·`still`·`discount` 태그로 잘라두고
|
||||
이미지도 blob에 있다. `extract_cast`가 cast 섹션을 VLM에 물어보는 방식을 그대로 쓸 수 있다.
|
||||
|
||||
## [Playreel] ⑪ compose
|
||||
|
||||
### 스크롤 범위를 사람이 정하는 경로가 없다
|
||||
|
||||