Compare commits
62
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8ab021dee4 | ||
|
|
70965d3eef | ||
|
|
0d2c4a4a19 | ||
|
|
a5b7529f17 | ||
|
|
c659f8c2f9 | ||
|
|
c06018d88c | ||
|
|
cd71f6d9d3 | ||
|
|
2e187ec193 | ||
|
|
c82a386b5b | ||
|
|
487d0f6d6a | ||
|
|
8ba5546f85 | ||
|
|
94b39a44bd | ||
|
|
3bcca23e97 | ||
|
|
1128712170 | ||
|
|
e328fc950c | ||
|
|
547dd415c5 | ||
|
|
cea60e70db | ||
|
|
0d3167c1a2 | ||
|
|
efc6e45070 | ||
|
|
8be95778f3 | ||
|
|
40895207ee | ||
|
|
0ca2140b98 | ||
|
|
17319e950e | ||
|
|
4dff60c1ba | ||
|
|
82b9fef3a1 | ||
|
|
4fe065378f | ||
|
|
bdb581459d | ||
|
|
63d60caabd | ||
|
|
e400884eb7 | ||
|
|
3566c1f7bc | ||
|
|
9c0c3de35f | ||
|
|
3b8298bba2 | ||
|
|
fde7c8f6e1 | ||
|
|
1f6921c587 | ||
|
|
cdddb913a0 | ||
|
|
1cdb47ec2e | ||
|
|
23938871b0 | ||
|
|
18b5271110 | ||
|
|
1c01dab748 | ||
|
|
40ebe2cca0 | ||
|
|
b9fd77fb51 | ||
|
|
3701490728 | ||
|
|
bda4c267dd | ||
|
|
741539a023 | ||
|
|
7b1e691715 | ||
|
|
54e5d14127 | ||
|
|
bb0ab91bcc | ||
|
|
c4c46db0d9 | ||
|
|
f19cba7d75 | ||
|
|
f36fd5a3cb | ||
|
|
a853c714fd | ||
|
|
5512d90a9e | ||
|
|
e2b22bd8e9 | ||
|
|
5b7eba9540 | ||
|
|
e7d6d89fe5 | ||
|
|
bd92eb2226 | ||
|
|
2f720dfa92 | ||
|
|
8a39a34630 | ||
|
|
26ae588285 | ||
|
|
6c499ae061 | ||
|
|
888ac4fa5e | ||
|
|
429c8d4708 |
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
|
||||
|
||||
+88
-6
@@ -4,17 +4,92 @@
|
||||
<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://demo.castad.net/" />
|
||||
<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 -->
|
||||
<script>
|
||||
!function(f,b,e,v,n,t,s)
|
||||
{if(f.fbq)return;n=f.fbq=function(){n.callMethod?
|
||||
n.callMethod.apply(n,arguments):n.queue.push(arguments)};
|
||||
if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
|
||||
n.queue=[];t=b.createElement(e);t.async=!0;
|
||||
t.src=v;s=b.getElementsByTagName(e)[0];
|
||||
s.parentNode.insertBefore(t,s)}(window, document,'script',
|
||||
'https://connect.facebook.net/en_US/fbevents.js');
|
||||
fbq('init', '1572679738203392');
|
||||
fbq('track', 'PageView');
|
||||
</script>
|
||||
<!-- End Meta Pixel Code -->
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
<script>
|
||||
tailwind.config = {
|
||||
@@ -162,10 +237,17 @@
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<link rel="stylesheet" href="/index.css">
|
||||
</head>
|
||||
<body class="bg-[#121a1d]">
|
||||
<!-- Meta Pixel noscript fallback (head의 noscript에는 img가 허용되지 않아 body에 위치) -->
|
||||
<noscript><img height="1" width="1" style="display:none"
|
||||
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>
|
||||
Generated
+8
-8
@@ -16,8 +16,8 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^22.14.0",
|
||||
"@types/react": "^19.2.17",
|
||||
"@types/react-dom": "^19.2.3",
|
||||
"@types/react": "^19.2.0",
|
||||
"@types/react-dom": "^19.2.0",
|
||||
"@vitejs/plugin-react": "^5.0.0",
|
||||
"typescript": "~5.8.2",
|
||||
"vite": "^6.2.0"
|
||||
@@ -1297,9 +1297,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@types/react": {
|
||||
"version": "19.2.17",
|
||||
"resolved": "https://registry.npmjs.org/@types/react/-/react-19.2.17.tgz",
|
||||
"integrity": "sha512-MXfmqaVPEVgkBT/aY0aGCkRWWtByiYQXo3xdQ8r5RzuFrPiRn8Gar2tQdXSUQ2GKV3bkXckek89V8wQBY2Q/Aw==",
|
||||
"version": "19.2.18",
|
||||
"resolved": "https://registry.npmjs.org/@types/react/-/react-19.2.18.tgz",
|
||||
"integrity": "sha512-AnzbBERsrLKtk2XSfTbYRLjQPdy116Sty4q+T+Bp3IC4l6jNBvreVPAHmpq9qhXQM7CXZPjLVmGMw9sy+hxQ3w==",
|
||||
"devOptional": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
@@ -1308,9 +1308,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@types/react-dom": {
|
||||
"version": "19.2.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-19.2.3.tgz",
|
||||
"integrity": "sha512-jp2L/eY6fn+KgVVQAOqYItbF0VY/YApe5Mz2F0aykSO8gx31bYCZyvSeYxCHKvzHG5eZjc+zyaS5BrBWya2+kQ==",
|
||||
"version": "19.2.4",
|
||||
"resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-19.2.4.tgz",
|
||||
"integrity": "sha512-Bsc+QHgp+P/F02XDzNCY9jnZNCUuLki36KT7VKrTXXLdHf+vHMNZnW1rVu5DNW/rCK+fya3DATySbLM4yhtKUw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
|
||||
+4
-3
@@ -5,7 +5,8 @@
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "vite build",
|
||||
"typecheck": "tsc --noEmit",
|
||||
"build": "tsc --noEmit && vite build",
|
||||
"preview": "vite preview"
|
||||
},
|
||||
"dependencies": {
|
||||
@@ -17,8 +18,8 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^22.14.0",
|
||||
"@types/react": "^19.2.17",
|
||||
"@types/react-dom": "^19.2.3",
|
||||
"@types/react": "^19.2.0",
|
||||
"@types/react-dom": "^19.2.0",
|
||||
"@vitejs/plugin-react": "^5.0.0",
|
||||
"typescript": "~5.8.2",
|
||||
"vite": "^6.2.0"
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 8.7 KiB |
@@ -1,244 +0,0 @@
|
||||
{
|
||||
"status": "completed",
|
||||
"image_list": [
|
||||
"https://ldb-phinf.pstatic.net/20260112_189/1768176025117RmItD_PNG/ChatGPT_Image_2026%B3%E2_1%BF%F9_9%C0%CF_%BF%C0%C8%C4_03_21_56.png",
|
||||
"https://ldb-phinf.pstatic.net/20251215_290/1765776039787CALYj_JPEG/IMG_0060.JPG",
|
||||
"https://ldb-phinf.pstatic.net/20251215_70/1765776016674Nbo0Q_JPEG/IMG_0067_%BA%B9%BB%E7.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20251215_136/17657760168457kDf6_JPEG/KakaoTalk_20251214_181208552_03_%BA%B9%BB%E7.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20251215_38/1765776039760cYgOj_JPEG/IMG_0044.JPG",
|
||||
"https://ldb-phinf.pstatic.net/20251128_248/1764320049551B1gHl_JPEG/KakaoTalk_20251128_174635084_27.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20251128_209/1764320105053L8V2f_JPEG/KakaoTalk_20251128_174635084_17.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20241205_181/1733360083850LsEVv_JPEG/KakaoTalk_20241203_155353799_09.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20251128_209/1764320017959Rh3vs_JPEG/KakaoTalk_20251128_174635084_13.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20251128_102/1764320169035vluJN_JPEG/KakaoTalk_20251128_174635084_12.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20241129_249/17328584834569zWJT_JPEG/6S5A0642-%C6%ED%C1%FD.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20241129_196/1732858501391FjLpd_JPEG/6S5A0657.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20241202_230/1733105198846QGbcW_JPEG/8.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20241202_94/1733105214373Q8ncR_JPEG/%B5%BF%B1%D7%B6%F3%B9%CC_%C3%A2%B9%AE_%B9%E6%B0%A1%C0%BB_2.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20231207_110/1701910802632rDM5r_JPEG/a_%28301%29-%C6%ED%C1%FD.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20241202_7/1733106037765MNR8e_JPEG/9-1.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240118_42/17055625561156LIx7_JPEG/6S5A0809-%C6%ED%C1%FD.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240118_246/1705562556109bihHB_JPEG/6S5A1820-%C6%ED%C1%FD.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20241202_259/1733104881690lDgnH_JPEG/3-2.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20231207_76/1701910651888PpVap_JPEG/%C6%EA%B5%E5%B6%F3%C0%CC%B7%EB.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20231207_242/1701910651863IAAlE_JPEG/%B0%AD%BE%C6%C1%F6_%BA%F1%C7%B0.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20241202_120/17331038087267aQ0S_JPEG/KakaoTalk_20241015_154536888_04.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20250710_164/17521338301365LRwl_JPEG/6S5A6748-%C6%ED%C1%FD.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20250710_169/1752133830016fqFlL_JPEG/6S5A6760-%C6%ED%C1%FD.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20231207_80/1701920469022ef7TW_JPEG/6S5A0614-%C6%ED%C1%FD.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240603_140/17173835278369nntD_JPEG/6S5A6707.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20250710_173/1752133829861tPALd_JPEG/6S5A7136.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20241202_248/1733106037776BGjJx_JPEG/1-1.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240603_275/1717383527874oJOpz_JPEG/DJI_0040-%C6%ED%C1%FD.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20250710_153/1752133811173ba7oE_JPEG/6S5A6458.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20250710_185/1752133829868FyD76_JPEG/6S5A6815.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20250710_220/1752133829963w1aee_JPEG/6S5A6856.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20250710_228/1752133830002U65jg_JPEG/6S5A6864.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20250710_178/1752133829793fQQ2E_JPEG/6S5A7016-%C6%ED%C1%FD.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20250710_279/1752133829838lTSC9_JPEG/6S5A7034-%C6%ED%C1%FD.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20250710_179/1752133811452tOl7F_JPEG/6S5A6363.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20250710_75/1752133811152vd5ts_JPEG/6S5A6513.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20250710_147/1752133810693TfR5M_JPEG/6S5A6556.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20250710_202/1752133811177NRBDn_JPEG/6S5A6619-2.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20250710_196/1752133811066ufvpA_JPEG/6S5A6657.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20250710_280/1752133811307QCs3n_JPEG/6S5A6709.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240603_85/1717383527884ST2DF_JPEG/6S5A6540.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240603_249/1717383528285Om6dI_JPEG/6S5A6648.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240603_288/1717383528022TxA4c_JPEG/6S5A6785.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240909_284/1725865224424ux2W4_JPEG/6S5A9299-%C6%ED%C1%FD.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20241129_87/1732858513628bWPt7_JPEG/6S5A9837-%C6%ED%C1%FD.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20241202_50/1733105457578cGfYD_JPEG/6S5A9807-%C6%ED%C1%FD.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240603_100/1717383527950q4yNf_JPEG/6S5A7056.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240603_221/1717383527791s4ziP_JPEG/6S5A6673.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20241202_134/17331166295182o4vs_JPEG/47%C6%F2_%2829%29.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20241202_249/17331060371685uFQi_JPEG/3-1_%281%29.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240909_238/1725865224397wnWE5_JPEG/DJI_0157.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20231206_34/1701833355386Nsg5j_JPEG/6S5A9995.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20241202_293/1733105206236d8l2f_JPEG/8-1.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20241202_224/1733105239528RLN59_JPEG/3-1-min.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20241202_31/1733116629874BYgpO_JPEG/47%C6%F2_%2823%29.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20241205_106/1733360083918ER1RI_JPEG/KakaoTalk_20241203_155353799_27.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20241129_126/17328584834200qVDw_JPEG/6S5A0645.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240909_35/1725865128231ar2eM_PNG/KakaoTalk_20240710_163045662.png",
|
||||
"https://ldb-phinf.pstatic.net/20241202_153/1733105180908PyVIC_JPEG/KakaoTalk_20231027_143438563_25-min.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20241129_128/1732858517984PFmrJ_JPEG/KakaoTalk_20241119_105023750.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20231207_124/1701910720268qeACJ_JPEG/%B9%D9%BA%A3%C5%A5.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20241202_55/173310545746333mf8_JPEG/6S5A9837-%C6%ED%C1%FD.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20241202_11/1733106430749ovoeY_JPEG/37%C6%F2_%2820%29.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20231207_185/1701910772479mexsh_JPEG/a_%28282%29.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240118_211/17055625561294XsN2_JPEG/6S5A1803-%C6%ED%C1%FD.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240118_156/17055625560847R7SL_JPEG/6S5A0934-%C6%ED%C1%FD.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20231207_179/17019107724184CCEU_JPEG/6S5A9906.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20231207_287/1701910772339cG7K0_JPEG/a_%28119%29.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20231207_40/1701910675360dvC1i_JPEG/%C8%AD%C0%E5%BD%C7_%281%29.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20231207_263/1701910675262pevKk_JPEG/%C8%AD%C0%E5%BD%C7_%284%29.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20231207_73/1701910651864xPI48_JPEG/%BB%E7%B6%F7_%BC%A4%C7%AA.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20231207_265/17019204486629hzae_JPEG/6S5A0645.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20241202_147/1733103809000xsMrG_JPEG/KakaoTalk_20241015_154532027_01.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20241202_77/1733103809037HSO4S_JPEG/KakaoTalk_20241015_154532027_02.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20241202_233/1733103809020IMEdL_JPEG/KakaoTalk_20241015_154532027_06.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20241202_53/1733103808802Wui9x_JPEG/KakaoTalk_20241015_154532027_04.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20241202_230/1733103808998dOq0b_JPEG/KakaoTalk_20241015_154532027_15.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20241202_122/1733103808509lOt9x_JPEG/KakaoTalk_20241015_154536888_13.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20241202_246/1733103809045RdnEP_JPEG/KakaoTalk_20241015_154536888_11.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20241202_287/1733103808656oB1xz_JPEG/KakaoTalk_20241015_154536888_06.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20241202_222/1733103808508hkf5K_JPEG/KakaoTalk_20241015_154536888_08.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20241202_229/1733103808818KGAps_JPEG/KakaoTalk_20241015_154536888_02.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20241202_12/1733103808751cVAsT_JPEG/KakaoTalk_20241015_154536888_03.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240909_261/1725865224473Uo7V9_JPEG/6S5A9371-%C6%ED%C1%FD-%C6%ED%C1%FD-2.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240909_22/1725865224495AL798_JPEG/6S5A9557-%C6%ED%C1%FD.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240909_177/1725865224462eX1Pi_JPEG/DJI_0149-%C6%ED%C1%FD.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240909_165/1725865224480S7c1j_JPEG/6S5A9468-%C6%ED%C1%FD.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240909_85/1725865224421CNRrk_JPEG/DJI_0155.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240909_62/1725865224361fP2d2_JPEG/6S5A9434.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240909_155/1725865224363Xxt8y_JPEG/6S5A9431-%C6%ED%C1%FD.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240909_13/1725865224457BGLGs_JPEG/6S5A9456.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240603_162/1717383527882Vnrsk_JPEG/6S5A6786.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240603_256/1717383527892WXOKA_JPEG/6S5A6896.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240603_130/1717383527800oHSKA_JPEG/6S5A6904.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240603_118/17173835277794IXlt_JPEG/6S5A6946.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240603_257/1717383527822ITvHM_JPEG/6S5A6973.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240603_170/1717383527880sTdFE_JPEG/DJI_0039-%C6%ED%C1%FD.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240603_10/1717383527863CVLJ2_JPEG/DJI_0087-%C6%ED%C1%FD.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240603_94/1717383527921sDeDB_JPEG/DJI_0091-%C6%ED%C1%FD.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20231206_81/1701833426718D5Qwk_JPEG/b_%28119%29-%C6%ED%C1%FD.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240118_153/17055625561274LAs5_JPEG/6S5A1460-%C6%ED%C1%FD.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240118_8/1705562556139zGkjb_JPEG/6S5A1780.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240118_57/1705562556129IR40O_JPEG/6S5A1199.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240118_260/1705562556111cA7PG_JPEG/6S5A1927-%C6%ED%C1%FD.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20231207_183/1701910720221oI66j_JPEG/%B9%D9%BA%A3%C5%A52.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20231207_247/1701910720113MBgKD_JPEG/%B9%D9%BA%A3%C5%A5_%282%29.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20231207_227/1701910720098FE7Si_JPEG/6S5A0001.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20231206_24/1701833408064fgoVj_JPEG/b_%2874%29.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240603_100/1717383527883LWVq4_JPEG/6S5A6022-%C6%ED%C1%FD.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240603_169/17173835278856AEUV_JPEG/6S5A5974-%C6%ED%C1%FD.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240603_155/1717383527937gxiyc_JPEG/6S5A5988.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20231206_160/170183333003287LrV_JPEG/6S5A0243-%C6%ED%C1%FD.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240603_217/1717383528190t41X5_JPEG/6S5A6027.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240603_142/1717383527892jHtgI_JPEG/6S5A6643.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240603_251/1717383527948jTN2a_JPEG/6S5A6125.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240603_189/1717383527880wu4Bv_JPEG/6S5A6326.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240603_14/1717383527794qCuuu_JPEG/6S5A6337.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240603_220/1717383528017rKdOw_JPEG/6S5A6773.jpg"
|
||||
],
|
||||
"image_count": 119,
|
||||
"m_id": 1,
|
||||
"processed_info": {
|
||||
"customer_name": "풀스테이 스테이펫 홍천",
|
||||
"region": "",
|
||||
"detail_region_info": "강원 홍천군 화촌면 답연밭길 5-2 스테이펫 홍천"
|
||||
},
|
||||
"marketing_analysis": {
|
||||
"brand_identity": {
|
||||
"location_feature_analysis": "강원 홍천 화촌면의 자연 친화적 입지는 도심 소음에서 벗어난 ‘조용한 숲세권’ 체류 니즈에 최적이며, 수도권에서 주말 이동이 가능한 거리감으로 숏브레이크 수요를 흡수하기 유리합니다.",
|
||||
"concept_scalability": "‘스테이펫’ 콘셉트는 반려동물 동반 숙박을 넘어 펫 어메니티·펫 포토·펫 웰니스(산책 코스/케어 서비스)까지 확장 가능해, 체류 전 과정의 경험 가치를 패키지화하기 좋습니다."
|
||||
},
|
||||
"market_positioning": {
|
||||
"category_definition": "자연 속 프라이빗 애견 동반 힐링 스테이",
|
||||
"core_value": "반려동물과 ‘눈치 없이’ 온전히 쉬는 프라이빗한 쉼"
|
||||
},
|
||||
"target_persona": [
|
||||
{
|
||||
"persona": "주말 펫캉스 커플(반려견 1마리) – 조용한 자연에서 둘+한 마리의 리셋 여행을 찾는 2030",
|
||||
"age": {
|
||||
"min_age": 27,
|
||||
"max_age": 39
|
||||
},
|
||||
"favor_target": [
|
||||
"반려견 동반 가능 숙소",
|
||||
"자연 뷰/산책하기 좋은 동선",
|
||||
"청결한 침구와 탈취 관리",
|
||||
"프라이빗한 공간 구성",
|
||||
"감성 사진이 잘 나오는 무드"
|
||||
],
|
||||
"decision_trigger": "반려견 동반 + 프라이빗하게 쉴 수 있다는 확신(후기/시설 안내)"
|
||||
},
|
||||
{
|
||||
"persona": "도심 탈출 1인/2인 힐링러 – 조용한 곳에서 휴식·독서를 즐기며 재충전하는 직장인",
|
||||
"age": {
|
||||
"min_age": 29,
|
||||
"max_age": 45
|
||||
},
|
||||
"favor_target": [
|
||||
"소음 적은 입지",
|
||||
"자연 속 뷰",
|
||||
"편안한 침대/휴식형 라운지",
|
||||
"야간 감성 조명",
|
||||
"체크인/이용 동선의 간편함"
|
||||
],
|
||||
"decision_trigger": "‘조용함’과 ‘자연 몰입’이 보장되는 입지/분위기"
|
||||
},
|
||||
{
|
||||
"persona": "가족형 펫오너 – 반려견과 함께 안전하고 편하게 머물며 추억을 만드는 3040",
|
||||
"age": {
|
||||
"min_age": 33,
|
||||
"max_age": 49
|
||||
},
|
||||
"favor_target": [
|
||||
"반려견 안전 동선(미끄럼/울타리 등)",
|
||||
"넓은 휴식 공간",
|
||||
"바베큐 등 가족형 액티비티",
|
||||
"주차/이동 편의",
|
||||
"위생/청결 신뢰"
|
||||
],
|
||||
"decision_trigger": "가족 단위도 불편 없는 공간감 + 펫 프렌들리 정책"
|
||||
}
|
||||
],
|
||||
"selling_points": [
|
||||
{
|
||||
"english_category": "PET FRIENDLY",
|
||||
"korean_category": "애견 동반",
|
||||
"description": "반려견과 함께하는 완전한 휴식",
|
||||
"score": 95
|
||||
},
|
||||
{
|
||||
"english_category": "HEALING",
|
||||
"korean_category": "힐링 요소",
|
||||
"description": "홍천 자연 속 리셋 스테이",
|
||||
"score": 90
|
||||
},
|
||||
{
|
||||
"english_category": "PRIVACY",
|
||||
"korean_category": "프라이버시",
|
||||
"description": "눈치 없이 즐기는 프라이빗 쉼",
|
||||
"score": 88
|
||||
},
|
||||
{
|
||||
"english_category": "SHORT GETAWAY",
|
||||
"korean_category": "숏브레이크",
|
||||
"description": "주말에 딱, 가볍게 떠나는 홍천",
|
||||
"score": 82
|
||||
},
|
||||
{
|
||||
"english_category": "NIGHT MOOD",
|
||||
"korean_category": "야간 감성",
|
||||
"description": "밤이 더 예쁜 감성 무드",
|
||||
"score": 78
|
||||
},
|
||||
{
|
||||
"english_category": "BBQ PARTY",
|
||||
"korean_category": "바베큐",
|
||||
"description": "자연을 곁들인 바베큐 한 판",
|
||||
"score": 75
|
||||
},
|
||||
{
|
||||
"english_category": "PHOTO SPOT",
|
||||
"korean_category": "포토 스팟",
|
||||
"description": "반려견 인생샷 남기는 공간",
|
||||
"score": 73
|
||||
}
|
||||
],
|
||||
"target_keywords": [
|
||||
"홍천애견동반숙소",
|
||||
"강원도애견동반펜션",
|
||||
"스테이펫",
|
||||
"펫캉스",
|
||||
"반려견동반여행",
|
||||
"홍천감성숙소",
|
||||
"강원도힐링스테이",
|
||||
"숲뷰숙소",
|
||||
"주말여행추천",
|
||||
"프라이빗스테이"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,244 +0,0 @@
|
||||
{
|
||||
"status": "completed",
|
||||
"image_list": [
|
||||
"https://ldb-phinf.pstatic.net/20260112_189/1768176025117RmItD_PNG/ChatGPT_Image_2026%B3%E2_1%BF%F9_9%C0%CF_%BF%C0%C8%C4_03_21_56.png",
|
||||
"https://ldb-phinf.pstatic.net/20251215_290/1765776039787CALYj_JPEG/IMG_0060.JPG",
|
||||
"https://ldb-phinf.pstatic.net/20251215_70/1765776016674Nbo0Q_JPEG/IMG_0067_%BA%B9%BB%E7.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20251215_136/17657760168457kDf6_JPEG/KakaoTalk_20251214_181208552_03_%BA%B9%BB%E7.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20251215_38/1765776039760cYgOj_JPEG/IMG_0044.JPG",
|
||||
"https://ldb-phinf.pstatic.net/20251128_248/1764320049551B1gHl_JPEG/KakaoTalk_20251128_174635084_27.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20251128_209/1764320105053L8V2f_JPEG/KakaoTalk_20251128_174635084_17.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20241205_181/1733360083850LsEVv_JPEG/KakaoTalk_20241203_155353799_09.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20251128_209/1764320017959Rh3vs_JPEG/KakaoTalk_20251128_174635084_13.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20251128_102/1764320169035vluJN_JPEG/KakaoTalk_20251128_174635084_12.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20241129_249/17328584834569zWJT_JPEG/6S5A0642-%C6%ED%C1%FD.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20241129_196/1732858501391FjLpd_JPEG/6S5A0657.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20241202_230/1733105198846QGbcW_JPEG/8.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20241202_94/1733105214373Q8ncR_JPEG/%B5%BF%B1%D7%B6%F3%B9%CC_%C3%A2%B9%AE_%B9%E6%B0%A1%C0%BB_2.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20231207_110/1701910802632rDM5r_JPEG/a_%28301%29-%C6%ED%C1%FD.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20241202_7/1733106037765MNR8e_JPEG/9-1.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240118_42/17055625561156LIx7_JPEG/6S5A0809-%C6%ED%C1%FD.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240118_246/1705562556109bihHB_JPEG/6S5A1820-%C6%ED%C1%FD.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20241202_259/1733104881690lDgnH_JPEG/3-2.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20231207_76/1701910651888PpVap_JPEG/%C6%EA%B5%E5%B6%F3%C0%CC%B7%EB.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20231207_242/1701910651863IAAlE_JPEG/%B0%AD%BE%C6%C1%F6_%BA%F1%C7%B0.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20241202_120/17331038087267aQ0S_JPEG/KakaoTalk_20241015_154536888_04.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20250710_164/17521338301365LRwl_JPEG/6S5A6748-%C6%ED%C1%FD.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20250710_169/1752133830016fqFlL_JPEG/6S5A6760-%C6%ED%C1%FD.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20231207_80/1701920469022ef7TW_JPEG/6S5A0614-%C6%ED%C1%FD.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240603_140/17173835278369nntD_JPEG/6S5A6707.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20250710_173/1752133829861tPALd_JPEG/6S5A7136.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20241202_248/1733106037776BGjJx_JPEG/1-1.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240603_275/1717383527874oJOpz_JPEG/DJI_0040-%C6%ED%C1%FD.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20250710_153/1752133811173ba7oE_JPEG/6S5A6458.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20250710_185/1752133829868FyD76_JPEG/6S5A6815.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20250710_220/1752133829963w1aee_JPEG/6S5A6856.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20250710_228/1752133830002U65jg_JPEG/6S5A6864.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20250710_178/1752133829793fQQ2E_JPEG/6S5A7016-%C6%ED%C1%FD.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20250710_279/1752133829838lTSC9_JPEG/6S5A7034-%C6%ED%C1%FD.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20250710_179/1752133811452tOl7F_JPEG/6S5A6363.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20250710_75/1752133811152vd5ts_JPEG/6S5A6513.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20250710_147/1752133810693TfR5M_JPEG/6S5A6556.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20250710_202/1752133811177NRBDn_JPEG/6S5A6619-2.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20250710_196/1752133811066ufvpA_JPEG/6S5A6657.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20250710_280/1752133811307QCs3n_JPEG/6S5A6709.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240603_85/1717383527884ST2DF_JPEG/6S5A6540.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240603_249/1717383528285Om6dI_JPEG/6S5A6648.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240603_288/1717383528022TxA4c_JPEG/6S5A6785.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240909_284/1725865224424ux2W4_JPEG/6S5A9299-%C6%ED%C1%FD.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20241129_87/1732858513628bWPt7_JPEG/6S5A9837-%C6%ED%C1%FD.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20241202_50/1733105457578cGfYD_JPEG/6S5A9807-%C6%ED%C1%FD.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240603_100/1717383527950q4yNf_JPEG/6S5A7056.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240603_221/1717383527791s4ziP_JPEG/6S5A6673.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20241202_134/17331166295182o4vs_JPEG/47%C6%F2_%2829%29.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20241202_249/17331060371685uFQi_JPEG/3-1_%281%29.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240909_238/1725865224397wnWE5_JPEG/DJI_0157.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20231206_34/1701833355386Nsg5j_JPEG/6S5A9995.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20241202_293/1733105206236d8l2f_JPEG/8-1.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20241202_224/1733105239528RLN59_JPEG/3-1-min.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20241202_31/1733116629874BYgpO_JPEG/47%C6%F2_%2823%29.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20241205_106/1733360083918ER1RI_JPEG/KakaoTalk_20241203_155353799_27.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20241129_126/17328584834200qVDw_JPEG/6S5A0645.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240909_35/1725865128231ar2eM_PNG/KakaoTalk_20240710_163045662.png",
|
||||
"https://ldb-phinf.pstatic.net/20241202_153/1733105180908PyVIC_JPEG/KakaoTalk_20231027_143438563_25-min.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20241129_128/1732858517984PFmrJ_JPEG/KakaoTalk_20241119_105023750.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20231207_124/1701910720268qeACJ_JPEG/%B9%D9%BA%A3%C5%A7.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20241202_55/173310545746333mf8_JPEG/6S5A9837-%C6%ED%C1%FD.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20241202_11/1733106430749ovoeY_JPEG/37%C6%F2_%2820%29.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20231207_185/1701910772479mexsh_JPEG/a_%28282%29.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240118_211/17055625561294XsN2_JPEG/6S5A1803-%C6%ED%C1%FD.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240118_156/17055625560847R7SL_JPEG/6S5A0934-%C6%ED%C1%FD.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20231207_179/17019107724184CCEU_JPEG/6S5A9906.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20231207_287/1701910772339cG7K0_JPEG/a_%28119%29.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20231207_40/1701910675360dvC1i_JPEG/%C8%AD%C0%E5%BD%C7_%281%29.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20231207_263/1701910675262pevKk_JPEG/%C8%AD%C0%E5%BD%C7_%284%29.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20231207_73/1701910651864xPI48_JPEG/%BB%E7%B6%F7_%BC%A4%C7%AA.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20231207_265/17019204486629hzae_JPEG/6S5A0645.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20241202_147/1733103809000xsMrG_JPEG/KakaoTalk_20241015_154532027_01.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20241202_77/1733103809037HSO4S_JPEG/KakaoTalk_20241015_154532027_02.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20241202_233/1733103809020IMEdL_JPEG/KakaoTalk_20241015_154532027_06.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20241202_53/1733103808802Wui9x_JPEG/KakaoTalk_20241015_154532027_04.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20241202_230/1733103808998dOq0b_JPEG/KakaoTalk_20241015_154532027_15.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20241202_122/1733103808509lOt9x_JPEG/KakaoTalk_20241015_154536888_13.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20241202_246/1733103809045RdnEP_JPEG/KakaoTalk_20241015_154536888_11.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20241202_287/1733103808656oB1xz_JPEG/KakaoTalk_20241015_154536888_06.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20241202_222/1733103808508hkf5K_JPEG/KakaoTalk_20241015_154536888_08.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20241202_229/1733103808818KGAps_JPEG/KakaoTalk_20241015_154536888_02.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20241202_12/1733103808751cVAsT_JPEG/KakaoTalk_20241015_154536888_03.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240909_261/1725865224473Uo7V9_JPEG/6S5A9371-%C6%ED%C1%FD-%C6%ED%C1%FD-2.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240909_22/1725865224495AL798_JPEG/6S5A9557-%C6%ED%C1%FD.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240909_177/1725865224462eX1Pi_JPEG/DJI_0149-%C6%ED%C1%FD.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240909_165/1725865224480S7c1j_JPEG/6S5A9468-%C6%ED%C1%FD.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240909_85/1725865224421CNRrk_JPEG/DJI_0155.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240909_62/1725865224361fP2d2_JPEG/6S5A9434.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240909_155/1725865224363Xxt8y_JPEG/6S5A9431-%C6%ED%C1%FD.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240909_13/1725865224457BGLGs_JPEG/6S5A9456.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240603_162/1717383527882Vnrsk_JPEG/6S5A6786.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240603_256/1717383527892WXOKA_JPEG/6S5A6896.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240603_130/1717383527800oHSKA_JPEG/6S5A6904.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240603_118/17173835277794IXlt_JPEG/6S5A6946.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240603_257/1717383527822ITvHM_JPEG/6S5A6973.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240603_170/1717383527880sTdFE_JPEG/DJI_0039-%C6%ED%C1%FD.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240603_10/1717383527863CVLJ2_JPEG/DJI_0087-%C6%ED%C1%FD.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240603_94/1717383527921sDeDB_JPEG/DJI_0091-%C6%ED%C1%FD.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20231206_81/1701833426718D5Qwk_JPEG/b_%28119%29-%C6%ED%C1%FD.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240118_153/17055625561274LAs5_JPEG/6S5A1460-%C6%ED%C1%FD.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240118_8/1705562556139zGkjb_JPEG/6S5A1780.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240118_57/1705562556129IR40O_JPEG/6S5A1199.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240118_260/1705562556111cA7PG_JPEG/6S5A1927-%C6%ED%C1%FD.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20231207_183/1701910720221oI66j_JPEG/%B9%D9%BA%A3%C5%A52.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20231207_247/1701910720113MBgKD_JPEG/%B9%D9%BA%A3%C5%A5_%282%29.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20231207_227/1701910720098FE7Si_JPEG/6S5A0001.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20231206_24/1701833408064fgoVj_JPEG/b_%2874%29.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240603_100/1717383527883LWVq4_JPEG/6S5A6022-%C6%ED%C1%FD.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240603_169/17173835278856AEUV_JPEG/6S5A5974-%C6%ED%C1%FD.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240603_155/1717383527937gxiyc_JPEG/6S5A5988.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20231206_160/170183333003287LrV_JPEG/6S5A0243-%C6%ED%C1%FD.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240603_217/1717383528190t41X5_JPEG/6S5A6027.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240603_142/1717383527892jHtgI_JPEG/6S5A6643.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240603_251/1717383527948jTN2a_JPEG/6S5A6125.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240603_189/1717383527880wu4Bv_JPEG/6S5A6326.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240603_14/1717383527794qCuuu_JPEG/6S5A6337.jpg",
|
||||
"https://ldb-phinf.pstatic.net/20240603_220/1717383528017rKdOw_JPEG/6S5A6773.jpg"
|
||||
],
|
||||
"image_count": 119,
|
||||
"m_id": 1,
|
||||
"processed_info": {
|
||||
"customer_name": "Fullstay StayPet Hongcheon",
|
||||
"region": "",
|
||||
"detail_region_info": "5-2 Dapyeonbat-gil, Hwachon-myeon, Hongcheon-gun, Gangwon-do, Korea"
|
||||
},
|
||||
"marketing_analysis": {
|
||||
"brand_identity": {
|
||||
"location_feature_analysis": "Located in the nature-rich Hwachon-myeon area of Hongcheon, Gangwon-do, this property offers the ideal setting for a 'quiet forest retreat' away from urban noise. Its proximity to the Seoul metropolitan area makes it perfect for weekend short-break getaways.",
|
||||
"concept_scalability": "The 'StayPet' concept extends beyond simple pet-friendly accommodation to include pet amenities, pet photo zones, and pet wellness experiences (walking trails/care services), enabling a comprehensive packaged experience throughout the entire stay."
|
||||
},
|
||||
"market_positioning": {
|
||||
"category_definition": "Private Pet-Friendly Healing Stay in Nature",
|
||||
"core_value": "A private retreat where you and your pet can relax without worry"
|
||||
},
|
||||
"target_persona": [
|
||||
{
|
||||
"persona": "Weekend Pet-cation Couples (with 1 dog) – Millennials seeking a reset trip for two + one furry friend in peaceful nature",
|
||||
"age": {
|
||||
"min_age": 27,
|
||||
"max_age": 39
|
||||
},
|
||||
"favor_target": [
|
||||
"Pet-friendly accommodation",
|
||||
"Nature views / great walking trails",
|
||||
"Clean bedding and odor management",
|
||||
"Private space configuration",
|
||||
"Aesthetic mood for great photos"
|
||||
],
|
||||
"decision_trigger": "Confidence in pet-friendly + private relaxation (verified through reviews and facility info)"
|
||||
},
|
||||
{
|
||||
"persona": "Urban Escape Solo/Duo Healers – Working professionals recharging with quiet rest and reading in nature",
|
||||
"age": {
|
||||
"min_age": 29,
|
||||
"max_age": 45
|
||||
},
|
||||
"favor_target": [
|
||||
"Low-noise location",
|
||||
"Nature views",
|
||||
"Comfortable beds / relaxation lounge",
|
||||
"Ambient night lighting",
|
||||
"Simple check-in / easy access"
|
||||
],
|
||||
"decision_trigger": "Guaranteed 'quietness' and 'nature immersion' through location and atmosphere"
|
||||
},
|
||||
{
|
||||
"persona": "Family Pet Owners – Families in their 30s-40s creating memories with their pets in a safe, comfortable stay",
|
||||
"age": {
|
||||
"min_age": 33,
|
||||
"max_age": 49
|
||||
},
|
||||
"favor_target": [
|
||||
"Pet safety features (non-slip floors / fencing)",
|
||||
"Spacious relaxation areas",
|
||||
"Family activities like BBQ",
|
||||
"Parking / travel convenience",
|
||||
"Hygiene / cleanliness assurance"
|
||||
],
|
||||
"decision_trigger": "Spacious enough for families + reliable pet-friendly policies"
|
||||
}
|
||||
],
|
||||
"selling_points": [
|
||||
{
|
||||
"english_category": "PET FRIENDLY",
|
||||
"korean_category": "Pet-Friendly",
|
||||
"description": "A complete retreat with your beloved pet",
|
||||
"score": 95
|
||||
},
|
||||
{
|
||||
"english_category": "HEALING",
|
||||
"korean_category": "Healing",
|
||||
"description": "A reset stay in Hongcheon's natural surroundings",
|
||||
"score": 90
|
||||
},
|
||||
{
|
||||
"english_category": "PRIVACY",
|
||||
"korean_category": "Privacy",
|
||||
"description": "A private retreat — relax without a care",
|
||||
"score": 88
|
||||
},
|
||||
{
|
||||
"english_category": "SHORT GETAWAY",
|
||||
"korean_category": "Short Getaway",
|
||||
"description": "A quick weekend escape to Hongcheon",
|
||||
"score": 82
|
||||
},
|
||||
{
|
||||
"english_category": "NIGHT MOOD",
|
||||
"korean_category": "Night Mood",
|
||||
"description": "An aesthetic ambiance that shines at night",
|
||||
"score": 78
|
||||
},
|
||||
{
|
||||
"english_category": "BBQ PARTY",
|
||||
"korean_category": "BBQ Party",
|
||||
"description": "A BBQ feast surrounded by nature",
|
||||
"score": 75
|
||||
},
|
||||
{
|
||||
"english_category": "PHOTO SPOT",
|
||||
"korean_category": "Photo Spot",
|
||||
"description": "The perfect spot for unforgettable pet photos",
|
||||
"score": 73
|
||||
}
|
||||
],
|
||||
"target_keywords": [
|
||||
"Hongcheon pet-friendly stay",
|
||||
"Gangwon-do pet pension",
|
||||
"StayPet",
|
||||
"Pet-cation",
|
||||
"Travel with pets",
|
||||
"Hongcheon aesthetic stay",
|
||||
"Gangwon healing retreat",
|
||||
"Forest view accommodation",
|
||||
"Weekend trip recommendation",
|
||||
"Private stay"
|
||||
]
|
||||
}
|
||||
}
|
||||
+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크레딧으로 안내됩니다. 실제 생성 전 화면의 비용 안내를 확인하세요.
|
||||
- 삭제되었거나 공개 가능한 상태가 아닌 콘텐츠는 공유 링크로 열람할 수 없습니다.
|
||||
+1
-1
@@ -84,7 +84,7 @@
|
||||
<li><strong>회사명:</strong> ㈜에이아이오투오</li>
|
||||
<li><strong>서비스명:</strong> ADO2</li>
|
||||
<li><strong>이메일:</strong> <a href="mailto:o2oteam@o2o.kr">o2oteam@o2o.kr</a></li>
|
||||
<li><strong>웹사이트:</strong> https://demo.castad.net</li>
|
||||
<li><strong>웹사이트:</strong> https://ado2.o2osolution.ai</li>
|
||||
</ul>
|
||||
|
||||
<p style="margin-top:40px; font-size:14px; color:#999;">본 방침은 2026년 5월 7일부터 시행됩니다. 최종 수정일: 2026년 5월 27일</p>
|
||||
|
||||
@@ -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>
|
||||
+1
-1
@@ -58,7 +58,7 @@
|
||||
<li><strong>회사명:</strong> ㈜에이아이오투오</li>
|
||||
<li><strong>서비스명:</strong> ADO2</li>
|
||||
<li><strong>이메일:</strong> o2oteam@o2o.kr</li>
|
||||
<li><strong>웹사이트:</strong> https://demo.castad.net</li>
|
||||
<li><strong>웹사이트:</strong> https://ado2.o2osolution.ai</li>
|
||||
</ul>
|
||||
|
||||
<p style="margin-top:40px; font-size:14px; color:#999;">본 약관은 2026년 5월 7일부터 시행됩니다.</p>
|
||||
|
||||
Generated
-2907
File diff suppressed because it is too large.
Load diff
@@ -1,22 +0,0 @@
|
||||
{
|
||||
"name": "@ado2/higgsfield-remotion",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"description": "ADO2 Higgsfield Shorts — Remotion 자막·타이틀 오버레이 합성",
|
||||
"scripts": {
|
||||
"studio": "remotion studio",
|
||||
"render": "remotion render MumumShort out/mumum-poc2-final.mp4",
|
||||
"upgrade": "remotion upgrade"
|
||||
},
|
||||
"dependencies": {
|
||||
"@remotion/cli": "4.0.468",
|
||||
"@remotion/google-fonts": "4.0.468",
|
||||
"remotion": "4.0.468",
|
||||
"react": "19.2.0",
|
||||
"react-dom": "19.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/react": "19.2.0",
|
||||
"typescript": "5.7.3"
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@@ -1,6 +0,0 @@
|
||||
import { Config } from "@remotion/cli/config";
|
||||
|
||||
Config.setVideoImageFormat("jpeg");
|
||||
Config.setOverwriteOutput(true);
|
||||
// H.264 + AAC, 모바일 9:16 Shorts/Reels 호환
|
||||
Config.setCodec("h264");
|
||||
@@ -1,58 +0,0 @@
|
||||
import React from "react";
|
||||
import { AbsoluteFill, OffthreadVideo, Sequence, staticFile } from "remotion";
|
||||
import { ShortProps } from "./data/types";
|
||||
import { HookTitle } from "./components/HookTitle";
|
||||
import { BrandLines } from "./components/BrandLines";
|
||||
import { SellingBadge } from "./components/SellingBadge";
|
||||
import { EndCard } from "./components/EndCard";
|
||||
|
||||
// Higgsfield 완성본을 배경으로 깔고(오디오 포함), 자막/타이틀만 오버레이.
|
||||
// 모든 콘텐츠는 props로 주입 (펜션/제품마다 교체).
|
||||
export const MumumShort: React.FC<ShortProps> = ({
|
||||
videoSrc,
|
||||
hook,
|
||||
sellingPoint,
|
||||
brandLines,
|
||||
endCard,
|
||||
}) => {
|
||||
return (
|
||||
<AbsoluteFill style={{ backgroundColor: "black" }}>
|
||||
<OffthreadVideo
|
||||
src={staticFile(videoSrc)}
|
||||
style={{ width: "100%", height: "100%", objectFit: "cover" }}
|
||||
/>
|
||||
|
||||
{/* 상단 후킹 타이틀 */}
|
||||
<Sequence from={hook.fromFrame} durationInFrames={hook.toFrame - hook.fromFrame}>
|
||||
<HookTitle
|
||||
eyebrow={hook.eyebrow}
|
||||
title={hook.title}
|
||||
fromFrame={0}
|
||||
toFrame={hook.toFrame - hook.fromFrame}
|
||||
/>
|
||||
</Sequence>
|
||||
|
||||
{/* 셀링포인트: 3개 독립 박스 */}
|
||||
<SellingBadge
|
||||
items={sellingPoint.items}
|
||||
fromFrame={sellingPoint.fromFrame}
|
||||
toFrame={sellingPoint.toFrame}
|
||||
/>
|
||||
|
||||
{/* 브랜드 감성 2줄 (상단 중앙) */}
|
||||
<BrandLines
|
||||
lines={brandLines.lines}
|
||||
fromFrame={brandLines.fromFrame}
|
||||
toFrame={brandLines.toFrame}
|
||||
/>
|
||||
|
||||
{/* 엔드카드 + AI 디스클로저 */}
|
||||
<EndCard
|
||||
brand={endCard.brand}
|
||||
location={endCard.location}
|
||||
disclosure={endCard.disclosure}
|
||||
fromFrame={endCard.fromFrame}
|
||||
/>
|
||||
</AbsoluteFill>
|
||||
);
|
||||
};
|
||||
@@ -1,25 +0,0 @@
|
||||
import React from "react";
|
||||
import { Composition } from "remotion";
|
||||
import { MumumShort } from "./MumumShort";
|
||||
import { defaultProps } from "./data/mumum";
|
||||
|
||||
export const RemotionRoot: React.FC = () => {
|
||||
return (
|
||||
<Composition
|
||||
id="MumumShort"
|
||||
component={MumumShort}
|
||||
defaultProps={defaultProps}
|
||||
durationInFrames={defaultProps.durationInFrames}
|
||||
fps={defaultProps.fps}
|
||||
width={defaultProps.width}
|
||||
height={defaultProps.height}
|
||||
// props(영상 크기·길이)로 메타데이터 동적 설정 → 한 컴포지션이 모든 job 처리
|
||||
calculateMetadata={({ props }) => ({
|
||||
durationInFrames: props.durationInFrames,
|
||||
fps: props.fps,
|
||||
width: props.width,
|
||||
height: props.height,
|
||||
})}
|
||||
/>
|
||||
);
|
||||
};
|
||||
@@ -1,63 +0,0 @@
|
||||
import React from "react";
|
||||
import { useCurrentFrame, interpolate, AbsoluteFill } from "remotion";
|
||||
import { serifFont } from "../fonts";
|
||||
|
||||
// 브랜드 감성 2줄: 우상단 통일 위치에 한 덩어리로 쌓아 노출.
|
||||
// 첫 줄 먼저, 둘째 줄 살짝 뒤따라 등장 → 같은 자리에서 읽힘.
|
||||
export const BrandLines: React.FC<{
|
||||
lines: string[];
|
||||
fromFrame: number;
|
||||
toFrame: number;
|
||||
}> = ({ lines, fromFrame, toFrame }) => {
|
||||
const frame = useCurrentFrame();
|
||||
const LINE_STAGGER = 18; // 줄 간 등장 간격(frame)
|
||||
|
||||
return (
|
||||
<AbsoluteFill
|
||||
style={{
|
||||
justifyContent: "flex-start",
|
||||
alignItems: "center", // 가로 중앙 정렬
|
||||
flexDirection: "column",
|
||||
paddingTop: 230, // 상단 (~18%) 높이 유지
|
||||
gap: 8,
|
||||
}}
|
||||
>
|
||||
{lines.map((line, i) => {
|
||||
const start = fromFrame + i * LINE_STAGGER;
|
||||
// interpolate는 배열이 단조증가해야 한다.
|
||||
// 영상이 짧아 toFrame 이 start+24 이하로 내려오면 범위가 뒤집혀 크래시 발생.
|
||||
const fadeIn = start + 12;
|
||||
const fadeOut = Math.max(fadeIn + 1, toFrame - 12);
|
||||
const end = Math.max(fadeOut + 1, toFrame);
|
||||
const opacity = interpolate(
|
||||
frame,
|
||||
[start, fadeIn, fadeOut, end],
|
||||
[0, 1, 1, 0],
|
||||
{ extrapolateLeft: "clamp", extrapolateRight: "clamp" },
|
||||
);
|
||||
const rise = interpolate(frame, [start, start + 16], [16, 0], {
|
||||
extrapolateLeft: "clamp",
|
||||
extrapolateRight: "clamp",
|
||||
});
|
||||
return (
|
||||
<div
|
||||
key={i}
|
||||
style={{
|
||||
opacity,
|
||||
transform: `translateY(${rise}px)`,
|
||||
fontFamily: serifFont,
|
||||
fontWeight: 700,
|
||||
fontSize: 46,
|
||||
color: "#FFFFFF",
|
||||
textAlign: "center",
|
||||
letterSpacing: 1,
|
||||
textShadow: "0 2px 16px rgba(0,0,0,0.85)",
|
||||
}}
|
||||
>
|
||||
{line}
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</AbsoluteFill>
|
||||
);
|
||||
};
|
||||
@@ -1,91 +0,0 @@
|
||||
import React from "react";
|
||||
import {
|
||||
useCurrentFrame,
|
||||
useVideoConfig,
|
||||
interpolate,
|
||||
spring,
|
||||
AbsoluteFill,
|
||||
} from "remotion";
|
||||
import { serifFont } from "../fonts";
|
||||
|
||||
// 엔드카드: 브랜드 + 위치 + AI 디스클로저 (가드레일 필수)
|
||||
export const EndCard: React.FC<{
|
||||
brand: string;
|
||||
location: string;
|
||||
disclosure: string;
|
||||
fromFrame: number;
|
||||
}> = ({ brand, location, disclosure, fromFrame }) => {
|
||||
const frame = useCurrentFrame();
|
||||
const { fps } = useVideoConfig();
|
||||
|
||||
const appear = interpolate(frame, [fromFrame, fromFrame + 12], [0, 1], {
|
||||
extrapolateLeft: "clamp",
|
||||
extrapolateRight: "clamp",
|
||||
});
|
||||
const brandSpring = spring({
|
||||
frame: frame - fromFrame,
|
||||
fps,
|
||||
config: { damping: 200, mass: 0.5 },
|
||||
});
|
||||
const brandScale = interpolate(brandSpring, [0, 1], [0.92, 1]);
|
||||
|
||||
return (
|
||||
<AbsoluteFill
|
||||
style={{
|
||||
justifyContent: "center",
|
||||
alignItems: "center",
|
||||
// 하단을 살짝 어둡게 덮어 브랜드 가독성 확보
|
||||
background: `rgba(0,0,0,${0.42 * appear})`,
|
||||
opacity: appear,
|
||||
}}
|
||||
>
|
||||
<div
|
||||
style={{
|
||||
display: "flex",
|
||||
flexDirection: "column",
|
||||
alignItems: "center",
|
||||
transform: `scale(${brandScale})`,
|
||||
}}
|
||||
>
|
||||
<div
|
||||
style={{
|
||||
fontFamily: serifFont,
|
||||
fontWeight: 800,
|
||||
fontSize: 76,
|
||||
color: "#FFFFFF",
|
||||
letterSpacing: 1,
|
||||
textShadow: "0 3px 20px rgba(0,0,0,0.7)",
|
||||
}}
|
||||
>
|
||||
{brand}
|
||||
</div>
|
||||
<div
|
||||
style={{
|
||||
fontFamily: serifFont,
|
||||
fontWeight: 400,
|
||||
fontSize: 30,
|
||||
color: "#FFE9C7",
|
||||
marginTop: 18,
|
||||
letterSpacing: 2,
|
||||
}}
|
||||
>
|
||||
{location}
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
style={{
|
||||
position: "absolute",
|
||||
bottom: 70,
|
||||
fontFamily: serifFont,
|
||||
fontWeight: 400,
|
||||
fontSize: 19,
|
||||
color: "rgba(255,255,255,0.72)",
|
||||
textAlign: "center",
|
||||
padding: "0 40px",
|
||||
}}
|
||||
>
|
||||
{disclosure}
|
||||
</div>
|
||||
</AbsoluteFill>
|
||||
);
|
||||
};
|
||||
@@ -1,93 +0,0 @@
|
||||
import React from "react";
|
||||
import {
|
||||
useCurrentFrame,
|
||||
useVideoConfig,
|
||||
interpolate,
|
||||
spring,
|
||||
AbsoluteFill,
|
||||
} from "remotion";
|
||||
import { hookFont } from "../fonts";
|
||||
|
||||
export const HookTitle: React.FC<{
|
||||
eyebrow: string;
|
||||
title: string;
|
||||
fromFrame: number;
|
||||
toFrame: number;
|
||||
}> = ({ eyebrow, title, fromFrame, toFrame }) => {
|
||||
const frame = useCurrentFrame();
|
||||
const { fps } = useVideoConfig();
|
||||
|
||||
// 스프링 슬라이드-다운 등장
|
||||
const enter = spring({
|
||||
frame: frame - fromFrame,
|
||||
fps,
|
||||
config: { damping: 200, mass: 0.6 },
|
||||
});
|
||||
const translateY = interpolate(enter, [0, 1], [-60, 0]);
|
||||
// 퇴장 페이드
|
||||
const fadeIn = fromFrame + 8;
|
||||
const fadeOut = Math.max(fadeIn + 1, toFrame - 12);
|
||||
const end = Math.max(fadeOut + 1, toFrame);
|
||||
const opacity = interpolate(
|
||||
frame,
|
||||
[fromFrame, fadeIn, fadeOut, end],
|
||||
[0, 1, 1, 0],
|
||||
{ extrapolateLeft: "clamp", extrapolateRight: "clamp" },
|
||||
);
|
||||
|
||||
return (
|
||||
<AbsoluteFill style={{ opacity }}>
|
||||
{/* 상단 가독성 그라데이션 */}
|
||||
<div
|
||||
style={{
|
||||
position: "absolute",
|
||||
top: 0,
|
||||
left: 0,
|
||||
right: 0,
|
||||
height: 580,
|
||||
background:
|
||||
"linear-gradient(180deg, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0) 100%)",
|
||||
}}
|
||||
/>
|
||||
<div
|
||||
style={{
|
||||
position: "absolute",
|
||||
top: 280,
|
||||
left: 0,
|
||||
right: 0,
|
||||
transform: `translateY(${translateY}px)`,
|
||||
display: "flex",
|
||||
flexDirection: "column",
|
||||
alignItems: "center",
|
||||
padding: "0 48px",
|
||||
textAlign: "center",
|
||||
}}
|
||||
>
|
||||
<div
|
||||
style={{
|
||||
fontFamily: hookFont,
|
||||
fontSize: 34,
|
||||
color: "#FFE9C7",
|
||||
letterSpacing: 2,
|
||||
marginBottom: 14,
|
||||
textShadow: "0 2px 12px rgba(0,0,0,0.7)",
|
||||
}}
|
||||
>
|
||||
{eyebrow}
|
||||
</div>
|
||||
<div
|
||||
style={{
|
||||
fontFamily: hookFont,
|
||||
fontSize: 62,
|
||||
lineHeight: 1.18,
|
||||
color: "#FFFFFF",
|
||||
textShadow: "0 3px 18px rgba(0,0,0,0.85)",
|
||||
WebkitTextStroke: "1.5px rgba(0,0,0,0.35)",
|
||||
}}
|
||||
>
|
||||
{title}
|
||||
</div>
|
||||
</div>
|
||||
</AbsoluteFill>
|
||||
);
|
||||
};
|
||||
@@ -1,72 +0,0 @@
|
||||
import React from "react";
|
||||
import {
|
||||
useCurrentFrame,
|
||||
useVideoConfig,
|
||||
interpolate,
|
||||
spring,
|
||||
AbsoluteFill,
|
||||
} from "remotion";
|
||||
import { serifFont } from "../fonts";
|
||||
|
||||
// 셀링포인트: 3개 독립 pill 박스를 세로로 쌓고 순차 등장.
|
||||
// 컬러 지양 → 반투명 다크 pill + 흰색 텍스트. 앞 구간 단독 노출(시선 집중).
|
||||
export const SellingBadge: React.FC<{
|
||||
items: string[];
|
||||
fromFrame: number;
|
||||
toFrame: number;
|
||||
}> = ({ items, fromFrame, toFrame }) => {
|
||||
const frame = useCurrentFrame();
|
||||
const { fps } = useVideoConfig();
|
||||
const STAGGER = 9; // 박스 간 등장 간격(frame)
|
||||
|
||||
return (
|
||||
<AbsoluteFill
|
||||
style={{
|
||||
justifyContent: "flex-start",
|
||||
alignItems: "center",
|
||||
flexDirection: "column",
|
||||
paddingTop: 200, // 상단 배치 (~16%) — 이미지 가림 최소화
|
||||
gap: 18,
|
||||
}}
|
||||
>
|
||||
{items.map((item, i) => {
|
||||
const start = fromFrame + i * STAGGER;
|
||||
const enter = spring({
|
||||
frame: frame - start,
|
||||
fps,
|
||||
config: { damping: 200, mass: 0.5 },
|
||||
});
|
||||
const rise = interpolate(enter, [0, 1], [22, 0]);
|
||||
const fadeIn = start + 8;
|
||||
const fadeOut = Math.max(fadeIn + 1, toFrame - 10);
|
||||
const end = Math.max(fadeOut + 1, toFrame);
|
||||
const appear = interpolate(
|
||||
frame,
|
||||
[start, fadeIn, fadeOut, end],
|
||||
[0, 1, 1, 0],
|
||||
{ extrapolateLeft: "clamp", extrapolateRight: "clamp" },
|
||||
);
|
||||
return (
|
||||
<div
|
||||
key={i}
|
||||
style={{
|
||||
opacity: appear,
|
||||
transform: `translateY(${rise}px)`,
|
||||
fontFamily: serifFont,
|
||||
fontWeight: 700,
|
||||
fontSize: 38,
|
||||
color: "#FFFFFF",
|
||||
letterSpacing: 0.5,
|
||||
whiteSpace: "nowrap",
|
||||
// 배경 제거 → 블러리 소프트 쉐도우로 가독성 확보
|
||||
textShadow:
|
||||
"0 2px 22px rgba(0,0,0,0.95), 0 0 14px rgba(0,0,0,0.85), 0 0 40px rgba(0,0,0,0.6)",
|
||||
}}
|
||||
>
|
||||
{item}
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</AbsoluteFill>
|
||||
);
|
||||
};
|
||||
@@ -1,53 +0,0 @@
|
||||
import React from "react";
|
||||
import {
|
||||
useCurrentFrame,
|
||||
interpolate,
|
||||
AbsoluteFill,
|
||||
} from "remotion";
|
||||
import { serifFont } from "../fonts";
|
||||
|
||||
// 브랜드 자막: 페이드 + 미세 상승 (Profile A 모션 프리셋)
|
||||
export const Subtitle: React.FC<{
|
||||
text: string;
|
||||
fromFrame: number;
|
||||
toFrame: number;
|
||||
}> = ({ text, fromFrame, toFrame }) => {
|
||||
const frame = useCurrentFrame();
|
||||
|
||||
const opacity = interpolate(
|
||||
frame,
|
||||
[fromFrame, fromFrame + 10, toFrame - 10, toFrame],
|
||||
[0, 1, 1, 0],
|
||||
{ extrapolateLeft: "clamp", extrapolateRight: "clamp" },
|
||||
);
|
||||
const rise = interpolate(frame, [fromFrame, fromFrame + 18], [18, 0], {
|
||||
extrapolateLeft: "clamp",
|
||||
extrapolateRight: "clamp",
|
||||
});
|
||||
|
||||
return (
|
||||
<AbsoluteFill
|
||||
style={{
|
||||
justifyContent: "flex-end",
|
||||
alignItems: "center",
|
||||
paddingBottom: 220,
|
||||
opacity,
|
||||
}}
|
||||
>
|
||||
<div
|
||||
style={{
|
||||
fontFamily: serifFont,
|
||||
fontWeight: 700,
|
||||
fontSize: 50,
|
||||
color: "#FFFFFF",
|
||||
textAlign: "center",
|
||||
letterSpacing: 1,
|
||||
transform: `translateY(${rise}px)`,
|
||||
textShadow: "0 2px 16px rgba(0,0,0,0.8)",
|
||||
}}
|
||||
>
|
||||
{text}
|
||||
</div>
|
||||
</AbsoluteFill>
|
||||
);
|
||||
};
|
||||
@@ -1,35 +0,0 @@
|
||||
// Default props = the verified 머뭄 PoC #2 layout.
|
||||
// The Python render bridge overrides these per-job via --props.
|
||||
import { ShortProps } from "./types";
|
||||
|
||||
export const defaultProps: ShortProps = {
|
||||
videoSrc: "mumum_marketing_v1.mp4",
|
||||
fps: 30,
|
||||
width: 720,
|
||||
height: 1280,
|
||||
durationInFrames: 241, // ≈ 8.04s
|
||||
|
||||
hook: {
|
||||
eyebrow: "아무도 모르는 군산",
|
||||
title: "골목 안, 단 한 채의 독채 스테이 머뭄",
|
||||
fromFrame: 0,
|
||||
toFrame: 78,
|
||||
},
|
||||
sellingPoint: {
|
||||
items: ["프라이빗 독채펜션", "넓은 정원", "핵심 관광지 가까이"],
|
||||
fromFrame: 80,
|
||||
toFrame: 138,
|
||||
},
|
||||
brandLines: {
|
||||
lines: ["머무는 시간이", "다르게 흐르는 곳"],
|
||||
fromFrame: 138,
|
||||
toFrame: 196,
|
||||
},
|
||||
endCard: {
|
||||
brand: "Stay, 머뭄",
|
||||
location: "전북 군산시 절골길 18",
|
||||
disclosure: "실제 사진 기반, AI 카메라 효과를 적용한 영상입니다.",
|
||||
fromFrame: 192,
|
||||
toFrame: 241,
|
||||
},
|
||||
};
|
||||
@@ -1,19 +0,0 @@
|
||||
// Props contract — shared by Remotion composition and the Python render bridge.
|
||||
// Mirrors server/app/schemas.py VideoSpec (+ video config + timings).
|
||||
export type ShortProps = {
|
||||
videoSrc: string; // file in public/ (staticFile name)
|
||||
fps: number;
|
||||
width: number;
|
||||
height: number;
|
||||
durationInFrames: number;
|
||||
hook: { eyebrow: string; title: string; fromFrame: number; toFrame: number };
|
||||
sellingPoint: { items: string[]; fromFrame: number; toFrame: number };
|
||||
brandLines: { lines: string[]; fromFrame: number; toFrame: number };
|
||||
endCard: {
|
||||
brand: string;
|
||||
location: string;
|
||||
disclosure: string;
|
||||
fromFrame: number;
|
||||
toFrame: number;
|
||||
};
|
||||
};
|
||||
@@ -1,21 +0,0 @@
|
||||
// 한글 폰트 로딩 (@remotion/google-fonts, korean subset)
|
||||
// Hook = Black Han Sans (굵고 강렬한 바이럴 헤드라인)
|
||||
// Body/Brand = Nanum Myeongjo (우아한 명조 — 머뭄의 정적 브랜드 톤)
|
||||
//
|
||||
// 주의: korean subset 자체가 unicode-range 파일이 많아 요청 수가 많다.
|
||||
// weights 를 최소화(NanumMyeongjo는 400/700만 실제 존재)해 요청 수를 줄임.
|
||||
// latin 서브셋 제거 — 콘텐츠가 한국어 전용이므로 불필요.
|
||||
import { loadFont as loadHook } from "@remotion/google-fonts/BlackHanSans";
|
||||
import { loadFont as loadSerif } from "@remotion/google-fonts/NanumMyeongjo";
|
||||
|
||||
export const hookFont = loadHook("normal", {
|
||||
weights: ["400"],
|
||||
subsets: ["korean"],
|
||||
ignoreTooManyRequestsWarning: true,
|
||||
}).fontFamily;
|
||||
|
||||
export const serifFont = loadSerif("normal", {
|
||||
weights: ["400", "700"], // 800은 NanumMyeongjo에 없음 → 제거
|
||||
subsets: ["korean"],
|
||||
ignoreTooManyRequestsWarning: true,
|
||||
}).fontFamily;
|
||||
@@ -1,4 +0,0 @@
|
||||
import { registerRoot } from "remotion";
|
||||
import { RemotionRoot } from "./Root";
|
||||
|
||||
registerRoot(RemotionRoot);
|
||||
@@ -1,15 +0,0 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2020",
|
||||
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "Bundler",
|
||||
"jsx": "react-jsx",
|
||||
"strict": true,
|
||||
"esModuleInterop": true,
|
||||
"skipLibCheck": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"noEmit": true
|
||||
},
|
||||
"include": ["src"]
|
||||
}
|
||||
+50
-368
@@ -1,27 +1,17 @@
|
||||
|
||||
import React, { useRef, useState, useEffect } from 'react';
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import Header from './components/Header';
|
||||
import HeroSection from './pages/Landing/HeroSection';
|
||||
import WelcomeSection from './pages/Landing/WelcomeSection';
|
||||
import DisplaySection from './pages/Landing/DisplaySection';
|
||||
import LoadingSection from './pages/Analysis/LoadingSection';
|
||||
import AnalysisResultSection from './pages/Analysis/AnalysisResultSection';
|
||||
import LoginSection from './pages/Login/LoginSection';
|
||||
import GenerationFlow from './pages/Dashboard/GenerationFlow';
|
||||
import SocialConnectSuccess from './pages/Social/SocialConnectSuccess';
|
||||
import SocialConnectError from './pages/Social/SocialConnectError';
|
||||
import YouTubeOAuthCallback from './pages/Social/YouTubeOAuthCallback';
|
||||
import ADO2ContentsPage from './pages/Dashboard/ADO2ContentsPage';
|
||||
import VideoDetailPage from './components/VideoDetailPage';
|
||||
import { crawlUrl, autocomplete, marketingAnalysis, kakaoCallback, isLoggedIn, saveTokens, getVideosList, AutocompleteRequest } from './utils/api';
|
||||
import { saveSearchHistory } from './components/SearchHistory/useSearchHistory';
|
||||
import { CrawlingResponse } from './types/api';
|
||||
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';
|
||||
|
||||
type ViewMode = 'landing' | 'loading' | 'analysis' | 'login' | 'generation_flow';
|
||||
|
||||
const VIEW_MODE_KEY = 'castad_view_mode';
|
||||
const ANALYSIS_DATA_KEY = 'castad_analysis_data';
|
||||
const SESSION_KEY = 'castad_session_active';
|
||||
|
||||
// 새 탭/새 창에서 접근 시 localStorage 초기화 (sessionStorage로 현재 세션 확인)
|
||||
@@ -30,15 +20,7 @@ const initializeOnNewSession = () => {
|
||||
|
||||
if (!isExistingSession) {
|
||||
// 새 세션이면 localStorage 정리하고 세션 표시
|
||||
localStorage.removeItem(VIEW_MODE_KEY);
|
||||
localStorage.removeItem(ANALYSIS_DATA_KEY);
|
||||
localStorage.removeItem('castad_wizard_step');
|
||||
localStorage.removeItem('castad_active_item');
|
||||
localStorage.removeItem('castad_song_task_id');
|
||||
localStorage.removeItem('castad_image_task_id');
|
||||
localStorage.removeItem('castad_song_generation');
|
||||
localStorage.removeItem('castad_video_generation');
|
||||
localStorage.removeItem('castad_video_ratio');
|
||||
clearSessionStorage();
|
||||
sessionStorage.setItem(SESSION_KEY, 'true');
|
||||
}
|
||||
};
|
||||
@@ -47,82 +29,15 @@ const initializeOnNewSession = () => {
|
||||
initializeOnNewSession();
|
||||
|
||||
const App: React.FC = () => {
|
||||
const { t, i18n } = useTranslation();
|
||||
const containerRef = useRef<HTMLElement>(null);
|
||||
|
||||
// localStorage에서 저장된 상태 복원 (새 세션이면 이미 초기화됨)
|
||||
const savedViewMode = localStorage.getItem(VIEW_MODE_KEY) as ViewMode | null;
|
||||
const savedAnalysisData = localStorage.getItem(ANALYSIS_DATA_KEY);
|
||||
|
||||
// 저장된 분석 데이터 파싱 및 유효성 검사
|
||||
const parseSavedAnalysisData = (): CrawlingResponse | null => {
|
||||
if (!savedAnalysisData) return null;
|
||||
try {
|
||||
const data = JSON.parse(savedAnalysisData) as CrawlingResponse;
|
||||
// 기본값 보장
|
||||
if (data.marketing_analysis) {
|
||||
data.marketing_analysis.brand_identity = data.marketing_analysis.brand_identity || {
|
||||
location_feature_analysis: '',
|
||||
concept_scalability: ''
|
||||
};
|
||||
data.marketing_analysis.market_positioning = data.marketing_analysis.market_positioning || {
|
||||
category_definition: '',
|
||||
core_value: ''
|
||||
};
|
||||
data.marketing_analysis.target_persona = data.marketing_analysis.target_persona || [];
|
||||
data.marketing_analysis.selling_points = data.marketing_analysis.selling_points || [];
|
||||
data.marketing_analysis.target_keywords = data.marketing_analysis.target_keywords || [];
|
||||
}
|
||||
if (data.processed_info) {
|
||||
data.processed_info.customer_name = data.processed_info.customer_name || '알 수 없음';
|
||||
data.processed_info.region = data.processed_info.region || '';
|
||||
data.processed_info.detail_region_info = data.processed_info.detail_region_info || '';
|
||||
}
|
||||
data.image_list = data.image_list || [];
|
||||
return data;
|
||||
} catch {
|
||||
localStorage.removeItem(ANALYSIS_DATA_KEY);
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
// 초기 viewMode 결정: 로그인 상태면 바로 generation_flow로
|
||||
const getInitialViewMode = (): ViewMode => {
|
||||
if (savedViewMode === 'generation_flow') return 'generation_flow';
|
||||
if (isLoggedIn()) return 'generation_flow';
|
||||
return 'landing';
|
||||
};
|
||||
|
||||
const [viewMode, setViewMode] = useState<ViewMode>(getInitialViewMode());
|
||||
const [initialTab, setInitialTab] = useState('새 프로젝트 만들기');
|
||||
const [analysisData, setAnalysisData] = useState<CrawlingResponse | null>(
|
||||
parseSavedAnalysisData()
|
||||
);
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
const [isAnalysisComplete, setIsAnalysisComplete] = useState(false);
|
||||
const [afterLoadTarget, setAfterLoadTarget] = useState<ViewMode>('analysis');
|
||||
const [scrollProgress, setScrollProgress] = useState(0);
|
||||
const { t } = useTranslation();
|
||||
const [initialTab, setInitialTab] = useState<string>(NAV.HOME);
|
||||
const [isProcessingCallback, setIsProcessingCallback] = useState(false);
|
||||
const tutorialVideoCheckedRef = useRef(false);
|
||||
|
||||
// generation_flow 진입 시 영상 보유 여부 확인 → 있으면 튜토리얼 자동 off
|
||||
useEffect(() => {
|
||||
if (viewMode !== 'generation_flow') return;
|
||||
if (tutorialVideoCheckedRef.current) return;
|
||||
tutorialVideoCheckedRef.current = true;
|
||||
const ENABLED_KEY = 'ado2_tutorial_enabled';
|
||||
if (localStorage.getItem(ENABLED_KEY) !== null) return;
|
||||
getVideosList(1, 1).then(response => {
|
||||
const hasVideos = response.items.some(v => v.result_movie_url?.trim());
|
||||
if (hasVideos) {
|
||||
localStorage.setItem(ENABLED_KEY, 'false');
|
||||
window.dispatchEvent(new Event('ado2-tutorial-auto-disable'));
|
||||
}
|
||||
}).catch(() => {});
|
||||
}, [viewMode]);
|
||||
|
||||
// 카카오 로그인 콜백 처리 (URL에서 토큰 또는 code 파라미터 확인)
|
||||
useEffect(() => {
|
||||
// 광고 유입 UTM 파라미터 캡처 (콜백 처리로 URL이 정리되기 전에 최우선 실행)
|
||||
storeUtmFromUrl();
|
||||
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
const accessToken = urlParams.get('access_token');
|
||||
const refreshToken = urlParams.get('refresh_token');
|
||||
@@ -136,17 +51,21 @@ const App: React.FC = () => {
|
||||
// 백엔드에서 토큰을 URL 파라미터로 전달한 경우
|
||||
if (accessToken && refreshToken && !isProcessingCallback) {
|
||||
setIsProcessingCallback(true);
|
||||
handleTokenCallback(accessToken, refreshToken);
|
||||
handleTokenCallback(accessToken, refreshToken, urlParams.get('is_new_user') === 'true');
|
||||
}
|
||||
// 기존 code 방식 (Redirect URI가 프론트엔드인 경우) - Social OAuth는 제외
|
||||
else if (code && !isProcessingCallback && !isSocialOAuthCallback) {
|
||||
setIsProcessingCallback(true);
|
||||
handleKakaoCallback(code);
|
||||
}
|
||||
// 콜백이 아닌 일반 진입 — 광고 유입 추적
|
||||
else {
|
||||
trackViewContent();
|
||||
}
|
||||
}, []);
|
||||
|
||||
// 백엔드에서 토큰을 URL 파라미터로 전달받은 경우 처리
|
||||
const handleTokenCallback = (accessToken: string, refreshToken: string) => {
|
||||
const handleTokenCallback = async (accessToken: string, refreshToken: string, isNewUser: boolean = false) => {
|
||||
try {
|
||||
// 토큰 저장
|
||||
saveTokens(accessToken, refreshToken);
|
||||
@@ -155,23 +74,24 @@ const App: React.FC = () => {
|
||||
const url = new URL(window.location.href);
|
||||
url.searchParams.delete('access_token');
|
||||
url.searchParams.delete('refresh_token');
|
||||
url.searchParams.delete('is_new_user');
|
||||
window.history.replaceState({}, document.title, url.pathname);
|
||||
|
||||
const savedData = localStorage.getItem(ANALYSIS_DATA_KEY);
|
||||
if (savedData) {
|
||||
// 분석 데이터가 있으면 에셋 관리(step 1)부터 시작
|
||||
// 이전에 저장된 wizard step이 URL 입력(-2) 등으로 남아있을 수 있으므로 초기화
|
||||
localStorage.removeItem('castad_wizard_step');
|
||||
localStorage.removeItem('castad_active_item');
|
||||
// 신규 가입이면 Meta CompleteRegistration 전환 이벤트 발화
|
||||
// (서버가 계정당 최초 1회 판정 + UTM 저장, 실패해도 로그인 흐름에 영향 없음)
|
||||
if (isNewUser) {
|
||||
await trackCompleteRegistration();
|
||||
}
|
||||
|
||||
// 로그인 전 특정 화면(예: /video/{id})에서 유도된 로그인이면 그 경로로 복귀
|
||||
const redirectPath = sessionStorage.getItem('castad_login_redirect');
|
||||
sessionStorage.removeItem('castad_login_redirect');
|
||||
if (redirectPath && redirectPath !== '/') {
|
||||
window.location.href = redirectPath;
|
||||
return;
|
||||
}
|
||||
setInitialTab('새 프로젝트 만들기');
|
||||
setViewMode('generation_flow');
|
||||
// 그 외(사이드바 게이트 등)는 GenerationFlow 가 castad_login_next_item 으로 자체 복귀 처리
|
||||
setInitialTab(NAV.HOME);
|
||||
} catch (err) {
|
||||
console.error('Token callback failed:', err);
|
||||
alert(t('app.loginFailed'));
|
||||
@@ -184,6 +104,12 @@ const App: React.FC = () => {
|
||||
try {
|
||||
const response = await kakaoCallback(code);
|
||||
|
||||
// 신규 가입이면 Meta CompleteRegistration 전환 이벤트 발화
|
||||
// (페이지 이동 전에 완료해야 요청이 유실되지 않음)
|
||||
if (response.is_new_user) {
|
||||
await trackCompleteRegistration();
|
||||
}
|
||||
|
||||
// 로그인 성공 - 서버에서 받은 redirect_url로 이동
|
||||
window.location.href = response.redirect_url;
|
||||
} catch (err) {
|
||||
@@ -199,205 +125,6 @@ const App: React.FC = () => {
|
||||
}
|
||||
};
|
||||
|
||||
// viewMode 변경 시 localStorage에 저장
|
||||
useEffect(() => {
|
||||
localStorage.setItem(VIEW_MODE_KEY, viewMode);
|
||||
}, [viewMode]);
|
||||
|
||||
// 스크롤 이벤트 핸들러 - 첫 번째 섹션에서 두 번째 섹션으로 넘어갈 때 0~1 값 계산
|
||||
useEffect(() => {
|
||||
const container = containerRef.current;
|
||||
if (!container || viewMode !== 'landing') return;
|
||||
|
||||
const handleScroll = () => {
|
||||
const scrollTop = container.scrollTop;
|
||||
const sectionHeight = container.clientHeight;
|
||||
// 첫 번째 섹션 스크롤 진행률 (0 ~ 1)
|
||||
const progress = Math.min(1, Math.max(0, scrollTop / sectionHeight));
|
||||
setScrollProgress(progress);
|
||||
};
|
||||
|
||||
container.addEventListener('scroll', handleScroll);
|
||||
return () => container.removeEventListener('scroll', handleScroll);
|
||||
}, [viewMode]);
|
||||
|
||||
const scrollToSection = (index: number) => {
|
||||
if (containerRef.current) {
|
||||
const h = containerRef.current.clientHeight;
|
||||
containerRef.current.scrollTo({
|
||||
top: h * index,
|
||||
behavior: 'smooth'
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// 크롤링 응답 유효성 검사
|
||||
const validateCrawlingResponse = (data: CrawlingResponse): boolean => {
|
||||
// 필수 필드 존재 여부 확인
|
||||
if (!data) return false;
|
||||
if (!data.processed_info) return false;
|
||||
if (!data.marketing_analysis) return false;
|
||||
|
||||
// marketing_analysis 내부 필드 기본값 보장
|
||||
if (!data.marketing_analysis.brand_identity) {
|
||||
data.marketing_analysis.brand_identity = {
|
||||
location_feature_analysis: '',
|
||||
concept_scalability: ''
|
||||
};
|
||||
}
|
||||
if (!data.marketing_analysis.market_positioning) {
|
||||
data.marketing_analysis.market_positioning = {
|
||||
category_definition: '',
|
||||
core_value: ''
|
||||
};
|
||||
}
|
||||
if (!data.marketing_analysis.target_persona) {
|
||||
data.marketing_analysis.target_persona = [];
|
||||
}
|
||||
if (!data.marketing_analysis.selling_points) {
|
||||
data.marketing_analysis.selling_points = [];
|
||||
}
|
||||
if (!data.marketing_analysis.target_keywords) {
|
||||
data.marketing_analysis.target_keywords = [];
|
||||
}
|
||||
|
||||
// processed_info 내부 필드 기본값 보장
|
||||
if (!data.processed_info.customer_name) {
|
||||
data.processed_info.customer_name = '알 수 없음';
|
||||
}
|
||||
if (!data.processed_info.region) {
|
||||
data.processed_info.region = '';
|
||||
}
|
||||
if (!data.processed_info.detail_region_info) {
|
||||
data.processed_info.detail_region_info = '';
|
||||
}
|
||||
|
||||
// image_list 기본값 보장
|
||||
if (!data.image_list) {
|
||||
data.image_list = [];
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
const handleStartAnalysis = async (url: string) => {
|
||||
if (!url.trim()) return;
|
||||
|
||||
setAfterLoadTarget('analysis');
|
||||
setViewMode('loading');
|
||||
setIsAnalysisComplete(false);
|
||||
setError(null);
|
||||
|
||||
try {
|
||||
const data = await crawlUrl(url);
|
||||
|
||||
// 응답 유효성 검사
|
||||
if (!validateCrawlingResponse(data)) {
|
||||
throw new Error(t('app.invalidUrl'));
|
||||
}
|
||||
|
||||
setAnalysisData(data);
|
||||
localStorage.setItem(ANALYSIS_DATA_KEY, JSON.stringify(data));
|
||||
saveSearchHistory({ type: 'url', value: url });
|
||||
setIsAnalysisComplete(true);
|
||||
} catch (err) {
|
||||
console.error('Crawling failed:', err);
|
||||
setError(t('app.analysisError'));
|
||||
setViewMode('landing');
|
||||
}
|
||||
};
|
||||
|
||||
// 업체명 자동완성으로 분석 시작
|
||||
const handleAutocomplete = async (request: AutocompleteRequest) => {
|
||||
setAfterLoadTarget('analysis');
|
||||
setViewMode('loading');
|
||||
setIsAnalysisComplete(false);
|
||||
setError(null);
|
||||
|
||||
try {
|
||||
const data = await autocomplete(request);
|
||||
|
||||
// 응답 유효성 검사
|
||||
if (!validateCrawlingResponse(data)) {
|
||||
throw new Error(t('app.autocompleteError'));
|
||||
}
|
||||
|
||||
setAnalysisData(data);
|
||||
localStorage.setItem(ANALYSIS_DATA_KEY, JSON.stringify(data));
|
||||
saveSearchHistory({ type: 'name', value: request.title.replace(/<[^>]*>/g, ''), address: request.address, roadAddress: request.roadAddress });
|
||||
setIsAnalysisComplete(true);
|
||||
} catch (err) {
|
||||
console.error('Autocomplete failed:', err);
|
||||
setError(t('app.autocompleteError'));
|
||||
setViewMode('landing');
|
||||
}
|
||||
};
|
||||
|
||||
// 업체명·주소 수동 입력으로 마케팅 분석 API 호출
|
||||
const handleManualInput = async (businessName: string, address: string) => {
|
||||
setAfterLoadTarget('generation_flow');
|
||||
setViewMode('loading');
|
||||
setIsAnalysisComplete(false);
|
||||
setError(null);
|
||||
|
||||
try {
|
||||
const data = await marketingAnalysis(businessName, address);
|
||||
|
||||
if (!validateCrawlingResponse(data)) {
|
||||
throw new Error(t('app.autocompleteError'));
|
||||
}
|
||||
|
||||
setAnalysisData(data);
|
||||
localStorage.setItem(ANALYSIS_DATA_KEY, JSON.stringify(data));
|
||||
saveSearchHistory({ type: 'name', value: businessName, address, roadAddress: address });
|
||||
setIsAnalysisComplete(true);
|
||||
} catch (err) {
|
||||
console.error('Marketing analysis failed:', err);
|
||||
setError(t('app.autocompleteError'));
|
||||
setViewMode('landing');
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
const handleToLogin = async () => {
|
||||
// 이미 로그인된 상태면 바로 generation_flow로 이동
|
||||
if (isLoggedIn()) {
|
||||
// 분석 데이터가 있으면 이전 wizard step 초기화 (에셋 관리부터 시작하도록)
|
||||
const savedData = localStorage.getItem(ANALYSIS_DATA_KEY);
|
||||
if (savedData) {
|
||||
localStorage.removeItem('castad_wizard_step');
|
||||
localStorage.removeItem('castad_active_item');
|
||||
}
|
||||
setInitialTab('새 프로젝트 만들기');
|
||||
setViewMode('generation_flow');
|
||||
return;
|
||||
}
|
||||
|
||||
// 로그인 안 된 상태면 카카오 로그인 페이지로 리다이렉션
|
||||
try {
|
||||
const { getKakaoLoginUrl } = await import('./utils/api');
|
||||
const response = await getKakaoLoginUrl();
|
||||
window.location.href = response.auth_url;
|
||||
} catch (err) {
|
||||
console.error('Failed to get Kakao login URL:', err);
|
||||
alert(t('app.loginUrlFailed'));
|
||||
}
|
||||
};
|
||||
|
||||
const handleLoginSuccess = () => {
|
||||
setInitialTab('새 프로젝트 만들기');
|
||||
setViewMode('generation_flow');
|
||||
};
|
||||
|
||||
const handleGoBack = () => {
|
||||
// localStorage 정리
|
||||
localStorage.removeItem(VIEW_MODE_KEY);
|
||||
localStorage.removeItem(ANALYSIS_DATA_KEY);
|
||||
localStorage.removeItem('castad_wizard_step');
|
||||
localStorage.removeItem('castad_active_item');
|
||||
setViewMode('landing');
|
||||
};
|
||||
|
||||
// Social OAuth 콜백 페이지 처리
|
||||
const pathname = window.location.pathname;
|
||||
|
||||
@@ -420,6 +147,21 @@ const App: React.FC = () => {
|
||||
return <VideoDetailPage videoId={videoDetailMatch[1]} />;
|
||||
}
|
||||
|
||||
// 썰박스 공유 페이지 (/ssul/{id}) — 위와 동일한 패턴, 비로그인 열람 가능.
|
||||
// /video/{id} 와 경로를 나눈 이유: video.id 와 ssul_content.id 가 독립 시퀀스라
|
||||
// 값이 겹치므로, 한 경로로 합치면 다른 종류의 콘텐츠가 열린다.
|
||||
const ssulDetailMatch = pathname.match(/^\/ssul\/(\d+)$/);
|
||||
if (ssulDetailMatch) {
|
||||
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) {
|
||||
@@ -432,68 +174,8 @@ const App: React.FC = () => {
|
||||
);
|
||||
}
|
||||
|
||||
if (viewMode === 'loading') {
|
||||
return (
|
||||
<LoadingSection
|
||||
isComplete={isAnalysisComplete}
|
||||
onComplete={() => setViewMode(afterLoadTarget)}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
if (viewMode === 'analysis' && analysisData) {
|
||||
return (
|
||||
<AnalysisResultSection
|
||||
onBack={handleGoBack}
|
||||
onGenerate={handleToLogin}
|
||||
data={analysisData}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
if (viewMode === 'login') {
|
||||
return <LoginSection onBack={() => setViewMode('analysis')} onLogin={handleLoginSuccess} />;
|
||||
}
|
||||
|
||||
if (viewMode === 'generation_flow') {
|
||||
return (
|
||||
<GenerationFlow
|
||||
onHome={handleGoBack}
|
||||
initialActiveItem={initialTab}
|
||||
initialImageList={analysisData?.image_list || []}
|
||||
businessInfo={analysisData?.processed_info}
|
||||
initialAnalysisData={analysisData}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
// 로그인된 상태에서 "시작하기" 버튼 클릭
|
||||
const handleHeaderStart = () => {
|
||||
setInitialTab('새 프로젝트 만들기');
|
||||
setViewMode('generation_flow');
|
||||
};
|
||||
|
||||
return (
|
||||
<main className="landing-container" ref={containerRef}>
|
||||
<Header onStartClick={handleHeaderStart} />
|
||||
<section className="landing-section">
|
||||
<HeroSection
|
||||
onLogin={handleToLogin}
|
||||
onNext={() => scrollToSection(1)}
|
||||
scrollProgress={scrollProgress}
|
||||
/>
|
||||
</section>
|
||||
<section className="landing-section">
|
||||
<WelcomeSection
|
||||
onStartClick={() => scrollToSection(0)}
|
||||
onNext={() => scrollToSection(0)}
|
||||
/>
|
||||
</section>
|
||||
<section className="landing-section">
|
||||
<DisplaySection onStartClick={() => scrollToSection(0)} />
|
||||
</section>
|
||||
</main>
|
||||
);
|
||||
// 그 외 전 경로는 ADO2 콘텐츠 갤러리를 첫 화면으로 하는 GenerationFlow 로 수렴
|
||||
return <GenerationFlow initialActiveItem={initialTab} />;
|
||||
};
|
||||
|
||||
export default App;
|
||||
@@ -0,0 +1,67 @@
|
||||
import React, { useRef, useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { UserMeResponse } from '../types/api';
|
||||
import { NAV_ITEMS, SETTINGS_ID } from './navItems';
|
||||
import SettingsPanel from './SettingsPanel';
|
||||
|
||||
interface BottomNavProps {
|
||||
activeItem: string;
|
||||
onNavigate: (id: string) => void;
|
||||
userInfo?: UserMeResponse | null;
|
||||
onLogout?: () => void;
|
||||
credits?: number | null;
|
||||
isGuest: boolean;
|
||||
onLoginClick: () => void;
|
||||
}
|
||||
|
||||
const BottomNav: React.FC<BottomNavProps> = ({ activeItem, onNavigate, userInfo, onLogout, credits, isGuest, onLoginClick }) => {
|
||||
const { t } = useTranslation();
|
||||
const [settingsOpen, setSettingsOpen] = useState(false);
|
||||
const settingsAnchorRef = useRef<HTMLButtonElement>(null);
|
||||
|
||||
const handleItemClick = (id: string) => {
|
||||
if (id === SETTINGS_ID) {
|
||||
setSettingsOpen(v => !v);
|
||||
return;
|
||||
}
|
||||
onNavigate(id);
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
{settingsOpen && <div className="settings-backdrop" onClick={() => setSettingsOpen(false)} />}
|
||||
{settingsOpen && (
|
||||
<SettingsPanel
|
||||
variant="bottom"
|
||||
onClose={() => setSettingsOpen(false)}
|
||||
onNavigate={onNavigate}
|
||||
activeItem={activeItem}
|
||||
userInfo={userInfo}
|
||||
credits={credits}
|
||||
isGuest={isGuest}
|
||||
onLogout={onLogout}
|
||||
onLoginClick={onLoginClick}
|
||||
anchorRef={settingsAnchorRef}
|
||||
/>
|
||||
)}
|
||||
<nav className="bottom-nav">
|
||||
{NAV_ITEMS.map(item => {
|
||||
const isActive = item.id === SETTINGS_ID ? settingsOpen : activeItem === item.id;
|
||||
return (
|
||||
<button
|
||||
key={item.id}
|
||||
ref={item.id === SETTINGS_ID ? settingsAnchorRef : undefined}
|
||||
className={`bottom-nav-item ${isActive ? 'active' : ''}`}
|
||||
onClick={() => handleItemClick(item.id)}
|
||||
>
|
||||
{item.icon}
|
||||
<span>{t(item.labelKey)}</span>
|
||||
</button>
|
||||
);
|
||||
})}
|
||||
</nav>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default BottomNav;
|
||||
@@ -2,10 +2,11 @@ import React, { useState, useEffect } from 'react';
|
||||
import { createPortal } from 'react-dom';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import CitySelectModal, { REGIONS } from './CitySelectModal';
|
||||
import { useOverlayClose } from '../hooks/useOverlayClose';
|
||||
|
||||
interface BusinessNameInputModalProps {
|
||||
onClose: () => void;
|
||||
onSubmit: (businessName: string, address: string) => void;
|
||||
onSubmit: (businessName: string, address: string, category: string, officialSiteUrl: string) => void;
|
||||
}
|
||||
|
||||
const BusinessNameInputModal: React.FC<BusinessNameInputModalProps> = ({ onClose, onSubmit }) => {
|
||||
@@ -13,7 +14,10 @@ const BusinessNameInputModal: React.FC<BusinessNameInputModalProps> = ({ onClose
|
||||
const [businessName, setBusinessName] = useState('');
|
||||
const [selectedCity, setSelectedCity] = useState('');
|
||||
const [detailAddress, setDetailAddress] = useState('');
|
||||
const [category, setCategory] = useState('');
|
||||
const [officialSiteUrl, setOfficialSiteUrl] = useState('');
|
||||
const [isCityModalOpen, setIsCityModalOpen] = useState(false);
|
||||
const overlayCloseHandlers = useOverlayClose(onClose);
|
||||
|
||||
useEffect(() => {
|
||||
document.body.style.overflow = 'hidden';
|
||||
@@ -41,7 +45,12 @@ const BusinessNameInputModal: React.FC<BusinessNameInputModalProps> = ({ onClose
|
||||
const handleSubmit = () => {
|
||||
if (!isValid) return;
|
||||
const fullAddress = `${selectedCity} ${detailAddress.trim()}`;
|
||||
onSubmit(businessName.trim(), fullAddress);
|
||||
// 프로토콜 없이 입력하면 https:// 를 붙여서 전달
|
||||
const trimmedUrl = officialSiteUrl.trim();
|
||||
const normalizedUrl = trimmedUrl && !/^https?:\/\//i.test(trimmedUrl)
|
||||
? `https://${trimmedUrl}`
|
||||
: trimmedUrl;
|
||||
onSubmit(businessName.trim(), fullAddress, category.trim(), normalizedUrl);
|
||||
onClose();
|
||||
};
|
||||
|
||||
@@ -54,12 +63,13 @@ const BusinessNameInputModal: React.FC<BusinessNameInputModalProps> = ({ onClose
|
||||
|
||||
return createPortal(
|
||||
<>
|
||||
<div className="manual-modal-backdrop" onClick={onClose}>
|
||||
<div className="manual-modal-backdrop" {...overlayCloseHandlers}>
|
||||
<div className="manual-modal" onClick={e => e.stopPropagation()}>
|
||||
<div className="manual-modal-header">
|
||||
<span className="manual-modal-title">{t('landing.hero.manualModalTitle')}</span>
|
||||
<button className="manual-modal-close" onClick={onClose}>✕</button>
|
||||
</div>
|
||||
<p className="manual-modal-subtitle">{t('landing.hero.manualModalSubtitle')}</p>
|
||||
|
||||
<div className="manual-modal-body">
|
||||
<div className="manual-modal-field">
|
||||
@@ -103,6 +113,32 @@ const BusinessNameInputModal: React.FC<BusinessNameInputModalProps> = ({ onClose
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="manual-modal-field">
|
||||
<label className="manual-modal-label">{t('landing.hero.manualLabelCategory')}</label>
|
||||
<input
|
||||
type="text"
|
||||
className="manual-modal-input"
|
||||
placeholder={t('landing.hero.manualPlaceholderCategory')}
|
||||
value={category}
|
||||
onChange={e => setCategory(e.target.value)}
|
||||
onKeyDown={handleKeyDown}
|
||||
maxLength={30}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="manual-modal-field">
|
||||
<label className="manual-modal-label">{t('landing.hero.manualLabelSiteUrl')}</label>
|
||||
<input
|
||||
type="url"
|
||||
className="manual-modal-input"
|
||||
placeholder={t('landing.hero.manualPlaceholderSiteUrl')}
|
||||
value={officialSiteUrl}
|
||||
onChange={e => setOfficialSiteUrl(e.target.value)}
|
||||
onKeyDown={handleKeyDown}
|
||||
maxLength={2048}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="manual-modal-actions">
|
||||
<button type="button" className="manual-modal-cancel" onClick={onClose}>
|
||||
{t('common.cancel')}
|
||||
@@ -113,7 +149,7 @@ const BusinessNameInputModal: React.FC<BusinessNameInputModalProps> = ({ onClose
|
||||
onClick={handleSubmit}
|
||||
disabled={!isValid}
|
||||
>
|
||||
{t('landing.hero.analyzeButton')}
|
||||
{t('landing.hero.manualAnalyzeButton')}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import { useOverlayClose } from '../hooks/useOverlayClose';
|
||||
|
||||
export const REGIONS: { label: string; cities: string[] }[] = [
|
||||
{
|
||||
@@ -96,8 +97,10 @@ const CitySelectModal: React.FC<CitySelectModalProps> = ({ selected, onSelect, o
|
||||
onClose();
|
||||
};
|
||||
|
||||
const overlayCloseHandlers = useOverlayClose(onClose);
|
||||
|
||||
return (
|
||||
<div className="city-modal-backdrop" onClick={onClose}>
|
||||
<div className="city-modal-backdrop" {...overlayCloseHandlers}>
|
||||
<div className="city-modal" onClick={e => e.stopPropagation()}>
|
||||
<div className="city-modal-header">
|
||||
<span className="city-modal-title">
|
||||
|
||||
@@ -0,0 +1,201 @@
|
||||
import React from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
/**
|
||||
* 생성 완료 화면의 공용 레이아웃 (ADO2 영상 · 썰박스 공통).
|
||||
*
|
||||
* **순수 표현 컴포넌트다** — 생성·폴링·다운로드 로직은 전혀 갖지 않는다.
|
||||
* `CompletionContent`(ADO2)는 영상 생성과 자막 폴링까지 직접 수행하는 컨테이너라
|
||||
* 그대로 재사용할 수 없었고, 그래서 화면만 여기로 분리했다.
|
||||
*
|
||||
* 양쪽의 차이는 정보 패널뿐이다:
|
||||
* - ADO2 : 장르 · 해상도 → 가사 전문
|
||||
* - 썰박스 : 시나리오 · 생성일시 → 시나리오 설명
|
||||
* 그 차이를 `metaLines`/`detail` 슬롯으로 받는다.
|
||||
*
|
||||
* 마크업과 클래스명(`comp2-*`)은 기존 ADO2 완료 화면 그대로다. 클래스를 새로
|
||||
* 만들지 않아야 [generation-flow.css](../styles/generation-flow.css) 의 반응형·
|
||||
* 다크 팔레트가 두 화면에 동일하게 적용된다.
|
||||
*/
|
||||
|
||||
/** 영상 영역이 무엇을 그릴지 */
|
||||
export type CompletionVideoState =
|
||||
/** 생성/렌더 진행 중 — 스피너 + 진행률 */
|
||||
| 'loading'
|
||||
/** 실패 — 메시지 + (있으면) 재시도 버튼 */
|
||||
| 'error'
|
||||
/** 재생 가능 */
|
||||
| 'ready'
|
||||
/** URL 을 아직 못 받았지만 진행 중도 실패도 아님 — 빈 자리만 유지 */
|
||||
| 'empty';
|
||||
|
||||
interface CompletionViewProps {
|
||||
videoState: CompletionVideoState;
|
||||
videoUrl?: string | null;
|
||||
|
||||
/** `videoState === 'loading'` 일 때만 쓰인다 */
|
||||
loadingText?: string;
|
||||
/** 0~100. 표시용 값이며 크리핑 보간은 호출부 책임이다 */
|
||||
progress?: number;
|
||||
|
||||
/** `videoState === 'error'` 일 때만 쓰인다 */
|
||||
errorMessage?: string | null;
|
||||
/** 없으면 재시도 버튼을 그리지 않는다 (썰박스는 이 화면에서 재시도가 없다) */
|
||||
onRetry?: () => void;
|
||||
|
||||
/** 정보 패널 상단 파일명 */
|
||||
fileName: string;
|
||||
/** 메타 줄. 줄 사이에 구분선이 들어간다 */
|
||||
metaLines: React.ReactNode[];
|
||||
/** 메타 아래 상세 영역의 제목 */
|
||||
detailLabel: string;
|
||||
/** 상세 본문 (ADO2=가사 단락, 썰박스=시나리오 설명) */
|
||||
detail: React.ReactNode;
|
||||
|
||||
onDownload: () => void;
|
||||
downloadDisabled?: boolean;
|
||||
/** 진행 중에는 '다운로드 중...' 처럼 바뀌므로 호출부가 문구를 정한다 */
|
||||
downloadLabel: string;
|
||||
|
||||
onUpload: () => void;
|
||||
uploadDisabled?: boolean;
|
||||
|
||||
/**
|
||||
* 이 화면에 딸린 오버레이(SNS 업로드 모달 등).
|
||||
*
|
||||
* `.comp2-page` 안에 그려지므로 오버레이 쪽에서 타이포그래피 상속을
|
||||
* 끊어야 한다 — `.social-posting-overlay` 의 `text-align` 참조.
|
||||
*/
|
||||
children?: React.ReactNode;
|
||||
}
|
||||
|
||||
const CompletionView: React.FC<CompletionViewProps> = ({
|
||||
videoState,
|
||||
videoUrl,
|
||||
loadingText,
|
||||
progress = 0,
|
||||
errorMessage,
|
||||
onRetry,
|
||||
fileName,
|
||||
metaLines,
|
||||
detailLabel,
|
||||
detail,
|
||||
onDownload,
|
||||
downloadDisabled,
|
||||
downloadLabel,
|
||||
onUpload,
|
||||
uploadDisabled,
|
||||
children,
|
||||
}) => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
return (
|
||||
<main className="comp2-page">
|
||||
<div className="comp2-title-row">
|
||||
<h1 className="comp2-page-title">{t('completion.contentComplete')}</h1>
|
||||
<p className="comp2-page-subtitle">{t('completion.contentCompleteDesc')}</p>
|
||||
</div>
|
||||
|
||||
<div className="comp2-container">
|
||||
<div className="comp2-grid">
|
||||
{/* 왼쪽: 영상 */}
|
||||
<div className="comp2-video-section">
|
||||
<div className="comp2-video-wrapper">
|
||||
{videoState === 'loading' ? (
|
||||
<div className="comp2-video-loading">
|
||||
<div className="loading-spinner">
|
||||
<div className="loading-ring"></div>
|
||||
<div className="loading-dot">
|
||||
<div className="loading-dot-inner"></div>
|
||||
</div>
|
||||
</div>
|
||||
<p className="comp2-loading-text">{loadingText}</p>
|
||||
<div className="loading-progress-wrapper">
|
||||
<div className="loading-progress-bar">
|
||||
<div
|
||||
className="loading-progress-fill"
|
||||
style={{ width: `${progress}%` }}
|
||||
/>
|
||||
</div>
|
||||
<span className="loading-progress-text">{Math.floor(progress)}%</span>
|
||||
</div>
|
||||
</div>
|
||||
) : videoState === 'error' ? (
|
||||
<div className="comp2-video-error">
|
||||
<svg
|
||||
className="comp2-error-icon"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
strokeWidth="2"
|
||||
>
|
||||
<circle cx="12" cy="12" r="10" />
|
||||
<path d="M12 8v4M12 16h.01" />
|
||||
</svg>
|
||||
<p className="comp2-error-text">{errorMessage}</p>
|
||||
{onRetry && (
|
||||
<button onClick={onRetry} className="comp2-retry-btn">
|
||||
{t('completion.retry')}
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
) : videoState === 'ready' && videoUrl ? (
|
||||
<video src={videoUrl} className="comp2-video-player" controls playsInline />
|
||||
) : (
|
||||
<div className="comp2-video-placeholder"></div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* 오른쪽: 콘텐츠 정보 */}
|
||||
<div className="comp2-info-section">
|
||||
<div className="comp2-info-header">
|
||||
<span className="comp2-info-label">{t('completion.contentInfo')}</span>
|
||||
</div>
|
||||
<div className="comp2-file-info">
|
||||
<h3 className="comp2-filename">{fileName}</h3>
|
||||
</div>
|
||||
<div className="comp2-info-content">
|
||||
<div className="comp2-meta-grid">
|
||||
{metaLines.map((line, i) => (
|
||||
<React.Fragment key={i}>
|
||||
<div className="comp2-meta-item">
|
||||
<span className="comp2-meta-label">{line}</span>
|
||||
</div>
|
||||
<div className="comp2-meta-divider"></div>
|
||||
</React.Fragment>
|
||||
))}
|
||||
<div className="comp2-lyrics-section">
|
||||
<span className="comp2-meta-label">{detailLabel}</span>
|
||||
{detail}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* 하단 버튼 */}
|
||||
<div className="comp2-buttons">
|
||||
<button
|
||||
onClick={onDownload}
|
||||
disabled={downloadDisabled}
|
||||
className="comp2-btn comp2-btn-secondary"
|
||||
>
|
||||
{downloadLabel}
|
||||
</button>
|
||||
<button
|
||||
onClick={onUpload}
|
||||
disabled={uploadDisabled}
|
||||
className="comp2-btn comp2-btn-primary"
|
||||
>
|
||||
{t('completion.uploadToSocial')}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{children}
|
||||
</main>
|
||||
);
|
||||
};
|
||||
|
||||
export default CompletionView;
|
||||
@@ -0,0 +1,128 @@
|
||||
import React, { useRef, useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { API_URL, toggleVideoLike, isLoggedIn } from '../utils/api';
|
||||
import { buildContentShareUrl, tryNativeShare } from '../utils/nativeShare';
|
||||
import { ContentType } from '../types/api';
|
||||
import LoginPromptModal from './LoginPromptModal';
|
||||
|
||||
interface ContentCardSocialActionsProps {
|
||||
videoId: number;
|
||||
/**
|
||||
* 콘텐츠 종류. video.id 와 ssul_content.id 가 겹치므로 좋아요 API 와
|
||||
* 공유 URL(/video/{id} vs /ssul/{id}) 분기에 반드시 필요하다.
|
||||
*/
|
||||
contentType?: ContentType;
|
||||
storeName: string;
|
||||
region?: string;
|
||||
title?: string | null;
|
||||
description?: string | null;
|
||||
commentCount: number;
|
||||
initialLikeCount: number;
|
||||
initialIsLiked?: boolean;
|
||||
}
|
||||
|
||||
const ContentCardSocialActions: React.FC<ContentCardSocialActionsProps> = ({
|
||||
videoId,
|
||||
contentType = 'video',
|
||||
storeName,
|
||||
region,
|
||||
title,
|
||||
description,
|
||||
commentCount,
|
||||
initialLikeCount,
|
||||
initialIsLiked = false,
|
||||
}: ContentCardSocialActionsProps) => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const [likeCount, setLikeCount] = useState(initialLikeCount);
|
||||
const [isLiked, setIsLiked] = useState(initialIsLiked);
|
||||
const [showLoginModal, setShowLoginModal] = useState(false);
|
||||
const likeDebounceRef = useRef<ReturnType<typeof setTimeout> | null>(null);
|
||||
|
||||
const shareUrl = buildContentShareUrl(API_URL, videoId, contentType);
|
||||
const shareTitle = title || storeName || t('videoDetail.kakaoDefaultTitle');
|
||||
|
||||
const handleShareBtnClick = async (e: React.MouseEvent) => {
|
||||
e.stopPropagation();
|
||||
|
||||
const handled = await tryNativeShare({
|
||||
title: shareTitle,
|
||||
url: shareUrl,
|
||||
});
|
||||
if (handled) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
await navigator.clipboard.writeText(shareUrl);
|
||||
} catch {
|
||||
// clipboard API 미지원 환경에서는 무시
|
||||
}
|
||||
};
|
||||
|
||||
const handleLikeClick = (e: React.MouseEvent) => {
|
||||
e.stopPropagation();
|
||||
|
||||
if (!isLoggedIn()) {
|
||||
setShowLoginModal(true);
|
||||
return;
|
||||
}
|
||||
|
||||
const prevLiked = isLiked;
|
||||
const prevCount = likeCount;
|
||||
|
||||
setIsLiked(!prevLiked);
|
||||
setLikeCount(prevLiked ? prevCount - 1 : prevCount + 1);
|
||||
|
||||
if (likeDebounceRef.current) clearTimeout(likeDebounceRef.current);
|
||||
likeDebounceRef.current = setTimeout(async () => {
|
||||
try {
|
||||
const res = await toggleVideoLike(String(videoId), contentType);
|
||||
setIsLiked(res.is_liked);
|
||||
setLikeCount(res.like_count);
|
||||
} catch (err) {
|
||||
console.error('Failed to toggle like:', err);
|
||||
setIsLiked(prevLiked);
|
||||
setLikeCount(prevCount);
|
||||
}
|
||||
}, 500);
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="content-card-social" onClick={(e) => e.stopPropagation()}>
|
||||
<button
|
||||
className={`content-card-like-btn ${isLiked ? 'liked' : ''}`}
|
||||
onClick={handleLikeClick}
|
||||
>
|
||||
<svg width="15" height="15" 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>
|
||||
|
||||
<span className="content-card-comment">
|
||||
<svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
|
||||
<path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" />
|
||||
</svg>
|
||||
{commentCount}
|
||||
</span>
|
||||
|
||||
<button
|
||||
className="content-card-share-btn"
|
||||
onClick={handleShareBtnClick}
|
||||
title={t('videoDetail.share')}
|
||||
>
|
||||
<svg width="15" height="15" 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>
|
||||
</button>
|
||||
|
||||
{showLoginModal && (
|
||||
<LoginPromptModal onClose={() => setShowLoginModal(false)} />
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default ContentCardSocialActions;
|
||||
@@ -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;
|
||||
@@ -11,9 +11,9 @@ const Footer: React.FC = () => {
|
||||
<img src="/assets/images/ado2-sidebar-logo.svg" alt="ADO2" className="footer-logo" />
|
||||
<p className="footer-copyright">Copyright ⓒ O2O Inc. All rights reserved</p>
|
||||
<div className="footer-links">
|
||||
<a href="https://demo.castad.net/privacy.html" rel="noopener noreferrer" className="footer-link">{t('footer.privacyPolicy')}</a>
|
||||
<a href="https://ado2.o2osolution.ai/privacy.html" rel="noopener noreferrer" className="footer-link">{t('footer.privacyPolicy')}</a>
|
||||
<span className="footer-link-divider">|</span>
|
||||
<a href="https://demo.castad.net/terms.html" rel="noopener noreferrer" className="footer-link">{t('footer.termsOfService')}</a>
|
||||
<a href="https://ado2.o2osolution.ai/terms.html" rel="noopener noreferrer" className="footer-link">{t('footer.termsOfService')}</a>
|
||||
</div>
|
||||
</div>
|
||||
<div className="footer-right">
|
||||
|
||||
@@ -1,64 +0,0 @@
|
||||
|
||||
import React, { useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { getKakaoLoginUrl, isLoggedIn } from '../utils/api';
|
||||
import LanguageSwitch from './LanguageSwitch';
|
||||
|
||||
interface HeaderProps {
|
||||
onStartClick?: () => void;
|
||||
}
|
||||
|
||||
const Header: React.FC<HeaderProps> = ({ onStartClick }) => {
|
||||
const { t } = useTranslation();
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
const loggedIn = isLoggedIn();
|
||||
|
||||
const handleLogin = async () => {
|
||||
if (isLoading) return;
|
||||
|
||||
setIsLoading(true);
|
||||
try {
|
||||
const response = await getKakaoLoginUrl();
|
||||
window.location.href = response.auth_url;
|
||||
} catch (err) {
|
||||
console.error('Failed to get Kakao login URL:', err);
|
||||
alert(t('header.loginFailedAlert'));
|
||||
setIsLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
const handleStart = () => {
|
||||
if (onStartClick) {
|
||||
onStartClick();
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<header className="landing-header">
|
||||
<div className="header-logo">
|
||||
<img src="/assets/images/ado2-header-logo.svg" alt="ADO2" />
|
||||
</div>
|
||||
<div className="header-actions">
|
||||
<LanguageSwitch />
|
||||
{loggedIn ? (
|
||||
<button
|
||||
className="header-start-btn"
|
||||
onClick={handleStart}
|
||||
>
|
||||
{t('header.start')}
|
||||
</button>
|
||||
) : (
|
||||
<button
|
||||
className="header-login-btn"
|
||||
onClick={handleLogin}
|
||||
disabled={isLoading}
|
||||
>
|
||||
{isLoading ? t('header.loading') : t('header.login')}
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
</header>
|
||||
);
|
||||
};
|
||||
|
||||
export default Header;
|
||||
@@ -1,6 +1,7 @@
|
||||
import React from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { getKakaoLoginUrl } from '../utils/api';
|
||||
import { useOverlayClose } from '../hooks/useOverlayClose';
|
||||
|
||||
interface LoginPromptModalProps {
|
||||
onClose: () => void;
|
||||
@@ -8,6 +9,7 @@ interface LoginPromptModalProps {
|
||||
|
||||
const LoginPromptModal: React.FC<LoginPromptModalProps> = ({ onClose }) => {
|
||||
const { t } = useTranslation();
|
||||
const overlayCloseHandlers = useOverlayClose(onClose);
|
||||
|
||||
const handleLogin = async () => {
|
||||
try {
|
||||
@@ -24,22 +26,24 @@ const LoginPromptModal: React.FC<LoginPromptModalProps> = ({ onClose }) => {
|
||||
style={{
|
||||
position: 'fixed',
|
||||
inset: 0,
|
||||
background: 'rgba(255, 255, 255, 0.25)',
|
||||
background: 'rgba(0, 0, 0, 0.7)',
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
zIndex: 9999,
|
||||
padding: '16px',
|
||||
}}
|
||||
onClick={onClose}
|
||||
{...overlayCloseHandlers}
|
||||
>
|
||||
<div
|
||||
style={{
|
||||
background: '#01282A',
|
||||
border: '1px solid rgba(155, 202, 204, 0.2)',
|
||||
borderRadius: '16px',
|
||||
padding: '40px 32px',
|
||||
width: '360px',
|
||||
maxWidth: '90vw',
|
||||
border: '1px solid rgba(166, 255, 234, 0.15)',
|
||||
borderRadius: '20px',
|
||||
boxShadow: '0 24px 60px rgba(0, 0, 0, 0.5)',
|
||||
padding: '44px 32px 36px',
|
||||
width: '380px',
|
||||
maxWidth: '100%',
|
||||
textAlign: 'center',
|
||||
position: 'relative',
|
||||
}}
|
||||
@@ -64,27 +68,49 @@ const LoginPromptModal: React.FC<LoginPromptModalProps> = ({ onClose }) => {
|
||||
<line x1="16" y1="4" x2="4" y2="16"/>
|
||||
</svg>
|
||||
</button>
|
||||
<h2 style={{ color: '#FFFFFF', fontSize: '20px', fontWeight: 600, marginBottom: '12px' }}>
|
||||
|
||||
<div
|
||||
style={{
|
||||
width: '56px',
|
||||
height: '56px',
|
||||
margin: '0 auto 20px',
|
||||
borderRadius: '50%',
|
||||
background: 'rgba(166, 255, 234, 0.1)',
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
}}
|
||||
>
|
||||
<svg width="26" height="26" viewBox="0 0 24 24" fill="none" stroke="#A6FFEA" strokeWidth="2">
|
||||
<path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2" />
|
||||
<circle cx="12" cy="7" r="4" />
|
||||
</svg>
|
||||
</div>
|
||||
|
||||
<h2 style={{ color: '#FFFFFF', fontSize: '22px', fontWeight: 700, marginBottom: '10px', lineHeight: 1.4 }}>
|
||||
{t('loginPrompt.title')}
|
||||
</h2>
|
||||
<p style={{ color: '#9BCACC', fontSize: '14px', lineHeight: 1.5, marginBottom: '28px', whiteSpace: 'pre-line' }}>
|
||||
{t('loginPrompt.description')}
|
||||
</p>
|
||||
|
||||
<button
|
||||
onClick={handleLogin}
|
||||
style={{
|
||||
width: '50%',
|
||||
margin: '0 auto',
|
||||
padding: '14px',
|
||||
width: '100%',
|
||||
padding: '15px',
|
||||
background: '#FEE500',
|
||||
color: '#3C1E1E',
|
||||
border: 'none',
|
||||
borderRadius: '8px',
|
||||
fontSize: '15px',
|
||||
fontWeight: 600,
|
||||
borderRadius: '10px',
|
||||
fontSize: '16px',
|
||||
fontWeight: 700,
|
||||
cursor: 'pointer',
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
gap: '8px',
|
||||
boxShadow: '0 4px 14px rgba(254, 229, 0, 0.25)',
|
||||
}}
|
||||
>
|
||||
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
|
||||
@@ -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;
|
||||
@@ -0,0 +1,76 @@
|
||||
import React from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { BookIcon, PosterVideoIcon, StorefrontIcon } from './pipelineIcons';
|
||||
|
||||
/**
|
||||
* 생성할 콘텐츠 종류. 진입 화면에서 고르면 이후 플로우 전체가 갈린다.
|
||||
*
|
||||
* 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; 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 },
|
||||
];
|
||||
|
||||
/**
|
||||
* 파이프라인 전환 탭 (아이콘 타일 + 기능명).
|
||||
*
|
||||
* 밑줄 탭에서 타일로 바꾼 이유: 파이프라인이 2개일 때는 글자만으로 충분했지만
|
||||
* 4개가 되자 "포스터 영상"과 "포스터 스타일"처럼 **글자가 겹치는 항목**이 생겨
|
||||
* 훑어볼 때 구분이 안 됐다. 형태(아이콘)가 붙으면 읽지 않고도 갈라진다.
|
||||
*
|
||||
* 색은 파이프라인별로 나누지 않는다 — 참조한 레퍼런스는 항목마다 파스텔색을 쓰지만,
|
||||
* ADO2 는 민트 액센트 + 퍼플 CTA 한 곳이 규칙이라 4색을 쓰면 팔레트가 깨진다.
|
||||
* 구분은 형태로, 상태(선택)는 민트로 나눈다.
|
||||
*
|
||||
* 스타일은 generation-flow.css 의 `.pipeline-tabs*` 참조.
|
||||
*
|
||||
* 접근성: castad 의 기존 탭(`.myinfo-tab` 등)에는 role/aria 가 없지만,
|
||||
* 이 컴포넌트를 기점으로 표준 tablist 패턴을 도입한다.
|
||||
*/
|
||||
const PipelineTabs: React.FC<PipelineTabsProps> = ({ value, onChange }) => {
|
||||
const { t } = useTranslation();
|
||||
// 롱컷은 무빙 포스터 안의 두 번째 갈래라 별도 탭이 없다. 그 안에 있을 때도 무빙 포스터 탭을 켠다
|
||||
const active: Pipeline = value === 'playreel' ? 'poster' : value;
|
||||
|
||||
return (
|
||||
<div
|
||||
className="pipeline-tabs"
|
||||
data-active={active}
|
||||
role="tablist"
|
||||
aria-label={t('pipelineTabs.ariaLabel')}
|
||||
>
|
||||
{TABS.map(({ id, labelKey, Icon }) => (
|
||||
<button
|
||||
key={id}
|
||||
type="button"
|
||||
role="tab"
|
||||
aria-selected={active === id}
|
||||
className="pipeline-tab"
|
||||
onClick={() => onChange(id)}
|
||||
>
|
||||
<span className="pipeline-tab__tile">
|
||||
<Icon size={24} />
|
||||
</span>
|
||||
<span className="pipeline-tab__label">{t(labelKey)}</span>
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default PipelineTabs;
|
||||
@@ -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;
|
||||
+119
-125
@@ -1,6 +1,6 @@
|
||||
import React, { useState, useRef, useCallback, useEffect } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { searchAccommodation, AccommodationSearchItem, AutocompleteRequest } from '../utils/api';
|
||||
import { searchAccommodation, cleanSearchTitle, AccommodationSearchItem, AutocompleteRequest } from '../utils/api';
|
||||
import { useSearchHistory } from './SearchHistory/useSearchHistory';
|
||||
import SearchHistoryDropdown from './SearchHistory/SearchHistoryDropdown';
|
||||
import BusinessNameInputModal from './BusinessNameInputModal';
|
||||
@@ -18,13 +18,29 @@ const isValidUrl = (string: string): boolean => {
|
||||
}
|
||||
};
|
||||
|
||||
// URL 형태로 판단되는 입력: 프로토콜/www. 시작 또는 도메인 형태(naver.me/xxx 등)
|
||||
const isUrlLike = (value: string): boolean => {
|
||||
const trimmed = value.trim();
|
||||
return /^(https?:\/\/|www\.)/i.test(trimmed)
|
||||
|| /^[a-z0-9-]+(\.[a-z0-9-]+)+([/?#]|$)/i.test(trimmed);
|
||||
};
|
||||
|
||||
const sanitizeUrlInput = (value: string): string => {
|
||||
return value.replace(/[^\x00-\x7F]/g, '');
|
||||
};
|
||||
|
||||
// 텍스트 안에 포함된 첫 번째 URL을 추출 (없으면 null)
|
||||
const extractUrl = (text: string): string | null => {
|
||||
const match = text.match(/(https?:\/\/|www\.)[^\s]+/i);
|
||||
return match ? match[0] : null;
|
||||
};
|
||||
|
||||
interface SearchInputFormProps {
|
||||
onAnalyze?: (value: string, type: SearchType) => void;
|
||||
onAutocomplete?: (data: AutocompleteRequest) => void;
|
||||
onManualInput?: (businessName: string, address: string) => void;
|
||||
onManualInput?: (businessName: string, address: string, category: string, officialSiteUrl?: string) => void;
|
||||
/** 직접입력 버튼 클릭 시 기본 동작(모달 열기)을 대체합니다. 제공 시 모달을 직접 관리해야 합니다. */
|
||||
onManualButtonClick?: () => void;
|
||||
onShortform?: () => void;
|
||||
error?: string | null;
|
||||
}
|
||||
|
||||
@@ -33,13 +49,11 @@ const SearchInputForm: React.FC<SearchInputFormProps> = ({
|
||||
onAutocomplete,
|
||||
onManualInput,
|
||||
onManualButtonClick,
|
||||
onShortform,
|
||||
error: externalError,
|
||||
}) => {
|
||||
const { t } = useTranslation();
|
||||
const [inputValue, setInputValue] = useState('');
|
||||
const [searchType, setSearchType] = useState<SearchType>('name');
|
||||
const [isDropdownOpen, setIsDropdownOpen] = useState(false);
|
||||
const [searchType] = useState<SearchType>('name');
|
||||
const [isFocused, setIsFocused] = useState(false);
|
||||
const [isManualModalOpen, setIsManualModalOpen] = useState(false);
|
||||
const [localError, setLocalError] = useState('');
|
||||
@@ -49,16 +63,12 @@ const SearchInputForm: React.FC<SearchInputFormProps> = ({
|
||||
const [selectedItem, setSelectedItem] = useState<AccommodationSearchItem | null>(null);
|
||||
const [highlightedIndex, setHighlightedIndex] = useState<number>(-1);
|
||||
|
||||
const { filteredHistory, showHistory, openHistory, closeHistory, hideOnInput, deleteItem } = useSearchHistory(searchType === 'manual' ? 'name' : searchType);
|
||||
const { filteredHistory, showHistory, openHistory, closeHistory, hideOnInput, deleteItem } = useSearchHistory('name');
|
||||
const debounceRef = useRef<NodeJS.Timeout | null>(null);
|
||||
const dropdownRef = useRef<HTMLDivElement>(null);
|
||||
const autocompleteRef = useRef<HTMLDivElement>(null);
|
||||
|
||||
useEffect(() => {
|
||||
const handleClickOutside = (event: MouseEvent) => {
|
||||
if (dropdownRef.current && !dropdownRef.current.contains(event.target as Node)) {
|
||||
setIsDropdownOpen(false);
|
||||
}
|
||||
if (autocompleteRef.current && !autocompleteRef.current.contains(event.target as Node)) {
|
||||
setShowAutocomplete(false);
|
||||
}
|
||||
@@ -67,20 +77,8 @@ const SearchInputForm: React.FC<SearchInputFormProps> = ({
|
||||
return () => document.removeEventListener('mousedown', handleClickOutside);
|
||||
}, []);
|
||||
|
||||
const searchTypeOptions = [
|
||||
{ value: 'url' as SearchType, label: 'URL' },
|
||||
{ value: 'name' as SearchType, label: t('landing.hero.searchTypeBusinessName') },
|
||||
{ value: 'manual' as SearchType, label: t('landing.hero.searchTypeManual') },
|
||||
];
|
||||
|
||||
const getPlaceholder = () =>
|
||||
searchType === 'url' ? 'https://naver.me/abcdef' : t('landing.hero.placeholderBusinessName');
|
||||
|
||||
const getGuideText = () =>
|
||||
searchType === 'url' ? t('landing.hero.guideUrl') : t('landing.hero.guideBusinessName');
|
||||
|
||||
const handleAutocompleteSearch = useCallback(async (query: string) => {
|
||||
if (!query.trim() || searchType !== 'name') {
|
||||
if (!query.trim()) {
|
||||
setAutocompleteResults([]);
|
||||
setShowAutocomplete(false);
|
||||
return;
|
||||
@@ -96,11 +94,12 @@ const SearchInputForm: React.FC<SearchInputFormProps> = ({
|
||||
} finally {
|
||||
setIsAutocompleteLoading(false);
|
||||
}
|
||||
}, [searchType]);
|
||||
}, []);
|
||||
|
||||
const handleSelectAutocomplete = (item: AccommodationSearchItem) => {
|
||||
setInputValue(item.title.replace(/<[^>]*>/g, ''));
|
||||
setSelectedItem(item);
|
||||
const cleanTitle = cleanSearchTitle(item.title);
|
||||
setInputValue(cleanTitle);
|
||||
setSelectedItem({ ...item, title: cleanTitle });
|
||||
setShowAutocomplete(false);
|
||||
setAutocompleteResults([]);
|
||||
setHighlightedIndex(-1);
|
||||
@@ -136,18 +135,20 @@ const SearchInputForm: React.FC<SearchInputFormProps> = ({
|
||||
};
|
||||
|
||||
const handleStart = () => {
|
||||
if (!inputValue.trim()) {
|
||||
setLocalError(searchType === 'url' ? t('landing.hero.errorUrlRequired') : t('landing.hero.errorNameRequired'));
|
||||
const trimmed = inputValue.trim();
|
||||
if (!trimmed) {
|
||||
setLocalError(t('landing.hero.errorInputRequired'));
|
||||
return;
|
||||
}
|
||||
if (searchType === 'url' && !isValidUrl(inputValue.trim())) {
|
||||
setLocalError(t('landing.hero.errorInvalidUrl'));
|
||||
if (isValidUrl(trimmed)) {
|
||||
setLocalError('');
|
||||
onAnalyze?.(trimmed, 'url');
|
||||
return;
|
||||
}
|
||||
|
||||
setLocalError('');
|
||||
|
||||
if (searchType === 'name' && selectedItem && onAutocomplete) {
|
||||
if (selectedItem && onAutocomplete) {
|
||||
onAutocomplete({
|
||||
address: selectedItem.address,
|
||||
roadAddress: selectedItem.roadAddress,
|
||||
@@ -158,6 +159,67 @@ const SearchInputForm: React.FC<SearchInputFormProps> = ({
|
||||
}
|
||||
};
|
||||
|
||||
const applyInputChange = (value: string) => {
|
||||
setInputValue(value);
|
||||
setSelectedItem(null);
|
||||
setHighlightedIndex(-1);
|
||||
hideOnInput(value);
|
||||
if (localError) setLocalError('');
|
||||
if (debounceRef.current) clearTimeout(debounceRef.current);
|
||||
if (isValidUrl(value)) {
|
||||
setAutocompleteResults([]);
|
||||
setShowAutocomplete(false);
|
||||
} else {
|
||||
debounceRef.current = setTimeout(() => handleAutocompleteSearch(value), 300);
|
||||
}
|
||||
};
|
||||
|
||||
// 모바일 키보드 클립보드 추천 등 paste 이벤트 없이 여러 글자가 한 번에 들어오는 경우 처리
|
||||
const handleChange = (value: string) => {
|
||||
const isBulkInsert = value.length - inputValue.length > 1;
|
||||
if (isBulkInsert) {
|
||||
const extracted = extractUrl(value);
|
||||
if (extracted && extracted !== value.trim()) {
|
||||
applyInputChange(sanitizeUrlInput(extracted));
|
||||
return;
|
||||
}
|
||||
if (isUrlLike(value)) {
|
||||
const sanitized = sanitizeUrlInput(value);
|
||||
if (sanitized !== value) {
|
||||
applyInputChange(sanitized);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
applyInputChange(value);
|
||||
};
|
||||
|
||||
const handlePaste = (e: React.ClipboardEvent<HTMLInputElement>) => {
|
||||
const pastedText = e.clipboardData.getData('text');
|
||||
|
||||
// 붙여넣은 텍스트에 URL이 포함되어 있고 URL 외 다른 텍스트도 있으면 URL만 추출해서 입력창에 넣기
|
||||
const extracted = extractUrl(pastedText);
|
||||
if (extracted && extracted !== pastedText.trim()) {
|
||||
e.preventDefault();
|
||||
applyInputChange(sanitizeUrlInput(extracted));
|
||||
return;
|
||||
}
|
||||
|
||||
const input = e.currentTarget;
|
||||
const start = input.selectionStart ?? inputValue.length;
|
||||
const end = input.selectionEnd ?? inputValue.length;
|
||||
const merged = inputValue.slice(0, start) + pastedText + inputValue.slice(end);
|
||||
|
||||
// 붙여넣은 후 완성될 전체 값이 URL 형태일 때만 비영문 문자 제거
|
||||
if (!isUrlLike(merged)) return;
|
||||
|
||||
const sanitized = sanitizeUrlInput(merged);
|
||||
if (sanitized === merged) return;
|
||||
|
||||
e.preventDefault();
|
||||
applyInputChange(sanitized);
|
||||
};
|
||||
|
||||
const handleManualButtonClick = () => {
|
||||
if (onManualButtonClick) {
|
||||
onManualButtonClick();
|
||||
@@ -171,88 +233,30 @@ const SearchInputForm: React.FC<SearchInputFormProps> = ({
|
||||
return (
|
||||
<div className="hero-form">
|
||||
<div className={`hero-input-wrapper ${isFocused ? 'focused' : ''} ${error ? 'error' : ''} ${inputValue && !isFocused ? 'filled' : ''}`}>
|
||||
{/* 드롭다운 */}
|
||||
<div className="hero-dropdown-container" ref={dropdownRef}>
|
||||
<button
|
||||
type="button"
|
||||
className="hero-dropdown-trigger"
|
||||
onClick={() => setIsDropdownOpen(!isDropdownOpen)}
|
||||
>
|
||||
<span>{searchTypeOptions.find(opt => opt.value === searchType)?.label}</span>
|
||||
<svg
|
||||
width="12"
|
||||
height="12"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
strokeWidth="2"
|
||||
className={`hero-dropdown-arrow ${isDropdownOpen ? 'open' : ''}`}
|
||||
>
|
||||
<path d="M6 9l6 6 6-6" />
|
||||
</svg>
|
||||
</button>
|
||||
{isDropdownOpen && (
|
||||
<div className="hero-dropdown-menu">
|
||||
{searchTypeOptions.map((option) => (
|
||||
<button
|
||||
key={option.value}
|
||||
type="button"
|
||||
className={`hero-dropdown-item ${searchType === option.value ? 'active' : ''}`}
|
||||
onClick={() => {
|
||||
setIsDropdownOpen(false);
|
||||
if (option.value === 'manual') {
|
||||
handleManualButtonClick();
|
||||
} else {
|
||||
setSearchType(option.value);
|
||||
}
|
||||
}}
|
||||
>
|
||||
{option.label}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
{/* 유형 라벨 */}
|
||||
{/* <div className="hero-dropdown-container">
|
||||
<div className="hero-dropdown-trigger">
|
||||
<span className="hero-dropdown-main">
|
||||
{t('landing.hero.searchTypeLabel')}
|
||||
</span>
|
||||
</div>
|
||||
</div> */}
|
||||
|
||||
{/* 입력 필드 */}
|
||||
<div className="hero-input-container" ref={autocompleteRef}>
|
||||
<input
|
||||
type="text"
|
||||
value={inputValue}
|
||||
onChange={(e) => {
|
||||
let value = e.target.value;
|
||||
if (searchType === 'url') {
|
||||
const urlMatch = value.match(/https?:\/\/\S+/);
|
||||
if (urlMatch && urlMatch[0] !== value) value = urlMatch[0];
|
||||
}
|
||||
setInputValue(value);
|
||||
setSelectedItem(null);
|
||||
setHighlightedIndex(-1);
|
||||
hideOnInput(value);
|
||||
if (localError) setLocalError('');
|
||||
if (searchType === 'name') {
|
||||
if (debounceRef.current) clearTimeout(debounceRef.current);
|
||||
debounceRef.current = setTimeout(() => handleAutocompleteSearch(value), 300);
|
||||
}
|
||||
}}
|
||||
onPaste={(e: React.ClipboardEvent<HTMLInputElement>) => {
|
||||
if (searchType !== 'url') return;
|
||||
const pasted = e.clipboardData.getData('text');
|
||||
const urlMatch = pasted.match(/https?:\/\/[^\s]+/);
|
||||
if (urlMatch) {
|
||||
e.preventDefault();
|
||||
setInputValue(urlMatch[0]);
|
||||
if (localError) setLocalError('');
|
||||
}
|
||||
}}
|
||||
onChange={(e) => handleChange(e.target.value)}
|
||||
onPaste={handlePaste}
|
||||
onFocus={() => {
|
||||
setIsFocused(true);
|
||||
if (searchType === 'name' && autocompleteResults.length > 0) setShowAutocomplete(true);
|
||||
if (autocompleteResults.length > 0) setShowAutocomplete(true);
|
||||
openHistory(inputValue);
|
||||
}}
|
||||
onBlur={() => { setIsFocused(false); setTimeout(() => closeHistory(), 150); }}
|
||||
onKeyDown={handleKeyDown}
|
||||
placeholder={getPlaceholder()}
|
||||
placeholder={t('landing.hero.placeholderCombined')}
|
||||
className={`hero-input ${inputValue ? 'has-value' : ''}`}
|
||||
/>
|
||||
|
||||
@@ -262,12 +266,8 @@ const SearchInputForm: React.FC<SearchInputFormProps> = ({
|
||||
items={filteredHistory}
|
||||
onSelect={(item) => {
|
||||
closeHistory();
|
||||
if (item.type === 'url') {
|
||||
setSearchType('url');
|
||||
setInputValue(item.value);
|
||||
} else {
|
||||
setSearchType('name');
|
||||
setInputValue(item.value);
|
||||
setInputValue(item.value);
|
||||
if (item.type === 'name') {
|
||||
setSelectedItem({ title: item.value, address: item.address || '', roadAddress: item.roadAddress || '' });
|
||||
}
|
||||
}}
|
||||
@@ -280,7 +280,7 @@ const SearchInputForm: React.FC<SearchInputFormProps> = ({
|
||||
)}
|
||||
|
||||
{/* 자동완성 결과 */}
|
||||
{showAutocomplete && searchType === 'name' && (
|
||||
{showAutocomplete && (
|
||||
<div className="hero-autocomplete-dropdown">
|
||||
{isAutocompleteLoading ? (
|
||||
<div className="hero-autocomplete-loading">{t('landing.hero.searching')}</div>
|
||||
@@ -320,7 +320,7 @@ const SearchInputForm: React.FC<SearchInputFormProps> = ({
|
||||
)}
|
||||
</div>
|
||||
|
||||
<span className="hero-input-hint">{getGuideText()}</span>
|
||||
<span className="hero-input-hint">{t('landing.hero.guideCombined')}</span>
|
||||
|
||||
{error && <p className="hero-error">{error}</p>}
|
||||
|
||||
@@ -328,27 +328,21 @@ const SearchInputForm: React.FC<SearchInputFormProps> = ({
|
||||
{t('landing.hero.analyzeButton')}
|
||||
</button>
|
||||
|
||||
{onShortform && (
|
||||
<button
|
||||
type="button"
|
||||
className="url-input-shortform-btn"
|
||||
onClick={onShortform}
|
||||
>
|
||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
|
||||
<polygon points="23 7 16 12 23 17 23 7" />
|
||||
<rect x="1" y="5" width="15" height="14" rx="2" ry="2" />
|
||||
</svg>
|
||||
숏폼 영상 만들기
|
||||
</button>
|
||||
)}
|
||||
<div className="hero-divider"><span>또는</span></div>
|
||||
|
||||
<div className="hero-manual-card" onClick={handleManualButtonClick} role="button" tabIndex={0}
|
||||
onKeyDown={(e) => e.key === 'Enter' && handleManualButtonClick()}>
|
||||
<span className="hero-manual-card-title">{t('landing.hero.searchTypeManual')}</span>
|
||||
<p className="hero-manual-button-desc">{t('landing.hero.manualButtonDesc')}</p>
|
||||
</div>
|
||||
|
||||
{/* onManualButtonClick 미제공 시 모달을 내부에서 관리 */}
|
||||
{!onManualButtonClick && isManualModalOpen && (
|
||||
<BusinessNameInputModal
|
||||
onClose={() => setIsManualModalOpen(false)}
|
||||
onSubmit={(businessName, address) => {
|
||||
onSubmit={(businessName, address, category, officialSiteUrl) => {
|
||||
setIsManualModalOpen(false);
|
||||
onManualInput?.(businessName, address);
|
||||
onManualInput?.(businessName, address, category, officialSiteUrl);
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
|
||||
@@ -0,0 +1,150 @@
|
||||
import React, { useEffect, useRef } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { UserMeResponse } from '../types/api';
|
||||
import LanguageSwitch from './LanguageSwitch';
|
||||
import { NAV } from './navItems';
|
||||
|
||||
interface SettingsPanelProps {
|
||||
variant: 'sidebar' | 'bottom';
|
||||
onClose: () => void;
|
||||
onNavigate: (id: string) => void;
|
||||
activeItem: string;
|
||||
userInfo?: UserMeResponse | null;
|
||||
credits?: number | null;
|
||||
isGuest: boolean;
|
||||
isLoggingOut?: boolean;
|
||||
onLogout?: () => void;
|
||||
onLoginClick: () => void;
|
||||
/** 팝업을 여는 설정 버튼 영역. 외부 클릭 닫기에서 제외해 재클릭 시 토글이 정상 동작하게 한다 */
|
||||
anchorRef?: React.RefObject<HTMLElement | null>;
|
||||
}
|
||||
|
||||
const SettingsPanel: React.FC<SettingsPanelProps> = ({
|
||||
variant,
|
||||
onClose,
|
||||
onNavigate,
|
||||
activeItem,
|
||||
userInfo,
|
||||
credits,
|
||||
isGuest,
|
||||
isLoggingOut,
|
||||
onLogout,
|
||||
onLoginClick,
|
||||
anchorRef,
|
||||
}) => {
|
||||
const { t } = useTranslation();
|
||||
const panelRef = useRef<HTMLDivElement>(null);
|
||||
|
||||
useEffect(() => {
|
||||
const handleClickOutside = (e: MouseEvent) => {
|
||||
const target = e.target as Node;
|
||||
if (anchorRef?.current?.contains(target)) return;
|
||||
if (panelRef.current && !panelRef.current.contains(target)) {
|
||||
onClose();
|
||||
}
|
||||
};
|
||||
const handleEscape = (e: KeyboardEvent) => {
|
||||
if (e.key === 'Escape') onClose();
|
||||
};
|
||||
document.addEventListener('mousedown', handleClickOutside);
|
||||
document.addEventListener('keydown', handleEscape);
|
||||
return () => {
|
||||
document.removeEventListener('mousedown', handleClickOutside);
|
||||
document.removeEventListener('keydown', handleEscape);
|
||||
};
|
||||
}, [onClose, anchorRef]);
|
||||
|
||||
return (
|
||||
<div ref={panelRef} className={`settings-panel settings-panel--${variant}`}>
|
||||
{/* 1) 프로필 — 패널 헤더 역할 */}
|
||||
{!isGuest && (
|
||||
<>
|
||||
<div className="profile-section settings-panel-profile">
|
||||
{userInfo?.profile_image_url || userInfo?.thumbnail_image_url ? (
|
||||
<img
|
||||
src={userInfo.thumbnail_image_url || userInfo.profile_image_url || ''}
|
||||
alt="Profile"
|
||||
className="profile-avatar"
|
||||
/>
|
||||
) : (
|
||||
<div className="profile-avatar profile-avatar-default">
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
|
||||
<path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2" />
|
||||
<circle cx="12" cy="7" r="4" />
|
||||
</svg>
|
||||
</div>
|
||||
)}
|
||||
<div className="flex-1 min-w-0">
|
||||
<p className="profile-name">{userInfo?.nickname || t('sidebar.defaultUser')}</p>
|
||||
{credits !== null && credits !== undefined && (
|
||||
<p className="profile-credits">{t('sidebar.credits', { count: credits })}</p>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
|
||||
{/* 2) 메뉴 그룹 — 대시보드 */}
|
||||
<button
|
||||
className={`settings-panel-item ${activeItem === NAV.DASHBOARD ? 'active' : ''}`}
|
||||
onClick={() => {
|
||||
onNavigate(NAV.DASHBOARD);
|
||||
onClose();
|
||||
}}
|
||||
>
|
||||
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5">
|
||||
<rect x="3" y="3" width="7" height="9" /><rect x="14" y="3" width="7" height="5" />
|
||||
<rect x="14" y="12" width="7" height="9" /><rect x="3" y="16" width="7" height="5" />
|
||||
</svg>
|
||||
<span>{t('sidebar.dashboard')}</span>
|
||||
</button>
|
||||
|
||||
<div className="settings-panel-divider" />
|
||||
|
||||
{/* 3) 하단 그룹 — 언어 전환 / 로그아웃(로그인) / 고객의견 */}
|
||||
<div className="settings-panel-language">
|
||||
<LanguageSwitch isCollapsed={false} />
|
||||
</div>
|
||||
|
||||
{isGuest ? (
|
||||
<button className="settings-panel-item" onClick={onLoginClick}>
|
||||
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5">
|
||||
<path d="M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4" /><polyline points="10 17 15 12 10 7" /><line x1="15" y1="12" x2="3" y2="12" />
|
||||
</svg>
|
||||
<span>{t('sidebar.login')}</span>
|
||||
</button>
|
||||
) : (
|
||||
<button className="settings-panel-item" onClick={onLogout} disabled={isLoggingOut}>
|
||||
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5">
|
||||
<path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" /><polyline points="16 17 21 12 16 7" /><line x1="21" y1="12" x2="9" y2="12" />
|
||||
</svg>
|
||||
<span>{isLoggingOut ? t('sidebar.loggingOut') : t('sidebar.logout')}</span>
|
||||
</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"
|
||||
rel="noopener noreferrer"
|
||||
className="settings-panel-item"
|
||||
title={t('sidebar.inquiry')}
|
||||
>
|
||||
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5">
|
||||
<path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" />
|
||||
</svg>
|
||||
<span>{t('sidebar.inquiry')}</span>
|
||||
</a>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default SettingsPanel;
|
||||
+62
-181
@@ -1,32 +1,30 @@
|
||||
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import React, { useRef, useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { UserMeResponse } from '../types/api';
|
||||
import { logout } from '../utils/api';
|
||||
import LanguageSwitch from './LanguageSwitch';
|
||||
import { NAV_ITEMS, SETTINGS_ID } from './navItems';
|
||||
const TOP_NAV_ITEMS = NAV_ITEMS.filter(item => item.id !== SETTINGS_ID);
|
||||
const SETTINGS_NAV_ITEM = NAV_ITEMS.find(item => item.id === SETTINGS_ID)!;
|
||||
import SettingsPanel from './SettingsPanel';
|
||||
|
||||
interface SidebarItemProps {
|
||||
icon: React.ReactNode;
|
||||
label: string;
|
||||
isActive?: boolean;
|
||||
isCollapsed: boolean;
|
||||
isDisabled?: boolean;
|
||||
onClick?: () => void;
|
||||
id?: string;
|
||||
}
|
||||
|
||||
const SidebarItem: React.FC<SidebarItemProps> = ({ icon, label, isActive, isCollapsed, isDisabled, onClick, id }) => {
|
||||
const SidebarItem: React.FC<SidebarItemProps> = ({ icon, label, isActive, onClick }) => {
|
||||
return (
|
||||
<div
|
||||
id={id}
|
||||
onClick={isDisabled ? undefined : onClick}
|
||||
className={`sidebar-item ${isActive ? 'active' : ''} ${isCollapsed ? 'collapsed' : ''} ${isDisabled ? 'disabled' : ''}`}
|
||||
title={isCollapsed ? label : ""}
|
||||
onClick={onClick}
|
||||
className={`sidebar-item ${isActive ? 'active' : ''}`}
|
||||
>
|
||||
<div className="sidebar-item-icon">
|
||||
{icon}
|
||||
</div>
|
||||
{!isCollapsed && <span className="sidebar-item-label">{label}</span>}
|
||||
<span className="sidebar-item-label">{label}</span>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
@@ -34,22 +32,20 @@ const SidebarItem: React.FC<SidebarItemProps> = ({ icon, label, isActive, isColl
|
||||
interface SidebarProps {
|
||||
activeItem: string;
|
||||
onNavigate: (id: string) => void;
|
||||
onHome?: () => void;
|
||||
onLogoClick?: () => void;
|
||||
userInfo?: UserMeResponse | null;
|
||||
onLogout?: () => void;
|
||||
credits?: number | null;
|
||||
tutorialAvailable?: boolean;
|
||||
tutorialEnabled?: boolean;
|
||||
onToggleTutorial?: () => void;
|
||||
isGuest: boolean;
|
||||
onLoginClick: () => void;
|
||||
}
|
||||
|
||||
const Sidebar: React.FC<SidebarProps> = ({ activeItem, onNavigate, onHome, userInfo, onLogout, credits, tutorialAvailable, tutorialEnabled, onToggleTutorial }) => {
|
||||
const Sidebar: React.FC<SidebarProps> = ({ activeItem, onNavigate, onLogoClick, userInfo, onLogout, credits, isGuest, onLoginClick }) => {
|
||||
const { t } = useTranslation();
|
||||
const [isCollapsed, setIsCollapsed] = useState(false);
|
||||
const [isMobileOpen, setIsMobileOpen] = useState(false);
|
||||
const [isLoggingOut, setIsLoggingOut] = useState(false);
|
||||
const [settingsOpen, setSettingsOpen] = useState(false);
|
||||
const settingsAnchorRef = useRef<HTMLDivElement>(null);
|
||||
|
||||
// 로그아웃 처리
|
||||
const handleLogout = async () => {
|
||||
if (isLoggingOut) return;
|
||||
setIsLoggingOut(true);
|
||||
@@ -58,184 +54,69 @@ const Sidebar: React.FC<SidebarProps> = ({ activeItem, onNavigate, onHome, userI
|
||||
onLogout?.();
|
||||
} catch (error) {
|
||||
console.error('Logout failed:', error);
|
||||
// 에러가 나도 로컬 토큰은 이미 삭제됨, 홈으로 이동
|
||||
onLogout?.();
|
||||
} finally {
|
||||
setIsLoggingOut(false);
|
||||
}
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
const handleResize = () => {
|
||||
if (window.innerWidth < 768) {
|
||||
setIsMobileOpen(false);
|
||||
}
|
||||
};
|
||||
|
||||
handleResize();
|
||||
window.addEventListener('resize', handleResize);
|
||||
return () => window.removeEventListener('resize', handleResize);
|
||||
}, []);
|
||||
|
||||
const handleNavigate = (id: string) => {
|
||||
onNavigate(id);
|
||||
if (window.innerWidth < 768) {
|
||||
setIsMobileOpen(false);
|
||||
const handleItemClick = (id: string) => {
|
||||
if (id === SETTINGS_ID) {
|
||||
setSettingsOpen(v => !v);
|
||||
return;
|
||||
}
|
||||
onNavigate(id);
|
||||
};
|
||||
|
||||
const menuItems = [
|
||||
{ id: '대시보드', label: t('sidebar.dashboard'), disabled: false, icon: <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5"><rect x="3" y="3" width="7" height="9"/><rect x="14" y="3" width="7" height="5"/><rect x="14" y="12" width="7" height="9"/><rect x="3" y="16" width="7" height="5"/></svg> },
|
||||
{ id: '새 프로젝트 만들기', label: t('sidebar.newProject'), disabled: false, icon: <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5"><line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/></svg> },
|
||||
{ id: 'ADO2 콘텐츠', label: t('sidebar.ado2Contents'), disabled: false, icon: <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5"><path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"/></svg> },
|
||||
{ id: '내 콘텐츠', label: t('sidebar.myContents'), disabled: false, icon: <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"/><circle cx="8.5" cy="8.5" r="1.5"/><polyline points="21 15 16 10 5 21"/></svg> },
|
||||
{ id: '콘텐츠 캘린더', label: t('contentCalendar.title'), disabled: false, icon: <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"/><line x1="16" y1="2" x2="16" y2="6"/><line x1="8" y1="2" x2="8" y2="6"/><line x1="3" y1="10" x2="21" y2="10"/></svg> },
|
||||
{ id: '내 정보', label: t('sidebar.myInfo'), disabled: false, icon: <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5"><path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"/><circle cx="12" cy="7" r="4"/></svg> },
|
||||
];
|
||||
|
||||
return (
|
||||
<>
|
||||
{/* Mobile Menu Button */}
|
||||
<button
|
||||
onClick={() => setIsMobileOpen(true)}
|
||||
className="mobile-menu-btn"
|
||||
>
|
||||
<svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
|
||||
<line x1="3" y1="12" x2="21" y2="12"/><line x1="3" y1="6" x2="21" y2="6"/><line x1="3" y1="18" x2="21" y2="18"/>
|
||||
</svg>
|
||||
</button>
|
||||
|
||||
{/* Mobile Overlay */}
|
||||
{isMobileOpen && (
|
||||
<div
|
||||
className="mobile-overlay"
|
||||
onClick={() => setIsMobileOpen(false)}
|
||||
<div className="sidebar expanded">
|
||||
<div className="sidebar-header">
|
||||
<img
|
||||
onClick={onLogoClick}
|
||||
src="/assets/images/ado2-sidebar-logo.svg"
|
||||
alt="ADO2"
|
||||
className="sidebar-logo"
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* Sidebar */}
|
||||
<div className={`sidebar ${isCollapsed ? 'collapsed' : 'expanded'} ${isMobileOpen ? 'mobile-open' : 'mobile-closed'}`}>
|
||||
<div className={`sidebar-header ${isCollapsed ? 'collapsed' : ''}`}>
|
||||
{!isCollapsed && (
|
||||
<img
|
||||
onClick={onHome}
|
||||
src="/assets/images/ado2-sidebar-logo.svg"
|
||||
alt="ADO2"
|
||||
className="sidebar-logo"
|
||||
<div className="sidebar-menu no-scrollbar">
|
||||
{TOP_NAV_ITEMS.map(item => (
|
||||
<SidebarItem
|
||||
key={item.id}
|
||||
icon={item.icon}
|
||||
label={t(item.labelKey)}
|
||||
isActive={activeItem === item.id}
|
||||
onClick={() => handleItemClick(item.id)}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
|
||||
<div className="sidebar-footer">
|
||||
<div className="sidebar-settings-anchor" ref={settingsAnchorRef}>
|
||||
<SidebarItem
|
||||
icon={SETTINGS_NAV_ITEM.icon}
|
||||
label={t(SETTINGS_NAV_ITEM.labelKey)}
|
||||
isActive={settingsOpen}
|
||||
onClick={() => handleItemClick(SETTINGS_NAV_ITEM.id)}
|
||||
/>
|
||||
{settingsOpen && (
|
||||
<SettingsPanel
|
||||
variant="sidebar"
|
||||
onClose={() => setSettingsOpen(false)}
|
||||
onNavigate={onNavigate}
|
||||
activeItem={activeItem}
|
||||
userInfo={userInfo}
|
||||
credits={credits}
|
||||
isGuest={isGuest}
|
||||
isLoggingOut={isLoggingOut}
|
||||
onLogout={handleLogout}
|
||||
onLoginClick={onLoginClick}
|
||||
anchorRef={settingsAnchorRef}
|
||||
/>
|
||||
)}
|
||||
<button
|
||||
onClick={() => {
|
||||
if (window.innerWidth < 768) {
|
||||
setIsMobileOpen(false);
|
||||
} else {
|
||||
setIsCollapsed(!isCollapsed);
|
||||
}
|
||||
}}
|
||||
className="p-1.5 text-gray-400 hover:text-white"
|
||||
>
|
||||
<svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
|
||||
<line x1="3" y1="12" x2="21" y2="12"/><line x1="3" y1="6" x2="21" y2="6"/><line x1="3" y1="18" x2="21" y2="18"/>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div className="sidebar-menu no-scrollbar">
|
||||
{menuItems.map(item => (
|
||||
<SidebarItem
|
||||
key={item.id}
|
||||
id={
|
||||
item.id === '내 정보'
|
||||
? 'sidebar-my-info'
|
||||
: item.id === 'ADO2 콘텐츠'
|
||||
? 'sidebar-ado2-contents'
|
||||
: undefined
|
||||
}
|
||||
icon={item.icon}
|
||||
label={item.label}
|
||||
isCollapsed={isCollapsed}
|
||||
isActive={activeItem === item.id}
|
||||
isDisabled={item.disabled}
|
||||
onClick={() => handleNavigate(item.id)}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
|
||||
<div className="sidebar-footer">
|
||||
{/* 모바일 전용 튜토리얼 토글 */}
|
||||
{tutorialAvailable && (
|
||||
<button
|
||||
className={`sidebar-tutorial-btn ${tutorialEnabled ? 'active' : ''}`}
|
||||
onClick={() => onToggleTutorial?.()}
|
||||
title={tutorialEnabled ? t('sidebar.tutorialOff') : t('sidebar.tutorialOn')}
|
||||
>
|
||||
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5">
|
||||
<circle cx="12" cy="12" r="10"/>
|
||||
<path d="M12 8v4l3 3"/>
|
||||
</svg>
|
||||
<span className="sidebar-tutorial-label">{t('sidebar.tutorial')}</span>
|
||||
<span className={`sidebar-tutorial-badge ${tutorialEnabled ? 'on' : 'off'}`}>
|
||||
{tutorialEnabled ? 'ON' : 'OFF'}
|
||||
</span>
|
||||
</button>
|
||||
)}
|
||||
|
||||
<div className="sidebar-language-switch">
|
||||
<LanguageSwitch isCollapsed={isCollapsed} />
|
||||
</div>
|
||||
|
||||
<div className={`profile-section ${isCollapsed ? 'collapsed' : ''}`}>
|
||||
{userInfo?.profile_image_url || userInfo?.thumbnail_image_url ? (
|
||||
<img
|
||||
src={userInfo.thumbnail_image_url || userInfo.profile_image_url || ''}
|
||||
alt="Profile"
|
||||
className="profile-avatar"
|
||||
/>
|
||||
) : (
|
||||
<div className="profile-avatar profile-avatar-default">
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
|
||||
<path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"/>
|
||||
<circle cx="12" cy="7" r="4"/>
|
||||
</svg>
|
||||
</div>
|
||||
)}
|
||||
{!isCollapsed && (
|
||||
<div className="flex-1 min-w-0">
|
||||
<p className="profile-name">{userInfo?.nickname || t('sidebar.defaultUser')}</p>
|
||||
{credits !== null && credits !== undefined && (
|
||||
<p className="profile-credits">{t('sidebar.credits', { count: credits })}</p>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className="sidebar-footer-actions">
|
||||
<button
|
||||
className={`logout-btn ${isCollapsed ? 'collapsed' : ''}`}
|
||||
onClick={handleLogout}
|
||||
disabled={isLoggingOut}
|
||||
>
|
||||
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5">
|
||||
<path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"/><polyline points="16 17 21 12 16 7"/><line x1="21" y1="12" x2="9" y2="12"/>
|
||||
</svg>
|
||||
{!isCollapsed && <span className="logout-btn-label">{isLoggingOut ? t('sidebar.loggingOut') : t('sidebar.logout')}</span>}
|
||||
</button>
|
||||
<a
|
||||
href="https://forms.gle/4a8mGebBYtdesvby9"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className={`sidebar-inquiry-btn ${isCollapsed ? 'collapsed' : ''}`}
|
||||
title={t('sidebar.inquiry')}
|
||||
>
|
||||
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5">
|
||||
<path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" />
|
||||
</svg>
|
||||
{!isCollapsed && <span>{t('sidebar.inquiry')}</span>}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -2,16 +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 { useTutorial } from './Tutorial/useTutorial';
|
||||
import { TUTORIAL_KEYS } from './Tutorial/tutorialSteps';
|
||||
import TutorialOverlay from './Tutorial/TutorialOverlay';
|
||||
import { useOverlayClose } from '../hooks/useOverlayClose';
|
||||
|
||||
interface SocialPostingModalProps {
|
||||
isOpen: boolean;
|
||||
onClose: () => void;
|
||||
video: VideoListItem | null;
|
||||
video: SocialUploadableItem | null;
|
||||
onGoToCalendar?: () => void;
|
||||
}
|
||||
|
||||
@@ -121,7 +119,6 @@ const SocialPostingModal: React.FC<SocialPostingModalProps> = ({
|
||||
onGoToCalendar,
|
||||
}) => {
|
||||
const { t } = useTranslation();
|
||||
const tutorial = useTutorial();
|
||||
const [socialAccounts, setSocialAccounts] = useState<SocialAccount[]>([]);
|
||||
const [selectedChannel, setSelectedChannel] = useState<string>('');
|
||||
const [title, setTitle] = useState('');
|
||||
@@ -141,7 +138,6 @@ const SocialPostingModal: React.FC<SocialPostingModalProps> = ({
|
||||
const [videoMeta, setVideoMeta] = useState<{ width: number; height: number; duration: number } | null>(null);
|
||||
const channelDropdownRef = useRef<HTMLDivElement>(null);
|
||||
const privacyDropdownRef = useRef<HTMLDivElement>(null);
|
||||
const hasBeenOpenedRef = useRef(false);
|
||||
const loadedForTaskIdRef = useRef<string | null>(null);
|
||||
const loadedAtRef = useRef<number>(0);
|
||||
const seoCache = useRef<Map<string, { title: string; description: string; tags: string }>>(new Map());
|
||||
@@ -184,56 +180,43 @@ const SocialPostingModal: React.FC<SocialPostingModalProps> = ({
|
||||
return () => { document.body.style.overflow = ''; };
|
||||
}, [isOpen]);
|
||||
|
||||
// 모달 오픈/닫힘 시 튜토리얼 트리거
|
||||
// 소셜 계정 로드 + SEO 자동 채움
|
||||
useEffect(() => {
|
||||
if (isOpen) {
|
||||
hasBeenOpenedRef.current = true;
|
||||
if (!tutorial.hasSeen(TUTORIAL_KEYS.UPLOAD_MODAL)) {
|
||||
const timer = setTimeout(() => {
|
||||
tutorial.startTutorial(TUTORIAL_KEYS.UPLOAD_MODAL);
|
||||
}, 400);
|
||||
return () => clearTimeout(timer);
|
||||
}
|
||||
} else if (hasBeenOpenedRef.current && !tutorial.hasSeen(TUTORIAL_KEYS.FEEDBACK)) {
|
||||
hasBeenOpenedRef.current = false;
|
||||
tutorial.startTutorial(TUTORIAL_KEYS.FEEDBACK);
|
||||
if (!isOpen) {
|
||||
loadedForTaskIdRef.current = null;
|
||||
return;
|
||||
}
|
||||
}, [isOpen]);
|
||||
|
||||
// SEO 생성 완료 시 UPLOAD_FORM 튜토리얼 트리거
|
||||
useEffect(() => {
|
||||
if (!isLoadingAutoDescription && isOpen && !tutorial.hasSeen(TUTORIAL_KEYS.UPLOAD_FORM)) {
|
||||
const timer = setTimeout(() => {
|
||||
tutorial.startTutorial(TUTORIAL_KEYS.UPLOAD_FORM);
|
||||
}, 400);
|
||||
return () => clearTimeout(timer);
|
||||
}
|
||||
}, [isLoadingAutoDescription]);
|
||||
|
||||
// 소셜 계정 로드
|
||||
useEffect(() => {
|
||||
if (!isOpen) return;
|
||||
|
||||
const now = Date.now();
|
||||
|
||||
loadSocialAccounts();
|
||||
|
||||
const taskId = video?.task_id ?? null;
|
||||
if (video?.title) {
|
||||
setTitle(video.title);
|
||||
setDescription(video.description || '');
|
||||
setTags((video.hashtags || []).join(','));
|
||||
setIsLoadingAutoDescription(false);
|
||||
return;
|
||||
}
|
||||
|
||||
const now = Date.now();
|
||||
const seoKey =
|
||||
video && video.type !== 'video'
|
||||
? `${video.type}:${video.video_id}`
|
||||
: video?.task_id || null;
|
||||
const expired = now - loadedAtRef.current > SEO_CACHE_TTL;
|
||||
|
||||
if (taskId && (taskId !== loadedForTaskIdRef.current || expired)) {
|
||||
loadedForTaskIdRef.current = taskId;
|
||||
if (seoKey && (seoKey !== loadedForTaskIdRef.current || expired)) {
|
||||
loadedForTaskIdRef.current = seoKey;
|
||||
loadedAtRef.current = now;
|
||||
loadAutocomplete();
|
||||
} else if (taskId) {
|
||||
const cached = seoCache.current.get(taskId);
|
||||
loadAutocomplete(seoKey);
|
||||
} else if (seoKey) {
|
||||
const cached = seoCache.current.get(seoKey);
|
||||
if (cached) {
|
||||
setTitle(cached.title);
|
||||
setDescription(cached.description);
|
||||
setTags(cached.tags);
|
||||
}
|
||||
}
|
||||
}, [isOpen, video?.task_id]);
|
||||
}, [isOpen, video?.task_id, video?.type, video?.video_id, video?.title, video?.description, video?.hashtags]);
|
||||
|
||||
const loadSocialAccounts = async () => {
|
||||
setIsLoadingAccounts(true);
|
||||
@@ -258,30 +241,36 @@ const SocialPostingModal: React.FC<SocialPostingModalProps> = ({
|
||||
}
|
||||
};
|
||||
|
||||
const loadAutocomplete = async () => {
|
||||
if (!video?.task_id) return;
|
||||
/**
|
||||
* 제목·설명·태그 자동 채움.
|
||||
*
|
||||
* `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 byContentId = video.type !== 'video';
|
||||
if (!byContentId && !video.task_id) return;
|
||||
|
||||
setIsLoadingAutoDescription(true);
|
||||
try {
|
||||
const requestPayload = {
|
||||
task_id : video.task_id,
|
||||
content_type: video.type,
|
||||
task_id: byContentId ? String(video.video_id) : video.task_id,
|
||||
};
|
||||
// Call autoSEO API
|
||||
console.log('[Upload] Request payload:', requestPayload);
|
||||
const autoSeoResponse = await getAutoSeoYoutube(requestPayload);
|
||||
|
||||
// 각 필드가 있을 때만 덮어씌움 (기존 값 보호)
|
||||
if (autoSeoResponse.title) setTitle(autoSeoResponse.title);
|
||||
if (autoSeoResponse.description) setDescription(autoSeoResponse.description);
|
||||
if (autoSeoResponse.keywords) setTags(autoSeoResponse.keywords.join(','));
|
||||
seoCache.current.set(video.task_id, {
|
||||
seoCache.current.set(seoKey, {
|
||||
title: autoSeoResponse.title || '',
|
||||
description: autoSeoResponse.description || '',
|
||||
tags: autoSeoResponse.keywords?.join(',') || '',
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('Failed to load autocomplete:', error);
|
||||
// 실패해도 사용자에게 별도 알림 없이 조용히 처리
|
||||
} finally {
|
||||
setIsLoadingAutoDescription(false);
|
||||
}
|
||||
@@ -351,6 +340,9 @@ const SocialPostingModal: React.FC<SocialPostingModalProps> = ({
|
||||
}
|
||||
|
||||
const requestPayload = {
|
||||
// 종류를 함께 보낸다 — 없으면 백엔드가 video 로 간주해, 썰박스 항목에서는
|
||||
// id 가 겹치는 엉뚱한 ADO2 영상이 업로드된다.
|
||||
content_type: video.type,
|
||||
video_id: video.video_id,
|
||||
social_account_id: selectedAcc.id,
|
||||
title: title.trim(),
|
||||
@@ -380,7 +372,7 @@ const SocialPostingModal: React.FC<SocialPostingModalProps> = ({
|
||||
} else {
|
||||
// 즉시 업로드: 완료될 때까지 폴링
|
||||
const result = await waitForUploadComplete(
|
||||
uploadResponse.upload_id,
|
||||
uploadResponse.upload_id.toString(),
|
||||
(status, progress) => {
|
||||
setUploadStatus(status as UploadStatus);
|
||||
setUploadProgress(progress || 0);
|
||||
@@ -442,6 +434,8 @@ const SocialPostingModal: React.FC<SocialPostingModalProps> = ({
|
||||
resetForm();
|
||||
};
|
||||
|
||||
const overlayCloseHandlers = useOverlayClose(handleClose);
|
||||
|
||||
const selectedAccount = socialAccounts.find(acc => acc.platform_user_id === selectedChannel);
|
||||
|
||||
const privacyOptions = [
|
||||
@@ -473,23 +467,13 @@ const SocialPostingModal: React.FC<SocialPostingModalProps> = ({
|
||||
return (
|
||||
<>
|
||||
{showUploadProgress && uploadProgressModalElement}
|
||||
{tutorial.isActive && (
|
||||
<TutorialOverlay
|
||||
hints={tutorial.hints}
|
||||
currentIndex={tutorial.currentHintIndex}
|
||||
onNext={tutorial.nextHint}
|
||||
onPrev={tutorial.prevHint}
|
||||
onSkip={tutorial.skipTutorial}
|
||||
groupProgress={tutorial.groupProgress}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="social-posting-overlay" onClick={handleClose}>
|
||||
<div className="social-posting-overlay" {...overlayCloseHandlers}>
|
||||
<div className="social-posting-modal" onClick={(e) => e.stopPropagation()}>
|
||||
{/* Header */}
|
||||
<div className="social-posting-header">
|
||||
@@ -859,16 +843,6 @@ const SocialPostingModal: React.FC<SocialPostingModalProps> = ({
|
||||
</div>
|
||||
</div>
|
||||
{uploadProgressModalElement}
|
||||
{tutorial.isActive && (
|
||||
<TutorialOverlay
|
||||
hints={tutorial.hints}
|
||||
currentIndex={tutorial.currentHintIndex}
|
||||
onNext={tutorial.nextHint}
|
||||
onPrev={tutorial.prevHint}
|
||||
onSkip={tutorial.skipTutorial}
|
||||
groupProgress={tutorial.groupProgress}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -1,314 +0,0 @@
|
||||
import React, { useEffect, useState, useCallback } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { TutorialHint } from './tutorialSteps';
|
||||
|
||||
interface Rect {
|
||||
top: number;
|
||||
left: number;
|
||||
width: number;
|
||||
height: number;
|
||||
bottom: number;
|
||||
}
|
||||
|
||||
interface TooltipPos {
|
||||
top: number;
|
||||
left: number;
|
||||
}
|
||||
|
||||
interface TutorialOverlayProps {
|
||||
hints: TutorialHint[];
|
||||
currentIndex: number;
|
||||
onNext: () => void;
|
||||
onPrev: () => void;
|
||||
onSkip: () => void;
|
||||
groupProgress?: { groupTotal: number; groupOffset: number; isLastKeyInGroup: boolean } | null;
|
||||
}
|
||||
|
||||
const PADDING = 8;
|
||||
|
||||
function getTargetRect(selector: string): Rect | null {
|
||||
const els = Array.from(document.querySelectorAll(selector));
|
||||
const el = els.find(e => {
|
||||
const r = (e as HTMLElement).getBoundingClientRect();
|
||||
return r.width > 0 && r.height > 0;
|
||||
}) ?? els[0];
|
||||
if (!el) return null;
|
||||
const r = el.getBoundingClientRect();
|
||||
return { top: r.top, left: r.left, width: r.width, height: r.height, bottom: r.bottom };
|
||||
}
|
||||
|
||||
function getSpotlightRect(
|
||||
rect: Rect,
|
||||
padding: number,
|
||||
override?: { top?: number; right?: number; bottom?: number; left?: number }
|
||||
): Rect {
|
||||
const pTop = override?.top ?? padding;
|
||||
const pRight = override?.right ?? padding;
|
||||
const pBottom = override?.bottom ?? padding;
|
||||
const pLeft = override?.left ?? padding;
|
||||
const left = Math.max(0, Math.floor(rect.left - pLeft));
|
||||
const top = Math.max(0, Math.floor(rect.top - pTop));
|
||||
const right = Math.min(window.innerWidth, Math.ceil(rect.left + rect.width + pRight));
|
||||
const bottom = Math.min(window.innerHeight, Math.ceil(rect.top + rect.height + pBottom));
|
||||
|
||||
return {
|
||||
top,
|
||||
bottom,
|
||||
left,
|
||||
width: Math.max(0, right - left),
|
||||
height: Math.max(0, bottom - top),
|
||||
};
|
||||
}
|
||||
|
||||
function calcTooltipPos(rect: Rect, position: TutorialHint['position'], tooltipW = 300, tooltipH = 160): TooltipPos {
|
||||
|
||||
switch (position) {
|
||||
case 'bottom':
|
||||
return {
|
||||
top: Math.min(rect.top + rect.height + PADDING, window.innerHeight - tooltipH - 8),
|
||||
left: Math.min(Math.max(rect.left + rect.width / 2 - tooltipW / 2, 8), window.innerWidth - tooltipW - 8),
|
||||
};
|
||||
case 'top':
|
||||
return {
|
||||
top: Math.max(rect.top - tooltipH - PADDING, 8),
|
||||
left: Math.min(Math.max(rect.left + rect.width / 2 - tooltipW / 2, 8), window.innerWidth - tooltipW - 8),
|
||||
};
|
||||
case 'right':
|
||||
return {
|
||||
top: Math.min(Math.max(rect.top + rect.height / 2 - tooltipH / 2, 8), window.innerHeight - tooltipH - 8),
|
||||
left: Math.min(rect.left + rect.width + PADDING, window.innerWidth - tooltipW - 8),
|
||||
};
|
||||
case 'left':
|
||||
return {
|
||||
top: Math.min(Math.max(rect.top + rect.height / 2 - tooltipH / 2, 8), window.innerHeight - tooltipH - 8),
|
||||
left: Math.max(rect.left - tooltipW - PADDING, 8),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
const TutorialOverlay: React.FC<TutorialOverlayProps> = ({
|
||||
hints,
|
||||
currentIndex,
|
||||
onNext,
|
||||
onPrev,
|
||||
onSkip,
|
||||
groupProgress,
|
||||
}) => {
|
||||
const { t } = useTranslation();
|
||||
const [targetRect, setTargetRect] = useState<Rect | null>(null);
|
||||
const tooltipRef = React.useRef<HTMLDivElement>(null);
|
||||
const [tooltipSize, setTooltipSize] = useState({ w: 300, h: 160 });
|
||||
|
||||
const hint = hints[currentIndex];
|
||||
const isLast = currentIndex === hints.length - 1;
|
||||
// 그룹이 있으면 그룹의 마지막 키 + 마지막 힌트일 때만 완료, 그룹 없으면 기존대로
|
||||
const isFinish = isLast && (groupProgress ? groupProgress.isLastKeyInGroup : true);
|
||||
|
||||
const updateRect = useCallback(() => {
|
||||
if (!hint) return;
|
||||
setTargetRect(getTargetRect(hint.targetSelector));
|
||||
}, [hint]);
|
||||
|
||||
useEffect(() => {
|
||||
updateRect();
|
||||
window.addEventListener('resize', updateRect);
|
||||
window.addEventListener('scroll', updateRect, true);
|
||||
return () => {
|
||||
window.removeEventListener('resize', updateRect);
|
||||
window.removeEventListener('scroll', updateRect, true);
|
||||
};
|
||||
}, [updateRect]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!hint) return;
|
||||
let retryTimer: number | undefined;
|
||||
let rectTimer: number | undefined;
|
||||
let cleanupTarget: (() => void) | undefined;
|
||||
|
||||
const bindToTarget = (el: HTMLElement) => {
|
||||
el.scrollIntoView({ behavior: 'smooth', block: 'center' });
|
||||
rectTimer = window.setTimeout(updateRect, 200);
|
||||
|
||||
const shouldClickAdvance = hint.clickToAdvance !== false;
|
||||
if (shouldClickAdvance) {
|
||||
el.style.cursor = 'pointer';
|
||||
el.addEventListener('click', onNext);
|
||||
cleanupTarget = () => {
|
||||
el.style.cursor = '';
|
||||
el.removeEventListener('click', onNext);
|
||||
};
|
||||
} else {
|
||||
cleanupTarget = () => {};
|
||||
}
|
||||
};
|
||||
|
||||
const tryBind = (): boolean => {
|
||||
const els = Array.from(document.querySelectorAll(hint.targetSelector));
|
||||
const el = (els.find(e => {
|
||||
const r = (e as HTMLElement).getBoundingClientRect();
|
||||
return r.width > 0 && r.height > 0;
|
||||
}) ?? els[0]) as HTMLElement | null;
|
||||
if (!el) return false;
|
||||
bindToTarget(el);
|
||||
return true;
|
||||
};
|
||||
|
||||
if (!tryBind()) {
|
||||
retryTimer = window.setInterval(() => {
|
||||
if (tryBind() && retryTimer) {
|
||||
window.clearInterval(retryTimer);
|
||||
retryTimer = undefined;
|
||||
}
|
||||
}, 80);
|
||||
}
|
||||
|
||||
return () => {
|
||||
if (retryTimer) window.clearInterval(retryTimer);
|
||||
if (rectTimer) window.clearTimeout(rectTimer);
|
||||
cleanupTarget?.();
|
||||
};
|
||||
}, [hint, updateRect, onNext]);
|
||||
|
||||
// 툴팁 DOM 크기 측정 — 힌트가 바뀔 때만 재측정
|
||||
useEffect(() => {
|
||||
const el = tooltipRef.current;
|
||||
if (!el) return;
|
||||
const { offsetWidth, offsetHeight } = el;
|
||||
if (offsetWidth && offsetHeight) {
|
||||
setTooltipSize(prev =>
|
||||
prev.w === offsetWidth && prev.h === offsetHeight
|
||||
? prev
|
||||
: { w: offsetWidth, h: offsetHeight }
|
||||
);
|
||||
}
|
||||
}, [currentIndex, hints]);
|
||||
|
||||
if (!hint) return null;
|
||||
|
||||
const isTargetVisible = targetRect
|
||||
? targetRect.top + 60 < window.innerHeight && targetRect.bottom > 60
|
||||
: true;
|
||||
|
||||
if (!isTargetVisible) return null;
|
||||
|
||||
const spotlightPadding = hint.spotlightPadding ?? PADDING;
|
||||
const spotlightRect = (targetRect && !hint.noSpotlight) ? getSpotlightRect(targetRect, spotlightPadding, hint.spotlightPaddingOverride) : null;
|
||||
|
||||
// 툴팁은 spotlightRect 기준으로 배치해야 스포트라이트와 겹치지 않음
|
||||
const tooltipPos: TooltipPos = (spotlightRect ?? targetRect)
|
||||
? calcTooltipPos((spotlightRect ?? targetRect)!, hint.position, tooltipSize.w, tooltipSize.h)
|
||||
: {
|
||||
top: window.innerHeight / 2 - tooltipSize.h / 2,
|
||||
left: window.innerWidth / 2 - tooltipSize.w / 2,
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="tutorial-overlay-root">
|
||||
{spotlightRect ? (
|
||||
<>
|
||||
<div
|
||||
className="tutorial-overlay-blocker"
|
||||
style={{ top: 0, left: 0, right: 0, height: spotlightRect.top }}
|
||||
/>
|
||||
<div
|
||||
className="tutorial-overlay-blocker"
|
||||
style={{
|
||||
top: spotlightRect.top,
|
||||
left: 0,
|
||||
width: spotlightRect.left,
|
||||
height: spotlightRect.height,
|
||||
}}
|
||||
/>
|
||||
<div
|
||||
className="tutorial-overlay-blocker"
|
||||
style={{
|
||||
top: spotlightRect.top,
|
||||
left: spotlightRect.left + spotlightRect.width,
|
||||
right: 0,
|
||||
height: spotlightRect.height,
|
||||
}}
|
||||
/>
|
||||
<div
|
||||
className="tutorial-overlay-blocker"
|
||||
style={{
|
||||
top: spotlightRect.top + spotlightRect.height,
|
||||
left: 0,
|
||||
right: 0,
|
||||
bottom: 0,
|
||||
}}
|
||||
/>
|
||||
<div
|
||||
className="tutorial-spotlight-ring"
|
||||
style={{
|
||||
top: spotlightRect.top,
|
||||
left: spotlightRect.left,
|
||||
width: spotlightRect.width,
|
||||
height: spotlightRect.height,
|
||||
}}
|
||||
/>
|
||||
</>
|
||||
) : null}
|
||||
|
||||
<div
|
||||
ref={tooltipRef}
|
||||
className={`tutorial-tooltip${hint.variant === 'bubble' ? ` tutorial-tooltip-bubble tutorial-tooltip-bubble--${hint.position}` : ''}`}
|
||||
style={{ top: tooltipPos.top, left: tooltipPos.left }}
|
||||
onClick={(e) => e.stopPropagation()}
|
||||
>
|
||||
<p className="tutorial-tooltip-title">{t(hint.titleKey)}</p>
|
||||
<p className="tutorial-tooltip-desc">{t(hint.descriptionKey)}</p>
|
||||
{hint.noteKey && (
|
||||
<p className="tutorial-tooltip-note">{t(hint.noteKey)}</p>
|
||||
)}
|
||||
|
||||
<div className="tutorial-tooltip-footer">
|
||||
<span className="tutorial-tooltip-counter">
|
||||
{groupProgress ? groupProgress.groupOffset + 1 : currentIndex + 1} / {groupProgress ? groupProgress.groupTotal : hints.length}
|
||||
</span>
|
||||
<div className="tutorial-tooltip-actions">
|
||||
<button className="tutorial-btn-skip" onClick={onSkip}>
|
||||
{t('tutorial.skip')}
|
||||
</button>
|
||||
{currentIndex > 0 && (
|
||||
<button className="tutorial-btn-prev" onClick={onPrev}>
|
||||
{t('tutorial.prev')}
|
||||
</button>
|
||||
)}
|
||||
{(hint.clickToAdvance !== true || isFinish) && (
|
||||
<button className="tutorial-btn-next" onClick={onNext}>
|
||||
{isFinish ? t('tutorial.finish') : t('tutorial.next')}
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default TutorialOverlay;
|
||||
|
||||
interface TutorialRestartPopupProps {
|
||||
onConfirm: () => void;
|
||||
onCancel: () => void;
|
||||
}
|
||||
|
||||
export const TutorialRestartPopup: React.FC<TutorialRestartPopupProps> = ({ onConfirm, onCancel }) => {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<div className="tutorial-restart-backdrop">
|
||||
<div className="tutorial-restart-popup" onClick={(e) => e.stopPropagation()}>
|
||||
<p className="tutorial-restart-title">{t('tutorial.restart.title')}</p>
|
||||
<p className="tutorial-restart-desc">{t('tutorial.restart.desc')}</p>
|
||||
<div className="tutorial-restart-actions">
|
||||
<button className="tutorial-restart-cancel" onClick={onCancel}>
|
||||
{t('tutorial.restart.cancel')}
|
||||
</button>
|
||||
<button className="tutorial-restart-confirm" onClick={onConfirm}>
|
||||
{t('tutorial.restart.confirm')}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
@@ -1,349 +0,0 @@
|
||||
export interface TutorialHint {
|
||||
targetSelector: string;
|
||||
titleKey: string;
|
||||
descriptionKey: string;
|
||||
position: 'top' | 'bottom' | 'left' | 'right';
|
||||
noteKey?: string;
|
||||
variant?: 'bubble';
|
||||
clickToAdvance?: boolean;
|
||||
advanceSelector?: string;
|
||||
noSpotlight?: boolean;
|
||||
spotlightPadding?: number;
|
||||
spotlightPaddingOverride?: { top?: number; right?: number; bottom?: number; left?: number };
|
||||
}
|
||||
|
||||
export interface TutorialStepDef {
|
||||
key: string;
|
||||
hints: TutorialHint[];
|
||||
}
|
||||
|
||||
export const TUTORIAL_KEYS = {
|
||||
LANDING: 'landing',
|
||||
ANALYSIS: 'analysis',
|
||||
ASSET: 'asset',
|
||||
SOUND: 'sound',
|
||||
SOUND_LYRICS: 'soundLyrics',
|
||||
SOUND_AUDIO: 'soundAudio',
|
||||
GENERATING:'generating',
|
||||
COMPLETION: 'completion',
|
||||
MY_INFO: 'myInfo',
|
||||
ADO2_CONTENTS: 'ado2Contents',
|
||||
UPLOAD_MODAL: 'uploadModal',
|
||||
UPLOAD_FORM: 'uploadForm',
|
||||
DASHBOARD: 'dashboard',
|
||||
CONTENT_CALENDAR: 'contentCalendar',
|
||||
FEEDBACK: 'feedback',
|
||||
} as const;
|
||||
|
||||
// 같은 페이지에 속하는 튜토리얼 키 그룹 — 진행 카운터를 합산해서 표시
|
||||
export const TUTORIAL_PAGE_GROUPS: string[][] = [
|
||||
[TUTORIAL_KEYS.SOUND, TUTORIAL_KEYS.SOUND_LYRICS, TUTORIAL_KEYS.SOUND_AUDIO],
|
||||
[TUTORIAL_KEYS.GENERATING, TUTORIAL_KEYS.COMPLETION],
|
||||
[TUTORIAL_KEYS.UPLOAD_MODAL, TUTORIAL_KEYS.UPLOAD_FORM],
|
||||
];
|
||||
|
||||
export const tutorialSteps: TutorialStepDef[] = [
|
||||
{
|
||||
key: TUTORIAL_KEYS.LANDING,
|
||||
hints: [],
|
||||
},
|
||||
{
|
||||
key: TUTORIAL_KEYS.ASSET,
|
||||
hints: [
|
||||
{
|
||||
targetSelector: '.asset-column.asset-column-left',
|
||||
titleKey: 'tutorial.asset.image.title',
|
||||
descriptionKey: 'tutorial.asset.image.desc',
|
||||
position: 'left',
|
||||
clickToAdvance: false,
|
||||
},
|
||||
{
|
||||
targetSelector: '.asset-upload-zone, .asset-mobile-upload-btn',
|
||||
titleKey: 'tutorial.asset.upload.title',
|
||||
descriptionKey: 'tutorial.asset.upload.desc',
|
||||
position: 'bottom',
|
||||
clickToAdvance: false,
|
||||
},
|
||||
{
|
||||
targetSelector: '.asset-ratio-section',
|
||||
titleKey: 'tutorial.asset.ratio.title',
|
||||
descriptionKey: 'tutorial.asset.ratio.desc',
|
||||
position: 'top',
|
||||
clickToAdvance: false,
|
||||
},
|
||||
{
|
||||
targetSelector: '.asset-next-button',
|
||||
titleKey: 'tutorial.asset.next.title',
|
||||
descriptionKey: 'tutorial.asset.next.desc',
|
||||
position: 'top',
|
||||
clickToAdvance: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
key: TUTORIAL_KEYS.SOUND,
|
||||
hints: [
|
||||
{
|
||||
targetSelector: '.genre-grid',
|
||||
titleKey: 'tutorial.sound.genre.title',
|
||||
descriptionKey: 'tutorial.sound.genre.desc',
|
||||
position: 'top',
|
||||
clickToAdvance: false,
|
||||
},
|
||||
{
|
||||
targetSelector: '.language-grid',
|
||||
titleKey: 'tutorial.sound.language.title',
|
||||
descriptionKey: 'tutorial.sound.language.desc',
|
||||
position: 'top',
|
||||
clickToAdvance: false,
|
||||
},
|
||||
{
|
||||
targetSelector: '.btn-generate-sound',
|
||||
titleKey: 'tutorial.sound.generate.title',
|
||||
descriptionKey: 'tutorial.sound.generate.desc',
|
||||
position: 'top',
|
||||
clickToAdvance: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
key: TUTORIAL_KEYS.SOUND_LYRICS,
|
||||
hints: [
|
||||
{
|
||||
targetSelector: '.lyrics-display',
|
||||
titleKey: 'tutorial.sound.lyrics.title',
|
||||
descriptionKey: 'tutorial.sound.lyrics.desc',
|
||||
position: 'top',
|
||||
clickToAdvance: false,
|
||||
},
|
||||
{
|
||||
targetSelector: '.status-message-new',
|
||||
titleKey: 'tutorial.sound.lyricsWait.title',
|
||||
descriptionKey: 'tutorial.sound.lyricsWait.desc',
|
||||
position: 'top',
|
||||
clickToAdvance: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
key: TUTORIAL_KEYS.SOUND_AUDIO,
|
||||
hints: [
|
||||
{
|
||||
targetSelector: '.audio-player',
|
||||
titleKey: 'tutorial.sound.audioPlayer.title',
|
||||
descriptionKey: 'tutorial.sound.audioPlayer.desc',
|
||||
position: 'bottom',
|
||||
clickToAdvance: false,
|
||||
},
|
||||
{
|
||||
targetSelector: '.btn-video-generate',
|
||||
titleKey: 'tutorial.sound.video.title',
|
||||
descriptionKey: 'tutorial.sound.video.desc',
|
||||
position: 'top',
|
||||
clickToAdvance: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
key: TUTORIAL_KEYS.MY_INFO,
|
||||
hints: [
|
||||
{
|
||||
targetSelector: '.youtube-connect-section',
|
||||
titleKey: 'tutorial.myInfo.myInfo.title',
|
||||
descriptionKey: 'tutorial.myInfo.myInfo.desc',
|
||||
position: 'top',
|
||||
clickToAdvance: false,
|
||||
},
|
||||
{
|
||||
targetSelector: '.myinfo-social-btn',
|
||||
titleKey: 'tutorial.myInfo.connect.title',
|
||||
descriptionKey: 'tutorial.myInfo.connect.desc',
|
||||
noteKey: 'tutorial.myInfo.connect.note',
|
||||
position: 'top',
|
||||
clickToAdvance: true,
|
||||
},
|
||||
{
|
||||
targetSelector: '.myinfo-connected-accounts',
|
||||
titleKey: 'tutorial.myInfo.connected.title',
|
||||
descriptionKey: 'tutorial.myInfo.connected.desc',
|
||||
position: 'top',
|
||||
clickToAdvance: false,
|
||||
},
|
||||
{
|
||||
targetSelector: '#sidebar-ado2-contents',
|
||||
titleKey: 'tutorial.myInfo.ado2.title',
|
||||
descriptionKey: 'tutorial.myInfo.ado2.desc',
|
||||
position: 'right',
|
||||
clickToAdvance: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
key: TUTORIAL_KEYS.ADO2_CONTENTS,
|
||||
hints: [
|
||||
{
|
||||
targetSelector: '.ado2-content-card',
|
||||
titleKey: 'tutorial.ado2.list.title',
|
||||
descriptionKey: 'tutorial.ado2.list.desc',
|
||||
position: 'right',
|
||||
clickToAdvance: false,
|
||||
},
|
||||
{
|
||||
targetSelector: '.content-upload-btn',
|
||||
titleKey: 'tutorial.ado2.download.title',
|
||||
descriptionKey: 'tutorial.ado2.download.desc',
|
||||
position: 'top',
|
||||
clickToAdvance: false,
|
||||
},
|
||||
{
|
||||
targetSelector: '.content-delete-btn',
|
||||
titleKey: 'tutorial.ado2.delete.title',
|
||||
descriptionKey: 'tutorial.ado2.delete.desc',
|
||||
position: 'top',
|
||||
clickToAdvance: false,
|
||||
},
|
||||
{
|
||||
targetSelector: '.content-download-btn',
|
||||
titleKey: 'tutorial.ado2.upload.title',
|
||||
descriptionKey: 'tutorial.ado2.upload.desc',
|
||||
position: 'top',
|
||||
clickToAdvance: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
key: TUTORIAL_KEYS.GENERATING,
|
||||
hints:[
|
||||
{
|
||||
targetSelector: '.comp2-info-section',
|
||||
titleKey: 'tutorial.completion.contentInfo.title',
|
||||
descriptionKey: 'tutorial.completion.contentInfo.desc',
|
||||
position: 'left',
|
||||
},
|
||||
{
|
||||
targetSelector: '.comp2-video-section',
|
||||
titleKey: 'tutorial.completion.generating.title',
|
||||
descriptionKey: 'tutorial.completion.generating.desc',
|
||||
position: 'top',
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
key: TUTORIAL_KEYS.COMPLETION,
|
||||
hints: [
|
||||
{
|
||||
targetSelector: '.comp2-video-section',
|
||||
titleKey: 'tutorial.completion.completion.title',
|
||||
descriptionKey: 'tutorial.completion.completion.desc',
|
||||
position: 'top',
|
||||
clickToAdvance: false,
|
||||
},
|
||||
{
|
||||
targetSelector: '#sidebar-my-info',
|
||||
titleKey: 'tutorial.completion.myInfo.title',
|
||||
descriptionKey: 'tutorial.completion.myInfo.desc',
|
||||
position: 'right',
|
||||
clickToAdvance: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
key: TUTORIAL_KEYS.UPLOAD_MODAL,
|
||||
hints: [
|
||||
{
|
||||
targetSelector: '.social-posting-content',
|
||||
titleKey: 'tutorial.upload.seo.title',
|
||||
descriptionKey: 'tutorial.upload.seo.desc',
|
||||
position: 'right',
|
||||
clickToAdvance: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
key: TUTORIAL_KEYS.UPLOAD_FORM,
|
||||
hints: [
|
||||
{
|
||||
targetSelector: '.social-posting-form',
|
||||
titleKey: 'tutorial.upload.required.title',
|
||||
descriptionKey: 'tutorial.upload.required.desc',
|
||||
position: 'top',
|
||||
clickToAdvance: false,
|
||||
},
|
||||
{
|
||||
targetSelector: '.social-posting-radio-group',
|
||||
titleKey: 'tutorial.upload.schedule.title',
|
||||
descriptionKey: 'tutorial.upload.schedule.desc',
|
||||
position: 'top',
|
||||
clickToAdvance: false,
|
||||
},
|
||||
{
|
||||
targetSelector: '.social-posting-btn:not(.cancel)',
|
||||
titleKey: 'tutorial.upload.submit.title',
|
||||
descriptionKey: 'tutorial.upload.submit.desc',
|
||||
position: 'top',
|
||||
clickToAdvance: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
key: TUTORIAL_KEYS.DASHBOARD,
|
||||
hints: [
|
||||
{
|
||||
targetSelector: '.stats-grid-8',
|
||||
titleKey: 'tutorial.dashboard.metrics.title',
|
||||
descriptionKey: 'tutorial.dashboard.metrics.desc',
|
||||
position: 'bottom',
|
||||
},
|
||||
{
|
||||
targetSelector: '.yoy-chart-card',
|
||||
titleKey: 'tutorial.dashboard.chart.title',
|
||||
descriptionKey: 'tutorial.dashboard.chart.desc',
|
||||
position: 'top',
|
||||
},
|
||||
{
|
||||
targetSelector: '.tutorial-center-anchor',
|
||||
titleKey: 'tutorial.dashboard.more.title',
|
||||
descriptionKey: 'tutorial.dashboard.more.desc',
|
||||
position: 'bottom',
|
||||
clickToAdvance: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
key: TUTORIAL_KEYS.CONTENT_CALENDAR,
|
||||
hints: [
|
||||
{
|
||||
targetSelector: '.calendar-grid-area',
|
||||
titleKey: 'tutorial.contentCalendar.grid.title',
|
||||
descriptionKey: 'tutorial.contentCalendar.grid.desc',
|
||||
position: 'top',
|
||||
clickToAdvance: false,
|
||||
},
|
||||
{
|
||||
targetSelector: '.calendar-side-panel',
|
||||
titleKey: 'tutorial.contentCalendar.panel.title',
|
||||
descriptionKey: 'tutorial.contentCalendar.panel.desc',
|
||||
position: 'left',
|
||||
clickToAdvance: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
key: TUTORIAL_KEYS.FEEDBACK,
|
||||
hints: [
|
||||
{
|
||||
targetSelector: '.tutorial-center-anchor',
|
||||
titleKey: 'tutorial.feedback.complete.title',
|
||||
descriptionKey: 'tutorial.feedback.complete.desc',
|
||||
position: 'bottom',
|
||||
clickToAdvance: false,
|
||||
},
|
||||
{
|
||||
targetSelector: '.sidebar-inquiry-btn',
|
||||
titleKey: 'tutorial.feedback.title',
|
||||
descriptionKey: 'tutorial.feedback.desc',
|
||||
position: 'right',
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
@@ -1,220 +0,0 @@
|
||||
import React, { useState, useCallback, useEffect } from 'react';
|
||||
import { tutorialSteps, TutorialHint, TUTORIAL_PAGE_GROUPS } from './tutorialSteps';
|
||||
|
||||
// 현재 키가 속한 그룹의 전체 힌트 수와 현재까지의 offset 반환
|
||||
function getGroupProgress(key: string, currentIndex: number): { groupTotal: number; groupOffset: number; isLastKeyInGroup: boolean } | null {
|
||||
const group = TUTORIAL_PAGE_GROUPS.find(g => g.includes(key));
|
||||
if (!group) return null;
|
||||
let offset = 0;
|
||||
let total = 0;
|
||||
for (const k of group) {
|
||||
const step = tutorialSteps.find(s => s.key === k);
|
||||
const count = step?.hints.length ?? 0;
|
||||
if (k === key) offset = total;
|
||||
total += count;
|
||||
}
|
||||
const isLastKeyInGroup = group[group.length - 1] === key;
|
||||
return { groupTotal: total, groupOffset: offset + currentIndex, isLastKeyInGroup };
|
||||
}
|
||||
|
||||
const SEEN_KEY = 'ado2_tutorial_seen';
|
||||
const PROGRESS_KEY = 'ado2_tutorial_progress';
|
||||
const ENABLED_KEY = 'ado2_tutorial_enabled';
|
||||
|
||||
// 전역 단일 활성 튜토리얼 관리 — 새 튜토리얼 시작 시 이전 것을 skip 처리
|
||||
let globalSkip: (() => void) | null = null;
|
||||
|
||||
function getSeenKeys(): string[] {
|
||||
try {
|
||||
return JSON.parse(localStorage.getItem(SEEN_KEY) || '[]');
|
||||
} catch {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
function markSeen(key: string) {
|
||||
const seen = getSeenKeys();
|
||||
if (!seen.includes(key)) {
|
||||
localStorage.setItem(SEEN_KEY, JSON.stringify([...seen, key]));
|
||||
}
|
||||
clearProgress(key);
|
||||
}
|
||||
|
||||
function saveProgress(key: string, index: number) {
|
||||
try {
|
||||
const progress = JSON.parse(localStorage.getItem(PROGRESS_KEY) || '{}');
|
||||
progress[key] = index;
|
||||
localStorage.setItem(PROGRESS_KEY, JSON.stringify(progress));
|
||||
} catch {}
|
||||
}
|
||||
|
||||
function loadProgress(key: string): number {
|
||||
try {
|
||||
const progress = JSON.parse(localStorage.getItem(PROGRESS_KEY) || '{}');
|
||||
return progress[key] ?? 0;
|
||||
} catch {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
function clearProgress(key: string) {
|
||||
try {
|
||||
const progress = JSON.parse(localStorage.getItem(PROGRESS_KEY) || '{}');
|
||||
delete progress[key];
|
||||
localStorage.setItem(PROGRESS_KEY, JSON.stringify(progress));
|
||||
} catch {}
|
||||
}
|
||||
|
||||
interface UseTutorialReturn {
|
||||
isActive: boolean;
|
||||
isEnabled: boolean;
|
||||
isRestartPopupVisible: boolean;
|
||||
currentHintIndex: number;
|
||||
hints: TutorialHint[];
|
||||
tutorialKey: string | null;
|
||||
groupProgress: { groupTotal: number; groupOffset: number; isLastKeyInGroup: boolean } | null;
|
||||
startTutorial: (key: string, onComplete?: () => void, forceFromStart?: boolean) => void;
|
||||
nextHint: () => void;
|
||||
prevHint: () => void;
|
||||
skipTutorial: () => void;
|
||||
toggleTutorial: (currentKey: string | null) => void;
|
||||
showRestartPopup: (key: string) => void;
|
||||
confirmRestart: () => void;
|
||||
cancelRestart: () => void;
|
||||
hasSeen: (key: string) => boolean;
|
||||
}
|
||||
|
||||
export function useTutorial(): UseTutorialReturn {
|
||||
const [isActive, setIsActive] = useState(false);
|
||||
const [isEnabled, setIsEnabled] = useState(() => localStorage.getItem(ENABLED_KEY) !== 'false');
|
||||
const [isRestartPopupVisible, setIsRestartPopupVisible] = useState(false);
|
||||
const [pendingRestartKey, setPendingRestartKey] = useState<string | null>(null);
|
||||
const [currentHintIndex, setCurrentHintIndex] = useState(0);
|
||||
const [hints, setHints] = useState<TutorialHint[]>([]);
|
||||
const [tutorialKey, setTutorialKey] = useState<string | null>(null);
|
||||
const onCompleteRef = React.useRef<(() => void) | undefined>(undefined);
|
||||
|
||||
const startTutorial = useCallback((key: string, onComplete?: () => void, forceFromStart?: boolean) => {
|
||||
if (localStorage.getItem(ENABLED_KEY) === 'false') return;
|
||||
const step = tutorialSteps.find(s => s.key === key);
|
||||
if (!step || step.hints.length === 0) return;
|
||||
// 다른 인스턴스에서 활성화된 튜토리얼이 있으면 skip 처리
|
||||
globalSkip?.();
|
||||
const savedIndex = forceFromStart ? 0 : loadProgress(key);
|
||||
const resumeIndex = savedIndex < step.hints.length ? savedIndex : 0;
|
||||
onCompleteRef.current = onComplete;
|
||||
setHints(step.hints);
|
||||
setTutorialKey(key);
|
||||
setCurrentHintIndex(resumeIndex);
|
||||
setIsActive(true);
|
||||
// 이 인스턴스의 skip을 전역에 등록
|
||||
globalSkip = () => {
|
||||
if (key) saveProgress(key, resumeIndex);
|
||||
setIsActive(false);
|
||||
setCurrentHintIndex(0);
|
||||
globalSkip = null;
|
||||
};
|
||||
}, []);
|
||||
|
||||
const nextHint = useCallback(() => {
|
||||
setCurrentHintIndex(prev => {
|
||||
if (prev < hints.length - 1) {
|
||||
const next = prev + 1;
|
||||
if (tutorialKey) saveProgress(tutorialKey, next);
|
||||
return next;
|
||||
}
|
||||
// 마지막 힌트 완료 → seen 기록 + 진행 상태 삭제
|
||||
setIsActive(false);
|
||||
if (tutorialKey) markSeen(tutorialKey);
|
||||
globalSkip = null; // 완료된 튜토리얼은 globalSkip 해제
|
||||
onCompleteRef.current?.();
|
||||
onCompleteRef.current = undefined;
|
||||
return 0;
|
||||
});
|
||||
}, [hints.length, tutorialKey]);
|
||||
|
||||
const prevHint = useCallback(() => {
|
||||
setCurrentHintIndex(prev => Math.max(0, prev - 1));
|
||||
}, []);
|
||||
|
||||
// 건너뛰기: 현재 진행 인덱스 저장 후 오버레이 닫기 → 다음 방문 시 이어서 표시
|
||||
const skipTutorial = useCallback(() => {
|
||||
if (tutorialKey) saveProgress(tutorialKey, currentHintIndex);
|
||||
setIsActive(false);
|
||||
setCurrentHintIndex(0);
|
||||
}, [tutorialKey, currentHintIndex]);
|
||||
|
||||
const toggleTutorial = useCallback((currentKey: string | null) => {
|
||||
if (isEnabled) {
|
||||
// off: 튜토리얼 중단 + 비활성화
|
||||
setIsActive(false);
|
||||
setIsEnabled(false);
|
||||
localStorage.setItem(ENABLED_KEY, 'false');
|
||||
} else {
|
||||
// on: seen/progress 초기화 + 현재 화면 튜토리얼 시작
|
||||
localStorage.removeItem(SEEN_KEY);
|
||||
localStorage.removeItem(PROGRESS_KEY);
|
||||
localStorage.setItem(ENABLED_KEY, 'true');
|
||||
setIsEnabled(true);
|
||||
if (currentKey) {
|
||||
startTutorial(currentKey, undefined, true);
|
||||
}
|
||||
}
|
||||
}, [isEnabled, startTutorial]);
|
||||
|
||||
// 튜토리얼 다시 보기: 팝업 표시만
|
||||
const showRestartPopup = useCallback((key: string) => {
|
||||
setPendingRestartKey(key);
|
||||
setIsRestartPopupVisible(true);
|
||||
}, []);
|
||||
|
||||
// 팝업에서 확인 → seen/progress 초기화 후 튜토리얼 시작
|
||||
const confirmRestart = useCallback(() => {
|
||||
setIsRestartPopupVisible(false);
|
||||
if (pendingRestartKey) {
|
||||
localStorage.removeItem(SEEN_KEY);
|
||||
localStorage.removeItem(PROGRESS_KEY);
|
||||
startTutorial(pendingRestartKey, undefined, true);
|
||||
}
|
||||
setPendingRestartKey(null);
|
||||
}, [pendingRestartKey, startTutorial]);
|
||||
|
||||
// 팝업에서 취소
|
||||
const cancelRestart = useCallback(() => {
|
||||
setIsRestartPopupVisible(false);
|
||||
setPendingRestartKey(null);
|
||||
}, []);
|
||||
|
||||
const hasSeen = useCallback((key: string) => {
|
||||
return getSeenKeys().includes(key);
|
||||
}, []);
|
||||
|
||||
// 영상 보유 사용자 자동 off 이벤트 수신
|
||||
useEffect(() => {
|
||||
const handler = () => {
|
||||
setIsActive(false);
|
||||
setIsEnabled(false);
|
||||
};
|
||||
window.addEventListener('ado2-tutorial-auto-disable', handler);
|
||||
return () => window.removeEventListener('ado2-tutorial-auto-disable', handler);
|
||||
}, []);
|
||||
|
||||
return {
|
||||
isActive,
|
||||
isEnabled,
|
||||
isRestartPopupVisible,
|
||||
currentHintIndex,
|
||||
hints,
|
||||
tutorialKey,
|
||||
groupProgress: tutorialKey ? getGroupProgress(tutorialKey, currentHintIndex) : null,
|
||||
startTutorial,
|
||||
nextHint,
|
||||
prevHint,
|
||||
skipTutorial,
|
||||
toggleTutorial,
|
||||
showRestartPopup,
|
||||
confirmRestart,
|
||||
cancelRestart,
|
||||
hasSeen,
|
||||
};
|
||||
}
|
||||
@@ -7,9 +7,13 @@ import {
|
||||
deleteComment,
|
||||
toggleVideoLike,
|
||||
isLoggedIn,
|
||||
getUserMe,
|
||||
API_URL,
|
||||
} from '../utils/api';
|
||||
import { VideoDetailItem, CommentItem } from '../types/api';
|
||||
import { VideoDetailItem, CommentItem, UserMeResponse } from '../types/api';
|
||||
import { buildVideoShareUrl, tryNativeShare } from '../utils/nativeShare';
|
||||
import LoginPromptModal from './LoginPromptModal';
|
||||
import { isSafeHttpUrl } from '../utils/url';
|
||||
|
||||
interface VideoDetailContentProps {
|
||||
videoId: string;
|
||||
@@ -29,8 +33,8 @@ const VideoDetailContent: React.FC<VideoDetailContentProps> = ({ videoId, isModa
|
||||
const [isLiked, setIsLiked] = useState(false);
|
||||
|
||||
const [copied, setCopied] = useState(false);
|
||||
const [shareMenuOpen, setShareMenuOpen] = useState(false);
|
||||
const [isLandscape, setIsLandscape] = useState(false);
|
||||
const [showSiteOverlay, setShowSiteOverlay] = useState(false);
|
||||
const [showLoginModal, setShowLoginModal] = useState(false);
|
||||
|
||||
const [comments, setComments] = useState<CommentItem[]>([]);
|
||||
@@ -42,16 +46,7 @@ const VideoDetailContent: React.FC<VideoDetailContentProps> = ({ videoId, isModa
|
||||
const [commentSubmitting, setCommentSubmitting] = useState(false);
|
||||
const commentTextareaRef = useRef<HTMLTextAreaElement>(null);
|
||||
|
||||
const [commentNickname, setCommentNickname] = useState('');
|
||||
const [commentAvatarSeedIdx, setCommentAvatarSeedIdx] = useState(0);
|
||||
|
||||
// 고정 seed 목록: 브라우저가 캐싱하여 중복 요청 없음
|
||||
const AVATAR_SEEDS = ['42', '77', '123', '256', '512', '888', '1024', '2048', '3141', '9999'];
|
||||
const commentAvatarSeed = AVATAR_SEEDS[commentAvatarSeedIdx % AVATAR_SEEDS.length];
|
||||
|
||||
const handleChangeAvatar = useCallback(() => {
|
||||
setCommentAvatarSeedIdx(prev => (prev + 1) % AVATAR_SEEDS.length);
|
||||
}, []);
|
||||
const [currentUser, setCurrentUser] = useState<UserMeResponse | null>(null);
|
||||
|
||||
const fetchComments = useCallback(async (page: number, append = false) => {
|
||||
setCommentsLoading(true);
|
||||
@@ -75,6 +70,7 @@ const VideoDetailContent: React.FC<VideoDetailContentProps> = ({ videoId, isModa
|
||||
const fetchVideo = async () => {
|
||||
setLoading(true);
|
||||
setError(null);
|
||||
setShowSiteOverlay(false);
|
||||
try {
|
||||
const data = await getVideoById(videoId);
|
||||
setVideo(data);
|
||||
@@ -92,9 +88,16 @@ const VideoDetailContent: React.FC<VideoDetailContentProps> = ({ videoId, isModa
|
||||
fetchComments(1);
|
||||
}, [videoId, fetchComments]);
|
||||
|
||||
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 `${date.getFullYear()}년 ${date.getMonth() + 1}월 ${date.getDate()}일`;
|
||||
return t('videoDetail.dateFormat', { year: date.getFullYear(), month: date.getMonth() + 1, day: date.getDate() });
|
||||
};
|
||||
|
||||
const formatCommentDate = (dateString: string) => {
|
||||
@@ -102,7 +105,8 @@ const VideoDetailContent: React.FC<VideoDetailContentProps> = ({ videoId, isModa
|
||||
return `${date.getFullYear()}.${String(date.getMonth() + 1).padStart(2, '0')}.${String(date.getDate()).padStart(2, '0')}`;
|
||||
};
|
||||
|
||||
const shareUrl = `${window.location.origin}/video/${videoId}`;
|
||||
const shareUrl = buildVideoShareUrl(API_URL, videoId);
|
||||
const shareTitle = video?.title || video?.store_name || t('videoDetail.kakaoDefaultTitle');
|
||||
|
||||
const handleCopyLink = async () => {
|
||||
try {
|
||||
@@ -114,50 +118,17 @@ const VideoDetailContent: React.FC<VideoDetailContentProps> = ({ videoId, isModa
|
||||
setTimeout(() => setCopied(false), 2000);
|
||||
};
|
||||
|
||||
const handleKakaoShare = () => {
|
||||
const kakao = window.Kakao;
|
||||
if (kakao?.Share) {
|
||||
kakao.Share.sendDefault({
|
||||
objectType: 'feed',
|
||||
content: {
|
||||
title: video?.store_name ?? 'ADO2 영상',
|
||||
description: `${video?.region ?? ''} · ADO2 AI 마케팅 영상`,
|
||||
imageUrl: 'https://demo.castad.net/favicon_48.svg',
|
||||
link: { mobileWebUrl: shareUrl, webUrl: shareUrl },
|
||||
},
|
||||
buttons: [{ title: '영상 보기', link: { mobileWebUrl: shareUrl, webUrl: shareUrl } }],
|
||||
});
|
||||
} else if (navigator.share) {
|
||||
navigator.share({ url: shareUrl }).catch(() => {});
|
||||
} else {
|
||||
handleCopyLink();
|
||||
const handleShareButtonClick = async () => {
|
||||
const handled = await tryNativeShare({
|
||||
title: shareTitle,
|
||||
url: shareUrl,
|
||||
});
|
||||
if (handled) {
|
||||
return;
|
||||
}
|
||||
setShareMenuOpen(false);
|
||||
await handleCopyLink();
|
||||
};
|
||||
|
||||
const handleFacebookShare = () => {
|
||||
window.open(`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(shareUrl)}`, '_blank', 'noopener,width=600,height=600');
|
||||
setShareMenuOpen(false);
|
||||
};
|
||||
|
||||
const handleTwitterShare = () => {
|
||||
window.open(`https://twitter.com/intent/tweet?url=${encodeURIComponent(shareUrl)}`, '_blank', 'noopener,width=600,height=600');
|
||||
setShareMenuOpen(false);
|
||||
};
|
||||
|
||||
const shareMenuRef = React.useRef<HTMLDivElement>(null);
|
||||
|
||||
useEffect(() => {
|
||||
if (!shareMenuOpen) return;
|
||||
const handleClickOutside = (e: MouseEvent) => {
|
||||
if (shareMenuRef.current && !shareMenuRef.current.contains(e.target as Node)) {
|
||||
setShareMenuOpen(false);
|
||||
}
|
||||
};
|
||||
document.addEventListener('mousedown', handleClickOutside);
|
||||
return () => document.removeEventListener('mousedown', handleClickOutside);
|
||||
}, [shareMenuOpen]);
|
||||
|
||||
const likeDebounceRef = React.useRef<ReturnType<typeof setTimeout> | null>(null);
|
||||
|
||||
const handleLike = () => {
|
||||
@@ -197,13 +168,11 @@ const VideoDetailContent: React.FC<VideoDetailContentProps> = ({ videoId, isModa
|
||||
if (!commentInput.trim() || commentSubmitting) return;
|
||||
setCommentSubmitting(true);
|
||||
try {
|
||||
await postVideoComment(videoId, commentInput.trim(), commentNickname);
|
||||
await postVideoComment(videoId, commentInput.trim());
|
||||
setCommentInput('');
|
||||
if (commentTextareaRef.current) {
|
||||
commentTextareaRef.current.style.height = 'auto';
|
||||
}
|
||||
setCommentNickname('');
|
||||
setCommentAvatarSeedIdx(prev => (prev + 1) % AVATAR_SEEDS.length);
|
||||
await fetchComments(1);
|
||||
} catch (err) {
|
||||
console.error('Failed to post comment:', err);
|
||||
@@ -222,7 +191,7 @@ const VideoDetailContent: React.FC<VideoDetailContentProps> = ({ videoId, isModa
|
||||
};
|
||||
|
||||
const renderCommentContent = (content: string | null, isDeleted: boolean) => {
|
||||
if (isDeleted) return <span style={{ color: '#6B9EA0', fontStyle: 'italic' }}>(삭제된 댓글입니다.)</span>;
|
||||
if (isDeleted) return <span style={{ color: '#6B9EA0', fontStyle: 'italic' }}>{t('videoDetail.deletedComment')}</span>;
|
||||
return content;
|
||||
};
|
||||
|
||||
@@ -231,11 +200,14 @@ const VideoDetailContent: React.FC<VideoDetailContentProps> = ({ videoId, isModa
|
||||
{/* 헤더 */}
|
||||
<div className="video-detail-header">
|
||||
{isModal ? (
|
||||
<button className="video-detail-close-btn" onClick={handleHeaderAction} aria-label="닫기">
|
||||
<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>
|
||||
<>
|
||||
<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">
|
||||
@@ -246,6 +218,7 @@ const VideoDetailContent: React.FC<VideoDetailContentProps> = ({ videoId, isModa
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className="video-detail-body">
|
||||
{loading ? (
|
||||
<div className="ado2-contents-loading">
|
||||
<div className="loading-spinner"></div>
|
||||
@@ -255,18 +228,47 @@ const VideoDetailContent: React.FC<VideoDetailContentProps> = ({ videoId, isModa
|
||||
<div className="ado2-contents-error"><p>{error}</p></div>
|
||||
) : video ? (
|
||||
<div className={`video-detail-content ${isLandscape ? 'landscape' : ''}`}>
|
||||
<video
|
||||
src={video.result_movie_url}
|
||||
controls
|
||||
autoPlay
|
||||
controlsList="nodownload"
|
||||
onContextMenu={(e) => e.preventDefault()}
|
||||
className="video-detail-player"
|
||||
onLoadedMetadata={(e) => {
|
||||
const v = e.currentTarget;
|
||||
setIsLandscape(v.videoWidth > v.videoHeight);
|
||||
}}
|
||||
/>
|
||||
<div className="video-detail-player-wrap">
|
||||
<video
|
||||
src={video.result_movie_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 (!video.official_site_url) return;
|
||||
const v = e.currentTarget;
|
||||
// 영상 종료 3초 전부터 공식 홈페이지 오버레이 노출
|
||||
setShowSiteOverlay(
|
||||
Number.isFinite(v.duration) && v.duration - v.currentTime <= 3
|
||||
);
|
||||
}}
|
||||
/>
|
||||
{showSiteOverlay && isSafeHttpUrl(video.official_site_url) && (
|
||||
<a
|
||||
href={video.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>{video.store_name}</strong>
|
||||
{t('videoDetail.siteOverlayLabel')}
|
||||
</span>
|
||||
</a>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className="video-detail-info">
|
||||
<h2 className="video-detail-store">{video.store_name}</h2>
|
||||
@@ -284,80 +286,37 @@ const VideoDetailContent: React.FC<VideoDetailContentProps> = ({ videoId, isModa
|
||||
</svg>
|
||||
{likeCount}
|
||||
</button>
|
||||
<div style={{ position: 'relative' }} ref={shareMenuRef}>
|
||||
<button
|
||||
className="video-detail-copy-btn"
|
||||
onClick={() => setShareMenuOpen(v => !v)}
|
||||
>
|
||||
<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 ? '복사됨!' : '공유하기'}
|
||||
</button>
|
||||
{shareMenuOpen && (
|
||||
<div className="video-detail-share-menu">
|
||||
{/* 카카오톡 */}
|
||||
<button className="video-detail-share-item" onClick={handleKakaoShare}>
|
||||
<svg width="18" height="18" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<rect width="20" height="20" rx="4" fill="#FEE500"/>
|
||||
<path fillRule="evenodd" clipRule="evenodd" d="M10 3.5C6.134 3.5 3 6.01 3 9.1c0 1.98 1.2 3.72 3.01 4.76l-.74 2.75a.19.19 0 0 0 .28.21l3.37-2.23c.34.04.69.06 1.06.06 3.866 0 7-2.51 7-5.6S13.866 3.5 10 3.5z" fill="#3C1E1E"/>
|
||||
</svg>
|
||||
카카오톡
|
||||
</button>
|
||||
{/* 페이스북 */}
|
||||
<button className="video-detail-share-item" onClick={handleFacebookShare}>
|
||||
<svg width="18" height="18" viewBox="0 0 24 24" fill="#1877F2">
|
||||
<path d="M24 12.073C24 5.405 18.627 0 12 0S0 5.405 0 12.073C0 18.1 4.388 23.094 10.125 24v-8.437H7.078v-3.49h3.047V9.41c0-3.025 1.792-4.697 4.533-4.697 1.312 0 2.686.235 2.686.235v2.97h-1.513c-1.491 0-1.956.93-1.956 1.887v2.268h3.328l-.532 3.49h-2.796V24C19.612 23.094 24 18.1 24 12.073z"/>
|
||||
</svg>
|
||||
페이스북
|
||||
</button>
|
||||
{/* X (트위터) */}
|
||||
<button className="video-detail-share-item" onClick={handleTwitterShare}>
|
||||
<svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor">
|
||||
<path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"/>
|
||||
</svg>
|
||||
X (트위터)
|
||||
</button>
|
||||
{/* URL 복사 */}
|
||||
<button className="video-detail-share-item" onClick={() => { handleCopyLink(); setShareMenuOpen(false); }}>
|
||||
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
|
||||
<rect x="9" y="9" width="13" height="13" rx="2"/>
|
||||
<path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/>
|
||||
</svg>
|
||||
{copied ? '복사됨!' : 'URL 복사'}
|
||||
</button>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
<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">댓글</h3>
|
||||
<h3 className="video-detail-comments-title">{t('videoDetail.commentsTitle')}</h3>
|
||||
<span className="video-detail-comments-count">{commentsTotal}</span>
|
||||
</div>
|
||||
|
||||
{/* 댓글 작성자 프로필 선택 */}
|
||||
{authed && (
|
||||
{/* 댓글 작성자 프로필 (카카오 로그인 정보) */}
|
||||
{authed && currentUser && (
|
||||
<div className="video-detail-comment-profile">
|
||||
<img
|
||||
src={`https://api.dicebear.com/9.x/pixel-art/svg?seed=${commentAvatarSeed}`}
|
||||
alt="아바타 변경"
|
||||
className="video-detail-comment-avatar"
|
||||
onClick={handleChangeAvatar}
|
||||
style={{ cursor: 'pointer' }}
|
||||
title="클릭하여 아바타 변경"
|
||||
/>
|
||||
<input
|
||||
className="video-detail-nickname-input"
|
||||
type="text"
|
||||
placeholder="작성자 이름"
|
||||
value={commentNickname}
|
||||
onChange={(e) => setCommentNickname(e.target.value)}
|
||||
maxLength={20}
|
||||
/>
|
||||
{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>
|
||||
)}
|
||||
|
||||
@@ -365,7 +324,7 @@ const VideoDetailContent: React.FC<VideoDetailContentProps> = ({ videoId, isModa
|
||||
<textarea
|
||||
ref={commentTextareaRef}
|
||||
className="video-detail-comment-input"
|
||||
placeholder={authed ? '댓글을 입력하세요...' : '로그인 후 댓글을 작성할 수 있습니다'}
|
||||
placeholder={authed ? t('videoDetail.commentPlaceholder') : t('videoDetail.commentLoginRequired')}
|
||||
maxLength={500}
|
||||
rows={1}
|
||||
value={commentInput}
|
||||
@@ -388,24 +347,26 @@ const VideoDetailContent: React.FC<VideoDetailContentProps> = ({ videoId, isModa
|
||||
onClick={handleCommentSubmit}
|
||||
disabled={!authed || !commentInput.trim() || commentSubmitting}
|
||||
>
|
||||
{commentSubmitting ? '작성 중' : '작성'}
|
||||
{commentSubmitting ? t('videoDetail.commentSubmitting') : t('videoDetail.commentSubmit')}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{comments.length === 0 && !commentsLoading ? (
|
||||
<p className="video-detail-comments-empty">아직 댓글이 없습니다.</p>
|
||||
<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">
|
||||
<img
|
||||
src={`https://api.dicebear.com/9.x/pixel-art/svg?seed=${c.id}`}
|
||||
alt="avatar"
|
||||
className="video-detail-comment-avatar"
|
||||
/>
|
||||
{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 || '익명'}
|
||||
{c.nickname || t('videoDetail.anonymous')}
|
||||
</span>
|
||||
<p className="video-detail-comment-text">
|
||||
{renderCommentContent(c.content, c.is_deleted)}
|
||||
@@ -417,7 +378,7 @@ const VideoDetailContent: React.FC<VideoDetailContentProps> = ({ videoId, isModa
|
||||
className="video-detail-comment-delete"
|
||||
onClick={() => handleDeleteComment(c.id)}
|
||||
>
|
||||
삭제
|
||||
{t('videoDetail.deleteComment')}
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
@@ -427,14 +388,16 @@ const VideoDetailContent: React.FC<VideoDetailContentProps> = ({ videoId, isModa
|
||||
<ul className="video-detail-reply-list">
|
||||
{c.replies.map((r) => (
|
||||
<li key={r.id} className="video-detail-reply-item">
|
||||
<img
|
||||
src={`https://api.dicebear.com/9.x/pixel-art/svg?seed=${r.id}`}
|
||||
alt="avatar"
|
||||
className="video-detail-comment-avatar small"
|
||||
/>
|
||||
{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 || '익명'}
|
||||
{r.nickname || t('videoDetail.anonymous')}
|
||||
</span>
|
||||
<p className="video-detail-comment-text">
|
||||
{renderCommentContent(r.content, r.is_deleted)}
|
||||
@@ -446,7 +409,7 @@ const VideoDetailContent: React.FC<VideoDetailContentProps> = ({ videoId, isModa
|
||||
className="video-detail-comment-delete"
|
||||
onClick={() => handleDeleteComment(r.id)}
|
||||
>
|
||||
삭제
|
||||
{t('videoDetail.deleteComment')}
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
@@ -467,13 +430,14 @@ const VideoDetailContent: React.FC<VideoDetailContentProps> = ({ videoId, isModa
|
||||
onClick={() => fetchComments(commentsPage + 1, true)}
|
||||
disabled={commentsLoading}
|
||||
>
|
||||
{commentsLoading ? '불러오는 중...' : '댓글 더 보기'}
|
||||
{commentsLoading ? t('videoDetail.loadingComments') : t('videoDetail.loadMoreComments')}
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
) : null}
|
||||
</div>
|
||||
|
||||
{showLoginModal && (
|
||||
<LoginPromptModal onClose={() => setShowLoginModal(false)} />
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import React, { useEffect } from 'react';
|
||||
import VideoDetailContent from './VideoDetailContent';
|
||||
import { useOverlayClose } from '../hooks/useOverlayClose';
|
||||
|
||||
interface VideoDetailModalProps {
|
||||
videoId: string;
|
||||
@@ -23,30 +24,11 @@ const VideoDetailModal: React.FC<VideoDetailModalProps> = ({ videoId, onClose })
|
||||
};
|
||||
}, [onClose]);
|
||||
|
||||
const overlayCloseHandlers = useOverlayClose(onClose);
|
||||
|
||||
return (
|
||||
<div
|
||||
style={{
|
||||
position: 'fixed',
|
||||
inset: 0,
|
||||
background: 'rgba(0, 0, 0, 0.85)',
|
||||
zIndex: 2000,
|
||||
display: 'flex',
|
||||
overflowY: 'auto',
|
||||
padding: '24px 16px',
|
||||
}}
|
||||
onClick={onClose}
|
||||
>
|
||||
<div
|
||||
style={{
|
||||
background: '#01282A',
|
||||
borderRadius: '16px',
|
||||
width: '100%',
|
||||
maxWidth: '900px',
|
||||
margin: 'auto',
|
||||
position: 'relative',
|
||||
}}
|
||||
onClick={(e) => e.stopPropagation()}
|
||||
>
|
||||
<div className="video-detail-overlay" {...overlayCloseHandlers}>
|
||||
<div className="video-detail-modal-box" onClick={(e) => e.stopPropagation()}>
|
||||
<VideoDetailContent videoId={videoId} isModal={true} onClose={onClose} />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
|
||||
import React from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
interface WizardStepperProps {
|
||||
currentStep: number; // 0-based. ADO2 는 wizardStep 0~3 과 일치
|
||||
/**
|
||||
* 단계 라벨. 생략하면 ADO2 기본 4단계를 쓴다(기존 호출부 무수정).
|
||||
* 썰박스처럼 단계 구성이 다른 파이프라인이 직접 넘긴다.
|
||||
*/
|
||||
steps?: string[];
|
||||
}
|
||||
|
||||
const WizardStepper: React.FC<WizardStepperProps> = ({ currentStep, steps: stepsProp }) => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const steps = stepsProp ?? [
|
||||
t('wizardSteps.brandAnalysis'),
|
||||
t('wizardSteps.asset'),
|
||||
t('wizardSteps.sound'),
|
||||
t('wizardSteps.video'),
|
||||
];
|
||||
|
||||
return (
|
||||
<div className="wizard-stepper">
|
||||
{steps.map((label, index) => {
|
||||
const isDone = index < currentStep;
|
||||
const isCurrent = index === currentStep;
|
||||
const stateClass = isDone ? ' done' : isCurrent ? ' current' : ' pending';
|
||||
|
||||
return (
|
||||
<React.Fragment key={index}>
|
||||
{/* 노드: 2rem 고정 너비. 라벨은 absolute로 노드 중심 아래에 붙음 */}
|
||||
<div className={`wizard-step${stateClass}`}>
|
||||
<div className="wizard-stepper-node">
|
||||
{isDone ? (
|
||||
<svg width="14" height="14" viewBox="0 0 14 14" fill="none">
|
||||
<path d="M2.5 7L5.5 10L11.5 4" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" />
|
||||
</svg>
|
||||
) : (
|
||||
<span>{index + 1}</span>
|
||||
)}
|
||||
</div>
|
||||
<span className="wizard-stepper-label">{label}</span>
|
||||
</div>
|
||||
|
||||
{/* 연결선: flex:1로 남은 공간을 균등하게 채움 */}
|
||||
{index < steps.length - 1 && (
|
||||
<div className={`wizard-step-line${isDone ? ' done' : ''}`} />
|
||||
)}
|
||||
</React.Fragment>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default WizardStepper;
|
||||
@@ -0,0 +1,93 @@
|
||||
import React from 'react';
|
||||
|
||||
export const NAV = {
|
||||
HOME: 'ADO2 콘텐츠',
|
||||
NEW: '새 프로젝트 만들기',
|
||||
MY: '내 정보',
|
||||
DASHBOARD: '대시보드',
|
||||
} as const;
|
||||
|
||||
export const SETTINGS_ID = '__settings__';
|
||||
|
||||
export const GATED_ITEMS: string[] = [NAV.NEW, NAV.MY, NAV.DASHBOARD];
|
||||
|
||||
export type MyInfoTab = 'contents' | 'calendar' | 'payment' | 'business';
|
||||
|
||||
export interface NavItemDef {
|
||||
id: string;
|
||||
labelKey: string;
|
||||
icon: React.ReactNode;
|
||||
}
|
||||
|
||||
export const NAV_ITEMS: NavItemDef[] = [
|
||||
{
|
||||
id: NAV.HOME,
|
||||
labelKey: 'sidebar.ado2Contents',
|
||||
icon: (
|
||||
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5">
|
||||
<path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" />
|
||||
<polyline points="9 22 9 12 15 12 15 22" />
|
||||
</svg>
|
||||
),
|
||||
},
|
||||
{
|
||||
id: NAV.NEW,
|
||||
labelKey: 'sidebar.newProject',
|
||||
icon: (
|
||||
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5">
|
||||
<line x1="12" y1="5" x2="12" y2="19" />
|
||||
<line x1="5" y1="12" x2="19" y2="12" />
|
||||
</svg>
|
||||
),
|
||||
},
|
||||
{
|
||||
id: NAV.MY,
|
||||
labelKey: 'sidebar.myInfo',
|
||||
icon: (
|
||||
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5">
|
||||
<path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2" />
|
||||
<circle cx="12" cy="7" r="4" />
|
||||
</svg>
|
||||
),
|
||||
},
|
||||
{
|
||||
id: SETTINGS_ID,
|
||||
labelKey: 'sidebar.settings',
|
||||
icon: (
|
||||
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5">
|
||||
<circle cx="12" cy="12" r="3" />
|
||||
<path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z" />
|
||||
</svg>
|
||||
),
|
||||
},
|
||||
];
|
||||
|
||||
/** 구 activeItem(6메뉴 체제) → 새 4메뉴 체계 매핑 + 비로그인 게이트 강등을 함께 처리한다. */
|
||||
export function sanitizeActiveItem(
|
||||
raw: string | null,
|
||||
isGuest: boolean
|
||||
): { item: string; myInfoTab?: MyInfoTab } {
|
||||
const gate = (result: { item: string; myInfoTab?: MyInfoTab }) =>
|
||||
isGuest && GATED_ITEMS.includes(result.item) ? { item: NAV.HOME } : result;
|
||||
|
||||
switch (raw) {
|
||||
case '대시보드':
|
||||
return gate({ item: NAV.DASHBOARD });
|
||||
case '내 콘텐츠':
|
||||
return gate({ item: NAV.MY, myInfoTab: 'contents' });
|
||||
case '콘텐츠 캘린더':
|
||||
return gate({ item: NAV.MY, myInfoTab: 'calendar' });
|
||||
case '비즈니스 설정':
|
||||
return gate({ item: NAV.MY, myInfoTab: 'business' });
|
||||
case NAV.MY:
|
||||
return gate({ item: NAV.MY });
|
||||
case NAV.NEW:
|
||||
return gate({ item: NAV.NEW });
|
||||
case NAV.DASHBOARD:
|
||||
return gate({ item: NAV.DASHBOARD });
|
||||
case NAV.HOME:
|
||||
return { item: NAV.HOME };
|
||||
default:
|
||||
return { item: NAV.HOME };
|
||||
}
|
||||
}
|
||||
@@ -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,24 @@
|
||||
import React, { useRef } from 'react';
|
||||
|
||||
/**
|
||||
* 모달 오버레이(배경) 클릭 시에만 닫히도록 하는 핸들러 쌍.
|
||||
* 모달 내부에서 텍스트를 드래그 선택하다가 마우스가 오버레이 위에서 놓이면
|
||||
* click 이벤트의 타겟이 오버레이가 되어 의도치 않게 닫히는 문제를 막기 위해,
|
||||
* mousedown과 click(mouseup) 타겟이 모두 오버레이 자신일 때만 닫는다.
|
||||
*/
|
||||
export function useOverlayClose(onClose: () => void) {
|
||||
const mouseDownOnSelfRef = useRef(false);
|
||||
|
||||
const onMouseDown = (e: React.MouseEvent<HTMLElement>) => {
|
||||
mouseDownOnSelfRef.current = e.target === e.currentTarget;
|
||||
};
|
||||
|
||||
const onClick = (e: React.MouseEvent<HTMLElement>) => {
|
||||
if (mouseDownOnSelfRef.current && e.target === e.currentTarget) {
|
||||
onClose();
|
||||
}
|
||||
mouseDownOnSelfRef.current = false;
|
||||
};
|
||||
|
||||
return { onMouseDown, onClick };
|
||||
}
|
||||
@@ -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 };
|
||||
}
|
||||
+1
-11
@@ -2,19 +2,9 @@
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom/client';
|
||||
import './i18n';
|
||||
import './styles/index.css';
|
||||
import App from './App';
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
Kakao: any;
|
||||
}
|
||||
}
|
||||
|
||||
const kakaoKey = import.meta.env.VITE_KAKAO_JS_KEY as string | undefined;
|
||||
if (kakaoKey && window.Kakao && !window.Kakao.isInitialized()) {
|
||||
window.Kakao.init(kakaoKey);
|
||||
}
|
||||
|
||||
const rootElement = document.getElementById('root');
|
||||
if (!rootElement) {
|
||||
throw new Error("Could not find root element to mount to");
|
||||
|
||||
+434
-113
@@ -1,4 +1,10 @@
|
||||
{
|
||||
"wizardSteps": {
|
||||
"brandAnalysis": "Analysis",
|
||||
"asset": "Image",
|
||||
"sound": "Sound",
|
||||
"video": "Video"
|
||||
},
|
||||
"header": {
|
||||
"loginFailedAlert": "Failed to get login URL. Please try again.",
|
||||
"start": "Get Started",
|
||||
@@ -15,86 +21,13 @@
|
||||
"credits": "Credits left: {{count}}",
|
||||
"loggingOut": "Logging out...",
|
||||
"logout": "Log Out",
|
||||
"tutorialRestart": "Restart Tutorial",
|
||||
"tutorial": "Tutorial",
|
||||
"tutorialOn": "Enable Tutorial",
|
||||
"tutorialOff": "Disable Tutorial",
|
||||
"inquiry": "Feedback"
|
||||
},
|
||||
"tutorial": {
|
||||
"skip": "Skip",
|
||||
"next": "Next",
|
||||
"prev": "Back",
|
||||
"finish": "Done",
|
||||
"landing": {
|
||||
"intro": { "title": "Welcome to ADO2 Tutorial", "desc": "We'll guide you through ADO2 step by step." },
|
||||
"dropdown": { "title": "Choose Search Type", "desc": "Select URL or business name from the dropdown." },
|
||||
"field": { "title": "Enter Search Term", "desc": "For URL, paste a Naver Maps share URL.\nFor business name, type the name and select from the list." },
|
||||
"manual": { "title": "Direct Input", "desc": "You can also enter the business name and address manually to start analysis." },
|
||||
"button": { "title": "Start Brand Analysis", "desc": "Click the button to let AI start analyzing your brand." }
|
||||
},
|
||||
"asset": {
|
||||
"image": { "title": "Image List", "desc": "Photos from Naver Place. Tap 'Show more' to see the rest, or X to remove any." },
|
||||
"upload": { "title": "Add Images", "desc": "You can freely add more images." },
|
||||
"ratio": { "title": "Select Video Ratio", "desc": "Choose the ratio for the video to be generated." },
|
||||
"next": { "title": "Next Step", "desc": "Proceed to the next step when ready." }
|
||||
},
|
||||
"sound": {
|
||||
"genre": { "title": "Select Genre", "desc": "Pick a music genre that fits your brand.", "note": "Background music is coming soon." },
|
||||
"language": { "title": "Select Language", "desc": "You can choose the language for the sound.\nWant to continue with Korean?" },
|
||||
"generate": { "title": "Generate Sound", "desc": "Click the button and AI will generate lyrics and music in your chosen genre and language." },
|
||||
"lyrics": { "title": "Lyrics Complete", "desc": "AI wrote lyrics in your selected language.\nCheck the generated lyrics." },
|
||||
"lyricsWait": { "title": "Generating Music", "desc": "AI is composing music based on the lyrics.\nPlease wait a moment." },
|
||||
"audioPlayer": { "title": "Preview the Music", "desc": "Music generation is complete.\nPress play to listen to the generated music." },
|
||||
"video": { "title": "Generate Video", "desc": "Click the button to start generating your video." }
|
||||
},
|
||||
"myInfo": {
|
||||
"myInfo": { "title": "My Info", "desc": "In My Info, you can manage your social connections and view connected accounts." },
|
||||
"connect": { "title": "Connect Now", "desc": "Click the YouTube connect button to go to the connection page.", "note": "Instagram connection is coming soon." },
|
||||
"connected": { "title": "Connected Accounts", "desc": "Your linked social accounts appear here.\nCheck after connecting." },
|
||||
"ado2": { "title": "ADO2 Contents", "desc": "You can now upload the generated video.\nClick to navigate." }
|
||||
},
|
||||
"ado2": {
|
||||
"list": { "title": "Generated Videos", "desc": "View all AI-created videos here." },
|
||||
"download": { "title": "Download", "desc": "Download the video to your device." },
|
||||
"delete": { "title": "Delete", "desc": "Remove videos you no longer need." },
|
||||
"upload": { "title": "Upload to Social Media", "desc": "Select a video and upload it to social media." }
|
||||
},
|
||||
"completion": {
|
||||
"contentInfo": { "title": "Content Info", "desc": "Check the title, genre, resolution, and lyrics of the generated content." },
|
||||
"generating": { "title": "Generating Video", "desc": "AI is creating your video.\nPlease wait a moment." },
|
||||
"completion": { "title": "Video Complete!", "desc": "Your video is ready. Want to take a look?" },
|
||||
"myInfo": { "title": "Connect Social Account", "desc": "To upload your video to YouTube, connect your social account in My Info. Click to go there." }
|
||||
},
|
||||
"upload": {
|
||||
"seo": { "title": "Title & Description", "desc": "AI is generating the title and description for your video. Please wait a moment." },
|
||||
"required": { "title": "Required Fields", "desc": "Fields marked with * are required.\nPlease check them before uploading." },
|
||||
"schedule": { "title": "Schedule Upload", "desc": "Post now or schedule for a specific time." },
|
||||
"submit": { "title": "Start Upload", "desc": "Click the Post button to start uploading." }
|
||||
},
|
||||
"dashboard": {
|
||||
"metrics": { "title": "Key Metrics", "desc": "Check views, subscribers, and other stats for content uploaded via ADO2." },
|
||||
"chart": { "title": "Growth Chart", "desc": "Track your channel's growth over time." },
|
||||
"more": { "title": "More Analytics", "desc": "Even more statistics are available at a glance on the dashboard." }
|
||||
},
|
||||
"contentCalendar": {
|
||||
"grid": { "title": "Content Calendar", "desc": "View your content schedule by date.\nWhy not select today?" },
|
||||
"panel": { "title": "Content List", "desc": "Check the detailed content schedule here." }
|
||||
},
|
||||
"feedback": {
|
||||
"complete": { "title": "Tutorial Complete 🎉", "desc": "You've completed the full flow from brand analysis to YouTube upload.\nTo replay the tutorial, click the button in the top right." },
|
||||
"title": "Customer Feedback",
|
||||
"desc": "Share any issues or suggestions to help us improve."
|
||||
},
|
||||
"restart": {
|
||||
"title": "Restart Tutorial?",
|
||||
"desc": "The tutorial will restart from the current screen.",
|
||||
"confirm": "Start",
|
||||
"cancel": "Cancel"
|
||||
}
|
||||
"inquiry": "Feedback",
|
||||
"faq": "FAQ (Korean)",
|
||||
"login": "Log In",
|
||||
"settings": "Settings"
|
||||
},
|
||||
"footer": {
|
||||
"company":"O2O Inc.",
|
||||
"company": "O2O Inc.",
|
||||
"businessNumber": "Business Registration No. : 620-87-00810 | CEO : Ahn Sungmin",
|
||||
"headquarters": "HQ : Unicorn Lab Daegu A05, 5F, 111 Oksan-ro, Buk-gu, Daegu, Korea",
|
||||
"researchCenter": "R&D : Rooms 504-505 (East), KT Pangyo Bldg, 32 Geumto-ro, Sujeong-gu, Seongnam-si, Gyeonggi-do, Korea",
|
||||
@@ -123,7 +56,7 @@
|
||||
"privacyPrivate": "Private",
|
||||
"publishTimeLabel": "Publish Time",
|
||||
"publishNow": "Publish Now",
|
||||
"publishSchedule": "Schedule (Coming Soon)",
|
||||
"publishSchedule": "Schedule",
|
||||
"footerNote": "",
|
||||
"footerNoteLink": "",
|
||||
"cancel": "Cancel",
|
||||
@@ -137,7 +70,29 @@
|
||||
"uploadFailed": "Upload failed.",
|
||||
"autoSeoTitle": "Auto-generating... (30–60 sec)",
|
||||
"autoSeoDescription": "Auto-generating... (30–60 sec)",
|
||||
"autoSeoTags": "Auto-generating... (30–60 sec)"
|
||||
"autoSeoTags": "Auto-generating... (30–60 sec)",
|
||||
"youtubeCallback": {
|
||||
"connecting": "Connecting YouTube...",
|
||||
"pleaseWait": "Please wait a moment.",
|
||||
"failed": "Connection Failed",
|
||||
"errorAuthCancelled": "Google authentication was cancelled or failed.",
|
||||
"errorNoCode": "Authorization code was not received.",
|
||||
"errorProcessing": "An error occurred while processing the YouTube connection."
|
||||
},
|
||||
"connectError": {
|
||||
"title": "{{platform}} Connection Failed",
|
||||
"defaultError": "An unknown error occurred.",
|
||||
"detail": "Please try again. If the problem persists, contact customer support.",
|
||||
"retry": "Try Again"
|
||||
},
|
||||
"connectSuccess": {
|
||||
"title": "{{name}} Connected",
|
||||
"messageWithChannel": "{{platform}} account has been successfully connected.",
|
||||
"messageWithoutChannel": "Account has been successfully connected.",
|
||||
"verified": "Verified",
|
||||
"countdown": "Redirecting in {{count}} seconds...",
|
||||
"goNow": "Go Now"
|
||||
}
|
||||
},
|
||||
"upload": {
|
||||
"title": "YouTube Upload",
|
||||
@@ -159,29 +114,31 @@
|
||||
},
|
||||
"landing": {
|
||||
"hero": {
|
||||
"searchTypeBusinessName": "Business Name",
|
||||
"placeholderBusinessName": "Enter a business name",
|
||||
"guideUrl": "Search for a place on Naver Maps, tap Share,\nthen paste the URL here.",
|
||||
"guideBusinessName": "Search by business name to retrieve information.",
|
||||
"errorUrlRequired": "Please enter a URL.",
|
||||
"errorNameRequired": "Please enter a business name.",
|
||||
"errorInvalidUrl": "Invalid URL format. (e.g., https://example.com)",
|
||||
"searchTypeLabel": "Business Name | URL",
|
||||
"placeholderCombined": "Enter a business name or Naver Maps/Place URL",
|
||||
"guideCombined": "Paste a Naver Maps share URL, or enter a business name to automatically retrieve information.",
|
||||
"errorInputRequired": "Please enter a business name or URL.",
|
||||
"errorInvalidUrl": "Invalid URL format. (e.g., https://naver.me/abcdef)",
|
||||
"analyzeButton": "Brand Analysis",
|
||||
"scrollMore": "Scroll to see more",
|
||||
"testDataLoading": "Loading...",
|
||||
"testData": "Test Data",
|
||||
"testDataLoadFailed": "Failed to load test data.",
|
||||
"searching": "Searching...",
|
||||
"searchTypeManual": "Manual Input",
|
||||
"manualModalTitle": "Enter Business Info",
|
||||
"searchTypeManual": "Not on Naver? Enter manually",
|
||||
"manualButtonDesc": "Even businesses not listed on Naver Maps/Place\ncan get lyrics, music, and video production\njust by entering the name, region, and address.",
|
||||
"manualModalTitle": "Enter Business Info Directly",
|
||||
"manualModalSubtitle": "Even businesses not on Naver can get lyrics, music, and video production by filling in the details below.",
|
||||
"manualAnalyzeButton": "Get Started",
|
||||
"manualLabelName": "Business Name",
|
||||
"manualLabelAddress": "Address",
|
||||
"manualLabelRegion": "Region",
|
||||
"manualLabelDetail": "Detail Address",
|
||||
"manualLabelCategory": "Category",
|
||||
"manualPlaceholderName": "Enter the business name",
|
||||
"manualPlaceholderAddress": "Enter the address",
|
||||
"manualPlaceholderRegion": "Select a region",
|
||||
"manualPlaceholderDetail": "Enter detail address (e.g. Gangnam-gu Teheran-ro 123)"
|
||||
"manualPlaceholderDetail": "Enter detail address (e.g. Gangnam-gu Teheran-ro 123)",
|
||||
"manualPlaceholderCategory": "Enter the business category (e.g. pension, cafe, salon)",
|
||||
"manualLabelSiteUrl": "Website link (optional)",
|
||||
"manualPlaceholderSiteUrl": "Enter the official website URL (e.g. https://example.com)"
|
||||
},
|
||||
"welcome": {
|
||||
"title": "Welcome to ADO2.AI",
|
||||
@@ -211,8 +168,6 @@
|
||||
"guideBusinessName": "Search by business name to retrieve information.",
|
||||
"searchButton": "Search",
|
||||
"searching": "Searching...",
|
||||
"testDataLoading": "Loading...",
|
||||
"testData": "Test Data",
|
||||
"searchTypeManual": "Manual Input",
|
||||
"errorSelectFromList": "Please select a business from the list.",
|
||||
"errorUrlRequired": "Please enter a URL.",
|
||||
@@ -223,26 +178,34 @@
|
||||
"manualLabelAddress": "Address",
|
||||
"manualLabelRegion": "Region",
|
||||
"manualLabelDetail": "Detail Address",
|
||||
"manualLabelCategory": "Category",
|
||||
"manualPlaceholderName": "Enter the business name",
|
||||
"manualPlaceholderAddress": "Enter the address",
|
||||
"manualPlaceholderRegion": "Select a region",
|
||||
"manualPlaceholderDetail": "Enter detail address (e.g. Gangnam-gu Teheran-ro 123)"
|
||||
"manualPlaceholderDetail": "Enter detail address (e.g. Gangnam-gu Teheran-ro 123)",
|
||||
"manualPlaceholderCategory": "Enter the business category (e.g. pension, cafe, salon)"
|
||||
},
|
||||
"assetManagement": {
|
||||
"title": "Brand Assets",
|
||||
"selectedImages": "Selected Images",
|
||||
"imageAlt": "Image",
|
||||
"uploadBadge": "Uploaded",
|
||||
"previewUnavailable": "No preview",
|
||||
"imageUpload": "Image Upload",
|
||||
"dragAndDrop": "Drag & drop or\nclick to upload",
|
||||
"videoRatio": "Video Ratio",
|
||||
"minImages": "Min. 5 images",
|
||||
"minImages": "Recommended 30+ images",
|
||||
"youtubeShorts": "YouTube Shorts",
|
||||
"youtubeVideo": "YouTube Video",
|
||||
"back": "Go Back",
|
||||
"loadMore": "Load more",
|
||||
"uploadFailed": "Image upload failed.",
|
||||
"uploading": "Uploading... (30 sec – 2 min)",
|
||||
"uploadErrorTitle": "Image Upload Error",
|
||||
"uploadErrorConfirm": "OK",
|
||||
"duplicateSkippedTitle": "Duplicate Images Skipped",
|
||||
"duplicateSkippedMessage": "Skipped {{count}} image(s) that were already added.",
|
||||
"preparingPreviews": "Preparing previews ({{done}} / {{total}})",
|
||||
"uploading": "Uploading... (30 sec – 1 min)",
|
||||
"nextStep": "Next Step"
|
||||
},
|
||||
"soundStudio": {
|
||||
@@ -255,7 +218,7 @@
|
||||
"genreLabel": "Select Genre",
|
||||
"genreAuto": "Auto Select",
|
||||
"genreBallad": "Ballad",
|
||||
"languageLabel": "Language",
|
||||
"languageLabel": "Select Language",
|
||||
"languageKorean": "Korean",
|
||||
"lyricsColumn": "Lyrics",
|
||||
"lyricsHint": "Select the lyrics area to edit",
|
||||
@@ -269,8 +232,8 @@
|
||||
"videoGenerating": "Generating Video",
|
||||
"noBusinessInfo": "No business information. Please try again.",
|
||||
"noImageUploadInfo": "No image upload information. Please go back to the previous step and try again.",
|
||||
"generatingLyrics": "Generating lyrics...\n(30–60 sec)",
|
||||
"generatingSong": "Generating music...\n(1–2 min)",
|
||||
"generatingLyrics": "Generating lyrics... (30–60 sec)",
|
||||
"generatingSong": "Generating music... (1–2 min)",
|
||||
"songQueued": "Song generation queued...",
|
||||
"retryMessage": "Regenerating due to timeout... ({{count}}/{{max}})",
|
||||
"lyricGenerationFailed": "Lyrics generation request failed.",
|
||||
@@ -284,7 +247,7 @@
|
||||
"songRegenerationError": "An error occurred during music regeneration.",
|
||||
"creditsRemaining": "{{count}} left",
|
||||
"creditsExhausted": "Not enough credits.",
|
||||
"chargeCredits": "Purchase credits"
|
||||
"chargeCredits": "Top Up Credits"
|
||||
},
|
||||
"completion": {
|
||||
"back": "Go Back",
|
||||
@@ -338,7 +301,7 @@
|
||||
"noLyricsBGM": "Background music is generated without lyrics.",
|
||||
"downloading": "Downloading...",
|
||||
"download": "Download",
|
||||
"uploadToSocial": "Upload to Social"
|
||||
"uploadToSocial": "Upload"
|
||||
},
|
||||
"dashboard": {
|
||||
"title": "Dashboard",
|
||||
@@ -436,8 +399,8 @@
|
||||
"monthOverMonth": "Month-over-Month Growth",
|
||||
"noAudienceData": "Not enough data to show real audience insights.",
|
||||
"mockContentNotice": "The content shown below is sample data, not your actual content.",
|
||||
"dataDelayTitle": "Data is being prepared",
|
||||
"dataDelayDesc": "According to YouTube's policy, analytics data may take up to 48 hours to be reflected after a video is uploaded. Please check back later.",
|
||||
"dataDelayTitle": "No data to display",
|
||||
"dataDelayDesc": "There is no analytics data to display. YouTube may take up to 48 hours to reflect data after upload, and statistics are also not collected if the video was uploaded as private or has been deleted from YouTube.",
|
||||
"sampleHide": "Hide Sample",
|
||||
"sampleShow": "Show Sample",
|
||||
"recentVideosDesc": "Showing stats for the latest 30 videos uploaded via ADO2.",
|
||||
@@ -478,7 +441,9 @@
|
||||
"chargeSubmit": "Submit",
|
||||
"chargeSubmitting": "Submitting...",
|
||||
"chargeSuccess": "Your top-up request has been submitted!",
|
||||
"chargeConfirm": "OK"
|
||||
"chargeConfirm": "OK",
|
||||
"tabContents": "My Contents",
|
||||
"tabCalendar": "Calendar"
|
||||
},
|
||||
"ado2Contents": {
|
||||
"title": "ADO2 Contents",
|
||||
@@ -497,7 +462,7 @@
|
||||
"delete": "Delete",
|
||||
"previous": "Previous",
|
||||
"next": "Next",
|
||||
"uploadToSocial": "Upload to social media",
|
||||
"uploadToSocial": "Upload",
|
||||
"sortLatest": "Latest",
|
||||
"sortOldest": "Oldest",
|
||||
"sortLikes": "Most Liked",
|
||||
@@ -526,9 +491,9 @@
|
||||
"marketPositioning": "Market Positioning",
|
||||
"coreValue": "Core Value",
|
||||
"categoryDefinition": "Category Definition",
|
||||
"targetPersona": "Target Persona",
|
||||
"targetPersona": "Key Customer Type",
|
||||
"ageSuffix": "years old",
|
||||
"sellingPoints": "Unique Selling Points (USP)",
|
||||
"sellingPoints": "Key Selling Points",
|
||||
"recommendedKeywords": "Recommended Target Keywords",
|
||||
"generateContent": "Generate Content",
|
||||
"pageDescBefore": " reveals ",
|
||||
@@ -562,14 +527,35 @@
|
||||
"scheduled": "Planned",
|
||||
"failed": "Failed"
|
||||
},
|
||||
"months": ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],
|
||||
"days": ["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],
|
||||
"months": [
|
||||
"Jan",
|
||||
"Feb",
|
||||
"Mar",
|
||||
"Apr",
|
||||
"May",
|
||||
"Jun",
|
||||
"Jul",
|
||||
"Aug",
|
||||
"Sep",
|
||||
"Oct",
|
||||
"Nov",
|
||||
"Dec"
|
||||
],
|
||||
"days": [
|
||||
"Sun",
|
||||
"Mon",
|
||||
"Tue",
|
||||
"Wed",
|
||||
"Thu",
|
||||
"Fri",
|
||||
"Sat"
|
||||
],
|
||||
"yearMonth": "{{month}} {{year}}",
|
||||
"monthDay": "{{month}} {{day}}",
|
||||
"loading": "Loading...",
|
||||
"noResults": "No recent results",
|
||||
"noResultsDesc": "Upload your content to social channels",
|
||||
"ado2Contents": "ADO2 Contents",
|
||||
"myContents": "My Contents",
|
||||
"cancel": "Cancel",
|
||||
"retry": "Retry",
|
||||
"cancelConfirm": "Are you sure you want to cancel this reservation?",
|
||||
@@ -581,7 +567,28 @@
|
||||
},
|
||||
"loginPrompt": {
|
||||
"title": "Login Required",
|
||||
"loginBtn": "Login with Kakao"
|
||||
"loginBtn": "Login",
|
||||
"description": "Sign in with Kakao in a few seconds\nto keep going."
|
||||
},
|
||||
"videoDetail": {
|
||||
"dateFormat": "{{month}}/{{day}}/{{year}}",
|
||||
"kakaoDefaultTitle": "ADO2 Video",
|
||||
"kakaoDescription": "{{region}} · ADO2 AI Marketing Video",
|
||||
"deletedComment": "(This comment has been deleted.)",
|
||||
"closeAriaLabel": "Close",
|
||||
"share": "Share",
|
||||
"copied": "Copied!",
|
||||
"siteOverlayLabel": "View more",
|
||||
"commentsTitle": "Comments",
|
||||
"commentPlaceholder": "Write a comment...",
|
||||
"commentLoginRequired": "Please log in to write a comment",
|
||||
"commentSubmitting": "Submitting",
|
||||
"commentSubmit": "Submit",
|
||||
"noComments": "No comments yet.",
|
||||
"anonymous": "Anonymous",
|
||||
"deleteComment": "Delete",
|
||||
"loadMoreComments": "Load more comments",
|
||||
"loadingComments": "Loading..."
|
||||
},
|
||||
"app": {
|
||||
"loginProcessing": "Processing login...",
|
||||
@@ -593,5 +600,319 @@
|
||||
"autocompleteError": "No results found. Please check your input and try again.",
|
||||
"autocompleteGeneralError": "An error occurred while retrieving business information. Please try again.",
|
||||
"pageComingSoon": "{{page}} page is coming soon."
|
||||
},
|
||||
"pipelineTabs": {
|
||||
"ariaLabel": "Content type",
|
||||
"ado2": "ADO2",
|
||||
"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": {
|
||||
"pick": "Select",
|
||||
"making": "Generating",
|
||||
"done": "Done"
|
||||
},
|
||||
"create": {
|
||||
"step1": "STEP 1 · Pick a story",
|
||||
"step2": "STEP 2 · Pick a place",
|
||||
"searchPlaceholder": "Business name, or paste a Naver Map link",
|
||||
"searchButton": "Search",
|
||||
"searching": "Searching",
|
||||
"cost": "Cost",
|
||||
"costValue": "1 credit",
|
||||
"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"
|
||||
}
|
||||
}
|
||||
}
|
||||
+509
-106
@@ -1,4 +1,10 @@
|
||||
{
|
||||
"wizardSteps": {
|
||||
"brandAnalysis": "분석",
|
||||
"asset": "이미지",
|
||||
"sound": "사운드",
|
||||
"video": "영상"
|
||||
},
|
||||
"header": {
|
||||
"loginFailedAlert": "로그인 URL을 가져오는데 실패했습니다. 다시 시도해주세요.",
|
||||
"start": "시작하기",
|
||||
@@ -15,86 +21,13 @@
|
||||
"credits": "보유 크레딧: {{count}}",
|
||||
"loggingOut": "로그아웃 중...",
|
||||
"logout": "로그아웃",
|
||||
"tutorialRestart": "튜토리얼 다시 보기",
|
||||
"tutorial": "튜토리얼",
|
||||
"tutorialOn": "튜토리얼 켜기",
|
||||
"tutorialOff": "튜토리얼 끄기",
|
||||
"inquiry": "고객의견"
|
||||
},
|
||||
"tutorial": {
|
||||
"skip": "건너뛰기",
|
||||
"next": "다음",
|
||||
"prev": "이전",
|
||||
"finish": "완료",
|
||||
"landing": {
|
||||
"intro": { "title": "ADO2 튜토리얼 시작", "desc": "ADO2 사용 방법을 단계별로 안내해 드릴게요." },
|
||||
"dropdown": { "title": "검색 방식 선택", "desc": "드롭다운에서 URL 또는 업체명 중 원하는 방식을 선택하세요." },
|
||||
"field": { "title": "입력하기", "desc": "URL 방식이라면 네이버 지도 공유 URL,\n업체명 방식이라면 업체명을 입력하고 목록에서 선택하세요." },
|
||||
"manual": { "title": "직접 입력", "desc": "업체명과 주소를 직접 입력해서 분석을 시작할 수도 있어요." },
|
||||
"button": { "title": "브랜드 분석 시작", "desc": "버튼을 누르면 AI가 브랜드를 분석하기 시작해요." }
|
||||
},
|
||||
"asset": {
|
||||
"image": { "title": "이미지 목록", "desc": "네이버 Place에서 가져 온 사진이에요. \n더보기를 누르면 나머지 사진도 볼 수 있고 X를 눌러 삭제 할 수 있어요." },
|
||||
"upload": { "title": "이미지 추가", "desc": "이미지를 자유롭게 추가 할 수 있어요." },
|
||||
"ratio": { "title": "영상 비율 선택", "desc": "생성 할 영상의 비율을 선택하세요." },
|
||||
"next": { "title": "다음 단계로", "desc": "설정이 완료되면 다음 단계로 진행하세요." }
|
||||
},
|
||||
"sound": {
|
||||
"genre": { "title": "장르 선택", "desc": "영상에 어울리는 음악 장르를 선택하세요.", "note": "배경음악은 이후 오픈 예정입니다." },
|
||||
"language": { "title": "언어 선택", "desc": "음악의 언어를 선택할 수 있어요. \n이미 선택된 한국어로 진행해볼까요?" },
|
||||
"generate": { "title": "사운드 생성", "desc": "버튼을 클릭하면 AI가 가사와 음악을 생성해요."},
|
||||
"lyrics": { "title": "가사 생성 완료", "desc": "AI가 선택한 언어로 가사를 만들었어요.\n생성된 가사를 확인하세요." },
|
||||
"lyricsWait": { "title": "음악 생성 중", "desc": "가사를 바탕으로 AI가 음악을 만들고 있어요.\n잠시만 기다려 주세요." },
|
||||
"audioPlayer": { "title": "음악 미리 듣기", "desc": "음악 생성이 완료되었어요.\n재생 버튼을 눌러 생성된 음악을 들어보세요." },
|
||||
"video": { "title": "영상 생성", "desc": "버튼을 클릭해서 영상 생성을 시작하세요." }
|
||||
},
|
||||
"completion": {
|
||||
"contentInfo": { "title": "콘텐츠 정보", "desc": "콘텐츠의 파일명, 장르, 규격, 가사를 확인하세요." },
|
||||
"generating": { "title": "영상 제작 중", "desc": "AI가 영상을 만들고 있어요. \n잠시만 기다려 주세요." },
|
||||
"completion": { "title": "영상 완성!", "desc": "영상 제작이 완료되었어요. \n영상을 확인해 볼까요?" },
|
||||
"myInfo": { "title": "소셜 계정 연동", "desc": "영상을 유튜브에 업로드하려면 내 정보에서 소셜 계정을 연동해야 해요. \n클릭해서 이동하세요." }
|
||||
},
|
||||
"myInfo": {
|
||||
"myInfo": { "title": "내 정보", "desc": "내 정보에서는 소셜 연결과 연결된 계정을 확인 할 수 있어요." },
|
||||
"connect": { "title": "연결하기", "desc": "YouTube 연결 버튼을 누르면 연결 페이지로 이동합니다.", "note": "Instagram 연결은 오픈 예정입니다." },
|
||||
"connected": { "title": "연결 계정", "desc": "연결된 소셜 계정 목록이에요. \n연결 후 여기서 확인할 수 있어요." },
|
||||
"ado2": { "title": "ADO2 콘텐츠", "desc": "이제 생성된 영상을 업로드할 수 있어요. \n클릭해서 이동하세요." }
|
||||
},
|
||||
"ado2": {
|
||||
"list": { "title": "생성된 영상 목록", "desc": "ADO2에서 만든 영상들을 확인할 수 있어요." },
|
||||
"download": { "title": "다운로드", "desc": "영상을 다운로드 할 수 있어요." },
|
||||
"delete": { "title": "삭제", "desc": "필요없는 영상을 삭제할 수 있어요." },
|
||||
"upload": { "title": "소셜 업로드", "desc": "선택해서 소셜미디어에 업로드하세요." }
|
||||
},
|
||||
"upload": {
|
||||
"seo": { "title": "제목 및 설명", "desc": "영상의 제목과 설명을 AI가 만들고 있어요. 잠시만 기다려 주세요." },
|
||||
"required": { "title": "필수 항목", "desc": "영상을 업로드 하기 전 *는 필수 항목으로 \n반드시 확인해 주세요." },
|
||||
"schedule": { "title": "업로드 예약", "desc": "지금 게시하거나 원하는 시간에 예약할 수 있어요." },
|
||||
"submit": { "title": "업로드 시작", "desc": "게시 버튼을 눌러 업로드를 시작하세요." }
|
||||
},
|
||||
"dashboard": {
|
||||
"metrics": { "title": "핵심 지표", "desc": "조회수, 구독자 등 ADO2로 업로드한 콘텐츠의 주요 통계를 확인하세요." },
|
||||
"chart": { "title": "성장 추이 차트", "desc": "기간별 성장 추이를 그래프로 확인할 수 있어요." },
|
||||
"more": { "title": "더 많은 통계", "desc": "그 외에도 다양한 통계를 대시보드에서 한눈에 확인할 수 있어요." }
|
||||
},
|
||||
"contentCalendar": {
|
||||
"grid": { "title": "콘텐츠 캘린더", "desc": "날짜별로 콘텐츠 스케줄을 확인할 수 있어요. \n오늘 날짜를 선택해 볼까요?" },
|
||||
"panel": { "title": "콘텐츠 목록", "desc": "자세한 콘텐츠 스케줄을 확인 할수 있어요." }
|
||||
},
|
||||
"feedback": {
|
||||
"complete": { "title": "튜토리얼 완료 🎉", "desc": "유튜브 업로드까지 모든 과정을 완료했어요. \n튜토리얼을 다시보고 싶다면 우측 상단의 버튼을 눌러주세요." },
|
||||
"title": "고객의견",
|
||||
"desc": "서비스 이용 중 불편한 점이나 개선 의견을 보내주세요."
|
||||
},
|
||||
"restart": {
|
||||
"title": "튜토리얼을 다시 시작할까요?",
|
||||
"desc": "현재 화면부터 튜토리얼이 다시 시작됩니다.",
|
||||
"confirm": "시작하기",
|
||||
"cancel": "취소"
|
||||
}
|
||||
"inquiry": "고객의견",
|
||||
"faq": "자주 묻는 질문",
|
||||
"login": "로그인",
|
||||
"settings": "설정"
|
||||
},
|
||||
"footer": {
|
||||
"company":"㈜에이아이오투오",
|
||||
"company": "㈜에이아이오투오",
|
||||
"businessNumber": "사업자 등록번호 : 620-87-00810 | 대표 : 안성민",
|
||||
"headquarters": "본사 : 대구광역시 북구 옥산로 111, 5층 유니콘랩 대구 A05호",
|
||||
"researchCenter": "연구소 : 경기 성남시 수정구 금토로 32 (금토동) (주)KT 판교빌딩 504호~505호 (East)",
|
||||
@@ -137,7 +70,29 @@
|
||||
"uploadFailed": "업로드에 실패했습니다.",
|
||||
"autoSeoTitle": "자동으로 작성중입니다. (30~60초 소요)",
|
||||
"autoSeoDescription": "자동으로 작성중입니다. (30~60초 소요)",
|
||||
"autoSeoTags": "자동으로 작성중입니다. (30~60초 소요)"
|
||||
"autoSeoTags": "자동으로 작성중입니다. (30~60초 소요)",
|
||||
"youtubeCallback": {
|
||||
"connecting": "YouTube 연결 중...",
|
||||
"pleaseWait": "잠시만 기다려주세요.",
|
||||
"failed": "연결 실패",
|
||||
"errorAuthCancelled": "Google 인증이 취소되었거나 실패했습니다.",
|
||||
"errorNoCode": "인증 코드를 받지 못했습니다.",
|
||||
"errorProcessing": "YouTube 연결 처리 중 오류가 발생했습니다."
|
||||
},
|
||||
"connectError": {
|
||||
"title": "{{platform}} 연결 실패",
|
||||
"defaultError": "알 수 없는 오류가 발생했습니다.",
|
||||
"detail": "다시 시도해주세요. 문제가 지속되면 고객 지원에 문의해주세요.",
|
||||
"retry": "다시 시도"
|
||||
},
|
||||
"connectSuccess": {
|
||||
"title": "{{name}} 연결 완료",
|
||||
"messageWithChannel": "{{platform}} 계정이 성공적으로 연결되었습니다.",
|
||||
"messageWithoutChannel": "계정이 성공적으로 연결되었습니다.",
|
||||
"verified": "인증됨",
|
||||
"countdown": "{{count}}초 후 자동으로 이동합니다...",
|
||||
"goNow": "지금 이동"
|
||||
}
|
||||
},
|
||||
"upload": {
|
||||
"title": "YouTube 업로드",
|
||||
@@ -159,29 +114,31 @@
|
||||
},
|
||||
"landing": {
|
||||
"hero": {
|
||||
"searchTypeBusinessName": "업체명",
|
||||
"placeholderBusinessName": "업체명을 입력하세요.",
|
||||
"guideUrl": "네이버지도에서 장소를 검색하고 공유 선택, \n나오는 URL을 붙여 넣어 주세요.",
|
||||
"guideBusinessName": "업체명으로 검색하여 정보를 가져옵니다.",
|
||||
"errorUrlRequired": "URL을 입력해주세요.",
|
||||
"errorNameRequired": "업체명을 입력해주세요.",
|
||||
"errorInvalidUrl": "올바른 URL 형식이 아닙니다. (예: https://example.com)",
|
||||
"searchTypeLabel": "업체명 | URL",
|
||||
"placeholderCombined": "업체명 또는 URL을 입력하세요.",
|
||||
"guideCombined": "네이버 지도 공유 URL을 붙여넣거나,\n업체명을 입력하면 자동으로 정보를 가져옵니다.",
|
||||
"errorInputRequired": "업체명 또는 URL을 입력해주세요.",
|
||||
"errorInvalidUrl": "올바른 URL 형식이 아닙니다. (예: https://naver.me/abcdef)",
|
||||
"analyzeButton": "브랜드 분석",
|
||||
"scrollMore": "스크롤하여 더 보기",
|
||||
"testDataLoading": "로딩 중...",
|
||||
"testData": "테스트 데이터",
|
||||
"testDataLoadFailed": "테스트 데이터를 불러오는데 실패했습니다.",
|
||||
"searching": "검색 중...",
|
||||
"searchTypeManual": "직접 입력",
|
||||
"manualModalTitle": "업체 정보 입력",
|
||||
"searchTypeManual": "네이버에 없는 업체인가요? 직접 입력하기",
|
||||
"manualButtonDesc": "네이버 지도/플레이스에 등록되지 않은 업체도\n업체명·지역·상세주소만 입력하면\n가사·음악·영상 제작까지 가능합니다.",
|
||||
"manualModalTitle": "업체 정보 직접 입력",
|
||||
"manualModalSubtitle": "네이버에 등록되지 않은 업체도 아래 정보만 입력하면 가사·음악·영상 제작까지 할 수 있어요.",
|
||||
"manualAnalyzeButton": "시작하기",
|
||||
"manualLabelName": "업체명",
|
||||
"manualLabelAddress": "주소",
|
||||
"manualLabelRegion": "지역",
|
||||
"manualLabelDetail": "상세 주소",
|
||||
"manualLabelCategory": "업종",
|
||||
"manualPlaceholderName": "업체명을 입력하세요.",
|
||||
"manualPlaceholderAddress": "주소를 입력하세요.",
|
||||
"manualPlaceholderRegion": "지역을 선택하세요.",
|
||||
"manualPlaceholderDetail": "상세 주소를 입력하세요. (예: 강남구 테헤란로 123)"
|
||||
"manualPlaceholderDetail": "상세 주소를 입력하세요. (예: 강남구 테헤란로 123)",
|
||||
"manualPlaceholderCategory": "업종을 입력하세요. (예: 펜션, 카페, 미용실)",
|
||||
"manualLabelSiteUrl": "홈페이지 링크 (선택)",
|
||||
"manualPlaceholderSiteUrl": "공식 홈페이지 주소를 입력하세요. (예: https://example.com)"
|
||||
},
|
||||
"welcome": {
|
||||
"title": "ADO2.AI에 오신 것을 환영합니다.",
|
||||
@@ -211,8 +168,6 @@
|
||||
"guideBusinessName": "업체명으로 검색하여 정보를 가져옵니다.",
|
||||
"searchButton": "검색하기",
|
||||
"searching": "검색 중...",
|
||||
"testDataLoading": "로딩 중...",
|
||||
"testData": "테스트 데이터",
|
||||
"searchTypeManual": "직접 입력",
|
||||
"errorSelectFromList": "목록에서 업체를 선택해 주세요.",
|
||||
"errorUrlRequired": "URL을 입력해주세요.",
|
||||
@@ -223,26 +178,34 @@
|
||||
"manualLabelAddress": "주소",
|
||||
"manualLabelRegion": "지역",
|
||||
"manualLabelDetail": "상세 주소",
|
||||
"manualLabelCategory": "업종",
|
||||
"manualPlaceholderName": "업체명을 입력하세요.",
|
||||
"manualPlaceholderAddress": "주소를 입력하세요.",
|
||||
"manualPlaceholderRegion": "지역을 선택하세요.",
|
||||
"manualPlaceholderDetail": "상세 주소를 입력하세요. (예: 강남구 테헤란로 123)"
|
||||
"manualPlaceholderDetail": "상세 주소를 입력하세요. (예: 강남구 테헤란로 123)",
|
||||
"manualPlaceholderCategory": "업종을 입력하세요. (예: 펜션, 카페, 미용실)"
|
||||
},
|
||||
"assetManagement": {
|
||||
"title": "브랜드 에셋",
|
||||
"selectedImages": "선택된 이미지",
|
||||
"imageAlt": "이미지",
|
||||
"uploadBadge": "업로드",
|
||||
"previewUnavailable": "미리보기 없음",
|
||||
"imageUpload": "이미지 업로드",
|
||||
"dragAndDrop": "이미지를 끌어다 놓거나\n클릭하여 업로드",
|
||||
"videoRatio": "영상 비율",
|
||||
"minImages": "최소 5장",
|
||||
"minImages": "권장 30장 이상",
|
||||
"youtubeShorts": "유튜브 쇼츠",
|
||||
"youtubeVideo": "유튜브 일반",
|
||||
"back": "뒤로가기",
|
||||
"loadMore": "더보기",
|
||||
"uploadFailed": "이미지 업로드에 실패했습니다.",
|
||||
"uploading": "업로드 중 (30초~2분 소요)",
|
||||
"uploadErrorTitle": "이미지 업로드 초과",
|
||||
"uploadErrorConfirm": "확인",
|
||||
"duplicateSkippedTitle": "중복 이미지 제외",
|
||||
"duplicateSkippedMessage": "이미 추가된 이미지 {{count}}장을 제외했습니다.",
|
||||
"preparingPreviews": "미리보기 준비 중 ({{done}} / {{total}})",
|
||||
"uploading": "업로드 중 (30~60초 소요)",
|
||||
"nextStep": "다음 단계"
|
||||
},
|
||||
"soundStudio": {
|
||||
@@ -338,7 +301,7 @@
|
||||
"noLyricsBGM": "배경음악은 가사 없이 생성됩니다.",
|
||||
"downloading": "다운로드 중...",
|
||||
"download": "다운로드",
|
||||
"uploadToSocial": "소셜 채널 업로드"
|
||||
"uploadToSocial": "업로드"
|
||||
},
|
||||
"dashboard": {
|
||||
"title": "대시보드",
|
||||
@@ -436,8 +399,8 @@
|
||||
"monthOverMonth": "전월 대비 성장",
|
||||
"noAudienceData": "누적 데이터가 부족하여 실제 시청자 정보가 없습니다.",
|
||||
"mockContentNotice": "현재 표시된 콘텐츠는 실제 데이터가 아닌 샘플 데이터입니다.",
|
||||
"dataDelayTitle": "데이터 준비 중",
|
||||
"dataDelayDesc": "유튜브 정책에 따라 분석 데이터는 영상 업로드 후 최대 48시간이 지나야 반영됩니다. 나중에 다시 확인해 주세요.",
|
||||
"dataDelayTitle": "표시할 데이터 없음",
|
||||
"dataDelayDesc": "표시할 분석 데이터가 없습니다. 유튜브 정책상 업로드 후 최대 48시간이 지나야 데이터가 반영되며, 영상을 비공개로 업로드했거나 유튜브에서 삭제한 경우에도 통계가 집계되지 않습니다.",
|
||||
"sampleHide": "Sample 숨기기",
|
||||
"sampleShow": "Sample 보기",
|
||||
"recentVideosDesc": "ADO2에서 업로드한 최근 30개의 영상 통계가 표시됩니다.",
|
||||
@@ -478,7 +441,9 @@
|
||||
"chargeSubmit": "요청하기",
|
||||
"chargeSubmitting": "요청 중...",
|
||||
"chargeSuccess": "충전 요청이 완료 되었습니다!",
|
||||
"chargeConfirm": "확인"
|
||||
"chargeConfirm": "확인",
|
||||
"tabContents": "내 콘텐츠",
|
||||
"tabCalendar": "콘텐츠 캘린더"
|
||||
},
|
||||
"ado2Contents": {
|
||||
"title": "ADO2 콘텐츠",
|
||||
@@ -497,7 +462,7 @@
|
||||
"delete": "삭제",
|
||||
"previous": "이전",
|
||||
"next": "다음",
|
||||
"uploadToSocial": "소셜 미디어에 업로드",
|
||||
"uploadToSocial": "업로드",
|
||||
"sortLatest": "최신순",
|
||||
"sortOldest": "오래된순",
|
||||
"sortLikes": "좋아요 많은순",
|
||||
@@ -562,14 +527,35 @@
|
||||
"scheduled": "예약",
|
||||
"failed": "실패"
|
||||
},
|
||||
"months": ["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"],
|
||||
"days": ["일","월","화","수","목","금","토"],
|
||||
"months": [
|
||||
"1월",
|
||||
"2월",
|
||||
"3월",
|
||||
"4월",
|
||||
"5월",
|
||||
"6월",
|
||||
"7월",
|
||||
"8월",
|
||||
"9월",
|
||||
"10월",
|
||||
"11월",
|
||||
"12월"
|
||||
],
|
||||
"days": [
|
||||
"일",
|
||||
"월",
|
||||
"화",
|
||||
"수",
|
||||
"목",
|
||||
"금",
|
||||
"토"
|
||||
],
|
||||
"yearMonth": "{{year}}년 {{month}}",
|
||||
"monthDay": "{{month}} {{day}}일",
|
||||
"loading": "불러오는 중...",
|
||||
"noResults": "최근 결과 없음",
|
||||
"noResultsDesc": "제작한 콘텐츠를 소셜 채널에 업로드해 보세요",
|
||||
"ado2Contents": "ADO2 콘텐츠",
|
||||
"myContents": "내 콘텐츠",
|
||||
"cancel": "취소",
|
||||
"retry": "재시도",
|
||||
"cancelConfirm": "예약을 취소하시겠습니까?",
|
||||
@@ -581,7 +567,28 @@
|
||||
},
|
||||
"loginPrompt": {
|
||||
"title": "로그인이 필요합니다.",
|
||||
"loginBtn": "로그인"
|
||||
"loginBtn": "로그인",
|
||||
"description": "카카오 계정으로 간편하게 로그인하고\n이어서 진행해보세요."
|
||||
},
|
||||
"videoDetail": {
|
||||
"dateFormat": "{{year}}년 {{month}}월 {{day}}일",
|
||||
"kakaoDefaultTitle": "ADO2 영상",
|
||||
"kakaoDescription": "{{region}} · ADO2 AI 마케팅 영상",
|
||||
"deletedComment": "(삭제된 댓글입니다.)",
|
||||
"closeAriaLabel": "닫기",
|
||||
"share": "공유하기",
|
||||
"copied": "복사됨!",
|
||||
"siteOverlayLabel": "자세히 보기",
|
||||
"commentsTitle": "댓글",
|
||||
"commentPlaceholder": "댓글을 입력하세요...",
|
||||
"commentLoginRequired": "로그인 후 댓글을 작성할 수 있습니다",
|
||||
"commentSubmitting": "작성 중",
|
||||
"commentSubmit": "작성",
|
||||
"noComments": "아직 댓글이 없습니다.",
|
||||
"anonymous": "익명",
|
||||
"deleteComment": "삭제",
|
||||
"loadMoreComments": "댓글 더 보기",
|
||||
"loadingComments": "불러오는 중..."
|
||||
},
|
||||
"app": {
|
||||
"loginProcessing": "로그인 처리 중...",
|
||||
@@ -593,5 +600,401 @@
|
||||
"autocompleteError": "검색 정보를 찾을 수 없습니다. 입력 정보를 다시 확인해주세요.",
|
||||
"autocompleteGeneralError": "업체 정보 조회 중 오류가 발생했습니다. 다시 시도해주세요.",
|
||||
"pageComingSoon": "{{page}} 페이지 준비 중입니다."
|
||||
},
|
||||
"pipelineTabs": {
|
||||
"ariaLabel": "생성할 콘텐츠 종류",
|
||||
"ado2": "ADO2",
|
||||
"ssul": "썰박스",
|
||||
"poster": "무빙 포스터",
|
||||
"desc": {
|
||||
"ado2": "업체 URL 하나로 브랜드를 분석해 가사·음악·숏폼 영상까지 자동 제작합니다.",
|
||||
"ssul": "유명 역사 스토리에 업체 셀링포인트를 녹여 흥미로운 숏폼 콘텐츠를 만듭니다.",
|
||||
"poster": "포스터가 나레이션, 음악, 애니메이션을 추가한 숏폼 콘텐츠로 나옵니다.",
|
||||
"playreel": "공연 상품페이지 주소 하나로 30초 세로 예고편을 만듭니다. 중요한 순간마다 확인을 요청합니다."
|
||||
}
|
||||
},
|
||||
"ssulbox": {
|
||||
"steps": {
|
||||
"pick": "선택",
|
||||
"making": "생성",
|
||||
"done": "완성"
|
||||
},
|
||||
"create": {
|
||||
"step1": "STEP 1 · 시나리오 선택",
|
||||
"step2": "STEP 2 · 업체 검색",
|
||||
"searchPlaceholder": "업체명 또는 URL을 입력하세요.",
|
||||
"searchButton": "검색",
|
||||
"searching": "검색 중",
|
||||
"placeLoading": "업체를 찾는 중… (몇 초 걸려요)",
|
||||
"hintUrlOk": "네이버 링크로 해당 업체를 직접 수집합니다.",
|
||||
"hintDefault": "업체를 선택하면 해당 업체의 사진과 정보를 수집해 썰박스에 씁니다.",
|
||||
"hintScenario": "{{name}} 시나리오로 약 5~6분 소요됩니다.",
|
||||
"noResult": "검색 결과가 없어요. 이름을 바꾸거나 네이버 지도 링크를 붙여넣어 주세요.",
|
||||
"cost": "생성 비용",
|
||||
"costValue": "1 크레딧",
|
||||
"submit": "썰박스 만들기",
|
||||
"submitting": "요청 중…"
|
||||
},
|
||||
"making": {
|
||||
"title": "썰박스를 만들고 있어요",
|
||||
"step1": "대본 생성 중",
|
||||
"step2": "스토리보드 구성 중",
|
||||
"step3": "이미지·목소리 생성 중",
|
||||
"step4": "영상 합성 중",
|
||||
"takesTime": "약 5~6분 소요됩니다.",
|
||||
"failTitle": "생성에 실패했어요",
|
||||
"failDefault": "잠시 후 다시 시도해주세요.",
|
||||
"refunded": "차감된 크레딧은 환불되었습니다.",
|
||||
"retry": "다시 만들기"
|
||||
},
|
||||
"result": {
|
||||
"title": "썰박스가 완성됐어요",
|
||||
"download": "다운로드",
|
||||
"downloading": "다운로드 중...",
|
||||
"loadFailed": "영상을 불러오지 못했어요. 내 콘텐츠에서 확인해주세요.",
|
||||
"scenarioLabel": "시나리오",
|
||||
"createdLabel": "생성일시"
|
||||
},
|
||||
"viewer": {
|
||||
"untitled": "이름 없는 콘텐츠"
|
||||
},
|
||||
"error": {
|
||||
"createFailed": "생성 요청에 실패했어요. 잠시 후 다시 시도해주세요."
|
||||
},
|
||||
"scenario": {
|
||||
"joseon": {
|
||||
"name": "조선왕",
|
||||
"desc": "조선 27대 왕들의 실화 썰"
|
||||
},
|
||||
"samgukji": {
|
||||
"name": "삼국지",
|
||||
"desc": "위·촉·오 영웅 28인의 야사"
|
||||
},
|
||||
"greek": {
|
||||
"name": "그리스·로마신화",
|
||||
"desc": "올림포스 신·영웅들의 전설"
|
||||
},
|
||||
"odyssey": {
|
||||
"name": "오디세이",
|
||||
"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,10 +1,7 @@
|
||||
import React, { useEffect } from 'react';
|
||||
import React from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { CrawlingResponse, TargetPersona } from '../../types/api';
|
||||
import { GeometricChart } from './GeometricChart';
|
||||
import { useTutorial } from '../../components/Tutorial/useTutorial';
|
||||
import { TUTORIAL_KEYS } from '../../components/Tutorial/tutorialSteps';
|
||||
import TutorialOverlay from '../../components/Tutorial/TutorialOverlay';
|
||||
|
||||
interface AnalysisResultSectionProps {
|
||||
onBack: () => void;
|
||||
@@ -14,19 +11,8 @@ interface AnalysisResultSectionProps {
|
||||
|
||||
const AnalysisResultSection: React.FC<AnalysisResultSectionProps> = ({ onBack, onGenerate, data }) => {
|
||||
const { t } = useTranslation();
|
||||
const tutorial = useTutorial();
|
||||
const { processed_info, marketing_analysis } = data;
|
||||
|
||||
useEffect(() => {
|
||||
const timer = setTimeout(() => {
|
||||
if (!tutorial.hasSeen(TUTORIAL_KEYS.ANALYSIS)) {
|
||||
tutorial.startTutorial(TUTORIAL_KEYS.ANALYSIS);
|
||||
}
|
||||
}, 600);
|
||||
return () => clearTimeout(timer);
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, []);
|
||||
|
||||
const brandIdentity = marketing_analysis?.brand_identity;
|
||||
const marketPositioning = marketing_analysis?.market_positioning;
|
||||
const targetPersonas = marketing_analysis?.target_persona || [];
|
||||
@@ -37,7 +23,6 @@ const AnalysisResultSection: React.FC<AnalysisResultSectionProps> = ({ onBack, o
|
||||
const sortedSellingPoints = [...sellingPoints].sort((a, b) => b.score - a.score);
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="bi2-page">
|
||||
{/* Header */}
|
||||
<div className="bi2-header">
|
||||
@@ -189,18 +174,6 @@ const AnalysisResultSection: React.FC<AnalysisResultSectionProps> = ({ onBack, o
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{tutorial.isActive && (
|
||||
<TutorialOverlay
|
||||
hints={tutorial.hints}
|
||||
currentIndex={tutorial.currentHintIndex}
|
||||
onNext={tutorial.nextHint}
|
||||
onPrev={tutorial.prevHint}
|
||||
onSkip={tutorial.skipTutorial}
|
||||
groupProgress={tutorial.groupProgress}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ const LoadingSection: React.FC<LoadingSectionProps> = ({ onComplete, isComplete
|
||||
const increment = prev < 70 ? 0.5 : prev < 90 ? 0.2 : 0.1;
|
||||
return Math.min(prev + increment, 100);
|
||||
});
|
||||
}, 100);
|
||||
}, 200);
|
||||
return () => {
|
||||
if (intervalRef.current) clearInterval(intervalRef.current);
|
||||
};
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { getAllVideos, isLoggedIn } from '../../utils/api';
|
||||
import { getAllVideos } from '../../utils/api';
|
||||
import { isP2vContent } from '../../utils/p2vApi';
|
||||
import { VideoListItem } from '../../types/api';
|
||||
import LoginPromptModal from '../../components/LoginPromptModal';
|
||||
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;
|
||||
@@ -12,11 +15,14 @@ interface ADO2ContentsPageProps {
|
||||
|
||||
const ADO2ContentsPage: React.FC<ADO2ContentsPageProps> = () => {
|
||||
const { t } = useTranslation();
|
||||
const authed = isLoggedIn();
|
||||
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 [videos, setVideos] = useState<VideoListItem[]>([]);
|
||||
const [total, setTotal] = useState(0);
|
||||
const [loading, setLoading] = useState(authed);
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
const [page, setPage] = useState(1);
|
||||
const [hasNext, setHasNext] = useState(false);
|
||||
@@ -32,7 +38,6 @@ const ADO2ContentsPage: React.FC<ADO2ContentsPageProps> = () => {
|
||||
const [showCityModal, setShowCityModal] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
if (!authed) return;
|
||||
fetchVideos();
|
||||
}, [page, sortBy, order, storeName, region]);
|
||||
|
||||
@@ -140,17 +145,40 @@ const ADO2ContentsPage: React.FC<ADO2ContentsPageProps> = () => {
|
||||
<>
|
||||
<div className="ado2-contents-grid">
|
||||
{videos.map((video) => (
|
||||
// key·상세 열기 모두 (type, video_id) 로 다뤄야 한다 —
|
||||
// video_id 는 종류별 독립 시퀀스라 값이 겹친다.
|
||||
<div
|
||||
key={video.video_id}
|
||||
key={`${video.type}-${video.video_id}`}
|
||||
className="ado2-content-card"
|
||||
style={{ cursor: 'pointer' }}
|
||||
onClick={() => handleCardClick(video.video_id)}
|
||||
onClick={() =>
|
||||
isP2vContent(video.type)
|
||||
? setSelectedP2v(video)
|
||||
: video.type === 'ssul'
|
||||
? setSelectedSsul(video)
|
||||
: handleCardClick(video.video_id)
|
||||
}
|
||||
role="button"
|
||||
tabIndex={0}
|
||||
onKeyDown={(e) => e.key === 'Enter' && handleCardClick(video.video_id)}
|
||||
onKeyDown={(e) =>
|
||||
e.key === 'Enter' &&
|
||||
(isP2vContent(video.type)
|
||||
? setSelectedP2v(video)
|
||||
: video.type === 'ssul'
|
||||
? setSelectedSsul(video)
|
||||
: handleCardClick(video.video_id))
|
||||
}
|
||||
>
|
||||
<div className="content-card-thumbnail ado2-gallery-thumbnail-wrap">
|
||||
{video.thumbnail_url ? (
|
||||
{video.poster_url ? (
|
||||
<img
|
||||
src={video.poster_url}
|
||||
alt={video.store_name}
|
||||
loading="lazy"
|
||||
decoding="async"
|
||||
className="content-video-preview"
|
||||
/>
|
||||
) : video.thumbnail_url ? (
|
||||
<img
|
||||
src={video.thumbnail_url}
|
||||
alt={video.store_name}
|
||||
@@ -179,18 +207,20 @@ const ADO2ContentsPage: React.FC<ADO2ContentsPageProps> = () => {
|
||||
<div className="content-card-info">
|
||||
<div className="content-card-text">
|
||||
<h3 className="content-card-title">{video.store_name}</h3>
|
||||
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
|
||||
<div className="content-card-meta">
|
||||
<p className="content-card-date">{formatDate(video.created_at)}</p>
|
||||
<span className="content-card-like">
|
||||
<svg width="15" height="15" viewBox="0 0 24 24" fill="currentColor" 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>
|
||||
{video.like_count ?? 0}
|
||||
<svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" style={{ marginLeft: '6px' }}>
|
||||
<path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/>
|
||||
</svg>
|
||||
{video.comment_count ?? 0}
|
||||
</span>
|
||||
{/* 모든 콘텐츠는 ID 와 종류를 함께 보내 소셜 반응을 구분한다. */}
|
||||
<ContentCardSocialActions
|
||||
videoId={video.video_id}
|
||||
contentType={video.type}
|
||||
storeName={video.store_name}
|
||||
region={video.region}
|
||||
title={video.title}
|
||||
description={video.description}
|
||||
commentCount={video.comment_count ?? 0}
|
||||
initialLikeCount={video.like_count ?? 0}
|
||||
initialIsLiked={video.is_liked_by_me}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -218,9 +248,8 @@ const ADO2ContentsPage: React.FC<ADO2ContentsPageProps> = () => {
|
||||
</>
|
||||
)}
|
||||
|
||||
{!authed && (
|
||||
<LoginPromptModal onClose={() => { window.location.href = '/'; }} />
|
||||
)}
|
||||
<SsulViewerModal item={selectedSsul} onClose={() => setSelectedSsul(null)} />
|
||||
<P2vViewerModal item={selectedP2v} onClose={() => setSelectedP2v(null)} />
|
||||
|
||||
{selectedVideoId !== null && (
|
||||
<VideoDetailModal
|
||||
|
||||
@@ -3,13 +3,19 @@ import React, { useRef, useState, useEffect } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { ImageItem, ImageUrlItem } from '../../types/api';
|
||||
import { uploadImages } from '../../utils/api';
|
||||
import { isImageInputFile } from '../../utils/imageCompression.ts';
|
||||
import { MAX_IMAGES_PER_UPLOAD_TASK } from '../../utils/imageUpload.ts';
|
||||
import { splitDuplicateFiles } from '../../utils/imageDedup.ts';
|
||||
|
||||
interface AssetManagementContentProps {
|
||||
onNext: (imageTaskId: string) => void;
|
||||
onBack?: () => void;
|
||||
imageList: ImageItem[];
|
||||
onRemoveImage: (index: number) => void;
|
||||
onAddImages: (files: File[]) => void;
|
||||
onAddImages: (
|
||||
files: File[],
|
||||
onProgress: (done: number, total: number) => void
|
||||
) => Promise<void>;
|
||||
}
|
||||
|
||||
type VideoRatio = 'vertical' | 'horizontal';
|
||||
@@ -26,9 +32,12 @@ const AssetManagementContent: React.FC<AssetManagementContentProps> = ({
|
||||
const { t } = useTranslation();
|
||||
const fileInputRef = useRef<HTMLInputElement>(null);
|
||||
const [isUploading, setIsUploading] = useState(false);
|
||||
const [uploadError, setUploadError] = useState<string | null>(null);
|
||||
const [uploadProgress, setUploadProgress] = useState(0);
|
||||
// 업로드 실패와 중복 제외 안내가 같은 다이얼로그 마크업을 공유한다.
|
||||
const [dialog, setDialog] = useState<{ title: string; message: string } | null>(null);
|
||||
const [videoRatio, setVideoRatio] = useState<VideoRatio>('vertical');
|
||||
const [displayCount, setDisplayCount] = useState(IMAGES_PER_PAGE);
|
||||
const [thumbnailProgress, setThumbnailProgress] = useState<{ done: number; total: number } | null>(null);
|
||||
|
||||
useEffect(() => {
|
||||
const savedRatio = localStorage.getItem('castad_video_ratio') as VideoRatio;
|
||||
@@ -37,20 +46,42 @@ const AssetManagementContent: React.FC<AssetManagementContentProps> = ({
|
||||
}
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
if (!dialog) return;
|
||||
|
||||
const handleEscape = (event: KeyboardEvent) => {
|
||||
if (event.key === 'Escape') {
|
||||
event.preventDefault();
|
||||
setDialog(null);
|
||||
}
|
||||
};
|
||||
|
||||
window.addEventListener('keydown', handleEscape);
|
||||
return () => window.removeEventListener('keydown', handleEscape);
|
||||
}, [dialog]);
|
||||
|
||||
const handleVideoRatioChange = (ratio: VideoRatio) => {
|
||||
setVideoRatio(ratio);
|
||||
localStorage.setItem('castad_video_ratio', ratio);
|
||||
};
|
||||
|
||||
const getImageSrc = (item: ImageItem): string => {
|
||||
return item.type === 'url' ? item.url : item.preview;
|
||||
const getImageSrc = (item: ImageItem): string | null => {
|
||||
return item.type === 'url' ? item.preview_url : item.preview;
|
||||
};
|
||||
|
||||
const handleNextWithUpload = async () => {
|
||||
if (imageList.length === 0) return;
|
||||
|
||||
setIsUploading(true);
|
||||
setUploadError(null);
|
||||
setUploadProgress(0);
|
||||
setDialog(null);
|
||||
|
||||
const interval = setInterval(() => {
|
||||
setUploadProgress(prev => {
|
||||
if (prev >= 99) return prev;
|
||||
return prev + (prev < 50 ? 0.6 : prev < 80 ? 0.3 : prev < 90 ? 0.15 : 0.11);
|
||||
});
|
||||
}, 200);
|
||||
|
||||
try {
|
||||
const urlImages: ImageUrlItem[] = imageList
|
||||
@@ -63,13 +94,47 @@ const AssetManagementContent: React.FC<AssetManagementContentProps> = ({
|
||||
|
||||
if (urlImages.length > 0 || fileImages.length > 0) {
|
||||
const response = await uploadImages(urlImages, fileImages);
|
||||
clearInterval(interval);
|
||||
setUploadProgress(100);
|
||||
// 이미지 변경 시 이전 음악/영상 생성 결과 초기화 — 반드시 재생성하도록 강제
|
||||
localStorage.removeItem('castad_song_generation');
|
||||
localStorage.removeItem('castad_song_completion');
|
||||
localStorage.removeItem('castad_song_task_id');
|
||||
localStorage.removeItem('castad_video_generation');
|
||||
localStorage.removeItem('castad_video_complete');
|
||||
onNext(response.task_id);
|
||||
}
|
||||
} catch (error) {
|
||||
clearInterval(interval);
|
||||
console.error('Image upload failed:', error);
|
||||
setUploadError(error instanceof Error ? error.message : t('assetManagement.uploadFailed'));
|
||||
setDialog({
|
||||
title: t('assetManagement.uploadErrorTitle'),
|
||||
message: error instanceof Error ? error.message : t('assetManagement.uploadFailed'),
|
||||
});
|
||||
} finally {
|
||||
setIsUploading(false);
|
||||
setUploadProgress(0);
|
||||
}
|
||||
};
|
||||
|
||||
const runAddImages = async (files: File[]) => {
|
||||
const { newFiles, duplicateCount } = splitDuplicateFiles(imageList, files);
|
||||
|
||||
if (newFiles.length > 0) {
|
||||
setThumbnailProgress({ done: 0, total: newFiles.length });
|
||||
try {
|
||||
await onAddImages(newFiles, (done, total) => setThumbnailProgress({ done, total }));
|
||||
} finally {
|
||||
setThumbnailProgress(null);
|
||||
}
|
||||
}
|
||||
|
||||
// 썸네일 생성 오버레이에 가려지지 않도록 작업이 끝난 뒤에 안내한다.
|
||||
if (duplicateCount > 0) {
|
||||
setDialog({
|
||||
title: t('assetManagement.duplicateSkippedTitle'),
|
||||
message: t('assetManagement.duplicateSkippedMessage', { count: duplicateCount }),
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
@@ -81,10 +146,8 @@ const AssetManagementContent: React.FC<AssetManagementContentProps> = ({
|
||||
const handleDrop = (e: React.DragEvent) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
const files = Array.from(e.dataTransfer.files).filter((file: File) =>
|
||||
file.type.startsWith('image/')
|
||||
);
|
||||
if (files.length > 0) onAddImages(files);
|
||||
const files = Array.from<File>(e.dataTransfer.files).filter(isImageInputFile);
|
||||
if (files.length > 0) void runAddImages(files);
|
||||
};
|
||||
|
||||
const handleFileSelect = () => {
|
||||
@@ -94,7 +157,7 @@ const AssetManagementContent: React.FC<AssetManagementContentProps> = ({
|
||||
const handleFileChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
||||
const files = e.target.files;
|
||||
if (files && files.length > 0) {
|
||||
onAddImages(Array.from(files));
|
||||
void runAddImages(Array.from(files));
|
||||
e.target.value = '';
|
||||
}
|
||||
};
|
||||
@@ -104,6 +167,79 @@ const AssetManagementContent: React.FC<AssetManagementContentProps> = ({
|
||||
|
||||
return (
|
||||
<main className="asset-page">
|
||||
{thumbnailProgress && (
|
||||
<div className="asset-upload-overlay">
|
||||
<div className="asset-upload-overlay-content">
|
||||
<div className="loading-spinner">
|
||||
<div className="loading-ring"></div>
|
||||
<div className="loading-dot">
|
||||
<div className="loading-dot-inner"></div>
|
||||
</div>
|
||||
</div>
|
||||
<p className="comp2-loading-text">
|
||||
{t('assetManagement.preparingPreviews', {
|
||||
done: thumbnailProgress.done,
|
||||
total: thumbnailProgress.total,
|
||||
})}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{isUploading && (
|
||||
<div className="asset-upload-overlay">
|
||||
<div className="asset-upload-overlay-content">
|
||||
<div className="loading-spinner">
|
||||
<div className="loading-ring"></div>
|
||||
<div className="loading-dot">
|
||||
<div className="loading-dot-inner"></div>
|
||||
</div>
|
||||
</div>
|
||||
<p className="comp2-loading-text">{t('assetManagement.uploading')}</p>
|
||||
<div className="loading-progress-wrapper">
|
||||
<div className="loading-progress-bar">
|
||||
<div
|
||||
className="loading-progress-fill"
|
||||
style={{ width: `${uploadProgress}%` }}
|
||||
/>
|
||||
</div>
|
||||
<span className="loading-progress-text">{Math.floor(uploadProgress)}%</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{dialog && (
|
||||
<div
|
||||
className="asset-upload-error-overlay"
|
||||
onClick={() => setDialog(null)}
|
||||
>
|
||||
<div
|
||||
className="asset-upload-error-dialog"
|
||||
role="alertdialog"
|
||||
aria-modal="true"
|
||||
aria-labelledby="asset-upload-error-title"
|
||||
aria-describedby="asset-upload-error-message"
|
||||
onClick={(event) => event.stopPropagation()}
|
||||
>
|
||||
<h2 id="asset-upload-error-title" className="asset-upload-error-title">
|
||||
{dialog.title}
|
||||
</h2>
|
||||
<p id="asset-upload-error-message" className="asset-upload-error-message">
|
||||
{dialog.message}
|
||||
</p>
|
||||
<button
|
||||
type="button"
|
||||
className="asset-upload-error-confirm"
|
||||
onClick={() => setDialog(null)}
|
||||
autoFocus
|
||||
>
|
||||
{t('assetManagement.uploadErrorConfirm')}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Fixed Header - 뒤로가기 버튼 */}
|
||||
<div className="asset-sticky-header">
|
||||
{onBack && (
|
||||
@@ -127,6 +263,13 @@ const AssetManagementContent: React.FC<AssetManagementContentProps> = ({
|
||||
<div className="asset-section-header-left">
|
||||
<h3 className="asset-section-title">{t('assetManagement.selectedImages')}</h3>
|
||||
<span className="asset-section-subtitle">{t('assetManagement.minImages')}</span>
|
||||
<span
|
||||
className={`asset-section-count${
|
||||
imageList.length > MAX_IMAGES_PER_UPLOAD_TASK ? ' asset-section-count-over' : ''
|
||||
}`}
|
||||
>
|
||||
{imageList.length} / {MAX_IMAGES_PER_UPLOAD_TASK}
|
||||
</span>
|
||||
</div>
|
||||
<button onClick={handleFileSelect} className="asset-mobile-upload-btn">
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none">
|
||||
@@ -140,26 +283,46 @@ const AssetManagementContent: React.FC<AssetManagementContentProps> = ({
|
||||
<div className="asset-image-list">
|
||||
{visibleImages.length > 0 && (
|
||||
<div className="asset-image-grid">
|
||||
{visibleImages.map((item, i) => (
|
||||
<div key={i} className="asset-image-item">
|
||||
<img
|
||||
src={getImageSrc(item)}
|
||||
alt={`${t('assetManagement.imageAlt')} ${i + 1}`}
|
||||
/>
|
||||
{item.type === 'file' && (
|
||||
<div className="asset-image-badge">{t('assetManagement.uploadBadge')}</div>
|
||||
)}
|
||||
<button
|
||||
onClick={() => onRemoveImage(i)}
|
||||
className="asset-image-remove"
|
||||
>
|
||||
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5">
|
||||
<line x1="18" y1="6" x2="6" y2="18"/>
|
||||
<line x1="6" y1="6" x2="18" y2="18"/>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
))}
|
||||
{visibleImages.map((item, i) => {
|
||||
const src = getImageSrc(item);
|
||||
const fileName = item.type === 'file' ? item.file.name : '';
|
||||
return (
|
||||
<div key={i} className="asset-image-item">
|
||||
{src ? (
|
||||
<img
|
||||
src={src}
|
||||
alt={`${t('assetManagement.imageAlt')} ${i + 1}`}
|
||||
referrerPolicy="no-referrer"
|
||||
loading="lazy"
|
||||
decoding="async"
|
||||
/>
|
||||
) : (
|
||||
<div className="asset-image-placeholder" title={fileName}>
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
|
||||
<rect x="3" y="3" width="18" height="18" rx="2"/>
|
||||
<circle cx="8.5" cy="8.5" r="1.5"/>
|
||||
<path d="M21 15l-5-5L5 21"/>
|
||||
</svg>
|
||||
<span className="asset-image-placeholder-name">
|
||||
{fileName || t('assetManagement.previewUnavailable')}
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
{item.type === 'file' && (
|
||||
<div className="asset-image-badge">{t('assetManagement.uploadBadge')}</div>
|
||||
)}
|
||||
<button
|
||||
onClick={() => onRemoveImage(i)}
|
||||
className="asset-image-remove"
|
||||
>
|
||||
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5">
|
||||
<line x1="18" y1="6" x2="6" y2="18"/>
|
||||
<line x1="6" y1="6" x2="18" y2="18"/>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
@@ -225,9 +388,6 @@ const AssetManagementContent: React.FC<AssetManagementContentProps> = ({
|
||||
|
||||
{/* Fixed Footer - 다음 단계 버튼 */}
|
||||
<div className="asset-sticky-footer">
|
||||
{uploadError && (
|
||||
<p className="text-red-500 text-sm mb-2">{uploadError}</p>
|
||||
)}
|
||||
<button
|
||||
onClick={handleNextWithUpload}
|
||||
disabled={imageList.length === 0 || isUploading}
|
||||
@@ -240,7 +400,7 @@ const AssetManagementContent: React.FC<AssetManagementContentProps> = ({
|
||||
<input
|
||||
ref={fileInputRef}
|
||||
type="file"
|
||||
accept="image/*"
|
||||
accept="image/*,.heic,.heif"
|
||||
multiple
|
||||
onChange={handleFileChange}
|
||||
className="hidden"
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
|
||||
import React from 'react';
|
||||
import Sidebar from '../../components/Sidebar';
|
||||
import AssetManagementContent from './AssetManagementContent';
|
||||
|
||||
interface AssetManagementSectionProps {
|
||||
onBack: () => void;
|
||||
}
|
||||
|
||||
const AssetManagementSection: React.FC<AssetManagementSectionProps> = ({ onBack }) => {
|
||||
return (
|
||||
<div className="flex w-full h-screen bg-[#002224] text-white overflow-hidden">
|
||||
<Sidebar />
|
||||
<div className="flex-1 overflow-y-auto">
|
||||
<AssetManagementContent onBack={onBack} onNext={() => {}} />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default AssetManagementSection;
|
||||
@@ -1,11 +1,9 @@
|
||||
|
||||
import React, { useState, useEffect, useRef } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { generateVideo, waitForVideoComplete, getSubtitleStatus, waitForSubtitleComplete } from '../../utils/api';
|
||||
import { generateVideo, waitForVideoComplete, getSubtitleStatus, waitForSubtitleComplete, trackFirstVideoCreated } from '../../utils/api';
|
||||
import SocialPostingModal from '../../components/SocialPostingModal';
|
||||
import { useTutorial } from '../../components/Tutorial/useTutorial';
|
||||
import { TUTORIAL_KEYS } from '../../components/Tutorial/tutorialSteps';
|
||||
import TutorialOverlay from '../../components/Tutorial/TutorialOverlay';
|
||||
import CompletionView from '../../components/CompletionView';
|
||||
|
||||
interface CompletionContentProps {
|
||||
onBack: () => void;
|
||||
@@ -46,22 +44,6 @@ const CompletionContent: React.FC<CompletionContentProps> = ({
|
||||
const hasStartedGeneration = useRef(false);
|
||||
const displayIntervalRef = useRef<ReturnType<typeof setInterval> | null>(null);
|
||||
|
||||
const tutorial = useTutorial();
|
||||
const tutorialIsActiveRef = useRef(tutorial.isActive);
|
||||
tutorialIsActiveRef.current = tutorial.isActive;
|
||||
|
||||
// 영상 생성 중 튜토리얼 트리거 (생성 상태 안내 -> 콘텐츠 정보 -> 내 정보 이동)
|
||||
useEffect(() => {
|
||||
const isComplete = videoStatus === 'complete';
|
||||
const isProcessing = videoStatus === 'generating' || videoStatus === 'polling';
|
||||
|
||||
if (isProcessing && !tutorialIsActiveRef.current && !tutorial.hasSeen(TUTORIAL_KEYS.GENERATING)) {
|
||||
tutorial.startTutorial(TUTORIAL_KEYS.GENERATING);
|
||||
} else if (isComplete && !tutorialIsActiveRef.current && !tutorial.hasSeen(TUTORIAL_KEYS.COMPLETION)) {
|
||||
tutorial.startTutorial(TUTORIAL_KEYS.COMPLETION);
|
||||
}
|
||||
}, [videoStatus]);
|
||||
|
||||
// 소셜 미디어 포스팅 모달
|
||||
const [showSocialModal, setShowSocialModal] = useState(false);
|
||||
const [videoDbId, setVideoDbId] = useState<number | null>(null);
|
||||
@@ -266,6 +248,9 @@ const CompletionContent: React.FC<CompletionContentProps> = ({
|
||||
setVideoStatus('complete');
|
||||
setStatusMessage('');
|
||||
saveToStorage(videoTaskId, currentSongTaskId, 'complete', videoUrlFromResponse, videoId);
|
||||
|
||||
// Meta FirstVideoCreated 전환 이벤트 발화 (서버가 계정당 최초 1회 판정, 실패해도 무시)
|
||||
trackFirstVideoCreated();
|
||||
} else {
|
||||
throw new Error(t('completion.videoUrlMissing'));
|
||||
}
|
||||
@@ -407,170 +392,98 @@ const CompletionContent: React.FC<CompletionContentProps> = ({
|
||||
return `${businessName}.mp4`;
|
||||
};
|
||||
|
||||
/**
|
||||
* 가사 단락 파싱.
|
||||
*
|
||||
* `[Verse]` 처럼 대괄호만 있는 줄을 섹션 머리로 보고, 뒤따르는 줄들을 그 섹션에
|
||||
* 묶는다. 태그 없이 시작하는 가사도 있어 첫 섹션은 태그 없이 열릴 수 있다.
|
||||
*/
|
||||
const renderLyrics = () => {
|
||||
if (!songCompletionData) {
|
||||
return <p className="comp2-lyrics-text">{t('completion.sampleLyrics')}</p>;
|
||||
}
|
||||
if (!songCompletionData.lyrics) {
|
||||
return <p className="comp2-lyrics-text">{t('completion.noLyricsBGM')}</p>;
|
||||
}
|
||||
const lines = songCompletionData.lyrics.split('\n').filter((l: string) => l.trim());
|
||||
const sections: { tag: string | null; lines: string[] }[] = [];
|
||||
lines.forEach((line: string) => {
|
||||
const tagMatch = line.trim().match(/^\[(.+)\]$/);
|
||||
if (tagMatch) {
|
||||
sections.push({ tag: `[${tagMatch[1]}]`, lines: [] });
|
||||
} else if (sections.length === 0) {
|
||||
sections.push({ tag: null, lines: [line] });
|
||||
} else {
|
||||
sections[sections.length - 1].lines.push(line);
|
||||
}
|
||||
});
|
||||
return (
|
||||
<div className="comp2-lyrics-paragraphs">
|
||||
{sections
|
||||
.filter((s) => s.lines.length > 0)
|
||||
.map((section, i) => (
|
||||
<div key={i} className="comp2-lyrics-para-section">
|
||||
{section.tag && <span className="comp2-lyrics-tag">{section.tag}</span>}
|
||||
<p className="comp2-lyrics-text">{section.lines.join('\n')}</p>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
return (
|
||||
<main className="comp2-page">
|
||||
<div className="comp2-header">
|
||||
<button onClick={onBack} className="comp2-back-btn">
|
||||
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
|
||||
<path d="M15 18l-6-6 6-6" />
|
||||
</svg>
|
||||
<span>{t('completion.back')}</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div className="comp2-title-row">
|
||||
<h1 className="comp2-page-title">{t('completion.contentComplete')}</h1>
|
||||
<p className="comp2-page-subtitle">{t('completion.contentCompleteDesc')}</p>
|
||||
</div>
|
||||
|
||||
<div className="comp2-container">
|
||||
<div className="comp2-grid">
|
||||
{/* 왼쪽: 영상 */}
|
||||
<div className="comp2-video-section">
|
||||
<div className="comp2-video-wrapper">
|
||||
{isLoading ? (
|
||||
<div className="comp2-video-loading">
|
||||
<div className="loading-spinner">
|
||||
<div className="loading-ring"></div>
|
||||
<div className="loading-dot">
|
||||
<div className="loading-dot-inner"></div>
|
||||
</div>
|
||||
</div>
|
||||
<p className="comp2-loading-text">{statusMessage}</p>
|
||||
<div className="loading-progress-wrapper">
|
||||
<div className="loading-progress-bar">
|
||||
<div
|
||||
className="loading-progress-fill"
|
||||
style={{ width: `${displayProgress}%` }}
|
||||
/>
|
||||
</div>
|
||||
<span className="loading-progress-text">{Math.floor(displayProgress)}%</span>
|
||||
</div>
|
||||
</div>
|
||||
) : videoStatus === 'error' ? (
|
||||
<div className="comp2-video-error">
|
||||
<svg className="comp2-error-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
|
||||
<circle cx="12" cy="12" r="10" />
|
||||
<path d="M12 8v4M12 16h.01" />
|
||||
</svg>
|
||||
<p className="comp2-error-text">{errorMessage}</p>
|
||||
<button onClick={handleRetry} className="comp2-retry-btn">
|
||||
{t('completion.retry')}
|
||||
</button>
|
||||
</div>
|
||||
) : videoUrl ? (
|
||||
<video
|
||||
src={videoUrl}
|
||||
className="comp2-video-player"
|
||||
controls
|
||||
playsInline
|
||||
/>
|
||||
) : (
|
||||
<div className="comp2-video-placeholder"></div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* 오른쪽: 콘텐츠 정보 */}
|
||||
<div className="comp2-info-section">
|
||||
<div className="comp2-info-header">
|
||||
<span className="comp2-info-label">{t('completion.contentInfo')}</span>
|
||||
</div>
|
||||
<div className="comp2-info-content">
|
||||
<div className="comp2-file-info">
|
||||
<h3 className="comp2-filename">{getFileName()}</h3>
|
||||
{/* <p className="comp2-filesize">19.6MB</p> */}
|
||||
</div>
|
||||
<div className="comp2-meta-grid">
|
||||
<div className="comp2-meta-item">
|
||||
<span className="comp2-meta-label">{t('completion.genre')} : {songCompletionData?.genre || 'K-POP'}</span>
|
||||
</div>
|
||||
<div className="comp2-meta-divider"></div>
|
||||
<div className="comp2-meta-item">
|
||||
<span className="comp2-meta-label">{t('completion.resolution')} : {getVideoResolution()}</span>
|
||||
</div>
|
||||
<div className="comp2-meta-divider"></div>
|
||||
<div className="comp2-lyrics-section">
|
||||
<span className="comp2-meta-label">{t('completion.lyrics')}</span>
|
||||
{(() => {
|
||||
if (!songCompletionData) {
|
||||
return <p className="comp2-lyrics-text">{t('completion.sampleLyrics')}</p>;
|
||||
}
|
||||
if (!songCompletionData.lyrics) {
|
||||
return <p className="comp2-lyrics-text">{t('completion.noLyricsBGM')}</p>;
|
||||
}
|
||||
const lines = songCompletionData.lyrics.split('\n').filter((l: string) => l.trim());
|
||||
const outro = lines.slice(-1);
|
||||
const body = lines.slice(0, -1);
|
||||
const half = Math.ceil(body.length / 2);
|
||||
const sections = [
|
||||
{ tag: '[Verse]', lines: body.slice(0, half) },
|
||||
{ tag: '[Chorus]', lines: body.slice(half) },
|
||||
{ tag: '[Outro]', lines: outro },
|
||||
].filter(s => s.lines.length > 0);
|
||||
return (
|
||||
<div className="comp2-lyrics-paragraphs">
|
||||
{sections.map((section, i) => (
|
||||
<div key={i} className="comp2-lyrics-para-section">
|
||||
<span className="comp2-lyrics-tag">{section.tag}</span>
|
||||
<p className="comp2-lyrics-text">{section.lines.join('\n')}</p>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
);
|
||||
})()}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/* 하단 버튼 */}
|
||||
<div className="comp2-buttons">
|
||||
<button
|
||||
onClick={handleDownload}
|
||||
disabled={videoStatus !== 'complete' || !videoUrl || isDownloading}
|
||||
className="comp2-btn comp2-btn-secondary"
|
||||
>
|
||||
{isDownloading ? t('completion.downloading') : t('completion.download')}
|
||||
</button>
|
||||
<button
|
||||
onClick={handleOpenSocialConnect}
|
||||
disabled={videoStatus !== 'complete' || !videoDbId}
|
||||
className="comp2-btn comp2-btn-primary"
|
||||
>
|
||||
{t('completion.uploadToSocial')}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* 소셜 미디어 포스팅 모달 (기존 SocialPostingModal 컴포넌트 사용) */}
|
||||
<SocialPostingModal
|
||||
isOpen={showSocialModal}
|
||||
onClose={handleCloseSocialConnect}
|
||||
onGoToCalendar={onGoToCalendar}
|
||||
video={videoUrl && videoDbId ? {
|
||||
video_id: videoDbId,
|
||||
store_name: songCompletionData?.businessName || '',
|
||||
region: '',
|
||||
task_id: songTaskId || '',
|
||||
result_movie_url: videoUrl,
|
||||
created_at: new Date().toISOString(),
|
||||
like_count: 0,
|
||||
comment_count: 0,
|
||||
} : null}
|
||||
/>
|
||||
|
||||
{tutorial.isActive && (
|
||||
<TutorialOverlay
|
||||
hints={tutorial.hints}
|
||||
currentIndex={tutorial.currentHintIndex}
|
||||
onNext={tutorial.nextHint}
|
||||
onPrev={tutorial.prevHint}
|
||||
onSkip={tutorial.skipTutorial}
|
||||
groupProgress={tutorial.groupProgress}
|
||||
/>
|
||||
)}
|
||||
</main>
|
||||
<CompletionView
|
||||
videoState={
|
||||
isLoading
|
||||
? 'loading'
|
||||
: videoStatus === 'error'
|
||||
? 'error'
|
||||
: videoUrl
|
||||
? 'ready'
|
||||
: 'empty'
|
||||
}
|
||||
videoUrl={videoUrl}
|
||||
loadingText={statusMessage}
|
||||
progress={displayProgress}
|
||||
errorMessage={errorMessage}
|
||||
onRetry={handleRetry}
|
||||
fileName={getFileName()}
|
||||
metaLines={[
|
||||
`${t('completion.genre')} : ${songCompletionData?.genre || 'K-POP'}`,
|
||||
`${t('completion.resolution')} : ${getVideoResolution()}`,
|
||||
]}
|
||||
detailLabel={t('completion.lyrics')}
|
||||
detail={renderLyrics()}
|
||||
onDownload={handleDownload}
|
||||
downloadDisabled={videoStatus !== 'complete' || !videoUrl || isDownloading}
|
||||
downloadLabel={isDownloading ? t('completion.downloading') : t('completion.download')}
|
||||
onUpload={handleOpenSocialConnect}
|
||||
uploadDisabled={videoStatus !== 'complete' || !videoDbId}
|
||||
>
|
||||
{/* 소셜 미디어 포스팅 모달 (기존 SocialPostingModal 컴포넌트 사용) */}
|
||||
<SocialPostingModal
|
||||
isOpen={showSocialModal}
|
||||
onClose={handleCloseSocialConnect}
|
||||
onGoToCalendar={onGoToCalendar}
|
||||
video={
|
||||
videoUrl && videoDbId
|
||||
? {
|
||||
// ADO2 파이프라인 완료 화면이므로 항상 영상이다
|
||||
type: 'video',
|
||||
video_id: videoDbId,
|
||||
store_name: songCompletionData?.businessName || '',
|
||||
region: '',
|
||||
task_id: songTaskId || '',
|
||||
result_movie_url: videoUrl,
|
||||
created_at: new Date().toISOString(),
|
||||
like_count: 0,
|
||||
comment_count: 0,
|
||||
is_liked_by_me: false,
|
||||
}
|
||||
: null
|
||||
}
|
||||
/>
|
||||
</CompletionView>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -67,16 +67,17 @@ const statusLabelKey = (status: UploadStatus) => {
|
||||
|
||||
interface ContentCalendarContentProps {
|
||||
onNavigate?: (id: string) => void;
|
||||
/** 내 정보 탭 안에 임베드될 때: 탭 라벨과 중복되는 자체 제목을 숨기고 여백을 줄인다 */
|
||||
embedded?: boolean;
|
||||
}
|
||||
|
||||
const ContentCalendarContent: React.FC<ContentCalendarContentProps> = ({ onNavigate }) => {
|
||||
const ContentCalendarContent: React.FC<ContentCalendarContentProps> = ({ onNavigate, embedded }) => {
|
||||
const { t } = useTranslation();
|
||||
const today = new Date();
|
||||
const [year, setYear] = useState(today.getFullYear());
|
||||
const [month, setMonth] = useState(today.getMonth());
|
||||
const [activeTab, setActiveTab] = useState<TabType>('전체');
|
||||
const [isMobile, setIsMobile] = useState(window.innerWidth < MOBILE_BREAKPOINT);
|
||||
const [sheetOpen, setSheetOpen] = useState(false);
|
||||
// allItems: 캘린더 도트용 (전체)
|
||||
// panelItems: 오른쪽 패널용 (탭 필터)
|
||||
const [allItems, setAllItems] = useState<UploadHistoryItem[]>([]);
|
||||
@@ -194,11 +195,16 @@ const ContentCalendarContent: React.FC<ContentCalendarContentProps> = ({ onNavig
|
||||
setTimeout(() => {
|
||||
const el = dateRefs.current[dateKey];
|
||||
const panel = panelRef.current;
|
||||
if (el && panel) {
|
||||
if (!el) return;
|
||||
// 패널이 자체 스크롤을 가진 경우(데스크톱 사이드 패널)만 내부 스크롤.
|
||||
// 모바일은 목록이 캘린더 아래에 그대로 펼쳐지므로 페이지 스크롤로 이동한다.
|
||||
if (panel && panel.scrollHeight > panel.clientHeight) {
|
||||
const panelTop = panel.getBoundingClientRect().top;
|
||||
const elTop = el.getBoundingClientRect().top;
|
||||
const offset = elTop - panelTop + panel.scrollTop - 12; // 12px 여백
|
||||
panel.scrollTo({ top: offset, behavior: 'smooth' });
|
||||
} else {
|
||||
el.scrollIntoView({ behavior: 'smooth', block: 'center' });
|
||||
}
|
||||
}, 50);
|
||||
};
|
||||
@@ -396,7 +402,7 @@ const ContentCalendarContent: React.FC<ContentCalendarContentProps> = ({ onNavig
|
||||
{summary.completed > 0 && (
|
||||
<div style={{ display: 'flex', alignItems: 'center', gap: 4 }}>
|
||||
<div style={{ width: 8, height: 8, borderRadius: '50%', backgroundColor: '#1ba64f', flexShrink: 0 }} />
|
||||
<span style={{ fontFamily: 'Pretendard, sans-serif', fontWeight: 500, fontSize: 11, color: '#01191a', lineHeight: 1, whiteSpace: 'nowrap' }}>
|
||||
<span style={{ fontFamily: 'Pretendard, sans-serif', fontWeight: 500, fontSize: 12, color: '#01191a', lineHeight: 1, whiteSpace: 'nowrap' }}>
|
||||
{t('contentCalendar.completedCount', { count: summary.completed })}
|
||||
</span>
|
||||
</div>
|
||||
@@ -404,7 +410,7 @@ const ContentCalendarContent: React.FC<ContentCalendarContentProps> = ({ onNavig
|
||||
{summary.scheduled > 0 && (
|
||||
<div style={{ display: 'flex', alignItems: 'center', gap: 4 }}>
|
||||
<div style={{ width: 8, height: 8, borderRadius: '50%', backgroundColor: '#2563eb', flexShrink: 0 }} />
|
||||
<span style={{ fontFamily: 'Pretendard, sans-serif', fontWeight: 500, fontSize: 11, color: '#01191a', lineHeight: 1, whiteSpace: 'nowrap' }}>
|
||||
<span style={{ fontFamily: 'Pretendard, sans-serif', fontWeight: 500, fontSize: 12, color: '#01191a', lineHeight: 1, whiteSpace: 'nowrap' }}>
|
||||
{t('contentCalendar.scheduledCount', { count: summary.scheduled })}
|
||||
</span>
|
||||
</div>
|
||||
@@ -412,7 +418,7 @@ const ContentCalendarContent: React.FC<ContentCalendarContentProps> = ({ onNavig
|
||||
{summary.failed > 0 && (
|
||||
<div style={{ display: 'flex', alignItems: 'center', gap: 4 }}>
|
||||
<div style={{ width: 8, height: 8, borderRadius: '50%', backgroundColor: '#e15252', flexShrink: 0 }} />
|
||||
<span style={{ fontFamily: 'Pretendard, sans-serif', fontWeight: 500, fontSize: 11, color: '#01191a', lineHeight: 1, whiteSpace: 'nowrap' }}>
|
||||
<span style={{ fontFamily: 'Pretendard, sans-serif', fontWeight: 500, fontSize: 12, color: '#01191a', lineHeight: 1, whiteSpace: 'nowrap' }}>
|
||||
{t('contentCalendar.failedCount', { count: summary.failed })}
|
||||
</span>
|
||||
</div>
|
||||
@@ -428,7 +434,7 @@ const ContentCalendarContent: React.FC<ContentCalendarContentProps> = ({ onNavig
|
||||
|
||||
// ── 탭 바 ────────────────────────────────────────────────────
|
||||
const renderTabs = () => (
|
||||
<div style={{ display: 'flex', gap: 8, alignItems: 'center' }}>
|
||||
<div style={{ display: 'flex', gap: 8, alignItems: 'center', justifyContent: 'center', width: '100%' }}>
|
||||
{tabs.map(tab => (
|
||||
<button
|
||||
key={tab}
|
||||
@@ -535,13 +541,13 @@ const ContentCalendarContent: React.FC<ContentCalendarContentProps> = ({ onNavig
|
||||
backgroundColor: statusColor(item.status as UploadStatus), flexShrink: 0,
|
||||
}} />
|
||||
<span style={{
|
||||
fontFamily: 'Pretendard, sans-serif', fontWeight: 500, fontSize: 13,
|
||||
fontFamily: 'Pretendard, sans-serif', fontWeight: 500, fontSize: 14,
|
||||
color: statusColor(item.status as UploadStatus), lineHeight: 1,
|
||||
}}>
|
||||
{t(statusLabelKey(item.status as UploadStatus))}
|
||||
</span>
|
||||
<span style={{
|
||||
fontFamily: 'Pretendard, sans-serif', fontWeight: 400, fontSize: 13,
|
||||
fontFamily: 'Pretendard, sans-serif', fontWeight: 400, fontSize: 14,
|
||||
color: '#9bcacc', lineHeight: 1, marginLeft: 'auto',
|
||||
}}>
|
||||
{formatTime(item)}
|
||||
@@ -589,7 +595,7 @@ const ContentCalendarContent: React.FC<ContentCalendarContentProps> = ({ onNavig
|
||||
style={{
|
||||
height: 30, padding: '0 12px', borderRadius: 8,
|
||||
border: '1px solid #379599', backgroundColor: 'transparent',
|
||||
fontFamily: 'Pretendard, sans-serif', fontWeight: 500, fontSize: 13,
|
||||
fontFamily: 'Pretendard, sans-serif', fontWeight: 500, fontSize: 14,
|
||||
color: '#9bcacc', cursor: 'pointer',
|
||||
}}
|
||||
>
|
||||
@@ -602,7 +608,7 @@ const ContentCalendarContent: React.FC<ContentCalendarContentProps> = ({ onNavig
|
||||
style={{
|
||||
height: 30, padding: '0 12px', borderRadius: 8,
|
||||
border: 'none', backgroundColor: '#a65eff',
|
||||
fontFamily: 'Pretendard, sans-serif', fontWeight: 500, fontSize: 13,
|
||||
fontFamily: 'Pretendard, sans-serif', fontWeight: 500, fontSize: 14,
|
||||
color: '#ffffff', cursor: 'pointer',
|
||||
}}
|
||||
>
|
||||
@@ -616,10 +622,11 @@ const ContentCalendarContent: React.FC<ContentCalendarContentProps> = ({ onNavig
|
||||
};
|
||||
|
||||
// ── 패널 콘텐츠 ────────────────────────────────────────────
|
||||
const renderPanelContent = () => {
|
||||
// inline=true (모바일): 자체 스크롤 없이 페이지 흐름에 그대로 펼친다
|
||||
const renderPanelContent = (inline = false) => {
|
||||
if (panelLoading) {
|
||||
return (
|
||||
<div style={{ flex: 1, display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
|
||||
<div style={{ flex: 1, display: 'flex', alignItems: 'center', justifyContent: 'center', minHeight: inline ? 120 : undefined }}>
|
||||
<span style={{ color: '#9bcacc', fontFamily: 'Pretendard, sans-serif', fontSize: 14 }}>{t('contentCalendar.loading')}</span>
|
||||
</div>
|
||||
);
|
||||
@@ -629,6 +636,7 @@ const ContentCalendarContent: React.FC<ContentCalendarContentProps> = ({ onNavig
|
||||
<div style={{
|
||||
flex: 1, display: 'flex', flexDirection: 'column',
|
||||
alignItems: 'center', justifyContent: 'center', gap: 24, padding: 16,
|
||||
minHeight: inline ? 160 : undefined,
|
||||
}}>
|
||||
<div style={{ display: 'flex', flexDirection: 'column', gap: 8, alignItems: 'center', textAlign: 'center' }}>
|
||||
<p style={{
|
||||
@@ -645,7 +653,7 @@ const ContentCalendarContent: React.FC<ContentCalendarContentProps> = ({ onNavig
|
||||
</p>
|
||||
</div>
|
||||
<button
|
||||
onClick={() => onNavigate?.('ADO2 콘텐츠')}
|
||||
onClick={() => onNavigate?.('내 콘텐츠')}
|
||||
style={{
|
||||
height: 34, padding: '0 10px', borderRadius: 8, border: 'none',
|
||||
backgroundColor: '#a65eff', cursor: 'pointer',
|
||||
@@ -653,7 +661,7 @@ const ContentCalendarContent: React.FC<ContentCalendarContentProps> = ({ onNavig
|
||||
color: '#ffffff',
|
||||
}}
|
||||
>
|
||||
{t('contentCalendar.ado2Contents')}
|
||||
{t('contentCalendar.myContents')}
|
||||
</button>
|
||||
</div>
|
||||
);
|
||||
@@ -662,7 +670,11 @@ const ContentCalendarContent: React.FC<ContentCalendarContentProps> = ({ onNavig
|
||||
<div
|
||||
ref={panelRef}
|
||||
className="calendar-panel-scroll"
|
||||
style={{ flex: 1, overflowY: 'auto', padding: '12px 16px', display: 'flex', flexDirection: 'column', gap: 20, maxHeight: 700 }}
|
||||
style={{
|
||||
flex: 1, padding: '12px 16px', display: 'flex', flexDirection: 'column', gap: 20,
|
||||
overflowY: inline ? 'visible' : 'auto',
|
||||
maxHeight: inline ? undefined : 700,
|
||||
}}
|
||||
>
|
||||
{sortedDateKeys.map(dateKey => (
|
||||
<div
|
||||
@@ -691,17 +703,19 @@ const ContentCalendarContent: React.FC<ContentCalendarContentProps> = ({ onNavig
|
||||
return (
|
||||
<div style={{
|
||||
display: 'flex', flexDirection: 'column', alignItems: 'center',
|
||||
paddingTop: 24, paddingBottom: 20, width: '100%',
|
||||
paddingTop: embedded ? 0 : 24, paddingBottom: 20, width: '100%',
|
||||
boxSizing: 'border-box', position: 'relative',
|
||||
}}>
|
||||
<div style={{ width: '100%', paddingBottom: 24, paddingLeft: 20, paddingRight: 20, boxSizing: 'border-box' }}>
|
||||
<p style={{
|
||||
fontFamily: 'Pretendard, sans-serif', fontWeight: 700, fontSize: 30,
|
||||
color: '#ffffff', letterSpacing: '-0.18px', lineHeight: 1.3, margin: 0,
|
||||
}}>
|
||||
{t('contentCalendar.title')}
|
||||
</p>
|
||||
</div>
|
||||
{!embedded && (
|
||||
<div style={{ width: '100%', paddingBottom: 24, paddingLeft: 20, paddingRight: 20, boxSizing: 'border-box' }}>
|
||||
<p style={{
|
||||
fontFamily: 'Pretendard, sans-serif', fontWeight: 700, fontSize: 30,
|
||||
color: '#ffffff', letterSpacing: '-0.18px', lineHeight: 1.3, margin: 0,
|
||||
}}>
|
||||
{t('contentCalendar.title')}
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div style={{
|
||||
display: 'flex', flexDirection: 'column', gap: 16,
|
||||
@@ -716,34 +730,24 @@ const ContentCalendarContent: React.FC<ContentCalendarContentProps> = ({ onNavig
|
||||
{renderCalendarGrid()}
|
||||
</div>
|
||||
|
||||
{/* 바텀시트 */}
|
||||
<div style={{ position: 'fixed', bottom: 0, left: 0, right: 0, zIndex: 100, display: 'flex', flexDirection: 'column' }}>
|
||||
{/* 업로드 목록 — 캘린더 바로 아래에 펼쳐 둔다(바텀시트로 감추지 않음).
|
||||
좌우 여백 없음: 위 캘린더 그리드와 가로 폭을 맞춘다 */}
|
||||
<div style={{ width: '100%', marginTop: 16, boxSizing: 'border-box' }}>
|
||||
<div style={{
|
||||
backgroundColor: '#01393b',
|
||||
borderTop: '1px solid #046266',
|
||||
borderRadius: '20px 20px 0 0',
|
||||
border: '1px solid #046266',
|
||||
borderRadius: 20,
|
||||
overflow: 'hidden',
|
||||
}}>
|
||||
<div
|
||||
onClick={() => setSheetOpen(o => !o)}
|
||||
style={{ display: 'flex', justifyContent: 'center', padding: '8px 0', cursor: 'pointer' }}
|
||||
>
|
||||
<div style={{ width: 49, height: 4, backgroundColor: '#9bcacc', borderRadius: 999 }} />
|
||||
</div>
|
||||
<div style={{
|
||||
borderBottom: sheetOpen ? '1px solid #046266' : 'none',
|
||||
borderBottom: '1px solid #046266',
|
||||
height: 50, display: 'flex', alignItems: 'center', padding: '0 16px',
|
||||
}}>
|
||||
{renderTabs()}
|
||||
</div>
|
||||
{sheetOpen && (
|
||||
<div style={{ height: 400, overflowY: 'auto', backgroundColor: '#01393b', display: 'flex', flexDirection: 'column' }}>
|
||||
{renderPanelContent()}
|
||||
</div>
|
||||
)}
|
||||
{renderPanelContent(true)}
|
||||
</div>
|
||||
</div>
|
||||
<div style={{ height: sheetOpen ? 516 : 116 }} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -754,26 +758,28 @@ const ContentCalendarContent: React.FC<ContentCalendarContentProps> = ({ onNavig
|
||||
return (
|
||||
<div style={{
|
||||
display: 'flex', flexDirection: 'column', alignItems: 'center',
|
||||
padding: '32px',
|
||||
padding: embedded ? '0' : '32px',
|
||||
width: '100%',
|
||||
minWidth: 1400,
|
||||
height: '100%', boxSizing: 'border-box',
|
||||
height: embedded ? 'auto' : '100%', boxSizing: 'border-box',
|
||||
}}>
|
||||
<div style={{ width: '100%', maxWidth: 1440, paddingBottom: 32, flexShrink: 0 }}>
|
||||
<p style={{
|
||||
fontFamily: 'Pretendard, sans-serif', fontWeight: 700, fontSize: 30,
|
||||
color: '#ffffff', letterSpacing: '-0.18px', lineHeight: 1.3, margin: 0,
|
||||
}}>
|
||||
{t('contentCalendar.title')}
|
||||
</p>
|
||||
</div>
|
||||
{!embedded && (
|
||||
<div style={{ width: '100%', maxWidth: 1440, paddingBottom: 32, flexShrink: 0 }}>
|
||||
<p style={{
|
||||
fontFamily: 'Pretendard, sans-serif', fontWeight: 700, fontSize: 30,
|
||||
color: '#ffffff', letterSpacing: '-0.18px', lineHeight: 1.3, margin: 0,
|
||||
}}>
|
||||
{t('contentCalendar.title')}
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div style={{
|
||||
display: 'grid',
|
||||
gridTemplateColumns: 'minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) 340px',
|
||||
gap: 16,
|
||||
width: '100%', maxWidth: 1440,
|
||||
flex: 1, minHeight: 0,
|
||||
flex: 1, minHeight: embedded ? 'calc(100vh - 220px)' : 0,
|
||||
}}>
|
||||
{/* 캘린더 영역 */}
|
||||
<div className="calendar-grid-area" style={{
|
||||
|
||||
@@ -740,7 +740,7 @@ const DashboardContent: React.FC<DashboardContentProps> = ({ onNavigate }) => {
|
||||
borderRadius: '8px',
|
||||
color: 'rgba(255,255,255,0.85)',
|
||||
padding: '5px 10px',
|
||||
fontSize: '13px',
|
||||
fontSize: '14px',
|
||||
cursor: 'pointer',
|
||||
minWidth: '160px',
|
||||
}}
|
||||
@@ -788,7 +788,7 @@ const DashboardContent: React.FC<DashboardContentProps> = ({ onNavigate }) => {
|
||||
display: 'flex', alignItems: 'center', gap: '8px',
|
||||
padding: '8px 12px',
|
||||
cursor: 'pointer',
|
||||
fontSize: '13px',
|
||||
fontSize: '14px',
|
||||
background: acc.id === selectedAccountId ? 'rgba(255,255,255,0.08)' : 'transparent',
|
||||
color: 'rgba(255,255,255,0.85)',
|
||||
}}
|
||||
@@ -940,8 +940,8 @@ const DashboardContent: React.FC<DashboardContentProps> = ({ onNavigate }) => {
|
||||
onClick={() => setShowMockData(prev => !prev)}
|
||||
style={{
|
||||
position: 'fixed',
|
||||
bottom: '24px',
|
||||
right: '24px',
|
||||
top: '10px',
|
||||
right: '5px',
|
||||
zIndex: 9999,
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,12 +1,15 @@
|
||||
|
||||
import React, { useState, useEffect, useRef, useCallback } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { getVideosList, deleteVideo } from '../../utils/api';
|
||||
import { VideoListItem } from '../../types/api';
|
||||
import { getVideosList, deleteVideo, deleteSsulContent } from '../../utils/api';
|
||||
import { deleteP2vContent, isP2vContent } from '../../utils/p2vApi';
|
||||
import { SocialUploadableItem, VideoListItem } from '../../types/api';
|
||||
import SocialPostingModal from '../../components/SocialPostingModal';
|
||||
import VideoDetailModal from '../../components/VideoDetailModal';
|
||||
import { useTutorial } from '../../components/Tutorial/useTutorial';
|
||||
import { TUTORIAL_KEYS } from '../../components/Tutorial/tutorialSteps';
|
||||
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 }) => {
|
||||
const videoRef = useRef<HTMLVideoElement>(null);
|
||||
@@ -88,11 +91,12 @@ const VideoPreviewCard: React.FC<{ src: string; className?: string }> = ({ src,
|
||||
interface MyContentsPageProps {
|
||||
onBack?: () => void;
|
||||
onNavigate?: (item: string) => void;
|
||||
/** 내 정보 탭 안에 임베드될 때: 탭 라벨과 중복되는 자체 제목을 숨긴다 */
|
||||
embedded?: boolean;
|
||||
}
|
||||
|
||||
const MyContentsPage: React.FC<MyContentsPageProps> = ({ onNavigate }) => {
|
||||
const MyContentsPage: React.FC<MyContentsPageProps> = ({ onNavigate, embedded }) => {
|
||||
const { t } = useTranslation();
|
||||
const tutorial = useTutorial();
|
||||
const [videos, setVideos] = useState<VideoListItem[]>([]);
|
||||
const [total, setTotal] = useState(0);
|
||||
const [loading, setLoading] = useState(true);
|
||||
@@ -102,11 +106,15 @@ const MyContentsPage: React.FC<MyContentsPageProps> = ({ onNavigate }) => {
|
||||
const [hasPrev, setHasPrev] = useState(false);
|
||||
const [totalPages, setTotalPages] = useState(1);
|
||||
const [deleteModalOpen, setDeleteModalOpen] = useState(false);
|
||||
const [deleteTargetId, setDeleteTargetId] = useState<number | null>(null);
|
||||
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;
|
||||
|
||||
@@ -114,12 +122,6 @@ const MyContentsPage: React.FC<MyContentsPageProps> = ({ onNavigate }) => {
|
||||
fetchVideos();
|
||||
}, [page]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!tutorial.hasSeen(TUTORIAL_KEYS.ADO2_CONTENTS)) {
|
||||
tutorial.startTutorial(TUTORIAL_KEYS.ADO2_CONTENTS);
|
||||
}
|
||||
}, []);
|
||||
|
||||
const fetchVideos = async () => {
|
||||
setLoading(true);
|
||||
setError(null);
|
||||
@@ -144,9 +146,7 @@ const MyContentsPage: React.FC<MyContentsPageProps> = ({ onNavigate }) => {
|
||||
const year = date.getFullYear();
|
||||
const month = String(date.getMonth() + 1).padStart(2, '0');
|
||||
const day = String(date.getDate()).padStart(2, '0');
|
||||
const hours = String(date.getHours()).padStart(2, '0');
|
||||
const minutes = String(date.getMinutes()).padStart(2, '0');
|
||||
return `${year}.${month}.${day}・${hours}:${minutes}`;
|
||||
return `${year}.${month}.${day}`;
|
||||
};
|
||||
|
||||
const formatTitle = (storeName: string, dateString: string) => {
|
||||
@@ -176,13 +176,17 @@ const MyContentsPage: React.FC<MyContentsPageProps> = ({ onNavigate }) => {
|
||||
}
|
||||
};
|
||||
|
||||
const handleDeleteClick = (videoId: number) => {
|
||||
setDeleteTargetId(videoId);
|
||||
// 아이템 전체를 저장한다 — id 만 들면 종류를 잃어 어느 삭제 API 를 부를지 알 수 없다
|
||||
// (video.id 와 ssul_content.id 는 값이 겹치는 독립 시퀀스).
|
||||
const handleDeleteClick = (video: VideoListItem) => {
|
||||
setDeleteTarget(video);
|
||||
setDeleteModalOpen(true);
|
||||
};
|
||||
|
||||
const handleUploadClick = (video: VideoListItem) => {
|
||||
setUploadTargetVideo(video);
|
||||
// 롱컷(p2v_playreel)은 소셜 업로드를 지원하지 않는다(버튼도 막는다). 무빙 포스터는 지원한다.
|
||||
if (video.type === 'p2v_playreel') return;
|
||||
setUploadTargetVideo({ ...video, type: video.type });
|
||||
setUploadModalOpen(true);
|
||||
};
|
||||
|
||||
@@ -193,18 +197,32 @@ const MyContentsPage: React.FC<MyContentsPageProps> = ({ onNavigate }) => {
|
||||
|
||||
const handleDeleteCancel = () => {
|
||||
setDeleteModalOpen(false);
|
||||
setDeleteTargetId(null);
|
||||
setDeleteTarget(null);
|
||||
};
|
||||
const deleteModalOverlayHandlers = useOverlayClose(handleDeleteCancel);
|
||||
|
||||
const handleDeleteConfirm = async () => {
|
||||
if (!deleteTargetId) return;
|
||||
if (!deleteTarget) return;
|
||||
setIsDeleting(true);
|
||||
try {
|
||||
await deleteVideo(deleteTargetId);
|
||||
setVideos(prev => prev.filter(video => video.video_id !== deleteTargetId));
|
||||
// 종류별 삭제 API 가 다르다. deleteVideo 는 Video.id 로 지우므로
|
||||
// 썰박스 id 를 넘기면 id 가 겹치는 엉뚱한 ADO2 영상이 삭제된다.
|
||||
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);
|
||||
}
|
||||
setVideos(prev =>
|
||||
prev.filter(
|
||||
video =>
|
||||
!(video.type === deleteTarget.type && video.video_id === deleteTarget.video_id)
|
||||
)
|
||||
);
|
||||
setTotal(prev => Math.max(0, prev - 1));
|
||||
setDeleteModalOpen(false);
|
||||
setDeleteTargetId(null);
|
||||
setDeleteTarget(null);
|
||||
} catch (err) {
|
||||
console.error('Delete failed:', err);
|
||||
alert(t('ado2Contents.deleteFailed'));
|
||||
@@ -214,10 +232,10 @@ const MyContentsPage: React.FC<MyContentsPageProps> = ({ onNavigate }) => {
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="ado2-contents-page">
|
||||
<div className={`ado2-contents-page ${embedded ? 'ado2-contents-page--embedded' : ''}`}>
|
||||
{/* Header */}
|
||||
<div className="ado2-contents-header">
|
||||
<h1 className="ado2-contents-title">{t('sidebar.myContents')}</h1>
|
||||
{!embedded && <h1 className="ado2-contents-title">{t('sidebar.myContents')}</h1>}
|
||||
<span className="ado2-contents-count">{t('ado2Contents.totalCount', { count: total })}</span>
|
||||
</div>
|
||||
|
||||
@@ -240,14 +258,30 @@ const MyContentsPage: React.FC<MyContentsPageProps> = ({ onNavigate }) => {
|
||||
<>
|
||||
<div className="ado2-contents-grid">
|
||||
{videos.map((video) => (
|
||||
<div key={video.task_id} className="ado2-content-card">
|
||||
// key 는 (type, video_id) 쌍이어야 한다 — task_id 는 썰박스에 없고(빈 문자열)
|
||||
// video_id 는 종류별 독립 시퀀스라 값이 겹친다.
|
||||
<div key={`${video.type}-${video.video_id}`} className="ado2-content-card">
|
||||
{/* Video Thumbnail */}
|
||||
<div
|
||||
className="content-card-thumbnail"
|
||||
style={{ cursor: 'pointer' }}
|
||||
onClick={() => setSelectedVideoId(video.video_id)}
|
||||
onClick={() =>
|
||||
isP2vContent(video.type)
|
||||
? setSelectedP2v(video)
|
||||
: video.type === 'ssul'
|
||||
? setSelectedSsul(video)
|
||||
: setSelectedVideoId(video.video_id)
|
||||
}
|
||||
>
|
||||
{video.result_movie_url ? (
|
||||
{video.poster_url ? (
|
||||
<img
|
||||
src={video.poster_url}
|
||||
alt={video.store_name}
|
||||
loading="lazy"
|
||||
decoding="async"
|
||||
className="content-video-preview"
|
||||
/>
|
||||
) : video.result_movie_url ? (
|
||||
<VideoPreviewCard
|
||||
src={video.result_movie_url}
|
||||
className="content-video-preview"
|
||||
@@ -274,29 +308,33 @@ const MyContentsPage: React.FC<MyContentsPageProps> = ({ onNavigate }) => {
|
||||
<h3 className="content-card-title">
|
||||
{formatTitle(video.store_name, video.created_at)}
|
||||
</h3>
|
||||
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
|
||||
<div className="content-card-meta">
|
||||
<p className="content-card-date">
|
||||
{formatDate(video.created_at)}
|
||||
</p>
|
||||
<span className="content-card-like">
|
||||
<svg width="15" height="15" viewBox="0 0 24 24" fill="currentColor" 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>
|
||||
{video.like_count ?? 0}
|
||||
<svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" style={{ marginLeft: '6px' }}>
|
||||
<path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/>
|
||||
</svg>
|
||||
{video.comment_count ?? 0}
|
||||
</span>
|
||||
{/* 모든 콘텐츠는 ID 와 종류를 함께 보내 소셜 반응을 구분한다. */}
|
||||
<ContentCardSocialActions
|
||||
videoId={video.video_id}
|
||||
contentType={video.type}
|
||||
storeName={video.store_name}
|
||||
region={video.region}
|
||||
title={video.title}
|
||||
description={video.description}
|
||||
commentCount={video.comment_count ?? 0}
|
||||
initialLikeCount={video.like_count ?? 0}
|
||||
initialIsLiked={video.is_liked_by_me}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Action Buttons */}
|
||||
<div className="content-card-actions">
|
||||
{/* SocialPostingModal 이 content_type 을 함께 보내므로
|
||||
썰박스 항목도 같은 모달로 업로드한다 (social_upload 병합). */}
|
||||
<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"/>
|
||||
@@ -315,9 +353,11 @@ const MyContentsPage: React.FC<MyContentsPageProps> = ({ onNavigate }) => {
|
||||
<path d="M3 15v2h14v-2"/>
|
||||
</svg>
|
||||
</button>
|
||||
{/* 삭제는 종류별 API 로 분기한다(handleDeleteConfirm).
|
||||
아이템 전체를 넘겨야 종류를 잃지 않는다. */}
|
||||
<button
|
||||
className="content-delete-btn"
|
||||
onClick={() => handleDeleteClick(video.video_id)}
|
||||
onClick={() => handleDeleteClick(video)}
|
||||
>
|
||||
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" stroke="currentColor" strokeWidth="1.5">
|
||||
<path d="M3 5h14M8 5V3h4v2M6 5v12h8V5"/>
|
||||
@@ -354,7 +394,7 @@ const MyContentsPage: React.FC<MyContentsPageProps> = ({ onNavigate }) => {
|
||||
|
||||
{/* 삭제 확인 모달 */}
|
||||
{deleteModalOpen && (
|
||||
<div className="delete-modal-overlay" onClick={handleDeleteCancel}>
|
||||
<div className="delete-modal-overlay" {...deleteModalOverlayHandlers}>
|
||||
<div className="delete-modal" onClick={(e: React.MouseEvent) => e.stopPropagation()}>
|
||||
<h2 className="delete-modal-title">{t('ado2Contents.deleteConfirmTitle')}</h2>
|
||||
<p className="delete-modal-description">{t('ado2Contents.deleteConfirmDesc')}</p>
|
||||
@@ -385,6 +425,9 @@ const MyContentsPage: React.FC<MyContentsPageProps> = ({ onNavigate }) => {
|
||||
/>
|
||||
)}
|
||||
|
||||
<SsulViewerModal item={selectedSsul} onClose={() => setSelectedSsul(null)} />
|
||||
<P2vViewerModal item={selectedP2v} onClose={() => setSelectedP2v(null)} />
|
||||
|
||||
{/* 소셜 미디어 업로드 모달 */}
|
||||
<SocialPostingModal
|
||||
isOpen={uploadModalOpen}
|
||||
|
||||
@@ -3,16 +3,21 @@ import React, { useState, useEffect } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { getSocialAccounts, getYouTubeConnectUrl, disconnectSocialAccount, TokenExpiredError, handleSocialReconnect, getUserCredits, requestCreditCharge } from '../../utils/api';
|
||||
import { SocialAccount } from '../../types/api';
|
||||
import { MyInfoTab } from '../../components/navItems';
|
||||
import MyContentsPage from './MyContentsPage';
|
||||
import ContentCalendarContent from './ContentCalendarContent';
|
||||
import { useOverlayClose } from '../../hooks/useOverlayClose';
|
||||
|
||||
type TabType = 'basic' | 'payment' | 'business';
|
||||
type TabType = MyInfoTab;
|
||||
|
||||
interface MyInfoContentProps {
|
||||
initialTab?: TabType;
|
||||
onNavigate?: (id: string) => void;
|
||||
}
|
||||
|
||||
const MyInfoContent: React.FC<MyInfoContentProps> = ({ initialTab }) => {
|
||||
const MyInfoContent: React.FC<MyInfoContentProps> = ({ initialTab, onNavigate }) => {
|
||||
const { t } = useTranslation();
|
||||
const [activeTab, setActiveTab] = useState<TabType>(initialTab || 'business');
|
||||
const [activeTab, setActiveTab] = useState<TabType>(initialTab || 'contents');
|
||||
const [businessUrl, setBusinessUrl] = useState('');
|
||||
const [socialAccounts, setSocialAccounts] = useState<SocialAccount[]>([]);
|
||||
const [isLoadingAccounts, setIsLoadingAccounts] = useState(false);
|
||||
@@ -113,20 +118,33 @@ const MyInfoContent: React.FC<MyInfoContentProps> = ({ initialTab }) => {
|
||||
const hasConnectedAccounts = youtubeAccounts.length > 0 || instagramAccounts.length > 0;
|
||||
|
||||
const tabs = [
|
||||
// { id: 'basic' as TabType, label: t('myInfo.tabBasic') },
|
||||
{ id: 'contents' as TabType, label: t('myInfo.tabContents') },
|
||||
{ id: 'calendar' as TabType, label: t('myInfo.tabCalendar') },
|
||||
{ id: 'payment' as TabType, label: t('myInfo.tabPayment') },
|
||||
{ id: 'business' as TabType, label: t('myInfo.tabBusiness') },
|
||||
];
|
||||
|
||||
const isWideTab = activeTab === 'contents' || activeTab === 'calendar';
|
||||
|
||||
const handleChildNavigate = (id: string) => {
|
||||
if (id === '내 정보') { setActiveTab('business'); return; }
|
||||
if (id === '콘텐츠 캘린더') { setActiveTab('calendar'); return; }
|
||||
if (id === '내 콘텐츠') { setActiveTab('contents'); return; }
|
||||
onNavigate?.(id);
|
||||
};
|
||||
|
||||
const closeChargePopup = () => { setShowChargePopup(false); setChargeSuccess(false); setChargeAmount(''); setChargeNote(''); };
|
||||
const chargePopupOverlayHandlers = useOverlayClose(closeChargePopup);
|
||||
|
||||
return (
|
||||
<>
|
||||
{showChargePopup && (
|
||||
<div className="myinfo-popup-overlay" onClick={() => { setShowChargePopup(false); setChargeSuccess(false); setChargeAmount(''); setChargeNote(''); }}>
|
||||
<div className="myinfo-popup-overlay" {...chargePopupOverlayHandlers}>
|
||||
<div className="myinfo-popup" onClick={e => e.stopPropagation()}>
|
||||
{chargeSuccess ? (
|
||||
<>
|
||||
<p className="myinfo-popup-message">{t('myInfo.chargeSuccess')}</p>
|
||||
<button className="myinfo-popup-close" onClick={() => { setShowChargePopup(false); setChargeSuccess(false); setChargeAmount(''); setChargeNote(''); }}>{t('myInfo.chargeConfirm')}</button>
|
||||
<button className="myinfo-popup-close" onClick={closeChargePopup}>{t('myInfo.chargeConfirm')}</button>
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
@@ -187,7 +205,7 @@ const MyInfoContent: React.FC<MyInfoContentProps> = ({ initialTab }) => {
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
<main className="myinfo-page">
|
||||
<main className={`myinfo-page ${isWideTab ? 'myinfo-page--wide' : ''}`}>
|
||||
<h1 className="myinfo-title">{t('myInfo.title')}</h1>
|
||||
|
||||
{/* 탭 네비게이션 */}
|
||||
@@ -205,11 +223,13 @@ const MyInfoContent: React.FC<MyInfoContentProps> = ({ initialTab }) => {
|
||||
|
||||
{/* 탭 컨텐츠 */}
|
||||
<div className="myinfo-content">
|
||||
{/* {activeTab === 'basic' && (
|
||||
<div className="myinfo-section">
|
||||
<p className="myinfo-placeholder">{t('myInfo.basicPlaceholder')}</p>
|
||||
</div>
|
||||
)} */}
|
||||
{activeTab === 'contents' && (
|
||||
<MyContentsPage onNavigate={handleChildNavigate} embedded />
|
||||
)}
|
||||
|
||||
{activeTab === 'calendar' && (
|
||||
<ContentCalendarContent onNavigate={handleChildNavigate} embedded />
|
||||
)}
|
||||
|
||||
{activeTab === 'payment' && (
|
||||
<div className="myinfo-section">
|
||||
@@ -278,13 +298,13 @@ const MyInfoContent: React.FC<MyInfoContentProps> = ({ initialTab }) => {
|
||||
<span>{isConnecting === 'youtube' ? t('myInfo.youtubeConnecting') : t('myInfo.youtubeConnect')}</span>
|
||||
</button>
|
||||
|
||||
<button
|
||||
{/* <button
|
||||
disabled
|
||||
className="myinfo-social-btn disabled"
|
||||
>
|
||||
<img src="/assets/images/social-instagram.png" alt="Instagram" className="myinfo-social-btn-icon" />
|
||||
<span>{t('myInfo.instagramConnect')}</span>
|
||||
</button>
|
||||
</button> */}
|
||||
</div>
|
||||
|
||||
{/* 연결된 계정 목록 */}
|
||||
|
||||
@@ -1,478 +0,0 @@
|
||||
import React, { useRef, useState } from 'react';
|
||||
import { uploadImages, generateShortform, waitForShortformComplete, previewShortform } from '../../utils/api';
|
||||
import { ShortformStatusResponse, VideoSpec } from '../../types/api';
|
||||
|
||||
type Kind = 'place' | 'product' | 'message';
|
||||
type Step = 1 | 2 | 3 | 4;
|
||||
|
||||
interface ShortformContentProps {
|
||||
onComplete?: () => void;
|
||||
}
|
||||
|
||||
const KIND_OPTIONS: { value: Kind; label: string; desc: string }[] = [
|
||||
{ value: 'place', label: '장소', desc: '펜션·카페·식당·매장 등 공간' },
|
||||
{ value: 'product', label: '물건', desc: '제품, 음식 등 시각적인 아이템' },
|
||||
{ value: 'message', label: '메시지', desc: '축하·안부·홍보 등' },
|
||||
];
|
||||
|
||||
const STEP_META = [
|
||||
{ label: '사진 업로드', sub: '4~5장' },
|
||||
{ label: '정보 입력', sub: '몇 가지만 답하기' },
|
||||
{ label: '영상 생성', sub: 'AI 카메라 + 자막' },
|
||||
{ label: '완성', sub: '다운로드' },
|
||||
];
|
||||
|
||||
const MIN_PHOTOS = 4;
|
||||
const MIN_PHOTOS_LABEL = `${MIN_PHOTOS}장`;
|
||||
|
||||
const ShortformContent: React.FC<ShortformContentProps> = ({ onComplete }) => {
|
||||
const fileInputRef = useRef<HTMLInputElement>(null);
|
||||
const dropRef = useRef<HTMLDivElement>(null);
|
||||
|
||||
// 단계
|
||||
const [step, setStep] = useState<Step>(1);
|
||||
|
||||
// Step 1 — 사진
|
||||
const [files, setFiles] = useState<File[]>([]);
|
||||
const [previews, setPreviews] = useState<string[]>([]);
|
||||
|
||||
// Step 2 — 폼
|
||||
const [kind, setKind] = useState<Kind>('place');
|
||||
const [bizName, setBizName] = useState('');
|
||||
const [selling, setSelling] = useState('');
|
||||
const [addr, setAddr] = useState('');
|
||||
const [price, setPrice] = useState('');
|
||||
|
||||
// Step 3/4 — 생성 상태
|
||||
const [statusMsg, setStatusMsg] = useState('');
|
||||
const [result, setResult] = useState<ShortformStatusResponse | null>(null);
|
||||
const [errorMsg, setErrorMsg] = useState('');
|
||||
|
||||
// 자막 미리보기
|
||||
const [preview, setPreview] = useState<VideoSpec | null>(null);
|
||||
const [previewLoading, setPreviewLoading] = useState(false);
|
||||
const [previewError, setPreviewError] = useState('');
|
||||
|
||||
// --- 사진 관리 ---
|
||||
const addFiles = (newFiles: File[]) => {
|
||||
const images = newFiles.filter(f => f.type.startsWith('image/'));
|
||||
if (!images.length) return;
|
||||
const newUrls = images.map(f => URL.createObjectURL(f));
|
||||
setFiles(prev => [...prev, ...images]);
|
||||
setPreviews(prev => [...prev, ...newUrls]);
|
||||
};
|
||||
|
||||
const removeFile = (index: number) => {
|
||||
URL.revokeObjectURL(previews[index]);
|
||||
setFiles(prev => prev.filter((_, i) => i !== index));
|
||||
setPreviews(prev => prev.filter((_, i) => i !== index));
|
||||
};
|
||||
|
||||
const handleDragOver = (e: React.DragEvent) => { e.preventDefault(); };
|
||||
const handleDrop = (e: React.DragEvent) => {
|
||||
e.preventDefault();
|
||||
addFiles(Array.from(e.dataTransfer.files));
|
||||
};
|
||||
|
||||
// --- 미리보기 필드 수정 ---
|
||||
const patchPreview = (updater: (prev: NonNullable<typeof preview>) => NonNullable<typeof preview>) => {
|
||||
setPreview(prev => prev ? updater(prev) : prev);
|
||||
};
|
||||
|
||||
// --- 자막 미리보기 ---
|
||||
const handlePreview = async () => {
|
||||
if (!selling.trim()) return;
|
||||
setPreviewLoading(true);
|
||||
setPreviewError('');
|
||||
try {
|
||||
const spec = await previewShortform({
|
||||
kind,
|
||||
biz_name: bizName.trim(),
|
||||
selling: selling.trim(),
|
||||
addr: addr.trim() || undefined,
|
||||
price: price.trim() || undefined,
|
||||
});
|
||||
setPreview(spec);
|
||||
} catch (err) {
|
||||
setPreviewError(err instanceof Error ? err.message : '미리보기 생성에 실패했습니다.');
|
||||
} finally {
|
||||
setPreviewLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
// --- 다운로드 ---
|
||||
const [isDownloading, setIsDownloading] = useState(false);
|
||||
const handleDownload = async (url: string) => {
|
||||
if (isDownloading) return;
|
||||
setIsDownloading(true);
|
||||
try {
|
||||
const resp = await fetch(url);
|
||||
const blob = await resp.blob();
|
||||
const blobUrl = URL.createObjectURL(blob);
|
||||
const link = document.createElement('a');
|
||||
link.href = blobUrl;
|
||||
link.download = `${bizName || 'shortform'}.mp4`;
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
document.body.removeChild(link);
|
||||
URL.revokeObjectURL(blobUrl);
|
||||
} catch {
|
||||
const link = document.createElement('a');
|
||||
link.href = url;
|
||||
link.download = `${bizName || 'shortform'}.mp4`;
|
||||
link.target = '_blank';
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
document.body.removeChild(link);
|
||||
} finally {
|
||||
setIsDownloading(false);
|
||||
}
|
||||
};
|
||||
|
||||
// --- 생성 실행 ---
|
||||
const handleGenerate = async () => {
|
||||
setStep(3);
|
||||
setErrorMsg('');
|
||||
setResult(null);
|
||||
try {
|
||||
setStatusMsg('사진 업로드 중...');
|
||||
const uploadResp = await uploadImages([], files);
|
||||
|
||||
setStatusMsg('영상 생성 요청 중...');
|
||||
await generateShortform({
|
||||
task_id: uploadResp.task_id,
|
||||
kind,
|
||||
biz_name: bizName.trim(),
|
||||
addr: addr.trim() || undefined,
|
||||
price: price.trim() || undefined,
|
||||
selling: selling.trim(),
|
||||
spec: preview ?? undefined,
|
||||
dry_run: true,
|
||||
});
|
||||
|
||||
setStatusMsg('AI 카메라 무브·자막 렌더링 중...');
|
||||
const statusResp = await waitForShortformComplete(uploadResp.task_id, s => {
|
||||
setStatusMsg(s === 'processing' ? 'AI 카메라 무브·자막 렌더링 중...' : s);
|
||||
});
|
||||
|
||||
setResult(statusResp);
|
||||
setStep(4);
|
||||
onComplete?.();
|
||||
} catch (err) {
|
||||
setErrorMsg(err instanceof Error ? err.message : '생성 중 오류가 발생했습니다.');
|
||||
setStep(2);
|
||||
}
|
||||
};
|
||||
|
||||
const step1Valid = files.length >= MIN_PHOTOS;
|
||||
const step2Valid = bizName.trim() && selling.trim();
|
||||
|
||||
// ===================== 렌더 =====================
|
||||
|
||||
// 스텝 인디케이터
|
||||
const StepBar = () => (
|
||||
<div className="sf-step-bar">
|
||||
{STEP_META.map((s, i) => {
|
||||
const n = (i + 1) as Step;
|
||||
const done = step > n;
|
||||
const active = step === n;
|
||||
return (
|
||||
<div key={n} className={`sf-step-item ${active ? 'active' : ''} ${done ? 'done' : ''}`}>
|
||||
<div className="sf-step-circle">
|
||||
{done
|
||||
? <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="3"><polyline points="20 6 9 17 4 12"/></svg>
|
||||
: n}
|
||||
</div>
|
||||
<div className="sf-step-label">
|
||||
<span className="sf-step-name">{s.label}</span>
|
||||
<span className="sf-step-sub">{s.sub}</span>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
);
|
||||
|
||||
// ---- Step 1: 사진 업로드 ----
|
||||
if (step === 1) return (
|
||||
<main className="sf-page">
|
||||
<div className="sf-scroll-area">
|
||||
<div className="sf-hero">
|
||||
<h1 className="sf-hero-title">사진 몇 장과 한마디면, <span className="sf-hero-accent">8초 홍보 영상</span>이 됩니다</h1>
|
||||
<p className="sf-hero-desc">복잡한 분석 없이 — 사진을 올리고 몇 가지만 답하면, AI 카메라 무브와 자막을 입힌 세로형 숏폼이 완성됩니다.</p>
|
||||
</div>
|
||||
|
||||
<StepBar />
|
||||
|
||||
<div className="sf-card">
|
||||
<h2 className="sf-card-title">사진 업로드</h2>
|
||||
<p className="sf-card-desc">홍보할 장소나 물건 사진 4~5장. 전경 1장·디테일 2~3장을 섞으면 영상의 서사가 살아납니다.</p>
|
||||
|
||||
<div
|
||||
ref={dropRef}
|
||||
className="sf-drop-zone"
|
||||
onClick={() => fileInputRef.current?.click()}
|
||||
onDragOver={handleDragOver}
|
||||
onDrop={handleDrop}
|
||||
>
|
||||
<div className="sf-drop-icon">
|
||||
<svg width="32" height="32" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5"><rect x="3" y="3" width="18" height="18" rx="2"/><circle cx="8.5" cy="8.5" r="1.5"/><polyline points="21 15 16 10 5 21"/></svg>
|
||||
</div>
|
||||
<p className="sf-drop-text">여기로 사진을 끌어다 놓거나 클릭</p>
|
||||
<p className="sf-drop-hint">JPG·PNG·{MIN_PHOTOS_LABEL} 이상</p>
|
||||
</div>
|
||||
<input ref={fileInputRef} type="file" accept="image/*" multiple style={{ display: 'none' }} onChange={e => { addFiles(Array.from(e.target.files || [])); e.target.value = ''; }} />
|
||||
|
||||
{previews.length > 0 && (
|
||||
<div className="sf-photo-grid">
|
||||
{previews.map((url, i) => (
|
||||
<div key={i} className="sf-photo-item">
|
||||
<span className="sf-photo-num">{i + 1}</span>
|
||||
<img src={url} alt={`사진 ${i + 1}`} />
|
||||
<button className="sf-photo-remove" onClick={() => removeFile(i)}>×</button>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="sf-footer">
|
||||
<div className="sf-footer-info">
|
||||
<span className="sf-footer-count">{files.length}장</span>
|
||||
{step1Valid
|
||||
? <span className="sf-footer-status ok">업로드됨·준비 완료</span>
|
||||
: <span className="sf-footer-status">{MIN_PHOTOS - files.length}장 더 추가해주세요</span>}
|
||||
</div>
|
||||
<button
|
||||
className="sf-btn-next"
|
||||
disabled={!step1Valid}
|
||||
onClick={() => setStep(2)}
|
||||
>
|
||||
다음: 정보 입력 →
|
||||
</button>
|
||||
</div>
|
||||
</main>
|
||||
);
|
||||
|
||||
// ---- Step 2: 정보 입력 ----
|
||||
if (step === 2) return (
|
||||
<main className="sf-page">
|
||||
<div className="sf-scroll-area">
|
||||
<StepBar />
|
||||
|
||||
<div className="sf-card">
|
||||
<h2 className="sf-card-title">몇 가지만 알려주세요</h2>
|
||||
<p className="sf-card-desc">사장님·마케터가 가장 잘 아는 정보로 카피를 만듭니다.</p>
|
||||
|
||||
{/* Kind */}
|
||||
<div className="sf-field">
|
||||
<label className="sf-label">영상의 목적이 무엇인가요? <span className="sf-required">*</span></label>
|
||||
<div className="sf-kind-grid">
|
||||
{KIND_OPTIONS.map(opt => (
|
||||
<button
|
||||
key={opt.value}
|
||||
type="button"
|
||||
className={`sf-kind-card ${kind === opt.value ? 'active' : ''}`}
|
||||
onClick={() => setKind(opt.value)}
|
||||
>
|
||||
<span className="sf-kind-label">{opt.label}</span>
|
||||
<span className="sf-kind-desc">{opt.desc}</span>
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* 업체명 */}
|
||||
<div className="sf-field">
|
||||
<label className="sf-label">업체·상품·메시지 제목 <span className="sf-required">*</span></label>
|
||||
<input
|
||||
className="sf-input"
|
||||
type="text"
|
||||
placeholder="예: 스테이 머뭄"
|
||||
value={bizName}
|
||||
onChange={e => setBizName(e.target.value)}
|
||||
maxLength={50}
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* 셀링포인트 */}
|
||||
<div className="sf-field">
|
||||
<label className="sf-label">가장 자랑하고 싶은 한 가지 <span className="sf-required">*</span></label>
|
||||
<textarea
|
||||
className="sf-textarea"
|
||||
placeholder="예: 열방 손님 없는 완전한 독채, 개별 정원까지"
|
||||
value={selling}
|
||||
onChange={e => setSelling(e.target.value)}
|
||||
maxLength={100}
|
||||
rows={3}
|
||||
/>
|
||||
<p className="sf-field-hint">이 한마디가 영상의 후킹 타이틀·핵심 메시지가 됩니다. 구체적일수록 좋아요.</p>
|
||||
</div>
|
||||
|
||||
{/* 자막 미리보기 */}
|
||||
<div className="sf-field">
|
||||
<div className="sf-subtitle-header">
|
||||
<label className="sf-label">영상 자막·스크립트</label>
|
||||
<button
|
||||
className="sf-subtitle-btn"
|
||||
disabled={!selling.trim() || previewLoading}
|
||||
onClick={handlePreview}
|
||||
>
|
||||
{previewLoading ? '생성 중...' : preview ? '재생성하기' : '자막 생성하기'}
|
||||
</button>
|
||||
</div>
|
||||
<p className="sf-field-hint">위 한 가지를 적은 뒤 누르면, AI가 인트로·셀링포인트·감성 스토리·CTA 4가지를 만들어줍니다.</p>
|
||||
{previewError && <p className="sf-field-error">{previewError}</p>}
|
||||
{preview && (
|
||||
<div className="sf-preview-spec">
|
||||
<div className="sf-preview-block">
|
||||
<span className="sf-preview-tag">인트로</span>
|
||||
<input className="sf-preview-input" value={preview.hook.eyebrow}
|
||||
onChange={e => patchPreview(p => ({ ...p, hook: { ...p.hook, eyebrow: e.target.value } }))} />
|
||||
<input className="sf-preview-input sf-preview-input-bold" value={preview.hook.title}
|
||||
onChange={e => patchPreview(p => ({ ...p, hook: { ...p.hook, title: e.target.value } }))} />
|
||||
</div>
|
||||
<div className="sf-preview-block">
|
||||
<span className="sf-preview-tag">셀링포인트</span>
|
||||
<div className="sf-preview-badge-inputs">
|
||||
{preview.selling_point.items.slice(0, 3).map((item, i) => (
|
||||
<input key={i} className="sf-preview-badge-input" value={item}
|
||||
onChange={e => patchPreview(p => {
|
||||
const items = [...p.selling_point.items];
|
||||
items[i] = e.target.value;
|
||||
return { ...p, selling_point: { items } };
|
||||
})} />
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
<div className="sf-preview-block">
|
||||
<span className="sf-preview-tag">감성 스토리</span>
|
||||
{preview.brand_lines.slice(0, 2).map((line, i) => (
|
||||
<input key={i} className="sf-preview-input" value={line}
|
||||
onChange={e => patchPreview(p => {
|
||||
const brand_lines = [...p.brand_lines];
|
||||
brand_lines[i] = e.target.value;
|
||||
return { ...p, brand_lines };
|
||||
})} />
|
||||
))}
|
||||
</div>
|
||||
<div className="sf-preview-block">
|
||||
<span className="sf-preview-tag">CTA</span>
|
||||
<input className="sf-preview-input" value={preview.end_card.brand}
|
||||
onChange={e => patchPreview(p => ({ ...p, end_card: { ...p.end_card, brand: e.target.value } }))} />
|
||||
<input className="sf-preview-input" value={preview.end_card.location}
|
||||
onChange={e => patchPreview(p => ({ ...p, end_card: { ...p.end_card, location: e.target.value } }))} />
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* 주소 */}
|
||||
<div className="sf-field">
|
||||
<label className="sf-label">주소 또는 판매 사이트 URL <span className="sf-optional">(선택)</span></label>
|
||||
<input
|
||||
className="sf-input"
|
||||
type="text"
|
||||
placeholder="예: 전북 군산시 절골길 18"
|
||||
value={addr}
|
||||
onChange={e => setAddr(e.target.value)}
|
||||
maxLength={100}
|
||||
/>
|
||||
<p className="sf-field-hint">영상 엔드카드·해시태그에 활용됩니다.</p>
|
||||
</div>
|
||||
|
||||
{/* 가격 */}
|
||||
<div className="sf-field">
|
||||
<label className="sf-label">가격 정보 <span className="sf-optional">(선택)</span></label>
|
||||
<input
|
||||
className="sf-input"
|
||||
type="text"
|
||||
placeholder="예: 1박 19만원~"
|
||||
value={price}
|
||||
onChange={e => setPrice(e.target.value)}
|
||||
maxLength={50}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="sf-footer sf-footer-two">
|
||||
<button className="sf-btn-prev" onClick={() => setStep(1)}>← 사진 다시</button>
|
||||
<button className="sf-btn-generate" disabled={!step2Valid} onClick={handleGenerate}>
|
||||
영상 생성 →
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{errorMsg && (
|
||||
<div className="sf-error-toast">{errorMsg}</div>
|
||||
)}
|
||||
</main>
|
||||
);
|
||||
|
||||
// ---- Step 3: 생성 중 ----
|
||||
if (step === 3) return (
|
||||
<main className="sf-page">
|
||||
<div className="sf-scroll-area">
|
||||
<StepBar />
|
||||
<div className="sf-generating">
|
||||
<div className="sf-gen-orb-ring">
|
||||
<div className="sf-gen-spinner-lg" />
|
||||
<div className="sf-gen-icon">
|
||||
<svg width="36" height="36" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round">
|
||||
<path d="M15 10l4.553-2.069A1 1 0 0121 8.87V15.13a1 1 0 01-1.447.899L15 14M3 8a2 2 0 012-2h10a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2V8z"/>
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
<h2 className="sf-gen-title">AI가 영상을 만들고 있어요</h2>
|
||||
<p className="sf-gen-msg">{statusMsg || 'AI 카메라 무브·자막 렌더링 중...'}</p>
|
||||
<p className="sf-gen-sub">보통 1~3분 정도 소요됩니다. 잠시만 기다려주세요.</p>
|
||||
<div className="sf-gen-steps">
|
||||
<div className={`sf-gen-step ${statusMsg.includes('업로드') ? 'active' : statusMsg ? 'done' : ''}`}>
|
||||
<span className="sf-gen-step-dot" />사진 업로드
|
||||
</div>
|
||||
<div className={`sf-gen-step ${statusMsg.includes('요청') ? 'active' : statusMsg.includes('렌더링') || statusMsg.includes('완성') ? 'done' : ''}`}>
|
||||
<span className="sf-gen-step-dot" />영상 생성 요청
|
||||
</div>
|
||||
<div className={`sf-gen-step ${statusMsg.includes('렌더링') ? 'active' : ''}`}>
|
||||
<span className="sf-gen-step-dot" />AI 렌더링
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
);
|
||||
|
||||
// ---- Step 4: 완성 ----
|
||||
return (
|
||||
<main className="sf-page">
|
||||
<div className="sf-scroll-area">
|
||||
<StepBar />
|
||||
<div className="sf-result">
|
||||
<p className="sf-result-label">✓ 영상이 완성됐습니다!</p>
|
||||
{result?.result_url && (
|
||||
<div className="sf-result-video-wrap">
|
||||
<video className="sf-result-video" src={result.result_url} controls playsInline />
|
||||
</div>
|
||||
)}
|
||||
<div className="sf-result-actions">
|
||||
{result?.result_url && (
|
||||
<button
|
||||
className="sf-download-btn"
|
||||
disabled={isDownloading}
|
||||
onClick={() => handleDownload(result.result_url!)}
|
||||
>
|
||||
{isDownloading ? '다운로드 중...' : '다운로드'}
|
||||
</button>
|
||||
)}
|
||||
<button className="sf-btn-prev" onClick={() => { setStep(1); setFiles([]); setPreviews([]); setBizName(''); setSelling(''); setAddr(''); setPrice(''); }}>
|
||||
새 영상 만들기
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
);
|
||||
};
|
||||
|
||||
export default ShortformContent;
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
import React, { useState, useRef, useEffect } from 'react';
|
||||
import React, { useState, useRef, useEffect, useMemo } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { generateLyric, waitForLyricComplete, generateSong, waitForSongComplete } from '../../utils/api';
|
||||
import { LANGUAGE_MAP } from '../../types/api';
|
||||
@@ -16,6 +16,7 @@ interface SoundStudioContentProps {
|
||||
businessInfo?: BusinessInfo;
|
||||
imageTaskId: string | null;
|
||||
mId: number;
|
||||
industry?: string;
|
||||
onStatusChange?: (status: string) => void;
|
||||
videoGenerationStatus?: 'idle' | 'generating' | 'complete' | 'error';
|
||||
videoGenerationProgress?: number;
|
||||
@@ -26,6 +27,46 @@ type GenerationStatus = 'idle' | 'generating_lyric' | 'generating_song' | 'polli
|
||||
|
||||
const MAX_RETRY_COUNT = 3;
|
||||
|
||||
// 생성 완료된 곡 상태를 새로고침 후에도 복원하기 위한 키
|
||||
// GenerationFlow의 clearAllProjectStorage가 이 키를 포함해 정리함
|
||||
const SONG_GENERATION_KEY = 'castad_song_generation';
|
||||
|
||||
const GENRE_VALUES = ['kpop', 'pop', 'ballad', 'hip-hop', 'rnb', 'edm', 'jazz', 'rock'];
|
||||
|
||||
const genreMap: Record<string, string> = {
|
||||
'자동 선택': '', // 런타임에 랜덤 결정
|
||||
'K-POP': 'kpop',
|
||||
'POP': 'pop',
|
||||
'발라드': 'ballad',
|
||||
'Hip-Hop': 'hip-hop',
|
||||
'R&B': 'rnb',
|
||||
'EDM': 'edm',
|
||||
'JAZZ': 'jazz',
|
||||
'ROCK': 'rock',
|
||||
};
|
||||
|
||||
const getEffectiveGenre = (selectedGenre: string): string => {
|
||||
if (selectedGenre === '자동 선택') {
|
||||
return GENRE_VALUES[Math.floor(Math.random() * GENRE_VALUES.length)];
|
||||
}
|
||||
return genreMap[selectedGenre] || 'pop';
|
||||
};
|
||||
|
||||
// 실제 영상 생성에 사용된 genre 값(kpop, hip-hop 등)을 화면 표시용 라벨로 변환
|
||||
const getGenreDisplayLabel = (genreValue: string, t: (key: string) => string): string => {
|
||||
const displayMap: Record<string, string> = {
|
||||
kpop: 'K-POP',
|
||||
pop: 'POP',
|
||||
ballad: t('soundStudio.genreBallad'),
|
||||
'hip-hop': 'Hip-Hop',
|
||||
rnb: 'R&B',
|
||||
edm: 'EDM',
|
||||
jazz: 'JAZZ',
|
||||
rock: 'ROCK',
|
||||
};
|
||||
return displayMap[genreValue] || genreValue;
|
||||
};
|
||||
|
||||
const sanitizeError = (message: string, fallback: string): string => {
|
||||
if (
|
||||
message.includes('Traceback') ||
|
||||
@@ -54,6 +95,7 @@ const SoundStudioContent: React.FC<SoundStudioContentProps> = ({
|
||||
businessInfo,
|
||||
imageTaskId,
|
||||
mId,
|
||||
industry = '',
|
||||
onStatusChange,
|
||||
videoGenerationStatus = 'idle',
|
||||
videoGenerationProgress = 0,
|
||||
@@ -63,8 +105,8 @@ const SoundStudioContent: React.FC<SoundStudioContentProps> = ({
|
||||
const [selectedType, setSelectedType] = useState('보컬');
|
||||
const [selectedLang, setSelectedLang] = useState('한국어');
|
||||
const [selectedGenre, setSelectedGenre] = useState('자동 선택');
|
||||
const [usedGenre, setUsedGenre] = useState('');
|
||||
const [progress, setProgress] = useState(0);
|
||||
const [isDragging, setIsDragging] = useState(false);
|
||||
const [status, setStatus] = useState<GenerationStatus>('idle');
|
||||
const [lyrics, setLyrics] = useState('');
|
||||
const [audioUrl, setAudioUrl] = useState<string | null>(null);
|
||||
@@ -75,20 +117,40 @@ const SoundStudioContent: React.FC<SoundStudioContentProps> = ({
|
||||
const [statusMessage, setStatusMessage] = useState('');
|
||||
const [retryCount, setRetryCount] = useState(0);
|
||||
const [songTaskId, setSongTaskId] = useState<string | null>(null);
|
||||
const progressBarRef = useRef<HTMLDivElement>(null);
|
||||
const audioRef = useRef<HTMLAudioElement>(null);
|
||||
|
||||
// 완료 데이터를 localStorage에 저장
|
||||
const saveSongCompletionData = () => {
|
||||
const completionData = {
|
||||
businessName: businessInfo?.customer_name || '알 수 없음',
|
||||
genre: selectedGenre === '자동 선택' ? 'K-POP' : selectedGenre,
|
||||
// '자동 선택'처럼 UI에서 고른 값이 아니라, 실제 영상 생성에 사용된 genre(usedGenre)를 저장
|
||||
genre: usedGenre ? getGenreDisplayLabel(usedGenre, t) : selectedGenre,
|
||||
lyrics: lyrics,
|
||||
timestamp: Date.now(),
|
||||
};
|
||||
localStorage.setItem('castad_song_completion', JSON.stringify(completionData));
|
||||
};
|
||||
|
||||
// 새로고침 후 생성 완료된 곡 상태 복원
|
||||
useEffect(() => {
|
||||
const saved = localStorage.getItem(SONG_GENERATION_KEY);
|
||||
if (!saved) return;
|
||||
|
||||
try {
|
||||
const parsed = JSON.parse(saved);
|
||||
if (parsed.status !== 'complete' || !parsed.audioUrl || !parsed.songTaskId) return;
|
||||
|
||||
// 저장된 URL로 복원 (public Blob URL이라 만료되지 않음)
|
||||
// 백엔드에 /song/download 엔드포인트가 없으므로 재조회하지 않는다.
|
||||
setSongTaskId(parsed.songTaskId);
|
||||
setAudioUrl(parsed.audioUrl);
|
||||
setLyrics(parsed.lyrics ?? '');
|
||||
setStatus('complete');
|
||||
} catch {
|
||||
// 파싱 실패 시 무시
|
||||
}
|
||||
}, []); // 마운트 1회만 실행
|
||||
|
||||
// Close language dropdown when clicking outside
|
||||
// Auto-navigate to next page when video generation is complete
|
||||
useEffect(() => {
|
||||
@@ -128,6 +190,18 @@ const SoundStudioContent: React.FC<SoundStudioContentProps> = ({
|
||||
setStatusMessage('');
|
||||
setRetryCount(0);
|
||||
|
||||
// 새로고침 후에도 복원할 수 있도록 완료된 곡 상태를 저장
|
||||
try {
|
||||
localStorage.setItem(SONG_GENERATION_KEY, JSON.stringify({
|
||||
audioUrl: statusResponse.song_result_url,
|
||||
songTaskId: taskId,
|
||||
lyrics: currentLyrics,
|
||||
status: 'complete',
|
||||
}));
|
||||
} catch {
|
||||
// localStorage 쓰기 실패는 무시
|
||||
}
|
||||
|
||||
} catch (error) {
|
||||
console.error('Polling failed:', error);
|
||||
|
||||
@@ -158,20 +232,13 @@ const SoundStudioContent: React.FC<SoundStudioContentProps> = ({
|
||||
|
||||
try {
|
||||
const language = LANGUAGE_MAP[selectedLang] || 'Korean';
|
||||
const genreMap: Record<string, string> = {
|
||||
'자동 선택': 'pop',
|
||||
'K-POP': 'kpop',
|
||||
'발라드': 'ballad',
|
||||
'Hip-Hop': 'hip-hop',
|
||||
'R&B': 'rnb',
|
||||
'EDM': 'edm',
|
||||
'JAZZ': 'jazz',
|
||||
'ROCK': 'rock',
|
||||
};
|
||||
|
||||
const isInstrumental = selectedType === '배경음악';
|
||||
const effectiveGenre = getEffectiveGenre(selectedGenre);
|
||||
setUsedGenre(effectiveGenre);
|
||||
|
||||
const songResponse = await generateSong(imageTaskId, {
|
||||
genre: genreMap[selectedGenre] || 'pop',
|
||||
genre: effectiveGenre,
|
||||
...(isInstrumental ? { instrumental: true, lyrics: '' } : { language, lyrics: currentLyrics }),
|
||||
});
|
||||
|
||||
@@ -192,41 +259,6 @@ const SoundStudioContent: React.FC<SoundStudioContentProps> = ({
|
||||
}
|
||||
};
|
||||
|
||||
const handleMove = (clientX: number) => {
|
||||
if (!progressBarRef.current || !audioRef.current) return;
|
||||
const rect = progressBarRef.current.getBoundingClientRect();
|
||||
const newProgress = Math.max(0, Math.min(100, ((clientX - rect.left) / rect.width) * 100));
|
||||
const newTime = (newProgress / 100) * duration;
|
||||
audioRef.current.currentTime = newTime;
|
||||
setProgress(newProgress);
|
||||
setCurrentTime(newTime);
|
||||
};
|
||||
|
||||
const onMouseDown = (e: React.MouseEvent) => {
|
||||
if (!audioUrl) return;
|
||||
setIsDragging(true);
|
||||
handleMove(e.clientX);
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
const onMouseMove = (e: MouseEvent) => {
|
||||
if (isDragging) handleMove(e.clientX);
|
||||
};
|
||||
const onMouseUp = () => {
|
||||
setIsDragging(false);
|
||||
};
|
||||
|
||||
if (isDragging) {
|
||||
window.addEventListener('mousemove', onMouseMove);
|
||||
window.addEventListener('mouseup', onMouseUp);
|
||||
}
|
||||
|
||||
return () => {
|
||||
window.removeEventListener('mousemove', onMouseMove);
|
||||
window.removeEventListener('mouseup', onMouseUp);
|
||||
};
|
||||
}, [isDragging]);
|
||||
|
||||
useEffect(() => {
|
||||
const audio = audioRef.current;
|
||||
if (!audio) return;
|
||||
@@ -286,6 +318,9 @@ const SoundStudioContent: React.FC<SoundStudioContentProps> = ({
|
||||
return;
|
||||
}
|
||||
|
||||
// 새 곡 생성 시작 — 이전에 저장된 완료 곡 제거
|
||||
localStorage.removeItem(SONG_GENERATION_KEY);
|
||||
|
||||
setStatus('generating_lyric');
|
||||
setErrorMessage(null);
|
||||
setStatusMessage(t('soundStudio.generatingLyrics'));
|
||||
@@ -296,6 +331,9 @@ const SoundStudioContent: React.FC<SoundStudioContentProps> = ({
|
||||
try {
|
||||
const language = LANGUAGE_MAP[selectedLang] || 'Korean';
|
||||
const isInstrumental = selectedType === '배경음악';
|
||||
// 수동 선택한 장르는 가사 생성 시점부터 넘겨서, 그 장르 템포에 맞는 줄 수로 가사를 쓰게 한다.
|
||||
// '자동 선택'이면 넘기지 않고, 가사 생성 결과로 받은 recommended genre를 그대로 쓴다.
|
||||
const manualGenre = selectedGenre === '자동 선택' ? undefined : genreMap[selectedGenre];
|
||||
|
||||
// 1. 가사 생성 요청
|
||||
console.log('[SoundStudio] Sending m_id:', mId);
|
||||
@@ -306,26 +344,20 @@ const SoundStudioContent: React.FC<SoundStudioContentProps> = ({
|
||||
m_id: mId,
|
||||
region: businessInfo.region,
|
||||
task_id: imageTaskId,
|
||||
industry,
|
||||
orientation,
|
||||
...(isInstrumental && { instrumental: true }),
|
||||
...(manualGenre && { genre: manualGenre }),
|
||||
});
|
||||
|
||||
if (!lyricResponse.success || !lyricResponse.task_id) {
|
||||
throw new Error(lyricResponse.error_message || t('soundStudio.lyricGenerationFailed'));
|
||||
}
|
||||
|
||||
const genreMap: Record<string, string> = {
|
||||
'자동 선택': 'pop',
|
||||
'K-POP': 'kpop',
|
||||
'발라드': 'ballad',
|
||||
'Hip-Hop': 'hip-hop',
|
||||
'R&B': 'rnb',
|
||||
'EDM': 'edm',
|
||||
'JAZZ': 'jazz',
|
||||
'ROCK': 'rock',
|
||||
};
|
||||
|
||||
let songLyrics: string | undefined;
|
||||
// BGM 모드는 백엔드가 가사/장르 추천 없이 즉시 completed 처리하므로 GPT 추천 장르가 없다.
|
||||
// 이 경우에만 기존 랜덤 선택 로직으로 폴백한다.
|
||||
let effectiveGenre = manualGenre || getEffectiveGenre(selectedGenre);
|
||||
|
||||
if (!isInstrumental) {
|
||||
// 2. 가사 생성 상태 폴링 → 완료 시 상세 조회
|
||||
@@ -350,13 +382,16 @@ const SoundStudioContent: React.FC<SoundStudioContentProps> = ({
|
||||
|
||||
setLyrics(lyricDetailResponse.lyric_result);
|
||||
songLyrics = lyricDetailResponse.lyric_result;
|
||||
// 가사와 함께 확정된 장르(수동 선택값 또는 GPT 추천값)를 그대로 음악 생성에 사용
|
||||
effectiveGenre = lyricDetailResponse.genre || effectiveGenre;
|
||||
}
|
||||
|
||||
setStatus('generating_song');
|
||||
setStatusMessage(t('soundStudio.generatingSong'));
|
||||
setUsedGenre(effectiveGenre);
|
||||
|
||||
const songResponse = await generateSong(imageTaskId, {
|
||||
genre: genreMap[selectedGenre] || 'pop',
|
||||
genre: effectiveGenre,
|
||||
...(isInstrumental ? { instrumental: true, lyrics: '' } : { language, lyrics: songLyrics }),
|
||||
});
|
||||
|
||||
@@ -402,6 +437,24 @@ const SoundStudioContent: React.FC<SoundStudioContentProps> = ({
|
||||
|
||||
const isGenerating = status === 'generating_lyric' || status === 'generating_song' || status === 'polling';
|
||||
|
||||
// 드래그로 인한 잦은 리렌더에서도 가사 파싱(정규식/배열 처리)이 매번 재실행되지 않도록 메모이제이션
|
||||
const lyricsSections = useMemo(() => {
|
||||
if (!lyrics) return [];
|
||||
const lines = lyrics.split('\n').filter(l => l.trim());
|
||||
const sections: { tag: string | null; lines: string[] }[] = [];
|
||||
lines.forEach(line => {
|
||||
const tagMatch = line.trim().match(/^\[(.+)\]$/);
|
||||
if (tagMatch) {
|
||||
sections.push({ tag: `[${tagMatch[1]}]`, lines: [] });
|
||||
} else if (sections.length === 0) {
|
||||
sections.push({ tag: null, lines: [line] });
|
||||
} else {
|
||||
sections[sections.length - 1].lines.push(line);
|
||||
}
|
||||
});
|
||||
return sections.filter(s => s.lines.length > 0);
|
||||
}, [lyrics]);
|
||||
|
||||
// status 변경 시 부모에 알림
|
||||
useEffect(() => {
|
||||
onStatusChange?.(status);
|
||||
@@ -495,7 +548,7 @@ const SoundStudioContent: React.FC<SoundStudioContentProps> = ({
|
||||
))}
|
||||
</div>
|
||||
<div className="genre-row">
|
||||
{['JAZZ', 'ROCK'].map(genre => (
|
||||
{['JAZZ', 'ROCK', 'POP'].map(genre => (
|
||||
<button
|
||||
key={genre}
|
||||
onClick={() => setSelectedGenre(genre)}
|
||||
@@ -505,7 +558,6 @@ const SoundStudioContent: React.FC<SoundStudioContentProps> = ({
|
||||
{genre}
|
||||
</button>
|
||||
))}
|
||||
<div className="genre-btn-placeholder"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -615,9 +667,8 @@ const SoundStudioContent: React.FC<SoundStudioContentProps> = ({
|
||||
)}
|
||||
</button>
|
||||
|
||||
{/* 진행 표시 전용 — Azure Blob 익명 응답에 Accept-Ranges가 없어 seek가 불안정하므로 드래그 미지원 */}
|
||||
<div
|
||||
ref={progressBarRef}
|
||||
onMouseDown={onMouseDown}
|
||||
className={`audio-progress-container ${!audioUrl ? 'disabled' : ''}`}
|
||||
>
|
||||
<div
|
||||
@@ -633,27 +684,16 @@ const SoundStudioContent: React.FC<SoundStudioContentProps> = ({
|
||||
|
||||
{/* Lyrics Display */}
|
||||
<div className="lyrics-display">
|
||||
{lyrics ? (() => {
|
||||
const lines = lyrics.split('\n').filter(l => l.trim());
|
||||
const outro = lines.slice(-1);
|
||||
const body = lines.slice(0, -1);
|
||||
const half = Math.ceil(body.length / 2);
|
||||
const sections = [
|
||||
{ tag: '[Verse]', lines: body.slice(0, half) },
|
||||
{ tag: '[Chorus]', lines: body.slice(half) },
|
||||
{ tag: '[Outro]', lines: outro },
|
||||
].filter(s => s.lines.length > 0);
|
||||
return (
|
||||
<div className="lyrics-paragraphs">
|
||||
{sections.map((section, i) => (
|
||||
<div key={i} className="lyrics-section">
|
||||
<span className="lyrics-tag">{section.tag}</span>
|
||||
<p className="lyrics-paragraph">{section.lines.join('\n')}</p>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
);
|
||||
})() : (
|
||||
{lyrics ? (
|
||||
<div className="lyrics-paragraphs">
|
||||
{lyricsSections.map((section, i) => (
|
||||
<div key={i} className="lyrics-section">
|
||||
{section.tag && <span className="lyrics-tag">{section.tag}</span>}
|
||||
<p className="lyrics-paragraph">{section.lines.join('\n')}</p>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
) : (
|
||||
<div className="lyrics-placeholder">
|
||||
{selectedType === '배경음악' ? t('soundStudio.lyricsPlaceholderBGM') : t('soundStudio.lyricsPlaceholder')}
|
||||
</div>
|
||||
|
||||
@@ -1,31 +1,122 @@
|
||||
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 (분기·리셋 때문) */
|
||||
pipeline: Pipeline;
|
||||
onPipelineChange: (pipeline: Pipeline) => void;
|
||||
onAnalyze: (value: string, type?: SearchType) => void;
|
||||
onAutocomplete?: (data: AutocompleteRequest) => void;
|
||||
onManualInput?: (businessName: string, address: string) => void;
|
||||
onShortform?: () => void;
|
||||
onManualInput?: (businessName: string, address: string, category: string, officialSiteUrl?: string) => void;
|
||||
error: string | null;
|
||||
/** 썰박스 생성 요청 접수 시. 폴링 소유는 GenerationFlow */
|
||||
onSsulJobStarted: (taskId: number, scenario: Scen) => void;
|
||||
/** 포스터 영상(F1) 생성 요청 접수 시. 폴링 소유는 GenerationFlow */
|
||||
onPosterJobStarted: (jobId: string) => void;
|
||||
/** 롱컷 생성 요청 접수 시. 폴링 소유는 GenerationFlow */
|
||||
onPlayreelJobStarted: (jobId: string) => void;
|
||||
/** 크레딧 부족 시 충전 화면으로 */
|
||||
onGoToPayment: () => void;
|
||||
}
|
||||
|
||||
const UrlInputContent: React.FC<UrlInputContentProps> = ({ onAnalyze, onAutocomplete, onManualInput, onShortform, error }) => {
|
||||
/**
|
||||
* 대시보드 진입 화면.
|
||||
*
|
||||
* 탭바는 로고와 하위 폼 **사이에 형제로** 얹고 하위 폼만 교체한다.
|
||||
*/
|
||||
const UrlInputContent: React.FC<UrlInputContentProps> = ({
|
||||
pipeline,
|
||||
onPipelineChange,
|
||||
onAnalyze,
|
||||
onAutocomplete,
|
||||
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">
|
||||
{/* 로고 */}
|
||||
<div className="url-input-logo">
|
||||
<img src="/assets/images/ADO2_with Slogan_white.svg" alt="ADO2" />
|
||||
</div>
|
||||
|
||||
<SearchInputForm
|
||||
onAnalyze={onAnalyze}
|
||||
onAutocomplete={onAutocomplete}
|
||||
onManualInput={onManualInput}
|
||||
onShortform={onShortform}
|
||||
error={error}
|
||||
/>
|
||||
<PipelineTabs value={pipeline} onChange={handleTabChange} />
|
||||
|
||||
{/* 고른 기능이 무엇을 해주는지 한 줄. 탭 라벨(2~6자)만으로는 네 기능의 차이가
|
||||
전달되지 않아 처음 온 사람이 아무거나 눌러본다. STEP 1 위에 둔다. */}
|
||||
{!showChoice && <p className="pipeline-desc">{t(`pipelineTabs.desc.${pipeline}`)}</p>}
|
||||
|
||||
{renderForm()}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -1,51 +0,0 @@
|
||||
|
||||
import React from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import Footer from '../../components/Footer';
|
||||
|
||||
interface DisplaySectionProps {
|
||||
onStartClick?: () => void;
|
||||
}
|
||||
|
||||
const DisplaySection: React.FC<DisplaySectionProps> = ({ onStartClick }) => {
|
||||
const { t } = useTranslation();
|
||||
// YouTube Shorts 영상 ID들
|
||||
const videos = [
|
||||
{ id: 1, videoId: 'M3iuPZ59X1I' },
|
||||
{ id: 2, videoId: 'JxWQxELDHSs' },
|
||||
{ id: 3, videoId: 'c2ZdwhaB7S4' },
|
||||
];
|
||||
|
||||
return (
|
||||
<div className="display-section">
|
||||
<div className="content-safe-area">
|
||||
{/* Main visual frames container */}
|
||||
<div className="display-frames">
|
||||
{videos.map((video, index) => (
|
||||
<div
|
||||
key={video.id}
|
||||
className={`display-frame ${index === 2 ? 'display-frame-hidden-mobile' : ''}`}
|
||||
>
|
||||
<iframe
|
||||
src={`https://www.youtube.com/embed/${video.videoId}?autoplay=1&mute=1&loop=1&playlist=${video.videoId}&controls=0&showinfo=0&rel=0&modestbranding=1&playsinline=1`}
|
||||
title={`YouTube Shorts ${video.id}`}
|
||||
frameBorder="0"
|
||||
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
|
||||
allowFullScreen
|
||||
className="display-video"
|
||||
/>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
|
||||
{/* Action Button */}
|
||||
<button onClick={onStartClick} className="display-button">
|
||||
{t('landing.display.startButton')}
|
||||
</button>
|
||||
</div>
|
||||
<Footer />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default DisplaySection;
|
||||
@@ -1,139 +0,0 @@
|
||||
import React, { useEffect, useRef } from 'react';
|
||||
|
||||
// Orb configuration with movement zones to prevent overlap
|
||||
interface OrbConfig {
|
||||
id: string;
|
||||
size: number;
|
||||
initialX: number;
|
||||
initialY: number;
|
||||
color: string;
|
||||
minX: number;
|
||||
maxX: number;
|
||||
minY: number;
|
||||
maxY: number;
|
||||
}
|
||||
|
||||
const orbConfigs: OrbConfig[] = [
|
||||
{ id: 'orb-1', size: 500, initialX: -10, initialY: -10, color: 'radial-gradient(circle, #C490FF 20%, #AE72F9 50%, rgba(94, 235, 195, 0.4) 100%)', minX: -30, maxX: 35, minY: -30, maxY: 40 },
|
||||
{ id: 'orb-2', size: 480, initialX: 70, initialY: -5, color: 'radial-gradient(circle, #5EEBC3 25%, rgba(174, 114, 249, 0.6) 70%, rgba(139, 92, 246, 0.3) 100%)', minX: 50, maxX: 110, minY: -30, maxY: 40 },
|
||||
{ id: 'orb-3', size: 420, initialX: 5, initialY: 35, color: 'radial-gradient(circle, rgba(148, 251, 224, 0.8) 15%, #AE72F9 55%, rgba(94, 235, 195, 0.3) 100%)', minX: -20, maxX: 45, minY: 20, maxY: 65 },
|
||||
{ id: 'orb-4', size: 400, initialX: 60, initialY: 40, color: 'radial-gradient(circle, rgba(220, 200, 255, 0.95) 10%, rgba(148, 251, 224, 0.85) 45%, rgba(174, 114, 249, 0.5) 100%)', minX: 40, maxX: 100, minY: 25, maxY: 70 },
|
||||
{ id: 'orb-5', size: 520, initialX: -8, initialY: 65, color: 'radial-gradient(circle, #B794F6 30%, rgba(148, 251, 224, 0.6) 65%, rgba(174, 114, 249, 0.3) 100%)', minX: -30, maxX: 40, minY: 50, maxY: 110 },
|
||||
{ id: 'orb-6', size: 450, initialX: 65, initialY: 70, color: 'radial-gradient(circle, rgba(180, 255, 235, 0.95) 15%, rgba(200, 160, 255, 0.8) 50%, rgba(94, 235, 195, 0.45) 100%)', minX: 45, maxX: 110, minY: 55, maxY: 110 },
|
||||
];
|
||||
|
||||
interface HeroSectionProps {
|
||||
onLogin?: () => void;
|
||||
onNext?: () => void;
|
||||
scrollProgress?: number;
|
||||
}
|
||||
|
||||
const HeroSection: React.FC<HeroSectionProps> = ({ onLogin, onNext, scrollProgress = 0 }) => {
|
||||
const orbRefs = useRef<(HTMLDivElement | null)[]>([]);
|
||||
const animationRefs = useRef<number[]>([]);
|
||||
|
||||
// Orb 랜덤 이동 애니메이션
|
||||
useEffect(() => {
|
||||
const moveOrb = (orb: HTMLDivElement, index: number) => {
|
||||
const config = orbConfigs[index];
|
||||
let currentX = config.initialX;
|
||||
let currentY = config.initialY;
|
||||
let targetX = currentX;
|
||||
let targetY = currentY;
|
||||
let scale = 1;
|
||||
let targetScale = 1;
|
||||
let isFirstMove = true;
|
||||
|
||||
const generateNewTarget = () => {
|
||||
const rangeX = config.maxX - config.minX;
|
||||
const rangeY = config.maxY - config.minY;
|
||||
if (isFirstMove) {
|
||||
const smallRangeX = rangeX * 0.3;
|
||||
const smallRangeY = rangeY * 0.3;
|
||||
targetX = currentX + (Math.random() - 0.5) * smallRangeX;
|
||||
targetY = currentY + (Math.random() - 0.5) * smallRangeY;
|
||||
targetX = Math.max(config.minX, Math.min(config.maxX, targetX));
|
||||
targetY = Math.max(config.minY, Math.min(config.maxY, targetY));
|
||||
isFirstMove = false;
|
||||
} else {
|
||||
targetX = config.minX + Math.random() * rangeX;
|
||||
targetY = config.minY + Math.random() * rangeY;
|
||||
}
|
||||
targetScale = 0.9 + Math.random() * 0.2;
|
||||
};
|
||||
|
||||
const animate = () => {
|
||||
const speed = 0.003;
|
||||
currentX += (targetX - currentX) * speed;
|
||||
currentY += (targetY - currentY) * speed;
|
||||
scale += (targetScale - scale) * speed;
|
||||
orb.style.left = `${currentX}%`;
|
||||
orb.style.top = `${currentY}%`;
|
||||
orb.style.transform = `scale(${scale})`;
|
||||
const distance = Math.sqrt(Math.pow(targetX - currentX, 2) + Math.pow(targetY - currentY, 2));
|
||||
if (distance < 1) generateNewTarget();
|
||||
animationRefs.current[index] = requestAnimationFrame(animate);
|
||||
};
|
||||
|
||||
generateNewTarget();
|
||||
animate();
|
||||
};
|
||||
|
||||
orbRefs.current.forEach((orb, index) => {
|
||||
if (orb) moveOrb(orb, index);
|
||||
});
|
||||
|
||||
return () => {
|
||||
animationRefs.current.forEach(id => cancelAnimationFrame(id));
|
||||
};
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<div className="hero-section">
|
||||
{/* Animated background orbs */}
|
||||
<div
|
||||
className="hero-bg-orbs"
|
||||
style={{ opacity: Math.max(0, 1 - scrollProgress * 3) }}
|
||||
>
|
||||
{orbConfigs.map((config, index) => (
|
||||
<div
|
||||
key={config.id}
|
||||
ref={el => { orbRefs.current[index] = el; }}
|
||||
className="hero-orb-random"
|
||||
style={{
|
||||
width: `${config.size}px`,
|
||||
height: `${config.size}px`,
|
||||
background: config.color,
|
||||
left: `${config.initialX}%`,
|
||||
top: `${config.initialY}%`,
|
||||
}}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
|
||||
<div className="hero-content">
|
||||
<img
|
||||
src="/assets/images/ADO2_with Slogan_white.svg"
|
||||
alt="ADO2"
|
||||
className="hero-logo"
|
||||
/>
|
||||
|
||||
<button className="hero-login-btn" onClick={onLogin}>
|
||||
로그인
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{/* Footer Indicator */}
|
||||
<button onClick={onNext} className="scroll-indicator">
|
||||
<span className="scroll-indicator-text">더 알아보기</span>
|
||||
<div className="scroll-indicator-icon">
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1" strokeLinecap="round" strokeLinejoin="round">
|
||||
<path d="M7 10l5 5 5-5" />
|
||||
</svg>
|
||||
</div>
|
||||
</button>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default HeroSection;
|
||||
@@ -1,70 +0,0 @@
|
||||
|
||||
import React from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
interface WelcomeSectionProps {
|
||||
onStartClick?: () => void;
|
||||
onNext?: () => void;
|
||||
}
|
||||
|
||||
const WelcomeSection: React.FC<WelcomeSectionProps> = () => {
|
||||
const { t } = useTranslation();
|
||||
const features = [
|
||||
{
|
||||
id: 1,
|
||||
title: t('landing.welcome.feature1Title'),
|
||||
description: t('landing.welcome.feature1Desc'),
|
||||
iconBg: '#9BCACC',
|
||||
icon: '/assets/images/icon-analysis.svg'
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
title: t('landing.welcome.feature2Title'),
|
||||
description: t('landing.welcome.feature2Desc'),
|
||||
iconBg: '#DFC7FD',
|
||||
icon: '/assets/images/icon-content.svg'
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
title: t('landing.welcome.feature3Title'),
|
||||
description: t('landing.welcome.feature3Desc'),
|
||||
iconBg: '#D4FDF3',
|
||||
icon: '/assets/images/icon-deploy.svg'
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<div className="welcome-section">
|
||||
<div className="welcome-content">
|
||||
{/* Star Icon - Top Center */}
|
||||
<div className="welcome-star">
|
||||
<img src="/assets/images/star-icon.svg" alt="star" />
|
||||
</div>
|
||||
|
||||
{/* Header */}
|
||||
<div className="welcome-header">
|
||||
<h2 className="welcome-title">{t('landing.welcome.title')}</h2>
|
||||
<p className="welcome-subtitle">{t('landing.welcome.subtitle')}</p>
|
||||
</div>
|
||||
|
||||
{/* Feature Cards */}
|
||||
<div className="feature-grid">
|
||||
{features.map((feature) => (
|
||||
<div key={feature.id} className="feature-card">
|
||||
<div className="feature-number-badge">
|
||||
<span>{feature.id}</span>
|
||||
</div>
|
||||
<h3 className="feature-card-title">{feature.title}</h3>
|
||||
<div className="feature-icon-box" style={{ backgroundColor: feature.iconBg }}>
|
||||
<img src={feature.icon} alt={feature.title} className="feature-icon-img" />
|
||||
</div>
|
||||
<p className="feature-card-description">{feature.description}</p>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default WelcomeSection;
|
||||
@@ -1,103 +0,0 @@
|
||||
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { getKakaoLoginUrl, kakaoCallback } from '../../utils/api';
|
||||
|
||||
interface LoginSectionProps {
|
||||
onBack: () => void;
|
||||
onLogin: () => void;
|
||||
}
|
||||
|
||||
const LoginSection: React.FC<LoginSectionProps> = ({ onBack, onLogin }) => {
|
||||
const { t } = useTranslation();
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
|
||||
// 카카오 콜백 처리 (URL에서 code 파라미터 확인)
|
||||
useEffect(() => {
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
const code = urlParams.get('code');
|
||||
|
||||
if (code) {
|
||||
handleKakaoCallback(code);
|
||||
}
|
||||
}, []);
|
||||
|
||||
const handleKakaoCallback = async (code: string) => {
|
||||
setIsLoading(true);
|
||||
setError(null);
|
||||
|
||||
try {
|
||||
await kakaoCallback(code);
|
||||
|
||||
// URL에서 code 파라미터 제거
|
||||
const url = new URL(window.location.href);
|
||||
url.searchParams.delete('code');
|
||||
window.history.replaceState({}, document.title, url.pathname);
|
||||
|
||||
// 로그인 성공
|
||||
onLogin();
|
||||
} catch (err) {
|
||||
console.error('Kakao callback failed:', err);
|
||||
setError(t('login.kakaoLoginFailed'));
|
||||
|
||||
// URL에서 code 파라미터 제거
|
||||
const url = new URL(window.location.href);
|
||||
url.searchParams.delete('code');
|
||||
window.history.replaceState({}, document.title, url.pathname);
|
||||
} finally {
|
||||
setIsLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
const handleKakaoLogin = async () => {
|
||||
setIsLoading(true);
|
||||
setError(null);
|
||||
|
||||
try {
|
||||
const response = await getKakaoLoginUrl();
|
||||
|
||||
// 카카오 로그인 페이지로 리다이렉트
|
||||
window.location.href = response.auth_url;
|
||||
} catch (err) {
|
||||
console.error('Failed to get Kakao login URL:', err);
|
||||
setError(t('login.loginUrlFailed'));
|
||||
setIsLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="login-container">
|
||||
{/* Back Button */}
|
||||
<button onClick={onBack} className="login-back-btn" disabled={isLoading}>
|
||||
<img src="/assets/images/icon-back.svg" alt="Back" />
|
||||
<span>{t('login.back')}</span>
|
||||
</button>
|
||||
|
||||
<div className="login-content">
|
||||
{/* Logo */}
|
||||
<div className="login-logo">
|
||||
<img src="/assets/images/ADO2_with Slogan_white.svg" alt="ADO2" />
|
||||
</div>
|
||||
|
||||
{/* Error Message */}
|
||||
{error && (
|
||||
<div className="login-error">
|
||||
{error}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Kakao Login Button */}
|
||||
<button
|
||||
onClick={handleKakaoLogin}
|
||||
className="btn-kakao"
|
||||
disabled={isLoading}
|
||||
>
|
||||
{isLoading ? t('login.loggingIn') : t('login.kakaoStart')}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default LoginSection;
|
||||
@@ -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];
|
||||
@@ -1,11 +1,13 @@
|
||||
|
||||
import React from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
const SocialConnectError: React.FC = () => {
|
||||
// URL 파라미터 파싱
|
||||
const { t } = useTranslation();
|
||||
|
||||
const searchParams = new URLSearchParams(window.location.search);
|
||||
const platform = searchParams.get('platform') || 'unknown';
|
||||
const errorMessage = searchParams.get('error') || '알 수 없는 오류가 발생했습니다.';
|
||||
const errorMessage = searchParams.get('error') || t('social.connectError.defaultError');
|
||||
|
||||
const platformName = platform === 'youtube' ? 'YouTube' :
|
||||
platform === 'instagram' ? 'Instagram' :
|
||||
@@ -25,19 +27,19 @@ const SocialConnectError: React.FC = () => {
|
||||
<line x1="9" y1="9" x2="15" y2="15" />
|
||||
</svg>
|
||||
</div>
|
||||
<h1 className="social-connect-title">{platformName} 연결 실패</h1>
|
||||
<h1 className="social-connect-title">{t('social.connectError.title', { platform: platformName })}</h1>
|
||||
<p className="social-connect-message">
|
||||
{errorMessage}
|
||||
</p>
|
||||
<p className="social-connect-detail">
|
||||
다시 시도해주세요. 문제가 지속되면 고객 지원에 문의해주세요.
|
||||
{t('social.connectError.detail')}
|
||||
</p>
|
||||
<div className="social-connect-actions">
|
||||
<button
|
||||
onClick={navigateToHome}
|
||||
className="social-connect-button"
|
||||
>
|
||||
다시 시도
|
||||
{t('social.connectError.retry')}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
// 연결된 소셜 계정 정보를 저장하는 localStorage 키
|
||||
const SOCIAL_CONNECTED_KEY = 'castad_social_connected';
|
||||
|
||||
interface ConnectedSocialAccount {
|
||||
@@ -13,9 +13,9 @@ interface ConnectedSocialAccount {
|
||||
}
|
||||
|
||||
const SocialConnectSuccess: React.FC = () => {
|
||||
const { t } = useTranslation();
|
||||
const [countdown, setCountdown] = useState(3);
|
||||
|
||||
// URL 파라미터 파싱
|
||||
const searchParams = new URLSearchParams(window.location.search);
|
||||
const platform = searchParams.get('platform') || 'unknown';
|
||||
const accountId = searchParams.get('account_id') || '';
|
||||
@@ -26,7 +26,6 @@ const SocialConnectSuccess: React.FC = () => {
|
||||
platform === 'instagram' ? 'Instagram' :
|
||||
platform === 'facebook' ? 'Facebook' : platform;
|
||||
|
||||
// 연결된 계정 정보를 localStorage에 저장
|
||||
useEffect(() => {
|
||||
if (platform && accountId) {
|
||||
const connectedAccount: ConnectedSocialAccount = {
|
||||
@@ -42,7 +41,6 @@ const SocialConnectSuccess: React.FC = () => {
|
||||
}, [platform, accountId, channelName, profileImage]);
|
||||
|
||||
const navigateToHome = () => {
|
||||
// URL을 루트로 변경하고 페이지 새로고침하여 generation_flow로 이동
|
||||
window.location.href = '/';
|
||||
};
|
||||
|
||||
@@ -64,7 +62,6 @@ const SocialConnectSuccess: React.FC = () => {
|
||||
return (
|
||||
<div className="social-connect-page">
|
||||
<div className="social-connect-card success">
|
||||
{/* 프로필 이미지가 있으면 표시 */}
|
||||
{profileImage ? (
|
||||
<img
|
||||
src={profileImage}
|
||||
@@ -81,15 +78,13 @@ const SocialConnectSuccess: React.FC = () => {
|
||||
)}
|
||||
|
||||
<h1 className="social-connect-title">
|
||||
{channelName || platformName} 연결 완료
|
||||
{t('social.connectSuccess.title', { name: channelName || platformName })}
|
||||
</h1>
|
||||
|
||||
<p className="social-connect-message">
|
||||
{channelName ? (
|
||||
<>{platformName} 계정이 성공적으로 연결되었습니다.</>
|
||||
) : (
|
||||
<>계정이 성공적으로 연결되었습니다.</>
|
||||
)}
|
||||
{channelName
|
||||
? t('social.connectSuccess.messageWithChannel', { platform: platformName })
|
||||
: t('social.connectSuccess.messageWithoutChannel')}
|
||||
</p>
|
||||
|
||||
{channelName && (
|
||||
@@ -98,20 +93,20 @@ const SocialConnectSuccess: React.FC = () => {
|
||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
|
||||
<polyline points="20 6 9 17 4 12" />
|
||||
</svg>
|
||||
인증됨
|
||||
{t('social.connectSuccess.verified')}
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<p className="social-connect-countdown">
|
||||
{countdown}초 후 자동으로 이동합니다...
|
||||
{t('social.connectSuccess.countdown', { count: countdown })}
|
||||
</p>
|
||||
|
||||
<button
|
||||
onClick={navigateToHome}
|
||||
className="social-connect-button"
|
||||
>
|
||||
지금 이동
|
||||
{t('social.connectSuccess.goNow')}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
const API_URL = import.meta.env.VITE_API_URL || 'http://40.82.133.44';
|
||||
|
||||
const YouTubeOAuthCallback: React.FC = () => {
|
||||
const { t } = useTranslation();
|
||||
const [status, setStatus] = useState<'processing' | 'error'>('processing');
|
||||
const [errorMessage, setErrorMessage] = useState<string>('');
|
||||
|
||||
@@ -18,7 +20,7 @@ const YouTubeOAuthCallback: React.FC = () => {
|
||||
if (error) {
|
||||
console.error('[YouTube OAuth] Error from Google:', error);
|
||||
setStatus('error');
|
||||
setErrorMessage('Google 인증이 취소되었거나 실패했습니다.');
|
||||
setErrorMessage(t('social.youtubeCallback.errorAuthCancelled'));
|
||||
setTimeout(() => {
|
||||
window.location.href = '/social/connect/error?platform=youtube&error=' + encodeURIComponent(error);
|
||||
}, 1500);
|
||||
@@ -28,7 +30,7 @@ const YouTubeOAuthCallback: React.FC = () => {
|
||||
if (!code) {
|
||||
console.error('[YouTube OAuth] No code received');
|
||||
setStatus('error');
|
||||
setErrorMessage('인증 코드를 받지 못했습니다.');
|
||||
setErrorMessage(t('social.youtubeCallback.errorNoCode'));
|
||||
setTimeout(() => {
|
||||
window.location.href = '/social/connect/error?platform=youtube&error=no_code';
|
||||
}, 1500);
|
||||
@@ -46,7 +48,7 @@ const YouTubeOAuthCallback: React.FC = () => {
|
||||
} catch (err) {
|
||||
console.error('[YouTube OAuth] Failed to process callback:', err);
|
||||
setStatus('error');
|
||||
setErrorMessage('YouTube 연결 처리 중 오류가 발생했습니다.');
|
||||
setErrorMessage(t('social.youtubeCallback.errorProcessing'));
|
||||
setTimeout(() => {
|
||||
window.location.href = '/social/connect/error?platform=youtube&error=processing_failed';
|
||||
}, 1500);
|
||||
@@ -66,8 +68,8 @@ const YouTubeOAuthCallback: React.FC = () => {
|
||||
<circle cx="25" cy="25" r="20" fill="none" strokeWidth="4" />
|
||||
</svg>
|
||||
</div>
|
||||
<h1 className="social-connect-title">YouTube 연결 중...</h1>
|
||||
<p className="social-connect-message">잠시만 기다려주세요.</p>
|
||||
<h1 className="social-connect-title">{t('social.youtubeCallback.connecting')}</h1>
|
||||
<p className="social-connect-message">{t('social.youtubeCallback.pleaseWait')}</p>
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
@@ -78,7 +80,7 @@ const YouTubeOAuthCallback: React.FC = () => {
|
||||
<line x1="9" y1="9" x2="15" y2="15" />
|
||||
</svg>
|
||||
</div>
|
||||
<h1 className="social-connect-title">연결 실패</h1>
|
||||
<h1 className="social-connect-title">{t('social.youtubeCallback.failed')}</h1>
|
||||
<p className="social-connect-message">{errorMessage}</p>
|
||||
</>
|
||||
)}
|
||||
|
||||
@@ -0,0 +1,250 @@
|
||||
import React, { useEffect, useRef, useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import {
|
||||
AccommodationSearchItem,
|
||||
InsufficientCreditError,
|
||||
cleanSearchTitle,
|
||||
createSsulJob,
|
||||
searchAccommodation,
|
||||
} from '../../utils/api';
|
||||
import { SCEN_KEYS, Scen, scenDesc, scenName } from './ssulData';
|
||||
|
||||
interface SsulCreateFormProps {
|
||||
/** 생성 요청이 접수되면 호출. 폴링 소유는 GenerationFlow */
|
||||
onSubmitted: (taskId: number, scenario: Scen) => void;
|
||||
/** 크레딧 부족(402) 시 충전 화면으로 유도 */
|
||||
onNeedCredit: () => void;
|
||||
}
|
||||
|
||||
/** 네이버 지도 링크로 보이는가 — 링크면 검색을 건너뛰고 그대로 크롤링한다 */
|
||||
const isNaverUrl = (s: string): boolean =>
|
||||
/naver\.me|map\.naver|place\.naver|^https?:\/\//i.test(s.trim());
|
||||
|
||||
/** 자동완성 디바운스 — ADO2 SearchInputForm 과 동일 */
|
||||
const AUTOCOMPLETE_DEBOUNCE = 300;
|
||||
|
||||
/**
|
||||
* 썰박스 생성 폼. 진입 화면의 썰박스 탭에 들어간다.
|
||||
*
|
||||
* 원본 썰박스의 CreateSheet(바텀시트) 를 시트 크롬 없이 인라인으로 재배치했다.
|
||||
* 시나리오 선택과 업장 검색을 한 화면에 둔다(원본은 2단계로 나뉘어 있었으나,
|
||||
* 여기서는 위저드 스텝퍼가 이미 단계를 보여주므로 중복이다).
|
||||
*
|
||||
* **업장 검색은 ADO2 와 같은 방식**이다(2026-07-31 전환):
|
||||
* 타이핑 중에는 네이버 **검색 API**(`/search/accommodation`, ~0.2초)로 자동완성을
|
||||
* 띄우고, place URL 해석은 제출 후 서버가 한다(ADO2 `_autocomplete_logic` 과 동일).
|
||||
* 이전에는 썰박스 전용 지도 크롤링(`/ssul/search/place`)으로 후보를 받았는데
|
||||
* **17초**가 걸려 UX 가 크게 나빴다.
|
||||
*/
|
||||
const SsulCreateForm: React.FC<SsulCreateFormProps> = ({ onSubmitted, onNeedCredit }) => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const [scenario, setScenario] = useState<Scen | null>(null);
|
||||
const [input, setInput] = useState('');
|
||||
const [results, setResults] = useState<AccommodationSearchItem[]>([]);
|
||||
const [showResults, setShowResults] = useState(false);
|
||||
const [selected, setSelected] = useState<AccommodationSearchItem | null>(null);
|
||||
const [searching, setSearching] = useState(false);
|
||||
const [submitting, setSubmitting] = useState(false);
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
|
||||
const debounceRef = useRef<ReturnType<typeof setTimeout> | null>(null);
|
||||
const boxRef = useRef<HTMLDivElement>(null);
|
||||
|
||||
const isUrl = isNaverUrl(input);
|
||||
// 업장을 골랐거나 링크를 직접 붙여넣었을 때만 생성 가능
|
||||
const canSubmit = !!scenario && (!!selected || isUrl) && !submitting;
|
||||
|
||||
// 바깥 클릭 시 자동완성 닫기
|
||||
useEffect(() => {
|
||||
const onDown = (e: MouseEvent) => {
|
||||
if (boxRef.current && !boxRef.current.contains(e.target as Node)) {
|
||||
setShowResults(false);
|
||||
}
|
||||
};
|
||||
document.addEventListener('mousedown', onDown);
|
||||
return () => document.removeEventListener('mousedown', onDown);
|
||||
}, []);
|
||||
|
||||
// 언마운트 시 대기 중인 디바운스 취소 (setState-after-unmount 방지)
|
||||
useEffect(() => {
|
||||
return () => {
|
||||
if (debounceRef.current) clearTimeout(debounceRef.current);
|
||||
};
|
||||
}, []);
|
||||
|
||||
const runAutocomplete = async (query: string) => {
|
||||
if (query.trim().length < 2 || isNaverUrl(query)) {
|
||||
setResults([]);
|
||||
setShowResults(false);
|
||||
return;
|
||||
}
|
||||
setSearching(true);
|
||||
try {
|
||||
const res = await searchAccommodation(query);
|
||||
const items = res.items || [];
|
||||
setResults(items);
|
||||
setShowResults(items.length > 0);
|
||||
} catch {
|
||||
// 검색 실패는 조용히 넘긴다 — 링크 직접 입력 우회 경로가 있다
|
||||
setResults([]);
|
||||
setShowResults(false);
|
||||
} finally {
|
||||
setSearching(false);
|
||||
}
|
||||
};
|
||||
|
||||
const handleInputChange = (value: string) => {
|
||||
setInput(value);
|
||||
if (selected) setSelected(null);
|
||||
|
||||
if (debounceRef.current) clearTimeout(debounceRef.current);
|
||||
debounceRef.current = setTimeout(() => runAutocomplete(value), AUTOCOMPLETE_DEBOUNCE);
|
||||
};
|
||||
|
||||
const handleSelect = (item: AccommodationSearchItem) => {
|
||||
// 검색 API 는 제목에 <b> 하이라이트 태그를 섞어 준다 — 그대로 쓰면
|
||||
// 업장명·SNS 제목에 태그가 노출된다.
|
||||
const title = cleanSearchTitle(item.title);
|
||||
setInput(title);
|
||||
setSelected({ ...item, title });
|
||||
setShowResults(false);
|
||||
setResults([]);
|
||||
};
|
||||
|
||||
const handleSubmit = async () => {
|
||||
if (!scenario || submitting) return;
|
||||
|
||||
// 고른 가게가 있으면 업장명을 보내고, 서버가 place URL 을 해석한다
|
||||
// (ADO2 와 동일한 경로 — NvMapPwScraper.get_place_id_url).
|
||||
// 링크를 직접 붙여넣었으면 그대로 넘긴다.
|
||||
const payload = selected ? selected.title : input.trim();
|
||||
setSubmitting(true);
|
||||
setError(null);
|
||||
try {
|
||||
const res = await createSsulJob({
|
||||
scenario,
|
||||
input: payload,
|
||||
// 고른 가게가 있을 때만 함께 보낸다. 통합 목록의 업장명 표시와
|
||||
// 업장명·지역 필터가 이 값에 걸린다(링크 직접 입력 시에는 없다).
|
||||
// 도로명·지번을 모두 보낸다. 백엔드가 도로명에서 시/군 추출에 실패하면
|
||||
// 지번으로 재시도한다(한쪽만 보내면 지역이 비는 경우가 생긴다).
|
||||
...(selected && {
|
||||
store_name: selected.title,
|
||||
road_address: selected.roadAddress,
|
||||
address: selected.address,
|
||||
}),
|
||||
});
|
||||
onSubmitted(res.id, scenario);
|
||||
} catch (e) {
|
||||
if (e instanceof InsufficientCreditError) {
|
||||
onNeedCredit();
|
||||
} else {
|
||||
setError(t('ssulbox.error.createFailed'));
|
||||
}
|
||||
} finally {
|
||||
setSubmitting(false);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="ssul-scope ssul-create">
|
||||
{/* ── 1단계: 시나리오 ─────────────────────────────── */}
|
||||
<span className="ssul-create__step">{t('ssulbox.create.step1')}</span>
|
||||
|
||||
<div className="ssul-create__scenarios">
|
||||
{SCEN_KEYS.map((key) => {
|
||||
const active = scenario === key;
|
||||
return (
|
||||
<button
|
||||
key={key}
|
||||
type="button"
|
||||
aria-pressed={active}
|
||||
className={`ssul-scn${active ? ' active' : ''}`}
|
||||
onClick={() => setScenario(key)}
|
||||
>
|
||||
<span className="ssul-scn__name">{t(scenName(key))}</span>
|
||||
<span className="ssul-scn__desc">{t(scenDesc(key))}</span>
|
||||
</button>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
|
||||
{/* ── 2단계: 업장 ─────────────────────────────────── */}
|
||||
{/* 2단계는 약하게 — 시선이 1단계(아직 안 고른 경우)로 먼저 가야 한다 */}
|
||||
<span className="ssul-create__step muted">{t('ssulbox.create.step2')}</span>
|
||||
|
||||
{/* 자동완성 드롭다운을 붙이려면 상대 위치 컨테이너가 필요하다 */}
|
||||
<div className="ssul-create__search" ref={boxRef}>
|
||||
<input
|
||||
className="ssul-create__input"
|
||||
placeholder={t('ssulbox.create.searchPlaceholder')}
|
||||
value={input}
|
||||
onChange={(e) => handleInputChange(e.target.value)}
|
||||
onFocus={() => results.length > 0 && setShowResults(true)}
|
||||
autoComplete="off"
|
||||
/>
|
||||
|
||||
{showResults && (
|
||||
<ul className="ssul-places">
|
||||
{results.map((place, i) => (
|
||||
<li key={`${place.title}-${i}`}>
|
||||
<button type="button" onClick={() => handleSelect(place)}>
|
||||
<b>{cleanSearchTitle(place.title)}</b>
|
||||
<span>{place.roadAddress || place.address}</span>
|
||||
</button>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* 상태 안내 — 한 번에 하나만 보인다 */}
|
||||
{selected ? (
|
||||
<div className="ssul-picked">
|
||||
<div className="ssul-picked__body">
|
||||
<b>{selected.title}</b>
|
||||
<span>{selected.roadAddress || selected.address}</span>
|
||||
</div>
|
||||
</div>
|
||||
) : isUrl ? (
|
||||
<div className="ssul-hint ok">{t('ssulbox.create.hintUrlOk')}</div>
|
||||
) : searching ? (
|
||||
<div className="ssul-hint">{t('ssulbox.create.placeLoading')}</div>
|
||||
) : scenario ? (
|
||||
// 고른 시나리오를 되짚어 준다. 소요 시간은 기본 옵션 실측 전이라
|
||||
// 분 단위를 못 박지 않는다("수 분 내외").
|
||||
<div className="ssul-hint dot">
|
||||
{t('ssulbox.create.hintScenario', { name: t(scenName(scenario)) })}
|
||||
</div>
|
||||
) : (
|
||||
<div className="ssul-hint">{t('ssulbox.create.hintDefault')}</div>
|
||||
)}
|
||||
|
||||
{error && <div className="ssul-hint warn">{error}</div>}
|
||||
|
||||
{/* ── 비용 고지 + 제출 ────────────────────────────── */}
|
||||
{/* 요청 시점에 즉시 차감되므로 누르기 전에 반드시 알린다 */}
|
||||
<div className="ssul-create__cost">
|
||||
<span>{t('ssulbox.create.cost')}</span>
|
||||
<span className="ssul-create__cost-badge">
|
||||
<span className="ssul-create__coin" aria-hidden="true">
|
||||
🪙
|
||||
</span>
|
||||
{t('ssulbox.create.costValue')}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<button
|
||||
type="button"
|
||||
className="ssul-create__submit"
|
||||
disabled={!canSubmit}
|
||||
onClick={handleSubmit}
|
||||
>
|
||||
{submitting ? t('ssulbox.create.submitting') : t('ssulbox.create.submit')}
|
||||
</button>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default SsulCreateForm;
|
||||
@@ -0,0 +1,14 @@
|
||||
import React from 'react';
|
||||
import ContentDetailContent from '../../components/ContentDetailContent';
|
||||
|
||||
interface SsulDetailContentProps {
|
||||
contentId: string;
|
||||
isModal?: boolean;
|
||||
onClose?: () => void;
|
||||
}
|
||||
|
||||
const SsulDetailContent: React.FC<SsulDetailContentProps> = (props) => (
|
||||
<ContentDetailContent {...props} contentType="ssul" />
|
||||
);
|
||||
|
||||
export default SsulDetailContent;
|
||||
@@ -0,0 +1,25 @@
|
||||
import React from 'react';
|
||||
import SsulDetailContent from './SsulDetailContent';
|
||||
|
||||
interface SsulDetailPageProps {
|
||||
contentId: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 썰박스 공유 링크 페이지 (`/ssul/{id}`) — castad `VideoDetailPage` 와 동일한 패턴.
|
||||
* 비로그인도 볼 수 있다(백엔드 `GET /ssul/{id}` 가 인증 선택).
|
||||
*/
|
||||
const SsulDetailPage: React.FC<SsulDetailPageProps> = ({ contentId }) => {
|
||||
const handleBack = () => {
|
||||
localStorage.setItem('castad_active_item', 'ADO2 콘텐츠');
|
||||
window.location.href = '/';
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="video-detail-page">
|
||||
<SsulDetailContent contentId={contentId} isModal={false} onClose={handleBack} />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default SsulDetailPage;
|
||||
@@ -0,0 +1,100 @@
|
||||
import React from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Scen, scenName } from './ssulData';
|
||||
|
||||
/** 생성 잡의 현재 상태. GenerationFlow 가 폴링해 내려준다 */
|
||||
export interface SsulJob {
|
||||
taskId: number;
|
||||
scenario: Scen;
|
||||
status: 'queued' | 'running' | 'done' | 'error';
|
||||
/** 0~4. 0=준비, 4=영상 합성 완료 */
|
||||
step: number;
|
||||
error: string | null;
|
||||
}
|
||||
|
||||
interface SsulMakingContentProps {
|
||||
job: SsulJob | null;
|
||||
/** 실패 후 처음부터 다시 */
|
||||
onRetry: () => void;
|
||||
}
|
||||
|
||||
/** 백엔드 generator 가 뱉는 4단계. `ssul_content.step` 과 1:1 대응 */
|
||||
const TOTAL_STEPS = 4;
|
||||
|
||||
const STEP_LABEL_KEYS = [
|
||||
'ssulbox.making.step1',
|
||||
'ssulbox.making.step2',
|
||||
'ssulbox.making.step3',
|
||||
'ssulbox.making.step4',
|
||||
] as const;
|
||||
|
||||
/**
|
||||
* 썰박스 생성 진행 화면.
|
||||
*
|
||||
* 원본은 SSE 로 진행률만 받아 막대 하나를 그렸지만, castad 는 폴링으로
|
||||
* `step`(0~4)을 받으므로 **지금 무슨 작업 중인지 단계명까지** 보여준다.
|
||||
* 수 분~십수 분이 걸리는 작업이라 진행바만 있으면 멈춘 것처럼 보인다.
|
||||
*
|
||||
* 잡 소유는 GenerationFlow 다. 이 컴포넌트는 표시만 하므로
|
||||
* 사이드바로 이동해 언마운트돼도 폴링이 끊기지 않는다.
|
||||
* 그래서 "백그라운드로 전환" 버튼을 두지 않는다 — 사이드바로 그냥 이동하면
|
||||
* 되고, 버튼이 있으면 마치 전환해야 계속 도는 것처럼 오해를 준다.
|
||||
*/
|
||||
const SsulMakingContent: React.FC<SsulMakingContentProps> = ({ job, onRetry }) => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
if (!job) return null;
|
||||
|
||||
const failed = job.status === 'error';
|
||||
// step 은 "완료한 단계 수"라 진행률은 step/4. queued(0) 면 0%
|
||||
const percent = Math.round((Math.min(job.step, TOTAL_STEPS) / TOTAL_STEPS) * 100);
|
||||
// 진행 중인 단계는 완료 수 + 1 (마지막 단계 완료 시엔 더 올리지 않음)
|
||||
const currentIndex = Math.min(job.step, TOTAL_STEPS - 1);
|
||||
|
||||
return (
|
||||
<div className="ssul-scope ssul-making">
|
||||
<span className="ssul-making__scenario">{t(scenName(job.scenario))}</span>
|
||||
|
||||
{failed ? (
|
||||
<>
|
||||
<h3 className="ssul-making__title warn">{t('ssulbox.making.failTitle')}</h3>
|
||||
<p className="ssul-making__desc">{job.error || t('ssulbox.making.failDefault')}</p>
|
||||
{/* 백엔드가 실패 시 크레딧을 환불한다 — 사용자가 손해 보지 않았음을 알린다 */}
|
||||
<p className="ssul-making__refund">{t('ssulbox.making.refunded')}</p>
|
||||
<button type="button" className="ssul-making__btn" onClick={onRetry}>
|
||||
{t('ssulbox.making.retry')}
|
||||
</button>
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<h3 className="ssul-making__title">{t('ssulbox.making.title')}</h3>
|
||||
|
||||
{/*
|
||||
단계 사이 구간에서는 진행바가 멈춰 있어 고장처럼 보인다.
|
||||
스피너는 "살아 있다"는 신호 전용이라 진행률을 표현하지 않는다.
|
||||
*/}
|
||||
<div className="ssul-making__spinner" aria-hidden="true" />
|
||||
|
||||
<div
|
||||
className="ssul-making__bar"
|
||||
role="progressbar"
|
||||
aria-valuenow={percent}
|
||||
aria-valuemin={0}
|
||||
aria-valuemax={100}
|
||||
>
|
||||
<div className="ssul-making__fill" style={{ width: `${percent}%` }} />
|
||||
</div>
|
||||
|
||||
<div className="ssul-making__meta">
|
||||
<span>{t(STEP_LABEL_KEYS[currentIndex])}</span>
|
||||
<span className="ssul-making__pct">{percent}%</span>
|
||||
</div>
|
||||
|
||||
<p className="ssul-making__desc">{t('ssulbox.making.takesTime')}</p>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default SsulMakingContent;
|
||||
Loaded 100 of 132 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user