Compare commits
14
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8ab021dee4 | ||
|
|
70965d3eef | ||
|
|
0d2c4a4a19 | ||
|
|
a5b7529f17 | ||
|
|
c659f8c2f9 | ||
|
|
c06018d88c | ||
|
|
cd71f6d9d3 | ||
|
|
2e187ec193 | ||
|
|
c82a386b5b | ||
|
|
487d0f6d6a | ||
|
|
8ba5546f85 | ||
|
|
efc6e45070 | ||
|
|
40895207ee | ||
|
|
0ca2140b98 |
No files matched your search
@@ -0,0 +1,157 @@
|
||||
# 배포 요청서 — castad 프론트엔드 `feature-ssulbox-ado2-ds`
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| **요청일** | 2026-08-20 |
|
||||
| **대상 저장소** | `gitea.o2o.kr/castad/o2o-castad-frontend` |
|
||||
| **브랜치** | `feature-ssulbox-ado2-ds` (브랜치 최신 커밋을 그대로 배포) |
|
||||
| **코드 커밋** | `0ca2140` — 이 문서는 그 위에 문서만 얹은 커밋입니다 |
|
||||
| **대상 환경** | dev-ssul.castad.net |
|
||||
| **연관 저장소** | `gitea.o2o.kr/castad/o2o-ado2-poster-to-video` (신규 연동 대상) |
|
||||
|
||||
---
|
||||
|
||||
## 0. 한 장 요약
|
||||
|
||||
이번 브랜치는 **두 덩어리**입니다. 서로 독립적이라 **나눠서 배포할 수 있습니다.**
|
||||
|
||||
| 덩어리 | 내용 | 추가 인프라 | 배포 난이도 |
|
||||
|---|---|---|---|
|
||||
| **A. DS 통일 + 네비게이션** | 썰박스 디자인 시스템 통일, 진입 화면 탭 개편, 레이아웃 버그 수정 | **없음** | 기존과 동일 |
|
||||
| **B. 포스터 파이프라인** | 무빙 포스터(F1), 포스터 스타일링(F2) 탭 | **P2V 서버 신규 배포 필요** | 선행조건 5개 |
|
||||
|
||||
**권장: A를 먼저 배포하고, B는 P2V 서버가 준비된 뒤 여는 2단계 진행.**
|
||||
A만 배포해도 화면은 깨지지 않습니다. 포스터 탭 2개만 "접근 키 입력" 화면이나 연결 실패로
|
||||
떨어지고, ADO2·썰박스 탭은 평소대로 동작합니다.
|
||||
|
||||
---
|
||||
|
||||
## 1. A안 — DS·네비게이션만 배포 (지금 바로 가능)
|
||||
|
||||
### 필요 작업
|
||||
```bash
|
||||
git fetch origin
|
||||
git checkout feature-ssulbox-ado2-ds # 0ca2140
|
||||
npm ci
|
||||
npm run build
|
||||
```
|
||||
|
||||
### 환경변수
|
||||
| 변수 | 값 | 비고 |
|
||||
|---|---|---|
|
||||
| `VITE_API_URL` | 기존 값 유지 | castad 백엔드 |
|
||||
| `VITE_P2V_URL` | **설정하지 않음** | 미설정 시 포스터 탭만 비활성 상태로 남음 |
|
||||
|
||||
### 검증
|
||||
1. 진입 화면에 탭 4개(ADO2 / 썰박스 / 무빙 포스터 / 포스터 스타일링)가 아이콘 타일로 표시
|
||||
2. 썰박스 탭 — 시나리오 카드에 이모지·시나리오별 색이 없고 선택 시 민트 테두리
|
||||
3. **모바일(375px)에서 상단 ADO2 로고가 잘리지 않을 것** ← 이번에 고친 버그
|
||||
4. ADO2 탭 기존 플로우(URL 입력 → 브랜드 분석) 정상
|
||||
|
||||
---
|
||||
|
||||
## 2. B안 — 포스터 파이프라인까지 배포
|
||||
|
||||
### 2-1. 선행조건 (P2V 서버 측)
|
||||
|
||||
P2V 저장소의 `product/DEPLOY.md`가 원본 문서입니다. 아래는 **castad 연동에 필요한 것만** 추린 것입니다.
|
||||
|
||||
| # | 항목 | 상태 | 담당 |
|
||||
|---|---|---|---|
|
||||
| 1 | P2V 서버(`:8010`) 배포 | **미배포** | Dev |
|
||||
| 2 | `SUNO_CALLBACK_URL` — Suno가 결과를 POST할 **공개 주소** | 도메인 확정 필요 | Dev |
|
||||
| 3 | Higgsfield CLI 토큰 — 머신에서 **사람이 1회 로그인** | 자동화 불가 | 담당자 |
|
||||
| 4 | **P2V를 HTTPS로 서빙** | 미확인 | Dev |
|
||||
| 5 | F2 템플릿 이미지 파일 별도 전달 | 저장소에 없음 | 요청자 |
|
||||
|
||||
**4번이 이번에 새로 확인된 항목입니다.** dev-ssul.castad.net은 HTTPS인데 P2V가 HTTP면
|
||||
브라우저가 mixed content로 **전부 차단**합니다. P2V 앞에 리버스 프록시로 TLS를 붙여야 합니다.
|
||||
|
||||
**5번 주의:** P2V 저장소는 `templates/*.jpg`를 gitignore합니다(영화 포스터 = 저작권).
|
||||
`templates.json`(메타데이터)만 커밋돼 있어 **클론 직후 F2는 썸네일이 전부 깨집니다.**
|
||||
compose가 `./server/templates`를 호스트 바인드 마운트하므로, 이미지 21개를 서버에 직접
|
||||
넣어야 합니다. F2를 이관 범위에서 빼는 것도 선택지입니다(F1은 영향 없음).
|
||||
|
||||
### 2-2. P2V 서버 환경변수
|
||||
|
||||
`product/.env.example`을 `.env`로 복사해 채웁니다.
|
||||
|
||||
| 변수 | 필수 | 설명 |
|
||||
|---|---|---|
|
||||
| `CHATGPT_API_KEY` | ✅ | 영역검출·나레이션·모션선정·TTS·F2 |
|
||||
| `SUNO_API_KEY` | ✅ | BGM 생성 |
|
||||
| `SUNO_CALLBACK_URL` | ✅ | Suno 결과 수신용 **공개** URL. 없으면 BGM 단계에서 죽음 |
|
||||
| `P2V_ACCESS_KEY` | ✅ | 팀 공용 키 1개. **비우면 무인증** — 배포에서는 반드시 설정 |
|
||||
| `P2V_ALLOWED_ORIGINS` | ✅ | **`https://dev-ssul.castad.net` 추가 필수.** 없으면 CORS 차단 |
|
||||
| `P2V_QUEUE_PATH` | compose가 지정 | 큐를 볼륨 위로. 이미지 레이어에 두면 재배포 때 소실 |
|
||||
|
||||
Higgsfield는 환경변수가 아니라 **CLI 토큰 인증**입니다:
|
||||
```bash
|
||||
higgsfield auth login && higgsfield workspace set
|
||||
# 생성된 ~/.config/higgsfield/{credentials,config}.json 을 p2v-higgsfield 볼륨에 주입
|
||||
# CLI가 토큰을 자동 갱신하며 파일을 다시 쓰므로 :ro 마운트 금지
|
||||
```
|
||||
|
||||
### 2-3. castad 프론트엔드 빌드
|
||||
|
||||
```bash
|
||||
VITE_P2V_URL="https://<P2V 공개 도메인>" npm run build
|
||||
```
|
||||
|
||||
Vite는 **빌드 시점에** 값을 산출물에 박습니다(런타임 주입 아님). 검증했습니다 —
|
||||
값을 넣으면 번들에 그대로 들어가고 기본값 `localhost:8010`은 남지 않습니다.
|
||||
|
||||
### 2-4. 알아둘 제약
|
||||
|
||||
- **api를 스케일아웃하면 안 됩니다.** 인메모리 큐 + 파일 상태(`data/jobs.json`) 구조라
|
||||
인스턴스가 늘면 큐가 깨집니다. compose에도 명시돼 있습니다.
|
||||
- **처리 시간 1건 4~6분** (Suno ~2분 + veo ~3분).
|
||||
- **렌더 비용** veo 22크레딧/편(≈$1.12) + OpenAI·Suno 소액.
|
||||
- **인증이 단일 팀 키**라 사용자별 크레딧 차감이 없습니다. 현재는 내부 시연 범위이고,
|
||||
대외 공개 시 castad 백엔드에 `/p2v/*` 프록시를 세워 카카오 인증·크레딧을 얹는 것이
|
||||
다음 수순입니다. 프론트에서 갈아끼울 지점은 `src/utils/p2vApi.ts` 한 파일입니다.
|
||||
|
||||
### 2-5. 검증 절차
|
||||
|
||||
```bash
|
||||
# 1) 서버 헬스체크 (인증 없이 열려 있는 유일한 경로)
|
||||
curl -i https://<P2V 도메인>/api/health # → 200
|
||||
|
||||
# 2) 인증 게이트 동작
|
||||
curl -i https://<P2V 도메인>/api/f2/templates # → 401
|
||||
curl -i -H "X-P2V-Key: <키>" https://<P2V 도메인>/api/f2/templates # → 200 + JSON
|
||||
```
|
||||
|
||||
브라우저에서:
|
||||
|
||||
| # | 확인 항목 | 기대 결과 |
|
||||
|---|---|---|
|
||||
| 1 | 무빙 포스터 탭 첫 진입 | 접근 키 입력창 → 키 입력 후 업로드 화면 |
|
||||
| 2 | 포스터 업로드 | 5단계 스텝퍼가 "분석"으로 진행, 진행바·스테이지 라벨 표시 |
|
||||
| 3 | 1~2분 후 | **검수 화면** — 나레이션 3문장, 모션 칩, 메타태그, 우측 분석 이미지 |
|
||||
| 4 | 승인 | "생성" 단계로 넘어가고 4~6분 뒤 영상 재생 + MP4 다운로드 |
|
||||
| 5 | 포스터 스타일링 탭 | 템플릿 썸네일 표시 (**깨지면 5번 선행조건 미이행**) |
|
||||
| 6 | 모바일(375px) 검수 화면 | 포스터가 위, 승인 버튼이 하단 탭바 위에 고정 |
|
||||
|
||||
**F1은 검수 게이트에서 멈춥니다.** 승인 전까지 TTS·BGM·렌더가 시작되지 않으므로,
|
||||
3번까지만 확인하면 유료 API를 거의 쓰지 않고 연동을 검증할 수 있습니다.
|
||||
|
||||
---
|
||||
|
||||
## 3. 롤백
|
||||
|
||||
프론트엔드는 이전 커밋으로 되돌려 재빌드하면 끝입니다. P2V는 castad와 별도 서비스라
|
||||
내려도 castad 본체에 영향이 없습니다 — 포스터 탭만 연결 실패 상태가 됩니다.
|
||||
|
||||
---
|
||||
|
||||
## 4. 이번 브랜치에서 고친 기존 버그
|
||||
|
||||
배포 후 확인해 두면 좋은 항목입니다. 모두 포스터 기능과 무관하게 A안에 포함됩니다.
|
||||
|
||||
1. **진입 화면 세로 잘림** — `justify-content: center` + `overflow: hidden` 조합이라
|
||||
콘텐츠가 뷰포트보다 길면 위로 넘친 부분에 스크롤로도 닿을 수 없었습니다.
|
||||
자식의 `margin: auto 0` 중앙정렬로 교체했습니다.
|
||||
2. **한글 단어 중간 줄바꿈** — `word-break: keep-all` 적용.
|
||||
3. **입력·안내·제출 박스 높이 불일치**(46/38/48) — 48px로 통일.
|
||||
4. **카피 어휘** — 가게→업체, 크롤링→수집.
|
||||
@@ -51,6 +51,28 @@ npm run build
|
||||
npm run preview
|
||||
```
|
||||
|
||||
## 환경 변수
|
||||
|
||||
| 변수 | 기본값 | 설명 |
|
||||
|---|---|---|
|
||||
| `VITE_API_URL` | `http://40.82.133.44` | castad 백엔드 (ADO2·썰박스) |
|
||||
| `VITE_P2V_URL` | `http://localhost:8010` | Poster to Video 서버 (포스터 영상·스타일링) |
|
||||
|
||||
### 포스터 파이프라인 (Poster to Video)
|
||||
|
||||
'포스터 영상'(F1)·'포스터 스타일'(F2) 탭은 castad 백엔드가 아니라 **별도 P2V 서버**를 직접
|
||||
호출한다(`src/utils/p2vApi.ts`). 붙이려면 세 가지가 필요하다:
|
||||
|
||||
1. P2V 서버 기동 — 저장소는 `o2o-ado2-poster-to-video`, 기본 포트 8010
|
||||
2. 서버의 `P2V_ALLOWED_ORIGINS` 에 이 프론트 오리진 추가 (예: `http://localhost:3000`)
|
||||
3. 첫 진입 시 화면에 뜨는 입력창에 서버의 `P2V_ACCESS_KEY` 입력 (브라우저에 저장된다)
|
||||
|
||||
인증이 단일 팀 키라 **내부 시연 범위**다. 대외 공개 시에는 castad 백엔드에 `/p2v/*` 프록시를
|
||||
세워 카카오 인증·크레딧 차감을 얹고, 프론트는 `p2vApi.ts` 한 파일만 그쪽으로 돌리면 된다.
|
||||
|
||||
포스터 스타일링(F2)은 영화 포스터 레퍼런스가 저작권 자산이라 **결과물의 외부 공개·상업 사용을
|
||||
금한다**(퍼블릭 도메인 명화 제외). 화면 상단과 템플릿 배지로 등급을 표시한다.
|
||||
|
||||
## Docker 실행
|
||||
|
||||
```bash
|
||||
|
||||
+71
-5
@@ -4,15 +4,76 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
||||
<title>ADO2</title>
|
||||
<title>ADO2 - AI 홍보 영상·썰박스·무빙 포스터 제작</title>
|
||||
<!-- ① 페이지 설명 -->
|
||||
<meta name="description" content="ADO2는 ㈜에이아이오투오의 AI 기반 마케팅 자동화 플랫폼입니다. 콘텐츠 제작부터 채널 배포까지 자동으로 처리합니다." />
|
||||
<meta name="description" content="ADO2에서 매장 정보로 홍보 음악과 영상을 만들고, 썰박스로 스토리형 숏폼을, 포스터 한 장으로 무빙 포스터를 제작하세요. 완성된 콘텐츠를 공유하고 연결된 YouTube 채널에 업로드할 수 있습니다." />
|
||||
<link rel="canonical" href="https://ado2.o2osolution.ai/" />
|
||||
<!-- ② Open Graph 제목 -->
|
||||
<meta property="og:title" content="ADO2 - AI 마케팅 자동화 플랫폼" />
|
||||
<meta property="og:title" content="ADO2 - AI 홍보 영상·썰박스·무빙 포스터 제작" />
|
||||
<!-- ③ Open Graph 설명 -->
|
||||
<meta property="og:description" content="ADO2는 ㈜에이아이오투오의 AI 기반 마케팅 자동화 플랫폼입니다. 콘텐츠 제작부터 채널 배포까지 자동으로 처리합니다." />
|
||||
<meta property="og:url" content="https://ado2.o2osolution.ai" />
|
||||
<meta property="og:description" content="매장 홍보 영상, 스토리형 숏폼 썰박스, 포스터를 움직이는 무빙 포스터까지. AI 콘텐츠 제작부터 공유와 YouTube 업로드까지 ADO2에서 시작하세요." />
|
||||
<meta property="og:url" content="https://ado2.o2osolution.ai/" />
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:site_name" content="ADO2" />
|
||||
<meta property="og:locale" content="ko_KR" />
|
||||
<meta property="og:image" content="https://ado2.o2osolution.ai/assets/images/ado2_image.png" />
|
||||
<meta property="og:image:width" content="385" />
|
||||
<meta property="og:image:height" content="385" />
|
||||
<meta property="og:image:alt" content="ADO2 로고" />
|
||||
<meta name="twitter:card" content="summary" />
|
||||
<meta name="twitter:title" content="ADO2 - AI 홍보 영상·썰박스·무빙 포스터 제작" />
|
||||
<meta name="twitter:description" content="매장 정보로 홍보 영상을, 역사·신화 이야기로 썰박스를, 포스터 한 장으로 무빙 포스터를 만드세요. 완성한 콘텐츠는 공유하거나 YouTube에 업로드할 수 있습니다." />
|
||||
<meta name="twitter:image" content="https://ado2.o2osolution.ai/assets/images/ado2_image.png" />
|
||||
<!-- ④ 구조화 데이터 (검색엔진·AI 답변 엔진용) -->
|
||||
<script type="application/ld+json">
|
||||
{
|
||||
"@context": "https://schema.org",
|
||||
"@graph": [
|
||||
{
|
||||
"@type": "Organization",
|
||||
"@id": "https://ado2.o2osolution.ai/#organization",
|
||||
"name": "㈜에이아이오투오",
|
||||
"url": "https://ado2.o2osolution.ai/",
|
||||
"logo": "https://ado2.o2osolution.ai/assets/images/ado2_image.png",
|
||||
"email": "o2oteam@o2o.kr",
|
||||
"telephone": "+82-70-4260-8310",
|
||||
"address": {
|
||||
"@type": "PostalAddress",
|
||||
"streetAddress": "옥산로 111, 5층 유니콘랩 대구 A05호",
|
||||
"addressLocality": "북구",
|
||||
"addressRegion": "대구광역시",
|
||||
"addressCountry": "KR"
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "WebSite",
|
||||
"@id": "https://ado2.o2osolution.ai/#website",
|
||||
"name": "ADO2",
|
||||
"url": "https://ado2.o2osolution.ai/",
|
||||
"inLanguage": "ko-KR",
|
||||
"publisher": { "@id": "https://ado2.o2osolution.ai/#organization" }
|
||||
},
|
||||
{
|
||||
"@type": "SoftwareApplication",
|
||||
"name": "ADO2",
|
||||
"url": "https://ado2.o2osolution.ai/",
|
||||
"applicationCategory": "BusinessApplication",
|
||||
"operatingSystem": "Web",
|
||||
"inLanguage": "ko-KR",
|
||||
"description": "매장 정보를 분석해 홍보 음악과 영상을 만들고, 역사·신화 이야기에 업체 정보를 담은 썰박스와 포스터 이미지 기반 무빙 포스터를 제작하는 AI 마케팅 플랫폼입니다. 완성한 콘텐츠를 다운로드·공유하거나 연결된 YouTube 채널에 업로드할 수 있습니다.",
|
||||
"featureList": [
|
||||
"비즈니스 핵심 정보 분석 (홈페이지, 네이버 지도, 블로그 URL)",
|
||||
"홍보 콘텐츠 자동 제작 (음악, 자막, 영상)",
|
||||
"역사·신화 이야기에 업체 정보를 담은 스토리형 숏폼 썰박스",
|
||||
"포스터 이미지에 움직임·나레이션·음악을 더하는 무빙 포스터",
|
||||
"완성 콘텐츠 공개 열람·링크 공유·좋아요·댓글",
|
||||
"YouTube 채널 연결·업로드·예약 게시"
|
||||
],
|
||||
"publisher": { "@id": "https://ado2.o2osolution.ai/#organization" }
|
||||
}
|
||||
]
|
||||
}
|
||||
</script>
|
||||
<link rel="icon" type="image/svg+xml" href="/favicon_32.svg" sizes="32x32">
|
||||
<link rel="icon" type="image/svg+xml" href="/favicon_48.svg" sizes="48x48">
|
||||
<!-- Meta Pixel Code -->
|
||||
@@ -50,6 +111,7 @@
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<script src="https://t1.kakaocdn.net/kakao_js_sdk/2.7.4/kakao.min.js" crossorigin="anonymous"></script>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500;700&family=Playfair+Display:ital,wght@0,700;1,700&display=swap" rel="stylesheet">
|
||||
@@ -182,6 +244,10 @@
|
||||
src="https://www.facebook.com/tr?id=1572679738203392&ev=PageView&noscript=1"
|
||||
/></noscript>
|
||||
<div id="root"></div>
|
||||
<noscript>
|
||||
<p>ADO2는 매장 홍보 영상, 스토리형 숏폼 썰박스, 무빙 포스터를 만드는 AI 마케팅 플랫폼입니다. 제작 화면을 이용하려면 JavaScript를 활성화해 주세요.</p>
|
||||
<a href="/faq.html">ADO2 홍보 영상·썰박스·무빙 포스터 FAQ</a>
|
||||
</noscript>
|
||||
<script type="module" src="/src/index.tsx"></script>
|
||||
</body>
|
||||
</html>
|
||||
+464
@@ -0,0 +1,464 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="ko">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>AI 홍보 영상·썰박스·무빙 포스터 FAQ | ADO2</title>
|
||||
<meta name="description" content="ADO2의 매장 홍보 영상, 스토리형 숏폼 썰박스, 무빙 포스터 제작 방법을 안내합니다. 업종별 활용 팁과 생성 비용, 공개 열람·공유, YouTube 업로드까지 확인하세요." />
|
||||
<link rel="canonical" href="https://ado2.o2osolution.ai/faq.html" />
|
||||
<meta property="og:title" content="AI 홍보 영상·썰박스·무빙 포스터 FAQ | ADO2" />
|
||||
<meta property="og:description" content="매장 홍보 영상, 썰박스, 무빙 포스터 중 어떤 방식으로 만들까요? 제작 방법과 비용, 공유·YouTube 업로드를 안내합니다." />
|
||||
<meta property="og:url" content="https://ado2.o2osolution.ai/faq.html" />
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:site_name" content="ADO2" />
|
||||
<meta property="og:locale" content="ko_KR" />
|
||||
<meta property="og:image" content="https://ado2.o2osolution.ai/assets/images/ado2_image.png" />
|
||||
<meta property="og:image:alt" content="ADO2 로고" />
|
||||
<meta name="twitter:card" content="summary" />
|
||||
<meta name="twitter:title" content="AI 홍보 영상·썰박스·무빙 포스터 FAQ | ADO2" />
|
||||
<meta name="twitter:description" content="ADO2의 콘텐츠 제작 방법과 생성 비용, 공유·YouTube 업로드 안내를 확인하세요." />
|
||||
<meta name="twitter:image" content="https://ado2.o2osolution.ai/assets/images/ado2_image.png" />
|
||||
<script type="application/ld+json">
|
||||
{
|
||||
"@context": "https://schema.org",
|
||||
"@type": "FAQPage",
|
||||
"url": "https://ado2.o2osolution.ai/faq.html",
|
||||
"inLanguage": "ko-KR",
|
||||
"dateModified": "2026-10-16",
|
||||
"publisher": {
|
||||
"@type": "Organization",
|
||||
"name": "㈜에이아이오투오",
|
||||
"url": "https://ado2.o2osolution.ai/"
|
||||
},
|
||||
"mainEntity": [
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "ADO2에서 어떤 종류의 콘텐츠를 만들 수 있나요?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "새 프로젝트 만들기에서 ADO2, 썰박스, 무빙 포스터 중 선택할 수 있습니다. ADO2는 매장 정보를 분석해 가사·음악·홍보 영상을 만들고, 썰박스는 역사·신화 이야기에 업체 셀링포인트를 담은 스토리형 숏폼을 만듭니다. 무빙 포스터는 포스터 이미지 한 장에 움직임·나레이션·음악을 더해 세로형 영상으로 만듭니다."
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "썰박스는 무엇이고 어떻게 만드나요?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "썰박스는 역사·신화 이야기에 업체의 특징을 담아 만드는 숏폼 콘텐츠입니다. 조선왕조, 삼국지, 그리스 신화, 오디세이 중 시나리오를 선택하고 업체명이나 네이버 지도 링크로 업체를 찾은 뒤 생성합니다. AI가 대본·이미지·나레이션과 영상을 만들며, 화면에서는 약 5~6분 소요로 안내합니다. 실제 시간은 처리 상황에 따라 달라질 수 있습니다."
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "포스터 한 장으로 움직이는 홍보 영상을 만들 수 있나요?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "네, 무빙 포스터의 이미지로 시작하기에서 포스터를 올리면 불꽃·물결·조명 같은 요소에 움직임을 더하고 제목·일시 나레이션과 음악을 넣은 8~15초 세로형 숏폼을 만들 수 있습니다. 분석 뒤 검수 화면에서 나레이션, 움직일 요소, 행사 정보를 확인하고 생성합니다."
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "무빙 포스터에 필요한 파일과 생성 비용은 어떻게 되나요?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "JPG, PNG, WEBP, GIF 형식의 포스터 이미지 1장이 필요합니다. 행사 이름은 직접 입력하거나 자동 추출할 수 있습니다. 현재 생성 화면에는 3크레딧이 안내되며, 약 3분 소요로 소개됩니다. 생성 시간은 작업량과 외부 서비스 처리 상황에 따라 달라질 수 있으므로 시작 전 화면 안내를 확인하세요."
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "공연상품페이지 주소로 예고편을 만드는 기능도 사용할 수 있나요?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "공연상품페이지 주소로 줄거리·캐스팅·일정과 예매 안내를 담은 30초 예고편을 만드는 롱컷은 현재 준비 중입니다. 시작 화면에 공연상품페이지로 시작하기가 표시되지만 생성 버튼은 비활성화되어 있습니다. 현재는 이미지로 시작하기를 통해 무빙 포스터를 제작할 수 있습니다."
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "썰박스 생성 비용과 실패 시 크레딧 처리는 어떻게 되나요?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "현재 썰박스 생성 화면에는 영상 1편당 1크레딧이 안내됩니다. 썰박스와 무빙 포스터는 생성 요청 시 크레딧이 차감되고 생성에 실패하면 사용한 크레딧이 환불됩니다. 보유 크레딧은 내 정보에서 확인하고, 부족하면 서비스에서 충전을 요청할 수 있습니다. 실제 요청 전 화면의 비용 안내를 확인하세요."
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "공유받은 썰박스나 무빙 포스터를 로그인 없이 볼 수 있나요?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "네, 공개된 썰박스와 무빙 포스터는 공유 링크의 상세 화면에서 로그인 없이 재생할 수 있습니다. 좋아요를 누르거나 댓글을 작성하려면 로그인이 필요합니다. 콘텐츠가 삭제되었거나 공개 가능한 상태가 아니면 상세 화면에서 불러오지 못할 수 있습니다."
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "썰박스와 무빙 포스터도 YouTube에 업로드할 수 있나요?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "네, ADO2 홍보 영상뿐 아니라 완성된 썰박스와 무빙 포스터도 연결된 YouTube 채널에 업로드하거나 예약 게시할 수 있습니다. 업로드 전에 채널을 연결하고 제목·설명·태그와 게시 설정을 확인하세요. 완성한 영상 파일을 다운로드해 직접 활용할 수도 있습니다."
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "가게 홍보 영상은 어떻게 만드나요?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "가게 홍보 영상은 보통 매장의 강점 정리, 사진과 영상 소재 준비, 음악과 자막을 넣은 편집, 유튜브 쇼츠나 인스타그램 릴스 같은 채널 업로드 순서로 만듭니다. 이 중 편집과 업로드가 가장 시간이 많이 드는 단계라, 인력이 부족한 소상공인은 AI 영상 제작 도구로 자동화하는 경우가 많습니다. ADO2는 네이버 지도 URL이나 업체명만 입력하면 매장 분석부터 음악, 자막, 영상 제작, YouTube 업로드까지 자동으로 진행합니다."
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "영상 편집을 할 줄 몰라도 매장 홍보 영상을 만들 수 있나요?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "네, 만들 수 있습니다. 최근에는 사진만 넣으면 장면 구성, 자막, 음악, 장면 전환을 AI가 자동으로 처리하는 도구가 있어 편집 프로그램을 배우지 않아도 됩니다. ADO2를 사용하면 매장 정보를 입력하고 이미지와 음악을 고르는 것만으로 홍보 영상이 완성되며, 별도 프로그램 설치 없이 웹에서 바로 이용할 수 있습니다."
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "소상공인 홍보 영상은 왜 세로형 숏폼으로 만드는 게 좋나요?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "유튜브 쇼츠, 인스타그램 릴스, 틱톡 같은 숏폼 채널은 스마트폰 전체 화면에 맞는 9:16 세로형 영상을 기본으로 합니다. 짧은 세로 영상은 구독자가 아닌 사람에게도 추천 피드를 통해 노출될 수 있어, 광고비를 많이 쓰기 어려운 지역 매장이 인지도를 높이는 데 유리합니다. ADO2는 YouTube 쇼츠용 세로형 영상과 일반 가로형 영상 중에서 선택해 제작할 수 있습니다."
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "홍보 영상에 쓸 매장 사진은 어떻게 준비하나요?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "홍보 영상용 사진은 외관과 간판, 내부 전경, 대표 메뉴나 서비스, 소품 같은 디테일, 실제 이용 장면처럼 다양한 장면을 고르게 준비하는 것이 좋습니다. 자연광이 드는 밝은 시간에 수평을 맞춰 찍고, 비슷한 사진 여러 장보다 서로 다른 장면을 담은 사진이 영상을 지루하지 않게 만듭니다. ADO2는 30장 이상의 이미지를 권장하며, 네이버 지도에 등록된 매장 사진을 불러와 함께 사용할 수 있습니다."
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "가게 홍보 영상에 넣을 음악은 어떻게 고르나요?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "홍보 영상 음악은 매장 분위기와 주요 고객층에 맞추는 것이 기본입니다. 인기 가요나 유명 곡은 저작권 때문에 상업용 홍보 영상에 자유롭게 쓰기 어려우므로, 이용 조건이 명확한 음원을 사용해야 합니다. ADO2는 매장 분석 결과를 바탕으로 AI가 새로 작사하고 작곡한 음악을 만들어 영상에 넣어 줍니다."
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "AI로 가게 광고 음악이나 로고송을 만들 수 있나요?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "네, AI 음악 생성 기술로 매장 이름과 특징을 가사에 담은 광고 음악이나 로고송을 만들 수 있습니다. 가사에 매장 이름, 지역, 대표 메뉴나 서비스를 넣으면 고객이 기억하기 쉬운 노래가 됩니다. ADO2는 매장 분석에서 찾은 셀링 포인트와 키워드로 가사를 쓰고 음악을 만들며, 가사를 직접 고친 뒤 다시 생성할 수도 있습니다."
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "매장 홍보 영상의 제목과 태그는 어떻게 쓰나요?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "홍보 영상 제목과 태그에는 사람들이 실제로 검색하는 지역명, 업종, 특징을 함께 넣는 것이 좋습니다. 예를 들어 '강릉 오션뷰 펜션'이나 '성수동 디저트 카페'처럼 지역과 업종을 묶은 표현이 검색에 잘 걸립니다. ADO2는 YouTube에 업로드할 때 매장 정보를 바탕으로 제목, 설명, 태그를 AI가 자동으로 작성합니다."
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "홍보 영상은 얼마나 자주 올리는 게 좋나요?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "숏폼 채널에서는 한 번에 많이 올리는 것보다 일정한 간격으로 꾸준히 올리는 것이 노출과 채널 관리에 유리합니다. 계절 메뉴, 이벤트, 성수기처럼 시기에 맞는 영상을 미리 만들어 두고 정해진 날짜에 올리는 방식이 운영 부담을 줄여 줍니다. ADO2는 원하는 날짜와 시간에 YouTube 예약 업로드를 걸어 두고 콘텐츠 캘린더에서 일정을 관리할 수 있습니다."
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "네이버 지도에 등록된 매장 정보로 홍보 영상을 만들 수 있나요?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "네, 네이버 지도나 네이버 플레이스에 등록된 매장 이름, 주소, 업종, 사진 같은 정보는 홍보 영상의 기본 소재로 활용할 수 있습니다. 네이버 지도에서 매장을 검색해 공유 버튼을 누르면 naver.me로 시작하는 URL이 나오는데, ADO2에 이 URL을 붙여넣으면 매장 정보를 자동으로 가져와 영상 제작에 사용합니다. 네이버에 등록되지 않은 매장은 업체명, 지역, 주소, 업종을 직접 입력하면 됩니다."
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "펜션 홍보 영상에는 어떤 장면을 넣어야 하나요?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "펜션 홍보 영상에는 예약을 결정하는 요소인 객실 내부, 침구와 욕실, 스파나 수영장 같은 부대시설, 바비큐 공간, 창밖 풍경을 중심으로 담는 것이 좋습니다. 진입로와 외관, 낮과 밤의 분위기 차이, 주변 관광지까지 보여 주면 숙소의 전체 경험을 전달할 수 있습니다. ADO2는 이런 숙소 사진을 바탕으로 숙소 분위기에 맞는 음악과 자막을 붙여 홍보 영상을 자동으로 만듭니다."
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "펜션이나 풀빌라 유튜브 쇼츠는 어떻게 만드나요?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "펜션 유튜브 쇼츠는 객실과 뷰가 잘 보이는 사진이나 짧은 영상을 세로형으로 이어 붙이고, 숙소 이름과 위치, 특징을 자막으로 넣어 만듭니다. 첫 장면에 가장 인상적인 뷰나 시설을 배치하면 넘겨 보는 시청자를 붙잡는 데 도움이 됩니다. ADO2를 사용하면 네이버 지도 URL만으로 숙소 정보를 분석해 세로형 쇼츠 영상을 만들고 연결된 YouTube 채널에 바로 올릴 수 있습니다."
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "외국인 관광객을 위한 숙소 홍보 영상은 어떻게 만드나요?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "외국인 관광객을 대상으로 할 때는 영상 속 언어를 타깃 국가의 언어로 맞추고, 교통편과 주변 관광지처럼 여행자가 궁금해하는 정보를 함께 보여 주는 것이 좋습니다. ADO2는 한국어, 영어, 중국어, 일본어, 태국어, 베트남어 중에서 가사 언어를 선택할 수 있어 같은 숙소로 여러 언어의 홍보 영상을 만들 수 있습니다."
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "숙소 홍보 영상을 올린 뒤 예약으로 연결하려면 어떻게 하나요?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "숙소 홍보 영상에는 예약 페이지나 공식 홈페이지로 이동할 수 있는 경로를 함께 두어야 시청이 예약으로 이어집니다. 영상 설명란에 예약 링크를 넣고, 홈페이지와 SNS 프로필에도 같은 영상을 걸어 두는 방식이 일반적입니다. ADO2에서 매장의 공식 홈페이지 주소를 등록하면 ADO2 영상 페이지에서 영상이 끝나기 3초 전에 '자세히 보기' 링크가 표시됩니다."
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "음식점 홍보 영상에는 무엇을 담아야 하나요?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "음식점 홍보 영상은 대표 메뉴의 클로즈업, 조리 과정, 매장 분위기, 간판과 찾아오는 길을 중심으로 구성하는 것이 좋습니다. 특히 첫 장면에 가장 맛있어 보이는 메뉴 사진을 두면 시청자의 관심을 끌기 쉽습니다. ADO2는 음식점의 네이버 지도 정보를 분석해 대표 메뉴와 셀링 포인트를 정리하고, 이를 가사와 자막에 반영한 홍보 영상을 만듭니다."
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "카페 홍보 영상에 어울리는 음악은 무엇인가요?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "카페 홍보 영상 음악은 공간 콘셉트에 맞추는 것이 좋습니다. 조용한 감성 카페는 재즈나 발라드, 밝고 트렌디한 디저트 카페는 팝이나 K-POP, 젊은 층이 많이 찾는 공간은 R&B나 힙합이 잘 어울리는 편입니다. ADO2에서는 K-POP, POP, 발라드, Hip-Hop, R&B, EDM, JAZZ, ROCK 중에서 고르거나, 자동 선택으로 매장 분석에 맞는 장르를 추천받을 수 있습니다."
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "맛집 홍보용 숏폼 영상을 쉽게 만드는 방법이 있나요?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "맛집 숏폼은 메뉴 사진과 매장 사진만 잘 준비해도 AI 도구로 쉽게 만들 수 있습니다. 메뉴 이름과 가격, 위치를 짧은 자막으로 넣고 템포가 빠른 음악을 쓰면 짧은 시간 안에 핵심을 전달할 수 있습니다. ADO2는 사진을 고르면 음악 비트에 맞춰 장면을 전환하고 자막을 자동으로 넣어 맛집 홍보용 세로 영상을 만들어 줍니다."
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "신메뉴나 계절 메뉴가 나올 때마다 홍보 영상을 새로 만들기 어렵지 않나요?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "메뉴가 바뀔 때마다 외주로 영상을 맡기면 비용과 시간이 부담되기 때문에, 사진만 바꿔 직접 다시 만들 수 있는 방식이 효율적입니다. ADO2에서는 새 메뉴 사진을 업로드하고 음악을 다시 생성하면 같은 과정으로 새 홍보 영상을 만들 수 있으며, 만든 영상은 내 콘텐츠 목록에 쌓여 언제든 다시 내려받을 수 있습니다."
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "미용실 홍보 영상은 어떻게 만드나요?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "미용실 홍보 영상은 시술 결과물, 디자이너의 작업 모습, 매장 인테리어를 중심으로 구성하는 것이 일반적입니다. 고객의 얼굴이나 시술 전후 사진을 사용할 때는 반드시 고객의 동의를 먼저 받아야 합니다. ADO2는 미용실 사진과 매장 정보를 바탕으로 음악과 자막이 들어간 홍보 영상을 자동으로 만들어 줍니다."
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "네일숍이나 피부관리실 같은 예약형 매장도 홍보 영상이 효과가 있나요?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "네일숍, 피부관리실, 속눈썹 숍처럼 결과물이 눈에 보이는 업종은 사진과 영상으로 실력을 보여 주기 좋아 영상 홍보에 잘 맞습니다. 예약형 매장은 영상에 위치, 대표 시술, 예약 방법을 함께 안내하면 문의로 이어지기 쉽습니다. ADO2는 업종을 직접 입력할 수 있어 네이버 지도 등록 여부와 상관없이 다양한 예약형 매장의 홍보 영상을 만들 수 있습니다."
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "매장 홍보 영상을 단골 고객에게 공유하려면 어떻게 하나요?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "완성한 콘텐츠의 공유 버튼을 누르면 지원 기기에서는 기본 공유 창으로 링크를 보낼 수 있고, 그 외 환경에서는 링크를 복사할 수 있습니다. 공개된 영상은 해당 콘텐츠의 상세 화면에서 재생됩니다. MP4 파일을 다운로드해 직접 전달하거나 원하는 채널에 올릴 수도 있습니다."
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "ADO2는 어떤 서비스인가요?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "ADO2는 ㈜에이아이오투오가 운영하는 AI 마케팅 플랫폼입니다. 매장 정보를 활용한 홍보 음악·영상, 역사·신화 이야기를 활용한 썰박스, 이미지 기반 무빙 포스터를 만들 수 있습니다. 완성한 콘텐츠는 다운로드하거나 링크로 공유하고, 연결된 YouTube 채널에 업로드·예약 게시할 수 있습니다."
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "ADO2로 홍보 영상을 만드는 데 시간이 얼마나 걸리나요?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "제작 방식과 검수 시간, 작업량에 따라 다릅니다. 썰박스는 화면에서 약 5~6분, 무빙 포스터는 약 3분 소요로 안내합니다. ADO2 홍보 영상은 브랜드 분석, 가사·음악 생성, 이미지 선택, 영상 생성 순서로 진행하며 사용자가 선택하는 시간도 필요합니다. 외부 서비스 처리 상황에 따라 안내 시간보다 오래 걸릴 수 있습니다."
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "ADO2의 AI 브랜드 분석에서는 무엇을 알려주나요?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "ADO2의 브랜드 분석은 매장 정보를 바탕으로 브랜드 정체성, 입지 특성, 시장 포지셔닝, 핵심 가치, 주요 고객 유형, 주요 셀링 포인트, 추천 타겟 키워드를 정리해 줍니다. 이 분석 결과는 이후 가사와 영상 제작에 그대로 반영됩니다."
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "ADO2는 어떻게 시작하나요?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "첫 화면의 ADO2 콘텐츠에서 공개된 영상을 둘러볼 수 있습니다. 콘텐츠를 만들려면 카카오 계정으로 로그인하고 새 프로젝트 만들기에서 ADO2, 썰박스, 무빙 포스터 중 선택하세요. 생성에는 크레딧이 사용되며, 보유 크레딧은 내 정보 화면에서 확인할 수 있습니다."
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "다른 매장이 ADO2로 만든 홍보 영상 예시를 볼 수 있나요?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "네, ADO2 콘텐츠 메뉴에서 다른 매장들이 만든 홍보 영상을 볼 수 있습니다. 지역과 업체명으로 검색할 수 있고, 최신순, 좋아요 많은순, 댓글 많은순으로 정렬해 업종별 영상 예시를 참고할 수 있습니다."
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "ADO2를 운영하는 회사는 어디인가요?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "ADO2는 ㈜에이아이오투오가 개발하고 운영합니다. 본사는 대구광역시 북구 옥산로 111에 있으며, 연구소는 경기도 성남시 수정구 금토로 32 KT 판교빌딩에 있습니다. 서비스 문의는 이메일 o2oteam@o2o.kr로 할 수 있습니다."
|
||||
}
|
||||
}
|
||||
],
|
||||
"name": "AI 홍보 영상·썰박스·무빙 포스터 FAQ"
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; line-height: 1.8; color: #333; max-width: 800px; margin: 0 auto; padding: 40px 20px; }
|
||||
h1 { font-size: 28px; border-bottom: 2px solid #eee; padding-bottom: 12px; margin-bottom: 30px; }
|
||||
h2 { font-size: 22px; margin-top: 56px; color: #111; border-bottom: 1px solid #eee; padding-bottom: 8px; }
|
||||
h3 { font-size: 17px; margin-top: 32px; color: #111; }
|
||||
p, li { font-size: 15px; color: #555; margin-bottom: 10px; }
|
||||
ul { padding-left: 20px; }
|
||||
.updated { color: #888; font-size: 14px; margin-bottom: 30px; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>AI 홍보 영상·썰박스·무빙 포스터 FAQ</h1>
|
||||
<p class="updated"><strong>최종 수정일:</strong> <time datetime="2026-10-16">2026년 10월 16일</time></p>
|
||||
<p>ADO2의 매장 홍보 영상, 역사·신화 스토리형 숏폼 썰박스, 이미지 기반 무빙 포스터를 안내합니다. 펜션·음식점·카페·미용실의 홍보 영상 활용법부터 생성 비용, 공개 콘텐츠 공유와 YouTube 업로드까지 확인할 수 있습니다.</p>
|
||||
|
||||
<nav>
|
||||
<ul>
|
||||
<li><a href="#formats">제작 방식 선택·썰박스·무빙 포스터</a></li>
|
||||
<li><a href="#basic">소상공인 매장 홍보 영상 기본</a></li>
|
||||
<li><a href="#stay">펜션·풀빌라 등 숙박업 홍보</a></li>
|
||||
<li><a href="#food">음식점·카페 홍보</a></li>
|
||||
<li><a href="#beauty">미용실·네일숍 등 예약형 매장 홍보</a></li>
|
||||
<li><a href="#ado2">ADO2 이용 안내</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
<section id="formats">
|
||||
<h2>제작 방식 선택·썰박스·무빙 포스터</h2>
|
||||
|
||||
<h3>ADO2에서 어떤 종류의 콘텐츠를 만들 수 있나요?</h3>
|
||||
<p>새 프로젝트 만들기에서 ADO2, 썰박스, 무빙 포스터 중 선택할 수 있습니다. ADO2는 매장 정보를 분석해 가사·음악·홍보 영상을 만들고, 썰박스는 역사·신화 이야기에 업체 셀링포인트를 담은 스토리형 숏폼을 만듭니다. 무빙 포스터는 포스터 이미지 한 장에 움직임·나레이션·음악을 더해 세로형 영상으로 만듭니다.</p>
|
||||
|
||||
<h3>썰박스는 무엇이고 어떻게 만드나요?</h3>
|
||||
<p>썰박스는 역사·신화 이야기에 업체의 특징을 담아 만드는 숏폼 콘텐츠입니다. 조선왕조, 삼국지, 그리스 신화, 오디세이 중 시나리오를 선택하고 업체명이나 네이버 지도 링크로 업체를 찾은 뒤 생성합니다. AI가 대본·이미지·나레이션과 영상을 만들며, 화면에서는 약 5~6분 소요로 안내합니다. 실제 시간은 처리 상황에 따라 달라질 수 있습니다.</p>
|
||||
|
||||
<h3>포스터 한 장으로 움직이는 홍보 영상을 만들 수 있나요?</h3>
|
||||
<p>네, 무빙 포스터의 이미지로 시작하기에서 포스터를 올리면 불꽃·물결·조명 같은 요소에 움직임을 더하고 제목·일시 나레이션과 음악을 넣은 8~15초 세로형 숏폼을 만들 수 있습니다. 분석 뒤 검수 화면에서 나레이션, 움직일 요소, 행사 정보를 확인하고 생성합니다.</p>
|
||||
|
||||
<h3>무빙 포스터에 필요한 파일과 생성 비용은 어떻게 되나요?</h3>
|
||||
<p>JPG, PNG, WEBP, GIF 형식의 포스터 이미지 1장이 필요합니다. 행사 이름은 직접 입력하거나 자동 추출할 수 있습니다. 현재 생성 화면에는 3크레딧이 안내되며, 약 3분 소요로 소개됩니다. 생성 시간은 작업량과 외부 서비스 처리 상황에 따라 달라질 수 있으므로 시작 전 화면 안내를 확인하세요.</p>
|
||||
|
||||
<h3>공연상품페이지 주소로 예고편을 만드는 기능도 사용할 수 있나요?</h3>
|
||||
<p>공연상품페이지 주소로 줄거리·캐스팅·일정과 예매 안내를 담은 30초 예고편을 만드는 롱컷은 현재 준비 중입니다. 시작 화면에 공연상품페이지로 시작하기가 표시되지만 생성 버튼은 비활성화되어 있습니다. 현재는 이미지로 시작하기를 통해 무빙 포스터를 제작할 수 있습니다.</p>
|
||||
|
||||
<h3>썰박스 생성 비용과 실패 시 크레딧 처리는 어떻게 되나요?</h3>
|
||||
<p>현재 썰박스 생성 화면에는 영상 1편당 1크레딧이 안내됩니다. 썰박스와 무빙 포스터는 생성 요청 시 크레딧이 차감되고 생성에 실패하면 사용한 크레딧이 환불됩니다. 보유 크레딧은 내 정보에서 확인하고, 부족하면 서비스에서 충전을 요청할 수 있습니다. 실제 요청 전 화면의 비용 안내를 확인하세요.</p>
|
||||
|
||||
<h3>공유받은 썰박스나 무빙 포스터를 로그인 없이 볼 수 있나요?</h3>
|
||||
<p>네, 공개된 썰박스와 무빙 포스터는 공유 링크의 상세 화면에서 로그인 없이 재생할 수 있습니다. 좋아요를 누르거나 댓글을 작성하려면 로그인이 필요합니다. 콘텐츠가 삭제되었거나 공개 가능한 상태가 아니면 상세 화면에서 불러오지 못할 수 있습니다.</p>
|
||||
|
||||
<h3>썰박스와 무빙 포스터도 YouTube에 업로드할 수 있나요?</h3>
|
||||
<p>네, ADO2 홍보 영상뿐 아니라 완성된 썰박스와 무빙 포스터도 연결된 YouTube 채널에 업로드하거나 예약 게시할 수 있습니다. 업로드 전에 채널을 연결하고 제목·설명·태그와 게시 설정을 확인하세요. 완성한 영상 파일을 다운로드해 직접 활용할 수도 있습니다.</p>
|
||||
</section>
|
||||
|
||||
<section id="basic">
|
||||
<h2>소상공인 매장 홍보 영상 기본</h2>
|
||||
|
||||
<h3>가게 홍보 영상은 어떻게 만드나요?</h3>
|
||||
<p>가게 홍보 영상은 보통 매장의 강점 정리, 사진과 영상 소재 준비, 음악과 자막을 넣은 편집, 유튜브 쇼츠나 인스타그램 릴스 같은 채널 업로드 순서로 만듭니다. 이 중 편집과 업로드가 가장 시간이 많이 드는 단계라, 인력이 부족한 소상공인은 AI 영상 제작 도구로 자동화하는 경우가 많습니다. ADO2는 네이버 지도 URL이나 업체명만 입력하면 매장 분석부터 음악, 자막, 영상 제작, YouTube 업로드까지 자동으로 진행합니다.</p>
|
||||
|
||||
<h3>영상 편집을 할 줄 몰라도 매장 홍보 영상을 만들 수 있나요?</h3>
|
||||
<p>네, 만들 수 있습니다. 최근에는 사진만 넣으면 장면 구성, 자막, 음악, 장면 전환을 AI가 자동으로 처리하는 도구가 있어 편집 프로그램을 배우지 않아도 됩니다. ADO2를 사용하면 매장 정보를 입력하고 이미지와 음악을 고르는 것만으로 홍보 영상이 완성되며, 별도 프로그램 설치 없이 웹에서 바로 이용할 수 있습니다.</p>
|
||||
|
||||
<h3>소상공인 홍보 영상은 왜 세로형 숏폼으로 만드는 게 좋나요?</h3>
|
||||
<p>유튜브 쇼츠, 인스타그램 릴스, 틱톡 같은 숏폼 채널은 스마트폰 전체 화면에 맞는 9:16 세로형 영상을 기본으로 합니다. 짧은 세로 영상은 구독자가 아닌 사람에게도 추천 피드를 통해 노출될 수 있어, 광고비를 많이 쓰기 어려운 지역 매장이 인지도를 높이는 데 유리합니다. ADO2는 YouTube 쇼츠용 세로형 영상과 일반 가로형 영상 중에서 선택해 제작할 수 있습니다.</p>
|
||||
|
||||
<h3>홍보 영상에 쓸 매장 사진은 어떻게 준비하나요?</h3>
|
||||
<p>홍보 영상용 사진은 외관과 간판, 내부 전경, 대표 메뉴나 서비스, 소품 같은 디테일, 실제 이용 장면처럼 다양한 장면을 고르게 준비하는 것이 좋습니다. 자연광이 드는 밝은 시간에 수평을 맞춰 찍고, 비슷한 사진 여러 장보다 서로 다른 장면을 담은 사진이 영상을 지루하지 않게 만듭니다. ADO2는 30장 이상의 이미지를 권장하며, 네이버 지도에 등록된 매장 사진을 불러와 함께 사용할 수 있습니다.</p>
|
||||
|
||||
<h3>가게 홍보 영상에 넣을 음악은 어떻게 고르나요?</h3>
|
||||
<p>홍보 영상 음악은 매장 분위기와 주요 고객층에 맞추는 것이 기본입니다. 인기 가요나 유명 곡은 저작권 때문에 상업용 홍보 영상에 자유롭게 쓰기 어려우므로, 이용 조건이 명확한 음원을 사용해야 합니다. ADO2는 매장 분석 결과를 바탕으로 AI가 새로 작사하고 작곡한 음악을 만들어 영상에 넣어 줍니다.</p>
|
||||
|
||||
<h3>AI로 가게 광고 음악이나 로고송을 만들 수 있나요?</h3>
|
||||
<p>네, AI 음악 생성 기술로 매장 이름과 특징을 가사에 담은 광고 음악이나 로고송을 만들 수 있습니다. 가사에 매장 이름, 지역, 대표 메뉴나 서비스를 넣으면 고객이 기억하기 쉬운 노래가 됩니다. ADO2는 매장 분석에서 찾은 셀링 포인트와 키워드로 가사를 쓰고 음악을 만들며, 가사를 직접 고친 뒤 다시 생성할 수도 있습니다.</p>
|
||||
|
||||
<h3>매장 홍보 영상의 제목과 태그는 어떻게 쓰나요?</h3>
|
||||
<p>홍보 영상 제목과 태그에는 사람들이 실제로 검색하는 지역명, 업종, 특징을 함께 넣는 것이 좋습니다. 예를 들어 '강릉 오션뷰 펜션'이나 '성수동 디저트 카페'처럼 지역과 업종을 묶은 표현이 검색에 잘 걸립니다. ADO2는 YouTube에 업로드할 때 매장 정보를 바탕으로 제목, 설명, 태그를 AI가 자동으로 작성합니다.</p>
|
||||
|
||||
<h3>홍보 영상은 얼마나 자주 올리는 게 좋나요?</h3>
|
||||
<p>숏폼 채널에서는 한 번에 많이 올리는 것보다 일정한 간격으로 꾸준히 올리는 것이 노출과 채널 관리에 유리합니다. 계절 메뉴, 이벤트, 성수기처럼 시기에 맞는 영상을 미리 만들어 두고 정해진 날짜에 올리는 방식이 운영 부담을 줄여 줍니다. ADO2는 원하는 날짜와 시간에 YouTube 예약 업로드를 걸어 두고 콘텐츠 캘린더에서 일정을 관리할 수 있습니다.</p>
|
||||
|
||||
<h3>네이버 지도에 등록된 매장 정보로 홍보 영상을 만들 수 있나요?</h3>
|
||||
<p>네, 네이버 지도나 네이버 플레이스에 등록된 매장 이름, 주소, 업종, 사진 같은 정보는 홍보 영상의 기본 소재로 활용할 수 있습니다. 네이버 지도에서 매장을 검색해 공유 버튼을 누르면 naver.me로 시작하는 URL이 나오는데, ADO2에 이 URL을 붙여넣으면 매장 정보를 자동으로 가져와 영상 제작에 사용합니다. 네이버에 등록되지 않은 매장은 업체명, 지역, 주소, 업종을 직접 입력하면 됩니다.</p>
|
||||
</section>
|
||||
|
||||
<section id="stay">
|
||||
<h2>펜션·풀빌라 등 숙박업 홍보</h2>
|
||||
|
||||
<h3>펜션 홍보 영상에는 어떤 장면을 넣어야 하나요?</h3>
|
||||
<p>펜션 홍보 영상에는 예약을 결정하는 요소인 객실 내부, 침구와 욕실, 스파나 수영장 같은 부대시설, 바비큐 공간, 창밖 풍경을 중심으로 담는 것이 좋습니다. 진입로와 외관, 낮과 밤의 분위기 차이, 주변 관광지까지 보여 주면 숙소의 전체 경험을 전달할 수 있습니다. ADO2는 이런 숙소 사진을 바탕으로 숙소 분위기에 맞는 음악과 자막을 붙여 홍보 영상을 자동으로 만듭니다.</p>
|
||||
|
||||
<h3>펜션이나 풀빌라 유튜브 쇼츠는 어떻게 만드나요?</h3>
|
||||
<p>펜션 유튜브 쇼츠는 객실과 뷰가 잘 보이는 사진이나 짧은 영상을 세로형으로 이어 붙이고, 숙소 이름과 위치, 특징을 자막으로 넣어 만듭니다. 첫 장면에 가장 인상적인 뷰나 시설을 배치하면 넘겨 보는 시청자를 붙잡는 데 도움이 됩니다. ADO2를 사용하면 네이버 지도 URL만으로 숙소 정보를 분석해 세로형 쇼츠 영상을 만들고 연결된 YouTube 채널에 바로 올릴 수 있습니다.</p>
|
||||
|
||||
<h3>외국인 관광객을 위한 숙소 홍보 영상은 어떻게 만드나요?</h3>
|
||||
<p>외국인 관광객을 대상으로 할 때는 영상 속 언어를 타깃 국가의 언어로 맞추고, 교통편과 주변 관광지처럼 여행자가 궁금해하는 정보를 함께 보여 주는 것이 좋습니다. ADO2는 한국어, 영어, 중국어, 일본어, 태국어, 베트남어 중에서 가사 언어를 선택할 수 있어 같은 숙소로 여러 언어의 홍보 영상을 만들 수 있습니다.</p>
|
||||
|
||||
<h3>숙소 홍보 영상을 올린 뒤 예약으로 연결하려면 어떻게 하나요?</h3>
|
||||
<p>숙소 홍보 영상에는 예약 페이지나 공식 홈페이지로 이동할 수 있는 경로를 함께 두어야 시청이 예약으로 이어집니다. 영상 설명란에 예약 링크를 넣고, 홈페이지와 SNS 프로필에도 같은 영상을 걸어 두는 방식이 일반적입니다. ADO2에서 매장의 공식 홈페이지 주소를 등록하면 ADO2 영상 페이지에서 영상이 끝나기 3초 전에 '자세히 보기' 링크가 표시됩니다.</p>
|
||||
</section>
|
||||
|
||||
<section id="food">
|
||||
<h2>음식점·카페 홍보</h2>
|
||||
|
||||
<h3>음식점 홍보 영상에는 무엇을 담아야 하나요?</h3>
|
||||
<p>음식점 홍보 영상은 대표 메뉴의 클로즈업, 조리 과정, 매장 분위기, 간판과 찾아오는 길을 중심으로 구성하는 것이 좋습니다. 특히 첫 장면에 가장 맛있어 보이는 메뉴 사진을 두면 시청자의 관심을 끌기 쉽습니다. ADO2는 음식점의 네이버 지도 정보를 분석해 대표 메뉴와 셀링 포인트를 정리하고, 이를 가사와 자막에 반영한 홍보 영상을 만듭니다.</p>
|
||||
|
||||
<h3>카페 홍보 영상에 어울리는 음악은 무엇인가요?</h3>
|
||||
<p>카페 홍보 영상 음악은 공간 콘셉트에 맞추는 것이 좋습니다. 조용한 감성 카페는 재즈나 발라드, 밝고 트렌디한 디저트 카페는 팝이나 K-POP, 젊은 층이 많이 찾는 공간은 R&B나 힙합이 잘 어울리는 편입니다. ADO2에서는 K-POP, POP, 발라드, Hip-Hop, R&B, EDM, JAZZ, ROCK 중에서 고르거나, 자동 선택으로 매장 분석에 맞는 장르를 추천받을 수 있습니다.</p>
|
||||
|
||||
<h3>맛집 홍보용 숏폼 영상을 쉽게 만드는 방법이 있나요?</h3>
|
||||
<p>맛집 숏폼은 메뉴 사진과 매장 사진만 잘 준비해도 AI 도구로 쉽게 만들 수 있습니다. 메뉴 이름과 가격, 위치를 짧은 자막으로 넣고 템포가 빠른 음악을 쓰면 짧은 시간 안에 핵심을 전달할 수 있습니다. ADO2는 사진을 고르면 음악 비트에 맞춰 장면을 전환하고 자막을 자동으로 넣어 맛집 홍보용 세로 영상을 만들어 줍니다.</p>
|
||||
|
||||
<h3>신메뉴나 계절 메뉴가 나올 때마다 홍보 영상을 새로 만들기 어렵지 않나요?</h3>
|
||||
<p>메뉴가 바뀔 때마다 외주로 영상을 맡기면 비용과 시간이 부담되기 때문에, 사진만 바꿔 직접 다시 만들 수 있는 방식이 효율적입니다. ADO2에서는 새 메뉴 사진을 업로드하고 음악을 다시 생성하면 같은 과정으로 새 홍보 영상을 만들 수 있으며, 만든 영상은 내 콘텐츠 목록에 쌓여 언제든 다시 내려받을 수 있습니다.</p>
|
||||
</section>
|
||||
|
||||
<section id="beauty">
|
||||
<h2>미용실·네일숍 등 예약형 매장 홍보</h2>
|
||||
|
||||
<h3>미용실 홍보 영상은 어떻게 만드나요?</h3>
|
||||
<p>미용실 홍보 영상은 시술 결과물, 디자이너의 작업 모습, 매장 인테리어를 중심으로 구성하는 것이 일반적입니다. 고객의 얼굴이나 시술 전후 사진을 사용할 때는 반드시 고객의 동의를 먼저 받아야 합니다. ADO2는 미용실 사진과 매장 정보를 바탕으로 음악과 자막이 들어간 홍보 영상을 자동으로 만들어 줍니다.</p>
|
||||
|
||||
<h3>네일숍이나 피부관리실 같은 예약형 매장도 홍보 영상이 효과가 있나요?</h3>
|
||||
<p>네일숍, 피부관리실, 속눈썹 숍처럼 결과물이 눈에 보이는 업종은 사진과 영상으로 실력을 보여 주기 좋아 영상 홍보에 잘 맞습니다. 예약형 매장은 영상에 위치, 대표 시술, 예약 방법을 함께 안내하면 문의로 이어지기 쉽습니다. ADO2는 업종을 직접 입력할 수 있어 네이버 지도 등록 여부와 상관없이 다양한 예약형 매장의 홍보 영상을 만들 수 있습니다.</p>
|
||||
|
||||
<h3>매장 홍보 영상을 단골 고객에게 공유하려면 어떻게 하나요?</h3>
|
||||
<p>완성한 콘텐츠의 공유 버튼을 누르면 지원 기기에서는 기본 공유 창으로 링크를 보낼 수 있고, 그 외 환경에서는 링크를 복사할 수 있습니다. 공개된 영상은 해당 콘텐츠의 상세 화면에서 재생됩니다. MP4 파일을 다운로드해 직접 전달하거나 원하는 채널에 올릴 수도 있습니다.</p>
|
||||
</section>
|
||||
|
||||
<section id="ado2">
|
||||
<h2>ADO2 이용 안내</h2>
|
||||
|
||||
<h3>ADO2는 어떤 서비스인가요?</h3>
|
||||
<p>ADO2는 ㈜에이아이오투오가 운영하는 AI 마케팅 플랫폼입니다. 매장 정보를 활용한 홍보 음악·영상, 역사·신화 이야기를 활용한 썰박스, 이미지 기반 무빙 포스터를 만들 수 있습니다. 완성한 콘텐츠는 다운로드하거나 링크로 공유하고, 연결된 YouTube 채널에 업로드·예약 게시할 수 있습니다.</p>
|
||||
|
||||
<h3>ADO2로 홍보 영상을 만드는 데 시간이 얼마나 걸리나요?</h3>
|
||||
<p>제작 방식과 검수 시간, 작업량에 따라 다릅니다. 썰박스는 화면에서 약 5~6분, 무빙 포스터는 약 3분 소요로 안내합니다. ADO2 홍보 영상은 브랜드 분석, 가사·음악 생성, 이미지 선택, 영상 생성 순서로 진행하며 사용자가 선택하는 시간도 필요합니다. 외부 서비스 처리 상황에 따라 안내 시간보다 오래 걸릴 수 있습니다.</p>
|
||||
|
||||
<h3>ADO2의 AI 브랜드 분석에서는 무엇을 알려주나요?</h3>
|
||||
<p>ADO2의 브랜드 분석은 매장 정보를 바탕으로 브랜드 정체성, 입지 특성, 시장 포지셔닝, 핵심 가치, 주요 고객 유형, 주요 셀링 포인트, 추천 타겟 키워드를 정리해 줍니다. 이 분석 결과는 이후 가사와 영상 제작에 그대로 반영됩니다.</p>
|
||||
|
||||
<h3>ADO2는 어떻게 시작하나요?</h3>
|
||||
<p>첫 화면의 ADO2 콘텐츠에서 공개된 영상을 둘러볼 수 있습니다. 콘텐츠를 만들려면 카카오 계정으로 로그인하고 새 프로젝트 만들기에서 ADO2, 썰박스, 무빙 포스터 중 선택하세요. 생성에는 크레딧이 사용되며, 보유 크레딧은 내 정보 화면에서 확인할 수 있습니다.</p>
|
||||
|
||||
<h3>다른 매장이 ADO2로 만든 홍보 영상 예시를 볼 수 있나요?</h3>
|
||||
<p>네, ADO2 콘텐츠 메뉴에서 다른 매장들이 만든 홍보 영상을 볼 수 있습니다. 지역과 업체명으로 검색할 수 있고, 최신순, 좋아요 많은순, 댓글 많은순으로 정렬해 업종별 영상 예시를 참고할 수 있습니다.</p>
|
||||
|
||||
<h3>ADO2를 운영하는 회사는 어디인가요?</h3>
|
||||
<p>ADO2는 ㈜에이아이오투오가 개발하고 운영합니다. 본사는 대구광역시 북구 옥산로 111에 있으며, 연구소는 경기도 성남시 수정구 금토로 32 KT 판교빌딩에 있습니다. 서비스 문의는 이메일 o2oteam@o2o.kr로 할 수 있습니다.</p>
|
||||
</section>
|
||||
|
||||
<p style="margin-top:40px; font-size:14px; color:#999;"><a href="/">ADO2 홈</a> · <a href="/terms.html">서비스 약관</a> · <a href="/privacy.html">개인정보처리방침</a></p>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,32 @@
|
||||
# ADO2
|
||||
|
||||
> ADO2는 ㈜에이아이오투오가 운영하는 AI 마케팅 플랫폼입니다. 매장 정보를 활용한 홍보 영상, 역사·신화 이야기를 활용한 썰박스, 포스터 이미지 기반 무빙 포스터를 제작하고 완성한 콘텐츠를 다운로드·공유하거나 연결된 YouTube 채널에 업로드할 수 있습니다.
|
||||
|
||||
최종 수정일: 2026-10-16
|
||||
|
||||
## 주요 기능
|
||||
|
||||
- 비즈니스 핵심 정보 분석: 홈페이지, 네이버 지도, 블로그 등의 URL이나 업체명을 입력하면 업체 정보를 자동으로 가져와 분석합니다.
|
||||
- 홍보 콘텐츠 자동 제작: 분석한 정보를 바탕으로 비즈니스에 맞는 가사, 음악, 자막, 영상을 자동으로 제작합니다.
|
||||
- 썰박스: 조선왕조, 삼국지, 그리스 신화, 오디세이 시나리오에 업체 셀링포인트를 담은 스토리형 숏폼을 만듭니다. 시나리오와 업체를 선택해 생성합니다.
|
||||
- 무빙 포스터: 이미지 한 장에 움직임·나레이션·음악을 더한 9:16 세로형 숏폼을 만듭니다. 분석 후 나레이션·움직임·행사 정보를 확인할 수 있습니다.
|
||||
- YouTube 업로드: ADO2 영상, 썰박스, 무빙 포스터를 다운로드하거나 연결된 YouTube 채널에 업로드·예약 게시할 수 있습니다.
|
||||
- 공개 콘텐츠: 첫 화면인 ADO2 콘텐츠에서 완성 영상을 열람하고 링크로 공유할 수 있습니다. 비로그인도 공개 상세를 볼 수 있으며 좋아요·댓글 작성에는 로그인이 필요합니다.
|
||||
- 직접 입력 지원: 네이버 지도/플레이스에 등록되지 않은 업체도 업체명, 지역, 상세 주소, 업종만 입력하면 영상 제작까지 가능합니다.
|
||||
|
||||
## 페이지
|
||||
|
||||
- [ADO2 홍보 영상·썰박스·무빙 포스터 FAQ](https://ado2.o2osolution.ai/faq.html): 제작 방식 선택, 업종별 홍보 영상 팁, 썰박스와 무빙 포스터 제작, 생성 비용, 공개 열람·공유·YouTube 업로드 안내
|
||||
- [서비스 약관](https://ado2.o2osolution.ai/terms.html)
|
||||
- [개인정보처리방침](https://ado2.o2osolution.ai/privacy.html)
|
||||
|
||||
## 운영사
|
||||
|
||||
- 회사명: ㈜에이아이오투오
|
||||
- 문의: o2oteam@o2o.kr
|
||||
|
||||
## 제공 범위
|
||||
|
||||
- 공연상품페이지 주소로 30초 예고편을 만드는 롱컷은 현재 시작 화면에서 준비 중입니다.
|
||||
- 생성 비용은 썰박스 1크레딧, 무빙 포스터 3크레딧으로 안내됩니다. 실제 생성 전 화면의 비용 안내를 확인하세요.
|
||||
- 삭제되었거나 공개 가능한 상태가 아닌 콘텐츠는 공유 링크로 열람할 수 없습니다.
|
||||
@@ -0,0 +1,29 @@
|
||||
User-agent: *
|
||||
Allow: /
|
||||
Disallow: /social/
|
||||
|
||||
User-agent: GPTBot
|
||||
Allow: /
|
||||
Disallow: /social/
|
||||
|
||||
User-agent: OAI-SearchBot
|
||||
Allow: /
|
||||
Disallow: /social/
|
||||
|
||||
User-agent: ClaudeBot
|
||||
Allow: /
|
||||
Disallow: /social/
|
||||
|
||||
User-agent: PerplexityBot
|
||||
Allow: /
|
||||
Disallow: /social/
|
||||
|
||||
User-agent: Google-Extended
|
||||
Allow: /
|
||||
Disallow: /social/
|
||||
|
||||
User-agent: Yeti
|
||||
Allow: /
|
||||
Disallow: /social/
|
||||
|
||||
Sitemap: https://ado2.o2osolution.ai/sitemap.xml
|
||||
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||
<url>
|
||||
<loc>https://ado2.o2osolution.ai/</loc>
|
||||
<lastmod>2026-10-16</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://ado2.o2osolution.ai/faq.html</loc>
|
||||
<lastmod>2026-10-16</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://ado2.o2osolution.ai/terms.html</loc>
|
||||
<lastmod>2026-05-21</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://ado2.o2osolution.ai/privacy.html</loc>
|
||||
<lastmod>2026-05-27</lastmod>
|
||||
</url>
|
||||
</urlset>
|
||||
@@ -7,6 +7,7 @@ import SocialConnectError from './pages/Social/SocialConnectError';
|
||||
import YouTubeOAuthCallback from './pages/Social/YouTubeOAuthCallback';
|
||||
import VideoDetailPage from './components/VideoDetailPage';
|
||||
import SsulDetailPage from './pages/Ssulbox/SsulDetailPage';
|
||||
import P2vDetailPage from './pages/P2v/P2vDetailPage';
|
||||
import { kakaoCallback, saveTokens, storeUtmFromUrl, trackViewContent, trackCompleteRegistration } from './utils/api';
|
||||
import { clearSessionStorage } from './utils/storageKeys';
|
||||
import { NAV } from './components/navItems';
|
||||
@@ -154,6 +155,14 @@ const App: React.FC = () => {
|
||||
return <SsulDetailPage contentId={ssulDetailMatch[1]} />;
|
||||
}
|
||||
|
||||
const p2vDetailMatch = pathname.match(/^\/p2v\/(f1|playreel)\/(\d+)\/?$/);
|
||||
if (p2vDetailMatch) {
|
||||
return <P2vDetailPage
|
||||
contentId={p2vDetailMatch[2]}
|
||||
contentType={p2vDetailMatch[1] === 'f1' ? 'p2v_video' : 'p2v_playreel'}
|
||||
/>;
|
||||
}
|
||||
|
||||
// 카카오 콜백 처리 중 로딩 화면 표시
|
||||
if (isProcessingCallback) {
|
||||
return (
|
||||
|
||||
@@ -31,7 +31,7 @@ const ContentCardSocialActions: React.FC<ContentCardSocialActionsProps> = ({
|
||||
commentCount,
|
||||
initialLikeCount,
|
||||
initialIsLiked = false,
|
||||
}) => {
|
||||
}: ContentCardSocialActionsProps) => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const [likeCount, setLikeCount] = useState(initialLikeCount);
|
||||
|
||||
@@ -0,0 +1,489 @@
|
||||
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import {
|
||||
API_URL,
|
||||
deleteComment,
|
||||
getSsulContentById,
|
||||
getUserMe,
|
||||
getVideoComments,
|
||||
isLoggedIn,
|
||||
postVideoComment,
|
||||
toggleVideoLike,
|
||||
} from '../utils/api';
|
||||
import type { SsulDetailItem } from '../utils/api';
|
||||
import { CommentItem, P2vContentType, UserMeResponse } from '../types/api';
|
||||
import { buildContentShareUrl, tryNativeShare } from '../utils/nativeShare';
|
||||
import LoginPromptModal from './LoginPromptModal';
|
||||
import { isSafeHttpUrl } from '../utils/url';
|
||||
import { getP2vContentById } from '../utils/p2vApi';
|
||||
|
||||
interface ContentDetailContentProps {
|
||||
contentId: string;
|
||||
contentType: 'ssul' | P2vContentType;
|
||||
isModal?: boolean;
|
||||
onClose?: () => void;
|
||||
}
|
||||
|
||||
type DetailContent = Pick<SsulDetailItem,
|
||||
'video_url' | 'store_name' | 'official_site_url' | 'created_at' | 'like_count' | 'is_liked_by_me'
|
||||
> & { poster_url?: string | null };
|
||||
|
||||
/** Shared public detail UI for Ssulbox and P2V content. */
|
||||
const ContentDetailContent: React.FC<ContentDetailContentProps> = ({
|
||||
contentId,
|
||||
contentType,
|
||||
isModal = false,
|
||||
onClose,
|
||||
}) => {
|
||||
const { t } = useTranslation();
|
||||
const authed = isLoggedIn();
|
||||
|
||||
const [content, setContent] = useState<DetailContent | null>(null);
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
|
||||
const [likeCount, setLikeCount] = useState(0);
|
||||
const [isLiked, setIsLiked] = useState(false);
|
||||
const [likeSubmitting, setLikeSubmitting] = useState(false);
|
||||
|
||||
const [copied, setCopied] = useState(false);
|
||||
const [isLandscape, setIsLandscape] = useState(false);
|
||||
const [showSiteOverlay, setShowSiteOverlay] = useState(false);
|
||||
const [showLoginModal, setShowLoginModal] = useState(false);
|
||||
|
||||
const [comments, setComments] = useState<CommentItem[]>([]);
|
||||
const [commentsTotal, setCommentsTotal] = useState(0);
|
||||
const [commentsPage, setCommentsPage] = useState(1);
|
||||
const [commentsHasNext, setCommentsHasNext] = useState(false);
|
||||
const [commentsLoading, setCommentsLoading] = useState(false);
|
||||
const [commentInput, setCommentInput] = useState('');
|
||||
const [commentSubmitting, setCommentSubmitting] = useState(false);
|
||||
const commentTextareaRef = useRef<HTMLTextAreaElement>(null);
|
||||
|
||||
const [currentUser, setCurrentUser] = useState<UserMeResponse | null>(null);
|
||||
|
||||
const fetchComments = useCallback(
|
||||
async (page: number, append = false) => {
|
||||
setCommentsLoading(true);
|
||||
try {
|
||||
const res = await getVideoComments(contentId, page, 20, contentType);
|
||||
const sorted = [...res.items].sort(
|
||||
(a, b) => new Date(a.created_at).getTime() - new Date(b.created_at).getTime()
|
||||
);
|
||||
setComments((prev) => (append ? [...prev, ...sorted] : sorted));
|
||||
setCommentsTotal(res.total);
|
||||
setCommentsHasNext(res.has_next);
|
||||
setCommentsPage(page);
|
||||
} catch (err) {
|
||||
console.error('Failed to fetch content comments:', err);
|
||||
} finally {
|
||||
setCommentsLoading(false);
|
||||
}
|
||||
},
|
||||
[contentId, contentType]
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
const fetchContent = async () => {
|
||||
setLoading(true);
|
||||
setError(null);
|
||||
setShowSiteOverlay(false);
|
||||
try {
|
||||
const data = contentType === 'ssul'
|
||||
? await getSsulContentById(contentId)
|
||||
: await getP2vContentById(contentType, contentId).then((item) => ({
|
||||
...item, store_name: item.title,
|
||||
}));
|
||||
setContent(data);
|
||||
setLikeCount(data.like_count);
|
||||
setIsLiked(data.is_liked_by_me);
|
||||
} catch (err) {
|
||||
console.error('Failed to fetch content:', err);
|
||||
setError(t('ado2Contents.loadFailed'));
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
setIsLandscape(false);
|
||||
fetchContent();
|
||||
fetchComments(1);
|
||||
}, [contentId, contentType, fetchComments, t]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!authed) return;
|
||||
getUserMe().then(setCurrentUser).catch((err) => {
|
||||
console.error('Failed to fetch current user:', err);
|
||||
});
|
||||
}, [authed]);
|
||||
|
||||
const formatDate = (dateString: string) => {
|
||||
const date = new Date(dateString);
|
||||
return t('videoDetail.dateFormat', {
|
||||
year: date.getFullYear(),
|
||||
month: date.getMonth() + 1,
|
||||
day: date.getDate(),
|
||||
});
|
||||
};
|
||||
|
||||
const formatCommentDate = (dateString: string) => {
|
||||
const date = new Date(dateString);
|
||||
return `${date.getFullYear()}.${String(date.getMonth() + 1).padStart(2, '0')}.${String(
|
||||
date.getDate()
|
||||
).padStart(2, '0')}`;
|
||||
};
|
||||
|
||||
// ID 가 같아도 콘텐츠 종류에 맞는 공유 경로로 연다.
|
||||
const shareUrl = buildContentShareUrl(API_URL, contentId, contentType);
|
||||
|
||||
const handleCopyLink = async () => {
|
||||
try {
|
||||
await navigator.clipboard.writeText(shareUrl);
|
||||
} catch {
|
||||
// clipboard API 미지원 환경에서는 무시
|
||||
}
|
||||
setCopied(true);
|
||||
setTimeout(() => setCopied(false), 2000);
|
||||
};
|
||||
|
||||
const handleShareButtonClick = async () => {
|
||||
const handled = await tryNativeShare({
|
||||
title: content?.store_name ?? t('videoDetail.kakaoDefaultTitle'),
|
||||
url: shareUrl,
|
||||
});
|
||||
if (handled) {
|
||||
return;
|
||||
}
|
||||
await handleCopyLink();
|
||||
};
|
||||
|
||||
const handleLike = async () => {
|
||||
if (!authed) {
|
||||
setShowLoginModal(true);
|
||||
return;
|
||||
}
|
||||
|
||||
if (likeSubmitting) return;
|
||||
const prevLiked = isLiked;
|
||||
const prevCount = likeCount;
|
||||
setLikeSubmitting(true);
|
||||
setIsLiked(!prevLiked);
|
||||
setLikeCount(prevLiked ? prevCount - 1 : prevCount + 1);
|
||||
try {
|
||||
const result = await toggleVideoLike(contentId, contentType);
|
||||
setIsLiked(result.is_liked);
|
||||
setLikeCount(result.like_count);
|
||||
} catch (err) {
|
||||
console.error('Failed to toggle content like:', err);
|
||||
setIsLiked(prevLiked);
|
||||
setLikeCount(prevCount);
|
||||
} finally {
|
||||
setLikeSubmitting(false);
|
||||
}
|
||||
};
|
||||
|
||||
const handleHeaderAction = () => {
|
||||
onClose?.();
|
||||
};
|
||||
|
||||
const handleCommentFocus = () => {
|
||||
if (!authed) setShowLoginModal(true);
|
||||
};
|
||||
|
||||
const handleCommentSubmit = async () => {
|
||||
if (!authed) {
|
||||
setShowLoginModal(true);
|
||||
return;
|
||||
}
|
||||
if (!commentInput.trim() || commentSubmitting) return;
|
||||
setCommentSubmitting(true);
|
||||
try {
|
||||
await postVideoComment(contentId, commentInput.trim(), undefined, contentType);
|
||||
setCommentInput('');
|
||||
if (commentTextareaRef.current) {
|
||||
commentTextareaRef.current.style.height = 'auto';
|
||||
}
|
||||
await fetchComments(1);
|
||||
} catch (err) {
|
||||
console.error('Failed to post content comment:', err);
|
||||
} finally {
|
||||
setCommentSubmitting(false);
|
||||
}
|
||||
};
|
||||
|
||||
const handleDeleteComment = async (commentId: number) => {
|
||||
try {
|
||||
await deleteComment(commentId);
|
||||
await fetchComments(commentsPage);
|
||||
} catch (err) {
|
||||
console.error('Failed to delete content comment:', err);
|
||||
}
|
||||
};
|
||||
|
||||
const renderCommentContent = (content_: string | null, isDeleted: boolean) => {
|
||||
if (isDeleted) {
|
||||
return (
|
||||
<span style={{ color: '#6B9EA0', fontStyle: 'italic' }}>
|
||||
{t('videoDetail.deletedComment')}
|
||||
</span>
|
||||
);
|
||||
}
|
||||
return content_;
|
||||
};
|
||||
|
||||
return (
|
||||
<div className={isModal ? 'video-detail-modal-content' : 'video-detail-page-content'}>
|
||||
{/* 헤더 */}
|
||||
<div className="video-detail-header">
|
||||
{isModal ? (
|
||||
<>
|
||||
{/* 제목이 없으면 space-between 인 헤더에서 닫기 버튼이 왼쪽으로 붙는다.
|
||||
문구는 ADO2 상세와 같은 키를 쓴다 — 통합 목록에서 열리는 같은
|
||||
모달이므로 콘텐츠 종류에 따라 제목이 바뀌면 오히려 어색하다. */}
|
||||
<h2 className="video-detail-modal-title">{t('sidebar.ado2Contents')}</h2>
|
||||
<button className="video-detail-close-btn" onClick={handleHeaderAction} aria-label={t('videoDetail.closeAriaLabel')}>
|
||||
<svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
|
||||
<line x1="18" y1="6" x2="6" y2="18" /><line x1="6" y1="6" x2="18" y2="18" />
|
||||
</svg>
|
||||
</button>
|
||||
</>
|
||||
) : (
|
||||
<button className="video-detail-back-btn" onClick={handleHeaderAction}>
|
||||
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" stroke="currentColor" strokeWidth="1.5">
|
||||
<path d="M13 4l-6 6 6 6" />
|
||||
</svg>
|
||||
{t('sidebar.ado2Contents')}
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className="video-detail-body">
|
||||
{loading ? (
|
||||
<div className="ado2-contents-loading">
|
||||
<div className="loading-spinner"></div>
|
||||
<p>{t('ado2Contents.loading')}</p>
|
||||
</div>
|
||||
) : error ? (
|
||||
<div className="ado2-contents-error"><p>{error}</p></div>
|
||||
) : content ? (
|
||||
<div className={`video-detail-content ${isLandscape ? 'landscape' : ''}`}>
|
||||
<div className="video-detail-player-wrap">
|
||||
<video
|
||||
src={content.video_url}
|
||||
poster={content.poster_url ?? undefined}
|
||||
controls
|
||||
autoPlay
|
||||
playsInline
|
||||
controlsList="nodownload"
|
||||
onContextMenu={(e) => e.preventDefault()}
|
||||
className="video-detail-player"
|
||||
onLoadedMetadata={(e) => {
|
||||
const v = e.currentTarget;
|
||||
setIsLandscape(v.videoWidth > v.videoHeight);
|
||||
}}
|
||||
onTimeUpdate={(e) => {
|
||||
if (!content.official_site_url) return;
|
||||
const v = e.currentTarget;
|
||||
// 영상 종료 3초 전부터 공식 홈페이지 오버레이 노출
|
||||
setShowSiteOverlay(
|
||||
Number.isFinite(v.duration) && v.duration - v.currentTime <= 3
|
||||
);
|
||||
}}
|
||||
/>
|
||||
{showSiteOverlay && isSafeHttpUrl(content.official_site_url) && (
|
||||
<a
|
||||
href={content.official_site_url as string}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="video-site-overlay"
|
||||
>
|
||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
|
||||
<circle cx="12" cy="12" r="10"/>
|
||||
<line x1="2" y1="12" x2="22" y2="12"/>
|
||||
<path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"/>
|
||||
</svg>
|
||||
<span className="video-site-overlay-text">
|
||||
<strong>{content.store_name}</strong>
|
||||
{t('videoDetail.siteOverlayLabel')}
|
||||
</span>
|
||||
</a>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className="video-detail-info">
|
||||
<h2 className="video-detail-store">
|
||||
{content.store_name || t('ssulbox.viewer.untitled')}
|
||||
</h2>
|
||||
<p className="video-detail-date">{formatDate(content.created_at)}</p>
|
||||
|
||||
{/* 좋아요 + 공유 */}
|
||||
<div style={{ display: 'flex', gap: '8px', flexWrap: 'wrap' }}>
|
||||
<button
|
||||
className={`video-detail-like-btn ${isLiked ? 'liked' : ''}`}
|
||||
onClick={handleLike}
|
||||
disabled={likeSubmitting}
|
||||
>
|
||||
<svg width="16" height="16" viewBox="0 0 24 24" fill={isLiked ? 'currentColor' : 'none'} stroke="currentColor" strokeWidth="2">
|
||||
<path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z" />
|
||||
</svg>
|
||||
{likeCount}
|
||||
</button>
|
||||
<button
|
||||
className="video-detail-copy-btn"
|
||||
onClick={handleShareButtonClick}
|
||||
title={t('videoDetail.share')}
|
||||
>
|
||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
|
||||
<circle cx="18" cy="5" r="3" /><circle cx="6" cy="12" r="3" /><circle cx="18" cy="19" r="3" />
|
||||
<line x1="8.59" y1="13.51" x2="15.42" y2="17.49" /><line x1="15.41" y1="6.51" x2="8.59" y2="10.49" />
|
||||
</svg>
|
||||
{copied ? t('videoDetail.copied') : t('videoDetail.share')}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{/* 댓글 섹션 */}
|
||||
<div className="video-detail-comments">
|
||||
<div className="video-detail-comments-header">
|
||||
<h3 className="video-detail-comments-title">{t('videoDetail.commentsTitle')}</h3>
|
||||
<span className="video-detail-comments-count">{commentsTotal}</span>
|
||||
</div>
|
||||
|
||||
{authed && currentUser && (
|
||||
<div className="video-detail-comment-profile">
|
||||
{currentUser.profile_image_url && (
|
||||
<img
|
||||
src={currentUser.profile_image_url}
|
||||
alt={currentUser.nickname}
|
||||
className="video-detail-comment-avatar"
|
||||
/>
|
||||
)}
|
||||
<span className="video-detail-comment-nickname">{currentUser.nickname}</span>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div className="video-detail-comment-input-wrap">
|
||||
<textarea
|
||||
ref={commentTextareaRef}
|
||||
className="video-detail-comment-input"
|
||||
placeholder={authed ? t('videoDetail.commentPlaceholder') : t('videoDetail.commentLoginRequired')}
|
||||
maxLength={500}
|
||||
rows={1}
|
||||
value={commentInput}
|
||||
onChange={(e) => {
|
||||
setCommentInput(e.target.value);
|
||||
e.target.style.height = 'auto';
|
||||
e.target.style.height = `${e.target.scrollHeight}px`;
|
||||
}}
|
||||
onFocus={handleCommentFocus}
|
||||
onKeyDown={(e) => {
|
||||
if (e.key === 'Enter' && !e.shiftKey) {
|
||||
e.preventDefault();
|
||||
handleCommentSubmit();
|
||||
}
|
||||
}}
|
||||
disabled={!authed}
|
||||
/>
|
||||
<button
|
||||
className="video-detail-comment-submit"
|
||||
onClick={handleCommentSubmit}
|
||||
disabled={!authed || !commentInput.trim() || commentSubmitting}
|
||||
>
|
||||
{commentSubmitting ? t('videoDetail.commentSubmitting') : t('videoDetail.commentSubmit')}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{comments.length === 0 && !commentsLoading ? (
|
||||
<p className="video-detail-comments-empty">{t('videoDetail.noComments')}</p>
|
||||
) : (
|
||||
<ul className="video-detail-comment-list">
|
||||
{comments.map((c) => (
|
||||
<li key={c.id} className="video-detail-comment-item">
|
||||
{c.profile_image_url && (
|
||||
<img
|
||||
src={c.profile_image_url}
|
||||
alt={c.nickname || t('videoDetail.anonymous')}
|
||||
className="video-detail-comment-avatar"
|
||||
/>
|
||||
)}
|
||||
<div className="video-detail-comment-body">
|
||||
<span className="video-detail-comment-nickname">
|
||||
{c.nickname || t('videoDetail.anonymous')}
|
||||
</span>
|
||||
<p className="video-detail-comment-text">
|
||||
{renderCommentContent(c.content, c.is_deleted)}
|
||||
</p>
|
||||
<div className="video-detail-comment-bottom">
|
||||
<span className="video-detail-comment-date">{formatCommentDate(c.created_at)}</span>
|
||||
{c.is_mine && !c.is_deleted && (
|
||||
<button
|
||||
className="video-detail-comment-delete"
|
||||
onClick={() => handleDeleteComment(c.id)}
|
||||
>
|
||||
{t('videoDetail.deleteComment')}
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{c.replies && c.replies.length > 0 && (
|
||||
<ul className="video-detail-reply-list">
|
||||
{c.replies.map((r) => (
|
||||
<li key={r.id} className="video-detail-reply-item">
|
||||
{r.profile_image_url && (
|
||||
<img
|
||||
src={r.profile_image_url}
|
||||
alt={r.nickname || t('videoDetail.anonymous')}
|
||||
className="video-detail-comment-avatar small"
|
||||
/>
|
||||
)}
|
||||
<div className="video-detail-comment-body">
|
||||
<span className="video-detail-comment-nickname">
|
||||
{r.nickname || t('videoDetail.anonymous')}
|
||||
</span>
|
||||
<p className="video-detail-comment-text">
|
||||
{renderCommentContent(r.content, r.is_deleted)}
|
||||
</p>
|
||||
<div className="video-detail-comment-bottom">
|
||||
<span className="video-detail-comment-date">{formatCommentDate(r.created_at)}</span>
|
||||
{r.is_mine && !r.is_deleted && (
|
||||
<button
|
||||
className="video-detail-comment-delete"
|
||||
onClick={() => handleDeleteComment(r.id)}
|
||||
>
|
||||
{t('videoDetail.deleteComment')}
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
)}
|
||||
</div>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
)}
|
||||
|
||||
{commentsHasNext && (
|
||||
<button
|
||||
className="video-detail-comments-more"
|
||||
onClick={() => fetchComments(commentsPage + 1, true)}
|
||||
disabled={commentsLoading}
|
||||
>
|
||||
{commentsLoading ? t('videoDetail.loadingComments') : t('videoDetail.loadMoreComments')}
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
) : null}
|
||||
</div>
|
||||
|
||||
{showLoginModal && (
|
||||
<LoginPromptModal onClose={() => setShowLoginModal(false)} />
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default ContentDetailContent;
|
||||
@@ -0,0 +1,55 @@
|
||||
import React, { useEffect } from 'react';
|
||||
import { VideoListItem } from '../types/api';
|
||||
import { useOverlayClose } from '../hooks/useOverlayClose';
|
||||
import ContentDetailContent from './ContentDetailContent';
|
||||
import { isP2vContent } from '../utils/p2vApi';
|
||||
|
||||
interface P2vViewerModalProps {
|
||||
/** null 이면 닫힘 */
|
||||
item: VideoListItem | null;
|
||||
onClose: () => void;
|
||||
}
|
||||
|
||||
/**
|
||||
* P2V(무빙 포스터·롱컷) 콘텐츠 재생 모달 — `SsulViewerModal` 과 같은 백드롭 래퍼.
|
||||
*
|
||||
* 공개 상세 API 를 사용하며 공유 상세 화면과 같은 소셜 기능을 제공한다.
|
||||
*/
|
||||
const P2vViewerModal: React.FC<P2vViewerModalProps> = ({ item, onClose }) => {
|
||||
|
||||
useEffect(() => {
|
||||
if (!item) return;
|
||||
const prev = document.body.style.overflow;
|
||||
document.body.style.overflow = 'hidden';
|
||||
|
||||
const handleKeyDown = (e: KeyboardEvent) => {
|
||||
if (e.key === 'Escape') onClose();
|
||||
};
|
||||
document.addEventListener('keydown', handleKeyDown);
|
||||
|
||||
return () => {
|
||||
document.body.style.overflow = prev;
|
||||
document.removeEventListener('keydown', handleKeyDown);
|
||||
};
|
||||
}, [item, onClose]);
|
||||
|
||||
const overlayCloseHandlers = useOverlayClose(onClose);
|
||||
|
||||
if (!item || !isP2vContent(item.type)) return null;
|
||||
|
||||
return (
|
||||
<div className="video-detail-overlay" {...overlayCloseHandlers}>
|
||||
<div className="video-detail-modal-box" onClick={(e) => e.stopPropagation()}>
|
||||
<ContentDetailContent
|
||||
key={`${item.type}-${item.video_id}`}
|
||||
contentId={String(item.video_id)}
|
||||
contentType={item.type}
|
||||
isModal
|
||||
onClose={onClose}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default P2vViewerModal;
|
||||
@@ -1,23 +1,42 @@
|
||||
import React from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { BookIcon, PosterVideoIcon, StorefrontIcon } from './pipelineIcons';
|
||||
|
||||
/** 생성할 콘텐츠 종류. 진입 화면에서 고르면 이후 플로우 전체가 갈린다. */
|
||||
export type Pipeline = 'ado2' | 'ssul';
|
||||
/**
|
||||
* 생성할 콘텐츠 종류. 진입 화면에서 고르면 이후 플로우 전체가 갈린다.
|
||||
*
|
||||
* poster·playreel 은 castad 백엔드의 `/p2v/*` 를 쓴다(utils/p2vApi.ts, utils/playreelApi.ts).
|
||||
*/
|
||||
export type Pipeline = 'ado2' | 'ssul' | 'poster' | 'playreel';
|
||||
|
||||
/** 유효한 파이프라인 값인가 — localStorage 복원 때 쓴다 */
|
||||
export const PIPELINES: readonly Pipeline[] = ['ado2', 'ssul', 'poster', 'playreel'];
|
||||
|
||||
export const isPipeline = (value: unknown): value is Pipeline =>
|
||||
typeof value === 'string' && (PIPELINES as readonly string[]).includes(value);
|
||||
|
||||
interface PipelineTabsProps {
|
||||
value: Pipeline;
|
||||
onChange: (value: Pipeline) => void;
|
||||
}
|
||||
|
||||
const TABS: { id: Pipeline; labelKey: string; emoji?: string }[] = [
|
||||
{ id: 'ado2', labelKey: 'pipelineTabs.ado2' },
|
||||
{ id: 'ssul', labelKey: 'pipelineTabs.ssul', emoji: '📋' },
|
||||
const TABS: { id: Pipeline; labelKey: string; Icon: React.FC<{ size?: number }> }[] = [
|
||||
{ id: 'ado2', labelKey: 'pipelineTabs.ado2', Icon: StorefrontIcon },
|
||||
{ id: 'ssul', labelKey: 'pipelineTabs.ssul', Icon: BookIcon },
|
||||
{ id: 'poster', labelKey: 'pipelineTabs.poster', Icon: PosterVideoIcon },
|
||||
];
|
||||
|
||||
/**
|
||||
* ADO2 / 썰박스 전환 탭 (밑줄 탭).
|
||||
* 파이프라인 전환 탭 (아이콘 타일 + 기능명).
|
||||
*
|
||||
* 밑줄 탭에서 타일로 바꾼 이유: 파이프라인이 2개일 때는 글자만으로 충분했지만
|
||||
* 4개가 되자 "포스터 영상"과 "포스터 스타일"처럼 **글자가 겹치는 항목**이 생겨
|
||||
* 훑어볼 때 구분이 안 됐다. 형태(아이콘)가 붙으면 읽지 않고도 갈라진다.
|
||||
*
|
||||
* 색은 파이프라인별로 나누지 않는다 — 참조한 레퍼런스는 항목마다 파스텔색을 쓰지만,
|
||||
* ADO2 는 민트 액센트 + 퍼플 CTA 한 곳이 규칙이라 4색을 쓰면 팔레트가 깨진다.
|
||||
* 구분은 형태로, 상태(선택)는 민트로 나눈다.
|
||||
*
|
||||
* 활성 탭 아래에만 밑줄이 얹히고, 색이 민트(ADO2) ↔ 앰버(썰박스)로 바뀐다.
|
||||
* 스타일은 generation-flow.css 의 `.pipeline-tabs*` 참조.
|
||||
*
|
||||
* 접근성: castad 의 기존 탭(`.myinfo-tab` 등)에는 role/aria 가 없지만,
|
||||
@@ -25,29 +44,29 @@ const TABS: { id: Pipeline; labelKey: string; emoji?: string }[] = [
|
||||
*/
|
||||
const PipelineTabs: React.FC<PipelineTabsProps> = ({ value, onChange }) => {
|
||||
const { t } = useTranslation();
|
||||
// 롱컷은 무빙 포스터 안의 두 번째 갈래라 별도 탭이 없다. 그 안에 있을 때도 무빙 포스터 탭을 켠다
|
||||
const active: Pipeline = value === 'playreel' ? 'poster' : value;
|
||||
|
||||
return (
|
||||
<div
|
||||
className="pipeline-tabs"
|
||||
data-active={value}
|
||||
data-active={active}
|
||||
role="tablist"
|
||||
aria-label={t('pipelineTabs.ariaLabel')}
|
||||
>
|
||||
{TABS.map((tab) => (
|
||||
{TABS.map(({ id, labelKey, Icon }) => (
|
||||
<button
|
||||
key={tab.id}
|
||||
key={id}
|
||||
type="button"
|
||||
role="tab"
|
||||
aria-selected={value === tab.id}
|
||||
aria-selected={active === id}
|
||||
className="pipeline-tab"
|
||||
onClick={() => onChange(tab.id)}
|
||||
onClick={() => onChange(id)}
|
||||
>
|
||||
{tab.emoji && (
|
||||
<span className="pipeline-tab__emoji" aria-hidden="true">
|
||||
{tab.emoji}
|
||||
</span>
|
||||
)}
|
||||
{t(tab.labelKey)}
|
||||
<span className="pipeline-tab__tile">
|
||||
<Icon size={24} />
|
||||
</span>
|
||||
<span className="pipeline-tab__label">{t(labelKey)}</span>
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,106 @@
|
||||
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
interface PosterDropzoneProps {
|
||||
file: File | null;
|
||||
onFile: (file: File | null) => void;
|
||||
}
|
||||
|
||||
/**
|
||||
* 해상도 하한. **차단하지 않고 알리기만 한다** —
|
||||
* 지자체·소상공인 포스터는 고해상도 원본 수급이 어려운 게 현실이라
|
||||
* 막아버리면 실제 소재의 상당수가 들어오지 못한다.
|
||||
*/
|
||||
const SOFT_LONG_EDGE = 1000;
|
||||
|
||||
const ACCEPTED = /^image\/(jpeg|png|webp|gif)$/;
|
||||
|
||||
/**
|
||||
* 포스터 업로드 드롭존. F1(영상)·F2(스타일링) 양쪽이 쓴다.
|
||||
*
|
||||
* 입력창을 4:5 세로로 두는 것은 포스터가 세로물이기 때문이다 — 가로 박스에 세로
|
||||
* 이미지를 넣으면 미리보기가 작게 박혀 무엇을 올렸는지 확인이 안 된다.
|
||||
*/
|
||||
const PosterDropzone: React.FC<PosterDropzoneProps> = ({ file, onFile }) => {
|
||||
const { t } = useTranslation();
|
||||
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);
|
||||
|
||||
// objectURL 은 명시적으로 놓아줘야 한다. 시연 중 포스터를 여러 장 갈아 끼우면
|
||||
// 해제 안 된 URL 이 그대로 쌓인다(castad 의 revokeAllPreviews 와 같은 이유).
|
||||
useEffect(() => {
|
||||
return () => {
|
||||
if (preview) URL.revokeObjectURL(preview);
|
||||
};
|
||||
}, [preview]);
|
||||
|
||||
const accept = useCallback((f: File) => {
|
||||
if (!ACCEPTED.test(f.type)) {
|
||||
setError(t('poster.dropzone.badType'));
|
||||
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 ? t('poster.dropzone.lowRes', { edge }) : null);
|
||||
setPreview((prev) => {
|
||||
if (prev) URL.revokeObjectURL(prev);
|
||||
return url;
|
||||
});
|
||||
onFile(f);
|
||||
};
|
||||
img.onerror = () => {
|
||||
URL.revokeObjectURL(url);
|
||||
setError(t('poster.dropzone.badType'));
|
||||
};
|
||||
img.src = url;
|
||||
}, [onFile, t]);
|
||||
|
||||
return (
|
||||
<div className="p2v-dropzone-wrap">
|
||||
<div
|
||||
className={`p2v-dropzone${preview ? ' has-file' : ''}${dragging ? ' dragging' : ''}`}
|
||||
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);
|
||||
}}
|
||||
>
|
||||
{preview ? (
|
||||
<img src={preview} alt={t('poster.dropzone.previewAlt')} />
|
||||
) : (
|
||||
<div className="p2v-dropzone__empty">
|
||||
<p className="p2v-dropzone__cta">{t('poster.dropzone.cta')}</p>
|
||||
<p className="p2v-dropzone__hint">{t('poster.dropzone.formats')}</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 className="p2v-note warn">{error}</p>}
|
||||
{notice && <p className="p2v-note">{notice}</p>}
|
||||
{file && (
|
||||
<p className="p2v-note">
|
||||
{file.name} · {(file.size / 1024 / 1024).toFixed(1)}MB
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default PosterDropzone;
|
||||
@@ -122,6 +122,15 @@ const SettingsPanel: React.FC<SettingsPanelProps> = ({
|
||||
</button>
|
||||
)}
|
||||
|
||||
<a href="/faq.html" className="settings-panel-item" onClick={onClose}>
|
||||
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5" aria-hidden="true">
|
||||
<circle cx="12" cy="12" r="9" />
|
||||
<path d="M9.1 9a3 3 0 0 1 5.8 1c0 2-3 2-3 4" />
|
||||
<path d="M12 17h.01" />
|
||||
</svg>
|
||||
<span>{t('sidebar.faq')}</span>
|
||||
</a>
|
||||
|
||||
<a
|
||||
href="https://forms.gle/4a8mGebBYtdesvby9"
|
||||
target="_blank"
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
import React, { useState, useEffect, useRef } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { getSocialAccounts, uploadToSocial, waitForUploadComplete, TokenExpiredError, handleSocialReconnect, getAutoSeoYoutube } from '../utils/api';
|
||||
import { SocialAccount, VideoListItem, SocialUploadStatusResponse } from '../types/api';
|
||||
import { SocialAccount, SocialUploadableItem, SocialUploadStatusResponse } from '../types/api';
|
||||
import UploadProgressModal, { UploadStatus } from './UploadProgressModal';
|
||||
import { useOverlayClose } from '../hooks/useOverlayClose';
|
||||
|
||||
interface SocialPostingModalProps {
|
||||
isOpen: boolean;
|
||||
onClose: () => void;
|
||||
video: VideoListItem | null;
|
||||
video: SocialUploadableItem | null;
|
||||
onGoToCalendar?: () => void;
|
||||
}
|
||||
|
||||
@@ -199,8 +199,8 @@ const SocialPostingModal: React.FC<SocialPostingModalProps> = ({
|
||||
|
||||
const now = Date.now();
|
||||
const seoKey =
|
||||
video?.type === 'ssul'
|
||||
? `ssul:${video.video_id}`
|
||||
video && video.type !== 'video'
|
||||
? `${video.type}:${video.video_id}`
|
||||
: video?.task_id || null;
|
||||
const expired = now - loadedAtRef.current > SEO_CACHE_TTL;
|
||||
|
||||
@@ -244,20 +244,20 @@ const SocialPostingModal: React.FC<SocialPostingModalProps> = ({
|
||||
/**
|
||||
* 제목·설명·태그 자동 채움.
|
||||
*
|
||||
* `seoKey` 는 호출부가 만든 캐시 키다(ADO2=task_id, 썰박스=`ssul:{id}`).
|
||||
* 백엔드에 보낼 식별자는 종류마다 다르다 — ADO2 는 task_id(UUID), 썰박스는
|
||||
* ssul_content.id 문자열이며, 서버가 content_type 으로 어느 테이블을 볼지 가른다.
|
||||
* `seoKey` 는 호출부가 만든 캐시 키다(ADO2=task_id, 썰박스=`ssul:{id}`, 무빙 포스터=`p2v_video:{id}`).
|
||||
* 백엔드에 보낼 식별자는 종류마다 다르다 — ADO2 는 task_id(UUID), 썰박스·무빙 포스터는
|
||||
* 콘텐츠 id 문자열이며, 서버가 content_type 으로 어느 테이블을 볼지 가른다.
|
||||
*/
|
||||
const loadAutocomplete = async (seoKey: string) => {
|
||||
if (!video) return;
|
||||
const isSsul = video.type === 'ssul';
|
||||
if (!isSsul && !video.task_id) return;
|
||||
const byContentId = video.type !== 'video';
|
||||
if (!byContentId && !video.task_id) return;
|
||||
|
||||
setIsLoadingAutoDescription(true);
|
||||
try {
|
||||
const requestPayload = {
|
||||
content_type: video.type,
|
||||
task_id: isSsul ? String(video.video_id) : video.task_id,
|
||||
task_id: byContentId ? String(video.video_id) : video.task_id,
|
||||
};
|
||||
const autoSeoResponse = await getAutoSeoYoutube(requestPayload);
|
||||
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
import React from 'react';
|
||||
|
||||
/**
|
||||
* 파이프라인 타일 아이콘.
|
||||
*
|
||||
* ADO2 Design System 의 아이콘 규칙을 그대로 따른다(`assets/icons/*.svg`):
|
||||
* viewBox 24×24 · fill none · stroke currentColor · stroke-width 2 · round cap/join
|
||||
*
|
||||
* 색은 넣지 않는다 — currentColor 로 두고 타일이 상태(민트/회색)를 정한다.
|
||||
* 파이프라인마다 다른 색을 주면 ADO2 팔레트(민트 액센트 + 퍼플 CTA 한 곳)가 깨진다.
|
||||
* 구분은 **형태**로만 한다.
|
||||
*/
|
||||
|
||||
interface IconProps {
|
||||
size?: number;
|
||||
}
|
||||
|
||||
const base = (size: number) => ({
|
||||
width: size,
|
||||
height: size,
|
||||
viewBox: '0 0 24 24',
|
||||
fill: 'none',
|
||||
stroke: 'currentColor',
|
||||
strokeWidth: 2,
|
||||
strokeLinecap: 'round' as const,
|
||||
strokeLinejoin: 'round' as const,
|
||||
});
|
||||
|
||||
/** ADO2 — 업체(가게)를 분석해 콘텐츠를 만든다 → 상점 차양 */
|
||||
export const StorefrontIcon: React.FC<IconProps> = ({ size = 24 }) => (
|
||||
<svg {...base(size)} aria-hidden="true">
|
||||
<path d="M4 10v9a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1v-9" />
|
||||
<path d="M3 10l1.4-4.3A1 1 0 0 1 5.35 5h13.3a1 1 0 0 1 .95.7L21 10a2.5 2.5 0 0 1-4.5 1.5A2.5 2.5 0 0 1 12 11.4a2.5 2.5 0 0 1-4.5.1A2.5 2.5 0 0 1 3 10z" />
|
||||
<path d="M10 20v-5h4v5" />
|
||||
</svg>
|
||||
);
|
||||
|
||||
/** 썰박스 — 역사 이야기 → 펼친 책 */
|
||||
export const BookIcon: React.FC<IconProps> = ({ size = 24 }) => (
|
||||
<svg {...base(size)} aria-hidden="true">
|
||||
<path d="M12 7.5v12" />
|
||||
<path d="M3 5h5a4 4 0 0 1 4 2.5V19.5A3 3 0 0 0 9.5 18H3V5z" />
|
||||
<path d="M21 5h-5a4 4 0 0 0-4 2.5V19.5A3 3 0 0 1 14.5 18H21V5z" />
|
||||
</svg>
|
||||
);
|
||||
|
||||
/**
|
||||
* 무빙 포스터 — 포스터가 영상이 된다 → 세로 포스터 + 재생.
|
||||
*
|
||||
* 프레임은 2:3 세로다(12×18). 가로 프레임으로 그리면 일반 '동영상' 아이콘과
|
||||
* 구별되지 않는다 — 소재가 **포스터**라는 점이 이 기능의 정체성이라 비율로 드러낸다.
|
||||
*/
|
||||
export const PosterVideoIcon: React.FC<IconProps> = ({ size = 24 }) => (
|
||||
<svg {...base(size)} aria-hidden="true">
|
||||
<rect x="6" y="3" width="12" height="18" rx="2" />
|
||||
{/* 재생 삼각형만 채운다 — 아웃라인으로 그리면 이 크기에서 뭉개진다 */}
|
||||
<path d="M10.5 9v6l4.2-3z" fill="currentColor" />
|
||||
</svg>
|
||||
);
|
||||
@@ -0,0 +1,7 @@
|
||||
import { P2vJob, getPosterJob, isP2vActive } from '../utils/p2vApi';
|
||||
import { UsePolledJobResult, usePolledJob } from './usePolledJob';
|
||||
|
||||
/** 무빙 포스터 잡 폴링. 검수 대기·완료·실패에서는 멈춘다 */
|
||||
export function useP2vJob(id: string | null): UsePolledJobResult<P2vJob> {
|
||||
return usePolledJob(id, getPosterJob, isP2vActive);
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
import { PlayreelJob, getPlayreelJob } from '../utils/playreelApi';
|
||||
import { UsePolledJobResult, usePolledJob } from './usePolledJob';
|
||||
|
||||
const isActive = (job: PlayreelJob): boolean => job.status === 'queued' || job.status === 'running';
|
||||
|
||||
/** 롱컷 잡 폴링. 검수 게이트(awaiting_review)에서는 멈춘다 */
|
||||
export function usePlayreelJob(id: string | null): UsePolledJobResult<PlayreelJob> {
|
||||
return usePolledJob(id, getPlayreelJob, isActive);
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
import { useCallback, useEffect, useRef, useState } from 'react';
|
||||
import { P2vNotFoundError } from '../utils/p2vApi';
|
||||
|
||||
export interface UsePolledJobResult<T> {
|
||||
job: T | null;
|
||||
error: string | null;
|
||||
/** 404 — 서버에 없는 잡이다. 호출부가 화면을 처음으로 되돌려야 한다 */
|
||||
notFound: boolean;
|
||||
/** 즉시 1회 조회하고, 멈춰 있던 폴링을 다시 켠다 (승인·재시도 직후에 쓴다) */
|
||||
refresh: () => void;
|
||||
}
|
||||
|
||||
const POLL_INTERVAL = 2500;
|
||||
|
||||
/**
|
||||
* P2V 잡 폴링 훅(무빙 포스터·롱컷 공용).
|
||||
*
|
||||
* castad 에는 웹소켓이 없고 썰박스도 폴링(`waitForSsulComplete`)이라 같은 방식을 쓴다.
|
||||
* 다만 썰박스는 "끝날 때까지 기다리는" 재귀 함수인 반면 이쪽은 **중간 상태를 계속
|
||||
* 그려야** 한다 — 검수 게이트에서 멈춰 사용자 입력을 기다리기 때문이다.
|
||||
*
|
||||
* 폴링은 활성(`isActive`) 상태에서만 돈다. 검수 대기·완료·실패는 사용자가 뭔가
|
||||
* 하기 전까지 절대 안 바뀌므로 계속 두드리면 서버만 때린다. 승인·재시도 후에는
|
||||
* 호출부가 refresh() 로 다시 켠다.
|
||||
*
|
||||
* `fetchJob`·`isActive` 는 모듈 상수여야 한다 — 바뀌면 폴링이 다시 시작된다.
|
||||
*/
|
||||
export function usePolledJob<T>(
|
||||
id: string | null,
|
||||
fetchJob: (id: string) => Promise<T>,
|
||||
isActive: (job: T) => boolean,
|
||||
): UsePolledJobResult<T> {
|
||||
const [job, setJob] = useState<T | null>(null);
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
const [notFound, setNotFound] = useState(false);
|
||||
const timerRef = useRef<ReturnType<typeof setInterval> | null>(null);
|
||||
|
||||
const stop = useCallback(() => {
|
||||
if (timerRef.current) {
|
||||
clearInterval(timerRef.current);
|
||||
timerRef.current = null;
|
||||
}
|
||||
}, []);
|
||||
|
||||
const fetchOnce = useCallback(async (jobId: string) => {
|
||||
try {
|
||||
const next = await fetchJob(jobId);
|
||||
setJob(next);
|
||||
setError(null);
|
||||
setNotFound(false);
|
||||
if (!isActive(next)) stop();
|
||||
} catch (e) {
|
||||
if (e instanceof P2vNotFoundError) {
|
||||
setNotFound(true);
|
||||
stop(); // 없는 잡은 다시 생기지 않는다
|
||||
return;
|
||||
}
|
||||
setError((e as Error).message);
|
||||
}
|
||||
}, [fetchJob, isActive, stop]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!id) {
|
||||
setJob(null);
|
||||
setError(null);
|
||||
setNotFound(false);
|
||||
stop();
|
||||
return;
|
||||
}
|
||||
// 잡이 바뀌면 이전 잡의 상태가 한 틱 남아 보이므로 먼저 비운다
|
||||
setJob(null);
|
||||
setNotFound(false);
|
||||
fetchOnce(id);
|
||||
timerRef.current = setInterval(() => fetchOnce(id), POLL_INTERVAL);
|
||||
return stop;
|
||||
}, [id, fetchOnce, stop]);
|
||||
|
||||
const refresh = useCallback(() => {
|
||||
if (!id) return;
|
||||
fetchOnce(id);
|
||||
if (!timerRef.current) {
|
||||
timerRef.current = setInterval(() => fetchOnce(id), POLL_INTERVAL);
|
||||
}
|
||||
}, [id, fetchOnce]);
|
||||
|
||||
return { job, error, notFound, refresh };
|
||||
}
|
||||
+293
-1
@@ -22,6 +22,7 @@
|
||||
"loggingOut": "Logging out...",
|
||||
"logout": "Log Out",
|
||||
"inquiry": "Feedback",
|
||||
"faq": "FAQ (Korean)",
|
||||
"login": "Log In",
|
||||
"settings": "Settings"
|
||||
},
|
||||
@@ -603,7 +604,14 @@
|
||||
"pipelineTabs": {
|
||||
"ariaLabel": "Content type",
|
||||
"ado2": "ADO2",
|
||||
"ssul": "Ssulbox"
|
||||
"ssul": "Ssulbox",
|
||||
"poster": "Moving Poster",
|
||||
"desc": {
|
||||
"ado2": "One business URL becomes a brand analysis, lyrics, music and a short-form video.",
|
||||
"ssul": "Weaves a business into a historical story people watch to the end.",
|
||||
"poster": "One event poster becomes a short-form video with narration, music and camera moves.",
|
||||
"playreel": "One show ticket page link becomes a 30-second vertical trailer, with checks at key moments."
|
||||
}
|
||||
},
|
||||
"ssulbox": {
|
||||
"steps": {
|
||||
@@ -622,5 +630,289 @@
|
||||
"submit": "Create Ssulbox",
|
||||
"submitting": "Requesting…"
|
||||
}
|
||||
},
|
||||
"poster": {
|
||||
"start": {
|
||||
"title": "How do you want to start?",
|
||||
"subtitle": "Choose by what you have. Both end as 9:16 vertical videos.",
|
||||
"badge": "With the detail page",
|
||||
"back": "‹ Choose again",
|
||||
"comingSoon": "Coming soon",
|
||||
"image": {
|
||||
"title": "Start with an image",
|
||||
"desc": "A single poster comes alive from its original first frame as an 8–15 sec moving poster",
|
||||
"flow": {
|
||||
"first": "Start with the original poster",
|
||||
"move": "Add motion to flames, water and lights",
|
||||
"narration": "Add title and date narration with music"
|
||||
},
|
||||
"facts": {
|
||||
"need": {
|
||||
"label": "You need",
|
||||
"value": "1 image"
|
||||
},
|
||||
"review": {
|
||||
"label": "Check",
|
||||
"value": "1 time"
|
||||
},
|
||||
"time": {
|
||||
"label": "Time",
|
||||
"value": "About 3 min"
|
||||
}
|
||||
},
|
||||
"cta": "Upload poster"
|
||||
},
|
||||
"url": {
|
||||
"title": "Start with a show page",
|
||||
"desc": "One ticket page link becomes a 30-sec trailer with casting, schedule and story",
|
||||
"flow": {
|
||||
"first": "Start with a moving poster · 8 sec",
|
||||
"move": "Introduce the story, cast and schedule",
|
||||
"narration": "Finish with booking details and a QR code"
|
||||
},
|
||||
"facts": {
|
||||
"need": {
|
||||
"label": "You need",
|
||||
"value": "Ticket page URL"
|
||||
},
|
||||
"review": {
|
||||
"label": "Check",
|
||||
"value": "5 times"
|
||||
},
|
||||
"time": {
|
||||
"label": "Time",
|
||||
"value": "About 15 min"
|
||||
}
|
||||
},
|
||||
"cta": "Enter link"
|
||||
}
|
||||
},
|
||||
"steps": {
|
||||
"upload": "Upload",
|
||||
"analyze": "Analyze",
|
||||
"review": "Review",
|
||||
"render": "Generate",
|
||||
"done": "Done"
|
||||
},
|
||||
"dropzone": {
|
||||
"cta": "Drop a poster here\nor click to choose",
|
||||
"formats": "JPG · PNG · WEBP · GIF\nNo resolution limit",
|
||||
"badType": "Only JPG / PNG / WEBP / GIF files are accepted.",
|
||||
"lowRes": "Long edge is {{edge}}px. You can proceed; deep zoom segments may look soft.",
|
||||
"previewAlt": "Poster preview"
|
||||
},
|
||||
"create": {
|
||||
"step": "STEP 1 · Upload poster",
|
||||
"namePlaceholder": "Event name (leave blank to auto-detect)",
|
||||
"cost": "Cost",
|
||||
"costValue": "3 credits",
|
||||
"submit": "Create short-form",
|
||||
"submitting": "Uploading…"
|
||||
},
|
||||
"making": {
|
||||
"titleAnalyze": "Analyzing the poster",
|
||||
"titleRender": "Generating the video",
|
||||
"descAnalyze": "Detecting regions and drafting narration and motion. The review screen opens when this finishes.",
|
||||
"descRender": "Voice, music, animation and compositing follow. The music step can take a few minutes.",
|
||||
"phaseAnalyze": "Analyzing",
|
||||
"phaseRender": "Generating",
|
||||
"failTitle": "Generation failed",
|
||||
"refunded": "Generation failed and the credits used were refunded. Please start a new one.",
|
||||
"discard": "Start over",
|
||||
"discardConfirm": "This deletes the job and every generated video, audio and analysis file. This cannot be undone."
|
||||
},
|
||||
"review": {
|
||||
"narration": "Narration review",
|
||||
"motion": "Elements to animate",
|
||||
"metadata": "Metadata",
|
||||
"field": {
|
||||
"event_name": "Event",
|
||||
"date_text": "Date",
|
||||
"place": "Place"
|
||||
},
|
||||
"analysis": "Poster analysis",
|
||||
"approve": "Approve and continue",
|
||||
"approving": "Approving…"
|
||||
},
|
||||
"result": {
|
||||
"title": "Your moving poster is ready",
|
||||
"fileName": "File name",
|
||||
"downloadThumb": "Still JPG",
|
||||
"downloadVideo": "Download MP4",
|
||||
"new": "Start a new poster"
|
||||
}
|
||||
},
|
||||
"playreel": {
|
||||
"auto": {
|
||||
"title": "Auto-approval settings",
|
||||
"done": "Step {{step}} {{name}} was auto-approved.",
|
||||
"gate": "Step {{step}} · {{name}}",
|
||||
"fetch_confirm": "Use the details and default sections read from the page as they are",
|
||||
"narration_confirm": "Continue with the generated lines and the default voice",
|
||||
"switchLabel": "Auto-approve {{name}}",
|
||||
"lockedTitle": "Steps 2 · 4 · 5",
|
||||
"lockedDesc": "These steps cannot be undone, so they always need your check",
|
||||
"working": "Auto-approving step {{step}} {{name}}",
|
||||
"hint": "You can turn this off on the start screen.",
|
||||
"failed": "Auto-approval failed — please review it yourself. {{message}}"
|
||||
},
|
||||
"steps": {
|
||||
"input": "Link",
|
||||
"prepare": "Collect",
|
||||
"review": "Review",
|
||||
"render": "Generate",
|
||||
"done": "Done"
|
||||
},
|
||||
"create": {
|
||||
"step": "STEP 1 · Show page link",
|
||||
"placeholder": "Paste the show's ticket page link",
|
||||
"recognized": "Product {{id}} recognized",
|
||||
"unsupported": "This link is not supported yet. Enter a show ticket page link.",
|
||||
"submit": "Create trailer",
|
||||
"submitting": "Reading the page…"
|
||||
},
|
||||
"stages": {
|
||||
"fetch": "Fetch",
|
||||
"split": "Sections",
|
||||
"upscale": "Upscale",
|
||||
"analyze": "Analyze",
|
||||
"motion": "Motion",
|
||||
"narration": "Narration",
|
||||
"tts": "Voice",
|
||||
"bgm": "Music",
|
||||
"i2v": "Generate",
|
||||
"hybrid": "Overlay",
|
||||
"compose": "Compose",
|
||||
"review": "Review"
|
||||
},
|
||||
"running": {
|
||||
"fetch": "Fetching the poster and details from the page",
|
||||
"split": "Splitting the detail page into sections",
|
||||
"upscale": "Enhancing the poster (about 1 min)",
|
||||
"analyze": "Finding elements that can move",
|
||||
"motion": "Writing the motion prompt",
|
||||
"narration": "Writing the narration",
|
||||
"tts": "Reading the narration aloud",
|
||||
"bgm": "Composing background music (may take a few minutes)",
|
||||
"i2v": "Animating the poster (5–8 min)",
|
||||
"hybrid": "Re-applying the original lettering",
|
||||
"compose": "Composing with the page scroll",
|
||||
"review": "Running automatic checks"
|
||||
},
|
||||
"making": {
|
||||
"title": "Creating your trailer",
|
||||
"preparing": "Preparing",
|
||||
"queued": "Queued",
|
||||
"wait": "The next review request will appear here. The job keeps running if you close the window.",
|
||||
"failTitle": "Generation failed",
|
||||
"refunded": "Generation failed and the credits used were refunded. Please start a new one.",
|
||||
"discard": "Start over",
|
||||
"discardConfirm": "This deletes the job and all generated video, audio and analysis files. This cannot be undone."
|
||||
},
|
||||
"gate": {
|
||||
"progress": "Review {{step}} / {{total}} · {{name}}",
|
||||
"next": "Next · {{next}} · {{eta}}",
|
||||
"approve": "Approve and continue",
|
||||
"approveFinal": "Approve and save",
|
||||
"approveClip": "Continue with this clip",
|
||||
"working": "Working…",
|
||||
"back": "‹ Previous step",
|
||||
"redo": "Regenerate"
|
||||
},
|
||||
"gates": {
|
||||
"fetch_confirm": {
|
||||
"name": "Collection check",
|
||||
"title": "Check this is the right show and choose what to include",
|
||||
"why": "The video is built from details taken from the page. The casting schedule is always included.",
|
||||
"next": "Poster enhancement · element analysis",
|
||||
"eta": "about 2 min"
|
||||
},
|
||||
"analysis_confirm": {
|
||||
"name": "Motion check",
|
||||
"title": "Choose what moves in the poster",
|
||||
"why": "Approving starts video generation and cannot be undone. Title, logo and figures stay exactly as in the original.",
|
||||
"next": "Kling 3.0 video generation",
|
||||
"eta": "about 5–8 min"
|
||||
},
|
||||
"narration_confirm": {
|
||||
"name": "Narration check",
|
||||
"title": "Check the narration and the voice",
|
||||
"why": "These sentences are read exactly as written. The casting schedule notice and the date/CTA lines are required.",
|
||||
"next": "Voice synthesis · music generation",
|
||||
"eta": "about 3 min"
|
||||
},
|
||||
"clip_confirm": {
|
||||
"name": "Clip review",
|
||||
"title": "Check the generated scene",
|
||||
"why": "This is the result of an automatic check that the title is intact. Regenerating starts over from the beginning.",
|
||||
"next": "Original lettering overlay · page scroll composition",
|
||||
"eta": "about 5 min"
|
||||
},
|
||||
"final_confirm": {
|
||||
"name": "Final review",
|
||||
"title": "Check the finished trailer",
|
||||
"why": "Approving locks this version and saves it to My Contents. Later changes become a new version.",
|
||||
"next": "Save · download",
|
||||
"eta": "instant"
|
||||
}
|
||||
},
|
||||
"fetch": {
|
||||
"info": "Show details",
|
||||
"field": {
|
||||
"title": "Title",
|
||||
"date_text": "Dates",
|
||||
"place": "Venue"
|
||||
},
|
||||
"cast": "Cast · {{cast}}",
|
||||
"sections": "Where to start scrolling the detail page",
|
||||
"sectionsHelp": "The detail page is scrolled continuously from the chosen point. Pieces are not cut and pasted.",
|
||||
"sectionsCount": "{{chosen}} of {{total}} selected · the casting schedule is always included.",
|
||||
"lowRes": "The poster is only {{width}}px wide. It is enhanced 2x in the next step. If you have the original file, uploading it in Moving Poster looks sharper.",
|
||||
"poster": "Poster"
|
||||
},
|
||||
"analysis": {
|
||||
"movable": "Elements that move",
|
||||
"movableHelp": "The camera does not move. Only elements like light, smoke and fabric come alive.",
|
||||
"fixed": "Keep as original",
|
||||
"fixedHelp": "Original pixels are laid back over the generated frames. The title never changes by a single pixel.",
|
||||
"model": "Generation model",
|
||||
"modelValue": "Kling 3.0 pro · 8 sec",
|
||||
"ipRisk": "This is a known IP (e.g. Disney). Other models have been rejected by copyright filters, so only Kling is used. If it fails, an artwork push-in is used instead.",
|
||||
"noQr": "The poster has no QR code, so the ending band QR is generated from the product page link.",
|
||||
"grid": "Element analysis (5% grid)"
|
||||
},
|
||||
"narration": {
|
||||
"lines": "Narration · {{count}} lines",
|
||||
"voice": "Voice",
|
||||
"sampleMissing": "Sample coming soon",
|
||||
"estimate": "Estimated length",
|
||||
"seconds": "{{value}}s",
|
||||
"target": "Target {{min}}–{{max}}s",
|
||||
"adjust": "shorten or lengthen the lines"
|
||||
},
|
||||
"clip": {
|
||||
"missing": "Generated 8-sec clip",
|
||||
"titleCheck": "Title integrity check",
|
||||
"passed": "Passed · title deviation {{mae}}",
|
||||
"failed": "Failed · title deviation {{mae}}",
|
||||
"criteria": "Threshold 4.0 or less, compared pixel by pixel with the original title.",
|
||||
"frames": "Frames at 5 points",
|
||||
"redoNote": "Regenerating repeats video generation from the start. The original-lettering overlay on this clip is not redone."
|
||||
},
|
||||
"final": {
|
||||
"missing": "Finished video {{seconds}}s",
|
||||
"checks": "Automatic checks",
|
||||
"proof": "Proof sheet",
|
||||
"version": "Approving locks this as v{{version}}."
|
||||
},
|
||||
"result": {
|
||||
"title": "Trailer ready",
|
||||
"videoMissing": "The video file could not be found.",
|
||||
"fileName": "File name",
|
||||
"source": "Source ·",
|
||||
"sourceLink": "Open the show page →",
|
||||
"download": "Download MP4",
|
||||
"new": "Create a new trailer"
|
||||
}
|
||||
}
|
||||
}
|
||||
+330
-5
@@ -22,6 +22,7 @@
|
||||
"loggingOut": "로그아웃 중...",
|
||||
"logout": "로그아웃",
|
||||
"inquiry": "고객의견",
|
||||
"faq": "자주 묻는 질문",
|
||||
"login": "로그인",
|
||||
"settings": "설정"
|
||||
},
|
||||
@@ -603,7 +604,14 @@
|
||||
"pipelineTabs": {
|
||||
"ariaLabel": "생성할 콘텐츠 종류",
|
||||
"ado2": "ADO2",
|
||||
"ssul": "썰박스"
|
||||
"ssul": "썰박스",
|
||||
"poster": "무빙 포스터",
|
||||
"desc": {
|
||||
"ado2": "업체 URL 하나로 브랜드를 분석해 가사·음악·숏폼 영상까지 자동 제작합니다.",
|
||||
"ssul": "유명 역사 스토리에 업체 셀링포인트를 녹여 흥미로운 숏폼 콘텐츠를 만듭니다.",
|
||||
"poster": "포스터가 나레이션, 음악, 애니메이션을 추가한 숏폼 콘텐츠로 나옵니다.",
|
||||
"playreel": "공연 상품페이지 주소 하나로 30초 세로 예고편을 만듭니다. 중요한 순간마다 확인을 요청합니다."
|
||||
}
|
||||
},
|
||||
"ssulbox": {
|
||||
"steps": {
|
||||
@@ -613,13 +621,13 @@
|
||||
},
|
||||
"create": {
|
||||
"step1": "STEP 1 · 시나리오 선택",
|
||||
"step2": "STEP 2 · 업장 검색",
|
||||
"step2": "STEP 2 · 업체 검색",
|
||||
"searchPlaceholder": "업체명 또는 URL을 입력하세요.",
|
||||
"searchButton": "검색",
|
||||
"searching": "검색 중",
|
||||
"placeLoading": "가게를 찾는 중… (몇 초 걸려요)",
|
||||
"hintUrlOk": "네이버 링크로 이 가게를 직접 크롤링합니다.",
|
||||
"hintDefault": "업체의 사진과 정보를 크롤링해 썰박스에 사용합니다.",
|
||||
"placeLoading": "업체를 찾는 중… (몇 초 걸려요)",
|
||||
"hintUrlOk": "네이버 링크로 해당 업체를 직접 수집합니다.",
|
||||
"hintDefault": "업체를 선택하면 해당 업체의 사진과 정보를 수집해 썰박스에 씁니다.",
|
||||
"hintScenario": "{{name}} 시나리오로 약 5~6분 소요됩니다.",
|
||||
"noResult": "검색 결과가 없어요. 이름을 바꾸거나 네이버 지도 링크를 붙여넣어 주세요.",
|
||||
"cost": "생성 비용",
|
||||
@@ -671,5 +679,322 @@
|
||||
"desc": "오디세우스 10년 귀향 대모험"
|
||||
}
|
||||
}
|
||||
},
|
||||
"poster": {
|
||||
"start": {
|
||||
"title": "어떻게 시작할까요?",
|
||||
"subtitle": "가진 것에 따라 고르세요. 둘 다 9:16 세로 영상으로 완성됩니다.",
|
||||
"badge": "상세페이지까지",
|
||||
"back": "‹ 다시 선택",
|
||||
"comingSoon": "준비 중",
|
||||
"image": {
|
||||
"title": "이미지로 시작하기",
|
||||
"desc": "포스터 한 장이 첫 프레임 그대로 살아나는 8~15초 무빙포스터",
|
||||
"flow": {
|
||||
"first": "포스터 원본으로 시작",
|
||||
"move": "불꽃·물결·조명에 움직임 추가",
|
||||
"narration": "제목·일시 나레이션과 음악 추가"
|
||||
},
|
||||
"facts": {
|
||||
"need": {
|
||||
"label": "필요한 것",
|
||||
"value": "이미지 1장"
|
||||
},
|
||||
"review": {
|
||||
"label": "확인",
|
||||
"value": "1회"
|
||||
},
|
||||
"time": {
|
||||
"label": "시간",
|
||||
"value": "약 3분"
|
||||
}
|
||||
},
|
||||
"cta": "포스터 올리기"
|
||||
},
|
||||
"url": {
|
||||
"title": "공연상품페이지로 시작하기",
|
||||
"desc": "상품페이지 주소 하나로 캐스팅·일정·줄거리까지 담긴 30초 예고편",
|
||||
"flow": {
|
||||
"first": "포스터 무빙으로 시작 · 8초",
|
||||
"move": "줄거리·캐스팅·일정 소개",
|
||||
"narration": "예매 안내와 QR로 마무리"
|
||||
},
|
||||
"facts": {
|
||||
"need": {
|
||||
"label": "필요한 것",
|
||||
"value": "상품페이지 URL"
|
||||
},
|
||||
"review": {
|
||||
"label": "확인",
|
||||
"value": "5회"
|
||||
},
|
||||
"time": {
|
||||
"label": "시간",
|
||||
"value": "약 15분"
|
||||
}
|
||||
},
|
||||
"cta": "주소 넣기"
|
||||
}
|
||||
},
|
||||
"steps": {
|
||||
"upload": "업로드",
|
||||
"analyze": "분석",
|
||||
"review": "검수",
|
||||
"render": "생성",
|
||||
"done": "완성"
|
||||
},
|
||||
"dropzone": {
|
||||
"cta": "포스터를 끌어다 놓거나\n클릭해서 선택",
|
||||
"formats": "JPG · PNG · WEBP · GIF\n해상도 제한 없음",
|
||||
"badType": "JPG / PNG / WEBP / GIF 파일만 올릴 수 있습니다.",
|
||||
"lowRes": "긴 변 {{edge}}px입니다. 그대로 진행할 수 있고, 깊은 줌 구간만 다소 부드럽게 보일 수 있습니다.",
|
||||
"previewAlt": "포스터 미리보기"
|
||||
},
|
||||
"create": {
|
||||
"step": "STEP 1 · 포스터 업로드",
|
||||
"namePlaceholder": "행사 이름을 입력하세요 (비우면 자동 추출)",
|
||||
"cost": "생성 비용",
|
||||
"costValue": "3 크레딧",
|
||||
"submit": "숏폼 만들기",
|
||||
"submitting": "업로드 중…"
|
||||
},
|
||||
"making": {
|
||||
"titleAnalyze": "포스터를 분석하고 있어요",
|
||||
"titleRender": "영상을 만들고 있어요",
|
||||
"descAnalyze": "영역을 검출하고 나레이션·모션을 초안으로 작성합니다. 끝나면 검수 화면이 열립니다.",
|
||||
"descRender": "음성·음악·애니메이션·합성이 이어집니다. 음악 단계는 몇 분 걸릴 수 있습니다.",
|
||||
"phaseAnalyze": "분석 중",
|
||||
"phaseRender": "생성 중",
|
||||
"failTitle": "생성에 실패했어요",
|
||||
"refunded": "생성에 실패해 사용한 크레딧은 환불되었습니다. 새로 만들어 주세요.",
|
||||
"discard": "처음부터",
|
||||
"discardConfirm": "이 작업과 만들어진 영상·음성·분석 파일을 모두 지웁니다. 되돌릴 수 없습니다."
|
||||
},
|
||||
"stages": {
|
||||
"detect": "영역 검출",
|
||||
"narration_text": "나레이션",
|
||||
"motion": "모션 선정",
|
||||
"tts": "음성",
|
||||
"bgm": "음악",
|
||||
"i2v": "애니메이션",
|
||||
"render": "합성",
|
||||
"transfer": "변환"
|
||||
},
|
||||
"review": {
|
||||
"narration": "나레이션 검수",
|
||||
"narrationHelp": "자동 작성된 문장을 확인하고 필요하면 고쳐주세요. 이대로 음성이 됩니다.",
|
||||
"motion": "움직일 요소",
|
||||
"motionHelp": "포스터에서 찾은 요소입니다. 빼거나 더할 수 있습니다.",
|
||||
"motionEmpty": "움직일 요소를 찾지 못했습니다. 직접 고르거나, 비워두면 애니메이션 없이 진행됩니다.",
|
||||
"metadata": "메타태그",
|
||||
"metadataHelp": "아카이브에 영구 저장됩니다. 연도나 지명이 잘못 읽혔는지 포스터와 대조해 주세요.",
|
||||
"field": {
|
||||
"event_name": "행사명",
|
||||
"date_text": "일시",
|
||||
"place": "장소"
|
||||
},
|
||||
"analysis": "포스터 분석 결과",
|
||||
"analysisAlt": "영역 분석 확인 이미지",
|
||||
"analysisMissing": "분석 이미지가 없습니다",
|
||||
"approve": "승인하고 계속",
|
||||
"approving": "승인 중…"
|
||||
},
|
||||
"motion": {
|
||||
"firework": "불꽃놀이",
|
||||
"water": "물살",
|
||||
"wave": "파도",
|
||||
"cloud": "구름",
|
||||
"smoke": "연기",
|
||||
"moon": "달",
|
||||
"sun": "해",
|
||||
"star": "별",
|
||||
"light": "조명",
|
||||
"flag": "깃발·천",
|
||||
"foliage": "나뭇잎·풀",
|
||||
"wheel": "바퀴·관람차",
|
||||
"vessel": "배",
|
||||
"crowd": "사람 무리"
|
||||
},
|
||||
"result": {
|
||||
"title": "무빙 포스터가 완성됐어요",
|
||||
"fileName": "파일명",
|
||||
"videoMissing": "영상 파일을 찾지 못했습니다.",
|
||||
"downloadThumb": "정지 컷 JPG",
|
||||
"downloadVideo": "MP4 다운로드",
|
||||
"new": "새 포스터로 만들기"
|
||||
}
|
||||
},
|
||||
"playreel": {
|
||||
"auto": {
|
||||
"title": "자동화 승인 단계 설정",
|
||||
"done": "{{step}}단계 {{name}}을 자동 승인했습니다.",
|
||||
"gate": "{{step}}단계 · {{name}}",
|
||||
"fetch_confirm": "상세페이지에서 읽은 정보와 기본 섹션을 그대로 사용",
|
||||
"narration_confirm": "자동 생성 문장과 기본 목소리로 바로 진행",
|
||||
"switchLabel": "{{name}} 자동 승인",
|
||||
"lockedTitle": "2 · 4 · 5단계",
|
||||
"lockedDesc": "되돌릴 수 없는 단계라 항상 확인합니다",
|
||||
"working": "{{step}}단계 {{name}}을 자동 승인하는 중",
|
||||
"hint": "시작 화면에서 끌 수 있습니다.",
|
||||
"failed": "자동 승인 실패 — 직접 확인해 주세요. {{message}}"
|
||||
},
|
||||
"steps": {
|
||||
"input": "주소 입력",
|
||||
"prepare": "수집·분석",
|
||||
"review": "확인",
|
||||
"render": "생성",
|
||||
"done": "완성"
|
||||
},
|
||||
"create": {
|
||||
"step": "STEP 1 · 공연 상품페이지 주소",
|
||||
"placeholder": "공연 상품페이지 주소를 붙여넣으세요",
|
||||
"recognized": "상품 {{id}} 인식됨",
|
||||
"unsupported": "아직 지원하지 않는 주소입니다. 공연 상품페이지 주소를 넣어주세요.",
|
||||
"submit": "예고편 만들기",
|
||||
"submitting": "상세페이지 읽는 중…"
|
||||
},
|
||||
"stages": {
|
||||
"fetch": "수집",
|
||||
"split": "섹션",
|
||||
"upscale": "화질",
|
||||
"analyze": "요소",
|
||||
"motion": "연출",
|
||||
"narration": "나레이션",
|
||||
"tts": "음성",
|
||||
"bgm": "음악",
|
||||
"i2v": "생성",
|
||||
"hybrid": "합성",
|
||||
"compose": "조립",
|
||||
"review": "검수"
|
||||
},
|
||||
"running": {
|
||||
"fetch": "상세페이지에서 포스터와 정보를 가져오는 중",
|
||||
"split": "상세페이지를 섹션으로 나누는 중",
|
||||
"upscale": "포스터 화질을 보정하는 중 (약 1분)",
|
||||
"analyze": "포스터에서 움직일 요소를 찾는 중",
|
||||
"motion": "연출 프롬프트를 쓰는 중",
|
||||
"narration": "나레이션 문장을 쓰는 중",
|
||||
"tts": "나레이션을 읽는 중",
|
||||
"bgm": "배경음악을 만드는 중 (몇 분 걸릴 수 있습니다)",
|
||||
"i2v": "포스터를 움직이는 중 (5~8분)",
|
||||
"hybrid": "원본 글자를 다시 덮는 중",
|
||||
"compose": "상세페이지 스크롤과 함께 조립하는 중",
|
||||
"review": "자동 검사 중"
|
||||
},
|
||||
"making": {
|
||||
"title": "예고편을 만들고 있어요",
|
||||
"preparing": "준비 중",
|
||||
"queued": "대기 중",
|
||||
"wait": "다음 확인 요청이 오면 이 화면에 나타납니다. 창을 닫아도 작업은 계속됩니다.",
|
||||
"failTitle": "생성에 실패했어요",
|
||||
"refunded": "생성에 실패해 사용한 크레딧은 환불되었습니다. 새로 만들어 주세요.",
|
||||
"discard": "처음부터",
|
||||
"discardConfirm": "이 작업과 만들어진 영상·음성·분석 파일을 모두 지웁니다. 되돌릴 수 없습니다."
|
||||
},
|
||||
"gate": {
|
||||
"progress": "확인 {{step}} / {{total}} · {{name}}",
|
||||
"next": "다음 단계 · {{next}} · {{eta}}",
|
||||
"approve": "승인하고 계속",
|
||||
"approveFinal": "승인하고 저장",
|
||||
"approveClip": "이 클립으로 계속",
|
||||
"working": "처리 중…",
|
||||
"back": "‹ 이전 단계로",
|
||||
"redo": "다시 만들기"
|
||||
},
|
||||
"gates": {
|
||||
"fetch_confirm": {
|
||||
"name": "수집 확인",
|
||||
"title": "이 공연이 맞는지, 어떤 부분을 넣을지 확인해 주세요",
|
||||
"why": "상세페이지에서 가져온 정보로 영상의 뼈대를 만듭니다. 캐스팅 스케줄은 항상 들어갑니다.",
|
||||
"next": "포스터 화질 보정 · 요소 분석",
|
||||
"eta": "약 2분"
|
||||
},
|
||||
"analysis_confirm": {
|
||||
"name": "연출 확인",
|
||||
"title": "포스터에서 무엇을 움직일지 정해주세요",
|
||||
"why": "승인하면 영상 생성이 시작되고 되돌릴 수 없습니다. 제목·로고·인물은 원본 그대로 고정됩니다.",
|
||||
"next": "Kling 3.0 영상 생성",
|
||||
"eta": "약 5~8분"
|
||||
},
|
||||
"narration_confirm": {
|
||||
"name": "나레이션 확인",
|
||||
"title": "나레이션 문장과 목소리를 확인해 주세요",
|
||||
"why": "이 문장이 그대로 읽힙니다. 캐스팅 스케줄 안내와 일시·CTA 문장은 꼭 필요합니다.",
|
||||
"next": "음성 합성 · 배경음악 생성",
|
||||
"eta": "약 3분"
|
||||
},
|
||||
"clip_confirm": {
|
||||
"name": "클립 검수",
|
||||
"title": "생성된 장면을 확인해 주세요",
|
||||
"why": "제목이 깨지지 않았는지 자동 검사한 결과입니다. 다시 만들면 처음부터 다시 만듭니다.",
|
||||
"next": "원본 글자 합성 · 상세페이지 스크롤 조립",
|
||||
"eta": "약 5분"
|
||||
},
|
||||
"final_confirm": {
|
||||
"name": "최종 검수",
|
||||
"title": "완성된 예고편을 확인해 주세요",
|
||||
"why": "승인하면 이 버전이 고정되어 내 콘텐츠에 저장됩니다. 이후 수정은 새 버전으로 만들어집니다.",
|
||||
"next": "저장 · 다운로드",
|
||||
"eta": "즉시"
|
||||
}
|
||||
},
|
||||
"fetch": {
|
||||
"info": "공연 정보",
|
||||
"field": {
|
||||
"title": "공연명",
|
||||
"date_text": "일시",
|
||||
"place": "장소"
|
||||
},
|
||||
"cast": "캐스트 · {{cast}}",
|
||||
"sections": "상세페이지에서 훑기 시작할 지점",
|
||||
"sectionsHelp": "고른 지점부터 상세페이지를 이어서 훑습니다. 조각을 잘라 붙이는 것이 아닙니다.",
|
||||
"sectionsCount": "{{total}}개 중 {{chosen}}개 선택 · 캐스팅 스케줄은 항상 포함됩니다.",
|
||||
"lowRes": "포스터가 {{width}}px로 작습니다. 다음 단계에서 화질을 2배 보정합니다. 원본 파일이 있으면 무빙 포스터에서 직접 올리는 편이 더 선명합니다.",
|
||||
"poster": "포스터"
|
||||
},
|
||||
"analysis": {
|
||||
"movable": "움직일 요소",
|
||||
"movableHelp": "카메라는 움직이지 않습니다. 빛·안개·천 같은 요소만 살아납니다.",
|
||||
"fixed": "원본 그대로 고정",
|
||||
"fixedHelp": "생성된 화면 위에 원본 픽셀을 다시 덮습니다. 제목은 한 픽셀도 바뀌지 않습니다.",
|
||||
"model": "생성 모델",
|
||||
"modelValue": "Kling 3.0 pro · 8초",
|
||||
"ipRisk": "알려진 IP(디즈니 등) 작품입니다. 다른 모델은 저작권 필터로 거부된 이력이 있어 Kling으로만 진행합니다. 실패하면 아트워크 푸시인으로 대체됩니다.",
|
||||
"noQr": "포스터에 QR이 없어 엔딩 밴드 QR은 상품 페이지 링크로 자동 생성합니다.",
|
||||
"grid": "요소 분석 (5% 격자)"
|
||||
},
|
||||
"narration": {
|
||||
"lines": "나레이션 {{count}}문장",
|
||||
"voice": "목소리",
|
||||
"sampleMissing": "샘플 준비 중",
|
||||
"estimate": "예상 길이",
|
||||
"seconds": "{{value}}초",
|
||||
"target": "목표 {{min}}~{{max}}초",
|
||||
"adjust": "문장을 줄이거나 늘려주세요"
|
||||
},
|
||||
"clip": {
|
||||
"missing": "생성 클립 8초",
|
||||
"titleCheck": "제목 훼손 검사",
|
||||
"passed": "통과 · 제목대 편차 {{mae}}",
|
||||
"failed": "실패 · 제목대 편차 {{mae}}",
|
||||
"criteria": "기준 4.0 이하. 원본 제목과 픽셀 단위로 비교한 값입니다.",
|
||||
"frames": "5시점 프레임",
|
||||
"redoNote": "다시 만들기는 영상 생성을 처음부터 반복합니다. 이 클립 위에 원본 글자를 덮는 합성은 다시 만들지 않습니다."
|
||||
},
|
||||
"final": {
|
||||
"missing": "완성본 {{seconds}}초",
|
||||
"checks": "자동 확인 항목",
|
||||
"proof": "proof 시트",
|
||||
"version": "승인하면 v{{version}}으로 고정됩니다."
|
||||
},
|
||||
"result": {
|
||||
"title": "예고편 완성",
|
||||
"videoMissing": "영상 파일을 찾지 못했습니다.",
|
||||
"fileName": "파일명",
|
||||
"source": "출처 ·",
|
||||
"sourceLink": "공연 상품페이지 열기 →",
|
||||
"download": "MP4 다운로드",
|
||||
"new": "새 예고편 만들기"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,13 @@
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { getAllVideos } from '../../utils/api';
|
||||
import { isP2vContent } from '../../utils/p2vApi';
|
||||
import { VideoListItem } from '../../types/api';
|
||||
import VideoDetailModal from '../../components/VideoDetailModal';
|
||||
import CitySelectModal from '../../components/CitySelectModal';
|
||||
import ContentCardSocialActions from '../../components/ContentCardSocialActions';
|
||||
import SsulViewerModal from '../Ssulbox/SsulViewerModal';
|
||||
import P2vViewerModal from '../../components/P2vViewerModal';
|
||||
|
||||
interface ADO2ContentsPageProps {
|
||||
onBack?: () => void;
|
||||
@@ -17,6 +19,7 @@ const ADO2ContentsPage: React.FC<ADO2ContentsPageProps> = () => {
|
||||
// 썰박스는 별도 뷰어를 쓴다 — VideoDetailModal 은 video_id 로 조회하므로
|
||||
// 썰박스 id 를 넘기면 id 가 겹치는 다른 영상이 열린다.
|
||||
const [selectedSsul, setSelectedSsul] = useState<VideoListItem | null>(null);
|
||||
const [selectedP2v, setSelectedP2v] = useState<VideoListItem | null>(null);
|
||||
const [videos, setVideos] = useState<VideoListItem[]>([]);
|
||||
const [total, setTotal] = useState(0);
|
||||
const [loading, setLoading] = useState(true);
|
||||
@@ -149,17 +152,21 @@ const ADO2ContentsPage: React.FC<ADO2ContentsPageProps> = () => {
|
||||
className="ado2-content-card"
|
||||
style={{ cursor: 'pointer' }}
|
||||
onClick={() =>
|
||||
video.type === 'ssul'
|
||||
? setSelectedSsul(video)
|
||||
: handleCardClick(video.video_id)
|
||||
isP2vContent(video.type)
|
||||
? setSelectedP2v(video)
|
||||
: video.type === 'ssul'
|
||||
? setSelectedSsul(video)
|
||||
: handleCardClick(video.video_id)
|
||||
}
|
||||
role="button"
|
||||
tabIndex={0}
|
||||
onKeyDown={(e) =>
|
||||
e.key === 'Enter' &&
|
||||
(video.type === 'ssul'
|
||||
? setSelectedSsul(video)
|
||||
: handleCardClick(video.video_id))
|
||||
(isP2vContent(video.type)
|
||||
? setSelectedP2v(video)
|
||||
: video.type === 'ssul'
|
||||
? setSelectedSsul(video)
|
||||
: handleCardClick(video.video_id))
|
||||
}
|
||||
>
|
||||
<div className="content-card-thumbnail ado2-gallery-thumbnail-wrap">
|
||||
@@ -202,8 +209,7 @@ const ADO2ContentsPage: React.FC<ADO2ContentsPageProps> = () => {
|
||||
<h3 className="content-card-title">{video.store_name}</h3>
|
||||
<div className="content-card-meta">
|
||||
<p className="content-card-date">{formatDate(video.created_at)}</p>
|
||||
{/* 좋아요·댓글 API 가 type 을 받으므로 썰박스에도 노출한다.
|
||||
contentType 이 없으면 id 가 겹치는 다른 영상에 반영된다. */}
|
||||
{/* 모든 콘텐츠는 ID 와 종류를 함께 보내 소셜 반응을 구분한다. */}
|
||||
<ContentCardSocialActions
|
||||
videoId={video.video_id}
|
||||
contentType={video.type}
|
||||
@@ -243,6 +249,7 @@ const ADO2ContentsPage: React.FC<ADO2ContentsPageProps> = () => {
|
||||
)}
|
||||
|
||||
<SsulViewerModal item={selectedSsul} onClose={() => setSelectedSsul(null)} />
|
||||
<P2vViewerModal item={selectedP2v} onClose={() => setSelectedP2v(null)} />
|
||||
|
||||
{selectedVideoId !== null && (
|
||||
<VideoDetailModal
|
||||
|
||||
@@ -146,7 +146,7 @@ const AssetManagementContent: React.FC<AssetManagementContentProps> = ({
|
||||
const handleDrop = (e: React.DragEvent) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
const files = Array.from(e.dataTransfer.files).filter(isImageInputFile);
|
||||
const files = Array.from<File>(e.dataTransfer.files).filter(isImageInputFile);
|
||||
if (files.length > 0) void runAddImages(files);
|
||||
};
|
||||
|
||||
|
||||
@@ -30,10 +30,20 @@ const revokeAllPreviews = (items: ImageItem[]) => {
|
||||
}
|
||||
});
|
||||
};
|
||||
import { Pipeline } from '../../components/PipelineTabs';
|
||||
import { Pipeline, isPipeline } from '../../components/PipelineTabs';
|
||||
import { Scen } from '../Ssulbox/ssulData';
|
||||
import SsulMakingContent, { SsulJob } from '../Ssulbox/SsulMakingContent';
|
||||
import SsulResultContent from '../Ssulbox/SsulResultContent';
|
||||
import PosterMakingContent from '../Poster/PosterMakingContent';
|
||||
import PosterReviewContent from '../Poster/PosterReviewContent';
|
||||
import PosterResultContent from '../Poster/PosterResultContent';
|
||||
import PlayreelMakingContent from '../P2v/PlayreelMakingContent';
|
||||
import PlayreelGateContent from '../P2v/PlayreelGateContent';
|
||||
import PlayreelResultContent from '../P2v/PlayreelResultContent';
|
||||
import { usePlayreelJob } from '../../hooks/usePlayreelJob';
|
||||
import { GateKey, deletePlayreelJob } from '../../utils/playreelApi';
|
||||
import { useP2vJob } from '../../hooks/useP2vJob';
|
||||
import { deletePosterJob, isPastReview } from '../../utils/p2vApi';
|
||||
import {
|
||||
K,
|
||||
clearProjectStorage,
|
||||
@@ -72,6 +82,40 @@ const SSUL_STEP_INDEX: Record<SsulStep, number> = {
|
||||
result: 2,
|
||||
};
|
||||
|
||||
/**
|
||||
* 포스터 영상(F1) 진행 단계. 잡 status 에서 파생되므로 state 로 들지 않는다 —
|
||||
* 서버 상태와 화면 상태를 따로 들면 반드시 어긋난다(썰박스에서 겪은 것).
|
||||
*/
|
||||
type PosterStep = 'entry' | 'making' | 'review' | 'result';
|
||||
|
||||
/** 롱컷(Playreel) 진행 단계. 포스터와 같은 이유로 잡 status 에서 파생한다 */
|
||||
type PlayreelStep = 'entry' | 'making' | 'review' | 'result';
|
||||
|
||||
/**
|
||||
* 롱컷 스텝퍼 라벨. 검수 게이트가 5번이라 게이트마다 칸을 두면 너무 길어진다 —
|
||||
* 승인 전 준비(수집·분석) / 확인 / 승인 후 생성으로 묶는다.
|
||||
*/
|
||||
const PLAYREEL_STEP_LABELS = [
|
||||
'playreel.steps.input',
|
||||
'playreel.steps.prepare',
|
||||
'playreel.steps.review',
|
||||
'playreel.steps.render',
|
||||
'playreel.steps.done',
|
||||
] as const;
|
||||
|
||||
/**
|
||||
* 스텝퍼 라벨. 5단계인 이유는 검수 게이트 **앞뒤가 서로 다른 작업**이기 때문이다 —
|
||||
* 분석(검출·나레이션·모션)과 생성(음성·음악·애니메이션·렌더)을 한 칸에 묶으면
|
||||
* 승인 후에도 스텝퍼가 안 움직여 멈춘 것처럼 보인다.
|
||||
*/
|
||||
const POSTER_STEP_LABELS = [
|
||||
'poster.steps.upload',
|
||||
'poster.steps.analyze',
|
||||
'poster.steps.review',
|
||||
'poster.steps.render',
|
||||
'poster.steps.done',
|
||||
] as const;
|
||||
|
||||
interface BusinessInfo {
|
||||
customer_name: string;
|
||||
region: string;
|
||||
@@ -164,7 +208,7 @@ const GenerationFlow: React.FC<GenerationFlowProps> = ({
|
||||
const getInitialPipeline = (): Pipeline => {
|
||||
// 1) 랜딩 CTA 프리셋 (1회성). 카카오 로그인 리다이렉트 왕복을 견뎌야 해서 sessionStorage
|
||||
const pending = sessionStorage.getItem(PENDING_PIPELINE_KEY);
|
||||
if (pending === 'ssul' || pending === 'ado2') {
|
||||
if (isPipeline(pending)) {
|
||||
sessionStorage.removeItem(PENDING_PIPELINE_KEY);
|
||||
return pending;
|
||||
}
|
||||
@@ -172,7 +216,7 @@ const GenerationFlow: React.FC<GenerationFlowProps> = ({
|
||||
if (initialAnalysisData || savedAnalysisData) return 'ado2';
|
||||
// 3) 저장된 선택
|
||||
const saved = localStorage.getItem(K.PIPELINE);
|
||||
return saved === 'ssul' ? 'ssul' : 'ado2';
|
||||
return isPipeline(saved) ? saved : 'ado2';
|
||||
};
|
||||
|
||||
const [pipeline, setPipeline] = useState<Pipeline>(getInitialPipeline);
|
||||
@@ -182,13 +226,86 @@ const GenerationFlow: React.FC<GenerationFlowProps> = ({
|
||||
/** 언마운트·로그아웃·재시도 시 진행 중인 폴링을 멈추는 플래그 */
|
||||
const ssulCancelledRef = useRef(false);
|
||||
|
||||
/**
|
||||
* 포스터 영상(F1) 잡. 썰박스와 달리 상태 축을 따로 들지 않고 서버 status 에서 파생한다 —
|
||||
* P2V 는 검수 게이트에서 멈춰 사용자를 기다리므로 중간 상태를 계속 그려야 하고,
|
||||
* 그때 화면 상태를 따로 들면 두 축이 어긋난다.
|
||||
*/
|
||||
const [posterJobId, setPosterJobId] = useState<string | null>(
|
||||
() => localStorage.getItem(K.POSTER_JOB_ID),
|
||||
);
|
||||
const [posterBusy, setPosterBusy] = useState(false);
|
||||
|
||||
/** 롱컷(Playreel) 잡. 포스터 영상과 같은 규칙으로 서버 status 에서 단계를 파생한다 */
|
||||
const [playreelJobId, setPlayreelJobId] = useState<string | null>(
|
||||
() => localStorage.getItem(K.PLAYREEL_JOB_ID),
|
||||
);
|
||||
const [playreelBusy, setPlayreelBusy] = useState(false);
|
||||
/** 방금 자동 승인한 게이트. 진행 화면이 안내를 보여주고, 새 잡·검수 화면에서 지운다 */
|
||||
const [playreelAutoGate, setPlayreelAutoGate] = useState<GateKey | null>(null);
|
||||
const { job: playreelJob, notFound: playreelNotFound, refresh: refreshPlayreelJob } =
|
||||
usePlayreelJob(pipeline === 'playreel' ? playreelJobId : null);
|
||||
const { job: posterJob, notFound: posterNotFound, refresh: refreshPosterJob } =
|
||||
useP2vJob(pipeline === 'poster' ? posterJobId : null);
|
||||
|
||||
const changePipeline = (next: Pipeline) => {
|
||||
setPipeline(next);
|
||||
localStorage.setItem(K.PIPELINE, next);
|
||||
};
|
||||
|
||||
/** 진입 화면(탭이 보이는 단계) 여부. 두 파이프라인이 공유한다 */
|
||||
const isEntry = pipeline === 'ado2' ? wizardStep === -2 : ssulStep === 'entry';
|
||||
/** 포스터 진행 단계 — 잡 status 에서 파생 */
|
||||
const posterStep: PosterStep = !posterJobId
|
||||
? 'entry'
|
||||
: posterJob?.status === 'awaiting_review'
|
||||
? 'review'
|
||||
: posterJob?.status === 'done'
|
||||
? 'result'
|
||||
: 'making'; // queued · running · failed · 조회 전(null)
|
||||
|
||||
/** 스텝퍼 인덱스. 검수 전 running(1) 과 승인 후 running(3) 을 구분한다 */
|
||||
const posterStepIndex = posterStep === 'entry'
|
||||
? 0
|
||||
: posterStep === 'review'
|
||||
? 2
|
||||
: posterStep === 'result'
|
||||
? 4
|
||||
: isPastReview(posterJob) ? 3 : 1;
|
||||
|
||||
const playreelStep: PlayreelStep = !playreelJobId
|
||||
? 'entry'
|
||||
: playreelJob?.status === 'awaiting_review' && playreelJob.gate && playreelJob.review
|
||||
? 'review'
|
||||
: playreelJob?.status === 'done'
|
||||
? 'result'
|
||||
: 'making'; // queued · running · failed · 조회 전(null)
|
||||
|
||||
// 자동 승인 안내는 다음 확인 요청(또는 완성)이 오면 낡은 정보라 지운다
|
||||
useEffect(() => {
|
||||
// 승인 직후에도 한동안 같은 게이트가 검수 대기로 보이므로, 다른 게이트일 때만 지운다
|
||||
if (playreelStep === 'result' || (playreelStep === 'review' && playreelJob?.gate !== playreelAutoGate)) {
|
||||
setPlayreelAutoGate(null);
|
||||
}
|
||||
}, [playreelStep, playreelJob?.gate, playreelAutoGate]);
|
||||
|
||||
/** 첫 게이트(연출 확인)를 승인했으면 이후 대기는 '생성' 구간이다 */
|
||||
const playreelPastApproval = playreelJob?.stages.motion?.status !== undefined
|
||||
&& playreelJob.stages.motion.status !== 'idle';
|
||||
|
||||
const playreelStepIndex = playreelStep === 'entry'
|
||||
? 0
|
||||
: playreelStep === 'review'
|
||||
? 2
|
||||
: playreelStep === 'result'
|
||||
? 4
|
||||
: playreelPastApproval ? 3 : 1;
|
||||
|
||||
/** 진입 화면(탭이 보이는 단계) 여부. 파이프라인마다 진입 조건이 다르다 */
|
||||
const isEntry =
|
||||
pipeline === 'ado2' ? wizardStep === -2
|
||||
: pipeline === 'ssul' ? ssulStep === 'entry'
|
||||
: pipeline === 'poster' ? posterStep === 'entry'
|
||||
: pipeline === 'playreel' ? playreelStep === 'entry'
|
||||
: true;
|
||||
const [songTaskId, setSongTaskId] = useState<string | null>(savedSongTaskId);
|
||||
const [imageTaskId, setImageTaskId] = useState<string | null>(savedImageTaskId);
|
||||
const [videoGenerationStatus, setVideoGenerationStatus] = useState<'idle' | 'generating' | 'complete' | 'error'>('idle');
|
||||
@@ -551,6 +668,81 @@ const GenerationFlow: React.FC<GenerationFlowProps> = ({
|
||||
setSsulStep('entry');
|
||||
};
|
||||
|
||||
// ── 포스터 영상 (P2V F1) ─────────────────────────────────────────────
|
||||
|
||||
const handlePosterJobStarted = (jobId: string) => {
|
||||
localStorage.setItem(K.POSTER_JOB_ID, jobId);
|
||||
setPosterJobId(jobId);
|
||||
};
|
||||
|
||||
/** 잡을 버리고 업로드 화면으로. 서버 잡은 남겨둔다(아카이브·디버깅에 쓰인다) */
|
||||
const handlePosterNew = () => {
|
||||
localStorage.removeItem(K.POSTER_JOB_ID);
|
||||
setPosterJobId(null);
|
||||
};
|
||||
|
||||
/** 실패한 잡과 산출물을 지우고 처음부터. 크레딧은 실패 시점에 이미 환불됐다. 되돌릴 수 없다 */
|
||||
const handlePosterDiscard = async () => {
|
||||
if (!posterJobId || posterBusy) return;
|
||||
if (!window.confirm(t('poster.making.discardConfirm'))) return;
|
||||
setPosterBusy(true);
|
||||
try {
|
||||
await deletePosterJob(posterJobId);
|
||||
} catch {
|
||||
// 서버에서 이미 사라졌어도 화면은 처음으로 돌려보내는 게 맞다
|
||||
} finally {
|
||||
setPosterBusy(false);
|
||||
handlePosterNew();
|
||||
}
|
||||
};
|
||||
|
||||
// ── 롱컷 (Playreel) ──────────────────────────────────────────────────
|
||||
|
||||
const handlePlayreelJobStarted = (jobId: string) => {
|
||||
localStorage.setItem(K.PLAYREEL_JOB_ID, jobId);
|
||||
setPlayreelJobId(jobId);
|
||||
};
|
||||
|
||||
/** 잡을 버리고 주소 입력 화면으로. 서버 잡은 남겨둔다(내 콘텐츠에 쓰인다) */
|
||||
const handlePlayreelNew = () => {
|
||||
localStorage.removeItem(K.PLAYREEL_JOB_ID);
|
||||
setPlayreelJobId(null);
|
||||
setPlayreelAutoGate(null);
|
||||
};
|
||||
|
||||
/** 실패한 잡과 산출물을 지우고 처음부터. 크레딧은 실패 시점에 이미 환불됐다. 되돌릴 수 없다 */
|
||||
const handlePlayreelDiscard = async () => {
|
||||
if (!playreelJobId || playreelBusy) return;
|
||||
if (!window.confirm(t('playreel.making.discardConfirm'))) return;
|
||||
setPlayreelBusy(true);
|
||||
try {
|
||||
await deletePlayreelJob(playreelJobId);
|
||||
} catch {
|
||||
// 서버에서 이미 사라졌어도 화면은 처음으로 돌려보내는 게 맞다
|
||||
} finally {
|
||||
setPlayreelBusy(false);
|
||||
handlePlayreelNew();
|
||||
}
|
||||
};
|
||||
|
||||
/** 사라졌거나 내 것이 아닌 롱컷 잡(404)이면 주소 입력 화면으로 되돌린다 */
|
||||
useEffect(() => {
|
||||
if (playreelNotFound) handlePlayreelNew();
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [playreelNotFound]);
|
||||
|
||||
/**
|
||||
* 사라진 잡 정리.
|
||||
*
|
||||
* 복구의 근거는 localStorage 의 id 다. 그런데 그 잡이 지워졌거나 로그인한 사용자의
|
||||
* 것이 아니면(백엔드는 남의 잡을 404 로 답한다) id 만 남아 **빈 진행 화면에서
|
||||
* 영원히 멈춘다**. 404 를 만나면 업로드 화면으로 되돌린다.
|
||||
*/
|
||||
useEffect(() => {
|
||||
if (posterNotFound) handlePosterNew();
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [posterNotFound]);
|
||||
|
||||
/**
|
||||
* 새로고침·새 탭 진입 시 진행 중인 잡을 복구한다.
|
||||
*
|
||||
@@ -599,6 +791,9 @@ const GenerationFlow: React.FC<GenerationFlowProps> = ({
|
||||
// 지우므로 state 만 남으면 저장소와 어긋난다.
|
||||
setPipeline('ado2');
|
||||
setSsulStep('entry');
|
||||
// clearProjectStorage() 가 POSTER_JOB_ID 를 지우므로 state 도 함께 비운다
|
||||
setPosterJobId(null);
|
||||
setPlayreelJobId(null);
|
||||
setSongTaskId(null);
|
||||
setImageTaskId(null);
|
||||
setAnalysisData(null);
|
||||
@@ -625,6 +820,8 @@ const GenerationFlow: React.FC<GenerationFlowProps> = ({
|
||||
onManualInput={handleManualInput}
|
||||
error={analysisError}
|
||||
onSsulJobStarted={handleSsulJobStarted}
|
||||
onPosterJobStarted={handlePosterJobStarted}
|
||||
onPlayreelJobStarted={handlePlayreelJobStarted}
|
||||
onGoToPayment={handleGoToPayment}
|
||||
/>
|
||||
);
|
||||
@@ -646,6 +843,56 @@ const GenerationFlow: React.FC<GenerationFlowProps> = ({
|
||||
}
|
||||
}
|
||||
|
||||
// 롱컷도 자체 축으로 진행한다 (단계는 잡 status 파생)
|
||||
if (pipeline === 'playreel') {
|
||||
switch (playreelStep) {
|
||||
case 'review':
|
||||
return playreelJob ? (
|
||||
<PlayreelGateContent
|
||||
key={playreelJob.gate}
|
||||
job={playreelJob}
|
||||
onChanged={refreshPlayreelJob}
|
||||
onAutoApproved={setPlayreelAutoGate}
|
||||
/>
|
||||
) : null;
|
||||
case 'result':
|
||||
return playreelJob ? (
|
||||
<PlayreelResultContent job={playreelJob} onNew={handlePlayreelNew} />
|
||||
) : null;
|
||||
default:
|
||||
return (
|
||||
<PlayreelMakingContent
|
||||
job={playreelJob}
|
||||
onDiscard={handlePlayreelDiscard}
|
||||
busy={playreelBusy}
|
||||
autoApprovedGate={playreelAutoGate}
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// 포스터 영상도 자체 축으로 진행한다 (단계는 잡 status 파생)
|
||||
if (pipeline === 'poster') {
|
||||
switch (posterStep) {
|
||||
case 'review':
|
||||
return posterJob ? (
|
||||
<PosterReviewContent job={posterJob} onApproved={refreshPosterJob} />
|
||||
) : null;
|
||||
case 'result':
|
||||
return posterJob ? (
|
||||
<PosterResultContent job={posterJob} onNew={handlePosterNew} />
|
||||
) : null;
|
||||
default:
|
||||
return (
|
||||
<PosterMakingContent
|
||||
job={posterJob}
|
||||
onDiscard={handlePosterDiscard}
|
||||
busy={posterBusy}
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
switch (wizardStep) {
|
||||
case -1:
|
||||
// 로딩 단계
|
||||
@@ -758,6 +1005,30 @@ const GenerationFlow: React.FC<GenerationFlowProps> = ({
|
||||
</div>
|
||||
);
|
||||
}
|
||||
// 포스터 영상은 검수 게이트를 포함한 5단계
|
||||
if (pipeline === 'poster') {
|
||||
return (
|
||||
<div className="wizard-page-container">
|
||||
<WizardStepper
|
||||
steps={POSTER_STEP_LABELS.map((key) => t(key))}
|
||||
currentStep={posterStepIndex}
|
||||
/>
|
||||
{renderWizardContent()}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
// 롱컷은 검수 게이트 5번을 준비·확인·생성 3구간으로 묶은 5단계
|
||||
if (pipeline === 'playreel') {
|
||||
return (
|
||||
<div className="wizard-page-container">
|
||||
<WizardStepper
|
||||
steps={PLAYREEL_STEP_LABELS.map((key) => t(key))}
|
||||
currentStep={playreelStepIndex}
|
||||
/>
|
||||
{renderWizardContent()}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
// 브랜드 분석(0)은 전체 화면 스크롤이지만 스텝퍼는 표시
|
||||
if (wizardStep === 0) {
|
||||
return (
|
||||
|
||||
@@ -2,11 +2,13 @@
|
||||
import React, { useState, useEffect, useRef, useCallback } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { getVideosList, deleteVideo, deleteSsulContent } from '../../utils/api';
|
||||
import { VideoListItem } from '../../types/api';
|
||||
import { deleteP2vContent, isP2vContent } from '../../utils/p2vApi';
|
||||
import { SocialUploadableItem, VideoListItem } from '../../types/api';
|
||||
import SocialPostingModal from '../../components/SocialPostingModal';
|
||||
import VideoDetailModal from '../../components/VideoDetailModal';
|
||||
import ContentCardSocialActions from '../../components/ContentCardSocialActions';
|
||||
import SsulViewerModal from '../Ssulbox/SsulViewerModal';
|
||||
import P2vViewerModal from '../../components/P2vViewerModal';
|
||||
import { useOverlayClose } from '../../hooks/useOverlayClose';
|
||||
|
||||
const VideoPreviewCard: React.FC<{ src: string; className?: string }> = ({ src, className }) => {
|
||||
@@ -107,11 +109,12 @@ const MyContentsPage: React.FC<MyContentsPageProps> = ({ onNavigate, embedded })
|
||||
const [deleteTarget, setDeleteTarget] = useState<VideoListItem | null>(null);
|
||||
const [isDeleting, setIsDeleting] = useState(false);
|
||||
const [uploadModalOpen, setUploadModalOpen] = useState(false);
|
||||
const [uploadTargetVideo, setUploadTargetVideo] = useState<VideoListItem | null>(null);
|
||||
const [uploadTargetVideo, setUploadTargetVideo] = useState<SocialUploadableItem | null>(null);
|
||||
const [selectedVideoId, setSelectedVideoId] = useState<number | null>(null);
|
||||
// 썰박스는 별도 뷰어를 쓴다 — VideoDetailModal 은 video_id 로 조회하므로
|
||||
// 썰박스 id 를 넘기면 id 가 겹치는 다른 영상이 열린다.
|
||||
const [selectedSsul, setSelectedSsul] = useState<VideoListItem | null>(null);
|
||||
const [selectedP2v, setSelectedP2v] = useState<VideoListItem | null>(null);
|
||||
|
||||
const pageSize = 12;
|
||||
|
||||
@@ -181,7 +184,9 @@ const MyContentsPage: React.FC<MyContentsPageProps> = ({ onNavigate, embedded })
|
||||
};
|
||||
|
||||
const handleUploadClick = (video: VideoListItem) => {
|
||||
setUploadTargetVideo(video);
|
||||
// 롱컷(p2v_playreel)은 소셜 업로드를 지원하지 않는다(버튼도 막는다). 무빙 포스터는 지원한다.
|
||||
if (video.type === 'p2v_playreel') return;
|
||||
setUploadTargetVideo({ ...video, type: video.type });
|
||||
setUploadModalOpen(true);
|
||||
};
|
||||
|
||||
@@ -202,7 +207,9 @@ const MyContentsPage: React.FC<MyContentsPageProps> = ({ onNavigate, embedded })
|
||||
try {
|
||||
// 종류별 삭제 API 가 다르다. deleteVideo 는 Video.id 로 지우므로
|
||||
// 썰박스 id 를 넘기면 id 가 겹치는 엉뚱한 ADO2 영상이 삭제된다.
|
||||
if (deleteTarget.type === 'ssul') {
|
||||
if (isP2vContent(deleteTarget.type)) {
|
||||
await deleteP2vContent(deleteTarget.type, deleteTarget.video_id);
|
||||
} else if (deleteTarget.type === 'ssul') {
|
||||
await deleteSsulContent(deleteTarget.video_id);
|
||||
} else {
|
||||
await deleteVideo(deleteTarget.video_id);
|
||||
@@ -259,9 +266,11 @@ const MyContentsPage: React.FC<MyContentsPageProps> = ({ onNavigate, embedded })
|
||||
className="content-card-thumbnail"
|
||||
style={{ cursor: 'pointer' }}
|
||||
onClick={() =>
|
||||
video.type === 'ssul'
|
||||
? setSelectedSsul(video)
|
||||
: setSelectedVideoId(video.video_id)
|
||||
isP2vContent(video.type)
|
||||
? setSelectedP2v(video)
|
||||
: video.type === 'ssul'
|
||||
? setSelectedSsul(video)
|
||||
: setSelectedVideoId(video.video_id)
|
||||
}
|
||||
>
|
||||
{video.poster_url ? (
|
||||
@@ -303,8 +312,7 @@ const MyContentsPage: React.FC<MyContentsPageProps> = ({ onNavigate, embedded })
|
||||
<p className="content-card-date">
|
||||
{formatDate(video.created_at)}
|
||||
</p>
|
||||
{/* 좋아요·댓글 API 가 type 을 받으므로 썰박스에도 노출한다.
|
||||
contentType 이 없으면 id 가 겹치는 다른 영상에 반영된다. */}
|
||||
{/* 모든 콘텐츠는 ID 와 종류를 함께 보내 소셜 반응을 구분한다. */}
|
||||
<ContentCardSocialActions
|
||||
videoId={video.video_id}
|
||||
contentType={video.type}
|
||||
@@ -326,7 +334,7 @@ const MyContentsPage: React.FC<MyContentsPageProps> = ({ onNavigate, embedded })
|
||||
<button
|
||||
className="content-download-btn"
|
||||
onClick={() => handleUploadClick(video)}
|
||||
disabled={!video.result_movie_url}
|
||||
disabled={!video.result_movie_url || video.type === 'p2v_playreel'}
|
||||
>
|
||||
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" stroke="currentColor" strokeWidth="1.5">
|
||||
<path d="M10 13V3M10 3l-4 4M10 3l4 4"/>
|
||||
@@ -418,6 +426,7 @@ const MyContentsPage: React.FC<MyContentsPageProps> = ({ onNavigate, embedded })
|
||||
)}
|
||||
|
||||
<SsulViewerModal item={selectedSsul} onClose={() => setSelectedSsul(null)} />
|
||||
<P2vViewerModal item={selectedP2v} onClose={() => setSelectedP2v(null)} />
|
||||
|
||||
{/* 소셜 미디어 업로드 모달 */}
|
||||
<SocialPostingModal
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
import React from 'react';
|
||||
import React, { useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { AutocompleteRequest } from '../../utils/api';
|
||||
import SearchInputForm, { SearchType } from '../../components/SearchInputForm';
|
||||
import PipelineTabs, { Pipeline } from '../../components/PipelineTabs';
|
||||
import SsulCreateForm from '../Ssulbox/SsulCreateForm';
|
||||
import { Scen } from '../Ssulbox/ssulData';
|
||||
import PosterCreateForm from '../Poster/PosterCreateForm';
|
||||
import PosterStartChoice from '../Poster/PosterStartChoice';
|
||||
import PlayreelCreateForm from '../P2v/PlayreelCreateForm';
|
||||
|
||||
interface UrlInputContentProps {
|
||||
/** 현재 선택된 파이프라인. 소유자는 GenerationFlow (분기·리셋 때문) */
|
||||
@@ -15,6 +19,10 @@ interface UrlInputContentProps {
|
||||
error: string | null;
|
||||
/** 썰박스 생성 요청 접수 시. 폴링 소유는 GenerationFlow */
|
||||
onSsulJobStarted: (taskId: number, scenario: Scen) => void;
|
||||
/** 포스터 영상(F1) 생성 요청 접수 시. 폴링 소유는 GenerationFlow */
|
||||
onPosterJobStarted: (jobId: string) => void;
|
||||
/** 롱컷 생성 요청 접수 시. 폴링 소유는 GenerationFlow */
|
||||
onPlayreelJobStarted: (jobId: string) => void;
|
||||
/** 크레딧 부족 시 충전 화면으로 */
|
||||
onGoToPayment: () => void;
|
||||
}
|
||||
@@ -32,8 +40,69 @@ const UrlInputContent: React.FC<UrlInputContentProps> = ({
|
||||
onManualInput,
|
||||
error,
|
||||
onSsulJobStarted,
|
||||
onPosterJobStarted,
|
||||
onPlayreelJobStarted,
|
||||
onGoToPayment,
|
||||
}) => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
/**
|
||||
* 무빙 포스터 탭의 시작 화면. 롱컷은 별도 탭이 아니라 이 화면의 두 번째 갈래다 —
|
||||
* 'choose' 에서 가진 것(이미지 / 상품페이지 주소)을 고르면 폼으로 들어간다.
|
||||
*/
|
||||
const [posterStart, setPosterStart] = useState<'choose' | 'image'>('choose');
|
||||
const showChoice = pipeline === 'poster' && posterStart === 'choose';
|
||||
|
||||
const handleTabChange = (next: Pipeline) => {
|
||||
// 무빙 포스터 탭을 다시 누르면 어느 폼에 있었든 선택 화면으로 돌아간다
|
||||
if (next === 'poster') setPosterStart('choose');
|
||||
onPipelineChange(next);
|
||||
};
|
||||
|
||||
const backToChoice = () => {
|
||||
setPosterStart('choose');
|
||||
onPipelineChange('poster');
|
||||
};
|
||||
|
||||
const renderForm = () => {
|
||||
switch (pipeline) {
|
||||
case 'ado2':
|
||||
return (
|
||||
<SearchInputForm
|
||||
onAnalyze={onAnalyze}
|
||||
onAutocomplete={onAutocomplete}
|
||||
onManualInput={onManualInput}
|
||||
error={error}
|
||||
/>
|
||||
);
|
||||
case 'ssul':
|
||||
return <SsulCreateForm onSubmitted={onSsulJobStarted} onNeedCredit={onGoToPayment} />;
|
||||
case 'poster':
|
||||
return posterStart === 'choose' ? (
|
||||
<PosterStartChoice
|
||||
onPickImage={() => setPosterStart('image')}
|
||||
onPickUrl={() => onPipelineChange('playreel')}
|
||||
/>
|
||||
) : (
|
||||
<PosterCreateForm
|
||||
onSubmitted={onPosterJobStarted}
|
||||
onNeedCredit={onGoToPayment}
|
||||
onBack={backToChoice}
|
||||
/>
|
||||
);
|
||||
case 'playreel':
|
||||
return (
|
||||
<PlayreelCreateForm
|
||||
onSubmitted={onPlayreelJobStarted}
|
||||
onNeedCredit={onGoToPayment}
|
||||
onBack={backToChoice}
|
||||
/>
|
||||
);
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="url-input-container">
|
||||
<div className="url-input-content">
|
||||
@@ -41,18 +110,13 @@ const UrlInputContent: React.FC<UrlInputContentProps> = ({
|
||||
<img src="/assets/images/ADO2_with Slogan_white.svg" alt="ADO2" />
|
||||
</div>
|
||||
|
||||
<PipelineTabs value={pipeline} onChange={onPipelineChange} />
|
||||
<PipelineTabs value={pipeline} onChange={handleTabChange} />
|
||||
|
||||
{pipeline === 'ado2' ? (
|
||||
<SearchInputForm
|
||||
onAnalyze={onAnalyze}
|
||||
onAutocomplete={onAutocomplete}
|
||||
onManualInput={onManualInput}
|
||||
error={error}
|
||||
/>
|
||||
) : (
|
||||
<SsulCreateForm onSubmitted={onSsulJobStarted} onNeedCredit={onGoToPayment} />
|
||||
)}
|
||||
{/* 고른 기능이 무엇을 해주는지 한 줄. 탭 라벨(2~6자)만으로는 네 기능의 차이가
|
||||
전달되지 않아 처음 온 사람이 아무거나 눌러본다. STEP 1 위에 둔다. */}
|
||||
{!showChoice && <p className="pipeline-desc">{t(`pipelineTabs.desc.${pipeline}`)}</p>}
|
||||
|
||||
{renderForm()}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
import React from 'react';
|
||||
import ContentDetailContent from '../../components/ContentDetailContent';
|
||||
import { P2vContentType } from '../../types/api';
|
||||
import { NAV } from '../../components/navItems';
|
||||
|
||||
interface P2vDetailPageProps {
|
||||
contentId: string;
|
||||
contentType: P2vContentType;
|
||||
}
|
||||
|
||||
const P2vDetailPage: React.FC<P2vDetailPageProps> = ({ contentId, contentType }) => (
|
||||
<div className="video-detail-page">
|
||||
<ContentDetailContent
|
||||
key={`${contentType}-${contentId}`}
|
||||
contentId={contentId}
|
||||
contentType={contentType}
|
||||
onClose={() => {
|
||||
localStorage.setItem('castad_active_item', NAV.HOME);
|
||||
window.location.href = '/';
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
|
||||
export default P2vDetailPage;
|
||||
@@ -0,0 +1,52 @@
|
||||
import React from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { GATE_ORDER } from '../../utils/playreelApi';
|
||||
import { AUTO_APPROVABLE, setAutoApprove, useAutoApprove } from '../../utils/playreelPrefs';
|
||||
|
||||
/**
|
||||
* 게이트 자동 승인 설정 — 롱컷 시작 화면에 놓는다(playreel 원본과 같은 자리).
|
||||
* 스위치는 되돌릴 수 있는 ①·③ 만 있고, 나머지는 잠금으로 이유를 알려준다.
|
||||
*/
|
||||
const PlayreelAutoApprovePanel: React.FC = () => {
|
||||
const { t } = useTranslation();
|
||||
const prefs = useAutoApprove();
|
||||
|
||||
return (
|
||||
<div className="pr-auto">
|
||||
<p className="p2v-label">{t('playreel.auto.title')}</p>
|
||||
<div className="p2v-panel">
|
||||
{AUTO_APPROVABLE.map((gate) => {
|
||||
const name = t(`playreel.gates.${gate}.name`);
|
||||
return (
|
||||
<div key={gate} className="pr-auto__row">
|
||||
<div className="pr-auto__text">
|
||||
<p className="pr-strong">
|
||||
{t('playreel.auto.gate', { step: GATE_ORDER.indexOf(gate) + 1, name })}
|
||||
</p>
|
||||
<p className="p2v-note">{t(`playreel.auto.${gate}`)}</p>
|
||||
</div>
|
||||
<button
|
||||
type="button"
|
||||
role="switch"
|
||||
aria-checked={!!prefs[gate]}
|
||||
aria-label={t('playreel.auto.switchLabel', { name })}
|
||||
className={`pr-switch${prefs[gate] ? ' on' : ''}`}
|
||||
onClick={() => setAutoApprove(gate, !prefs[gate])}
|
||||
>
|
||||
<span className="pr-switch__knob" />
|
||||
</button>
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
<div className="pr-auto__row pr-auto__row--locked">
|
||||
<div className="pr-auto__text">
|
||||
<p className="pr-strong">{t('playreel.auto.lockedTitle')}</p>
|
||||
<p className="p2v-note">{t('playreel.auto.lockedDesc')}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default PlayreelAutoApprovePanel;
|
||||
@@ -0,0 +1,78 @@
|
||||
import React, { useMemo, useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { InsufficientCreditError } from '../../utils/api';
|
||||
import { createPlayreelJob, parseGoodsId } from '../../utils/playreelApi';
|
||||
import PlayreelAutoApprovePanel from './PlayreelAutoApprovePanel';
|
||||
|
||||
interface PlayreelCreateFormProps {
|
||||
/** 생성 요청이 접수되면 호출. 폴링 소유는 GenerationFlow (썰박스·포스터와 같은 규칙) */
|
||||
onSubmitted: (jobId: string) => void;
|
||||
/** 크레딧 부족(402) 시 충전 화면으로 유도 */
|
||||
onNeedCredit: () => void;
|
||||
/** 시작 선택 화면으로 돌아간다 */
|
||||
onBack: () => void;
|
||||
}
|
||||
|
||||
/**
|
||||
* 롱컷(공연 상품페이지 → 30초 예고편) 생성 폼. 진입 화면의 '롱컷' 탭에 들어간다.
|
||||
*
|
||||
* 입력 도중의 안내(상품 번호 인식)는 `parseGoodsId` 가 하고, 판정은 서버가 같은 규칙으로 한다.
|
||||
*/
|
||||
const PlayreelCreateForm: React.FC<PlayreelCreateFormProps> = ({ onSubmitted, onNeedCredit, onBack }) => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const [url, setUrl] = useState('');
|
||||
const [submitting, setSubmitting] = useState(false);
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
const goodsId = useMemo(() => parseGoodsId(url), [url]);
|
||||
|
||||
const submit = async () => {
|
||||
if (!goodsId || submitting) return;
|
||||
setSubmitting(true);
|
||||
setError(null);
|
||||
try {
|
||||
const { id } = await createPlayreelJob(url);
|
||||
onSubmitted(id);
|
||||
} catch (e) {
|
||||
if (e instanceof InsufficientCreditError) {
|
||||
onNeedCredit();
|
||||
} else {
|
||||
setError((e as Error).message);
|
||||
}
|
||||
setSubmitting(false);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="p2v-scope p2v-create">
|
||||
<button type="button" className="p2v-back" onClick={onBack}>{t('poster.start.back')}</button>
|
||||
|
||||
<span className="p2v-step">{t('playreel.create.step')}</span>
|
||||
|
||||
<input
|
||||
className="p2v-input p2v-input--center"
|
||||
placeholder={t('playreel.create.placeholder')}
|
||||
value={url}
|
||||
onChange={(e) => setUrl(e.target.value)}
|
||||
onKeyDown={(e) => { if (e.key === 'Enter') submit(); }}
|
||||
/>
|
||||
|
||||
{goodsId && (
|
||||
<p className="p2v-note">
|
||||
<span className="p2v-tag">{t('playreel.create.recognized', { id: goodsId })}</span>
|
||||
</p>
|
||||
)}
|
||||
{url.trim() && !goodsId && <div className="p2v-note warn">{t('playreel.create.unsupported')}</div>}
|
||||
{error && <div className="p2v-note warn">{error}</div>}
|
||||
|
||||
<button type="button" className="p2v-btn-cta" disabled={!goodsId || submitting} onClick={submit}>
|
||||
{submitting ? t('playreel.create.submitting') : t('playreel.create.submit')}
|
||||
</button>
|
||||
|
||||
{/* 게이트 ①·③ 자동 승인 — 시작 전에 정하고, 되돌리는 자리도 여기다 */}
|
||||
<PlayreelAutoApprovePanel />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default PlayreelCreateForm;
|
||||
@@ -0,0 +1,467 @@
|
||||
import React, { useEffect, useRef, useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import {
|
||||
AnalysisReview, ClipReview, FetchReview, FinalReview, GATE_CAN_BACK, GATE_ORDER,
|
||||
GateEdits, GateKey, NarrationReview, PlayreelJob,
|
||||
approvePlayreelGate, backPlayreelGate, retryPlayreelClip,
|
||||
} from '../../utils/playreelApi';
|
||||
import { isAutoApprovable, useAutoApprove } from '../../utils/playreelPrefs';
|
||||
|
||||
interface PlayreelGateContentProps {
|
||||
/** `gate` 와 `review` 가 채워진 검수 대기 잡 */
|
||||
job: PlayreelJob;
|
||||
/** 승인·되돌리기·재생성 요청이 끝나면 호출 — GenerationFlow 가 폴링을 다시 켠다 */
|
||||
onChanged: () => void;
|
||||
/** 자동 승인이 성공했을 때 호출 — 진행 화면이 "자동 승인했습니다" 안내를 이어서 보여준다 */
|
||||
onAutoApproved: (gate: GateKey) => void;
|
||||
}
|
||||
|
||||
const Icon: React.FC<{ d: string; size?: number }> = ({ d, size = 12 }) => (
|
||||
<svg
|
||||
width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor"
|
||||
strokeWidth="3" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true"
|
||||
>
|
||||
<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: React.FC<{ size?: number }> = ({ size = 12 }) => (
|
||||
<svg
|
||||
width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor"
|
||||
strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true"
|
||||
>
|
||||
<rect x="4" y="11" width="16" height="10" rx="2" /><path d="M8 11V7a4 4 0 0 1 8 0v4" />
|
||||
</svg>
|
||||
);
|
||||
|
||||
/** 켜고 끄는 칩. `locked` 는 항상 켜져 있어 누를 수 없다 */
|
||||
const Chip: React.FC<{
|
||||
on: boolean; locked?: boolean; onClick?: () => void; children: React.ReactNode;
|
||||
}> = ({ on, locked, onClick, children }) => (
|
||||
<button
|
||||
type="button"
|
||||
className={`p2v-chip pr-chip${on ? ' active' : ''}${locked ? ' locked' : ''}`}
|
||||
onClick={locked ? undefined : onClick}
|
||||
>
|
||||
{locked ? <Lock /> : <Icon d={on ? CHECK : PLUS} />}
|
||||
{children}
|
||||
</button>
|
||||
);
|
||||
|
||||
// ── ① 수집 확인 ─────────────────────────────────────────────────────────
|
||||
|
||||
type FetchEdits = Extract<GateEdits, { sections: string[] }>;
|
||||
|
||||
/**
|
||||
* 상세페이지 조각은 라벨이 겹친다 — "유의사항"만 일곱 개인 페이지가 흔하다.
|
||||
* 칩으로 그리면 같은 글자가 줄줄이 서서 무엇을 고르는지 알 수 없어 썸네일을 그린다.
|
||||
*/
|
||||
const FetchGate: React.FC<{ data: FetchReview; onChange: (edits: FetchEdits) => void }> = ({
|
||||
data, onChange,
|
||||
}) => {
|
||||
const { t } = useTranslation();
|
||||
const [sections, setSections] = useState(data.sections);
|
||||
const [meta, setMeta] = useState(data.meta);
|
||||
|
||||
const emit = (nextSections = sections, nextMeta = meta) =>
|
||||
onChange({ sections: nextSections.filter((s) => s.selected).map((s) => s.id), meta: nextMeta });
|
||||
|
||||
const chosen = sections.filter((s) => s.selected).length;
|
||||
|
||||
return (
|
||||
<div className="pr-two">
|
||||
<div>
|
||||
<p className="p2v-label">{t('playreel.fetch.info')}</p>
|
||||
{(['title', 'date_text', 'place'] as const).map((key) => (
|
||||
<div key={key} className="pr-row">
|
||||
<span className="pr-row__label">{t(`playreel.fetch.field.${key}`)}</span>
|
||||
<input
|
||||
className="p2v-input"
|
||||
value={meta[key]}
|
||||
onChange={(e) => {
|
||||
const next = { ...meta, [key]: e.target.value };
|
||||
setMeta(next);
|
||||
emit(sections, next);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
))}
|
||||
<p className="p2v-note">{t('playreel.fetch.cast', { cast: meta.cast.join(', ') })}</p>
|
||||
|
||||
<p className="p2v-label pr-gap">{t('playreel.fetch.sections')}</p>
|
||||
<p className="p2v-help">{t('playreel.fetch.sectionsHelp')}</p>
|
||||
<div className="pr-sections">
|
||||
{sections.map((s, i) => (
|
||||
<button
|
||||
key={s.id}
|
||||
type="button"
|
||||
title={`${s.label} · ${s.height.toLocaleString()}px`}
|
||||
className={`pr-section${s.selected ? ' selected' : ''}${s.required ? ' locked' : ''}`}
|
||||
onClick={s.required ? undefined : () => {
|
||||
const next = sections.map((x) => (x.id === s.id ? { ...x, selected: !x.selected } : x));
|
||||
setSections(next);
|
||||
emit(next);
|
||||
}}
|
||||
>
|
||||
<img src={s.thumb_url} alt={s.label} />
|
||||
<span className="pr-section__no">{i + 1}</span>
|
||||
<span className="pr-section__cap">
|
||||
{s.required ? <Lock size={10} /> : <Icon d={s.selected ? CHECK : PLUS} size={10} />}
|
||||
<span>{s.label}</span>
|
||||
</span>
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
<p className="p2v-note">
|
||||
{t('playreel.fetch.sectionsCount', { total: sections.length, chosen })}
|
||||
</p>
|
||||
|
||||
{data.poster_width <= 800 && (
|
||||
<p className="pr-callout">{t('playreel.fetch.lowRes', { width: data.poster_width })}</p>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<p className="p2v-label">{t('playreel.fetch.poster')}</p>
|
||||
<img className="p2v-review__image pr-image" src={data.poster_url} alt={t('playreel.fetch.poster')} />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
// ── ② 연출 확인 ─────────────────────────────────────────────────────────
|
||||
|
||||
type AnalysisEdits = Extract<GateEdits, { movable: string[] }>;
|
||||
|
||||
const AnalysisGate: React.FC<{ data: AnalysisReview; onChange: (edits: AnalysisEdits) => void }> = ({
|
||||
data, onChange,
|
||||
}) => {
|
||||
const { t } = useTranslation();
|
||||
const [movable, setMovable] = useState(data.movable);
|
||||
const [fixed, setFixed] = useState(data.fixed);
|
||||
|
||||
const emit = (nextMovable = movable, nextFixed = fixed) =>
|
||||
onChange({
|
||||
movable: nextMovable.filter((x) => x.on).map((x) => x.key),
|
||||
fixed: nextFixed.filter((x) => x.on).map((x) => x.key),
|
||||
model: data.model,
|
||||
});
|
||||
|
||||
return (
|
||||
<div className="pr-two">
|
||||
<div>
|
||||
<p className="p2v-label">{t('playreel.analysis.movable')}</p>
|
||||
<p className="p2v-help">{t('playreel.analysis.movableHelp')}</p>
|
||||
<div className="p2v-chips">
|
||||
{movable.map((m) => (
|
||||
<Chip
|
||||
key={m.key}
|
||||
on={m.on}
|
||||
onClick={() => {
|
||||
const next = movable.map((x) => (x.key === m.key ? { ...x, on: !x.on } : x));
|
||||
setMovable(next);
|
||||
emit(next);
|
||||
}}
|
||||
>
|
||||
{m.label}
|
||||
</Chip>
|
||||
))}
|
||||
</div>
|
||||
|
||||
<p className="p2v-label pr-gap">{t('playreel.analysis.fixed')}</p>
|
||||
<p className="p2v-help">{t('playreel.analysis.fixedHelp')}</p>
|
||||
<div className="p2v-chips">
|
||||
{fixed.map((f) => (
|
||||
<Chip
|
||||
key={f.key}
|
||||
on={f.on}
|
||||
locked={f.key === 'title'}
|
||||
onClick={() => {
|
||||
const next = fixed.map((x) => (x.key === f.key ? { ...x, on: !x.on } : x));
|
||||
setFixed(next);
|
||||
emit(movable, next);
|
||||
}}
|
||||
>
|
||||
{f.label}
|
||||
</Chip>
|
||||
))}
|
||||
</div>
|
||||
|
||||
<p className="p2v-label pr-gap">{t('playreel.analysis.model')}</p>
|
||||
<p className="p2v-help">{t('playreel.analysis.modelValue')}</p>
|
||||
{data.ip_risk && <p className="pr-callout">{t('playreel.analysis.ipRisk')}</p>}
|
||||
{!data.has_qr && <p className="p2v-note">{t('playreel.analysis.noQr')}</p>}
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<p className="p2v-label">{t('playreel.analysis.grid')}</p>
|
||||
<img className="p2v-review__image pr-image" src={data.grid_url} alt={t('playreel.analysis.grid')} />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
// ── ③ 나레이션·보이스 확인 ──────────────────────────────────────────────
|
||||
|
||||
type NarrationEdits = Extract<GateEdits, { lines: string[] }>;
|
||||
|
||||
const NARRATION_MIN_SECONDS = 28;
|
||||
const NARRATION_MAX_SECONDS = 31;
|
||||
|
||||
const NarrationGate: React.FC<{ data: NarrationReview; onChange: (edits: NarrationEdits) => void }> = ({
|
||||
data, onChange,
|
||||
}) => {
|
||||
const { t } = useTranslation();
|
||||
const [lines, setLines] = useState(data.lines);
|
||||
const lengthOk = data.est_seconds >= NARRATION_MIN_SECONDS && data.est_seconds <= NARRATION_MAX_SECONDS;
|
||||
|
||||
return (
|
||||
<div className="pr-two">
|
||||
<div>
|
||||
<p className="p2v-label">{t('playreel.narration.lines', { count: lines.length })}</p>
|
||||
{lines.map((line, i) => (
|
||||
<div key={i} className="pr-row">
|
||||
<span className="pr-row__label pr-row__label--slot">{line.slot}</span>
|
||||
<input
|
||||
className="p2v-input"
|
||||
value={line.text}
|
||||
onChange={(e) => {
|
||||
const next = lines.map((x, j) => (j === i ? { ...x, text: e.target.value } : x));
|
||||
setLines(next);
|
||||
onChange({ lines: next.map((x) => x.text), voice_id: data.voice.id });
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<p className="p2v-label">{t('playreel.narration.voice')}</p>
|
||||
<div className="p2v-panel">
|
||||
<p className="pr-strong">{data.voice.name}</p>
|
||||
{data.voice.sample_url ? (
|
||||
<audio controls src={data.voice.sample_url} className="pr-audio" />
|
||||
) : (
|
||||
<p className="p2v-note">{t('playreel.narration.sampleMissing')}</p>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<p className="p2v-label pr-gap">{t('playreel.narration.estimate')}</p>
|
||||
<p className={`pr-stat${lengthOk ? '' : ' warn'}`}>
|
||||
{t('playreel.narration.seconds', { value: data.est_seconds.toFixed(1) })}
|
||||
</p>
|
||||
<p className="p2v-note">
|
||||
{t('playreel.narration.target', { min: NARRATION_MIN_SECONDS, max: NARRATION_MAX_SECONDS })}
|
||||
{!lengthOk && ` — ${t('playreel.narration.adjust')}`}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
// ── ④ 클립 검수 ─────────────────────────────────────────────────────────
|
||||
|
||||
const ClipGate: React.FC<{ data: ClipReview }> = ({ data }) => {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<div className="pr-two">
|
||||
<div className="p2v-panel pr-player">
|
||||
{data.clip_url ? (
|
||||
<video src={data.clip_url} controls playsInline />
|
||||
) : (
|
||||
<p className="p2v-note">{t('playreel.clip.missing')}</p>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<p className="p2v-label">{t('playreel.clip.titleCheck')}</p>
|
||||
<div className={`p2v-panel pr-verdict${data.gate_passed ? ' ok' : ' fail'}`}>
|
||||
<p className="pr-strong">
|
||||
{t(data.gate_passed ? 'playreel.clip.passed' : 'playreel.clip.failed', {
|
||||
mae: data.title_mae.toFixed(2),
|
||||
})}
|
||||
</p>
|
||||
<p className="p2v-note">{t('playreel.clip.criteria')}</p>
|
||||
{data.gate_reason && <p className="p2v-note warn">{data.gate_reason}</p>}
|
||||
</div>
|
||||
|
||||
<p className="p2v-label pr-gap">{t('playreel.clip.frames')}</p>
|
||||
<img className="p2v-review__image pr-image" src={data.frames_url} alt={t('playreel.clip.frames')} />
|
||||
<p className="pr-callout">{t('playreel.clip.redoNote')}</p>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
// ── ⑤ 최종 검수 ─────────────────────────────────────────────────────────
|
||||
|
||||
const FinalGate: React.FC<{ data: FinalReview }> = ({ data }) => {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<div className="pr-two">
|
||||
<div className="p2v-panel pr-player">
|
||||
{data.video_url ? (
|
||||
<video src={data.video_url} controls playsInline />
|
||||
) : (
|
||||
<p className="p2v-note">{t('playreel.final.missing', { seconds: data.duration.toFixed(1) })}</p>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<p className="p2v-label">{t('playreel.final.checks')}</p>
|
||||
{data.checks.map((c) => (
|
||||
<p key={c.key} className={`pr-check${c.ok ? '' : ' fail'}`}>
|
||||
<Icon d={c.ok ? CHECK : CROSS} size={14} />
|
||||
{c.label}
|
||||
</p>
|
||||
))}
|
||||
|
||||
<p className="p2v-label pr-gap">{t('playreel.final.proof')}</p>
|
||||
<img className="p2v-review__image pr-image" src={data.proof_url} alt={t('playreel.final.proof')} />
|
||||
<p className="p2v-note">{t('playreel.final.version', { version: data.version })}</p>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
// ── 게이트 셸 ───────────────────────────────────────────────────────────
|
||||
|
||||
/**
|
||||
* 롱컷 검수 게이트. 파이프라인이 사람의 확인을 기다리며 멈추는 5개 지점 중 하나를 그린다.
|
||||
*
|
||||
* 승인하면 다음 단계가 이어지고, 크레딧을 이미 쓴 지점(연출 확인 이후)부터는 되돌릴 수 없다.
|
||||
* 고친 값은 `edits` ref 에 모았다가 승인할 때 함께 보낸다 — 입력마다 요청하지 않는다.
|
||||
*/
|
||||
const PlayreelGateContent: React.FC<PlayreelGateContentProps> = ({ job, onChanged, onAutoApproved }) => {
|
||||
const { t } = useTranslation();
|
||||
const edits = useRef<GateEdits | null>(null);
|
||||
const [busy, setBusy] = useState(false);
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
const prefs = useAutoApprove();
|
||||
const autoFired = useRef(false); // 같은 게이트에 두 번 보내지 않는다
|
||||
|
||||
const { gate, review } = job;
|
||||
|
||||
// 자동 승인이 켜진 게이트(①·③)는 폴링이 검수 대기를 보는 순간 한 번만 승인한다.
|
||||
// 실패하면 카드가 그대로 남아 사람이 직접 누를 수 있다.
|
||||
const autoGate = isAutoApprovable(gate) && prefs[gate] ? gate : null;
|
||||
const autoActive = autoGate !== null && !error;
|
||||
useEffect(() => {
|
||||
if (!autoGate || autoFired.current) return;
|
||||
autoFired.current = true;
|
||||
approvePlayreelGate(job.id, autoGate, null)
|
||||
.then(() => {
|
||||
onAutoApproved(autoGate);
|
||||
onChanged();
|
||||
})
|
||||
.catch((e) => setError(t('playreel.auto.failed', { message: (e as Error).message })));
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [autoGate]);
|
||||
|
||||
if (!gate || !review) return null;
|
||||
|
||||
if (autoActive) {
|
||||
return (
|
||||
<div className="p2v-scope p2v-making">
|
||||
<div className="p2v-spinner" aria-hidden="true" />
|
||||
<p className="p2v-making__desc">
|
||||
{t('playreel.auto.working', { step: GATE_ORDER.indexOf(gate) + 1, name: t(`playreel.gates.${gate}.name`) })}
|
||||
</p>
|
||||
<p className="p2v-note">{t('playreel.auto.hint')}</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
const step = GATE_ORDER.indexOf(gate) + 1;
|
||||
|
||||
const run = async (request: () => Promise<unknown>) => {
|
||||
setBusy(true);
|
||||
setError(null);
|
||||
try {
|
||||
await request();
|
||||
edits.current = null;
|
||||
onChanged();
|
||||
} catch (e) {
|
||||
setError((e as Error).message);
|
||||
} finally {
|
||||
setBusy(false);
|
||||
}
|
||||
};
|
||||
|
||||
const approveLabel =
|
||||
gate === 'final_confirm' ? t('playreel.gate.approveFinal')
|
||||
: gate === 'clip_confirm' ? t('playreel.gate.approveClip')
|
||||
: t('playreel.gate.approve');
|
||||
|
||||
const renderBody = () => {
|
||||
switch (review.gate) {
|
||||
case 'fetch_confirm':
|
||||
return <FetchGate data={review.data} onChange={(e) => { edits.current = e; }} />;
|
||||
case 'analysis_confirm':
|
||||
return <AnalysisGate data={review.data} onChange={(e) => { edits.current = e; }} />;
|
||||
case 'narration_confirm':
|
||||
return <NarrationGate data={review.data} onChange={(e) => { edits.current = e; }} />;
|
||||
case 'clip_confirm':
|
||||
return <ClipGate data={review.data} />;
|
||||
case 'final_confirm':
|
||||
return <FinalGate data={review.data} />;
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="p2v-scope p2v-review pr-gate">
|
||||
<p className="pr-gate__eyebrow">
|
||||
{t('playreel.gate.progress', { step, total: GATE_ORDER.length, name: t(`playreel.gates.${gate}.name`) })}
|
||||
</p>
|
||||
<h2 className="pr-gate__title">{t(`playreel.gates.${gate}.title`)}</h2>
|
||||
<p className="p2v-help">{t(`playreel.gates.${gate}.why`)}</p>
|
||||
|
||||
{renderBody()}
|
||||
|
||||
{error && <div className="p2v-note warn">{error}</div>}
|
||||
|
||||
<button
|
||||
type="button"
|
||||
className="p2v-btn-cta"
|
||||
disabled={busy}
|
||||
onClick={() => run(() => approvePlayreelGate(job.id, gate, edits.current))}
|
||||
>
|
||||
{busy ? t('playreel.gate.working') : approveLabel}
|
||||
</button>
|
||||
|
||||
<div className="pr-gate__actions">
|
||||
{gate === 'clip_confirm' && (
|
||||
<button
|
||||
type="button"
|
||||
className="p2v-btn-outline"
|
||||
disabled={busy}
|
||||
onClick={() => run(() => retryPlayreelClip(job.id))}
|
||||
>
|
||||
{t('playreel.gate.redo')}
|
||||
</button>
|
||||
)}
|
||||
{GATE_CAN_BACK[gate] && (
|
||||
<button
|
||||
type="button"
|
||||
className="p2v-btn-outline"
|
||||
disabled={busy}
|
||||
onClick={() => run(() => backPlayreelGate(job.id))}
|
||||
>
|
||||
{t('playreel.gate.back')}
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<p className="p2v-note">
|
||||
{t('playreel.gate.next', {
|
||||
next: t(`playreel.gates.${gate}.next`),
|
||||
eta: t(`playreel.gates.${gate}.eta`),
|
||||
})}
|
||||
</p>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default PlayreelGateContent;
|
||||
@@ -0,0 +1,88 @@
|
||||
import React from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { p2vProgress } from '../../utils/p2vApi';
|
||||
import { GATE_ORDER, GateKey, PlayreelJob } from '../../utils/playreelApi';
|
||||
|
||||
interface PlayreelMakingContentProps {
|
||||
job: PlayreelJob | null;
|
||||
/** 실패한 잡을 버리고 처음부터. 실패하면 크레딧이 환불되므로 같은 잡을 다시 돌리지 않는다 */
|
||||
onDiscard: () => void;
|
||||
busy: boolean;
|
||||
/** 방금 자동 승인한 게이트가 있으면 그 안내. 다음 확인 요청이 올 때까지 보여준다 */
|
||||
autoApprovedGate?: GateKey | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 롱컷 진행·실패 화면. 검수 게이트 사이사이의 대기 구간에 쓰인다.
|
||||
*
|
||||
* 진행바는 스테이지 완료 수 기반이라 구간 사이에서 멈춰 보인다 —
|
||||
* 스피너가 "살아 있다"를 따로 알린다(PosterMakingContent 와 같은 판단).
|
||||
*/
|
||||
const PlayreelMakingContent: React.FC<PlayreelMakingContentProps> = ({
|
||||
job, onDiscard, busy, autoApprovedGate,
|
||||
}) => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
if (!job) return null;
|
||||
|
||||
const percent = p2vProgress(job);
|
||||
|
||||
if (job.status === 'failed') {
|
||||
return (
|
||||
<div className="p2v-scope p2v-making">
|
||||
<span className="p2v-making__name">{job.name}</span>
|
||||
<h2 className="p2v-making__title warn">{t('playreel.making.failTitle')}</h2>
|
||||
<p className="p2v-making__desc">
|
||||
{t(`playreel.stages.${job.error?.stage}`, { defaultValue: job.error?.stage ?? '' })}
|
||||
</p>
|
||||
{job.error?.detail && <pre className="p2v-errorbox">{job.error.detail}</pre>}
|
||||
<p className="p2v-making__desc">{t('playreel.making.refunded')}</p>
|
||||
<div className="p2v-making__actions">
|
||||
<button type="button" className="p2v-btn-mint" disabled={busy} onClick={onDiscard}>
|
||||
{t('playreel.making.discard')}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
const stageKey = job.stage ?? '';
|
||||
const copy = t(`playreel.running.${stageKey}`, { defaultValue: t('playreel.making.preparing') });
|
||||
|
||||
return (
|
||||
<div className="p2v-scope p2v-making">
|
||||
<span className="p2v-making__name">{job.name}</span>
|
||||
<h2 className="p2v-making__title">{t('playreel.making.title')}</h2>
|
||||
|
||||
<div className="p2v-spinner" aria-hidden="true" />
|
||||
|
||||
<div
|
||||
className="p2v-bar"
|
||||
role="progressbar"
|
||||
aria-valuenow={percent}
|
||||
aria-valuemin={0}
|
||||
aria-valuemax={100}
|
||||
>
|
||||
<div className="p2v-bar__fill" style={{ width: `${percent}%` }} />
|
||||
</div>
|
||||
|
||||
<div className="p2v-making__meta">
|
||||
<span>{job.status === 'queued' ? t('playreel.making.queued') : copy}</span>
|
||||
<span className="p2v-making__pct">{percent}%</span>
|
||||
</div>
|
||||
|
||||
<p className="p2v-making__desc">{t('playreel.making.wait')}</p>
|
||||
|
||||
{autoApprovedGate && (
|
||||
<p className="pr-auto-note">
|
||||
{t('playreel.auto.done', {
|
||||
step: GATE_ORDER.indexOf(autoApprovedGate) + 1,
|
||||
name: t(`playreel.gates.${autoApprovedGate}.name`),
|
||||
})}
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default PlayreelMakingContent;
|
||||
@@ -0,0 +1,61 @@
|
||||
import React from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { PlayreelJob } from '../../utils/playreelApi';
|
||||
|
||||
interface PlayreelResultContentProps {
|
||||
job: PlayreelJob;
|
||||
/** 새 롱컷으로 처음부터 */
|
||||
onNew: () => void;
|
||||
}
|
||||
|
||||
/**
|
||||
* 롱컷 완성 화면.
|
||||
*
|
||||
* 완성 영상은 blob 에 내려받기 헤더가 붙어 있어, 주소를 그대로 열면 파일로 저장된다.
|
||||
* `<a download>` 는 다른 출처에 듣지 않으므로 이 속성에 기대지 않는다.
|
||||
*/
|
||||
const PlayreelResultContent: React.FC<PlayreelResultContentProps> = ({ job, onNew }) => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const video = job.artifacts.video ?? '';
|
||||
|
||||
return (
|
||||
<div className="p2v-scope p2v-result">
|
||||
<h2 className="p2v-result__title">{t('playreel.result.title')}</h2>
|
||||
|
||||
<div className="p2v-result__grid">
|
||||
<div className="p2v-panel p2v-result__player">
|
||||
{video ? (
|
||||
<video src={video} controls playsInline />
|
||||
) : (
|
||||
<p className="p2v-note">{t('playreel.result.videoMissing')}</p>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className="p2v-result__side">
|
||||
<p className="p2v-label">{t('playreel.result.fileName')}</p>
|
||||
<p className="p2v-result__filename">{job.source.slug}_30_v{job.version}.mp4</p>
|
||||
|
||||
<p className="p2v-note">
|
||||
{t('playreel.result.source')}{' '}
|
||||
<a href={job.source.url} target="_blank" rel="noreferrer">{t('playreel.result.sourceLink')}</a>
|
||||
</p>
|
||||
|
||||
<div className="p2v-result__actions">
|
||||
{video && (
|
||||
<a href={video} className="p2v-btn-cta p2v-btn-cta--compact">
|
||||
{t('playreel.result.download')}
|
||||
</a>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button type="button" className="p2v-btn-outline p2v-result__new" onClick={onNew}>
|
||||
{t('playreel.result.new')}
|
||||
</button>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default PlayreelResultContent;
|
||||
@@ -0,0 +1,84 @@
|
||||
import React, { useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import PosterDropzone from '../../components/PosterDropzone';
|
||||
import { InsufficientCreditError } from '../../utils/api';
|
||||
import { createPosterJob } from '../../utils/p2vApi';
|
||||
|
||||
interface PosterCreateFormProps {
|
||||
/** 생성 요청이 접수되면 호출. 폴링 소유는 GenerationFlow (썰박스와 같은 규칙) */
|
||||
onSubmitted: (jobId: string) => void;
|
||||
/** 크레딧 부족(402) 시 충전 화면으로 유도 */
|
||||
onNeedCredit: () => void;
|
||||
/** 시작 선택 화면으로 돌아간다 */
|
||||
onBack: () => void;
|
||||
}
|
||||
|
||||
/**
|
||||
* 포스터 → 영상(F1) 생성 폼. 진입 화면의 '포스터 영상' 탭에 들어간다.
|
||||
*
|
||||
* 행사명은 비워도 된다 — 서버가 포스터에서 뽑는다. 다만 뽑은 값이 틀릴 수 있어
|
||||
* 검수 단계에서 다시 고칠 기회를 준다(메타태그는 아카이브에 영구 저장된다).
|
||||
*/
|
||||
const PosterCreateForm: React.FC<PosterCreateFormProps> = ({ onSubmitted, onNeedCredit, onBack }) => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const [file, setFile] = useState<File | null>(null);
|
||||
const [name, setName] = useState('');
|
||||
const [submitting, setSubmitting] = useState(false);
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
|
||||
const submit = async () => {
|
||||
if (!file || submitting) return;
|
||||
setSubmitting(true);
|
||||
setError(null);
|
||||
try {
|
||||
const { id } = await createPosterJob(file, name.trim());
|
||||
onSubmitted(id);
|
||||
} catch (e) {
|
||||
if (e instanceof InsufficientCreditError) {
|
||||
onNeedCredit();
|
||||
} else {
|
||||
setError((e as Error).message);
|
||||
}
|
||||
setSubmitting(false);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="p2v-scope p2v-create">
|
||||
<button type="button" className="p2v-back" onClick={onBack}>{t('poster.start.back')}</button>
|
||||
|
||||
<span className="p2v-step">{t('poster.create.step')}</span>
|
||||
|
||||
<PosterDropzone file={file} onFile={setFile} />
|
||||
|
||||
<input
|
||||
className="p2v-input p2v-input--center"
|
||||
placeholder={t('poster.create.namePlaceholder')}
|
||||
value={name}
|
||||
onChange={(e) => setName(e.target.value)}
|
||||
/>
|
||||
|
||||
{error && <div className="p2v-note warn">{error}</div>}
|
||||
|
||||
<div className="p2v-create__cost">
|
||||
<span>{t('poster.create.cost')}</span>
|
||||
<span className="p2v-create__cost-badge">
|
||||
<span className="p2v-create__coin" aria-hidden="true">🪙</span>
|
||||
{t('poster.create.costValue')}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<button
|
||||
type="button"
|
||||
className="p2v-btn-cta"
|
||||
disabled={!file || submitting}
|
||||
onClick={submit}
|
||||
>
|
||||
{submitting ? t('poster.create.submitting') : t('poster.create.submit')}
|
||||
</button>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default PosterCreateForm;
|
||||
@@ -0,0 +1,101 @@
|
||||
import React from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { P2vJob, isPastReview, p2vProgress } from '../../utils/p2vApi';
|
||||
|
||||
interface PosterMakingContentProps {
|
||||
job: P2vJob | null;
|
||||
/** 실패한 잡을 버리고 처음부터. 실패하면 크레딧이 환불되므로 같은 잡을 다시 돌리지 않는다 */
|
||||
onDiscard: () => void;
|
||||
busy: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* 포스터 영상 생성 진행 화면. 검수 전(분석)과 검수 후(생성) 양쪽에 쓰인다.
|
||||
*
|
||||
* 두 구간을 한 컴포넌트로 둔 이유: 화면 구성이 같고 문구만 다르다. 나누면
|
||||
* 스피너·진행바·에러 처리가 두 벌이 되어 한쪽만 고치는 사고가 난다.
|
||||
*
|
||||
* 진행바는 스테이지 완료 수 기반이라 구간 사이에서 멈춰 보인다 —
|
||||
* 스피너가 "살아 있다"를 따로 알린다(썰박스 SsulMakingContent 와 같은 판단).
|
||||
*/
|
||||
const PosterMakingContent: React.FC<PosterMakingContentProps> = ({
|
||||
job, onDiscard, busy,
|
||||
}) => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
if (!job) return null;
|
||||
|
||||
const failed = job.status === 'failed';
|
||||
const percent = p2vProgress(job);
|
||||
const past = isPastReview(job);
|
||||
|
||||
// 현재 스테이지 라벨. 서버가 stage 를 비워 보내는 순간(스테이지 전환 사이)이 있어
|
||||
// 그때는 구간 이름으로 대신한다 — 라벨이 깜빡이며 사라지면 멈춘 것처럼 보인다.
|
||||
const stageLabel = job.stage
|
||||
? t(`poster.stages.${job.stage}`, { defaultValue: job.stage })
|
||||
: t(past ? 'poster.making.phaseRender' : 'poster.making.phaseAnalyze');
|
||||
|
||||
return (
|
||||
<div className="p2v-scope p2v-making">
|
||||
<span className="p2v-making__name">{job.name}</span>
|
||||
|
||||
{failed ? (
|
||||
<>
|
||||
<h2 className="p2v-making__title warn">{t('poster.making.failTitle')}</h2>
|
||||
<p className="p2v-making__desc">
|
||||
{t(`poster.stages.${job.error?.stage}`, { defaultValue: job.error?.stage ?? '' })}
|
||||
</p>
|
||||
{job.error?.detail && (
|
||||
<pre className="p2v-errorbox">{job.error.detail}</pre>
|
||||
)}
|
||||
<p className="p2v-making__desc">{t('poster.making.refunded')}</p>
|
||||
<div className="p2v-making__actions">
|
||||
<button type="button" className="p2v-btn-mint" disabled={busy} onClick={onDiscard}>
|
||||
{t('poster.making.discard')}
|
||||
</button>
|
||||
</div>
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<h2 className="p2v-making__title">
|
||||
{t(past ? 'poster.making.titleRender' : 'poster.making.titleAnalyze')}
|
||||
</h2>
|
||||
|
||||
<div className="p2v-spinner" aria-hidden="true" />
|
||||
|
||||
<div
|
||||
className="p2v-bar"
|
||||
role="progressbar"
|
||||
aria-valuenow={percent}
|
||||
aria-valuemin={0}
|
||||
aria-valuemax={100}
|
||||
>
|
||||
<div className="p2v-bar__fill" style={{ width: `${percent}%` }} />
|
||||
</div>
|
||||
|
||||
<div className="p2v-making__meta">
|
||||
<span>{stageLabel}</span>
|
||||
<span className="p2v-making__pct">{percent}%</span>
|
||||
</div>
|
||||
|
||||
<p className="p2v-making__desc">
|
||||
{t(past ? 'poster.making.descRender' : 'poster.making.descAnalyze')}
|
||||
</p>
|
||||
|
||||
{/* 나레이션은 검수 전에 이미 나온다. 먼저 보여주면 대기 시간이 덜 비어 보이고,
|
||||
검수 화면에서 처음 읽는 것보다 훑을 시간이 생긴다 */}
|
||||
{job.narration && job.narration.length > 0 && (
|
||||
<div className="p2v-panel p2v-making__narration">
|
||||
<p className="p2v-label">{t('poster.review.narration')}</p>
|
||||
{job.narration.map((line, i) => (
|
||||
<p key={i} className="p2v-narration-line">{line}</p>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default PosterMakingContent;
|
||||
@@ -0,0 +1,131 @@
|
||||
import React, { useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { P2vJob } from '../../utils/p2vApi';
|
||||
import { SocialUploadableItem } from '../../types/api';
|
||||
import SocialPostingModal from '../../components/SocialPostingModal';
|
||||
|
||||
interface PosterResultContentProps {
|
||||
job: P2vJob;
|
||||
/** 새 포스터로 처음부터 */
|
||||
onNew: () => void;
|
||||
}
|
||||
|
||||
/**
|
||||
* 포스터 영상 완성 화면.
|
||||
*
|
||||
* 산출물은 Azure Blob 의 절대 URL 이다. 완성 영상은 blob 에 내려받기 헤더가 붙어 있어
|
||||
* `<a download>` 가 다른 출처에서도 파일로 저장된다.
|
||||
*/
|
||||
const PosterResultContent: React.FC<PosterResultContentProps> = ({ job, onNew }) => {
|
||||
const { t } = useTranslation();
|
||||
const [showSocialModal, setShowSocialModal] = useState(false);
|
||||
|
||||
const video = job.artifacts.video ?? '';
|
||||
const thumbnail = job.artifacts.thumbnail ?? null;
|
||||
|
||||
// 소셜 업로드 모달은 VideoListItem 형태를 받는다. type='p2v_video' 가 핵심이다 —
|
||||
// 모달이 content_type 으로 보내므로 id 가 겹치는 ADO2 영상이 업로드되는 사고가 없다.
|
||||
const uploadItem = video
|
||||
? ({
|
||||
type: 'p2v_video',
|
||||
video_id: job.id,
|
||||
store_name: job.name,
|
||||
region: '',
|
||||
task_id: '',
|
||||
result_movie_url: video,
|
||||
thumbnail_url: thumbnail ?? undefined,
|
||||
created_at: new Date(job.created_at * 1000).toISOString(),
|
||||
like_count: 0,
|
||||
comment_count: 0,
|
||||
is_liked_by_me: false,
|
||||
} as SocialUploadableItem)
|
||||
: null;
|
||||
|
||||
return (
|
||||
<div className="p2v-scope p2v-result">
|
||||
<h2 className="p2v-result__title">{t('poster.result.title')}</h2>
|
||||
|
||||
<div className="p2v-result__grid">
|
||||
<div className="p2v-panel p2v-result__player">
|
||||
{video ? (
|
||||
<video src={video} controls playsInline />
|
||||
) : (
|
||||
<p className="p2v-note">{t('poster.result.videoMissing')}</p>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className="p2v-result__side">
|
||||
<p className="p2v-label">{t('poster.result.fileName')}</p>
|
||||
<p className="p2v-result__filename">{job.name}.mp4</p>
|
||||
|
||||
{job.metadata && (
|
||||
<div className="p2v-result__block">
|
||||
{([
|
||||
['event_name', job.metadata.event_name],
|
||||
['date_text', job.metadata.date_text],
|
||||
['place', job.metadata.place],
|
||||
] as const).map(([field, value]) => (
|
||||
value ? (
|
||||
<div key={field} className="p2v-result__row">
|
||||
<span>{t(`poster.review.field.${field}`)}</span>
|
||||
<b>{value}</b>
|
||||
</div>
|
||||
) : null
|
||||
))}
|
||||
{job.metadata.keywords?.length > 0 && (
|
||||
<div className="p2v-tags">
|
||||
{job.metadata.keywords.map((kw) => (
|
||||
<span key={kw} className="p2v-tag">#{kw}</span>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{job.narration && job.narration.length > 0 && (
|
||||
<div className="p2v-result__block">
|
||||
<p className="p2v-label">{t('poster.review.narration')}</p>
|
||||
{job.narration.map((line, i) => (
|
||||
<p key={i} className="p2v-narration-line">{line}</p>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div className="p2v-result__actions">
|
||||
{thumbnail && (
|
||||
<a href={thumbnail} download className="p2v-btn-tonal">
|
||||
{t('poster.result.downloadThumb')}
|
||||
</a>
|
||||
)}
|
||||
{video && (
|
||||
<a href={video} download className="p2v-btn-cta p2v-btn-cta--compact">
|
||||
{t('poster.result.downloadVideo')}
|
||||
</a>
|
||||
)}
|
||||
{uploadItem && job.status === 'done' && (
|
||||
<button
|
||||
type="button"
|
||||
className="p2v-btn-tonal"
|
||||
onClick={() => setShowSocialModal(true)}
|
||||
>
|
||||
{t('ado2Contents.uploadToSocial')}
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<SocialPostingModal
|
||||
isOpen={showSocialModal}
|
||||
onClose={() => setShowSocialModal(false)}
|
||||
video={uploadItem}
|
||||
/>
|
||||
|
||||
<button type="button" className="p2v-btn-outline p2v-result__new" onClick={onNew}>
|
||||
{t('poster.result.new')}
|
||||
</button>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default PosterResultContent;
|
||||
@@ -0,0 +1,171 @@
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import {
|
||||
P2vJob,
|
||||
approvePosterJob,
|
||||
updatePosterMetadata,
|
||||
updatePosterNarration,
|
||||
} from '../../utils/p2vApi';
|
||||
import { META_FIELDS, MOTION_KEYS, MetaField, motionLabel } from './posterData';
|
||||
|
||||
interface PosterReviewContentProps {
|
||||
job: P2vJob;
|
||||
/** 승인 요청이 끝나면 호출 — GenerationFlow 가 폴링을 다시 켠다 */
|
||||
onApproved: () => void;
|
||||
}
|
||||
|
||||
type MetaDraft = Record<MetaField, string>;
|
||||
|
||||
const emptyMeta = (): MetaDraft => ({ event_name: '', date_text: '', place: '' });
|
||||
|
||||
/**
|
||||
* 검수 게이트.
|
||||
*
|
||||
* 이 화면이 파이프라인에서 가장 중요한 지점이다 — 여기서 승인해야 TTS·음악·
|
||||
* 애니메이션·렌더가 이어지고, 그 뒤로는 되돌리려면 전부 다시 만들어야 한다.
|
||||
* 그래서 셋을 한 화면에 모아 **포스터 원본과 대조하며** 고치게 한다:
|
||||
*
|
||||
* 1) 나레이션 3문장 — 그대로 음성이 된다
|
||||
* 2) 움직일 요소 — 애니메이션 대상. 비우면 정지 영상이 된다
|
||||
* 3) 메타태그 — 아카이브에 영구 저장된다. 연도·지명 오독이 여기서 걸린다
|
||||
*
|
||||
* 왼쪽에 편집, 오른쪽에 영역 분석 이미지를 두는 배치는 P2V 웹과 같다.
|
||||
*/
|
||||
const PosterReviewContent: React.FC<PosterReviewContentProps> = ({ job, onApproved }) => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const [lines, setLines] = useState<string[]>([]);
|
||||
const [motions, setMotions] = useState<string[] | null>(null);
|
||||
const [meta, setMeta] = useState<MetaDraft>(emptyMeta);
|
||||
const [busy, setBusy] = useState(false);
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
|
||||
// 서버 값으로 초안을 채우되, 사용자가 고치기 시작한 뒤에는 폴링 응답이 덮지 않아야 한다.
|
||||
// 잡 id 가 바뀔 때만 다시 채운다(같은 잡의 재조회는 무시).
|
||||
useEffect(() => {
|
||||
setLines(job.narration ?? []);
|
||||
// 0종([])도 유효한 값이라 null(미로딩)로만 판별한다
|
||||
setMotions(job.motion_elements ?? []);
|
||||
setMeta({
|
||||
event_name: job.metadata?.event_name ?? '',
|
||||
date_text: job.metadata?.date_text ?? '',
|
||||
place: job.metadata?.place ?? '',
|
||||
});
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [job.id]);
|
||||
|
||||
const toggleMotion = (key: string) => {
|
||||
setMotions((prev) => {
|
||||
const cur = prev ?? [];
|
||||
return cur.includes(key) ? cur.filter((m) => m !== key) : [...cur, key];
|
||||
});
|
||||
};
|
||||
|
||||
const approve = async () => {
|
||||
if (busy) return;
|
||||
setBusy(true);
|
||||
setError(null);
|
||||
try {
|
||||
// 바뀐 것만 보낸다. 서버는 PUT 마다 잡 파일을 다시 쓰므로 무의미한 쓰기를 줄인다.
|
||||
if (JSON.stringify(lines) !== JSON.stringify(job.narration ?? [])) {
|
||||
await updatePosterNarration(job.id, lines);
|
||||
}
|
||||
const md = job.metadata;
|
||||
const metaChanged = !md || META_FIELDS.some((f) => (md[f] ?? '') !== meta[f]);
|
||||
if (metaChanged) {
|
||||
await updatePosterMetadata(job.id, meta);
|
||||
}
|
||||
// 순서 차이는 의미가 없다(서버가 집합으로 쓴다) — 정렬해 비교해야 헛 전송이 없다
|
||||
const motionsChanged = motions !== null
|
||||
&& JSON.stringify([...motions].sort())
|
||||
!== JSON.stringify([...(job.motion_elements ?? [])].sort());
|
||||
await approvePosterJob(job.id, motionsChanged ? motions : null);
|
||||
onApproved();
|
||||
} catch (e) {
|
||||
setError((e as Error).message);
|
||||
setBusy(false);
|
||||
}
|
||||
};
|
||||
|
||||
const noMotion = motions !== null && motions.length === 0;
|
||||
|
||||
return (
|
||||
<div className="p2v-scope p2v-review">
|
||||
<div className="p2v-review__grid">
|
||||
<div className="p2v-review__edit">
|
||||
{/* ── 나레이션 ─────────────────────────────── */}
|
||||
<p className="p2v-label">{t('poster.review.narration')}</p>
|
||||
<p className="p2v-help">{t('poster.review.narrationHelp')}</p>
|
||||
{lines.map((line, i) => (
|
||||
<input
|
||||
key={i}
|
||||
className="p2v-input"
|
||||
value={line}
|
||||
onChange={(e) => setLines(lines.map((v, j) => (j === i ? e.target.value : v)))}
|
||||
/>
|
||||
))}
|
||||
|
||||
{/* ── 움직일 요소 ──────────────────────────── */}
|
||||
<p className="p2v-label">{t('poster.review.motion')}</p>
|
||||
<p className="p2v-help">
|
||||
{t(noMotion ? 'poster.review.motionEmpty' : 'poster.review.motionHelp')}
|
||||
</p>
|
||||
<div className="p2v-chips">
|
||||
{MOTION_KEYS.map((key) => {
|
||||
const on = motions?.includes(key) ?? false;
|
||||
return (
|
||||
<button
|
||||
key={key}
|
||||
type="button"
|
||||
aria-pressed={on}
|
||||
className={`p2v-chip${on ? ' active' : ''}`}
|
||||
onClick={() => toggleMotion(key)}
|
||||
>
|
||||
{t(motionLabel(key))}
|
||||
</button>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
|
||||
{/* ── 메타태그 ─────────────────────────────── */}
|
||||
<p className="p2v-label">{t('poster.review.metadata')}</p>
|
||||
<p className="p2v-help">{t('poster.review.metadataHelp')}</p>
|
||||
{META_FIELDS.map((field) => (
|
||||
<div key={field} className="p2v-field">
|
||||
<span className="p2v-field__label">{t(`poster.review.field.${field}`)}</span>
|
||||
<input
|
||||
className="p2v-input"
|
||||
value={meta[field]}
|
||||
onChange={(e) => setMeta({ ...meta, [field]: e.target.value })}
|
||||
/>
|
||||
</div>
|
||||
))}
|
||||
|
||||
{error && <div className="p2v-note warn">{error}</div>}
|
||||
|
||||
<button type="button" className="p2v-btn-cta" disabled={busy} onClick={approve}>
|
||||
{busy ? t('poster.review.approving') : t('poster.review.approve')}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{/* ── 대조용 분석 이미지 ────────────────────── */}
|
||||
<div className="p2v-review__preview">
|
||||
<p className="p2v-label">{t('poster.review.analysis')}</p>
|
||||
{job.artifacts.check_jpg ? (
|
||||
<img
|
||||
className="p2v-review__image"
|
||||
src={job.artifacts.check_jpg}
|
||||
alt={t('poster.review.analysisAlt')}
|
||||
/>
|
||||
) : (
|
||||
<div className="p2v-panel p2v-review__image-empty">
|
||||
{t('poster.review.analysisMissing')}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default PosterReviewContent;
|
||||
@@ -0,0 +1,72 @@
|
||||
import React from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
/** `ready` 가 false 인 갈래는 버튼이 "준비 중" 으로 잠긴다. 열 때는 이 값만 true 로 바꾼다 */
|
||||
const CARDS = [
|
||||
{ key: 'image', icon: 'IMG', hot: false, ready: true },
|
||||
{ key: 'url', icon: 'URL', hot: true, ready: false },
|
||||
] as const;
|
||||
const FLOW_KEYS = ['first', 'move', 'narration'] as const;
|
||||
const FACT_KEYS = ['need', 'review', 'time'] as const;
|
||||
|
||||
interface PosterStartChoiceProps {
|
||||
/** 이미지로 시작하기 — 포스터 업로드 폼(무빙 포스터)으로 */
|
||||
onPickImage: () => void;
|
||||
/** 공연상품페이지로 시작하기 — 주소 입력 폼(롱컷)으로 */
|
||||
onPickUrl: () => void;
|
||||
}
|
||||
|
||||
/**
|
||||
* 무빙 포스터 시작 선택 화면 — playreel 의 "어떻게 시작할까요?" 와 같은 구성이다.
|
||||
* 가진 것(이미지 한 장 / 상품페이지 주소)에 따라 두 갈래 중 하나를 고른다.
|
||||
*/
|
||||
const PosterStartChoice: React.FC<PosterStartChoiceProps> = ({ onPickImage, onPickUrl }) => {
|
||||
const { t } = useTranslation();
|
||||
const handlers = { image: onPickImage, url: onPickUrl };
|
||||
|
||||
return (
|
||||
<div className="p2v-scope p2v-start">
|
||||
<h2 className="p2v-start__title">{t('poster.start.title')}</h2>
|
||||
<p className="p2v-start__subtitle">{t('poster.start.subtitle')}</p>
|
||||
|
||||
{CARDS.map(({ key, icon, hot, ready }) => (
|
||||
<div key={key} className={`p2v-panel p2v-intro${hot ? ' p2v-intro--hot' : ''}`}>
|
||||
{hot && <span className="p2v-intro__badge">{t('poster.start.badge')}</span>}
|
||||
<div className="p2v-intro__head">
|
||||
<div className="p2v-intro__icon">{icon}</div>
|
||||
<div>
|
||||
<h3 className="p2v-intro__title">{t(`poster.start.${key}.title`)}</h3>
|
||||
<p className="p2v-intro__desc">{t(`poster.start.${key}.desc`)}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ol className="p2v-intro__flow">
|
||||
{FLOW_KEYS.map((flow, i) => (
|
||||
<li key={flow}>
|
||||
<span className="p2v-intro__flow-number" aria-hidden="true">
|
||||
{String(i + 1).padStart(2, '0')}
|
||||
</span>
|
||||
<span>{t(`poster.start.${key}.flow.${flow}`)}</span>
|
||||
</li>
|
||||
))}
|
||||
</ol>
|
||||
|
||||
<div className="p2v-intro__facts">
|
||||
{FACT_KEYS.map((fact) => (
|
||||
<div key={fact}>
|
||||
<b>{t(`poster.start.${key}.facts.${fact}.label`)}</b>
|
||||
<span>{t(`poster.start.${key}.facts.${fact}.value`)}</span>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
|
||||
<button type="button" className="p2v-btn-cta" disabled={!ready} onClick={handlers[key]}>
|
||||
{ready ? t(`poster.start.${key}.cta`) : t('poster.start.comingSoon')}
|
||||
</button>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default PosterStartChoice;
|
||||
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* 포스터 파이프라인의 코드 목록.
|
||||
*
|
||||
* 썰박스 ssulData.ts 와 같은 규칙 — **코드만 두고 표시 문구는 i18n 에 둔다.**
|
||||
* castad 는 ko/en 다국어라 한글이 코드에 박히면 번역 밖으로 샌다.
|
||||
*/
|
||||
|
||||
/**
|
||||
* 움직일 수 있는 요소.
|
||||
*
|
||||
* P2V `scripts/motion_plan.py` 의 MOTION_PHRASE 화이트리스트와 **1:1 이어야 한다** —
|
||||
* 여기 없는 키를 보내면 서버가 422 로 거른다. 순서는 그쪽 정의 순서를 따른다.
|
||||
*/
|
||||
export const MOTION_KEYS = [
|
||||
'firework', 'water', 'wave', 'cloud', 'smoke',
|
||||
'moon', 'sun', 'star', 'light', 'flag',
|
||||
'foliage', 'wheel', 'vessel', 'crowd',
|
||||
] as const;
|
||||
|
||||
export type MotionKey = (typeof MOTION_KEYS)[number];
|
||||
|
||||
/** i18n 키 헬퍼 — t(motionLabel('firework')) 형태로 쓴다 */
|
||||
export const motionLabel = (key: string): string => `poster.motion.${key}`;
|
||||
|
||||
/** 검수 화면에서 고칠 수 있는 메타 필드. 나머지(category·keywords)는 서버 판단을 따른다 */
|
||||
export const META_FIELDS = ['event_name', 'date_text', 'place'] as const;
|
||||
|
||||
export type MetaField = (typeof META_FIELDS)[number];
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
createSsulJob,
|
||||
searchAccommodation,
|
||||
} from '../../utils/api';
|
||||
import { SCEN, SCEN_KEYS, Scen, scenDesc, scenName } from './ssulData';
|
||||
import { SCEN_KEYS, Scen, scenDesc, scenName } from './ssulData';
|
||||
|
||||
interface SsulCreateFormProps {
|
||||
/** 생성 요청이 접수되면 호출. 폴링 소유는 GenerationFlow */
|
||||
@@ -154,7 +154,6 @@ const SsulCreateForm: React.FC<SsulCreateFormProps> = ({ onSubmitted, onNeedCred
|
||||
|
||||
<div className="ssul-create__scenarios">
|
||||
{SCEN_KEYS.map((key) => {
|
||||
const pal = SCEN[key];
|
||||
const active = scenario === key;
|
||||
return (
|
||||
<button
|
||||
@@ -162,19 +161,8 @@ const SsulCreateForm: React.FC<SsulCreateFormProps> = ({ onSubmitted, onNeedCred
|
||||
type="button"
|
||||
aria-pressed={active}
|
||||
className={`ssul-scn${active ? ' active' : ''}`}
|
||||
style={
|
||||
{
|
||||
// 표지 그라디언트 2단 + 대표색. CSS 가 옅게 깔아 쓴다
|
||||
'--scn': pal.hex,
|
||||
'--scn-a': pal.g[0],
|
||||
'--scn-b': pal.g[1],
|
||||
} as React.CSSProperties
|
||||
}
|
||||
onClick={() => setScenario(key)}
|
||||
>
|
||||
<span className="ssul-scn__emoji" aria-hidden="true">
|
||||
{pal.emoji}
|
||||
</span>
|
||||
<span className="ssul-scn__name">{t(scenName(key))}</span>
|
||||
<span className="ssul-scn__desc">{t(scenDesc(key))}</span>
|
||||
</button>
|
||||
|
||||
@@ -1,20 +1,5 @@
|
||||
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import {
|
||||
API_URL,
|
||||
deleteComment,
|
||||
getSsulContentById,
|
||||
getUserMe,
|
||||
getVideoComments,
|
||||
isLoggedIn,
|
||||
postVideoComment,
|
||||
toggleVideoLike,
|
||||
} from '../../utils/api';
|
||||
import type { SsulDetailItem } from '../../utils/api';
|
||||
import { CommentItem, UserMeResponse } from '../../types/api';
|
||||
import { buildContentShareUrl, tryNativeShare } from '../../utils/nativeShare';
|
||||
import LoginPromptModal from '../../components/LoginPromptModal';
|
||||
import { isSafeHttpUrl } from '../../utils/url';
|
||||
import React from 'react';
|
||||
import ContentDetailContent from '../../components/ContentDetailContent';
|
||||
|
||||
interface SsulDetailContentProps {
|
||||
contentId: string;
|
||||
@@ -22,467 +7,8 @@ interface SsulDetailContentProps {
|
||||
onClose?: () => void;
|
||||
}
|
||||
|
||||
/**
|
||||
* 썰박스 콘텐츠 상세 — castad `VideoDetailContent` 와 같은 3층 구조의 내용부.
|
||||
* (SsulViewerModal 이 모달로, SsulDetailPage 가 공유 링크 페이지로 감싼다)
|
||||
*
|
||||
* UI·동작(좋아요 낙관 갱신·댓글·대댓글·공유·비로그인 게이트)은
|
||||
* `VideoDetailContent` 와 동일하고, 다른 점은 셋뿐이다:
|
||||
* 1. 상세 조회가 `GET /ssul/{id}` (video 조회를 쓰면 id 가 겹치는 남의 영상이 열린다)
|
||||
* 2. 좋아요·댓글 API 에 `contentType='ssul'` 을 얹는다
|
||||
* 3. 공유 URL 이 `/ssul/share/{id}` 다
|
||||
*/
|
||||
const SsulDetailContent: React.FC<SsulDetailContentProps> = ({
|
||||
contentId,
|
||||
isModal = false,
|
||||
onClose,
|
||||
}) => {
|
||||
const { t } = useTranslation();
|
||||
const authed = isLoggedIn();
|
||||
|
||||
const [content, setContent] = useState<SsulDetailItem | null>(null);
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
|
||||
const [likeCount, setLikeCount] = useState(0);
|
||||
const [isLiked, setIsLiked] = useState(false);
|
||||
|
||||
const [copied, setCopied] = useState(false);
|
||||
const [isLandscape, setIsLandscape] = useState(false);
|
||||
const [showSiteOverlay, setShowSiteOverlay] = useState(false);
|
||||
const [showLoginModal, setShowLoginModal] = useState(false);
|
||||
|
||||
const [comments, setComments] = useState<CommentItem[]>([]);
|
||||
const [commentsTotal, setCommentsTotal] = useState(0);
|
||||
const [commentsPage, setCommentsPage] = useState(1);
|
||||
const [commentsHasNext, setCommentsHasNext] = useState(false);
|
||||
const [commentsLoading, setCommentsLoading] = useState(false);
|
||||
const [commentInput, setCommentInput] = useState('');
|
||||
const [commentSubmitting, setCommentSubmitting] = useState(false);
|
||||
const commentTextareaRef = useRef<HTMLTextAreaElement>(null);
|
||||
|
||||
const [currentUser, setCurrentUser] = useState<UserMeResponse | null>(null);
|
||||
|
||||
const fetchComments = useCallback(
|
||||
async (page: number, append = false) => {
|
||||
setCommentsLoading(true);
|
||||
try {
|
||||
const res = await getVideoComments(contentId, page, 20, 'ssul');
|
||||
const sorted = [...res.items].sort(
|
||||
(a, b) => new Date(a.created_at).getTime() - new Date(b.created_at).getTime()
|
||||
);
|
||||
setComments((prev) => (append ? [...prev, ...sorted] : sorted));
|
||||
setCommentsTotal(res.total);
|
||||
setCommentsHasNext(res.has_next);
|
||||
setCommentsPage(page);
|
||||
} catch (err) {
|
||||
console.error('Failed to fetch ssul comments:', err);
|
||||
} finally {
|
||||
setCommentsLoading(false);
|
||||
}
|
||||
},
|
||||
[contentId]
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
const fetchContent = async () => {
|
||||
setLoading(true);
|
||||
setError(null);
|
||||
setShowSiteOverlay(false);
|
||||
try {
|
||||
const data = await getSsulContentById(contentId);
|
||||
setContent(data);
|
||||
setLikeCount(data.like_count);
|
||||
setIsLiked(data.is_liked_by_me);
|
||||
} catch (err) {
|
||||
console.error('Failed to fetch ssul content:', err);
|
||||
setError(t('ado2Contents.loadFailed'));
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
setIsLandscape(false);
|
||||
fetchContent();
|
||||
fetchComments(1);
|
||||
}, [contentId, fetchComments, t]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!authed) return;
|
||||
getUserMe().then(setCurrentUser).catch((err) => {
|
||||
console.error('Failed to fetch current user:', err);
|
||||
});
|
||||
}, [authed]);
|
||||
|
||||
const formatDate = (dateString: string) => {
|
||||
const date = new Date(dateString);
|
||||
return t('videoDetail.dateFormat', {
|
||||
year: date.getFullYear(),
|
||||
month: date.getMonth() + 1,
|
||||
day: date.getDate(),
|
||||
});
|
||||
};
|
||||
|
||||
const formatCommentDate = (dateString: string) => {
|
||||
const date = new Date(dateString);
|
||||
return `${date.getFullYear()}.${String(date.getMonth() + 1).padStart(2, '0')}.${String(
|
||||
date.getDate()
|
||||
).padStart(2, '0')}`;
|
||||
};
|
||||
|
||||
// 썰박스 공개 페이지 경로. /video/{id} 를 쓰면 id 가 겹치는 남의 영상이 열린다.
|
||||
const shareUrl = buildContentShareUrl(API_URL, contentId, 'ssul');
|
||||
|
||||
const handleCopyLink = async () => {
|
||||
try {
|
||||
await navigator.clipboard.writeText(shareUrl);
|
||||
} catch {
|
||||
// clipboard API 미지원 환경에서는 무시
|
||||
}
|
||||
setCopied(true);
|
||||
setTimeout(() => setCopied(false), 2000);
|
||||
};
|
||||
|
||||
const handleShareButtonClick = async () => {
|
||||
const handled = await tryNativeShare({
|
||||
title: content?.store_name ?? t('videoDetail.kakaoDefaultTitle'),
|
||||
url: shareUrl,
|
||||
});
|
||||
if (handled) {
|
||||
return;
|
||||
}
|
||||
await handleCopyLink();
|
||||
};
|
||||
|
||||
const likeDebounceRef = useRef<ReturnType<typeof setTimeout> | null>(null);
|
||||
|
||||
const handleLike = () => {
|
||||
if (!authed) {
|
||||
setShowLoginModal(true);
|
||||
return;
|
||||
}
|
||||
|
||||
setIsLiked((prev) => !prev);
|
||||
setLikeCount((prev) => (isLiked ? prev - 1 : prev + 1));
|
||||
|
||||
if (likeDebounceRef.current) clearTimeout(likeDebounceRef.current);
|
||||
likeDebounceRef.current = setTimeout(async () => {
|
||||
const prevLiked = isLiked;
|
||||
const prevCount = likeCount;
|
||||
try {
|
||||
await toggleVideoLike(contentId, 'ssul');
|
||||
} catch (err) {
|
||||
console.error('Failed to toggle ssul like:', err);
|
||||
setIsLiked(prevLiked);
|
||||
setLikeCount(prevCount);
|
||||
}
|
||||
}, 500);
|
||||
};
|
||||
|
||||
const handleHeaderAction = () => {
|
||||
if (!isModal && !authed) {
|
||||
setShowLoginModal(true);
|
||||
return;
|
||||
}
|
||||
onClose?.();
|
||||
};
|
||||
|
||||
const handleCommentFocus = () => {
|
||||
if (!authed) setShowLoginModal(true);
|
||||
};
|
||||
|
||||
const handleCommentSubmit = async () => {
|
||||
if (!authed) {
|
||||
setShowLoginModal(true);
|
||||
return;
|
||||
}
|
||||
if (!commentInput.trim() || commentSubmitting) return;
|
||||
setCommentSubmitting(true);
|
||||
try {
|
||||
await postVideoComment(contentId, commentInput.trim(), undefined, 'ssul');
|
||||
setCommentInput('');
|
||||
if (commentTextareaRef.current) {
|
||||
commentTextareaRef.current.style.height = 'auto';
|
||||
}
|
||||
await fetchComments(1);
|
||||
} catch (err) {
|
||||
console.error('Failed to post ssul comment:', err);
|
||||
} finally {
|
||||
setCommentSubmitting(false);
|
||||
}
|
||||
};
|
||||
|
||||
const handleDeleteComment = async (commentId: number) => {
|
||||
try {
|
||||
await deleteComment(commentId);
|
||||
await fetchComments(commentsPage);
|
||||
} catch (err) {
|
||||
console.error('Failed to delete ssul comment:', err);
|
||||
}
|
||||
};
|
||||
|
||||
const renderCommentContent = (content_: string | null, isDeleted: boolean) => {
|
||||
if (isDeleted) {
|
||||
return (
|
||||
<span style={{ color: '#6B9EA0', fontStyle: 'italic' }}>
|
||||
{t('videoDetail.deletedComment')}
|
||||
</span>
|
||||
);
|
||||
}
|
||||
return content_;
|
||||
};
|
||||
|
||||
return (
|
||||
<div className={isModal ? 'video-detail-modal-content' : 'video-detail-page-content'}>
|
||||
{/* 헤더 */}
|
||||
<div className="video-detail-header">
|
||||
{isModal ? (
|
||||
<>
|
||||
{/* 제목이 없으면 space-between 인 헤더에서 닫기 버튼이 왼쪽으로 붙는다.
|
||||
문구는 ADO2 상세와 같은 키를 쓴다 — 통합 목록에서 열리는 같은
|
||||
모달이므로 콘텐츠 종류에 따라 제목이 바뀌면 오히려 어색하다. */}
|
||||
<h2 className="video-detail-modal-title">{t('sidebar.ado2Contents')}</h2>
|
||||
<button className="video-detail-close-btn" onClick={handleHeaderAction} aria-label={t('videoDetail.closeAriaLabel')}>
|
||||
<svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
|
||||
<line x1="18" y1="6" x2="6" y2="18" /><line x1="6" y1="6" x2="18" y2="18" />
|
||||
</svg>
|
||||
</button>
|
||||
</>
|
||||
) : (
|
||||
<button className="video-detail-back-btn" onClick={handleHeaderAction}>
|
||||
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" stroke="currentColor" strokeWidth="1.5">
|
||||
<path d="M13 4l-6 6 6 6" />
|
||||
</svg>
|
||||
{t('sidebar.ado2Contents')}
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className="video-detail-body">
|
||||
{loading ? (
|
||||
<div className="ado2-contents-loading">
|
||||
<div className="loading-spinner"></div>
|
||||
<p>{t('ado2Contents.loading')}</p>
|
||||
</div>
|
||||
) : error ? (
|
||||
<div className="ado2-contents-error"><p>{error}</p></div>
|
||||
) : content ? (
|
||||
<div className={`video-detail-content ${isLandscape ? 'landscape' : ''}`}>
|
||||
<div className="video-detail-player-wrap">
|
||||
<video
|
||||
src={content.video_url}
|
||||
controls
|
||||
autoPlay
|
||||
playsInline
|
||||
controlsList="nodownload"
|
||||
onContextMenu={(e) => e.preventDefault()}
|
||||
className="video-detail-player"
|
||||
onLoadedMetadata={(e) => {
|
||||
const v = e.currentTarget;
|
||||
setIsLandscape(v.videoWidth > v.videoHeight);
|
||||
}}
|
||||
onTimeUpdate={(e) => {
|
||||
if (!content.official_site_url) return;
|
||||
const v = e.currentTarget;
|
||||
// 영상 종료 3초 전부터 공식 홈페이지 오버레이 노출
|
||||
setShowSiteOverlay(
|
||||
Number.isFinite(v.duration) && v.duration - v.currentTime <= 3
|
||||
);
|
||||
}}
|
||||
/>
|
||||
{showSiteOverlay && isSafeHttpUrl(content.official_site_url) && (
|
||||
<a
|
||||
href={content.official_site_url as string}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="video-site-overlay"
|
||||
>
|
||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
|
||||
<circle cx="12" cy="12" r="10"/>
|
||||
<line x1="2" y1="12" x2="22" y2="12"/>
|
||||
<path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"/>
|
||||
</svg>
|
||||
<span className="video-site-overlay-text">
|
||||
<strong>{content.store_name}</strong>
|
||||
{t('videoDetail.siteOverlayLabel')}
|
||||
</span>
|
||||
</a>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className="video-detail-info">
|
||||
<h2 className="video-detail-store">
|
||||
{content.store_name || t('ssulbox.viewer.untitled')}
|
||||
</h2>
|
||||
<p className="video-detail-date">{formatDate(content.created_at)}</p>
|
||||
|
||||
{/* 좋아요 + 공유 */}
|
||||
<div style={{ display: 'flex', gap: '8px', flexWrap: 'wrap' }}>
|
||||
<button
|
||||
className={`video-detail-like-btn ${isLiked ? 'liked' : ''}`}
|
||||
onClick={handleLike}
|
||||
>
|
||||
<svg width="16" height="16" viewBox="0 0 24 24" fill={isLiked ? 'currentColor' : 'none'} stroke="currentColor" strokeWidth="2">
|
||||
<path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z" />
|
||||
</svg>
|
||||
{likeCount}
|
||||
</button>
|
||||
<button
|
||||
className="video-detail-copy-btn"
|
||||
onClick={handleShareButtonClick}
|
||||
title={t('videoDetail.share')}
|
||||
>
|
||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
|
||||
<circle cx="18" cy="5" r="3" /><circle cx="6" cy="12" r="3" /><circle cx="18" cy="19" r="3" />
|
||||
<line x1="8.59" y1="13.51" x2="15.42" y2="17.49" /><line x1="15.41" y1="6.51" x2="8.59" y2="10.49" />
|
||||
</svg>
|
||||
{copied ? t('videoDetail.copied') : t('videoDetail.share')}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{/* 댓글 섹션 */}
|
||||
<div className="video-detail-comments">
|
||||
<div className="video-detail-comments-header">
|
||||
<h3 className="video-detail-comments-title">{t('videoDetail.commentsTitle')}</h3>
|
||||
<span className="video-detail-comments-count">{commentsTotal}</span>
|
||||
</div>
|
||||
|
||||
{authed && currentUser && (
|
||||
<div className="video-detail-comment-profile">
|
||||
{currentUser.profile_image_url && (
|
||||
<img
|
||||
src={currentUser.profile_image_url}
|
||||
alt={currentUser.nickname}
|
||||
className="video-detail-comment-avatar"
|
||||
/>
|
||||
)}
|
||||
<span className="video-detail-comment-nickname">{currentUser.nickname}</span>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div className="video-detail-comment-input-wrap">
|
||||
<textarea
|
||||
ref={commentTextareaRef}
|
||||
className="video-detail-comment-input"
|
||||
placeholder={authed ? t('videoDetail.commentPlaceholder') : t('videoDetail.commentLoginRequired')}
|
||||
maxLength={500}
|
||||
rows={1}
|
||||
value={commentInput}
|
||||
onChange={(e) => {
|
||||
setCommentInput(e.target.value);
|
||||
e.target.style.height = 'auto';
|
||||
e.target.style.height = `${e.target.scrollHeight}px`;
|
||||
}}
|
||||
onFocus={handleCommentFocus}
|
||||
onKeyDown={(e) => {
|
||||
if (e.key === 'Enter' && !e.shiftKey) {
|
||||
e.preventDefault();
|
||||
handleCommentSubmit();
|
||||
}
|
||||
}}
|
||||
disabled={!authed}
|
||||
/>
|
||||
<button
|
||||
className="video-detail-comment-submit"
|
||||
onClick={handleCommentSubmit}
|
||||
disabled={!authed || !commentInput.trim() || commentSubmitting}
|
||||
>
|
||||
{commentSubmitting ? t('videoDetail.commentSubmitting') : t('videoDetail.commentSubmit')}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{comments.length === 0 && !commentsLoading ? (
|
||||
<p className="video-detail-comments-empty">{t('videoDetail.noComments')}</p>
|
||||
) : (
|
||||
<ul className="video-detail-comment-list">
|
||||
{comments.map((c) => (
|
||||
<li key={c.id} className="video-detail-comment-item">
|
||||
{c.profile_image_url && (
|
||||
<img
|
||||
src={c.profile_image_url}
|
||||
alt={c.nickname || t('videoDetail.anonymous')}
|
||||
className="video-detail-comment-avatar"
|
||||
/>
|
||||
)}
|
||||
<div className="video-detail-comment-body">
|
||||
<span className="video-detail-comment-nickname">
|
||||
{c.nickname || t('videoDetail.anonymous')}
|
||||
</span>
|
||||
<p className="video-detail-comment-text">
|
||||
{renderCommentContent(c.content, c.is_deleted)}
|
||||
</p>
|
||||
<div className="video-detail-comment-bottom">
|
||||
<span className="video-detail-comment-date">{formatCommentDate(c.created_at)}</span>
|
||||
{c.is_mine && !c.is_deleted && (
|
||||
<button
|
||||
className="video-detail-comment-delete"
|
||||
onClick={() => handleDeleteComment(c.id)}
|
||||
>
|
||||
{t('videoDetail.deleteComment')}
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{c.replies && c.replies.length > 0 && (
|
||||
<ul className="video-detail-reply-list">
|
||||
{c.replies.map((r) => (
|
||||
<li key={r.id} className="video-detail-reply-item">
|
||||
{r.profile_image_url && (
|
||||
<img
|
||||
src={r.profile_image_url}
|
||||
alt={r.nickname || t('videoDetail.anonymous')}
|
||||
className="video-detail-comment-avatar small"
|
||||
/>
|
||||
)}
|
||||
<div className="video-detail-comment-body">
|
||||
<span className="video-detail-comment-nickname">
|
||||
{r.nickname || t('videoDetail.anonymous')}
|
||||
</span>
|
||||
<p className="video-detail-comment-text">
|
||||
{renderCommentContent(r.content, r.is_deleted)}
|
||||
</p>
|
||||
<div className="video-detail-comment-bottom">
|
||||
<span className="video-detail-comment-date">{formatCommentDate(r.created_at)}</span>
|
||||
{r.is_mine && !r.is_deleted && (
|
||||
<button
|
||||
className="video-detail-comment-delete"
|
||||
onClick={() => handleDeleteComment(r.id)}
|
||||
>
|
||||
{t('videoDetail.deleteComment')}
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
)}
|
||||
</div>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
)}
|
||||
|
||||
{commentsHasNext && (
|
||||
<button
|
||||
className="video-detail-comments-more"
|
||||
onClick={() => fetchComments(commentsPage + 1, true)}
|
||||
disabled={commentsLoading}
|
||||
>
|
||||
{commentsLoading ? t('videoDetail.loadingComments') : t('videoDetail.loadMoreComments')}
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
) : null}
|
||||
</div>
|
||||
|
||||
{showLoginModal && (
|
||||
<LoginPromptModal onClose={() => setShowLoginModal(false)} />
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
const SsulDetailContent: React.FC<SsulDetailContentProps> = (props) => (
|
||||
<ContentDetailContent {...props} contentType="ssul" />
|
||||
);
|
||||
|
||||
export default SsulDetailContent;
|
||||
@@ -1,6 +1,6 @@
|
||||
import React from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { SCEN, Scen, scenName } from './ssulData';
|
||||
import { Scen, scenName } from './ssulData';
|
||||
|
||||
/** 생성 잡의 현재 상태. GenerationFlow 가 폴링해 내려준다 */
|
||||
export interface SsulJob {
|
||||
@@ -45,7 +45,6 @@ const SsulMakingContent: React.FC<SsulMakingContentProps> = ({ job, onRetry }) =
|
||||
|
||||
if (!job) return null;
|
||||
|
||||
const palette = SCEN[job.scenario];
|
||||
const failed = job.status === 'error';
|
||||
// step 은 "완료한 단계 수"라 진행률은 step/4. queued(0) 면 0%
|
||||
const percent = Math.round((Math.min(job.step, TOTAL_STEPS) / TOTAL_STEPS) * 100);
|
||||
@@ -54,9 +53,7 @@ const SsulMakingContent: React.FC<SsulMakingContentProps> = ({ job, onRetry }) =
|
||||
|
||||
return (
|
||||
<div className="ssul-scope ssul-making">
|
||||
<span className="ssul-making__scenario" style={{ color: palette.hex }}>
|
||||
<span aria-hidden="true">{palette.emoji}</span> {t(scenName(job.scenario))}
|
||||
</span>
|
||||
<span className="ssul-making__scenario">{t(scenName(job.scenario))}</span>
|
||||
|
||||
{failed ? (
|
||||
<>
|
||||
@@ -75,13 +72,8 @@ const SsulMakingContent: React.FC<SsulMakingContentProps> = ({ job, onRetry }) =
|
||||
{/*
|
||||
단계 사이 구간에서는 진행바가 멈춰 있어 고장처럼 보인다.
|
||||
스피너는 "살아 있다"는 신호 전용이라 진행률을 표현하지 않는다.
|
||||
색은 시나리오 대표색을 따른다(민트 고정이면 삼국지·오디세이와 부딪힌다).
|
||||
*/}
|
||||
<div
|
||||
className="ssul-making__spinner"
|
||||
style={{ ['--scn' as string]: palette.hex }}
|
||||
aria-hidden="true"
|
||||
/>
|
||||
<div className="ssul-making__spinner" aria-hidden="true" />
|
||||
|
||||
<div
|
||||
className="ssul-making__bar"
|
||||
@@ -90,10 +82,7 @@ const SsulMakingContent: React.FC<SsulMakingContentProps> = ({ job, onRetry }) =
|
||||
aria-valuemin={0}
|
||||
aria-valuemax={100}
|
||||
>
|
||||
<div
|
||||
className="ssul-making__fill"
|
||||
style={{ width: `${percent}%`, background: palette.hex }}
|
||||
/>
|
||||
<div className="ssul-making__fill" style={{ width: `${percent}%` }} />
|
||||
</div>
|
||||
|
||||
<div className="ssul-making__meta">
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { SsulTaskStatus, getSsulTask } from '../../utils/api';
|
||||
import { VideoListItem } from '../../types/api';
|
||||
import { SocialUploadableItem } from '../../types/api';
|
||||
import SocialPostingModal from '../../components/SocialPostingModal';
|
||||
import CompletionView from '../../components/CompletionView';
|
||||
import { Scen, scenDesc, scenName } from './ssulData';
|
||||
@@ -136,7 +136,7 @@ const SsulResultContent: React.FC<SsulResultContentProps> = ({ taskId, scenario
|
||||
created_at: task.created_at,
|
||||
like_count: 0,
|
||||
comment_count: 0,
|
||||
} as VideoListItem)
|
||||
} as SocialUploadableItem)
|
||||
: null
|
||||
}
|
||||
/>
|
||||
|
||||
@@ -1,53 +1,20 @@
|
||||
/**
|
||||
* 썰박스 시나리오 팔레트와 표시 유틸.
|
||||
* 썰박스 시나리오 코드와 표시 유틸.
|
||||
*
|
||||
* 원본(o2o-ssulbox/frontend/src/data.ts)에서 이식하되 **문구(name/desc)는 제외**했다.
|
||||
* castad 는 ko/en 다국어라 한글이 코드에 박히면 i18n 밖으로 새기 때문이다.
|
||||
* 표시 문구는 `t('ssulbox.scenario.<key>.name')` / `.desc` 로 가져온다.
|
||||
*
|
||||
* 목업(SAMPLE)도 제외했다 — 백엔드 `/ssul/feed` 가 진실 원천이다.
|
||||
* 시나리오별 이모지·대표색·그라디언트는 ADO2 디자인 시스템 통일(2026-08-20)로
|
||||
* 제거했다 — 카드·스피너·진행바 모두 시스템 색(민트/퍼플)을 쓴다.
|
||||
*/
|
||||
|
||||
/** 시나리오 코드. 백엔드 `ssul_content.scenario` 와 값이 일치해야 한다 */
|
||||
export type Scen = 'joseon' | 'samgukji' | 'greek' | 'odyssey';
|
||||
|
||||
export interface ScenPalette {
|
||||
/** 카드 표지 이모지 */
|
||||
emoji: string;
|
||||
/** 대표색 (뱃지·강조선) */
|
||||
hex: string;
|
||||
/** 표지 그라디언트 시작/끝 */
|
||||
g: [string, string];
|
||||
}
|
||||
|
||||
export const SCEN: Record<Scen, ScenPalette> = {
|
||||
joseon: { emoji: '👑', hex: '#3b4cc0', g: ['#4054d6', '#8a3ffb'] },
|
||||
samgukji: { emoji: '⚔️', hex: '#d63a2f', g: ['#e0402f', '#f0872b'] },
|
||||
greek: { emoji: '🏛️', hex: '#0a8f6b', g: ['#0a9e78', '#3fb6d6'] },
|
||||
odyssey: { emoji: '⛵', hex: '#1565c0', g: ['#1565c0', '#42a5f5'] },
|
||||
};
|
||||
|
||||
/** 시나리오 순서. 선택 그리드(2x2)와 필터 칩이 이 순서를 따른다 */
|
||||
export const SCEN_KEYS = Object.keys(SCEN) as Scen[];
|
||||
|
||||
/** 카드 표지 그라디언트 */
|
||||
export const scGrad = (s: Scen): string =>
|
||||
`linear-gradient(150deg,${SCEN[s].g[0]} 0%,${SCEN[s].g[1]} 100%)`;
|
||||
export const SCEN_KEYS: Scen[] = ['joseon', 'samgukji', 'greek', 'odyssey'];
|
||||
|
||||
/** i18n 키 헬퍼 — t(scenName('joseon')) 형태로 쓴다 */
|
||||
export const scenName = (s: Scen): string => `ssulbox.scenario.${s}.name`;
|
||||
export const scenDesc = (s: Scen): string => `ssulbox.scenario.${s}.desc`;
|
||||
|
||||
/**
|
||||
* 조회수·좋아요 수 축약 표기 (1.2만 / 3.4천).
|
||||
*
|
||||
* 한글 단위가 박혀 있어 en 로케일에서는 어색하다. 통합 목록에서 castad 콘텐츠와
|
||||
* 나란히 놓이므로, 표기 방식은 Phase 8 에서 castad 쪽과 함께 정하는 게 맞다.
|
||||
* 그때까지는 원본 동작을 유지한다.
|
||||
*/
|
||||
export const fmt = (n: number): string =>
|
||||
n >= 10000
|
||||
? `${(n / 10000).toFixed(1).replace(/\.0$/, '')}만`
|
||||
: n >= 1000
|
||||
? `${(n / 1000).toFixed(1).replace(/\.0$/, '')}천`
|
||||
: `${n}`;
|
||||
+122
-61
@@ -2387,12 +2387,19 @@
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
/* `justify-content: center` 를 쓰지 않는다.
|
||||
중앙정렬 상태에서 내용이 컨테이너보다 길어지면 위아래로 똑같이 넘치는데,
|
||||
**위로 넘친 부분은 스크롤로도 닿을 수 없다**(flexbox 중앙정렬의 알려진 함정).
|
||||
실제로 무빙 포스터 탭에서 로고 밴드가 47px 잘려 보였다.
|
||||
대신 자식의 `margin: auto 0` 으로 중앙에 놓는다 — auto 마진은 여백이 있을 때만
|
||||
중앙정렬하고, 넘칠 때는 0 이 되어 위에서부터 정상 스크롤된다. */
|
||||
justify-content: flex-start;
|
||||
background-color: var(--color-bg-darker);
|
||||
color: var(--color-text-white);
|
||||
padding: 80px 1rem 100px;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
@@ -2402,11 +2409,16 @@
|
||||
align-items: center;
|
||||
z-index: 20;
|
||||
position: relative;
|
||||
margin-top: 50px;
|
||||
/* 세로 중앙정렬은 auto 마진으로 한다 (부모의 justify-content 주석 참조).
|
||||
넘칠 때 잘리지 않는 유일한 방법이다 */
|
||||
margin: auto 0;
|
||||
width: 100%;
|
||||
max-width: 375px;
|
||||
}
|
||||
|
||||
/* 375px 화면에서는 타일 4개 + 라벨이 폭을 넘긴다. 타일과 글자를 함께 줄여
|
||||
한 줄을 지킨다 — 라벨이 줄바꿈되면 타일 정렬이 어긋난다 */
|
||||
|
||||
/* =====================================================
|
||||
PipelineTabs — ADO2 / 썰박스 전환 (밑줄 탭)
|
||||
진입 화면에서 로고와 하위 폼 사이에 형제로 얹힌다.
|
||||
@@ -2414,76 +2426,137 @@
|
||||
컨테이너 하단의 옅은 전체 폭 구분선 위로, 활성 탭 아래에만
|
||||
진한 밑줄이 얹힌다. 밑줄 색은 탭에 따라 민트↔앰버로 바뀐다.
|
||||
===================================================== */
|
||||
/* 간격 체계 (8px 그리드 · Material 3 / 수직 리듬 가이드 기준)
|
||||
8~12px 묶음 안 (라벨 ↔ 그 라벨이 설명하는 것, 입력 ↔ 그 입력의 안내)
|
||||
20px 묶음 사이
|
||||
32px 섹션 사이 (주제가 바뀜)
|
||||
이전에는 전부 10~24px 이라 "붙은 것"과 "다른 것"이 구분되지 않아 답답해 보였다.
|
||||
근접성(Gestalt)은 거리 차이로만 전달되므로 값이 고르면 정보 구조가 사라진다. */
|
||||
.pipeline-tabs {
|
||||
position: relative;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
/* 터치 타겟은 8dp 이상 떨어뜨린다(Material 3). 4px 이면 옆 타일 오탭이 난다 */
|
||||
gap: 8px;
|
||||
width: 100%;
|
||||
margin-bottom: 20px;
|
||||
/* 전체 폭 구분선. 활성 밑줄이 이 위에 겹쳐 얹힌다 */
|
||||
border-bottom: 1px solid var(--color-border-white-10);
|
||||
}
|
||||
|
||||
.pipeline-tab {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
flex: 1;
|
||||
/* 13px 상하 패딩 + 폰트로 터치 타겟 44px 이상 확보.
|
||||
밑줄 탭은 필과 달리 배경이 없어 타겟이 작아 보이기 쉽다 */
|
||||
padding: 13px 6px;
|
||||
/* 타일(52px) + 라벨로 터치 타겟이 이미 충분하다. 좌우 패딩은 라벨이
|
||||
이웃 타일에 붙지 않을 만큼만 */
|
||||
padding: 4px 2px;
|
||||
border: none;
|
||||
background: none;
|
||||
font-family: inherit;
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
letter-spacing: -0.006em;
|
||||
color: var(--color-text-gray-400);
|
||||
cursor: pointer;
|
||||
transition: color var(--transition-normal);
|
||||
}
|
||||
|
||||
/* 활성 표시 밑줄. 구분선(1px)을 덮도록 bottom: -1px */
|
||||
.pipeline-tab::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: -1px;
|
||||
height: 2px;
|
||||
border-radius: 2px;
|
||||
background: transparent;
|
||||
transition: background var(--transition-normal);
|
||||
/* 아이콘 타일 — 라운드 스퀘어. 아이콘은 currentColor 라 타일이 색을 정한다 */
|
||||
.pipeline-tab__tile {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 52px;
|
||||
height: 52px;
|
||||
border-radius: var(--radius-xl);
|
||||
border: 1px solid var(--color-border-white-10);
|
||||
background: var(--color-bg-card-inner);
|
||||
transition: background-color var(--transition-normal),
|
||||
border-color var(--transition-normal),
|
||||
color var(--transition-normal),
|
||||
box-shadow var(--transition-normal);
|
||||
}
|
||||
|
||||
.pipeline-tab__label {
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
letter-spacing: -0.006em;
|
||||
white-space: nowrap;
|
||||
transition: color var(--transition-normal);
|
||||
}
|
||||
|
||||
.pipeline-tab:hover {
|
||||
color: rgba(255, 255, 255, 0.85);
|
||||
color: var(--color-text-white);
|
||||
}
|
||||
|
||||
/* 활성 탭은 배경이 없으므로 밝은 글자 + 굵기로 대비를 만든다 */
|
||||
.pipeline-tab:hover .pipeline-tab__tile {
|
||||
border-color: rgba(255, 255, 255, 0.25);
|
||||
}
|
||||
|
||||
/* 선택 상태는 사이드바 활성 항목(.sidebar-item.active)과 같은 문법 —
|
||||
민트로 채우고 아이콘을 어두운 딥틸로 뒤집는다. 화면에서 가장 강한 표시이므로
|
||||
라벨까지 흰색으로 올려 타일과 한 덩어리로 읽히게 한다 */
|
||||
.pipeline-tab[aria-selected="true"] {
|
||||
color: var(--color-bg-dark);
|
||||
}
|
||||
|
||||
.pipeline-tab[aria-selected="true"] .pipeline-tab__tile {
|
||||
background: var(--color-mint);
|
||||
border-color: var(--color-mint);
|
||||
box-shadow: var(--shadow-mint-glow);
|
||||
}
|
||||
|
||||
.pipeline-tab[aria-selected="true"] .pipeline-tab__label {
|
||||
color: var(--color-text-white);
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.pipeline-tabs[data-active="ado2"] .pipeline-tab[aria-selected="true"]::after {
|
||||
background: var(--color-mint);
|
||||
}
|
||||
|
||||
.pipeline-tabs[data-active="ssul"] .pipeline-tab[aria-selected="true"]::after {
|
||||
background: var(--color-ssul-accent);
|
||||
}
|
||||
|
||||
.pipeline-tab__emoji {
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
/* 밑줄은 위치가 아니라 색만 바뀌므로 모션이 미미하지만,
|
||||
castad 전체에서 이 컴포넌트만 전환 효과를 쓰므로 함께 끈다 */
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.pipeline-tab,
|
||||
.pipeline-tab::after {
|
||||
.pipeline-tab__tile,
|
||||
.pipeline-tab__label {
|
||||
transition: none;
|
||||
}
|
||||
}
|
||||
|
||||
/* 고른 기능의 한 줄 설명. 탭과는 붙이고(20px), 아래 폼과는 섹션 간격(32px)을 둔다 —
|
||||
설명은 탭에 딸린 것이지 폼의 일부가 아니다 */
|
||||
.pipeline-desc {
|
||||
width: 100%;
|
||||
margin: 0 0 13px;
|
||||
font-size: 14px;
|
||||
line-height: 1.6;
|
||||
letter-spacing: -0.006em;
|
||||
text-align: center;
|
||||
color: var(--color-text-gray-300);
|
||||
/* 한글은 기본값(word-break: normal)이면 단어 중간에서 잘린다 — "애니메이/션".
|
||||
keep-all 로 어절 단위 줄바꿈을 강제한다(한국어 조판 표준) */
|
||||
word-break: keep-all;
|
||||
/* 두 줄이 될 때 길이를 고르게 나눠 한쪽만 길게 늘어지지 않게 한다 */
|
||||
text-wrap: balance;
|
||||
}
|
||||
|
||||
/* 좁은 화면 조정.
|
||||
**이 블록은 반드시 위 기본 규칙들보다 뒤에 있어야 한다** — 미디어 쿼리는 명시도를
|
||||
올리지 않아서, 앞에 두면 뒤에 오는 같은 명시도의 기본 규칙에 그대로 덮인다
|
||||
(실제로 그렇게 두었다가 모바일에서 타일이 48px 로 줄지 않았다). */
|
||||
@media (max-width: 420px) {
|
||||
/* 타일은 48dp 최소 터치 타겟이라 더 줄이지 않는다. 라벨만 줄여 한 줄을 지키고,
|
||||
타일 사이 8px 은 유지한다 — 간격을 없애면 옆 타일 오탭이 난다 */
|
||||
.pipeline-tab__tile {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
border-radius: var(--radius-md);
|
||||
}
|
||||
|
||||
.pipeline-tab__label {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.pipeline-desc {
|
||||
margin-bottom: 13px;
|
||||
font-size: 13px;
|
||||
}
|
||||
}
|
||||
|
||||
/* 썰박스 탭의 임시 자리 (Phase 7 에서 SsulCreateForm 으로 교체) */
|
||||
.pipeline-placeholder {
|
||||
width: 100%;
|
||||
@@ -2501,33 +2574,21 @@
|
||||
}
|
||||
|
||||
.url-input-logo {
|
||||
margin-bottom: 1rem;
|
||||
/* 로고 → 탭은 "묶음 사이" 간격 (generation-flow.css 상단 간격 체계 참조) */
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
/* 로고는 **아래 폼 열보다 넓어질 수 없다.**
|
||||
이전에는 화면이 커질수록 350 → 400 → 500 → 554px 로 키웠는데, 정작 폼 열은
|
||||
375px 로 고정이라 데스크톱에서 로고만 좌우로 90px 씩 삐져나왔다.
|
||||
min() 으로 열 폭과 상한을 동시에 걸면 어느 폭에서도 넘지 않는다 —
|
||||
브레이크포인트를 늘려도 다시 어긋날 일이 없다. */
|
||||
.url-input-logo img {
|
||||
width: 350px;
|
||||
max-width: 100%;
|
||||
display: block;
|
||||
width: min(100%, 280px);
|
||||
height: auto;
|
||||
}
|
||||
|
||||
@media (min-width: 640px) {
|
||||
.url-input-logo img {
|
||||
width: 400px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
.url-input-logo img {
|
||||
width: 500px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 1024px) {
|
||||
.url-input-logo img {
|
||||
width: 554px;
|
||||
}
|
||||
}
|
||||
|
||||
.url-input-title {
|
||||
font-family: 'Pretendard', sans-serif;
|
||||
font-size: 40px;
|
||||
|
||||
@@ -16,3 +16,7 @@
|
||||
castad 안에서 새로 만든 화면의 스타일은 ssulbox-castad.css 에 둔다. */
|
||||
@import './ssulbox.css';
|
||||
@import './ssulbox-castad.css';
|
||||
|
||||
/* Poster to Video (F1 영상 · F2 스타일링) — 모든 규칙이 `.p2v-scope` 안에 갇혀 있다 */
|
||||
@import './poster-p2v.css';
|
||||
@import './playreel-p2v.css';
|
||||
@@ -129,7 +129,7 @@
|
||||
|
||||
/* Hero Form */
|
||||
.hero-form {
|
||||
padding-top: 20px;
|
||||
padding-top: 13px;
|
||||
width: 100%;
|
||||
max-width: 375px;
|
||||
display: flex;
|
||||
|
||||
@@ -0,0 +1,266 @@
|
||||
/* =====================================================
|
||||
Playreel(롱컷) — 검수 게이트 화면 스타일
|
||||
|
||||
poster-p2v.css 의 `.p2v-*` 규칙(패널·라벨·버튼·칩·진행바)을 그대로 쓰고,
|
||||
게이트에만 있는 요소(섹션 썸네일 선택, 판정 카드, 경고 박스)만 `.pr-*` 로 더한다.
|
||||
규칙은 poster-p2v.css 와 같다: 모든 선택자를 `.p2v-scope` 안에 가둔다.
|
||||
===================================================== */
|
||||
|
||||
.p2v-scope .pr-gate__eyebrow {
|
||||
margin: 0;
|
||||
font-size: var(--text-sm);
|
||||
font-weight: 700;
|
||||
color: var(--color-mint);
|
||||
}
|
||||
|
||||
.p2v-scope .pr-gate__title {
|
||||
margin: 6px 0 8px;
|
||||
font-size: var(--text-2xl);
|
||||
font-weight: 700;
|
||||
letter-spacing: -0.02em;
|
||||
}
|
||||
|
||||
.p2v-scope .pr-gate__actions {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 10px;
|
||||
margin-top: 12px;
|
||||
}
|
||||
|
||||
/* 좌우 2단. 좁은 화면에서는 자동으로 한 줄씩 쌓인다 */
|
||||
.p2v-scope .pr-two {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
|
||||
gap: var(--spacing-page-md);
|
||||
align-items: start;
|
||||
}
|
||||
|
||||
.p2v-scope .pr-gap { margin-top: 24px; }
|
||||
|
||||
.p2v-scope .pr-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.p2v-scope .pr-row__label {
|
||||
flex-shrink: 0;
|
||||
width: 52px;
|
||||
font-size: var(--text-sm);
|
||||
color: var(--color-text-gray-400);
|
||||
}
|
||||
|
||||
.p2v-scope .pr-row__label--slot {
|
||||
width: 92px;
|
||||
font-size: var(--text-xs);
|
||||
}
|
||||
|
||||
.p2v-scope .pr-row .p2v-input { height: 44px; }
|
||||
|
||||
.p2v-scope .pr-strong {
|
||||
margin: 0;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.p2v-scope .pr-audio {
|
||||
width: 100%;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.p2v-scope .pr-image {
|
||||
max-width: 320px;
|
||||
}
|
||||
|
||||
.p2v-scope .pr-player {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-height: 320px;
|
||||
}
|
||||
|
||||
.p2v-scope .pr-player video {
|
||||
display: block;
|
||||
width: 100%;
|
||||
max-height: 520px;
|
||||
border-radius: var(--radius-md);
|
||||
}
|
||||
|
||||
/* 연출 칩 — 잠긴 칩은 눌리지 않는다 */
|
||||
.p2v-scope .pr-chip {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.p2v-scope .pr-chip.locked { cursor: default; }
|
||||
|
||||
/* 상세페이지 섹션 썸네일 선택 */
|
||||
.p2v-scope .pr-sections {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
|
||||
gap: 8px;
|
||||
max-height: 340px;
|
||||
padding-right: 4px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.p2v-scope .pr-section {
|
||||
position: relative;
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
border: 2px solid var(--color-border-white-10);
|
||||
border-radius: var(--radius-md);
|
||||
background: transparent;
|
||||
text-align: left;
|
||||
cursor: pointer;
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
.p2v-scope .pr-section.selected {
|
||||
border-color: var(--color-mint);
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.p2v-scope .pr-section.locked { cursor: default; }
|
||||
|
||||
.p2v-scope .pr-section img {
|
||||
display: block;
|
||||
width: 100%;
|
||||
aspect-ratio: 3 / 4;
|
||||
object-fit: cover;
|
||||
object-position: top;
|
||||
background: #000;
|
||||
}
|
||||
|
||||
.p2v-scope .pr-section__no {
|
||||
position: absolute;
|
||||
top: 4px;
|
||||
left: 4px;
|
||||
min-width: 16px;
|
||||
padding: 1px 4px;
|
||||
border-radius: 4px;
|
||||
background: rgba(0, 0, 0, 0.65);
|
||||
color: #fff;
|
||||
font-size: 10px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.p2v-scope .pr-section__cap {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
padding: 3px 5px;
|
||||
background: rgba(0, 0, 0, 0.65);
|
||||
color: var(--color-text-gray-400);
|
||||
font-size: 10px;
|
||||
line-height: 1.3;
|
||||
}
|
||||
|
||||
.p2v-scope .pr-section.selected .pr-section__cap { color: var(--color-mint); }
|
||||
|
||||
.p2v-scope .pr-section__cap span:last-child {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* 경고 박스 — 실패가 아니라 "확인하세요" 라서 호박색으로 구분한다 */
|
||||
.p2v-scope .pr-callout {
|
||||
margin: 12px 0 0;
|
||||
padding: 10px 14px;
|
||||
border: 1px solid rgba(255, 210, 122, 0.35);
|
||||
border-radius: var(--radius-md);
|
||||
background: rgba(255, 210, 122, 0.1);
|
||||
color: #ffd27a;
|
||||
font-size: var(--text-sm);
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
/* 예상 길이 */
|
||||
.p2v-scope .pr-stat {
|
||||
margin: 0;
|
||||
font-size: var(--text-2xl);
|
||||
font-weight: 700;
|
||||
color: var(--color-mint);
|
||||
}
|
||||
|
||||
.p2v-scope .pr-stat.warn { color: #ffd27a; }
|
||||
|
||||
/* 제목 훼손 검사 판정 */
|
||||
.p2v-scope .pr-verdict.ok { border-color: var(--color-mint-30); }
|
||||
.p2v-scope .pr-verdict.fail { border-color: rgba(255, 122, 122, 0.4); }
|
||||
.p2v-scope .pr-verdict.ok .pr-strong { color: var(--color-mint); }
|
||||
.p2v-scope .pr-verdict.fail .pr-strong { color: #ff8c8c; }
|
||||
|
||||
/* 자동 확인 항목 */
|
||||
.p2v-scope .pr-check {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
margin: 5px 0;
|
||||
font-size: var(--text-base);
|
||||
color: var(--color-text-gray-300);
|
||||
}
|
||||
|
||||
.p2v-scope .pr-check svg { color: var(--color-mint); }
|
||||
.p2v-scope .pr-check.fail { color: #ff8c8c; }
|
||||
.p2v-scope .pr-check.fail svg { color: #ff8c8c; }
|
||||
|
||||
/* 자동 승인 설정 패널 */
|
||||
.p2v-scope .pr-auto { margin-top: 28px; }
|
||||
|
||||
.p2v-scope .pr-auto__row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 16px;
|
||||
padding: 10px 0;
|
||||
}
|
||||
|
||||
.p2v-scope .pr-auto__row + .pr-auto__row { border-top: 1px solid var(--color-border-white-5); }
|
||||
.p2v-scope .pr-auto__row--locked { opacity: 0.55; }
|
||||
.p2v-scope .pr-auto__text { min-width: 0; }
|
||||
.p2v-scope .pr-auto__text .p2v-note { margin: 2px 0 0; }
|
||||
|
||||
.p2v-scope .pr-switch {
|
||||
position: relative;
|
||||
flex-shrink: 0;
|
||||
width: 44px;
|
||||
height: 24px;
|
||||
padding: 0;
|
||||
border: 1px solid var(--color-border-white-10);
|
||||
border-radius: var(--radius-full);
|
||||
background: transparent;
|
||||
cursor: pointer;
|
||||
transition: background-color var(--transition-normal), border-color var(--transition-normal);
|
||||
}
|
||||
|
||||
.p2v-scope .pr-switch.on {
|
||||
border-color: var(--color-mint);
|
||||
background: var(--color-mint-20);
|
||||
}
|
||||
|
||||
.p2v-scope .pr-switch__knob {
|
||||
position: absolute;
|
||||
top: 2px;
|
||||
left: 2px;
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
border-radius: 50%;
|
||||
background: var(--color-text-gray-400);
|
||||
transition: transform var(--transition-normal), background-color var(--transition-normal);
|
||||
}
|
||||
|
||||
.p2v-scope .pr-switch.on .pr-switch__knob {
|
||||
transform: translateX(20px);
|
||||
background: var(--color-mint);
|
||||
}
|
||||
|
||||
/* 자동 승인 안내 — 진행 화면 아래에 이어서 보인다 */
|
||||
.p2v-scope .pr-auto-note {
|
||||
margin: 14px 0 0;
|
||||
font-size: var(--text-sm);
|
||||
text-align: center;
|
||||
color: var(--color-mint);
|
||||
}
|
||||
@@ -0,0 +1,840 @@
|
||||
/* =====================================================
|
||||
Poster to Video (P2V) — castad 통합 화면 스타일
|
||||
|
||||
F1(포스터→영상) · F2(포스터 스타일링) 두 파이프라인이 함께 쓴다.
|
||||
|
||||
규칙 (썰박스 통합과 동일):
|
||||
- 모든 선택자를 `.p2v-scope` 안에 가둔다 — castad 기존 화면에 새지 않게.
|
||||
- 색·반경·간격은 tokens.css 토큰만 쓴다. 하드코딩 색은 상태색(실패 빨강) 뿐이고
|
||||
그것도 castad 가 이미 쓰는 값(#ff7a7a 계열)을 따른다.
|
||||
- 버튼 문법은 ADO2 프로덕트를 따른다: 퍼플=주 CTA(화면당 하나), 민트=보조·선택,
|
||||
아웃라인=중립. 이 규칙을 어기면 화면이 알록달록해진다.
|
||||
===================================================== */
|
||||
|
||||
.p2v-scope {
|
||||
width: 100%;
|
||||
color: var(--color-text-white);
|
||||
font-family: inherit;
|
||||
}
|
||||
|
||||
/* ── 공통 요소 ────────────────────────────────────── */
|
||||
|
||||
.p2v-scope .p2v-label {
|
||||
display: block;
|
||||
margin: 0 0 8px;
|
||||
font-size: var(--text-lg);
|
||||
font-weight: 700;
|
||||
color: var(--color-text-white);
|
||||
}
|
||||
|
||||
.p2v-scope .p2v-help {
|
||||
margin: 0 0 12px;
|
||||
font-size: var(--text-sm);
|
||||
line-height: 1.6;
|
||||
color: var(--color-text-gray-400);
|
||||
}
|
||||
|
||||
.p2v-scope .p2v-note {
|
||||
margin: 8px 0 0;
|
||||
font-size: var(--text-sm);
|
||||
line-height: 1.6;
|
||||
color: var(--color-text-gray-400);
|
||||
}
|
||||
|
||||
.p2v-scope .p2v-note.warn {
|
||||
color: #ff9a9a;
|
||||
}
|
||||
|
||||
.p2v-scope .p2v-panel {
|
||||
background: var(--color-bg-card-inner);
|
||||
border: 1px solid var(--color-border-white-5);
|
||||
border-radius: var(--radius-2xl);
|
||||
padding: var(--spacing-page);
|
||||
}
|
||||
|
||||
/* 서버 stderr tail — 개발자용이라 폭이 넘칠 수 있어 스스로 스크롤한다 */
|
||||
.p2v-scope .p2v-errorbox {
|
||||
margin: 12px 0 0;
|
||||
padding: 12px 14px;
|
||||
max-height: 220px;
|
||||
overflow: auto;
|
||||
background: var(--color-bg-card-inner);
|
||||
border: 1px solid var(--color-border-white-5);
|
||||
border-radius: var(--radius-md);
|
||||
font-size: var(--text-sm);
|
||||
line-height: 1.5;
|
||||
color: var(--color-text-gray-400);
|
||||
white-space: pre-wrap;
|
||||
word-break: break-all;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.p2v-scope .p2v-step {
|
||||
align-self: flex-start;
|
||||
margin-bottom: 10px;
|
||||
font-size: var(--text-xs);
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.04em;
|
||||
color: var(--color-mint);
|
||||
}
|
||||
|
||||
/* ── 입력 (프로덕트 흰 pill) ──────────────────────── */
|
||||
|
||||
.p2v-scope .p2v-input {
|
||||
width: 100%;
|
||||
height: 52px;
|
||||
padding: 0 20px;
|
||||
margin-bottom: 8px;
|
||||
border: 1.5px solid transparent;
|
||||
border-radius: var(--radius-full);
|
||||
background: var(--color-text-white);
|
||||
color: var(--color-bg-dark);
|
||||
font-family: inherit;
|
||||
font-size: var(--text-base);
|
||||
font-weight: 600;
|
||||
letter-spacing: -0.006em;
|
||||
}
|
||||
|
||||
.p2v-scope .p2v-input::placeholder {
|
||||
color: #3a8f86;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.p2v-scope .p2v-input:focus {
|
||||
outline: none;
|
||||
border-color: var(--color-mint);
|
||||
}
|
||||
|
||||
.p2v-scope .p2v-input--center,
|
||||
.p2v-scope .p2v-input--center::placeholder {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.p2v-scope .p2v-field {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.p2v-scope .p2v-field__label {
|
||||
flex: none;
|
||||
width: 52px;
|
||||
font-size: var(--text-sm);
|
||||
color: var(--color-text-gray-400);
|
||||
}
|
||||
|
||||
/* ── 버튼 ────────────────────────────────────────── */
|
||||
|
||||
.p2v-scope .p2v-btn-cta {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
height: 48px;
|
||||
margin-top: 20px;
|
||||
border: none;
|
||||
border-radius: var(--radius-full);
|
||||
background: var(--color-purple);
|
||||
color: var(--color-text-white);
|
||||
box-shadow: var(--shadow-purple);
|
||||
font-family: inherit;
|
||||
font-size: var(--text-base);
|
||||
font-weight: 700;
|
||||
cursor: pointer;
|
||||
transition: background-color var(--transition-normal);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.p2v-scope .p2v-btn-cta:hover:not(:disabled) {
|
||||
background: var(--color-purple-hover);
|
||||
}
|
||||
|
||||
.p2v-scope .p2v-btn-cta:disabled {
|
||||
opacity: 0.45;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
/* 다운로드처럼 행 안에 들어가는 CTA — 폭을 차지하지 않는다 */
|
||||
.p2v-scope .p2v-btn-cta--compact {
|
||||
width: auto;
|
||||
margin-top: 0;
|
||||
padding: 0 24px;
|
||||
height: 44px;
|
||||
}
|
||||
|
||||
.p2v-scope .p2v-btn-mint,
|
||||
.p2v-scope .p2v-btn-tonal,
|
||||
.p2v-scope .p2v-btn-outline {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 44px;
|
||||
padding: 0 22px;
|
||||
border-radius: var(--radius-full);
|
||||
font-family: inherit;
|
||||
font-size: var(--text-base);
|
||||
font-weight: 700;
|
||||
cursor: pointer;
|
||||
white-space: nowrap;
|
||||
text-decoration: none;
|
||||
transition: background-color var(--transition-normal), border-color var(--transition-normal);
|
||||
}
|
||||
|
||||
.p2v-scope .p2v-btn-mint {
|
||||
border: none;
|
||||
background: var(--color-mint);
|
||||
color: var(--color-bg-dark);
|
||||
}
|
||||
|
||||
.p2v-scope .p2v-btn-mint:hover:not(:disabled) { background: var(--color-mint-hover); }
|
||||
|
||||
.p2v-scope .p2v-btn-tonal {
|
||||
border: 1px solid var(--color-mint-30);
|
||||
background: var(--color-mint-20);
|
||||
color: var(--color-mint);
|
||||
}
|
||||
|
||||
.p2v-scope .p2v-btn-tonal:hover { background: var(--color-mint-30); }
|
||||
|
||||
.p2v-scope .p2v-btn-outline {
|
||||
border: 1px solid var(--color-border-gray-600);
|
||||
background: transparent;
|
||||
color: var(--color-text-white);
|
||||
}
|
||||
|
||||
.p2v-scope .p2v-btn-outline:hover:not(:disabled) { background: rgba(255, 255, 255, 0.05); }
|
||||
|
||||
.p2v-scope .p2v-btn-mint:disabled,
|
||||
.p2v-scope .p2v-btn-outline:disabled {
|
||||
opacity: 0.45;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
/* ── 접근 키 게이트 ───────────────────────────────── */
|
||||
|
||||
.p2v-scope .p2v-keygate {
|
||||
width: 100%;
|
||||
padding: 22px;
|
||||
border: 1px solid var(--color-mint-30);
|
||||
border-radius: var(--radius-2xl);
|
||||
background: var(--color-mint-10);
|
||||
}
|
||||
|
||||
.p2v-scope .p2v-keygate__title {
|
||||
margin: 0 0 6px;
|
||||
font-size: var(--text-lg);
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.p2v-scope .p2v-keygate__desc {
|
||||
margin: 0 0 16px;
|
||||
font-size: var(--text-sm);
|
||||
line-height: 1.6;
|
||||
color: var(--color-text-gray-300);
|
||||
}
|
||||
|
||||
.p2v-scope .p2v-keygate__row {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.p2v-scope .p2v-keygate__row .p2v-input { margin-bottom: 0; }
|
||||
.p2v-scope .p2v-keygate__row .p2v-btn-mint { height: 52px; flex: none; }
|
||||
|
||||
/* ── 드롭존 ──────────────────────────────────────── */
|
||||
|
||||
.p2v-scope .p2v-dropzone-wrap { width: 100%; }
|
||||
|
||||
.p2v-scope .p2v-dropzone {
|
||||
/* 포스터는 세로물 — 입력창도 세로여야 무엇을 올렸는지 바로 보인다 */
|
||||
aspect-ratio: 4 / 5;
|
||||
max-width: 400px;
|
||||
margin: 0 auto;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
overflow: hidden;
|
||||
padding: var(--spacing-page);
|
||||
border: 1px dashed var(--color-border-gray-700);
|
||||
border-radius: var(--radius-2xl);
|
||||
background: var(--color-bg-card-inner);
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
transition: border-color var(--transition-normal), background-color var(--transition-normal);
|
||||
}
|
||||
|
||||
.p2v-scope .p2v-dropzone.has-file { padding: 0; border-style: solid; }
|
||||
|
||||
.p2v-scope .p2v-dropzone.dragging {
|
||||
border-color: var(--color-mint);
|
||||
background: var(--color-mint-10);
|
||||
}
|
||||
|
||||
.p2v-scope .p2v-dropzone img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: contain;
|
||||
}
|
||||
|
||||
.p2v-scope .p2v-dropzone__cta {
|
||||
margin: 0;
|
||||
font-size: var(--text-base);
|
||||
font-weight: 700;
|
||||
line-height: 1.5;
|
||||
white-space: pre-line;
|
||||
}
|
||||
|
||||
.p2v-scope .p2v-dropzone__hint {
|
||||
margin: 12px 0 0;
|
||||
font-size: var(--text-sm);
|
||||
line-height: 1.5;
|
||||
color: var(--color-text-gray-400);
|
||||
white-space: pre-line;
|
||||
}
|
||||
|
||||
/* ── F1 생성 폼 ───────────────────────────────────── */
|
||||
|
||||
.p2v-scope.p2v-create {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
max-width: 480px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
/* 드롭존과 이름 입력은 "업로드" 한 묶음이라 붙이고(16), 제출과는 섹션 간격을 둔다.
|
||||
간격 체계는 generation-flow.css 상단 참조 */
|
||||
.p2v-scope.p2v-create .p2v-input {
|
||||
margin-top: 16px;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.p2v-scope.p2v-create .p2v-btn-cta { margin-top: 28px; }
|
||||
|
||||
.p2v-scope .p2v-create__cost {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
padding: 0 4px;
|
||||
margin-top: 28px;
|
||||
font-size: 12px;
|
||||
color: var(--color-text-gray-400);
|
||||
}
|
||||
|
||||
.p2v-scope .p2v-create__cost-badge {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 5px;
|
||||
font-weight: 700;
|
||||
color: var(--color-mint);
|
||||
}
|
||||
|
||||
.p2v-scope .p2v-create__coin {
|
||||
font-size: 14px;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.p2v-scope.p2v-create .p2v-create__cost + .p2v-btn-cta {
|
||||
margin-top: 12px;
|
||||
}
|
||||
|
||||
/* ── 시작 선택 화면 + 소개 카드 (playreel 의 "어떻게 시작할까요?") ── */
|
||||
|
||||
.p2v-scope.p2v-start {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 12px;
|
||||
max-width: 560px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.p2v-scope .p2v-start__title {
|
||||
margin: 0;
|
||||
font-size: var(--text-2xl);
|
||||
font-weight: 800;
|
||||
text-align: center;
|
||||
letter-spacing: -0.02em;
|
||||
}
|
||||
|
||||
.p2v-scope .p2v-start__subtitle {
|
||||
margin: 0 0 8px;
|
||||
font-size: var(--text-sm);
|
||||
text-align: center;
|
||||
color: var(--color-text-gray-400);
|
||||
}
|
||||
|
||||
.p2v-scope .p2v-back {
|
||||
align-self: flex-start;
|
||||
margin: 0 0 16px;
|
||||
padding: 0;
|
||||
border: none;
|
||||
background: none;
|
||||
color: var(--color-text-gray-400);
|
||||
font-family: inherit;
|
||||
font-size: var(--text-sm);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.p2v-scope .p2v-back:hover { color: var(--color-text-white); }
|
||||
|
||||
.p2v-scope .p2v-intro--hot { border-color: var(--color-mint-30); }
|
||||
|
||||
.p2v-scope .p2v-intro__badge {
|
||||
align-self: flex-start;
|
||||
margin-bottom: -4px;
|
||||
padding: 3px 10px;
|
||||
border-radius: var(--radius-full);
|
||||
background: var(--color-mint);
|
||||
color: var(--color-bg-dark);
|
||||
font-size: 11px;
|
||||
font-weight: 800;
|
||||
letter-spacing: 0.04em;
|
||||
}
|
||||
|
||||
.p2v-scope .p2v-intro .p2v-btn-cta { margin-top: 4px; }
|
||||
|
||||
|
||||
.p2v-scope .p2v-intro {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 14px;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.p2v-scope .p2v-intro__head {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.p2v-scope .p2v-intro__icon {
|
||||
display: grid;
|
||||
flex: none;
|
||||
place-items: center;
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
border-radius: var(--radius-md);
|
||||
background: var(--color-mint-10);
|
||||
color: var(--color-mint);
|
||||
font-size: 12px;
|
||||
font-weight: 800;
|
||||
letter-spacing: 0.04em;
|
||||
}
|
||||
|
||||
.p2v-scope .p2v-intro__title {
|
||||
margin: 0;
|
||||
font-size: var(--text-lg);
|
||||
font-weight: 800;
|
||||
letter-spacing: -0.02em;
|
||||
}
|
||||
|
||||
.p2v-scope .p2v-intro__desc {
|
||||
margin: 2px 0 0;
|
||||
font-size: var(--text-sm);
|
||||
color: var(--color-text-gray-400);
|
||||
}
|
||||
|
||||
.p2v-scope .p2v-intro__flow {
|
||||
display: grid;
|
||||
gap: 10px;
|
||||
margin: 0;
|
||||
padding: 14px;
|
||||
list-style: none;
|
||||
border: 1px solid var(--color-border-white-5);
|
||||
border-radius: var(--radius-md);
|
||||
background: var(--color-bg-card);
|
||||
font-size: var(--text-xs);
|
||||
line-height: 1.6;
|
||||
color: var(--color-text-gray-300);
|
||||
}
|
||||
|
||||
.p2v-scope .p2v-intro__flow li {
|
||||
display: grid;
|
||||
grid-template-columns: 22px minmax(0, 1fr);
|
||||
align-items: baseline;
|
||||
gap: 10px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.p2v-scope .p2v-intro__flow-number {
|
||||
color: var(--color-mint);
|
||||
font-weight: 800;
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
|
||||
.p2v-scope .p2v-intro__facts {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.p2v-scope .p2v-intro__facts div {
|
||||
padding: 8px 10px;
|
||||
border: 1px solid var(--color-bg-card);
|
||||
border-radius: var(--radius-md);
|
||||
background: var(--color-bg-card);
|
||||
}
|
||||
|
||||
.p2v-scope .p2v-intro__facts b {
|
||||
display: block;
|
||||
font-size: var(--text-xs);
|
||||
font-weight: 600;
|
||||
color: var(--color-text-gray-500);
|
||||
}
|
||||
|
||||
.p2v-scope .p2v-intro__facts span {
|
||||
font-size: var(--text-sm);
|
||||
font-weight: 700;
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
|
||||
@media (max-width: 480px) {
|
||||
.p2v-scope .p2v-intro__facts { grid-template-columns: repeat(2, 1fr); }
|
||||
}
|
||||
|
||||
/* ── F1 진행 화면 ────────────────────────────────── */
|
||||
|
||||
.p2v-scope.p2v-making {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
max-width: 520px;
|
||||
/* 부모(.wizard-page-container)가 height:100% flex column 이라
|
||||
margin:auto 가 스텝퍼~바닥 사이 중앙에 놓는다 (썰박스와 같은 처리) */
|
||||
height: auto;
|
||||
margin: auto;
|
||||
padding: 48px 20px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.p2v-making__name {
|
||||
font-size: var(--text-xl);
|
||||
font-weight: 700;
|
||||
color: var(--color-mint);
|
||||
}
|
||||
|
||||
.p2v-making__title {
|
||||
margin: 8px 0 24px;
|
||||
font-size: var(--text-2xl);
|
||||
font-weight: 700;
|
||||
letter-spacing: -0.015em;
|
||||
}
|
||||
|
||||
.p2v-making__title.warn { color: #ffb4a8; }
|
||||
|
||||
.p2v-making__meta {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
margin-top: 10px;
|
||||
font-size: var(--text-base);
|
||||
color: var(--color-text-gray-300);
|
||||
}
|
||||
|
||||
.p2v-making__pct {
|
||||
font-weight: 700;
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
|
||||
.p2v-making__desc {
|
||||
margin: 22px 0 0;
|
||||
font-size: var(--text-sm);
|
||||
line-height: 1.6;
|
||||
color: var(--color-text-gray-400);
|
||||
}
|
||||
|
||||
.p2v-making__actions {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
margin-top: 28px;
|
||||
}
|
||||
|
||||
.p2v-scope .p2v-making__narration {
|
||||
width: 100%;
|
||||
margin-top: 26px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.p2v-scope .p2v-narration-line {
|
||||
margin: 6px 0;
|
||||
font-size: var(--text-base);
|
||||
line-height: 1.6;
|
||||
color: var(--color-text-gray-300);
|
||||
}
|
||||
|
||||
/* 스피너 — castad 전역 `spin` 키프레임을 재사용한다(새로 만들면 중복) */
|
||||
.p2v-scope .p2v-spinner {
|
||||
position: relative;
|
||||
flex: none;
|
||||
width: 120px;
|
||||
height: 120px;
|
||||
margin: 4px 0 22px;
|
||||
}
|
||||
|
||||
.p2v-scope .p2v-spinner--md { width: 48px; height: 48px; margin: 0; }
|
||||
.p2v-scope .p2v-spinner--sm { width: 26px; height: 26px; margin: 0; }
|
||||
|
||||
.p2v-scope .p2v-spinner::before,
|
||||
.p2v-scope .p2v-spinner::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
border-radius: 50%;
|
||||
border: 6px solid transparent;
|
||||
}
|
||||
|
||||
.p2v-scope .p2v-spinner::before { border-color: var(--color-border-white-10); }
|
||||
|
||||
/* 3/4 만 칠해 회전이 보이게 한다. 색은 ADO2 생성 스피너 표준(퍼플) */
|
||||
.p2v-scope .p2v-spinner::after {
|
||||
border-top-color: var(--color-purple);
|
||||
border-right-color: var(--color-purple);
|
||||
border-bottom-color: var(--color-purple);
|
||||
animation: spin 1.1s linear infinite;
|
||||
}
|
||||
|
||||
.p2v-scope .p2v-spinner--md::before,
|
||||
.p2v-scope .p2v-spinner--md::after { border-width: 4px; }
|
||||
.p2v-scope .p2v-spinner--sm::before,
|
||||
.p2v-scope .p2v-spinner--sm::after { border-width: 3px; }
|
||||
|
||||
.p2v-scope .p2v-bar {
|
||||
width: 100%;
|
||||
height: 6px;
|
||||
margin-top: 20px;
|
||||
border-radius: var(--radius-full);
|
||||
background: var(--color-bg-card-inner);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.p2v-scope .p2v-bar__fill {
|
||||
height: 100%;
|
||||
border-radius: var(--radius-full);
|
||||
background: var(--color-mint);
|
||||
transition: width 400ms ease;
|
||||
}
|
||||
|
||||
/* ── F1 검수 게이트 ───────────────────────────────── */
|
||||
|
||||
/* 좌우 패딩을 스스로 갖는다. 부모 `.wizard-page-container` 에는 패딩이 없어서
|
||||
0 으로 두면 모바일에서 글자가 화면 가장자리에 그대로 붙는다(실제로 그랬다).
|
||||
16px 은 모바일 화면 가장자리 여백 기준값(Material 3). */
|
||||
.p2v-scope.p2v-review {
|
||||
max-width: 1080px;
|
||||
margin: 0 auto;
|
||||
padding: 8px 16px 40px;
|
||||
}
|
||||
|
||||
.p2v-review__grid {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: var(--spacing-page-md);
|
||||
align-items: start;
|
||||
}
|
||||
|
||||
.p2v-scope .p2v-review__edit .p2v-label { margin-top: 26px; }
|
||||
.p2v-scope .p2v-review__edit > .p2v-label:first-child { margin-top: 0; }
|
||||
|
||||
.p2v-scope .p2v-review__image {
|
||||
display: block;
|
||||
width: 100%;
|
||||
border: 1px solid var(--color-border-white-5);
|
||||
border-radius: var(--radius-2xl);
|
||||
}
|
||||
|
||||
.p2v-scope .p2v-review__image-empty {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-height: 320px;
|
||||
font-size: var(--text-sm);
|
||||
color: var(--color-text-gray-500);
|
||||
}
|
||||
|
||||
/* 모션 칩 — 선택은 민트 테두리+틴트(castad .btn-select.selected 문법) */
|
||||
.p2v-chips {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.p2v-scope .p2v-chip {
|
||||
padding: 7px 14px;
|
||||
border: 1px solid var(--color-border-white-10);
|
||||
border-radius: var(--radius-full);
|
||||
background: transparent;
|
||||
color: var(--color-text-gray-400);
|
||||
font-family: inherit;
|
||||
font-size: var(--text-sm);
|
||||
font-weight: 600;
|
||||
cursor: pointer;
|
||||
transition: border-color var(--transition-normal), background-color var(--transition-normal),
|
||||
color var(--transition-normal);
|
||||
}
|
||||
|
||||
.p2v-scope .p2v-chip:hover { color: var(--color-text-white); }
|
||||
|
||||
.p2v-scope .p2v-chip.active {
|
||||
border-color: var(--color-mint);
|
||||
background: var(--color-mint-20);
|
||||
color: var(--color-mint);
|
||||
}
|
||||
|
||||
/* ── F1 결과 ─────────────────────────────────────── */
|
||||
|
||||
.p2v-scope.p2v-result {
|
||||
max-width: 1000px;
|
||||
margin: 0 auto;
|
||||
padding: 8px 16px 40px;
|
||||
}
|
||||
|
||||
.p2v-result__title {
|
||||
margin: 0 0 22px;
|
||||
font-size: var(--text-2xl);
|
||||
font-weight: 700;
|
||||
text-align: center;
|
||||
letter-spacing: -0.015em;
|
||||
}
|
||||
|
||||
.p2v-result__grid {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: var(--spacing-page-md);
|
||||
align-items: stretch;
|
||||
}
|
||||
|
||||
.p2v-scope .p2v-result__player {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 12px;
|
||||
}
|
||||
|
||||
.p2v-scope .p2v-result__player video {
|
||||
display: block;
|
||||
width: 100%;
|
||||
max-height: 560px;
|
||||
border-radius: var(--radius-md);
|
||||
}
|
||||
|
||||
.p2v-result__side {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding-left: var(--spacing-page);
|
||||
border-left: 2px solid var(--color-mint-20);
|
||||
}
|
||||
|
||||
.p2v-result__filename {
|
||||
margin: 4px 0 16px;
|
||||
font-size: var(--text-xl);
|
||||
font-weight: 700;
|
||||
line-height: 1.35;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.p2v-result__block {
|
||||
margin-top: 16px;
|
||||
padding-top: 16px;
|
||||
border-top: 1px solid var(--color-border-white-10);
|
||||
}
|
||||
|
||||
.p2v-result__row {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
margin-bottom: 6px;
|
||||
font-size: var(--text-base);
|
||||
}
|
||||
|
||||
.p2v-result__row span {
|
||||
flex: none;
|
||||
width: 52px;
|
||||
color: var(--color-text-gray-400);
|
||||
}
|
||||
|
||||
.p2v-tags {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 6px;
|
||||
margin-top: 12px;
|
||||
}
|
||||
|
||||
.p2v-scope .p2v-tag {
|
||||
padding: 3px 10px;
|
||||
border-radius: var(--radius-full);
|
||||
background: var(--color-mint-10);
|
||||
color: var(--color-mint);
|
||||
font-size: var(--text-sm);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.p2v-result__actions {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
justify-content: flex-end;
|
||||
margin-top: auto;
|
||||
padding-top: 24px;
|
||||
}
|
||||
|
||||
.p2v-scope .p2v-result__new {
|
||||
display: flex;
|
||||
margin: 28px auto 0;
|
||||
}
|
||||
|
||||
/* ── F2 스타일링 ─────────────────────────────────── */
|
||||
|
||||
/* 내부 전용 — 주황 계열. 민트/퍼플과 겹치지 않아야 "제한"으로 읽힌다 */
|
||||
|
||||
/* 명화는 가로 그림도 있다 — cover 로 자르면 무엇인지 알 수 없다 */
|
||||
|
||||
/* 제목이 1줄인 카드와 2줄인 카드가 섞인다 — 아래로 밀어야 배지가 같은 선에 선다 */
|
||||
|
||||
/* ── 모바일 ──────────────────────────────────────── */
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.p2v-review__grid,
|
||||
.p2v-result__grid,
|
||||
.p2v-styling__io {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
/* 세로로 쌓이면 왼쪽 테두리는 위쪽 구분선이 되어야 한다 */
|
||||
.p2v-result__side {
|
||||
padding-left: 0;
|
||||
padding-top: var(--spacing-page);
|
||||
border-left: none;
|
||||
border-top: 2px solid var(--color-mint-20);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* 검수 화면(모바일) — 2단이 1단으로 접히면서 순서 문제가 생긴다.
|
||||
데스크톱은 좌(편집)·우(포스터)라 나란히 보이지만, 세로로 쌓으면 편집이 먼저 오고
|
||||
**대조할 포스터가 그 아래로 밀린다.** 연도·지명이 맞는지 보려면 위아래로 오가야 한다.
|
||||
포스터를 먼저 올려 읽고 나서 고치는 순서로 만든다. */
|
||||
.p2v-review__preview { order: -1; margin-bottom: 20px; }
|
||||
|
||||
.p2v-scope .p2v-review__image { max-height: 52vh; object-fit: contain; }
|
||||
|
||||
/* 주 액션은 하단 탭바 바로 위에 붙여 둔다.
|
||||
탭바(고정 72px)가 화면 아래를 차지해 CTA 가 문서 흐름 한가운데로 밀리는데,
|
||||
그러면 편집을 마치고도 버튼을 찾아 위로 스크롤해야 한다.
|
||||
castad 가 이미 쓰는 오프셋 패턴(`bottom: nav + 16px`)과 같은 발상이되,
|
||||
여기서는 스크롤 컨테이너 안이라 sticky 로 충분하다.
|
||||
box-shadow 의 두 번째 값은 배경색 링 — 뒤로 지나가는 콘텐츠를 가려 준다. */
|
||||
.p2v-scope.p2v-review .p2v-btn-cta {
|
||||
position: sticky;
|
||||
bottom: 12px;
|
||||
z-index: 5;
|
||||
box-shadow: var(--shadow-purple), 0 0 0 10px var(--color-bg-darker);
|
||||
}
|
||||
}
|
||||
|
||||
/* 진행 애니메이션은 모션 민감 사용자에게 끈다.
|
||||
스피너는 회전을 멈춰도 3/4 호가 남아 정적 표시로 읽힌다 */
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.p2v-scope .p2v-spinner::after { animation: none; }
|
||||
.p2v-scope .p2v-bar__fill { transition: none; }
|
||||
}
|
||||
@@ -25,13 +25,15 @@
|
||||
color: var(--color-text-white);
|
||||
}
|
||||
|
||||
/* 간격은 generation-flow.css 상단의 체계를 따른다 (묶음 안 8~12 / 묶음 사이 20 / 섹션 32) */
|
||||
.ssul-create__step {
|
||||
align-self: flex-start;
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.04em;
|
||||
color: var(--color-ssul-accent);
|
||||
margin-bottom: 10px;
|
||||
color: var(--color-mint);
|
||||
/* 라벨과 그 라벨이 설명하는 것은 붙여야 한 덩어리로 읽힌다 */
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
/* 2단계 라벨. 강조를 1단계에만 두어 시선 순서를 만든다 */
|
||||
@@ -44,9 +46,10 @@
|
||||
.ssul-create__scenarios {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 10px;
|
||||
gap: 12px;
|
||||
width: 100%;
|
||||
margin-bottom: 22px;
|
||||
/* STEP 1 → STEP 2 는 주제가 바뀌는 자리라 섹션 간격 */
|
||||
margin-bottom: 32px;
|
||||
}
|
||||
|
||||
.ssul-scn {
|
||||
@@ -54,8 +57,8 @@
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
gap: 5px;
|
||||
padding: 14px 12px;
|
||||
gap: 6px;
|
||||
padding: 16px 14px;
|
||||
/* 테두리 두께는 모든 상태에서 1px 로 고정한다. 선택 시 굵기를 바꾸면
|
||||
border-box 안쪽 폭이 줄어 글자가 흔들린다 — 굵기는 box-shadow 링으로 더한다 */
|
||||
border: 1px solid var(--color-border-white-10);
|
||||
@@ -69,56 +72,25 @@
|
||||
transition: border-color var(--transition-normal), transform var(--transition-normal);
|
||||
}
|
||||
|
||||
/* 시나리오 표지 그라디언트를 옅게 깐다.
|
||||
--scn / --scn-a / --scn-b 는 컴포넌트가 인라인으로 넘긴다. */
|
||||
.ssul-scn::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background: linear-gradient(150deg, var(--scn-a), var(--scn-b));
|
||||
/* 비선택은 눌러 둔다 — 채도까지 낮춰야 선택 카드와 확실히 갈린다 */
|
||||
opacity: 0.22;
|
||||
filter: saturate(0.75);
|
||||
pointer-events: none;
|
||||
transition: opacity var(--transition-normal), filter var(--transition-normal);
|
||||
}
|
||||
|
||||
/* 선택한 카드는 채도·명도를 함께 올린다.
|
||||
불투명도만 올리면 어두운 배경과 섞여 오히려 탁해지므로 filter 로 직접 올린다. */
|
||||
.ssul-scn.active::before {
|
||||
opacity: 0.72;
|
||||
filter: saturate(1.55) brightness(1.18);
|
||||
}
|
||||
|
||||
.ssul-scn:hover {
|
||||
border-color: rgba(255, 255, 255, 0.25);
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
/* 선택 표시는 밝은 중립색 테두리로 둔다.
|
||||
앰버(썰박스 강조색)를 쓰면 시나리오마다 다른 표지색과 부딪힌다 —
|
||||
특히 삼국지(적)·오디세이(청) 위에서 탁해진다. */
|
||||
/* 선택 표시 — castad .btn-select.selected 와 동일한 문법(민트 테두리 + 민트 틴트) */
|
||||
.ssul-scn.active {
|
||||
border-color: var(--color-mint);
|
||||
background: var(--color-mint-10);
|
||||
/* 링을 **테두리와 같은 색**으로 둔다. 색이 다르면 안쪽 테두리와 바깥 링이
|
||||
갈라져 두 줄로 보인다. 같은 색이면 1px 테두리 + 1px 링이 이어져
|
||||
2px 한 줄로 읽히고, 테두리 두께를 바꾸지 않아 글자도 흔들리지 않는다.
|
||||
마지막 그림자만 시나리오 대표색 글로우. */
|
||||
box-shadow:
|
||||
0 0 0 1px var(--color-mint),
|
||||
0 0 20px -2px var(--scn);
|
||||
2px 한 줄로 읽히고, 테두리 두께를 바꾸지 않아 글자도 흔들리지 않는다. */
|
||||
box-shadow: 0 0 0 1px var(--color-mint);
|
||||
}
|
||||
|
||||
/* 표지가 밝아진 만큼 설명 글자도 올려 대비를 지킨다 */
|
||||
.ssul-scn.active .ssul-scn__desc {
|
||||
color: rgba(255, 255, 255, 0.92);
|
||||
}
|
||||
|
||||
.ssul-scn__emoji {
|
||||
position: relative;
|
||||
font-size: 22px;
|
||||
}
|
||||
|
||||
.ssul-scn__name {
|
||||
position: relative;
|
||||
font-size: 14px;
|
||||
@@ -139,13 +111,17 @@
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
width: 100%;
|
||||
/* 입력과 바로 아래 안내는 한 덩어리 — 붙여 둔다 */
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
/* 이 폼의 가로 박스(입력·안내·선택결과·제출)는 높이를 48px 로 맞춘다.
|
||||
제각각이면(입력 46 / 안내 38 / 버튼 48) 세로로 쌓였을 때 리듬이 깨져
|
||||
정렬이 틀어진 것처럼 보인다. 48px 은 CTA·터치 타겟 기준값이다. */
|
||||
.ssul-create__input {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
min-height: 46px;
|
||||
min-height: 48px;
|
||||
padding: 8px 16px;
|
||||
border: none;
|
||||
border-radius: 999px;
|
||||
@@ -233,16 +209,20 @@
|
||||
color: var(--color-text-gray-400);
|
||||
}
|
||||
|
||||
/* 안내(.ssul-hint)와 같은 자리에 번갈아 나오므로 아래 간격도 같아야 한다 */
|
||||
.ssul-picked {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
width: 100%;
|
||||
/* 안내(.ssul-hint)와 같은 자리에 번갈아 나오므로 하한을 맞춘다.
|
||||
업체명 + 주소 2줄이라 실제로는 이보다 커지는데, 그건 내용이 늘어난 것이라 괜찮다 */
|
||||
min-height: 48px;
|
||||
padding: 11px 14px;
|
||||
margin-bottom: 14px;
|
||||
border: 1.5px solid var(--color-ssul-accent);
|
||||
margin-bottom: 28px;
|
||||
border: 1.5px solid var(--color-mint);
|
||||
border-radius: 12px;
|
||||
background: rgba(255, 184, 107, 0.08);
|
||||
background: var(--color-mint-10);
|
||||
}
|
||||
|
||||
.ssul-picked__body {
|
||||
@@ -264,9 +244,14 @@
|
||||
}
|
||||
|
||||
.ssul-hint {
|
||||
/* 높이를 입력·제출과 같은 48px 로. 글이 길어 두 줄이 되면 그때만 늘어난다 */
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
min-height: 48px;
|
||||
padding: 10px 14px;
|
||||
margin-bottom: 14px;
|
||||
/* 안내 다음은 비용·제출 묶음이라 섹션 간격을 준다 */
|
||||
margin-bottom: 28px;
|
||||
border-radius: 12px;
|
||||
background: var(--color-bg-card-inner);
|
||||
font-size: 12px;
|
||||
@@ -292,7 +277,7 @@
|
||||
width: 5px;
|
||||
height: 5px;
|
||||
border-radius: 50%;
|
||||
background: var(--color-ssul-accent);
|
||||
background: var(--color-mint);
|
||||
}
|
||||
|
||||
.ssul-hint.warn {
|
||||
@@ -300,12 +285,14 @@
|
||||
}
|
||||
|
||||
/* ── 비용 고지 + 제출 ────────────────────────────── */
|
||||
/* 비용 고지와 제출 버튼은 한 덩어리 — 누르기 직전에 읽어야 하므로 붙여 둔다 */
|
||||
.ssul-create__cost {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
padding: 10px 4px;
|
||||
padding: 0 4px;
|
||||
margin-bottom: 12px;
|
||||
font-size: 12px;
|
||||
color: var(--color-text-gray-400);
|
||||
}
|
||||
@@ -315,7 +302,7 @@
|
||||
align-items: center;
|
||||
gap: 5px;
|
||||
font-weight: 700;
|
||||
color: var(--color-ssul-accent);
|
||||
color: var(--color-mint);
|
||||
}
|
||||
|
||||
.ssul-create__coin {
|
||||
@@ -323,6 +310,7 @@
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
/* castad .btn-cta 와 같은 문법 — 퍼플은 페이지에서 이 CTA 한 곳만 쓴다 */
|
||||
.ssul-create__submit {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -331,18 +319,18 @@
|
||||
height: 48px;
|
||||
border: none;
|
||||
border-radius: 999px;
|
||||
background: linear-gradient(90deg, #ff8a5c, var(--color-ssul-accent));
|
||||
color: #1a1200;
|
||||
background: var(--color-purple);
|
||||
color: var(--color-text-white);
|
||||
font-family: inherit;
|
||||
font-size: 16px;
|
||||
font-weight: 800;
|
||||
font-weight: 700;
|
||||
cursor: pointer;
|
||||
transition: filter var(--transition-normal), box-shadow var(--transition-normal);
|
||||
box-shadow: var(--shadow-purple);
|
||||
transition: background-color var(--transition-normal);
|
||||
}
|
||||
|
||||
.ssul-create__submit:hover:not(:disabled) {
|
||||
filter: brightness(1.08);
|
||||
box-shadow: 0 4px 28px rgba(255, 180, 90, 0.4);
|
||||
background: var(--color-purple-hover);
|
||||
}
|
||||
|
||||
.ssul-create__submit:disabled {
|
||||
@@ -376,6 +364,7 @@
|
||||
.ssul-making__scenario {
|
||||
font-size: 20px;
|
||||
font-weight: 700;
|
||||
color: var(--color-mint);
|
||||
}
|
||||
|
||||
.ssul-making__title {
|
||||
@@ -390,8 +379,7 @@
|
||||
}
|
||||
|
||||
/* 진행 스피너 — 원본 LoadingSection 의 회전 요소만 가져왔다.
|
||||
SVG(loading-spinner.svg)를 쓰지 않은 이유: 색이 민트로 하드코딩돼 있어
|
||||
시나리오 대표색(삼국지=적, 오디세이=청)과 부딪힌다. CSS 로 그리면 --scn 을 받는다.
|
||||
색은 ADO2 생성 스피너 표준(퍼플)을 따른다.
|
||||
`spin` 키프레임은 castad 전역에 이미 있어 재사용한다(새로 만들면 3번째 중복). */
|
||||
.ssul-making__spinner {
|
||||
position: relative;
|
||||
@@ -417,9 +405,9 @@
|
||||
inset: 0;
|
||||
border-radius: 50%;
|
||||
border: 7px solid transparent;
|
||||
border-top-color: var(--scn);
|
||||
border-right-color: var(--scn);
|
||||
border-bottom-color: var(--scn);
|
||||
border-top-color: var(--color-purple);
|
||||
border-right-color: var(--color-purple);
|
||||
border-bottom-color: var(--color-purple);
|
||||
animation: spin 1.1s linear infinite;
|
||||
}
|
||||
|
||||
@@ -435,6 +423,7 @@
|
||||
.ssul-making__fill {
|
||||
height: 100%;
|
||||
border-radius: 999px;
|
||||
background: var(--color-mint);
|
||||
transition: width 400ms ease;
|
||||
}
|
||||
|
||||
|
||||
@@ -24,9 +24,6 @@
|
||||
--color-purple-glow: rgba(166, 130, 255, 0.2);
|
||||
--color-purple-80: rgba(166, 130, 255, 0.8);
|
||||
|
||||
/* 썰박스 파이프라인 강조색 (진입 화면 탭 활성 표시 전용) */
|
||||
--color-ssul-accent: #ffb86b;
|
||||
|
||||
/* Background Colors - Teal-600 based */
|
||||
--color-bg-dark: #002224;
|
||||
--color-bg-darker: #001a1c;
|
||||
|
||||
+13
-5
@@ -270,8 +270,13 @@ export interface UserCreditsResponse {
|
||||
}
|
||||
|
||||
// 비디오 목록 아이템 (갤러리용)
|
||||
/** 콘텐츠 종류. ADO2 영상과 썰박스가 한 목록에 섞인다 */
|
||||
export type ContentType = 'video' | 'ssul';
|
||||
/** 좋아요·댓글·공유에서 사용하는 통합 콘텐츠 종류 */
|
||||
export type ContentType = 'video' | 'ssul' | P2vContentType;
|
||||
|
||||
/**
|
||||
* P2V(무빙 포스터·롱컷) 콘텐츠 종류.
|
||||
*/
|
||||
export type P2vContentType = 'p2v_video' | 'p2v_playreel';
|
||||
|
||||
export interface VideoListItem {
|
||||
/**
|
||||
@@ -281,7 +286,7 @@ export interface VideoListItem {
|
||||
* 특히 `DELETE /archive/videos/{id}` 는 `Video.id` 로 지우므로,
|
||||
* 썰박스 항목의 id 를 넘기면 **엉뚱한 ADO2 영상이 삭제된다.**
|
||||
*/
|
||||
type: ContentType;
|
||||
type: ContentType | P2vContentType;
|
||||
video_id: number;
|
||||
store_name: string;
|
||||
region: string;
|
||||
@@ -325,6 +330,9 @@ export interface VideosListResponse {
|
||||
has_prev: boolean;
|
||||
}
|
||||
|
||||
/** 소셜 업로드 모달이 받는 항목 — 무빙 포스터(p2v_video)까지 업로드를 지원하고 롱컷(p2v_playreel)은 제외한다 */
|
||||
export type SocialUploadableItem = VideoListItem & { type: Exclude<ContentType, 'p2v_playreel'> };
|
||||
|
||||
// 댓글 대댓글
|
||||
export interface CommentReply {
|
||||
id: number;
|
||||
@@ -413,7 +421,7 @@ export interface SocialDisconnectResponse {
|
||||
// 유튜브 SEO Description 자동완성 요청
|
||||
export interface YTAutoSeoRequest {
|
||||
/** 썰박스면 'ssul' + task_id 자리에 ssul_content.id 문자열. 생략 시 video */
|
||||
content_type?: ContentType;
|
||||
content_type?: SocialUploadableItem['type'];
|
||||
task_id: string; // ADO2 는 task_id, 썰박스는 콘텐츠 id 문자열
|
||||
}
|
||||
|
||||
@@ -430,7 +438,7 @@ export interface SocialUploadRequest {
|
||||
* 콘텐츠 종류. video.id 와 ssul_content.id 가 겹치므로 생략(=video)한 채
|
||||
* 썰박스 id 를 보내면 **엉뚱한 ADO2 영상이 업로드된다.**
|
||||
*/
|
||||
content_type?: ContentType;
|
||||
content_type?: SocialUploadableItem['type'];
|
||||
video_id: number; // 콘텐츠 ID (content_type 안에서만 유일)
|
||||
social_account_id: number; // 선택된 채널 ID
|
||||
title: string; // 최대 100자
|
||||
|
||||
+13
-7
@@ -1,4 +1,5 @@
|
||||
import { clearSessionStorage } from './storageKeys';
|
||||
import { classifyAppAuthError } from './authError';
|
||||
import {
|
||||
CrawlingResponse,
|
||||
LyricGenerateRequest,
|
||||
@@ -859,18 +860,23 @@ export async function authenticatedFetch(
|
||||
|
||||
// 401 에러 시 에러 코드에 따라 처리
|
||||
if (response.status === 401) {
|
||||
const errorBody = await response.json().catch(() => null);
|
||||
const errorCode = errorBody?.detail?.code;
|
||||
// 호출부가 본문을 다시 읽을 수 있도록 clone 으로 판별한다
|
||||
const errorBody = await response.clone().json().catch(() => null);
|
||||
const authError = classifyAppAuthError(errorBody);
|
||||
|
||||
// 애초에 토큰이 없던 익명 요청(공개 화면)까지 튕기면 안 되므로 별도 처리
|
||||
const isMissingToken = errorCode === 'MISSING_TOKEN';
|
||||
// 앱 로그인 문제가 아닌 401(YouTube/소셜 재연동 필요 등)은 로그아웃하지 않고
|
||||
// 호출부가 code 로 처리하도록 응답을 그대로 돌려준다
|
||||
if (authError === null) {
|
||||
return response;
|
||||
}
|
||||
|
||||
if (errorCode !== 'TOKEN_EXPIRED') {
|
||||
if (authError !== 'expired') {
|
||||
// INVALID_TOKEN 등 갱신으로 해결 불가한 경우 즉시 로그인 이동
|
||||
if (redirectOnAuthFail && !isMissingToken) {
|
||||
// (애초에 토큰이 없던 익명 요청(공개 화면)은 튕기면 안 되므로 missing 은 제외)
|
||||
if (redirectOnAuthFail && authError !== 'missing') {
|
||||
redirectToLogin();
|
||||
}
|
||||
throw new Error(errorCode ?? 'Unauthorized');
|
||||
throw new Error(errorBody?.detail?.code ?? 'Unauthorized');
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
// 401 응답이 "앱 로그인(JWT) 문제"인지 구분한다.
|
||||
// 앱 JWT 오류는 { detail: { code, message } } 형태이고,
|
||||
// YouTube/소셜 외부 플랫폼 토큰 오류는 { detail: string, code } 형태라 서로 다르다.
|
||||
// 외부 플랫폼 401까지 로그아웃 처리하면 재연동 안내 대신 앱에서 튕겨 나간다.
|
||||
|
||||
export type AppAuthErrorKind = 'expired' | 'missing' | 'invalid';
|
||||
|
||||
export function classifyAppAuthError(errorBody: unknown): AppAuthErrorKind | null {
|
||||
const detail = (errorBody as { detail?: unknown } | null)?.detail;
|
||||
if (typeof detail !== 'object' || detail === null) return null;
|
||||
|
||||
switch ((detail as { code?: unknown }).code) {
|
||||
case 'TOKEN_EXPIRED':
|
||||
return 'expired';
|
||||
case 'MISSING_TOKEN':
|
||||
return 'missing';
|
||||
case 'INVALID_TOKEN':
|
||||
case 'TOKEN_REVOKED':
|
||||
return 'invalid';
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,5 @@
|
||||
import type { ContentType } from '../types/api';
|
||||
|
||||
/**
|
||||
* 기기의 네이티브 공유 시트를 열고 요청을 처리했는지 반환합니다.
|
||||
*
|
||||
@@ -32,9 +34,13 @@ export function buildVideoShareUrl(apiBaseUrl: string, videoId: number | string)
|
||||
export function buildContentShareUrl(
|
||||
apiBaseUrl: string,
|
||||
contentId: number | string,
|
||||
contentType: 'video' | 'ssul' = 'video',
|
||||
contentType: ContentType = 'video',
|
||||
): string {
|
||||
const base = apiBaseUrl.replace(/\/$/, '');
|
||||
if (contentType === 'p2v_video' || contentType === 'p2v_playreel') {
|
||||
const kind = contentType === 'p2v_video' ? 'f1' : 'playreel';
|
||||
return `${base}/p2v/${kind}/share/${encodeURIComponent(String(contentId))}`;
|
||||
}
|
||||
if (contentType === 'ssul') {
|
||||
return `${base}/ssul/share/${encodeURIComponent(String(contentId))}`;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,193 @@
|
||||
/**
|
||||
* Poster to Video (P2V) 클라이언트.
|
||||
*
|
||||
* castad 백엔드의 `/p2v/*` 를 다른 파이프라인(ADO2·썰박스)과 같은 방식으로 부른다 —
|
||||
* `authenticatedFetch` 가 Bearer 토큰을 싣는다. 잡 소유권·크레딧은 백엔드가 맡는다.
|
||||
*
|
||||
* 크레딧은 생성 요청 시점에 선차감되고, 실패하면 환불된다(썰박스와 같다).
|
||||
* 잔액이 모자라면 402 가 오며, 호출부가 충전 화면으로 유도할 수 있게
|
||||
* `InsufficientCreditError` 로 던진다.
|
||||
*/
|
||||
import { ContentType, P2vContentType } from '../types/api';
|
||||
import { API_URL, InsufficientCreditError, authenticatedFetch } from './api';
|
||||
|
||||
/**
|
||||
* 404 — 서버에 그 잡이 없다(지워졌거나 내 것이 아니다). 화면은 처음으로 되돌려야 한다.
|
||||
*
|
||||
* 상태 코드로 판정하는 이유: 서버 detail 문구("잡 없음")를 문자열로 맞추려다
|
||||
* 실제로 한 번 놓쳤다. 문구는 서버 사정으로 바뀌고 번역도 되지만 코드는 안 바뀐다.
|
||||
*/
|
||||
export class P2vNotFoundError extends Error {
|
||||
constructor(detail: string) {
|
||||
super(detail);
|
||||
this.name = 'P2vNotFoundError';
|
||||
}
|
||||
}
|
||||
|
||||
export async function p2vFetch<T>(path: string, init?: RequestInit): Promise<T> {
|
||||
const res = await authenticatedFetch(`${API_URL}${path}`, init);
|
||||
|
||||
if (res.status === 402) throw new InsufficientCreditError();
|
||||
|
||||
if (!res.ok) {
|
||||
// FastAPI 는 {detail: ...} 로 준다. 본문이 없는 에러(502 등)도 있으므로 감싼다
|
||||
let detail = res.statusText;
|
||||
try {
|
||||
const body = await res.json();
|
||||
detail = typeof body.detail === 'string' ? body.detail : JSON.stringify(body);
|
||||
} catch {
|
||||
/* 본문 없음 — statusText 로 간다 */
|
||||
}
|
||||
if (res.status === 404) throw new P2vNotFoundError(detail);
|
||||
throw new Error(detail);
|
||||
}
|
||||
return res.json() as Promise<T>;
|
||||
}
|
||||
|
||||
// ── 타입 (백엔드 app/p2v/api/routers/v1/view.py 와 1:1) ───────────────
|
||||
|
||||
export type P2vStageStatus = 'idle' | 'running' | 'done' | 'failed';
|
||||
|
||||
export interface P2vStageState {
|
||||
status: P2vStageStatus;
|
||||
started: number | null;
|
||||
ended: number | null;
|
||||
}
|
||||
|
||||
export interface PosterMeta {
|
||||
event_name: string;
|
||||
date_text: string;
|
||||
place: string;
|
||||
category: string;
|
||||
keywords: string[];
|
||||
region_guess?: string;
|
||||
}
|
||||
|
||||
export interface P2vJob {
|
||||
id: number;
|
||||
kind: 'f1';
|
||||
name: string;
|
||||
status: 'queued' | 'running' | 'awaiting_review' | 'failed' | 'done';
|
||||
stage: string | null;
|
||||
stages: Record<string, P2vStageState>;
|
||||
narration: string[] | null;
|
||||
motion_elements?: string[] | null;
|
||||
metadata: PosterMeta | null;
|
||||
error: { stage: string; detail: string } | null;
|
||||
/** 산출물은 Azure Blob 의 절대 URL 이다 */
|
||||
artifacts: Record<string, string>;
|
||||
created_at: number;
|
||||
}
|
||||
|
||||
/** 잡 id. 서버는 숫자로 주고, 화면은 localStorage 때문에 문자열로도 든다 */
|
||||
export type P2vJobId = string | number;
|
||||
|
||||
// ── F1 (포스터 → 영상) ────────────────────────────────────────────────
|
||||
|
||||
/** 포스터 업로드 → 잡 생성. 반환된 id 로 폴링한다. 크레딧이 먼저 차감된다 */
|
||||
export async function createPosterJob(poster: File, name: string): Promise<{ id: string }> {
|
||||
const fd = new FormData();
|
||||
fd.append('poster', poster);
|
||||
fd.append('name', name);
|
||||
const { id } = await p2vFetch<{ id: number }>('/p2v/f1/jobs', { method: 'POST', body: fd });
|
||||
// 화면은 잡 id 를 localStorage 문자열로 들고 있어 경계에서 맞춘다
|
||||
return { id: String(id) };
|
||||
}
|
||||
|
||||
export const getPosterJob = (id: P2vJobId): Promise<P2vJob> =>
|
||||
p2vFetch<P2vJob>(`/p2v/f1/jobs/${id}`);
|
||||
|
||||
export const updatePosterNarration = (id: P2vJobId, narration: string[]): Promise<unknown> =>
|
||||
p2vFetch(`/p2v/f1/jobs/${id}/narration`, {
|
||||
method: 'PUT',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ narration }),
|
||||
});
|
||||
|
||||
export const updatePosterMetadata = (
|
||||
id: P2vJobId,
|
||||
meta: { event_name: string; date_text: string; place: string },
|
||||
): Promise<unknown> =>
|
||||
p2vFetch(`/p2v/f1/jobs/${id}/metadata`, {
|
||||
method: 'PUT',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify(meta),
|
||||
});
|
||||
|
||||
/** 검수 승인 → TTS·BGM·애니메이션·렌더가 이어진다. motions 를 넘기면 모션 선정을 덮어쓴다 */
|
||||
export const approvePosterJob = (id: P2vJobId, motions?: string[] | null): Promise<unknown> =>
|
||||
p2vFetch(`/p2v/f1/jobs/${id}/approve`, {
|
||||
method: 'POST',
|
||||
...(motions
|
||||
? { headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ motions }) }
|
||||
: {}),
|
||||
});
|
||||
|
||||
export const deletePosterJob = (id: P2vJobId): Promise<unknown> =>
|
||||
p2vFetch(`/p2v/f1/jobs/${id}`, { method: 'DELETE' });
|
||||
|
||||
// ── 통합 콘텐츠 목록 ──────────────────────────────────────────────────
|
||||
|
||||
export const isP2vContent = (type: ContentType | P2vContentType): type is P2vContentType =>
|
||||
type === 'p2v_video' || type === 'p2v_playreel';
|
||||
|
||||
export interface P2vDetailItem {
|
||||
type: P2vContentType;
|
||||
content_id: number;
|
||||
video_url: string;
|
||||
poster_url: string | null;
|
||||
title: string | null;
|
||||
created_at: string;
|
||||
like_count: number;
|
||||
is_liked_by_me: boolean;
|
||||
}
|
||||
|
||||
/** 비로그인도 보는 공개 상세. 소유자 전용 /jobs/{id} API 와 구분한다. */
|
||||
export async function getP2vContentById(type: P2vContentType, id: string): Promise<P2vDetailItem> {
|
||||
const kind = type === 'p2v_video' ? 'f1' : 'playreel';
|
||||
const response = await authenticatedFetch(
|
||||
`${API_URL}/p2v/${kind}/${encodeURIComponent(id)}`,
|
||||
{ method: 'GET' },
|
||||
{ redirectOnAuthFail: false },
|
||||
);
|
||||
if (!response.ok) throw new Error(`HTTP error! status: ${response.status}`);
|
||||
return response.json();
|
||||
}
|
||||
|
||||
/**
|
||||
* 내 콘텐츠에서 P2V 항목 삭제. 종류마다 테이블이 달라 경로가 갈린다.
|
||||
* ⚠️ `deleteVideo`(`/archive/videos/{id}`, Video.id 기준)와 혼용하면 id 가 겹치는
|
||||
* 엉뚱한 ADO2 영상이 지워진다.
|
||||
*/
|
||||
export const deleteP2vContent = (type: P2vContentType, id: number): Promise<unknown> =>
|
||||
p2vFetch(`/p2v/${type === 'p2v_video' ? 'f1' : 'playreel'}/jobs/${id}`, { method: 'DELETE' });
|
||||
|
||||
// ── 진행 계산 ────────────────────────────────────────────────────────
|
||||
|
||||
/** 아직 도는 중인가. 이 두 상태에서만 폴링을 계속한다 */
|
||||
export const isP2vActive = (job: P2vJob | null): boolean =>
|
||||
job !== null && (job.status === 'queued' || job.status === 'running');
|
||||
|
||||
/** 스테이지 진행률(%) — 선형 진행바용. 도는 중인 스테이지는 절반으로 친다 */
|
||||
export function p2vProgress(job: Pick<P2vJob, 'stages'> | null): number {
|
||||
if (!job) return 0;
|
||||
const states = Object.values(job.stages);
|
||||
if (states.length === 0) return 0;
|
||||
const done = states.filter((s) => s.status === 'done').length;
|
||||
const running = states.some((s) => s.status === 'running') ? 0.5 : 0;
|
||||
return Math.round(((done + running) / states.length) * 100);
|
||||
}
|
||||
|
||||
/**
|
||||
* 검수 게이트를 이미 지났는가.
|
||||
*
|
||||
* 스텝퍼가 "분석 → 검수 → 생성" 중 어디인지 알아야 하는데 status 만으로는
|
||||
* 검수 전 running 과 승인 후 running 이 구분되지 않는다. tts 는 승인 이후에만
|
||||
* 시작하므로 이게 게이트 통과의 신호다(스테이지 이름을 박는 대신 F1_STAGES 순서에
|
||||
* 의존하지 않도록 tts 하나만 본다 — 게이트가 옮겨가면 이 상수만 고친다).
|
||||
*/
|
||||
const POST_REVIEW_STAGE = 'tts';
|
||||
|
||||
export const isPastReview = (job: P2vJob | null): boolean =>
|
||||
!!job && job.stages[POST_REVIEW_STAGE]?.status !== undefined
|
||||
&& job.stages[POST_REVIEW_STAGE].status !== 'idle';
|
||||
@@ -0,0 +1,170 @@
|
||||
/**
|
||||
* Playreel(롱컷) 클라이언트 — 공연 상품페이지 URL → 30초 세로 예고편.
|
||||
*
|
||||
* castad 백엔드의 `/p2v/playreel/*` 를 부른다(p2vApi.ts 의 `p2vFetch` 를 공유).
|
||||
* 이 파이프라인은 사람이 확인하는 **게이트 5개**에서 멈춘다. 게이트마다 검수 페이로드
|
||||
* (`review`)가 오고, 승인할 때 고친 값(`edits`)을 함께 보낸다.
|
||||
*
|
||||
* 크레딧은 생성 요청 시점에 선차감되고, 실패하면 환불된다. 실패한 잡은 다시 돌릴 수
|
||||
* 없다(새로 만든다). 다시 돌릴 수 있는 것은 클립 검수 게이트의 "다시 만들기" 뿐이다.
|
||||
*/
|
||||
import { P2vJobId, P2vStageState, p2vFetch } from './p2vApi';
|
||||
|
||||
export type GateKey =
|
||||
| 'fetch_confirm'
|
||||
| 'analysis_confirm'
|
||||
| 'narration_confirm'
|
||||
| 'clip_confirm'
|
||||
| 'final_confirm';
|
||||
|
||||
export const GATE_ORDER: readonly GateKey[] = [
|
||||
'fetch_confirm', 'analysis_confirm', 'narration_confirm', 'clip_confirm', 'final_confirm',
|
||||
];
|
||||
|
||||
/**
|
||||
* 게이트 진행 상태. 문구는 locales 의 `playreel.gates.<key>` 에 있다.
|
||||
* 되돌리기는 크레딧을 이미 쓴 지점 뒤로는 서버가 거절한다(`REVERSIBLE_GATES`).
|
||||
*/
|
||||
export const GATE_CAN_BACK: Record<GateKey, boolean> = {
|
||||
fetch_confirm: false,
|
||||
analysis_confirm: true,
|
||||
narration_confirm: true,
|
||||
clip_confirm: false,
|
||||
final_confirm: false,
|
||||
};
|
||||
|
||||
// ── 게이트별 검수 페이로드 (백엔드 app/p2v/worker/gate.py 와 1:1) ──────────
|
||||
|
||||
export interface DetailSection {
|
||||
id: string;
|
||||
tag: string;
|
||||
label: string;
|
||||
thumb_url: string;
|
||||
height: number;
|
||||
/** 캐스팅 스케줄은 항상 포함 */
|
||||
required?: boolean;
|
||||
selected: boolean;
|
||||
}
|
||||
|
||||
export interface FetchReview {
|
||||
poster_url: string;
|
||||
/** 800px 이하면 저해상 경고 */
|
||||
poster_width: number;
|
||||
meta: { title: string; date_text: string; place: string; cast: string[]; genre: string };
|
||||
sections: DetailSection[];
|
||||
}
|
||||
|
||||
export interface AnalysisReview {
|
||||
grid_url: string;
|
||||
movable: { key: string; label: string; on: boolean }[];
|
||||
fixed: { key: string; label: string; on: boolean }[];
|
||||
model: string;
|
||||
ip_risk: boolean;
|
||||
has_qr: boolean;
|
||||
}
|
||||
|
||||
export interface NarrationReview {
|
||||
lines: { slot: string; text: string }[];
|
||||
voice: { id: string; name: string; sample_url: string };
|
||||
est_seconds: number;
|
||||
}
|
||||
|
||||
export interface ClipReview {
|
||||
clip_url: string;
|
||||
frames_url: string;
|
||||
title_mae: number;
|
||||
gate_passed: boolean;
|
||||
gate_reason: string | null;
|
||||
}
|
||||
|
||||
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 type GateEdits =
|
||||
| { sections: string[]; meta: FetchReview['meta'] }
|
||||
| { movable: string[]; fixed: string[]; model: string }
|
||||
| { lines: string[]; voice_id: string };
|
||||
|
||||
export interface PlayreelJob {
|
||||
id: number;
|
||||
kind: 'playreel';
|
||||
name: string;
|
||||
status: 'queued' | 'running' | 'awaiting_review' | 'failed' | 'done';
|
||||
stage: string | null;
|
||||
stages: Record<string, P2vStageState>;
|
||||
error: { stage: string; detail: string } | null;
|
||||
/** 산출물은 Azure Blob 의 절대 URL 이다 */
|
||||
artifacts: Record<string, string>;
|
||||
created_at: number;
|
||||
source: { url: string; goods_id: string; slug: string };
|
||||
gate: GateKey | null;
|
||||
review: GateReview | null;
|
||||
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;
|
||||
}
|
||||
|
||||
// ── API ─────────────────────────────────────────────────────────────────
|
||||
|
||||
const jsonBody = (body: unknown): RequestInit => ({
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify(body),
|
||||
});
|
||||
|
||||
/** 상품페이지 주소 → 잡 생성. 크레딧이 먼저 차감된다 */
|
||||
export async function createPlayreelJob(url: string): Promise<{ id: string }> {
|
||||
const { id } = await p2vFetch<{ id: number }>('/p2v/playreel/jobs', jsonBody({ url: url.trim() }));
|
||||
// 화면은 잡 id 를 localStorage 문자열로 들고 있어 경계에서 맞춘다
|
||||
return { id: String(id) };
|
||||
}
|
||||
|
||||
export const getPlayreelJob = (id: P2vJobId): Promise<PlayreelJob> =>
|
||||
p2vFetch<PlayreelJob>(`/p2v/playreel/jobs/${id}`);
|
||||
|
||||
/** 게이트 승인. gate 를 함께 보내 화면과 서버의 게이트가 어긋나면 서버가 409 로 막는다 */
|
||||
export const approvePlayreelGate = (
|
||||
id: P2vJobId, gate: GateKey, edits: GateEdits | null,
|
||||
): Promise<PlayreelJob> =>
|
||||
p2vFetch<PlayreelJob>(`/p2v/playreel/jobs/${id}/approve`, jsonBody({ gate, edits }));
|
||||
|
||||
/** 직전 게이트로 되돌린다 */
|
||||
export const backPlayreelGate = (id: P2vJobId): Promise<PlayreelJob> =>
|
||||
p2vFetch<PlayreelJob>(`/p2v/playreel/jobs/${id}/back`, { method: 'POST' });
|
||||
|
||||
/** 클립 검수 게이트에서 영상을 다시 만든다. 추가 크레딧은 차감되지 않는다 */
|
||||
export const retryPlayreelClip = (id: P2vJobId): Promise<PlayreelJob> =>
|
||||
p2vFetch<PlayreelJob>(`/p2v/playreel/jobs/${id}/retry`, { method: 'POST' });
|
||||
|
||||
export const deletePlayreelJob = (id: P2vJobId): Promise<unknown> =>
|
||||
p2vFetch(`/p2v/playreel/jobs/${id}`, { method: 'DELETE' });
|
||||
@@ -0,0 +1,72 @@
|
||||
import { useSyncExternalStore } from 'react';
|
||||
import { GateKey } from './playreelApi';
|
||||
|
||||
/**
|
||||
* 롱컷 게이트 자동 승인 설정 — playreel 원본(`lib/prefs.ts`)과 같은 방식이다.
|
||||
*
|
||||
* 대상은 되돌릴 수 있는 게이트(① 수집 확인, ③ 나레이션 확인)뿐이다.
|
||||
* ②·④·⑤ 는 크레딧을 쓰거나 결과를 고정하는 비가역 단계라 항상 사람이 확인한다.
|
||||
*
|
||||
* 브라우저 localStorage 에만 저장하고 서버에는 보내지 않는다. `storageKeys.K` 에 넣지 않은 것도
|
||||
* 의도적이다 — 그쪽 키는 새 프로젝트·로그아웃 때 지워지는데, 이건 사용자의 취향이라
|
||||
* 생성할 때마다 다시 켜게 만들면 안 된다.
|
||||
*/
|
||||
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>>;
|
||||
|
||||
export const isAutoApprovable = (gate: GateKey | null | undefined): gate is AutoApprovable =>
|
||||
!!gate && (AUTO_APPROVABLE as readonly string[]).includes(gate);
|
||||
|
||||
const STORAGE_KEY = 'castad_playreel_auto_approve';
|
||||
const CHANGE_EVENT = 'castad:playreel-prefs';
|
||||
const EMPTY: AutoApprovePrefs = {};
|
||||
|
||||
// useSyncExternalStore 는 같은 값이면 같은 참조를 돌려줘야 한다
|
||||
let cache: { raw: string | null; value: AutoApprovePrefs } = { raw: null, value: EMPTY };
|
||||
|
||||
export function readAutoApprove(): AutoApprovePrefs {
|
||||
let raw: string | null = null;
|
||||
try {
|
||||
raw = localStorage.getItem(STORAGE_KEY);
|
||||
} catch {
|
||||
return EMPTY; // 저장소를 못 쓰면 항상 사람이 확인한다
|
||||
}
|
||||
if (raw === cache.raw) return cache.value;
|
||||
let value: AutoApprovePrefs = EMPTY;
|
||||
try {
|
||||
const parsed = raw ? JSON.parse(raw) : {};
|
||||
value = Object.fromEntries(
|
||||
AUTO_APPROVABLE.filter((gate) => parsed?.[gate] === true).map((gate) => [gate, true]),
|
||||
);
|
||||
} catch {
|
||||
/* 깨진 값은 꺼진 것으로 본다 */
|
||||
}
|
||||
cache = { raw, value };
|
||||
return value;
|
||||
}
|
||||
|
||||
export function setAutoApprove(gate: AutoApprovable, on: boolean): void {
|
||||
const next = { ...readAutoApprove() };
|
||||
if (on) next[gate] = true;
|
||||
else delete next[gate];
|
||||
try {
|
||||
localStorage.setItem(STORAGE_KEY, JSON.stringify(next));
|
||||
} catch {
|
||||
/* 프라이빗 모드 등 — 이 세션에서만 유지되지 않는다 */
|
||||
}
|
||||
window.dispatchEvent(new Event(CHANGE_EVENT));
|
||||
}
|
||||
|
||||
function subscribe(onChange: () => void): () => void {
|
||||
window.addEventListener(CHANGE_EVENT, onChange);
|
||||
window.addEventListener('storage', onChange); // 다른 탭에서 바꾼 경우
|
||||
return () => {
|
||||
window.removeEventListener(CHANGE_EVENT, onChange);
|
||||
window.removeEventListener('storage', onChange);
|
||||
};
|
||||
}
|
||||
|
||||
export function useAutoApprove(): AutoApprovePrefs {
|
||||
return useSyncExternalStore(subscribe, readAutoApprove, () => EMPTY);
|
||||
}
|
||||
@@ -32,10 +32,29 @@ export const K = {
|
||||
VIDEO_RATIO: 'castad_video_ratio',
|
||||
|
||||
// 썰박스 통합
|
||||
/** 현재 선택된 파이프라인 ('ado2' | 'ssul') */
|
||||
/** 현재 선택된 파이프라인 (PipelineTabs 의 Pipeline 값) */
|
||||
PIPELINE: 'castad_pipeline',
|
||||
/** 진행 중인 썰박스 생성 잡 ID. 권위는 서버(`/ssul/tasks/active`)이고 이건 복구 힌트다 */
|
||||
SSUL_TASK_ID: 'castad_ssul_task_id',
|
||||
|
||||
// Poster to Video 통합
|
||||
/**
|
||||
* 진행 중인 포스터 영상(F1) 잡 ID.
|
||||
*
|
||||
* 썰박스의 `/ssul/tasks/active` 같은 "내 활성 잡" 엔드포인트가 P2V 에는 없다
|
||||
* (단일 팀 키라 사용자 개념이 없다). 그래서 이 값이 새로고침 복구의 유일한 근거다 —
|
||||
* 지우면 진행 중인 잡을 화면에서 잃는다. 서버에서 잡이 사라졌으면 조회가 404 로
|
||||
* 떨어지고 GenerationFlow 가 이 키를 정리한다.
|
||||
*
|
||||
* 접근 키(castad_p2v_key)는 여기 두지 않는다 — 서버 자격증명이라 프로젝트 초기화·
|
||||
* 로그아웃으로 지워지면 시연 중 매번 다시 물어야 한다 (utils/p2vApi.ts 참조).
|
||||
*/
|
||||
POSTER_JOB_ID: 'castad_poster_job_id',
|
||||
/**
|
||||
* 롱컷(Playreel) 진행 중 잡 id. 포스터 영상과 같은 이유로 새로고침 복구의 근거다.
|
||||
* 잡이 사라졌으면 조회가 404 로 떨어지고 GenerationFlow 가 이 키를 정리한다.
|
||||
*/
|
||||
PLAYREEL_JOB_ID: 'castad_playreel_job_id',
|
||||
} as const;
|
||||
|
||||
/**
|
||||
@@ -52,6 +71,8 @@ export const PROJECT_KEYS: readonly string[] = [
|
||||
K.VIDEO_RATIO,
|
||||
K.PIPELINE,
|
||||
K.SSUL_TASK_ID,
|
||||
K.POSTER_JOB_ID,
|
||||
K.PLAYREEL_JOB_ID,
|
||||
];
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user