Compare commits
1
Commits
main
..
feature-p2v
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3b68845e2d |
No files matched your search
+20
-132
@@ -4,76 +4,15 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
||||||
<title>ADO2 - AI 홍보 영상·썰박스·무빙 포스터 제작</title>
|
<title>ADO2</title>
|
||||||
<!-- ① 페이지 설명 -->
|
<!-- ① 페이지 설명 -->
|
||||||
<meta name="description" content="ADO2에서 매장 정보로 홍보 음악과 영상을 만들고, 썰박스로 스토리형 숏폼을, 포스터 한 장으로 무빙 포스터를 제작하세요. 완성된 콘텐츠를 공유하고 연결된 YouTube 채널에 업로드할 수 있습니다." />
|
<meta name="description" content="ADO2는 ㈜에이아이오투오의 AI 기반 마케팅 자동화 플랫폼입니다. 콘텐츠 제작부터 채널 배포까지 자동으로 처리합니다." />
|
||||||
<link rel="canonical" href="https://ado2.o2osolution.ai/" />
|
|
||||||
<!-- ② Open Graph 제목 -->
|
<!-- ② Open Graph 제목 -->
|
||||||
<meta property="og:title" content="ADO2 - AI 홍보 영상·썰박스·무빙 포스터 제작" />
|
<meta property="og:title" content="ADO2 - AI 마케팅 자동화 플랫폼" />
|
||||||
<!-- ③ Open Graph 설명 -->
|
<!-- ③ Open Graph 설명 -->
|
||||||
<meta property="og:description" content="매장 홍보 영상, 스토리형 숏폼 썰박스, 포스터를 움직이는 무빙 포스터까지. AI 콘텐츠 제작부터 공유와 YouTube 업로드까지 ADO2에서 시작하세요." />
|
<meta property="og:description" content="ADO2는 ㈜에이아이오투오의 AI 기반 마케팅 자동화 플랫폼입니다. 콘텐츠 제작부터 채널 배포까지 자동으로 처리합니다." />
|
||||||
<meta property="og:url" content="https://ado2.o2osolution.ai/" />
|
<meta property="og:url" content="https://ado2.o2osolution.ai" />
|
||||||
<meta property="og:type" content="website" />
|
<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": "sales@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_32.svg" sizes="32x32">
|
||||||
<link rel="icon" type="image/svg+xml" href="/favicon_48.svg" sizes="48x48">
|
<link rel="icon" type="image/svg+xml" href="/favicon_48.svg" sizes="48x48">
|
||||||
<!-- Meta Pixel Code -->
|
<!-- Meta Pixel Code -->
|
||||||
@@ -90,12 +29,6 @@
|
|||||||
fbq('track', 'PageView');
|
fbq('track', 'PageView');
|
||||||
</script>
|
</script>
|
||||||
<!-- End Meta Pixel Code -->
|
<!-- End Meta Pixel Code -->
|
||||||
<!-- 유입 경로 분석 (analytics.webforai.kr) -->
|
|
||||||
<script defer src="https://analytics.webforai.kr/script.js"
|
|
||||||
data-website-id="4bca7237-30b5-4779-979a-ab1624ac7d9d"
|
|
||||||
data-domains="ado2.o2osolution.ai,www.ado2.o2osolution.ai"
|
|
||||||
data-exclude-search="true"
|
|
||||||
data-exclude-hash="true"></script>
|
|
||||||
<script src="https://cdn.tailwindcss.com"></script>
|
<script src="https://cdn.tailwindcss.com"></script>
|
||||||
<script>
|
<script>
|
||||||
tailwind.config = {
|
tailwind.config = {
|
||||||
@@ -103,24 +36,24 @@
|
|||||||
extend: {
|
extend: {
|
||||||
colors: {
|
colors: {
|
||||||
brand: {
|
brand: {
|
||||||
bg: '#011c1e',
|
bg: '#001a1c',
|
||||||
card: '#083336',
|
card: '#003538',
|
||||||
cardHover: '#0b3f42',
|
cardHover: '#004548',
|
||||||
accent: '#94FBE0',
|
accent: '#a6ffea',
|
||||||
purple: '#a855f7',
|
purple: '#a682ff',
|
||||||
purpleHover: '#9333ea',
|
purpleHover: '#9570f0',
|
||||||
text: '#e2e8f0',
|
text: '#d1d5db',
|
||||||
muted: '#94a3b8'
|
muted: '#9ca3af'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<script src="https://t1.kakaocdn.net/kakao_js_sdk/2.7.4/kakao.min.js" crossorigin="anonymous"></script>
|
|
||||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||||
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500;700&family=Playfair+Display:ital,wght@0,700;1,700&display=swap" rel="stylesheet">
|
<link href="https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,700;1,700&display=swap" rel="stylesheet">
|
||||||
|
<link href="https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css" rel="stylesheet">
|
||||||
<style>
|
<style>
|
||||||
:root {
|
:root {
|
||||||
--app-height: 100%;
|
--app-height: 100%;
|
||||||
@@ -130,29 +63,14 @@
|
|||||||
padding: 0;
|
padding: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
background-color: #121a1d;
|
background-color: #001a1c;
|
||||||
}
|
}
|
||||||
body {
|
body {
|
||||||
font-family: 'Noto Sans KR', sans-serif;
|
font-family: 'Pretendard', 'Apple SD Gothic Neo', -apple-system, BlinkMacSystemFont,
|
||||||
|
'Helvetica Neue', 'Segoe UI', system-ui, sans-serif;
|
||||||
-webkit-font-smoothing: antialiased;
|
-webkit-font-smoothing: antialiased;
|
||||||
|
letter-spacing: -0.006em;
|
||||||
}
|
}
|
||||||
/* 앱이 뜨기 전 소개 글 */
|
|
||||||
.seo-intro {
|
|
||||||
max-width: 760px;
|
|
||||||
margin: 0 auto;
|
|
||||||
padding: 48px 24px;
|
|
||||||
color: #e2e8f0;
|
|
||||||
line-height: 1.7;
|
|
||||||
/* 앱이 정상적으로 뜨는 동안에는 보이지 않게 두고, 3초가 지나도 앱이 안 뜨면 보여 준다 */
|
|
||||||
opacity: 0;
|
|
||||||
animation: seoIntroReveal 0.3s ease-out 3s forwards;
|
|
||||||
}
|
|
||||||
@keyframes seoIntroReveal {
|
|
||||||
to { opacity: 1; }
|
|
||||||
}
|
|
||||||
.seo-intro h1 { font-size: 24px; }
|
|
||||||
.seo-intro h2 { font-size: 18px; margin-top: 32px; }
|
|
||||||
.seo-intro a { color: #94FBE0; }
|
|
||||||
.font-serif-logo {
|
.font-serif-logo {
|
||||||
font-family: 'Playfair Display', serif;
|
font-family: 'Playfair Display', serif;
|
||||||
}
|
}
|
||||||
@@ -251,7 +169,6 @@
|
|||||||
animation: slideInFromRight 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
|
animation: slideInFromRight 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<noscript><style>.seo-intro { opacity: 1; animation: none; }</style></noscript>
|
|
||||||
<script type="importmap">
|
<script type="importmap">
|
||||||
{
|
{
|
||||||
"imports": {
|
"imports": {
|
||||||
@@ -267,36 +184,7 @@
|
|||||||
<noscript><img height="1" width="1" style="display:none"
|
<noscript><img height="1" width="1" style="display:none"
|
||||||
src="https://www.facebook.com/tr?id=1572679738203392&ev=PageView&noscript=1"
|
src="https://www.facebook.com/tr?id=1572679738203392&ev=PageView&noscript=1"
|
||||||
/></noscript>
|
/></noscript>
|
||||||
<!-- 앱이 뜨기 전 소개 글: JavaScript를 실행하지 않는 검색 로봇이 읽는다. React가 마운트되면 앱 화면으로 바뀐다. -->
|
<div id="root"></div>
|
||||||
<div id="root">
|
|
||||||
<main class="seo-intro">
|
|
||||||
<h1>ADO2 - AI 홍보 영상·썰박스·무빙 포스터 제작</h1>
|
|
||||||
<p>ADO2는 ㈜에이아이오투오가 운영하는 AI 마케팅 플랫폼입니다. 가게·매장 정보를 분석해 홍보 음악과 영상을 만들고, 완성한 콘텐츠를 다운로드·공유하거나 연결된 YouTube 채널에 업로드할 수 있습니다.</p>
|
|
||||||
<h2>주요 기능</h2>
|
|
||||||
<ul>
|
|
||||||
<li>비즈니스 핵심 정보 분석: 홈페이지, 네이버 지도, 블로그 등의 URL이나 업체명을 입력하면 업체 정보를 자동으로 가져와 분석합니다.</li>
|
|
||||||
<li>홍보 콘텐츠 자동 제작: 분석한 정보를 바탕으로 비즈니스에 맞는 가사, 음악, 자막, 영상을 자동으로 제작합니다.</li>
|
|
||||||
<li>썰박스: 조선왕조, 삼국지, 그리스 신화, 오디세이 시나리오에 업체 셀링포인트를 담은 스토리형 숏폼을 만듭니다.</li>
|
|
||||||
<li>무빙 포스터: 포스터 이미지 한 장에 움직임·나레이션·음악을 더한 9:16 세로형 숏폼을 만듭니다.</li>
|
|
||||||
<li>YouTube 업로드: 완성한 영상을 다운로드하거나 연결된 YouTube 채널에 업로드·예약 게시할 수 있습니다.</li>
|
|
||||||
<li>직접 입력 지원: 네이버 지도에 등록되지 않은 업체도 업체명, 지역, 상세 주소, 업종만 입력하면 영상 제작까지 가능합니다.</li>
|
|
||||||
</ul>
|
|
||||||
<h2>업종별 홍보 영상 안내</h2>
|
|
||||||
<ul>
|
|
||||||
<li><a href="/faq.html#formats">제작 방식 선택·썰박스·무빙 포스터</a></li>
|
|
||||||
<li><a href="/faq.html#basic">소상공인 매장 홍보 영상 기본</a></li>
|
|
||||||
<li><a href="/faq.html#stay">펜션·풀빌라 등 숙박업 홍보</a></li>
|
|
||||||
<li><a href="/faq.html#food">음식점·카페 홍보</a></li>
|
|
||||||
<li><a href="/faq.html#beauty">미용실·네일숍 등 예약형 매장 홍보</a></li>
|
|
||||||
<li><a href="/faq.html#ado2">ADO2 이용 안내</a></li>
|
|
||||||
</ul>
|
|
||||||
<p><a href="/faq.html">ADO2 홍보 영상·썰박스·무빙 포스터 FAQ</a> · <a href="/terms.html">서비스 약관</a> · <a href="/privacy.html">개인정보처리방침</a></p>
|
|
||||||
</main>
|
|
||||||
</div>
|
|
||||||
<noscript>
|
|
||||||
<p>ADO2는 매장 홍보 영상, 스토리형 숏폼 썰박스, 무빙 포스터를 만드는 AI 마케팅 플랫폼입니다. 제작 화면을 이용하려면 JavaScript를 활성화해 주세요.</p>
|
|
||||||
<a href="/faq.html">ADO2 홍보 영상·썰박스·무빙 포스터 FAQ</a>
|
|
||||||
</noscript>
|
|
||||||
<script type="module" src="/src/index.tsx"></script>
|
<script type="module" src="/src/index.tsx"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
@@ -7,7 +7,6 @@
|
|||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
"typecheck": "tsc --noEmit",
|
"typecheck": "tsc --noEmit",
|
||||||
"build": "tsc --noEmit && vite build",
|
"build": "tsc --noEmit && vite build",
|
||||||
"postbuild": "chmod -R a+rX dist",
|
|
||||||
"preview": "vite preview"
|
"preview": "vite preview"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
-482
@@ -1,482 +0,0 @@
|
|||||||
<!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 판교빌딩에 있습니다. 서비스 문의는 이메일 sales@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 판교빌딩에 있습니다. 서비스 문의는 이메일 sales@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>
|
|
||||||
<script>
|
|
||||||
// 방문 통계 비콘(쿠키 없음) — src/utils/visitBeacon.ts 와 같은 규칙. 끄기: localStorage 'ado2.stats.disabled' = '1'
|
|
||||||
(function () {
|
|
||||||
var disabled = false;
|
|
||||||
try { disabled = localStorage.getItem('ado2.stats.disabled') === '1'; }
|
|
||||||
catch (e) { console.warn('[VisitBeacon] localStorage unavailable:', e); }
|
|
||||||
if (disabled || typeof navigator.sendBeacon !== 'function') return;
|
|
||||||
try {
|
|
||||||
navigator.sendBeacon('/api/track/view', JSON.stringify({
|
|
||||||
path: location.pathname,
|
|
||||||
referrer: document.referrer || null,
|
|
||||||
utm_source: new URLSearchParams(location.search).get('utm_source')
|
|
||||||
}));
|
|
||||||
} catch (e) {
|
|
||||||
console.warn('[VisitBeacon] send failed:', e);
|
|
||||||
}
|
|
||||||
})();
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
# 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)
|
|
||||||
|
|
||||||
## 운영사
|
|
||||||
|
|
||||||
- 회사명: ㈜에이아이오투오
|
|
||||||
- 문의: sales@o2o.kr
|
|
||||||
|
|
||||||
## 제공 범위
|
|
||||||
|
|
||||||
- 공연상품페이지 주소로 30초 예고편을 만드는 롱컷은 현재 시작 화면에서 준비 중입니다.
|
|
||||||
- 생성 비용은 썰박스 1크레딧, 무빙 포스터 3크레딧으로 안내됩니다. 실제 생성 전 화면의 비용 안내를 확인하세요.
|
|
||||||
- 삭제되었거나 공개 가능한 상태가 아닌 콘텐츠는 공유 링크로 열람할 수 없습니다.
|
|
||||||
@@ -30,7 +30,6 @@
|
|||||||
<li><strong>YouTube Data API :</strong> AI가 생성한 콘텐츠를 YouTube에 업로드하기 위한 동영상 관리 권한</li>
|
<li><strong>YouTube Data API :</strong> AI가 생성한 콘텐츠를 YouTube에 업로드하기 위한 동영상 관리 권한</li>
|
||||||
<li><strong>YouTube Analytics API :</strong> 채널 및 동영상의 조회수, 시청 시간 등 성과 지표 데이터 (읽기 전용)</li>
|
<li><strong>YouTube Analytics API :</strong> 채널 및 동영상의 조회수, 시청 시간 등 성과 지표 데이터 (읽기 전용)</li>
|
||||||
<li><strong>서비스 이용 과정에서 자동 수집:</strong> 접속 IP, 쿠키, 서비스 이용 기록</li>
|
<li><strong>서비스 이용 과정에서 자동 수집:</strong> 접속 IP, 쿠키, 서비스 이용 기록</li>
|
||||||
<li><strong>쿠키 없는 익명 방문 통계:</strong> 서비스 개선을 위해 방문한 페이지, 유입 경로(직전 페이지의 도메인), 캠페인 링크 표시(utm_source), 기기 종류(PC·모바일·태블릿), 접속 시각을 수집합니다. 방문자를 구분하기 위한 쿠키나 브라우저 저장소는 사용하지 않으며, 접속 IP와 브라우저 정보는 매월 바뀌는 값과 함께 일방향 암호화(해시)한 값으로만 저장하고 IP 원문은 저장하지 않습니다. 이 정보는 방문 통계 산출에만 사용하며 개인을 식별하거나 광고·마케팅 목적으로 사용하지 않습니다.</li>
|
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<h2>2. Google 사용자 데이터의 수집 및 이용 목적</h2>
|
<h2>2. Google 사용자 데이터의 수집 및 이용 목적</h2>
|
||||||
@@ -89,23 +88,5 @@
|
|||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<p style="margin-top:40px; font-size:14px; color:#999;">본 방침은 2026년 5월 7일부터 시행됩니다. 최종 수정일: 2026년 5월 27일</p>
|
<p style="margin-top:40px; font-size:14px; color:#999;">본 방침은 2026년 5월 7일부터 시행됩니다. 최종 수정일: 2026년 5월 27일</p>
|
||||||
<script>
|
|
||||||
// 방문 통계 비콘(쿠키 없음) — src/utils/visitBeacon.ts 와 같은 규칙. 끄기: localStorage 'ado2.stats.disabled' = '1'
|
|
||||||
(function () {
|
|
||||||
var disabled = false;
|
|
||||||
try { disabled = localStorage.getItem('ado2.stats.disabled') === '1'; }
|
|
||||||
catch (e) { console.warn('[VisitBeacon] localStorage unavailable:', e); }
|
|
||||||
if (disabled || typeof navigator.sendBeacon !== 'function') return;
|
|
||||||
try {
|
|
||||||
navigator.sendBeacon('/api/track/view', JSON.stringify({
|
|
||||||
path: location.pathname,
|
|
||||||
referrer: document.referrer || null,
|
|
||||||
utm_source: new URLSearchParams(location.search).get('utm_source')
|
|
||||||
}));
|
|
||||||
} catch (e) {
|
|
||||||
console.warn('[VisitBeacon] send failed:', e);
|
|
||||||
}
|
|
||||||
})();
|
|
||||||
</script>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
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
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
<?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>
|
|
||||||
@@ -62,23 +62,5 @@
|
|||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<p style="margin-top:40px; font-size:14px; color:#999;">본 약관은 2026년 5월 7일부터 시행됩니다.</p>
|
<p style="margin-top:40px; font-size:14px; color:#999;">본 약관은 2026년 5월 7일부터 시행됩니다.</p>
|
||||||
<script>
|
|
||||||
// 방문 통계 비콘(쿠키 없음) — src/utils/visitBeacon.ts 와 같은 규칙. 끄기: localStorage 'ado2.stats.disabled' = '1'
|
|
||||||
(function () {
|
|
||||||
var disabled = false;
|
|
||||||
try { disabled = localStorage.getItem('ado2.stats.disabled') === '1'; }
|
|
||||||
catch (e) { console.warn('[VisitBeacon] localStorage unavailable:', e); }
|
|
||||||
if (disabled || typeof navigator.sendBeacon !== 'function') return;
|
|
||||||
try {
|
|
||||||
navigator.sendBeacon('/api/track/view', JSON.stringify({
|
|
||||||
path: location.pathname,
|
|
||||||
referrer: document.referrer || null,
|
|
||||||
utm_source: new URLSearchParams(location.search).get('utm_source')
|
|
||||||
}));
|
|
||||||
} catch (e) {
|
|
||||||
console.warn('[VisitBeacon] send failed:', e);
|
|
||||||
}
|
|
||||||
})();
|
|
||||||
</script>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
+1
-18
@@ -7,10 +7,8 @@ import SocialConnectError from './pages/Social/SocialConnectError';
|
|||||||
import YouTubeOAuthCallback from './pages/Social/YouTubeOAuthCallback';
|
import YouTubeOAuthCallback from './pages/Social/YouTubeOAuthCallback';
|
||||||
import VideoDetailPage from './components/VideoDetailPage';
|
import VideoDetailPage from './components/VideoDetailPage';
|
||||||
import SsulDetailPage from './pages/Ssulbox/SsulDetailPage';
|
import SsulDetailPage from './pages/Ssulbox/SsulDetailPage';
|
||||||
import P2vDetailPage from './pages/P2v/P2vDetailPage';
|
import { kakaoCallback, saveTokens, storeUtmFromUrl, trackViewContent, trackCompleteRegistration } from './utils/api';
|
||||||
import { API_URL, kakaoCallback, saveTokens, storeUtmFromUrl, trackViewContent, trackCompleteRegistration } from './utils/api';
|
|
||||||
import { clearSessionStorage } from './utils/storageKeys';
|
import { clearSessionStorage } from './utils/storageKeys';
|
||||||
import { isBlockedInDev, sendVisitBeaconFromBrowser } from './utils/visitBeacon';
|
|
||||||
import { NAV } from './components/navItems';
|
import { NAV } from './components/navItems';
|
||||||
|
|
||||||
const SESSION_KEY = 'castad_session_active';
|
const SESSION_KEY = 'castad_session_active';
|
||||||
@@ -29,13 +27,6 @@ const initializeOnNewSession = () => {
|
|||||||
// 앱 시작 시 세션 체크
|
// 앱 시작 시 세션 체크
|
||||||
initializeOnNewSession();
|
initializeOnNewSession();
|
||||||
|
|
||||||
// 방문 통계 비콘 — 콜백 처리가 URL 쿼리를 지우기 전에, 렌더(StrictMode 이중 실행)와 무관하게 페이지당 1번.
|
|
||||||
// 개발 서버에서는 보내지 않는다. 로컬 확인 때만 .env 에 VITE_TRAFFIC_BEACON_IN_DEV=true
|
|
||||||
sendVisitBeaconFromBrowser(
|
|
||||||
API_URL,
|
|
||||||
isBlockedInDev(import.meta.env.DEV, import.meta.env.VITE_TRAFFIC_BEACON_IN_DEV),
|
|
||||||
);
|
|
||||||
|
|
||||||
const App: React.FC = () => {
|
const App: React.FC = () => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [initialTab, setInitialTab] = useState<string>(NAV.HOME);
|
const [initialTab, setInitialTab] = useState<string>(NAV.HOME);
|
||||||
@@ -163,14 +154,6 @@ const App: React.FC = () => {
|
|||||||
return <SsulDetailPage contentId={ssulDetailMatch[1]} />;
|
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) {
|
if (isProcessingCallback) {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ import React, { useRef, useState } from 'react';
|
|||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { API_URL, toggleVideoLike, isLoggedIn } from '../utils/api';
|
import { API_URL, toggleVideoLike, isLoggedIn } from '../utils/api';
|
||||||
import { buildContentShareUrl, tryNativeShare } from '../utils/nativeShare';
|
import { buildContentShareUrl, tryNativeShare } from '../utils/nativeShare';
|
||||||
import { ContentType } from '../types/api';
|
|
||||||
import LoginPromptModal from './LoginPromptModal';
|
import LoginPromptModal from './LoginPromptModal';
|
||||||
|
|
||||||
interface ContentCardSocialActionsProps {
|
interface ContentCardSocialActionsProps {
|
||||||
@@ -10,8 +9,10 @@ interface ContentCardSocialActionsProps {
|
|||||||
/**
|
/**
|
||||||
* 콘텐츠 종류. video.id 와 ssul_content.id 가 겹치므로 좋아요 API 와
|
* 콘텐츠 종류. video.id 와 ssul_content.id 가 겹치므로 좋아요 API 와
|
||||||
* 공유 URL(/video/{id} vs /ssul/{id}) 분기에 반드시 필요하다.
|
* 공유 URL(/video/{id} vs /ssul/{id}) 분기에 반드시 필요하다.
|
||||||
|
* ContentType 전체가 아니라 이 둘로 좁힌 이유: 좋아요·공유 축은 video·ssul
|
||||||
|
* 에만 있다 — P2V 항목은 이 컴포넌트를 렌더하지 않는다(MyContentsPage 분기).
|
||||||
*/
|
*/
|
||||||
contentType?: ContentType;
|
contentType?: 'video' | 'ssul';
|
||||||
storeName: string;
|
storeName: string;
|
||||||
region?: string;
|
region?: string;
|
||||||
title?: string | null;
|
title?: string | null;
|
||||||
@@ -31,7 +32,7 @@ const ContentCardSocialActions: React.FC<ContentCardSocialActionsProps> = ({
|
|||||||
commentCount,
|
commentCount,
|
||||||
initialLikeCount,
|
initialLikeCount,
|
||||||
initialIsLiked = false,
|
initialIsLiked = false,
|
||||||
}: ContentCardSocialActionsProps) => {
|
}) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
const [likeCount, setLikeCount] = useState(initialLikeCount);
|
const [likeCount, setLikeCount] = useState(initialLikeCount);
|
||||||
|
|||||||
@@ -1,489 +0,0 @@
|
|||||||
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;
|
|
||||||
@@ -14,8 +14,6 @@ const Footer: React.FC = () => {
|
|||||||
<a href="https://ado2.o2osolution.ai/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>
|
<span className="footer-link-divider">|</span>
|
||||||
<a href="https://ado2.o2osolution.ai/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>
|
||||||
<span className="footer-link-divider">|</span>
|
|
||||||
<a href="https://ado2.o2osolution.ai/faq.html" rel="noopener noreferrer" className="footer-link">{t('footer.faq')}</a>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="footer-right">
|
<div className="footer-right">
|
||||||
|
|||||||
@@ -0,0 +1,46 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
|
import { P2vLicense } from '../utils/p2vApi';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 스타일 템플릿의 배포 등급 표시.
|
||||||
|
*
|
||||||
|
* 왜 카드마다 붙이나 — 퍼블릭 도메인 명화와 영화 포스터가 한 그리드에 섞여 있어
|
||||||
|
* 페이지 배너로는 **어느 결과물이 공개 가능한지** 구분되지 않는다. 경고 문구는
|
||||||
|
* 실제로 고른 순간에만 띄운다(항상 떠 있으면 아무도 안 읽는다).
|
||||||
|
*/
|
||||||
|
|
||||||
|
const CLASS: Record<P2vLicense, string> = {
|
||||||
|
'public-domain': 'ok',
|
||||||
|
'internal-only': 'warn',
|
||||||
|
// 내부 전용과 색을 나눈다 — 해제 조건도, 책임 주체도 다르다
|
||||||
|
'user-uploaded': 'unknown',
|
||||||
|
};
|
||||||
|
|
||||||
|
export const LicenseBadge: React.FC<{ license: P2vLicense }> = ({ license }) => {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
const variant = CLASS[license] ?? CLASS['internal-only'];
|
||||||
|
return (
|
||||||
|
<span className={`p2v-license p2v-license--${variant}`}>
|
||||||
|
{t(`poster.styling.license.${license}`)}
|
||||||
|
</span>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 내부 전용 템플릿을 고른 순간의 경고 */
|
||||||
|
export const InternalOnlyWarning: React.FC<{ note?: string }> = ({ note }) => {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
return (
|
||||||
|
<div className="p2v-notice p2v-notice--warn">
|
||||||
|
<b>{t('poster.styling.internalOnlyTitle')}</b>
|
||||||
|
{' — '}
|
||||||
|
{note || t('poster.styling.internalOnlyBody')}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 사용자가 올린 레퍼런스 고지 — 남의 저작물일 수 있다 */
|
||||||
|
export const UserReferenceNotice: React.FC = () => {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
return <div className="p2v-notice p2v-notice--unknown">{t('poster.styling.userRefNotice')}</div>;
|
||||||
|
};
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
import React, { useState } from 'react';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
|
import { getP2vKey, setP2vKey } from '../utils/p2vApi';
|
||||||
|
|
||||||
|
interface P2vKeyGateProps {
|
||||||
|
/** 키를 저장한 뒤 호출 — 호출부가 실패했던 요청을 다시 태운다 */
|
||||||
|
onSaved: () => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* P2V 접근 키 입력.
|
||||||
|
*
|
||||||
|
* P2V 웹은 401 에서 `window.prompt` 를 띄우지만(내부 도구라 그걸로 충분했다),
|
||||||
|
* castad 안에서는 제품 화면 한가운데라 시스템 다이얼로그가 튀어나오면 어색하다.
|
||||||
|
* 디자인 시스템 문법(민트 테두리 알림 + pill 입력)으로 인라인 처리한다.
|
||||||
|
*/
|
||||||
|
const P2vKeyGate: React.FC<P2vKeyGateProps> = ({ onSaved }) => {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
const [value, setValue] = useState(getP2vKey());
|
||||||
|
|
||||||
|
const save = () => {
|
||||||
|
if (!value.trim()) return;
|
||||||
|
setP2vKey(value);
|
||||||
|
onSaved();
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="p2v-keygate">
|
||||||
|
<p className="p2v-keygate__title">{t('poster.key.title')}</p>
|
||||||
|
<p className="p2v-keygate__desc">{t('poster.key.desc')}</p>
|
||||||
|
<div className="p2v-keygate__row">
|
||||||
|
<input
|
||||||
|
type="password"
|
||||||
|
className="p2v-input"
|
||||||
|
placeholder={t('poster.key.placeholder')}
|
||||||
|
value={value}
|
||||||
|
onChange={(e) => setValue(e.target.value)}
|
||||||
|
onKeyDown={(e) => e.key === 'Enter' && save()}
|
||||||
|
autoComplete="off"
|
||||||
|
/>
|
||||||
|
<button type="button" className="p2v-btn-mint" disabled={!value.trim()} onClick={save}>
|
||||||
|
{t('poster.key.save')}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default P2vKeyGate;
|
||||||
@@ -1,32 +1,38 @@
|
|||||||
import React, { useEffect } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
import { VideoListItem } from '../types/api';
|
import { VideoListItem } from '../types/api';
|
||||||
import { useOverlayClose } from '../hooks/useOverlayClose';
|
import { useOverlayClose } from '../hooks/useOverlayClose';
|
||||||
import ContentDetailContent from './ContentDetailContent';
|
import { downloadP2vFile } from '../utils/p2vApi';
|
||||||
import { isP2vContent } from '../utils/p2vApi';
|
|
||||||
|
|
||||||
interface P2vViewerModalProps {
|
interface P2vViewerModalProps {
|
||||||
/** null 이면 닫힘 */
|
/** null 이면 닫힘. type 이 p2v_video 면 영상, p2v_poster 면 이미지로 그린다 */
|
||||||
item: VideoListItem | null;
|
item: VideoListItem | null;
|
||||||
onClose: () => void;
|
onClose: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* P2V(무빙 포스터·롱컷) 콘텐츠 재생 모달 — `SsulViewerModal` 과 같은 백드롭 래퍼.
|
* P2V 콘텐츠 상세 뷰어 — ADO2/썰박스 상세(video-detail-*)와 같은 화면 구성.
|
||||||
*
|
*
|
||||||
* 공개 상세 API 를 사용하며 공유 상세 화면과 같은 소셜 기능을 제공한다.
|
* 다른 점 둘:
|
||||||
|
* - 상세 조회 API 를 부르지 않는다. P2V 항목은 목록 응답(result_movie_url =
|
||||||
|
* Blob 공개 URL)만으로 그릴 수 있고, 부를 상세 엔드포인트도 없다.
|
||||||
|
* - 좋아요·댓글·공유가 없다. comment/video_reaction 축이 video·ssul 전용이라
|
||||||
|
* P2V 지원은 별도 확장(DDL) 없이는 불가 — 화면 구성만 맞춘다(2026-08-26 결정).
|
||||||
|
* 대신 그 자리에 다운로드 버튼을 둔다.
|
||||||
*/
|
*/
|
||||||
const P2vViewerModal: React.FC<P2vViewerModalProps> = ({ item, onClose }) => {
|
const P2vViewerModal: React.FC<P2vViewerModalProps> = ({ item, onClose }) => {
|
||||||
|
const { t, i18n } = useTranslation();
|
||||||
|
const [isLandscape, setIsLandscape] = useState(false);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!item) return;
|
if (!item) return;
|
||||||
|
setIsLandscape(false);
|
||||||
const prev = document.body.style.overflow;
|
const prev = document.body.style.overflow;
|
||||||
document.body.style.overflow = 'hidden';
|
document.body.style.overflow = 'hidden';
|
||||||
|
|
||||||
const handleKeyDown = (e: KeyboardEvent) => {
|
const handleKeyDown = (e: KeyboardEvent) => {
|
||||||
if (e.key === 'Escape') onClose();
|
if (e.key === 'Escape') onClose();
|
||||||
};
|
};
|
||||||
document.addEventListener('keydown', handleKeyDown);
|
document.addEventListener('keydown', handleKeyDown);
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
document.body.style.overflow = prev;
|
document.body.style.overflow = prev;
|
||||||
document.removeEventListener('keydown', handleKeyDown);
|
document.removeEventListener('keydown', handleKeyDown);
|
||||||
@@ -35,18 +41,100 @@ const P2vViewerModal: React.FC<P2vViewerModalProps> = ({ item, onClose }) => {
|
|||||||
|
|
||||||
const overlayCloseHandlers = useOverlayClose(onClose);
|
const overlayCloseHandlers = useOverlayClose(onClose);
|
||||||
|
|
||||||
if (!item || !isP2vContent(item.type)) return null;
|
if (!item) return null;
|
||||||
|
|
||||||
|
const isVideo = item.type === 'p2v_video';
|
||||||
|
const fileName = `${item.store_name || 'p2v'}.${isVideo ? 'mp4' : 'png'}`;
|
||||||
|
const formatDate = (iso: string) =>
|
||||||
|
new Date(iso).toLocaleDateString(i18n.language === 'ko' ? 'ko-KR' : 'en-US', {
|
||||||
|
year: 'numeric', month: 'long', day: 'numeric',
|
||||||
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="video-detail-overlay" {...overlayCloseHandlers}>
|
<div className="video-detail-overlay" {...overlayCloseHandlers}>
|
||||||
<div className="video-detail-modal-box" onClick={(e) => e.stopPropagation()}>
|
<div className="video-detail-modal-box" onClick={(e) => e.stopPropagation()}>
|
||||||
<ContentDetailContent
|
<div className="video-detail-modal-content">
|
||||||
key={`${item.type}-${item.video_id}`}
|
{/* 헤더 — 문구는 ADO2/썰박스 상세와 같은 키를 쓴다 (같은 목록에서 열리는 모달) */}
|
||||||
contentId={String(item.video_id)}
|
<div className="video-detail-header">
|
||||||
contentType={item.type}
|
<h2 className="video-detail-modal-title">{t('sidebar.ado2Contents')}</h2>
|
||||||
isModal
|
<button
|
||||||
onClose={onClose}
|
className="video-detail-close-btn"
|
||||||
/>
|
onClick={onClose}
|
||||||
|
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>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="video-detail-body">
|
||||||
|
<div className={`video-detail-content ${isLandscape ? 'landscape' : ''}`}>
|
||||||
|
<div className="video-detail-player-wrap">
|
||||||
|
{isVideo ? (
|
||||||
|
<video
|
||||||
|
src={item.result_movie_url}
|
||||||
|
controls
|
||||||
|
autoPlay
|
||||||
|
playsInline
|
||||||
|
className="video-detail-player"
|
||||||
|
onLoadedMetadata={(e) => {
|
||||||
|
const v = e.currentTarget;
|
||||||
|
setIsLandscape(v.videoWidth > v.videoHeight);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
<img
|
||||||
|
src={item.result_movie_url}
|
||||||
|
alt={item.store_name}
|
||||||
|
className="video-detail-player"
|
||||||
|
style={{ objectFit: 'contain' }}
|
||||||
|
onLoad={(e) => {
|
||||||
|
const im = e.currentTarget;
|
||||||
|
setIsLandscape(im.naturalWidth > im.naturalHeight);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="video-detail-info">
|
||||||
|
<h2 className="video-detail-store">{item.store_name}</h2>
|
||||||
|
<p className="video-detail-date">{formatDate(item.created_at)}</p>
|
||||||
|
|
||||||
|
{/* 좋아요·공유 자리 — P2V 는 그 축이 없어 다운로드를 둔다.
|
||||||
|
교차 출처(Blob) URL 은 <a download> 가 무시되므로 fetch 경유 */}
|
||||||
|
<div style={{ display: 'flex', gap: '8px', flexWrap: 'wrap' }}>
|
||||||
|
<button
|
||||||
|
className="video-detail-copy-btn"
|
||||||
|
onClick={() => downloadP2vFile(item.result_movie_url, fileName)}
|
||||||
|
>
|
||||||
|
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
|
||||||
|
<path d="M12 3v12M12 15l-4-4M12 15l4-4" />
|
||||||
|
<path d="M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2" />
|
||||||
|
</svg>
|
||||||
|
{t('p2vViewer.download')}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* F1 키워드 해시태그 (있을 때만) — 검수 화면과 같은 칩 스타일 재사용 */}
|
||||||
|
{item.hashtags && item.hashtags.length > 0 && (
|
||||||
|
<div className="p2v-scope">
|
||||||
|
<div className="p2v-tags">
|
||||||
|
{item.hashtags.map((kw) => (
|
||||||
|
<span key={kw} className="p2v-tag">#{kw}</span>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{/* 스타일링은 사용한 템플릿 이름을 부가 정보로 (title 자리에 실려온다) */}
|
||||||
|
{item.type === 'p2v_poster' && item.title && (
|
||||||
|
<p className="video-detail-date">{item.title}</p>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,16 +1,21 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { BookIcon, PosterVideoIcon, StorefrontIcon } from './pipelineIcons';
|
import {
|
||||||
|
BookIcon,
|
||||||
|
PaletteIcon,
|
||||||
|
PosterVideoIcon,
|
||||||
|
StorefrontIcon,
|
||||||
|
} from './pipelineIcons';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 생성할 콘텐츠 종류. 진입 화면에서 고르면 이후 플로우 전체가 갈린다.
|
* 생성할 콘텐츠 종류. 진입 화면에서 고르면 이후 플로우 전체가 갈린다.
|
||||||
*
|
*
|
||||||
* poster·playreel 은 castad 백엔드의 `/p2v/*` 를 쓴다(utils/p2vApi.ts, utils/playreelApi.ts).
|
* poster·styling 은 castad 백엔드가 아니라 **P2V 서버(:8010)** 를 쓴다(utils/p2vApi.ts).
|
||||||
*/
|
*/
|
||||||
export type Pipeline = 'ado2' | 'ssul' | 'poster' | 'playreel';
|
export type Pipeline = 'ado2' | 'ssul' | 'poster' | 'styling';
|
||||||
|
|
||||||
/** 유효한 파이프라인 값인가 — localStorage 복원 때 쓴다 */
|
/** 유효한 파이프라인 값인가 — localStorage 복원 때 쓴다 */
|
||||||
export const PIPELINES: readonly Pipeline[] = ['ado2', 'ssul', 'poster', 'playreel'];
|
export const PIPELINES: readonly Pipeline[] = ['ado2', 'ssul', 'poster', 'styling'];
|
||||||
|
|
||||||
export const isPipeline = (value: unknown): value is Pipeline =>
|
export const isPipeline = (value: unknown): value is Pipeline =>
|
||||||
typeof value === 'string' && (PIPELINES as readonly string[]).includes(value);
|
typeof value === 'string' && (PIPELINES as readonly string[]).includes(value);
|
||||||
@@ -24,6 +29,7 @@ const TABS: { id: Pipeline; labelKey: string; Icon: React.FC<{ size?: number }>
|
|||||||
{ id: 'ado2', labelKey: 'pipelineTabs.ado2', Icon: StorefrontIcon },
|
{ id: 'ado2', labelKey: 'pipelineTabs.ado2', Icon: StorefrontIcon },
|
||||||
{ id: 'ssul', labelKey: 'pipelineTabs.ssul', Icon: BookIcon },
|
{ id: 'ssul', labelKey: 'pipelineTabs.ssul', Icon: BookIcon },
|
||||||
{ id: 'poster', labelKey: 'pipelineTabs.poster', Icon: PosterVideoIcon },
|
{ id: 'poster', labelKey: 'pipelineTabs.poster', Icon: PosterVideoIcon },
|
||||||
|
{ id: 'styling', labelKey: 'pipelineTabs.styling', Icon: PaletteIcon },
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -44,13 +50,11 @@ const TABS: { id: Pipeline; labelKey: string; Icon: React.FC<{ size?: number }>
|
|||||||
*/
|
*/
|
||||||
const PipelineTabs: React.FC<PipelineTabsProps> = ({ value, onChange }) => {
|
const PipelineTabs: React.FC<PipelineTabsProps> = ({ value, onChange }) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
// 롱컷은 무빙 포스터 안의 두 번째 갈래라 별도 탭이 없다. 그 안에 있을 때도 무빙 포스터 탭을 켠다
|
|
||||||
const active: Pipeline = value === 'playreel' ? 'poster' : value;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className="pipeline-tabs"
|
className="pipeline-tabs"
|
||||||
data-active={active}
|
data-active={value}
|
||||||
role="tablist"
|
role="tablist"
|
||||||
aria-label={t('pipelineTabs.ariaLabel')}
|
aria-label={t('pipelineTabs.ariaLabel')}
|
||||||
>
|
>
|
||||||
@@ -59,7 +63,7 @@ const PipelineTabs: React.FC<PipelineTabsProps> = ({ value, onChange }) => {
|
|||||||
key={id}
|
key={id}
|
||||||
type="button"
|
type="button"
|
||||||
role="tab"
|
role="tab"
|
||||||
aria-selected={active === id}
|
aria-selected={value === id}
|
||||||
className="pipeline-tab"
|
className="pipeline-tab"
|
||||||
onClick={() => onChange(id)}
|
onClick={() => onChange(id)}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -122,15 +122,6 @@ const SettingsPanel: React.FC<SettingsPanelProps> = ({
|
|||||||
</button>
|
</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
|
<a
|
||||||
href="https://forms.gle/4a8mGebBYtdesvby9"
|
href="https://forms.gle/4a8mGebBYtdesvby9"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
|
|||||||
@@ -2,14 +2,14 @@
|
|||||||
import React, { useState, useEffect, useRef } from 'react';
|
import React, { useState, useEffect, useRef } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { getSocialAccounts, uploadToSocial, waitForUploadComplete, TokenExpiredError, handleSocialReconnect, getAutoSeoYoutube } from '../utils/api';
|
import { getSocialAccounts, uploadToSocial, waitForUploadComplete, TokenExpiredError, handleSocialReconnect, getAutoSeoYoutube } from '../utils/api';
|
||||||
import { SocialAccount, SocialUploadableItem, SocialUploadStatusResponse } from '../types/api';
|
import { SocialAccount, VideoListItem, SocialUploadStatusResponse } from '../types/api';
|
||||||
import UploadProgressModal, { UploadStatus } from './UploadProgressModal';
|
import UploadProgressModal, { UploadStatus } from './UploadProgressModal';
|
||||||
import { useOverlayClose } from '../hooks/useOverlayClose';
|
import { useOverlayClose } from '../hooks/useOverlayClose';
|
||||||
|
|
||||||
interface SocialPostingModalProps {
|
interface SocialPostingModalProps {
|
||||||
isOpen: boolean;
|
isOpen: boolean;
|
||||||
onClose: () => void;
|
onClose: () => void;
|
||||||
video: SocialUploadableItem | null;
|
video: VideoListItem | null;
|
||||||
onGoToCalendar?: () => void;
|
onGoToCalendar?: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -199,8 +199,8 @@ const SocialPostingModal: React.FC<SocialPostingModalProps> = ({
|
|||||||
|
|
||||||
const now = Date.now();
|
const now = Date.now();
|
||||||
const seoKey =
|
const seoKey =
|
||||||
video && video.type !== 'video'
|
video?.type === 'ssul'
|
||||||
? `${video.type}:${video.video_id}`
|
? `ssul:${video.video_id}`
|
||||||
: video?.task_id || null;
|
: video?.task_id || null;
|
||||||
const expired = now - loadedAtRef.current > SEO_CACHE_TTL;
|
const expired = now - loadedAtRef.current > SEO_CACHE_TTL;
|
||||||
|
|
||||||
@@ -244,20 +244,20 @@ const SocialPostingModal: React.FC<SocialPostingModalProps> = ({
|
|||||||
/**
|
/**
|
||||||
* 제목·설명·태그 자동 채움.
|
* 제목·설명·태그 자동 채움.
|
||||||
*
|
*
|
||||||
* `seoKey` 는 호출부가 만든 캐시 키다(ADO2=task_id, 썰박스=`ssul:{id}`, 무빙 포스터=`p2v_video:{id}`).
|
* `seoKey` 는 호출부가 만든 캐시 키다(ADO2=task_id, 썰박스=`ssul:{id}`).
|
||||||
* 백엔드에 보낼 식별자는 종류마다 다르다 — ADO2 는 task_id(UUID), 썰박스·무빙 포스터는
|
* 백엔드에 보낼 식별자는 종류마다 다르다 — ADO2 는 task_id(UUID), 썰박스는
|
||||||
* 콘텐츠 id 문자열이며, 서버가 content_type 으로 어느 테이블을 볼지 가른다.
|
* ssul_content.id 문자열이며, 서버가 content_type 으로 어느 테이블을 볼지 가른다.
|
||||||
*/
|
*/
|
||||||
const loadAutocomplete = async (seoKey: string) => {
|
const loadAutocomplete = async (seoKey: string) => {
|
||||||
if (!video) return;
|
if (!video) return;
|
||||||
const byContentId = video.type !== 'video';
|
const isSsul = video.type === 'ssul';
|
||||||
if (!byContentId && !video.task_id) return;
|
if (!isSsul && !video.task_id) return;
|
||||||
|
|
||||||
setIsLoadingAutoDescription(true);
|
setIsLoadingAutoDescription(true);
|
||||||
try {
|
try {
|
||||||
const requestPayload = {
|
const requestPayload = {
|
||||||
content_type: video.type,
|
content_type: video.type,
|
||||||
task_id: byContentId ? String(video.video_id) : video.task_id,
|
task_id: isSsul ? String(video.video_id) : video.task_id,
|
||||||
};
|
};
|
||||||
const autoSeoResponse = await getAutoSeoYoutube(requestPayload);
|
const autoSeoResponse = await getAutoSeoYoutube(requestPayload);
|
||||||
|
|
||||||
|
|||||||
@@ -57,3 +57,13 @@ export const PosterVideoIcon: React.FC<IconProps> = ({ size = 24 }) => (
|
|||||||
<path d="M10.5 9v6l4.2-3z" fill="currentColor" />
|
<path d="M10.5 9v6l4.2-3z" fill="currentColor" />
|
||||||
</svg>
|
</svg>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/** 포스터 스타일 — 화풍 재해석 → 팔레트 */
|
||||||
|
export const PaletteIcon: React.FC<IconProps> = ({ size = 24 }) => (
|
||||||
|
<svg {...base(size)} aria-hidden="true">
|
||||||
|
<path d="M12 3a9 9 0 1 0 0 18 1.8 1.8 0 0 0 1.35-3 1.8 1.8 0 0 1 1.35-3H17a4 4 0 0 0 4-4c0-4.42-4.03-8-9-8z" />
|
||||||
|
<circle cx="7.6" cy="12.4" r="1.1" fill="currentColor" stroke="none" />
|
||||||
|
<circle cx="9.8" cy="8.2" r="1.1" fill="currentColor" stroke="none" />
|
||||||
|
<circle cx="14.6" cy="7.6" r="1.1" fill="currentColor" stroke="none" />
|
||||||
|
</svg>
|
||||||
|
);
|
||||||
+95
-5
@@ -1,7 +1,97 @@
|
|||||||
import { P2vJob, getPosterJob, isP2vActive } from '../utils/p2vApi';
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
||||||
import { UsePolledJobResult, usePolledJob } from './usePolledJob';
|
import {
|
||||||
|
P2vAuthError,
|
||||||
|
P2vJob,
|
||||||
|
P2vNotFoundError,
|
||||||
|
getPosterJob,
|
||||||
|
getStylingJob,
|
||||||
|
isP2vActive,
|
||||||
|
} from '../utils/p2vApi';
|
||||||
|
|
||||||
/** 무빙 포스터 잡 폴링. 검수 대기·완료·실패에서는 멈춘다 */
|
interface UseP2vJobResult {
|
||||||
export function useP2vJob(id: string | null): UsePolledJobResult<P2vJob> {
|
job: P2vJob | null;
|
||||||
return usePolledJob(id, getPosterJob, isP2vActive);
|
error: string | null;
|
||||||
|
/** 401 — 화면이 접근 키 입력을 띄워야 한다 */
|
||||||
|
authNeeded: boolean;
|
||||||
|
/** 404 — 서버에 없는 잡이다. 호출부가 화면을 처음으로 되돌려야 한다 */
|
||||||
|
notFound: boolean;
|
||||||
|
/** 즉시 1회 조회하고, 멈춰 있던 폴링을 다시 켠다 (승인·재시도 직후에 쓴다) */
|
||||||
|
refresh: () => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
const POLL_INTERVAL = 2500;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* P2V 잡 폴링 훅.
|
||||||
|
*
|
||||||
|
* castad 에는 웹소켓이 없고 썰박스도 폴링(`waitForSsulComplete`)이라 같은 방식을 쓴다.
|
||||||
|
* 다만 썰박스는 "끝날 때까지 기다리는" 재귀 함수인 반면 이쪽은 **중간 상태를 계속
|
||||||
|
* 그려야** 한다 — 검수 게이트에서 멈춰 사용자 입력을 기다리기 때문이다.
|
||||||
|
*
|
||||||
|
* 폴링은 queued/running 에서만 돈다. awaiting_review·done·failed 는 사용자가 뭔가
|
||||||
|
* 하기 전까지 절대 안 바뀌므로 계속 두드리면 서버만 때린다. 승인·재시도 후에는
|
||||||
|
* 호출부가 refresh() 로 다시 켠다.
|
||||||
|
*/
|
||||||
|
export function useP2vJob(kind: 'f1' | 'f2', id: string | null): UseP2vJobResult {
|
||||||
|
const [job, setJob] = useState<P2vJob | null>(null);
|
||||||
|
const [error, setError] = useState<string | null>(null);
|
||||||
|
const [authNeeded, setAuthNeeded] = useState(false);
|
||||||
|
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 = kind === 'f1' ? await getPosterJob(jobId) : await getStylingJob(jobId);
|
||||||
|
setJob(next);
|
||||||
|
setError(null);
|
||||||
|
setAuthNeeded(false);
|
||||||
|
setNotFound(false);
|
||||||
|
if (!isP2vActive(next)) stop();
|
||||||
|
} catch (e) {
|
||||||
|
if (e instanceof P2vAuthError) {
|
||||||
|
setAuthNeeded(true);
|
||||||
|
stop(); // 키가 없으면 계속 두드려봐야 401만 쌓인다
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (e instanceof P2vNotFoundError) {
|
||||||
|
setNotFound(true);
|
||||||
|
stop(); // 없는 잡은 다시 생기지 않는다
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
setError((e as Error).message);
|
||||||
|
}
|
||||||
|
}, [kind, 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, authNeeded, notFound, refresh };
|
||||||
}
|
}
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
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);
|
|
||||||
}
|
|
||||||
@@ -1,87 +0,0 @@
|
|||||||
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 };
|
|
||||||
}
|
|
||||||
+28
-234
@@ -22,7 +22,6 @@
|
|||||||
"loggingOut": "Logging out...",
|
"loggingOut": "Logging out...",
|
||||||
"logout": "Log Out",
|
"logout": "Log Out",
|
||||||
"inquiry": "Feedback",
|
"inquiry": "Feedback",
|
||||||
"faq": "FAQ (Korean)",
|
|
||||||
"login": "Log In",
|
"login": "Log In",
|
||||||
"settings": "Settings"
|
"settings": "Settings"
|
||||||
},
|
},
|
||||||
@@ -32,10 +31,9 @@
|
|||||||
"headquarters": "HQ : Unicorn Lab Daegu A05, 5F, 111 Oksan-ro, Buk-gu, Daegu, Korea",
|
"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",
|
"researchCenter": "R&D : Rooms 504-505 (East), KT Pangyo Bldg, 32 Geumto-ro, Sujeong-gu, Seongnam-si, Gyeonggi-do, Korea",
|
||||||
"phone": "Tel : 070-4260-8310 | 010-2755-6463",
|
"phone": "Tel : 070-4260-8310 | 010-2755-6463",
|
||||||
"email": "Email : sales@o2o.kr",
|
"email": "Email : o2oteam@o2o.kr",
|
||||||
"privacyPolicy": "Privacy Policy",
|
"privacyPolicy": "Privacy Policy",
|
||||||
"termsOfService": "Terms of Service",
|
"termsOfService": "Terms of Service"
|
||||||
"faq": "FAQ"
|
|
||||||
},
|
},
|
||||||
"social": {
|
"social": {
|
||||||
"title": "Social Media Posting",
|
"title": "Social Media Posting",
|
||||||
@@ -602,16 +600,21 @@
|
|||||||
"autocompleteGeneralError": "An error occurred while retrieving business information. Please try again.",
|
"autocompleteGeneralError": "An error occurred while retrieving business information. Please try again.",
|
||||||
"pageComingSoon": "{{page}} page is coming soon."
|
"pageComingSoon": "{{page}} page is coming soon."
|
||||||
},
|
},
|
||||||
|
"p2vViewer": {
|
||||||
|
"download": "Download",
|
||||||
|
"close": "Close"
|
||||||
|
},
|
||||||
"pipelineTabs": {
|
"pipelineTabs": {
|
||||||
"ariaLabel": "Content type",
|
"ariaLabel": "Content type",
|
||||||
"ado2": "ADO2",
|
"ado2": "ADO2",
|
||||||
"ssul": "Ssulbox",
|
"ssul": "Ssulbox",
|
||||||
"poster": "Moving Poster",
|
"poster": "Moving Poster",
|
||||||
|
"styling": "Poster Styling",
|
||||||
"desc": {
|
"desc": {
|
||||||
"ado2": "One business URL becomes a brand analysis, lyrics, music and a short-form video.",
|
"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.",
|
"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.",
|
"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."
|
"styling": "Reinterprets a poster in the visual language of paintings and film posters."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ssulbox": {
|
"ssulbox": {
|
||||||
@@ -633,61 +636,6 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"poster": {
|
"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": {
|
"steps": {
|
||||||
"upload": "Upload",
|
"upload": "Upload",
|
||||||
"analyze": "Analyze",
|
"analyze": "Analyze",
|
||||||
@@ -695,6 +643,12 @@
|
|||||||
"render": "Generate",
|
"render": "Generate",
|
||||||
"done": "Done"
|
"done": "Done"
|
||||||
},
|
},
|
||||||
|
"key": {
|
||||||
|
"title": "P2V access key required",
|
||||||
|
"desc": "The poster pipeline runs on a separate server. The key you enter is stored in this browser.",
|
||||||
|
"placeholder": "P2V_ACCESS_KEY",
|
||||||
|
"save": "Save"
|
||||||
|
},
|
||||||
"dropzone": {
|
"dropzone": {
|
||||||
"cta": "Drop a poster here\nor click to choose",
|
"cta": "Drop a poster here\nor click to choose",
|
||||||
"formats": "JPG · PNG · WEBP · GIF\nNo resolution limit",
|
"formats": "JPG · PNG · WEBP · GIF\nNo resolution limit",
|
||||||
@@ -705,8 +659,6 @@
|
|||||||
"create": {
|
"create": {
|
||||||
"step": "STEP 1 · Upload poster",
|
"step": "STEP 1 · Upload poster",
|
||||||
"namePlaceholder": "Event name (leave blank to auto-detect)",
|
"namePlaceholder": "Event name (leave blank to auto-detect)",
|
||||||
"cost": "Cost",
|
|
||||||
"costValue": "3 credits",
|
|
||||||
"submit": "Create short-form",
|
"submit": "Create short-form",
|
||||||
"submitting": "Uploading…"
|
"submitting": "Uploading…"
|
||||||
},
|
},
|
||||||
@@ -718,7 +670,8 @@
|
|||||||
"phaseAnalyze": "Analyzing",
|
"phaseAnalyze": "Analyzing",
|
||||||
"phaseRender": "Generating",
|
"phaseRender": "Generating",
|
||||||
"failTitle": "Generation failed",
|
"failTitle": "Generation failed",
|
||||||
"refunded": "Generation failed and the credits used were refunded. Please start a new one.",
|
"retry": "Retry",
|
||||||
|
"force": "Ignore and proceed",
|
||||||
"discard": "Start over",
|
"discard": "Start over",
|
||||||
"discardConfirm": "This deletes the job and every generated video, audio and analysis file. This cannot be undone."
|
"discardConfirm": "This deletes the job and every generated video, audio and analysis file. This cannot be undone."
|
||||||
},
|
},
|
||||||
@@ -741,179 +694,20 @@
|
|||||||
"downloadThumb": "Still JPG",
|
"downloadThumb": "Still JPG",
|
||||||
"downloadVideo": "Download MP4",
|
"downloadVideo": "Download MP4",
|
||||||
"new": "Start a new poster"
|
"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": {
|
"styling": {
|
||||||
"input": "Link",
|
"internalScope": "Internal demo only. Because of reference licensing, results must not be published externally or used commercially (public-domain artworks excepted).",
|
||||||
"prepare": "Collect",
|
"templates": "Style templates",
|
||||||
"review": "Review",
|
"myPoster": "My poster",
|
||||||
"render": "Generate",
|
"result": "Result",
|
||||||
"done": "Done"
|
"converting": "Converting (about 30s)",
|
||||||
},
|
"formats": "Output format",
|
||||||
"create": {
|
"submit": "Convert style",
|
||||||
"step": "STEP 1 · Show page link",
|
"license": {
|
||||||
"placeholder": "Paste the show's ticket page link",
|
"public-domain": "Publishable",
|
||||||
"recognized": "Product {{id}} recognized",
|
"internal-only": "Internal only",
|
||||||
"unsupported": "This link is not supported yet. Enter a show ticket page link.",
|
"user-uploaded": "Rights unverified"
|
||||||
"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"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+44
-234
@@ -22,7 +22,6 @@
|
|||||||
"loggingOut": "로그아웃 중...",
|
"loggingOut": "로그아웃 중...",
|
||||||
"logout": "로그아웃",
|
"logout": "로그아웃",
|
||||||
"inquiry": "고객의견",
|
"inquiry": "고객의견",
|
||||||
"faq": "자주 묻는 질문",
|
|
||||||
"login": "로그인",
|
"login": "로그인",
|
||||||
"settings": "설정"
|
"settings": "설정"
|
||||||
},
|
},
|
||||||
@@ -32,10 +31,9 @@
|
|||||||
"headquarters": "본사 : 대구광역시 북구 옥산로 111, 5층 유니콘랩 대구 A05호",
|
"headquarters": "본사 : 대구광역시 북구 옥산로 111, 5층 유니콘랩 대구 A05호",
|
||||||
"researchCenter": "연구소 : 경기 성남시 수정구 금토로 32 (금토동) (주)KT 판교빌딩 504호~505호 (East)",
|
"researchCenter": "연구소 : 경기 성남시 수정구 금토로 32 (금토동) (주)KT 판교빌딩 504호~505호 (East)",
|
||||||
"phone": "전화 : 070-4260-8310 | 010-2755-6463",
|
"phone": "전화 : 070-4260-8310 | 010-2755-6463",
|
||||||
"email": "이메일 : sales@o2o.kr",
|
"email": "이메일 : o2oteam@o2o.kr",
|
||||||
"privacyPolicy": "개인정보처리방침",
|
"privacyPolicy": "개인정보처리방침",
|
||||||
"termsOfService": "서비스 약관",
|
"termsOfService": "서비스 약관"
|
||||||
"faq": "자주 묻는 질문"
|
|
||||||
},
|
},
|
||||||
"social": {
|
"social": {
|
||||||
"title": "소셜 미디어 포스팅",
|
"title": "소셜 미디어 포스팅",
|
||||||
@@ -602,16 +600,21 @@
|
|||||||
"autocompleteGeneralError": "업체 정보 조회 중 오류가 발생했습니다. 다시 시도해주세요.",
|
"autocompleteGeneralError": "업체 정보 조회 중 오류가 발생했습니다. 다시 시도해주세요.",
|
||||||
"pageComingSoon": "{{page}} 페이지 준비 중입니다."
|
"pageComingSoon": "{{page}} 페이지 준비 중입니다."
|
||||||
},
|
},
|
||||||
|
"p2vViewer": {
|
||||||
|
"download": "다운로드",
|
||||||
|
"close": "닫기"
|
||||||
|
},
|
||||||
"pipelineTabs": {
|
"pipelineTabs": {
|
||||||
"ariaLabel": "생성할 콘텐츠 종류",
|
"ariaLabel": "생성할 콘텐츠 종류",
|
||||||
"ado2": "ADO2",
|
"ado2": "ADO2",
|
||||||
"ssul": "썰박스",
|
"ssul": "썰박스",
|
||||||
"poster": "무빙 포스터",
|
"poster": "무빙 포스터",
|
||||||
|
"styling": "포스터 스타일링",
|
||||||
"desc": {
|
"desc": {
|
||||||
"ado2": "업체 URL 하나로 브랜드를 분석해 가사·음악·숏폼 영상까지 자동 제작합니다.",
|
"ado2": "업체 URL 하나로 브랜드를 분석해 가사·음악·숏폼 영상까지 자동 제작합니다.",
|
||||||
"ssul": "유명 역사 스토리에 업체 셀링포인트를 녹여 흥미로운 숏폼 콘텐츠를 만듭니다.",
|
"ssul": "유명 역사 스토리에 업체 셀링포인트를 녹여 흥미로운 숏폼 콘텐츠를 만듭니다.",
|
||||||
"poster": "포스터가 나레이션, 음악, 애니메이션을 추가한 숏폼 콘텐츠로 나옵니다.",
|
"poster": "포스터가 나레이션, 음악, 애니메이션을 추가한 숏폼 콘텐츠로 나옵니다.",
|
||||||
"playreel": "공연 상품페이지 주소 하나로 30초 세로 예고편을 만듭니다. 중요한 순간마다 확인을 요청합니다."
|
"styling": "포스터를 유명 영화의 한 장면 · 고전화 · 영화 포스터 스타일로 재해석합니다."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ssulbox": {
|
"ssulbox": {
|
||||||
@@ -682,61 +685,6 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"poster": {
|
"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": {
|
"steps": {
|
||||||
"upload": "업로드",
|
"upload": "업로드",
|
||||||
"analyze": "분석",
|
"analyze": "분석",
|
||||||
@@ -744,6 +692,12 @@
|
|||||||
"render": "생성",
|
"render": "생성",
|
||||||
"done": "완성"
|
"done": "완성"
|
||||||
},
|
},
|
||||||
|
"key": {
|
||||||
|
"title": "P2V 접근 키가 필요합니다",
|
||||||
|
"desc": "포스터 파이프라인은 별도 서버에서 돕니다. 서버에 설정된 접근 키를 입력하면 이 브라우저에 저장됩니다.",
|
||||||
|
"placeholder": "P2V_ACCESS_KEY",
|
||||||
|
"save": "저장"
|
||||||
|
},
|
||||||
"dropzone": {
|
"dropzone": {
|
||||||
"cta": "포스터를 끌어다 놓거나\n클릭해서 선택",
|
"cta": "포스터를 끌어다 놓거나\n클릭해서 선택",
|
||||||
"formats": "JPG · PNG · WEBP · GIF\n해상도 제한 없음",
|
"formats": "JPG · PNG · WEBP · GIF\n해상도 제한 없음",
|
||||||
@@ -754,8 +708,6 @@
|
|||||||
"create": {
|
"create": {
|
||||||
"step": "STEP 1 · 포스터 업로드",
|
"step": "STEP 1 · 포스터 업로드",
|
||||||
"namePlaceholder": "행사 이름을 입력하세요 (비우면 자동 추출)",
|
"namePlaceholder": "행사 이름을 입력하세요 (비우면 자동 추출)",
|
||||||
"cost": "생성 비용",
|
|
||||||
"costValue": "3 크레딧",
|
|
||||||
"submit": "숏폼 만들기",
|
"submit": "숏폼 만들기",
|
||||||
"submitting": "업로드 중…"
|
"submitting": "업로드 중…"
|
||||||
},
|
},
|
||||||
@@ -767,7 +719,8 @@
|
|||||||
"phaseAnalyze": "분석 중",
|
"phaseAnalyze": "분석 중",
|
||||||
"phaseRender": "생성 중",
|
"phaseRender": "생성 중",
|
||||||
"failTitle": "생성에 실패했어요",
|
"failTitle": "생성에 실패했어요",
|
||||||
"refunded": "생성에 실패해 사용한 크레딧은 환불되었습니다. 새로 만들어 주세요.",
|
"retry": "다시 시도",
|
||||||
|
"force": "무시하고 진행",
|
||||||
"discard": "처음부터",
|
"discard": "처음부터",
|
||||||
"discardConfirm": "이 작업과 만들어진 영상·음성·분석 파일을 모두 지웁니다. 되돌릴 수 없습니다."
|
"discardConfirm": "이 작업과 만들어진 영상·음성·분석 파일을 모두 지웁니다. 되돌릴 수 없습니다."
|
||||||
},
|
},
|
||||||
@@ -823,179 +776,36 @@
|
|||||||
"downloadThumb": "정지 컷 JPG",
|
"downloadThumb": "정지 컷 JPG",
|
||||||
"downloadVideo": "MP4 다운로드",
|
"downloadVideo": "MP4 다운로드",
|
||||||
"new": "새 포스터로 만들기"
|
"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": {
|
"styling": {
|
||||||
"input": "주소 입력",
|
"internalScope": "내부 시연 전용입니다. 레퍼런스 저작권 때문에 결과물의 외부 공개·상업 사용은 금합니다(퍼블릭 도메인 명화 제외).",
|
||||||
"prepare": "수집·분석",
|
"templates": "스타일 템플릿",
|
||||||
"review": "확인",
|
"pickTemplate": "템플릿을 선택하세요",
|
||||||
"render": "생성",
|
"count": "{{count}}종",
|
||||||
"done": "완성"
|
"myRefs": "내 레퍼런스",
|
||||||
},
|
"myRefsHint": "직접 올린 이미지의 화법으로 변환합니다",
|
||||||
"create": {
|
"addRef": "레퍼런스 추가",
|
||||||
"step": "STEP 1 · 공연 상품페이지 주소",
|
"minEdge": "긴 변 {{px}}px 이상 권장",
|
||||||
"placeholder": "공연 상품페이지 주소를 붙여넣으세요",
|
"analyzing": "화풍 분석 중…",
|
||||||
"recognized": "상품 {{id}} 인식됨",
|
"deleteRef": "레퍼런스 삭제",
|
||||||
"unsupported": "아직 지원하지 않는 주소입니다. 공연 상품페이지 주소를 넣어주세요.",
|
"confirmDelete": "이 레퍼런스를 삭제할까요? 되돌릴 수 없습니다.",
|
||||||
"submit": "예고편 만들기",
|
"attribution": "레퍼런스 출처 · {{source}}",
|
||||||
"submitting": "상세페이지 읽는 중…"
|
"myPoster": "내 포스터",
|
||||||
},
|
"result": "결과",
|
||||||
"stages": {
|
"resultAlt": "변환 결과",
|
||||||
"fetch": "수집",
|
"resultHint": "변환 결과가 여기에 표시됩니다",
|
||||||
"split": "섹션",
|
"converting": "변환 중 (30초 안팎)",
|
||||||
"upscale": "화질",
|
"downloadPng": "PNG 다운로드",
|
||||||
"analyze": "요소",
|
"formats": "출력 포맷",
|
||||||
"motion": "연출",
|
"submit": "스타일 변환",
|
||||||
"narration": "나레이션",
|
"license": {
|
||||||
"tts": "음성",
|
"public-domain": "공개 가능",
|
||||||
"bgm": "음악",
|
"internal-only": "내부 전용",
|
||||||
"i2v": "생성",
|
"user-uploaded": "권리 미확인"
|
||||||
"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": {
|
"internalOnlyTitle": "내부 전용 템플릿",
|
||||||
"name": "연출 확인",
|
"internalOnlyBody": "이 레퍼런스로 만든 결과물은 외부 공개·상업 사용을 금합니다.",
|
||||||
"title": "포스터에서 무엇을 움직일지 정해주세요",
|
"userRefNotice": "직접 올린 레퍼런스는 권리를 가진 이미지만 사용하세요. 타인의 저작물을 올려 생긴 문제의 책임은 업로드한 사람에게 있습니다. 결과물은 권리 미확인으로 분류됩니다."
|
||||||
"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,14 +1,12 @@
|
|||||||
import React, { useState, useEffect } from 'react';
|
import React, { useState, useEffect } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { getAllVideos } from '../../utils/api';
|
import { getAllVideos } from '../../utils/api';
|
||||||
import { isP2vContent } from '../../utils/p2vApi';
|
|
||||||
import { VideoListItem } from '../../types/api';
|
import { VideoListItem } from '../../types/api';
|
||||||
import VideoDetailModal from '../../components/VideoDetailModal';
|
import VideoDetailModal from '../../components/VideoDetailModal';
|
||||||
import CitySelectModal from '../../components/CitySelectModal';
|
import CitySelectModal from '../../components/CitySelectModal';
|
||||||
import ContentCardSocialActions from '../../components/ContentCardSocialActions';
|
import ContentCardSocialActions from '../../components/ContentCardSocialActions';
|
||||||
import SsulViewerModal from '../Ssulbox/SsulViewerModal';
|
|
||||||
import P2vViewerModal from '../../components/P2vViewerModal';
|
import P2vViewerModal from '../../components/P2vViewerModal';
|
||||||
import Footer from '../../components/Footer';
|
import SsulViewerModal from '../Ssulbox/SsulViewerModal';
|
||||||
|
|
||||||
interface ADO2ContentsPageProps {
|
interface ADO2ContentsPageProps {
|
||||||
onBack?: () => void;
|
onBack?: () => void;
|
||||||
@@ -20,6 +18,7 @@ const ADO2ContentsPage: React.FC<ADO2ContentsPageProps> = () => {
|
|||||||
// 썰박스는 별도 뷰어를 쓴다 — VideoDetailModal 은 video_id 로 조회하므로
|
// 썰박스는 별도 뷰어를 쓴다 — VideoDetailModal 은 video_id 로 조회하므로
|
||||||
// 썰박스 id 를 넘기면 id 가 겹치는 다른 영상이 열린다.
|
// 썰박스 id 를 넘기면 id 가 겹치는 다른 영상이 열린다.
|
||||||
const [selectedSsul, setSelectedSsul] = useState<VideoListItem | null>(null);
|
const [selectedSsul, setSelectedSsul] = useState<VideoListItem | null>(null);
|
||||||
|
// P2V(무빙 포스터·스타일링)도 별도 뷰어 — 상세 API 없이 목록 데이터로 그린다
|
||||||
const [selectedP2v, setSelectedP2v] = useState<VideoListItem | null>(null);
|
const [selectedP2v, setSelectedP2v] = useState<VideoListItem | null>(null);
|
||||||
const [videos, setVideos] = useState<VideoListItem[]>([]);
|
const [videos, setVideos] = useState<VideoListItem[]>([]);
|
||||||
const [total, setTotal] = useState(0);
|
const [total, setTotal] = useState(0);
|
||||||
@@ -152,23 +151,19 @@ const ADO2ContentsPage: React.FC<ADO2ContentsPageProps> = () => {
|
|||||||
key={`${video.type}-${video.video_id}`}
|
key={`${video.type}-${video.video_id}`}
|
||||||
className="ado2-content-card"
|
className="ado2-content-card"
|
||||||
style={{ cursor: 'pointer' }}
|
style={{ cursor: 'pointer' }}
|
||||||
onClick={() =>
|
onClick={() => {
|
||||||
isP2vContent(video.type)
|
if (video.type === 'ssul') setSelectedSsul(video);
|
||||||
? setSelectedP2v(video)
|
else if (video.type === 'p2v_video' || video.type === 'p2v_poster') setSelectedP2v(video);
|
||||||
: video.type === 'ssul'
|
else handleCardClick(video.video_id);
|
||||||
? setSelectedSsul(video)
|
}}
|
||||||
: handleCardClick(video.video_id)
|
|
||||||
}
|
|
||||||
role="button"
|
role="button"
|
||||||
tabIndex={0}
|
tabIndex={0}
|
||||||
onKeyDown={(e) =>
|
onKeyDown={(e) => {
|
||||||
e.key === 'Enter' &&
|
if (e.key !== 'Enter') return;
|
||||||
(isP2vContent(video.type)
|
if (video.type === 'ssul') setSelectedSsul(video);
|
||||||
? setSelectedP2v(video)
|
else if (video.type === 'p2v_video' || video.type === 'p2v_poster') setSelectedP2v(video);
|
||||||
: video.type === 'ssul'
|
else handleCardClick(video.video_id);
|
||||||
? setSelectedSsul(video)
|
}}
|
||||||
: handleCardClick(video.video_id))
|
|
||||||
}
|
|
||||||
>
|
>
|
||||||
<div className="content-card-thumbnail ado2-gallery-thumbnail-wrap">
|
<div className="content-card-thumbnail ado2-gallery-thumbnail-wrap">
|
||||||
{video.poster_url ? (
|
{video.poster_url ? (
|
||||||
@@ -210,7 +205,10 @@ const ADO2ContentsPage: React.FC<ADO2ContentsPageProps> = () => {
|
|||||||
<h3 className="content-card-title">{video.store_name}</h3>
|
<h3 className="content-card-title">{video.store_name}</h3>
|
||||||
<div className="content-card-meta">
|
<div className="content-card-meta">
|
||||||
<p className="content-card-date">{formatDate(video.created_at)}</p>
|
<p className="content-card-date">{formatDate(video.created_at)}</p>
|
||||||
{/* 모든 콘텐츠는 ID 와 종류를 함께 보내 소셜 반응을 구분한다. */}
|
{/* 좋아요·댓글 API 가 type 을 받으므로 썰박스에도 노출한다.
|
||||||
|
contentType 이 없으면 id 가 겹치는 다른 영상에 반영된다.
|
||||||
|
갤러리(/video/all)에는 video·ssul 만 내려온다 — P2V 는 내 콘텐츠 전용. */}
|
||||||
|
{(video.type === 'video' || video.type === 'ssul') && (
|
||||||
<ContentCardSocialActions
|
<ContentCardSocialActions
|
||||||
videoId={video.video_id}
|
videoId={video.video_id}
|
||||||
contentType={video.type}
|
contentType={video.type}
|
||||||
@@ -222,6 +220,7 @@ const ADO2ContentsPage: React.FC<ADO2ContentsPageProps> = () => {
|
|||||||
initialLikeCount={video.like_count ?? 0}
|
initialLikeCount={video.like_count ?? 0}
|
||||||
initialIsLiked={video.is_liked_by_me}
|
initialIsLiked={video.is_liked_by_me}
|
||||||
/>
|
/>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -249,9 +248,8 @@ const ADO2ContentsPage: React.FC<ADO2ContentsPageProps> = () => {
|
|||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<Footer />
|
|
||||||
|
|
||||||
<SsulViewerModal item={selectedSsul} onClose={() => setSelectedSsul(null)} />
|
<SsulViewerModal item={selectedSsul} onClose={() => setSelectedSsul(null)} />
|
||||||
|
|
||||||
<P2vViewerModal item={selectedP2v} onClose={() => setSelectedP2v(null)} />
|
<P2vViewerModal item={selectedP2v} onClose={() => setSelectedP2v(null)} />
|
||||||
|
|
||||||
{selectedVideoId !== null && (
|
{selectedVideoId !== null && (
|
||||||
|
|||||||
@@ -146,7 +146,7 @@ const AssetManagementContent: React.FC<AssetManagementContentProps> = ({
|
|||||||
const handleDrop = (e: React.DragEvent) => {
|
const handleDrop = (e: React.DragEvent) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
const files = Array.from<File>(e.dataTransfer.files).filter(isImageInputFile);
|
const files = Array.from(e.dataTransfer.files).filter(isImageInputFile);
|
||||||
if (files.length > 0) void runAddImages(files);
|
if (files.length > 0) void runAddImages(files);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -37,13 +37,8 @@ import SsulResultContent from '../Ssulbox/SsulResultContent';
|
|||||||
import PosterMakingContent from '../Poster/PosterMakingContent';
|
import PosterMakingContent from '../Poster/PosterMakingContent';
|
||||||
import PosterReviewContent from '../Poster/PosterReviewContent';
|
import PosterReviewContent from '../Poster/PosterReviewContent';
|
||||||
import PosterResultContent from '../Poster/PosterResultContent';
|
import PosterResultContent from '../Poster/PosterResultContent';
|
||||||
import PlayreelMakingContent from '../P2v/PlayreelMakingContent';
|
|
||||||
import PlayreelGateContent from '../P2v/PlayreelGateContent';
|
|
||||||
import PlayreelResultContent from '../P2v/PlayreelResultContent';
|
|
||||||
import { usePlayreelJob } from '../../hooks/usePlayreelJob';
|
|
||||||
import { GateKey, deletePlayreelJob } from '../../utils/playreelApi';
|
|
||||||
import { useP2vJob } from '../../hooks/useP2vJob';
|
import { useP2vJob } from '../../hooks/useP2vJob';
|
||||||
import { deletePosterJob, isPastReview } from '../../utils/p2vApi';
|
import { deletePosterJob, forcePosterJob, isPastReview, retryPosterJob } from '../../utils/p2vApi';
|
||||||
import {
|
import {
|
||||||
K,
|
K,
|
||||||
clearProjectStorage,
|
clearProjectStorage,
|
||||||
@@ -88,21 +83,6 @@ const SSUL_STEP_INDEX: Record<SsulStep, number> = {
|
|||||||
*/
|
*/
|
||||||
type PosterStep = 'entry' | 'making' | 'review' | 'result';
|
type PosterStep = 'entry' | 'making' | 'review' | 'result';
|
||||||
|
|
||||||
/** 롱컷(Playreel) 진행 단계. 포스터와 같은 이유로 잡 status 에서 파생한다 */
|
|
||||||
type PlayreelStep = 'entry' | 'making' | 'review' | 'result';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 롱컷 스텝퍼 라벨. 검수 게이트가 5번이라 게이트마다 칸을 두면 너무 길어진다 —
|
|
||||||
* 승인 전 준비(수집·분석) / 확인 / 승인 후 생성으로 묶는다.
|
|
||||||
*/
|
|
||||||
const PLAYREEL_STEP_LABELS = [
|
|
||||||
'playreel.steps.input',
|
|
||||||
'playreel.steps.prepare',
|
|
||||||
'playreel.steps.review',
|
|
||||||
'playreel.steps.render',
|
|
||||||
'playreel.steps.done',
|
|
||||||
] as const;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 스텝퍼 라벨. 5단계인 이유는 검수 게이트 **앞뒤가 서로 다른 작업**이기 때문이다 —
|
* 스텝퍼 라벨. 5단계인 이유는 검수 게이트 **앞뒤가 서로 다른 작업**이기 때문이다 —
|
||||||
* 분석(검출·나레이션·모션)과 생성(음성·음악·애니메이션·렌더)을 한 칸에 묶으면
|
* 분석(검출·나레이션·모션)과 생성(음성·음악·애니메이션·렌더)을 한 칸에 묶으면
|
||||||
@@ -235,18 +215,8 @@ const GenerationFlow: React.FC<GenerationFlowProps> = ({
|
|||||||
() => localStorage.getItem(K.POSTER_JOB_ID),
|
() => localStorage.getItem(K.POSTER_JOB_ID),
|
||||||
);
|
);
|
||||||
const [posterBusy, setPosterBusy] = useState(false);
|
const [posterBusy, setPosterBusy] = useState(false);
|
||||||
|
|
||||||
/** 롱컷(Playreel) 잡. 포스터 영상과 같은 규칙으로 서버 status 에서 단계를 파생한다 */
|
|
||||||
const [playreelJobId, setPlayreelJobId] = useState<string | null>(
|
|
||||||
() => localStorage.getItem(K.PLAYREEL_JOB_ID),
|
|
||||||
);
|
|
||||||
const [playreelBusy, setPlayreelBusy] = useState(false);
|
|
||||||
/** 방금 자동 승인한 게이트. 진행 화면이 안내를 보여주고, 새 잡·검수 화면에서 지운다 */
|
|
||||||
const [playreelAutoGate, setPlayreelAutoGate] = useState<GateKey | null>(null);
|
|
||||||
const { job: playreelJob, notFound: playreelNotFound, refresh: refreshPlayreelJob } =
|
|
||||||
usePlayreelJob(pipeline === 'playreel' ? playreelJobId : null);
|
|
||||||
const { job: posterJob, notFound: posterNotFound, refresh: refreshPosterJob } =
|
const { job: posterJob, notFound: posterNotFound, refresh: refreshPosterJob } =
|
||||||
useP2vJob(pipeline === 'poster' ? posterJobId : null);
|
useP2vJob('f1', pipeline === 'poster' ? posterJobId : null);
|
||||||
|
|
||||||
const changePipeline = (next: Pipeline) => {
|
const changePipeline = (next: Pipeline) => {
|
||||||
setPipeline(next);
|
setPipeline(next);
|
||||||
@@ -271,40 +241,12 @@ const GenerationFlow: React.FC<GenerationFlowProps> = ({
|
|||||||
? 4
|
? 4
|
||||||
: isPastReview(posterJob) ? 3 : 1;
|
: isPastReview(posterJob) ? 3 : 1;
|
||||||
|
|
||||||
const playreelStep: PlayreelStep = !playreelJobId
|
|
||||||
? 'entry'
|
|
||||||
: playreelJob?.status === 'awaiting_review' && playreelJob.gate && playreelJob.review
|
|
||||||
? 'review'
|
|
||||||
: playreelJob?.status === 'done'
|
|
||||||
? 'result'
|
|
||||||
: 'making'; // queued · running · failed · 조회 전(null)
|
|
||||||
|
|
||||||
// 자동 승인 안내는 다음 확인 요청(또는 완성)이 오면 낡은 정보라 지운다
|
|
||||||
useEffect(() => {
|
|
||||||
// 승인 직후에도 한동안 같은 게이트가 검수 대기로 보이므로, 다른 게이트일 때만 지운다
|
|
||||||
if (playreelStep === 'result' || (playreelStep === 'review' && playreelJob?.gate !== playreelAutoGate)) {
|
|
||||||
setPlayreelAutoGate(null);
|
|
||||||
}
|
|
||||||
}, [playreelStep, playreelJob?.gate, playreelAutoGate]);
|
|
||||||
|
|
||||||
/** 첫 게이트(연출 확인)를 승인했으면 이후 대기는 '생성' 구간이다 */
|
|
||||||
const playreelPastApproval = playreelJob?.stages.motion?.status !== undefined
|
|
||||||
&& playreelJob.stages.motion.status !== 'idle';
|
|
||||||
|
|
||||||
const playreelStepIndex = playreelStep === 'entry'
|
|
||||||
? 0
|
|
||||||
: playreelStep === 'review'
|
|
||||||
? 2
|
|
||||||
: playreelStep === 'result'
|
|
||||||
? 4
|
|
||||||
: playreelPastApproval ? 3 : 1;
|
|
||||||
|
|
||||||
/** 진입 화면(탭이 보이는 단계) 여부. 파이프라인마다 진입 조건이 다르다 */
|
/** 진입 화면(탭이 보이는 단계) 여부. 파이프라인마다 진입 조건이 다르다 */
|
||||||
const isEntry =
|
const isEntry =
|
||||||
pipeline === 'ado2' ? wizardStep === -2
|
pipeline === 'ado2' ? wizardStep === -2
|
||||||
: pipeline === 'ssul' ? ssulStep === 'entry'
|
: pipeline === 'ssul' ? ssulStep === 'entry'
|
||||||
: pipeline === 'poster' ? posterStep === 'entry'
|
: pipeline === 'poster' ? posterStep === 'entry'
|
||||||
: pipeline === 'playreel' ? playreelStep === 'entry'
|
// 스타일링은 전 과정이 진입 화면 안에서 끝난다 (위저드 없음)
|
||||||
: true;
|
: true;
|
||||||
const [songTaskId, setSongTaskId] = useState<string | null>(savedSongTaskId);
|
const [songTaskId, setSongTaskId] = useState<string | null>(savedSongTaskId);
|
||||||
const [imageTaskId, setImageTaskId] = useState<string | null>(savedImageTaskId);
|
const [imageTaskId, setImageTaskId] = useState<string | null>(savedImageTaskId);
|
||||||
@@ -681,7 +623,43 @@ const GenerationFlow: React.FC<GenerationFlowProps> = ({
|
|||||||
setPosterJobId(null);
|
setPosterJobId(null);
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 실패한 잡과 산출물을 지우고 처음부터. 크레딧은 실패 시점에 이미 환불됐다. 되돌릴 수 없다 */
|
/**
|
||||||
|
* 실패한 스테이지부터 다시. 업로드부터 다시 하지 않는다 —
|
||||||
|
* i2v 실패(모델 큐·크레딧)는 같은 입력으로 재시도하면 자주 통과한다.
|
||||||
|
*/
|
||||||
|
const handlePosterRetry = async () => {
|
||||||
|
if (!posterJobId || posterBusy) return;
|
||||||
|
setPosterBusy(true);
|
||||||
|
try {
|
||||||
|
await retryPosterJob(posterJobId);
|
||||||
|
refreshPosterJob();
|
||||||
|
} catch {
|
||||||
|
// 재시도 요청 자체가 실패해도 잡 상태는 그대로다 — 폴링 결과가 계속 화면을 그린다
|
||||||
|
} finally {
|
||||||
|
setPosterBusy(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 실패를 무시하고 진행 — i2v 게이트 실패에서 이미 생성된 클립으로 렌더를 잇는다.
|
||||||
|
* 재시도와 달리 Higgsfield 재생성 비용이 없다. 무시 불가한 실패는 서버가 409 를 준다.
|
||||||
|
*/
|
||||||
|
const handlePosterForce = async () => {
|
||||||
|
if (!posterJobId || posterBusy) return;
|
||||||
|
setPosterBusy(true);
|
||||||
|
try {
|
||||||
|
await forcePosterJob(posterJobId);
|
||||||
|
refreshPosterJob();
|
||||||
|
} catch (e) {
|
||||||
|
// 409 = 무시할 수 없는 실패(클립 미생성 — 저해상·모션 없음 등).
|
||||||
|
// 조용히 삼키면 버튼이 아무 반응 없어 보여 재클릭만 유발한다 — 사유를 보여준다.
|
||||||
|
alert((e as Error).message);
|
||||||
|
} finally {
|
||||||
|
setPosterBusy(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 실패한 잡과 산출물을 지우고 처음부터. 되돌릴 수 없다 */
|
||||||
const handlePosterDiscard = async () => {
|
const handlePosterDiscard = async () => {
|
||||||
if (!posterJobId || posterBusy) return;
|
if (!posterJobId || posterBusy) return;
|
||||||
if (!window.confirm(t('poster.making.discardConfirm'))) return;
|
if (!window.confirm(t('poster.making.discardConfirm'))) return;
|
||||||
@@ -696,47 +674,13 @@ const GenerationFlow: React.FC<GenerationFlowProps> = ({
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// ── 롱컷 (Playreel) ──────────────────────────────────────────────────
|
|
||||||
|
|
||||||
const handlePlayreelJobStarted = (jobId: string) => {
|
|
||||||
localStorage.setItem(K.PLAYREEL_JOB_ID, jobId);
|
|
||||||
setPlayreelJobId(jobId);
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 잡을 버리고 주소 입력 화면으로. 서버 잡은 남겨둔다(내 콘텐츠에 쓰인다) */
|
|
||||||
const handlePlayreelNew = () => {
|
|
||||||
localStorage.removeItem(K.PLAYREEL_JOB_ID);
|
|
||||||
setPlayreelJobId(null);
|
|
||||||
setPlayreelAutoGate(null);
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 실패한 잡과 산출물을 지우고 처음부터. 크레딧은 실패 시점에 이미 환불됐다. 되돌릴 수 없다 */
|
|
||||||
const handlePlayreelDiscard = async () => {
|
|
||||||
if (!playreelJobId || playreelBusy) return;
|
|
||||||
if (!window.confirm(t('playreel.making.discardConfirm'))) return;
|
|
||||||
setPlayreelBusy(true);
|
|
||||||
try {
|
|
||||||
await deletePlayreelJob(playreelJobId);
|
|
||||||
} catch {
|
|
||||||
// 서버에서 이미 사라졌어도 화면은 처음으로 돌려보내는 게 맞다
|
|
||||||
} finally {
|
|
||||||
setPlayreelBusy(false);
|
|
||||||
handlePlayreelNew();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 사라졌거나 내 것이 아닌 롱컷 잡(404)이면 주소 입력 화면으로 되돌린다 */
|
|
||||||
useEffect(() => {
|
|
||||||
if (playreelNotFound) handlePlayreelNew();
|
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
||||||
}, [playreelNotFound]);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 사라진 잡 정리.
|
* 사라진 잡 정리.
|
||||||
*
|
*
|
||||||
* 복구의 근거는 localStorage 의 id 다. 그런데 그 잡이 지워졌거나 로그인한 사용자의
|
* P2V 에는 "내 활성 잡" 엔드포인트가 없어(단일 팀 키라 사용자 개념이 없다)
|
||||||
* 것이 아니면(백엔드는 남의 잡을 404 로 답한다) id 만 남아 **빈 진행 화면에서
|
* localStorage 의 id 가 복구의 유일한 근거다. 그런데 서버를 재시작하거나 다른
|
||||||
* 영원히 멈춘다**. 404 를 만나면 업로드 화면으로 되돌린다.
|
* 사람이 그 잡을 지우면 id 만 남아 **빈 진행 화면에서 영원히 멈춘다** — 실제로 겪었다.
|
||||||
|
* 404 를 만나면 업로드 화면으로 되돌린다.
|
||||||
*/
|
*/
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (posterNotFound) handlePosterNew();
|
if (posterNotFound) handlePosterNew();
|
||||||
@@ -793,7 +737,6 @@ const GenerationFlow: React.FC<GenerationFlowProps> = ({
|
|||||||
setSsulStep('entry');
|
setSsulStep('entry');
|
||||||
// clearProjectStorage() 가 POSTER_JOB_ID 를 지우므로 state 도 함께 비운다
|
// clearProjectStorage() 가 POSTER_JOB_ID 를 지우므로 state 도 함께 비운다
|
||||||
setPosterJobId(null);
|
setPosterJobId(null);
|
||||||
setPlayreelJobId(null);
|
|
||||||
setSongTaskId(null);
|
setSongTaskId(null);
|
||||||
setImageTaskId(null);
|
setImageTaskId(null);
|
||||||
setAnalysisData(null);
|
setAnalysisData(null);
|
||||||
@@ -821,7 +764,6 @@ const GenerationFlow: React.FC<GenerationFlowProps> = ({
|
|||||||
error={analysisError}
|
error={analysisError}
|
||||||
onSsulJobStarted={handleSsulJobStarted}
|
onSsulJobStarted={handleSsulJobStarted}
|
||||||
onPosterJobStarted={handlePosterJobStarted}
|
onPosterJobStarted={handlePosterJobStarted}
|
||||||
onPlayreelJobStarted={handlePlayreelJobStarted}
|
|
||||||
onGoToPayment={handleGoToPayment}
|
onGoToPayment={handleGoToPayment}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
@@ -843,34 +785,6 @@ const GenerationFlow: React.FC<GenerationFlowProps> = ({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 롱컷도 자체 축으로 진행한다 (단계는 잡 status 파생)
|
|
||||||
if (pipeline === 'playreel') {
|
|
||||||
switch (playreelStep) {
|
|
||||||
case 'review':
|
|
||||||
return playreelJob ? (
|
|
||||||
<PlayreelGateContent
|
|
||||||
key={playreelJob.gate}
|
|
||||||
job={playreelJob}
|
|
||||||
onChanged={refreshPlayreelJob}
|
|
||||||
onAutoApproved={setPlayreelAutoGate}
|
|
||||||
/>
|
|
||||||
) : null;
|
|
||||||
case 'result':
|
|
||||||
return playreelJob ? (
|
|
||||||
<PlayreelResultContent job={playreelJob} onNew={handlePlayreelNew} />
|
|
||||||
) : null;
|
|
||||||
default:
|
|
||||||
return (
|
|
||||||
<PlayreelMakingContent
|
|
||||||
job={playreelJob}
|
|
||||||
onDiscard={handlePlayreelDiscard}
|
|
||||||
busy={playreelBusy}
|
|
||||||
autoApprovedGate={playreelAutoGate}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 포스터 영상도 자체 축으로 진행한다 (단계는 잡 status 파생)
|
// 포스터 영상도 자체 축으로 진행한다 (단계는 잡 status 파생)
|
||||||
if (pipeline === 'poster') {
|
if (pipeline === 'poster') {
|
||||||
switch (posterStep) {
|
switch (posterStep) {
|
||||||
@@ -886,6 +800,8 @@ const GenerationFlow: React.FC<GenerationFlowProps> = ({
|
|||||||
return (
|
return (
|
||||||
<PosterMakingContent
|
<PosterMakingContent
|
||||||
job={posterJob}
|
job={posterJob}
|
||||||
|
onRetry={handlePosterRetry}
|
||||||
|
onForce={handlePosterForce}
|
||||||
onDiscard={handlePosterDiscard}
|
onDiscard={handlePosterDiscard}
|
||||||
busy={posterBusy}
|
busy={posterBusy}
|
||||||
/>
|
/>
|
||||||
@@ -1017,18 +933,6 @@ const GenerationFlow: React.FC<GenerationFlowProps> = ({
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
// 롱컷은 검수 게이트 5번을 준비·확인·생성 3구간으로 묶은 5단계
|
|
||||||
if (pipeline === 'playreel') {
|
|
||||||
return (
|
|
||||||
<div className="wizard-page-container">
|
|
||||||
<WizardStepper
|
|
||||||
steps={PLAYREEL_STEP_LABELS.map((key) => t(key))}
|
|
||||||
currentStep={playreelStepIndex}
|
|
||||||
/>
|
|
||||||
{renderWizardContent()}
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
// 브랜드 분석(0)은 전체 화면 스크롤이지만 스텝퍼는 표시
|
// 브랜드 분석(0)은 전체 화면 스크롤이지만 스텝퍼는 표시
|
||||||
if (wizardStep === 0) {
|
if (wizardStep === 0) {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -2,13 +2,13 @@
|
|||||||
import React, { useState, useEffect, useRef, useCallback } from 'react';
|
import React, { useState, useEffect, useRef, useCallback } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { getVideosList, deleteVideo, deleteSsulContent } from '../../utils/api';
|
import { getVideosList, deleteVideo, deleteSsulContent } from '../../utils/api';
|
||||||
import { deleteP2vContent, isP2vContent } from '../../utils/p2vApi';
|
import { deletePosterJob, deleteStylingJob } from '../../utils/p2vApi';
|
||||||
import { SocialUploadableItem, VideoListItem } from '../../types/api';
|
import { VideoListItem } from '../../types/api';
|
||||||
import SocialPostingModal from '../../components/SocialPostingModal';
|
import SocialPostingModal from '../../components/SocialPostingModal';
|
||||||
import VideoDetailModal from '../../components/VideoDetailModal';
|
import VideoDetailModal from '../../components/VideoDetailModal';
|
||||||
import ContentCardSocialActions from '../../components/ContentCardSocialActions';
|
import ContentCardSocialActions from '../../components/ContentCardSocialActions';
|
||||||
import SsulViewerModal from '../Ssulbox/SsulViewerModal';
|
|
||||||
import P2vViewerModal from '../../components/P2vViewerModal';
|
import P2vViewerModal from '../../components/P2vViewerModal';
|
||||||
|
import SsulViewerModal from '../Ssulbox/SsulViewerModal';
|
||||||
import { useOverlayClose } from '../../hooks/useOverlayClose';
|
import { useOverlayClose } from '../../hooks/useOverlayClose';
|
||||||
|
|
||||||
const VideoPreviewCard: React.FC<{ src: string; className?: string }> = ({ src, className }) => {
|
const VideoPreviewCard: React.FC<{ src: string; className?: string }> = ({ src, className }) => {
|
||||||
@@ -109,11 +109,12 @@ const MyContentsPage: React.FC<MyContentsPageProps> = ({ onNavigate, embedded })
|
|||||||
const [deleteTarget, setDeleteTarget] = useState<VideoListItem | null>(null);
|
const [deleteTarget, setDeleteTarget] = useState<VideoListItem | null>(null);
|
||||||
const [isDeleting, setIsDeleting] = useState(false);
|
const [isDeleting, setIsDeleting] = useState(false);
|
||||||
const [uploadModalOpen, setUploadModalOpen] = useState(false);
|
const [uploadModalOpen, setUploadModalOpen] = useState(false);
|
||||||
const [uploadTargetVideo, setUploadTargetVideo] = useState<SocialUploadableItem | null>(null);
|
const [uploadTargetVideo, setUploadTargetVideo] = useState<VideoListItem | null>(null);
|
||||||
const [selectedVideoId, setSelectedVideoId] = useState<number | null>(null);
|
const [selectedVideoId, setSelectedVideoId] = useState<number | null>(null);
|
||||||
// 썰박스는 별도 뷰어를 쓴다 — VideoDetailModal 은 video_id 로 조회하므로
|
// 썰박스는 별도 뷰어를 쓴다 — VideoDetailModal 은 video_id 로 조회하므로
|
||||||
// 썰박스 id 를 넘기면 id 가 겹치는 다른 영상이 열린다.
|
// 썰박스 id 를 넘기면 id 가 겹치는 다른 영상이 열린다.
|
||||||
const [selectedSsul, setSelectedSsul] = useState<VideoListItem | null>(null);
|
const [selectedSsul, setSelectedSsul] = useState<VideoListItem | null>(null);
|
||||||
|
// P2V(무빙 포스터·스타일링)도 별도 뷰어 — 상세 API 없이 목록 데이터로 그린다
|
||||||
const [selectedP2v, setSelectedP2v] = useState<VideoListItem | null>(null);
|
const [selectedP2v, setSelectedP2v] = useState<VideoListItem | null>(null);
|
||||||
|
|
||||||
const pageSize = 12;
|
const pageSize = 12;
|
||||||
@@ -184,9 +185,7 @@ const MyContentsPage: React.FC<MyContentsPageProps> = ({ onNavigate, embedded })
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleUploadClick = (video: VideoListItem) => {
|
const handleUploadClick = (video: VideoListItem) => {
|
||||||
// 롱컷(p2v_playreel)은 소셜 업로드를 지원하지 않는다(버튼도 막는다). 무빙 포스터는 지원한다.
|
setUploadTargetVideo(video);
|
||||||
if (video.type === 'p2v_playreel') return;
|
|
||||||
setUploadTargetVideo({ ...video, type: video.type });
|
|
||||||
setUploadModalOpen(true);
|
setUploadModalOpen(true);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -206,11 +205,13 @@ const MyContentsPage: React.FC<MyContentsPageProps> = ({ onNavigate, embedded })
|
|||||||
setIsDeleting(true);
|
setIsDeleting(true);
|
||||||
try {
|
try {
|
||||||
// 종류별 삭제 API 가 다르다. deleteVideo 는 Video.id 로 지우므로
|
// 종류별 삭제 API 가 다르다. deleteVideo 는 Video.id 로 지우므로
|
||||||
// 썰박스 id 를 넘기면 id 가 겹치는 엉뚱한 ADO2 영상이 삭제된다.
|
// 썰박스·P2V id 를 넘기면 id 가 겹치는 엉뚱한 ADO2 영상이 삭제된다.
|
||||||
if (isP2vContent(deleteTarget.type)) {
|
if (deleteTarget.type === 'ssul') {
|
||||||
await deleteP2vContent(deleteTarget.type, deleteTarget.video_id);
|
|
||||||
} else if (deleteTarget.type === 'ssul') {
|
|
||||||
await deleteSsulContent(deleteTarget.video_id);
|
await deleteSsulContent(deleteTarget.video_id);
|
||||||
|
} else if (deleteTarget.type === 'p2v_video') {
|
||||||
|
await deletePosterJob(deleteTarget.video_id);
|
||||||
|
} else if (deleteTarget.type === 'p2v_poster') {
|
||||||
|
await deleteStylingJob(deleteTarget.video_id);
|
||||||
} else {
|
} else {
|
||||||
await deleteVideo(deleteTarget.video_id);
|
await deleteVideo(deleteTarget.video_id);
|
||||||
}
|
}
|
||||||
@@ -265,13 +266,11 @@ const MyContentsPage: React.FC<MyContentsPageProps> = ({ onNavigate, embedded })
|
|||||||
<div
|
<div
|
||||||
className="content-card-thumbnail"
|
className="content-card-thumbnail"
|
||||||
style={{ cursor: 'pointer' }}
|
style={{ cursor: 'pointer' }}
|
||||||
onClick={() =>
|
onClick={() => {
|
||||||
isP2vContent(video.type)
|
if (video.type === 'ssul') setSelectedSsul(video);
|
||||||
? setSelectedP2v(video)
|
else if (video.type === 'p2v_video' || video.type === 'p2v_poster') setSelectedP2v(video);
|
||||||
: video.type === 'ssul'
|
else setSelectedVideoId(video.video_id);
|
||||||
? setSelectedSsul(video)
|
}}
|
||||||
: setSelectedVideoId(video.video_id)
|
|
||||||
}
|
|
||||||
>
|
>
|
||||||
{video.poster_url ? (
|
{video.poster_url ? (
|
||||||
<img
|
<img
|
||||||
@@ -312,29 +311,35 @@ const MyContentsPage: React.FC<MyContentsPageProps> = ({ onNavigate, embedded })
|
|||||||
<p className="content-card-date">
|
<p className="content-card-date">
|
||||||
{formatDate(video.created_at)}
|
{formatDate(video.created_at)}
|
||||||
</p>
|
</p>
|
||||||
{/* 모든 콘텐츠는 ID 와 종류를 함께 보내 소셜 반응을 구분한다. */}
|
{/* 좋아요·댓글 API 가 type 을 받으므로 썰박스에도 노출한다.
|
||||||
<ContentCardSocialActions
|
contentType 이 없으면 id 가 겹치는 다른 영상에 반영된다.
|
||||||
videoId={video.video_id}
|
P2V 는 좋아요·댓글 축이 없어(내 콘텐츠 전용) 숨긴다. */}
|
||||||
contentType={video.type}
|
{(video.type === 'video' || video.type === 'ssul') && (
|
||||||
storeName={video.store_name}
|
<ContentCardSocialActions
|
||||||
region={video.region}
|
videoId={video.video_id}
|
||||||
title={video.title}
|
contentType={video.type}
|
||||||
description={video.description}
|
storeName={video.store_name}
|
||||||
commentCount={video.comment_count ?? 0}
|
region={video.region}
|
||||||
initialLikeCount={video.like_count ?? 0}
|
title={video.title}
|
||||||
initialIsLiked={video.is_liked_by_me}
|
description={video.description}
|
||||||
/>
|
commentCount={video.comment_count ?? 0}
|
||||||
|
initialLikeCount={video.like_count ?? 0}
|
||||||
|
initialIsLiked={video.is_liked_by_me}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Action Buttons */}
|
{/* Action Buttons */}
|
||||||
<div className="content-card-actions">
|
<div className="content-card-actions">
|
||||||
{/* SocialPostingModal 이 content_type 을 함께 보내므로
|
{/* SocialPostingModal 이 content_type 을 함께 보내므로
|
||||||
썰박스 항목도 같은 모달로 업로드한다 (social_upload 병합). */}
|
썰박스 항목도 같은 모달로 업로드한다 (social_upload 병합).
|
||||||
|
P2V 는 업로드 파이프라인이 video·ssul 전용이라 SNS 버튼을 숨긴다. */}
|
||||||
<button
|
<button
|
||||||
className="content-download-btn"
|
className="content-download-btn"
|
||||||
onClick={() => handleUploadClick(video)}
|
onClick={() => handleUploadClick(video)}
|
||||||
disabled={!video.result_movie_url || video.type === 'p2v_playreel'}
|
disabled={!video.result_movie_url}
|
||||||
|
style={video.type === 'p2v_video' || video.type === 'p2v_poster' ? { display: 'none' } : undefined}
|
||||||
>
|
>
|
||||||
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" stroke="currentColor" strokeWidth="1.5">
|
<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"/>
|
<path d="M10 13V3M10 3l-4 4M10 3l4 4"/>
|
||||||
@@ -426,6 +431,7 @@ const MyContentsPage: React.FC<MyContentsPageProps> = ({ onNavigate, embedded })
|
|||||||
)}
|
)}
|
||||||
|
|
||||||
<SsulViewerModal item={selectedSsul} onClose={() => setSelectedSsul(null)} />
|
<SsulViewerModal item={selectedSsul} onClose={() => setSelectedSsul(null)} />
|
||||||
|
|
||||||
<P2vViewerModal item={selectedP2v} onClose={() => setSelectedP2v(null)} />
|
<P2vViewerModal item={selectedP2v} onClose={() => setSelectedP2v(null)} />
|
||||||
|
|
||||||
{/* 소셜 미디어 업로드 모달 */}
|
{/* 소셜 미디어 업로드 모달 */}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import React, { useState } from 'react';
|
import React from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { AutocompleteRequest } from '../../utils/api';
|
import { AutocompleteRequest } from '../../utils/api';
|
||||||
import SearchInputForm, { SearchType } from '../../components/SearchInputForm';
|
import SearchInputForm, { SearchType } from '../../components/SearchInputForm';
|
||||||
@@ -6,8 +6,7 @@ import PipelineTabs, { Pipeline } from '../../components/PipelineTabs';
|
|||||||
import SsulCreateForm from '../Ssulbox/SsulCreateForm';
|
import SsulCreateForm from '../Ssulbox/SsulCreateForm';
|
||||||
import { Scen } from '../Ssulbox/ssulData';
|
import { Scen } from '../Ssulbox/ssulData';
|
||||||
import PosterCreateForm from '../Poster/PosterCreateForm';
|
import PosterCreateForm from '../Poster/PosterCreateForm';
|
||||||
import PosterStartChoice from '../Poster/PosterStartChoice';
|
import StylingContent from '../Poster/StylingContent';
|
||||||
import PlayreelCreateForm from '../P2v/PlayreelCreateForm';
|
|
||||||
|
|
||||||
interface UrlInputContentProps {
|
interface UrlInputContentProps {
|
||||||
/** 현재 선택된 파이프라인. 소유자는 GenerationFlow (분기·리셋 때문) */
|
/** 현재 선택된 파이프라인. 소유자는 GenerationFlow (분기·리셋 때문) */
|
||||||
@@ -21,8 +20,6 @@ interface UrlInputContentProps {
|
|||||||
onSsulJobStarted: (taskId: number, scenario: Scen) => void;
|
onSsulJobStarted: (taskId: number, scenario: Scen) => void;
|
||||||
/** 포스터 영상(F1) 생성 요청 접수 시. 폴링 소유는 GenerationFlow */
|
/** 포스터 영상(F1) 생성 요청 접수 시. 폴링 소유는 GenerationFlow */
|
||||||
onPosterJobStarted: (jobId: string) => void;
|
onPosterJobStarted: (jobId: string) => void;
|
||||||
/** 롱컷 생성 요청 접수 시. 폴링 소유는 GenerationFlow */
|
|
||||||
onPlayreelJobStarted: (jobId: string) => void;
|
|
||||||
/** 크레딧 부족 시 충전 화면으로 */
|
/** 크레딧 부족 시 충전 화면으로 */
|
||||||
onGoToPayment: () => void;
|
onGoToPayment: () => void;
|
||||||
}
|
}
|
||||||
@@ -41,28 +38,12 @@ const UrlInputContent: React.FC<UrlInputContentProps> = ({
|
|||||||
error,
|
error,
|
||||||
onSsulJobStarted,
|
onSsulJobStarted,
|
||||||
onPosterJobStarted,
|
onPosterJobStarted,
|
||||||
onPlayreelJobStarted,
|
|
||||||
onGoToPayment,
|
onGoToPayment,
|
||||||
}) => {
|
}) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
/**
|
// 스타일링은 한 화면짜리 도구라 진입 폼보다 넓은 판이 필요하다 (generation-flow.css 참조)
|
||||||
* 무빙 포스터 탭의 시작 화면. 롱컷은 별도 탭이 아니라 이 화면의 두 번째 갈래다 —
|
const wide = pipeline === 'styling';
|
||||||
* '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 = () => {
|
const renderForm = () => {
|
||||||
switch (pipeline) {
|
switch (pipeline) {
|
||||||
@@ -78,26 +59,10 @@ const UrlInputContent: React.FC<UrlInputContentProps> = ({
|
|||||||
case 'ssul':
|
case 'ssul':
|
||||||
return <SsulCreateForm onSubmitted={onSsulJobStarted} onNeedCredit={onGoToPayment} />;
|
return <SsulCreateForm onSubmitted={onSsulJobStarted} onNeedCredit={onGoToPayment} />;
|
||||||
case 'poster':
|
case 'poster':
|
||||||
return posterStart === 'choose' ? (
|
return <PosterCreateForm onSubmitted={onPosterJobStarted} />;
|
||||||
<PosterStartChoice
|
case 'styling':
|
||||||
onPickImage={() => setPosterStart('image')}
|
// 스타일링은 위저드가 아니라 도구다 — 진입 화면 안에서 처음부터 끝까지 끝난다
|
||||||
onPickUrl={() => onPipelineChange('playreel')}
|
return <StylingContent />;
|
||||||
/>
|
|
||||||
) : (
|
|
||||||
<PosterCreateForm
|
|
||||||
onSubmitted={onPosterJobStarted}
|
|
||||||
onNeedCredit={onGoToPayment}
|
|
||||||
onBack={backToChoice}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
case 'playreel':
|
|
||||||
return (
|
|
||||||
<PlayreelCreateForm
|
|
||||||
onSubmitted={onPlayreelJobStarted}
|
|
||||||
onNeedCredit={onGoToPayment}
|
|
||||||
onBack={backToChoice}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
default:
|
default:
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -105,16 +70,16 @@ const UrlInputContent: React.FC<UrlInputContentProps> = ({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="url-input-container">
|
<div className="url-input-container">
|
||||||
<div className="url-input-content">
|
<div className={`url-input-content${wide ? ' url-input-content--wide' : ''}`}>
|
||||||
<div className="url-input-logo">
|
<div className="url-input-logo">
|
||||||
<img src="/assets/images/ADO2_with Slogan_white.svg" alt="ADO2" />
|
<img src="/assets/images/ADO2_with Slogan_white.svg" alt="ADO2" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<PipelineTabs value={pipeline} onChange={handleTabChange} />
|
<PipelineTabs value={pipeline} onChange={onPipelineChange} />
|
||||||
|
|
||||||
{/* 고른 기능이 무엇을 해주는지 한 줄. 탭 라벨(2~6자)만으로는 네 기능의 차이가
|
{/* 고른 기능이 무엇을 해주는지 한 줄. 탭 라벨(2~6자)만으로는 네 기능의 차이가
|
||||||
전달되지 않아 처음 온 사람이 아무거나 눌러본다. STEP 1 위에 둔다. */}
|
전달되지 않아 처음 온 사람이 아무거나 눌러본다. STEP 1 위에 둔다. */}
|
||||||
{!showChoice && <p className="pipeline-desc">{t(`pipelineTabs.desc.${pipeline}`)}</p>}
|
<p className="pipeline-desc">{t(`pipelineTabs.desc.${pipeline}`)}</p>
|
||||||
|
|
||||||
{renderForm()}
|
{renderForm()}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,25 +0,0 @@
|
|||||||
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;
|
|
||||||
@@ -1,52 +0,0 @@
|
|||||||
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;
|
|
||||||
@@ -1,78 +0,0 @@
|
|||||||
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;
|
|
||||||
@@ -1,467 +0,0 @@
|
|||||||
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;
|
|
||||||
@@ -1,88 +0,0 @@
|
|||||||
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;
|
|
||||||
@@ -1,61 +0,0 @@
|
|||||||
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;
|
|
||||||
@@ -1,16 +1,12 @@
|
|||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import PosterDropzone from '../../components/PosterDropzone';
|
import PosterDropzone from '../../components/PosterDropzone';
|
||||||
import { InsufficientCreditError } from '../../utils/api';
|
import P2vKeyGate from '../../components/P2vKeyGate';
|
||||||
import { createPosterJob } from '../../utils/p2vApi';
|
import { P2vAuthError, createPosterJob } from '../../utils/p2vApi';
|
||||||
|
|
||||||
interface PosterCreateFormProps {
|
interface PosterCreateFormProps {
|
||||||
/** 생성 요청이 접수되면 호출. 폴링 소유는 GenerationFlow (썰박스와 같은 규칙) */
|
/** 생성 요청이 접수되면 호출. 폴링 소유는 GenerationFlow (썰박스와 같은 규칙) */
|
||||||
onSubmitted: (jobId: string) => void;
|
onSubmitted: (jobId: string) => void;
|
||||||
/** 크레딧 부족(402) 시 충전 화면으로 유도 */
|
|
||||||
onNeedCredit: () => void;
|
|
||||||
/** 시작 선택 화면으로 돌아간다 */
|
|
||||||
onBack: () => void;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -19,13 +15,14 @@ interface PosterCreateFormProps {
|
|||||||
* 행사명은 비워도 된다 — 서버가 포스터에서 뽑는다. 다만 뽑은 값이 틀릴 수 있어
|
* 행사명은 비워도 된다 — 서버가 포스터에서 뽑는다. 다만 뽑은 값이 틀릴 수 있어
|
||||||
* 검수 단계에서 다시 고칠 기회를 준다(메타태그는 아카이브에 영구 저장된다).
|
* 검수 단계에서 다시 고칠 기회를 준다(메타태그는 아카이브에 영구 저장된다).
|
||||||
*/
|
*/
|
||||||
const PosterCreateForm: React.FC<PosterCreateFormProps> = ({ onSubmitted, onNeedCredit, onBack }) => {
|
const PosterCreateForm: React.FC<PosterCreateFormProps> = ({ onSubmitted }) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
const [file, setFile] = useState<File | null>(null);
|
const [file, setFile] = useState<File | null>(null);
|
||||||
const [name, setName] = useState('');
|
const [name, setName] = useState('');
|
||||||
const [submitting, setSubmitting] = useState(false);
|
const [submitting, setSubmitting] = useState(false);
|
||||||
const [error, setError] = useState<string | null>(null);
|
const [error, setError] = useState<string | null>(null);
|
||||||
|
const [authNeeded, setAuthNeeded] = useState(false);
|
||||||
|
|
||||||
const submit = async () => {
|
const submit = async () => {
|
||||||
if (!file || submitting) return;
|
if (!file || submitting) return;
|
||||||
@@ -35,8 +32,8 @@ const PosterCreateForm: React.FC<PosterCreateFormProps> = ({ onSubmitted, onNeed
|
|||||||
const { id } = await createPosterJob(file, name.trim());
|
const { id } = await createPosterJob(file, name.trim());
|
||||||
onSubmitted(id);
|
onSubmitted(id);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (e instanceof InsufficientCreditError) {
|
if (e instanceof P2vAuthError) {
|
||||||
onNeedCredit();
|
setAuthNeeded(true);
|
||||||
} else {
|
} else {
|
||||||
setError((e as Error).message);
|
setError((e as Error).message);
|
||||||
}
|
}
|
||||||
@@ -44,10 +41,16 @@ const PosterCreateForm: React.FC<PosterCreateFormProps> = ({ onSubmitted, onNeed
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (authNeeded) {
|
||||||
|
return (
|
||||||
|
<div className="p2v-scope p2v-create">
|
||||||
|
<P2vKeyGate onSaved={() => { setAuthNeeded(false); submit(); }} />
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="p2v-scope p2v-create">
|
<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>
|
<span className="p2v-step">{t('poster.create.step')}</span>
|
||||||
|
|
||||||
<PosterDropzone file={file} onFile={setFile} />
|
<PosterDropzone file={file} onFile={setFile} />
|
||||||
@@ -61,14 +64,6 @@ const PosterCreateForm: React.FC<PosterCreateFormProps> = ({ onSubmitted, onNeed
|
|||||||
|
|
||||||
{error && <div className="p2v-note warn">{error}</div>}
|
{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
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className="p2v-btn-cta"
|
className="p2v-btn-cta"
|
||||||
|
|||||||
@@ -4,7 +4,11 @@ import { P2vJob, isPastReview, p2vProgress } from '../../utils/p2vApi';
|
|||||||
|
|
||||||
interface PosterMakingContentProps {
|
interface PosterMakingContentProps {
|
||||||
job: P2vJob | null;
|
job: P2vJob | null;
|
||||||
/** 실패한 잡을 버리고 처음부터. 실패하면 크레딧이 환불되므로 같은 잡을 다시 돌리지 않는다 */
|
/** 실패 시 같은 잡을 다시 태운다 (업로드부터 다시 하지 않는다) */
|
||||||
|
onRetry: () => void;
|
||||||
|
/** 실패를 무시하고 이미 생성된 클립으로 렌더를 잇는다 (i2v 게이트 실패 전용) */
|
||||||
|
onForce: () => void;
|
||||||
|
/** 실패한 잡을 버리고 처음부터 */
|
||||||
onDiscard: () => void;
|
onDiscard: () => void;
|
||||||
busy: boolean;
|
busy: boolean;
|
||||||
}
|
}
|
||||||
@@ -19,13 +23,18 @@ interface PosterMakingContentProps {
|
|||||||
* 스피너가 "살아 있다"를 따로 알린다(썰박스 SsulMakingContent 와 같은 판단).
|
* 스피너가 "살아 있다"를 따로 알린다(썰박스 SsulMakingContent 와 같은 판단).
|
||||||
*/
|
*/
|
||||||
const PosterMakingContent: React.FC<PosterMakingContentProps> = ({
|
const PosterMakingContent: React.FC<PosterMakingContentProps> = ({
|
||||||
job, onDiscard, busy,
|
job, onRetry, onForce, onDiscard, busy,
|
||||||
}) => {
|
}) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
if (!job) return null;
|
if (!job) return null;
|
||||||
|
|
||||||
const failed = job.status === 'failed';
|
const failed = job.status === 'failed';
|
||||||
|
// "무시하고 진행"은 i2v 게이트 실패(클립은 이미 생성됨)에서만 의미가 있다.
|
||||||
|
// 다른 스테이지 실패는 이어갈 산출물이 없어 서버도 409 로 거절한다.
|
||||||
|
// 개발자 모드(vite dev) 전용 — 품질 게이트를 일반 사용자가 우회하면 훼손된
|
||||||
|
// 제목의 영상이 그대로 나가므로, 프로덕션 빌드에서는 버튼 자체를 뺀다.
|
||||||
|
const canForce = import.meta.env.DEV && failed && job.error?.stage === 'i2v';
|
||||||
const percent = p2vProgress(job);
|
const percent = p2vProgress(job);
|
||||||
const past = isPastReview(job);
|
const past = isPastReview(job);
|
||||||
|
|
||||||
@@ -48,11 +57,18 @@ const PosterMakingContent: React.FC<PosterMakingContentProps> = ({
|
|||||||
{job.error?.detail && (
|
{job.error?.detail && (
|
||||||
<pre className="p2v-errorbox">{job.error.detail}</pre>
|
<pre className="p2v-errorbox">{job.error.detail}</pre>
|
||||||
)}
|
)}
|
||||||
<p className="p2v-making__desc">{t('poster.making.refunded')}</p>
|
|
||||||
<div className="p2v-making__actions">
|
<div className="p2v-making__actions">
|
||||||
<button type="button" className="p2v-btn-mint" disabled={busy} onClick={onDiscard}>
|
<button type="button" className="p2v-btn-outline" disabled={busy} onClick={onDiscard}>
|
||||||
{t('poster.making.discard')}
|
{t('poster.making.discard')}
|
||||||
</button>
|
</button>
|
||||||
|
<button type="button" className="p2v-btn-mint" disabled={busy} onClick={onRetry}>
|
||||||
|
{t('poster.making.retry')}
|
||||||
|
</button>
|
||||||
|
{canForce && (
|
||||||
|
<button type="button" className="p2v-btn-tonal" disabled={busy} onClick={onForce}>
|
||||||
|
{t('poster.making.force')}
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
import React, { useState } from 'react';
|
import React from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { P2vJob } from '../../utils/p2vApi';
|
import { P2vJob, downloadP2vFile, p2vFile } from '../../utils/p2vApi';
|
||||||
import { SocialUploadableItem } from '../../types/api';
|
|
||||||
import SocialPostingModal from '../../components/SocialPostingModal';
|
|
||||||
|
|
||||||
interface PosterResultContentProps {
|
interface PosterResultContentProps {
|
||||||
job: P2vJob;
|
job: P2vJob;
|
||||||
@@ -13,33 +11,14 @@ interface PosterResultContentProps {
|
|||||||
/**
|
/**
|
||||||
* 포스터 영상 완성 화면.
|
* 포스터 영상 완성 화면.
|
||||||
*
|
*
|
||||||
* 산출물은 Azure Blob 의 절대 URL 이다. 완성 영상은 blob 에 내려받기 헤더가 붙어 있어
|
* 다운로드는 `<a download>` 다 — 헤더를 못 붙이므로 p2vFile() 이 접근 키를
|
||||||
* `<a download>` 가 다른 출처에서도 파일로 저장된다.
|
* 쿼리로 태워준다(P2V 서버가 ?key= 경로를 지원하는 이유가 이것이다).
|
||||||
*/
|
*/
|
||||||
const PosterResultContent: React.FC<PosterResultContentProps> = ({ job, onNew }) => {
|
const PosterResultContent: React.FC<PosterResultContentProps> = ({ job, onNew }) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [showSocialModal, setShowSocialModal] = useState(false);
|
|
||||||
|
|
||||||
const video = job.artifacts.video ?? '';
|
const video = p2vFile(job.artifacts.video);
|
||||||
const thumbnail = job.artifacts.thumbnail ?? null;
|
const thumbnail = job.artifacts.thumbnail ? p2vFile(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 (
|
return (
|
||||||
<div className="p2v-scope p2v-result">
|
<div className="p2v-scope p2v-result">
|
||||||
@@ -92,35 +71,29 @@ const PosterResultContent: React.FC<PosterResultContentProps> = ({ job, onNew })
|
|||||||
)}
|
)}
|
||||||
|
|
||||||
<div className="p2v-result__actions">
|
<div className="p2v-result__actions">
|
||||||
|
{/* 교차 출처(Blob) URL 은 <a download> 가 무시된다 — fetch 경유 다운로드 */}
|
||||||
{thumbnail && (
|
{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
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className="p2v-btn-tonal"
|
className="p2v-btn-tonal"
|
||||||
onClick={() => setShowSocialModal(true)}
|
onClick={() => downloadP2vFile(thumbnail, `${job.name || 'poster'}_thumb.jpg`)}
|
||||||
>
|
>
|
||||||
{t('ado2Contents.uploadToSocial')}
|
{t('poster.result.downloadThumb')}
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
|
{video && (
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="p2v-btn-cta p2v-btn-cta--compact"
|
||||||
|
onClick={() => downloadP2vFile(video, `${job.name || 'poster'}.mp4`)}
|
||||||
|
>
|
||||||
|
{t('poster.result.downloadVideo')}
|
||||||
</button>
|
</button>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<SocialPostingModal
|
|
||||||
isOpen={showSocialModal}
|
|
||||||
onClose={() => setShowSocialModal(false)}
|
|
||||||
video={uploadItem}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<button type="button" className="p2v-btn-outline p2v-result__new" onClick={onNew}>
|
<button type="button" className="p2v-btn-outline p2v-result__new" onClick={onNew}>
|
||||||
{t('poster.result.new')}
|
{t('poster.result.new')}
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import { useTranslation } from 'react-i18next';
|
|||||||
import {
|
import {
|
||||||
P2vJob,
|
P2vJob,
|
||||||
approvePosterJob,
|
approvePosterJob,
|
||||||
|
fetchP2vImage,
|
||||||
updatePosterMetadata,
|
updatePosterMetadata,
|
||||||
updatePosterNarration,
|
updatePosterNarration,
|
||||||
} from '../../utils/p2vApi';
|
} from '../../utils/p2vApi';
|
||||||
@@ -39,6 +40,23 @@ const PosterReviewContent: React.FC<PosterReviewContentProps> = ({ job, onApprov
|
|||||||
const [meta, setMeta] = useState<MetaDraft>(emptyMeta);
|
const [meta, setMeta] = useState<MetaDraft>(emptyMeta);
|
||||||
const [busy, setBusy] = useState(false);
|
const [busy, setBusy] = useState(false);
|
||||||
const [error, setError] = useState<string | null>(null);
|
const [error, setError] = useState<string | null>(null);
|
||||||
|
const [checkImageUrl, setCheckImageUrl] = useState<string | null>(null);
|
||||||
|
|
||||||
|
// 검수 이미지는 인증이 필요한 프록시 경로(regions/)라 <img src> 로 직접 못 넣는다.
|
||||||
|
// authenticatedFetch → blob URL 로 받아오고, 잡이 바뀌면 이전 URL 을 회수한다.
|
||||||
|
useEffect(() => {
|
||||||
|
const path = job.artifacts.check_jpg;
|
||||||
|
if (!path) {
|
||||||
|
setCheckImageUrl(null);
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
let revoked: string | null = null;
|
||||||
|
fetchP2vImage(path)
|
||||||
|
.then((url) => { revoked = url; setCheckImageUrl(url); })
|
||||||
|
.catch(() => setCheckImageUrl(null));
|
||||||
|
return () => { if (revoked) URL.revokeObjectURL(revoked); };
|
||||||
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
|
}, [job.artifacts.check_jpg]);
|
||||||
|
|
||||||
// 서버 값으로 초안을 채우되, 사용자가 고치기 시작한 뒤에는 폴링 응답이 덮지 않아야 한다.
|
// 서버 값으로 초안을 채우되, 사용자가 고치기 시작한 뒤에는 폴링 응답이 덮지 않아야 한다.
|
||||||
// 잡 id 가 바뀔 때만 다시 채운다(같은 잡의 재조회는 무시).
|
// 잡 id 가 바뀔 때만 다시 채운다(같은 잡의 재조회는 무시).
|
||||||
@@ -151,10 +169,10 @@ const PosterReviewContent: React.FC<PosterReviewContentProps> = ({ job, onApprov
|
|||||||
{/* ── 대조용 분석 이미지 ────────────────────── */}
|
{/* ── 대조용 분석 이미지 ────────────────────── */}
|
||||||
<div className="p2v-review__preview">
|
<div className="p2v-review__preview">
|
||||||
<p className="p2v-label">{t('poster.review.analysis')}</p>
|
<p className="p2v-label">{t('poster.review.analysis')}</p>
|
||||||
{job.artifacts.check_jpg ? (
|
{checkImageUrl ? (
|
||||||
<img
|
<img
|
||||||
className="p2v-review__image"
|
className="p2v-review__image"
|
||||||
src={job.artifacts.check_jpg}
|
src={checkImageUrl}
|
||||||
alt={t('poster.review.analysisAlt')}
|
alt={t('poster.review.analysisAlt')}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
|
|||||||
@@ -1,72 +0,0 @@
|
|||||||
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,341 @@
|
|||||||
|
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
|
import PosterDropzone from '../../components/PosterDropzone';
|
||||||
|
import P2vKeyGate from '../../components/P2vKeyGate';
|
||||||
|
import {
|
||||||
|
InternalOnlyWarning,
|
||||||
|
LicenseBadge,
|
||||||
|
UserReferenceNotice,
|
||||||
|
} from '../../components/LicenseBadge';
|
||||||
|
import { useP2vJob } from '../../hooks/useP2vJob';
|
||||||
|
import {
|
||||||
|
F2Category,
|
||||||
|
F2Format,
|
||||||
|
F2Template,
|
||||||
|
F2UploadHint,
|
||||||
|
P2vAuthError,
|
||||||
|
createF2Template,
|
||||||
|
createStylingJob,
|
||||||
|
deleteF2Template,
|
||||||
|
downloadP2vFile,
|
||||||
|
getF2UploadHint,
|
||||||
|
isP2vActive,
|
||||||
|
listF2Categories,
|
||||||
|
listF2Formats,
|
||||||
|
listF2Templates,
|
||||||
|
p2vFile,
|
||||||
|
} from '../../utils/p2vApi';
|
||||||
|
|
||||||
|
/** 사용자가 올린 레퍼런스 카테고리. 서버 카테고리 목록에서 따로 떼어 아래에 둔다 */
|
||||||
|
const USER_CATEGORY = 'user';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 포스터 스타일링(F2).
|
||||||
|
*
|
||||||
|
* **내부 시연 전용이다.** 영화 포스터 레퍼런스는 저작권 자산이라 결과물을 외부에
|
||||||
|
* 공개하면 안 된다(퍼블릭 도메인 명화만 예외). 그래서 화면 상단에 범위를 못박고,
|
||||||
|
* 템플릿마다 배포 등급 배지를 붙인다.
|
||||||
|
*
|
||||||
|
* 다른 파이프라인과 달리 위저드가 아니라 **한 화면짜리 도구**다 — 업로드·템플릿·
|
||||||
|
* 포맷·결과가 한눈에 있어야 여러 스타일을 빠르게 갈아 끼우며 비교할 수 있고,
|
||||||
|
* 30초짜리 작업에 단계를 나누면 왕복만 늘어난다. 그래서 폴링도 GenerationFlow 가
|
||||||
|
* 아니라 이 컴포넌트가 직접 소유한다(F1·썰박스와 다른 유일한 지점).
|
||||||
|
*/
|
||||||
|
const StylingContent: React.FC = () => {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
|
||||||
|
const [templates, setTemplates] = useState<F2Template[]>([]);
|
||||||
|
const [categories, setCategories] = useState<F2Category[]>([]);
|
||||||
|
const [formats, setFormats] = useState<F2Format[]>([]);
|
||||||
|
const [hint, setHint] = useState<F2UploadHint | null>(null);
|
||||||
|
|
||||||
|
const [file, setFile] = useState<File | null>(null);
|
||||||
|
const [selected, setSelected] = useState<string | null>(null);
|
||||||
|
const [format, setFormat] = useState('poster');
|
||||||
|
const [jobId, setJobId] = useState<string | null>(null);
|
||||||
|
|
||||||
|
const [tplOpen, setTplOpen] = useState(true);
|
||||||
|
const [busy, setBusy] = useState(false);
|
||||||
|
const [refBusy, setRefBusy] = useState(false);
|
||||||
|
const [error, setError] = useState<string | null>(null);
|
||||||
|
const [authNeeded, setAuthNeeded] = useState(false);
|
||||||
|
|
||||||
|
const refInput = useRef<HTMLInputElement>(null);
|
||||||
|
const { job, authNeeded: jobAuthNeeded } = useP2vJob('f2', jobId);
|
||||||
|
|
||||||
|
const selectedTpl = templates.find((tpl) => tpl.id === selected) ?? null;
|
||||||
|
const running = isP2vActive(job);
|
||||||
|
|
||||||
|
const loadAll = useCallback(async () => {
|
||||||
|
try {
|
||||||
|
const [tpls, cats, fmts, uploadHint] = await Promise.all([
|
||||||
|
listF2Templates(),
|
||||||
|
listF2Categories(),
|
||||||
|
listF2Formats(),
|
||||||
|
getF2UploadHint(),
|
||||||
|
]);
|
||||||
|
setTemplates(tpls);
|
||||||
|
setCategories(cats);
|
||||||
|
setFormats(fmts);
|
||||||
|
setHint(uploadHint);
|
||||||
|
setAuthNeeded(false);
|
||||||
|
setError(null);
|
||||||
|
} catch (e) {
|
||||||
|
if (e instanceof P2vAuthError) setAuthNeeded(true);
|
||||||
|
else setError((e as Error).message);
|
||||||
|
}
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
loadAll();
|
||||||
|
}, [loadAll]);
|
||||||
|
|
||||||
|
const uploadReference = async (f: File) => {
|
||||||
|
setRefBusy(true);
|
||||||
|
setError(null);
|
||||||
|
try {
|
||||||
|
const tpl = await createF2Template(f, f.name.replace(/\.[^.]+$/, '').slice(0, 40));
|
||||||
|
setTemplates(await listF2Templates());
|
||||||
|
setSelected(tpl.id); // 방금 올린 것을 바로 고른 상태로
|
||||||
|
} catch (e) {
|
||||||
|
if (e instanceof P2vAuthError) setAuthNeeded(true);
|
||||||
|
else setError((e as Error).message);
|
||||||
|
} finally {
|
||||||
|
setRefBusy(false);
|
||||||
|
if (refInput.current) refInput.current.value = '';
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const removeReference = async (id: string) => {
|
||||||
|
if (!window.confirm(t('poster.styling.confirmDelete'))) return;
|
||||||
|
try {
|
||||||
|
await deleteF2Template(id);
|
||||||
|
if (selected === id) setSelected(null);
|
||||||
|
setTemplates(await listF2Templates());
|
||||||
|
} catch (e) {
|
||||||
|
setError((e as Error).message);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const submit = async () => {
|
||||||
|
if (!file || !selected || busy) return;
|
||||||
|
setBusy(true);
|
||||||
|
setError(null);
|
||||||
|
try {
|
||||||
|
const { id } = await createStylingJob(file, selected, format);
|
||||||
|
setJobId(id);
|
||||||
|
} catch (e) {
|
||||||
|
if (e instanceof P2vAuthError) setAuthNeeded(true);
|
||||||
|
else setError((e as Error).message);
|
||||||
|
} finally {
|
||||||
|
setBusy(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
if (authNeeded || jobAuthNeeded) {
|
||||||
|
return (
|
||||||
|
<div className="p2v-scope p2v-styling">
|
||||||
|
<P2vKeyGate onSaved={() => { setAuthNeeded(false); loadAll(); }} />
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const renderCard = (tpl: F2Template) => (
|
||||||
|
<div key={tpl.id} className="p2v-tplcard">
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
aria-pressed={selected === tpl.id}
|
||||||
|
className={`p2v-tpl${selected === tpl.id ? ' active' : ''}`}
|
||||||
|
onClick={() => setSelected(tpl.id)}
|
||||||
|
>
|
||||||
|
{/* 명화는 가로 그림도 있다 — cover 로 자르면 무엇인지 알 수 없어 contain 을 쓴다 */}
|
||||||
|
<img src={p2vFile(tpl.thumb_url)} alt={tpl.name_ko} />
|
||||||
|
<span className="p2v-tpl__name">{tpl.name_ko}</span>
|
||||||
|
{/* 제목이 1줄인 카드와 2줄인 카드가 섞인다. 아래로 밀어붙여야 한 행의 배지가 같은 선에 선다 */}
|
||||||
|
<span className="p2v-tpl__badge">
|
||||||
|
<LicenseBadge license={tpl.license} />
|
||||||
|
</span>
|
||||||
|
</button>
|
||||||
|
{tpl.removable && (
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="p2v-tpl__remove"
|
||||||
|
title={t('poster.styling.deleteRef')}
|
||||||
|
onClick={() => removeReference(tpl.id)}
|
||||||
|
>
|
||||||
|
×
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="p2v-scope p2v-styling">
|
||||||
|
<div className="p2v-notice p2v-notice--warn p2v-styling__scope">
|
||||||
|
{t('poster.styling.internalScope')}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* ── 스타일 템플릿 (접이식) ─────────────────────── */}
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="p2v-collapse"
|
||||||
|
aria-expanded={tplOpen}
|
||||||
|
onClick={() => setTplOpen(!tplOpen)}
|
||||||
|
>
|
||||||
|
<span className="p2v-label">{t('poster.styling.templates')}</span>
|
||||||
|
{!tplOpen && selectedTpl && (
|
||||||
|
<span className="p2v-collapse__picked">
|
||||||
|
<img src={p2vFile(selectedTpl.thumb_url)} alt="" />
|
||||||
|
<b>{selectedTpl.name_ko}</b>
|
||||||
|
<LicenseBadge license={selectedTpl.license} />
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
{!tplOpen && !selectedTpl && (
|
||||||
|
<span className="p2v-collapse__empty">{t('poster.styling.pickTemplate')}</span>
|
||||||
|
)}
|
||||||
|
<svg
|
||||||
|
className={`p2v-collapse__caret${tplOpen ? ' open' : ''}`}
|
||||||
|
width="18" height="18" viewBox="0 0 24 24" fill="none"
|
||||||
|
stroke="currentColor" strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round"
|
||||||
|
>
|
||||||
|
<path d="m6 9 6 6 6-6" />
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
|
|
||||||
|
{tplOpen && categories.filter((c) => c.id !== USER_CATEGORY).map((cat) => {
|
||||||
|
const items = templates.filter((tpl) => tpl.category === cat.id);
|
||||||
|
if (items.length === 0) return null;
|
||||||
|
return (
|
||||||
|
<div key={cat.id} className="p2v-tplgroup">
|
||||||
|
<p className="p2v-tplgroup__title">
|
||||||
|
{cat.label}
|
||||||
|
<span>{t('poster.styling.count', { count: items.length })}</span>
|
||||||
|
</p>
|
||||||
|
<div className="p2v-tplgrid">{items.map(renderCard)}</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
|
||||||
|
{/* 내 레퍼런스 — 목록이 비어도 업로드 타일은 보여야 하므로 categories 가 아니라
|
||||||
|
upload-hint 의 enabled 로 렌더한다 */}
|
||||||
|
{tplOpen && hint?.enabled && (
|
||||||
|
<div className="p2v-tplgroup">
|
||||||
|
<p className="p2v-tplgroup__title">
|
||||||
|
{t('poster.styling.myRefs')}
|
||||||
|
<span>{t('poster.styling.myRefsHint')}</span>
|
||||||
|
</p>
|
||||||
|
<div className="p2v-tplgrid">
|
||||||
|
{templates.filter((tpl) => tpl.category === USER_CATEGORY).map(renderCard)}
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="p2v-tpl p2v-tpl--add"
|
||||||
|
disabled={refBusy}
|
||||||
|
onClick={() => refInput.current?.click()}
|
||||||
|
>
|
||||||
|
{refBusy ? (
|
||||||
|
<>
|
||||||
|
<span className="p2v-spinner p2v-spinner--sm" aria-hidden="true" />
|
||||||
|
<span className="p2v-tpl__name">{t('poster.styling.analyzing')}</span>
|
||||||
|
</>
|
||||||
|
) : (
|
||||||
|
<>
|
||||||
|
<span className="p2v-tpl__plus" aria-hidden="true">+</span>
|
||||||
|
<span className="p2v-tpl__name">{t('poster.styling.addRef')}</span>
|
||||||
|
<span className="p2v-tpl__sub">
|
||||||
|
{t('poster.styling.minEdge', { px: hint.min_long_edge })}
|
||||||
|
</span>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
</button>
|
||||||
|
<input
|
||||||
|
ref={refInput}
|
||||||
|
type="file"
|
||||||
|
accept="image/jpeg,image/png,image/webp,image/gif"
|
||||||
|
hidden
|
||||||
|
onChange={(e) => { const f = e.target.files?.[0]; if (f) uploadReference(f); }}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<UserReferenceNotice />
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{/* 경고는 실제로 고른 순간에만 */}
|
||||||
|
{selectedTpl?.license === 'internal-only' && (
|
||||||
|
<InternalOnlyWarning note={selectedTpl.license_note} />
|
||||||
|
)}
|
||||||
|
{selectedTpl?.attribution && (
|
||||||
|
<p className="p2v-note">{t('poster.styling.attribution', { source: selectedTpl.attribution })}</p>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{/* ── 입력 / 결과 ─────────────────────────────── */}
|
||||||
|
<div className="p2v-styling__io">
|
||||||
|
<div>
|
||||||
|
<p className="p2v-label">{t('poster.styling.myPoster')}</p>
|
||||||
|
<PosterDropzone file={file} onFile={setFile} />
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<p className="p2v-label">{t('poster.styling.result')}</p>
|
||||||
|
{job?.status === 'done' && job.artifacts.image ? (
|
||||||
|
<div className="p2v-panel p2v-styling__out">
|
||||||
|
<img src={p2vFile(job.artifacts.image)} alt={t('poster.styling.resultAlt')} />
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
<div className="p2v-panel p2v-styling__out p2v-styling__out--empty">
|
||||||
|
{running && <span className="p2v-spinner p2v-spinner--md" aria-hidden="true" />}
|
||||||
|
<span>{t(running ? 'poster.styling.converting' : 'poster.styling.resultHint')}</span>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
{job?.status === 'done' && job.artifacts.image && (
|
||||||
|
<div className="p2v-styling__download">
|
||||||
|
{/* 교차 출처(Blob) URL 은 <a download> 가 무시된다 — fetch 경유 다운로드 */}
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="p2v-btn-tonal"
|
||||||
|
onClick={() => downloadP2vFile(
|
||||||
|
p2vFile(job.artifacts.image),
|
||||||
|
`p2v_poster_${job.id}.png`,
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
{t('poster.styling.downloadPng')}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* ── 출력 포맷 ───────────────────────────────── */}
|
||||||
|
<p className="p2v-label">{t('poster.styling.formats')}</p>
|
||||||
|
<div className="p2v-formats">
|
||||||
|
{formats.map((f) => (
|
||||||
|
<button
|
||||||
|
key={f.id}
|
||||||
|
type="button"
|
||||||
|
aria-pressed={format === f.id}
|
||||||
|
className={`p2v-select${format === f.id ? ' active' : ''}`}
|
||||||
|
onClick={() => setFormat(f.id)}
|
||||||
|
>
|
||||||
|
{f.label}
|
||||||
|
</button>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="p2v-btn-cta"
|
||||||
|
disabled={!file || !selected || busy || running}
|
||||||
|
onClick={submit}
|
||||||
|
>
|
||||||
|
{running
|
||||||
|
? t('poster.styling.converting')
|
||||||
|
: busy ? t('poster.create.submitting') : t('poster.styling.submit')}
|
||||||
|
</button>
|
||||||
|
|
||||||
|
{error && <div className="p2v-note warn">{error}</div>}
|
||||||
|
{job?.status === 'failed' && job.error && (
|
||||||
|
<pre className="p2v-errorbox">{job.error.detail}</pre>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default StylingContent;
|
||||||
@@ -1,5 +1,20 @@
|
|||||||
import React from 'react';
|
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
||||||
import ContentDetailContent from '../../components/ContentDetailContent';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
import {
|
||||||
|
API_URL,
|
||||||
|
deleteComment,
|
||||||
|
getSsulContentById,
|
||||||
|
getUserMe,
|
||||||
|
getVideoComments,
|
||||||
|
isLoggedIn,
|
||||||
|
postVideoComment,
|
||||||
|
toggleVideoLike,
|
||||||
|
} from '../../utils/api';
|
||||||
|
import type { SsulDetailItem } from '../../utils/api';
|
||||||
|
import { CommentItem, UserMeResponse } from '../../types/api';
|
||||||
|
import { buildContentShareUrl, tryNativeShare } from '../../utils/nativeShare';
|
||||||
|
import LoginPromptModal from '../../components/LoginPromptModal';
|
||||||
|
import { isSafeHttpUrl } from '../../utils/url';
|
||||||
|
|
||||||
interface SsulDetailContentProps {
|
interface SsulDetailContentProps {
|
||||||
contentId: string;
|
contentId: string;
|
||||||
@@ -7,8 +22,467 @@ interface SsulDetailContentProps {
|
|||||||
onClose?: () => void;
|
onClose?: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
const SsulDetailContent: React.FC<SsulDetailContentProps> = (props) => (
|
/**
|
||||||
<ContentDetailContent {...props} contentType="ssul" />
|
* 썰박스 콘텐츠 상세 — castad `VideoDetailContent` 와 같은 3층 구조의 내용부.
|
||||||
);
|
* (SsulViewerModal 이 모달로, SsulDetailPage 가 공유 링크 페이지로 감싼다)
|
||||||
|
*
|
||||||
|
* UI·동작(좋아요 낙관 갱신·댓글·대댓글·공유·비로그인 게이트)은
|
||||||
|
* `VideoDetailContent` 와 동일하고, 다른 점은 셋뿐이다:
|
||||||
|
* 1. 상세 조회가 `GET /ssul/{id}` (video 조회를 쓰면 id 가 겹치는 남의 영상이 열린다)
|
||||||
|
* 2. 좋아요·댓글 API 에 `contentType='ssul'` 을 얹는다
|
||||||
|
* 3. 공유 URL 이 `/ssul/share/{id}` 다
|
||||||
|
*/
|
||||||
|
const SsulDetailContent: React.FC<SsulDetailContentProps> = ({
|
||||||
|
contentId,
|
||||||
|
isModal = false,
|
||||||
|
onClose,
|
||||||
|
}) => {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
const authed = isLoggedIn();
|
||||||
|
|
||||||
|
const [content, setContent] = useState<SsulDetailItem | null>(null);
|
||||||
|
const [loading, setLoading] = useState(true);
|
||||||
|
const [error, setError] = useState<string | null>(null);
|
||||||
|
|
||||||
|
const [likeCount, setLikeCount] = useState(0);
|
||||||
|
const [isLiked, setIsLiked] = useState(false);
|
||||||
|
|
||||||
|
const [copied, setCopied] = useState(false);
|
||||||
|
const [isLandscape, setIsLandscape] = useState(false);
|
||||||
|
const [showSiteOverlay, setShowSiteOverlay] = useState(false);
|
||||||
|
const [showLoginModal, setShowLoginModal] = useState(false);
|
||||||
|
|
||||||
|
const [comments, setComments] = useState<CommentItem[]>([]);
|
||||||
|
const [commentsTotal, setCommentsTotal] = useState(0);
|
||||||
|
const [commentsPage, setCommentsPage] = useState(1);
|
||||||
|
const [commentsHasNext, setCommentsHasNext] = useState(false);
|
||||||
|
const [commentsLoading, setCommentsLoading] = useState(false);
|
||||||
|
const [commentInput, setCommentInput] = useState('');
|
||||||
|
const [commentSubmitting, setCommentSubmitting] = useState(false);
|
||||||
|
const commentTextareaRef = useRef<HTMLTextAreaElement>(null);
|
||||||
|
|
||||||
|
const [currentUser, setCurrentUser] = useState<UserMeResponse | null>(null);
|
||||||
|
|
||||||
|
const fetchComments = useCallback(
|
||||||
|
async (page: number, append = false) => {
|
||||||
|
setCommentsLoading(true);
|
||||||
|
try {
|
||||||
|
const res = await getVideoComments(contentId, page, 20, 'ssul');
|
||||||
|
const sorted = [...res.items].sort(
|
||||||
|
(a, b) => new Date(a.created_at).getTime() - new Date(b.created_at).getTime()
|
||||||
|
);
|
||||||
|
setComments((prev) => (append ? [...prev, ...sorted] : sorted));
|
||||||
|
setCommentsTotal(res.total);
|
||||||
|
setCommentsHasNext(res.has_next);
|
||||||
|
setCommentsPage(page);
|
||||||
|
} catch (err) {
|
||||||
|
console.error('Failed to fetch ssul comments:', err);
|
||||||
|
} finally {
|
||||||
|
setCommentsLoading(false);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
[contentId]
|
||||||
|
);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const fetchContent = async () => {
|
||||||
|
setLoading(true);
|
||||||
|
setError(null);
|
||||||
|
setShowSiteOverlay(false);
|
||||||
|
try {
|
||||||
|
const data = await getSsulContentById(contentId);
|
||||||
|
setContent(data);
|
||||||
|
setLikeCount(data.like_count);
|
||||||
|
setIsLiked(data.is_liked_by_me);
|
||||||
|
} catch (err) {
|
||||||
|
console.error('Failed to fetch ssul content:', err);
|
||||||
|
setError(t('ado2Contents.loadFailed'));
|
||||||
|
} finally {
|
||||||
|
setLoading(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
setIsLandscape(false);
|
||||||
|
fetchContent();
|
||||||
|
fetchComments(1);
|
||||||
|
}, [contentId, fetchComments, t]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (!authed) return;
|
||||||
|
getUserMe().then(setCurrentUser).catch((err) => {
|
||||||
|
console.error('Failed to fetch current user:', err);
|
||||||
|
});
|
||||||
|
}, [authed]);
|
||||||
|
|
||||||
|
const formatDate = (dateString: string) => {
|
||||||
|
const date = new Date(dateString);
|
||||||
|
return t('videoDetail.dateFormat', {
|
||||||
|
year: date.getFullYear(),
|
||||||
|
month: date.getMonth() + 1,
|
||||||
|
day: date.getDate(),
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const formatCommentDate = (dateString: string) => {
|
||||||
|
const date = new Date(dateString);
|
||||||
|
return `${date.getFullYear()}.${String(date.getMonth() + 1).padStart(2, '0')}.${String(
|
||||||
|
date.getDate()
|
||||||
|
).padStart(2, '0')}`;
|
||||||
|
};
|
||||||
|
|
||||||
|
// 썰박스 공개 페이지 경로. /video/{id} 를 쓰면 id 가 겹치는 남의 영상이 열린다.
|
||||||
|
const shareUrl = buildContentShareUrl(API_URL, contentId, 'ssul');
|
||||||
|
|
||||||
|
const handleCopyLink = async () => {
|
||||||
|
try {
|
||||||
|
await navigator.clipboard.writeText(shareUrl);
|
||||||
|
} catch {
|
||||||
|
// clipboard API 미지원 환경에서는 무시
|
||||||
|
}
|
||||||
|
setCopied(true);
|
||||||
|
setTimeout(() => setCopied(false), 2000);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleShareButtonClick = async () => {
|
||||||
|
const handled = await tryNativeShare({
|
||||||
|
title: content?.store_name ?? t('videoDetail.kakaoDefaultTitle'),
|
||||||
|
url: shareUrl,
|
||||||
|
});
|
||||||
|
if (handled) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
await handleCopyLink();
|
||||||
|
};
|
||||||
|
|
||||||
|
const likeDebounceRef = useRef<ReturnType<typeof setTimeout> | null>(null);
|
||||||
|
|
||||||
|
const handleLike = () => {
|
||||||
|
if (!authed) {
|
||||||
|
setShowLoginModal(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
setIsLiked((prev) => !prev);
|
||||||
|
setLikeCount((prev) => (isLiked ? prev - 1 : prev + 1));
|
||||||
|
|
||||||
|
if (likeDebounceRef.current) clearTimeout(likeDebounceRef.current);
|
||||||
|
likeDebounceRef.current = setTimeout(async () => {
|
||||||
|
const prevLiked = isLiked;
|
||||||
|
const prevCount = likeCount;
|
||||||
|
try {
|
||||||
|
await toggleVideoLike(contentId, 'ssul');
|
||||||
|
} catch (err) {
|
||||||
|
console.error('Failed to toggle ssul like:', err);
|
||||||
|
setIsLiked(prevLiked);
|
||||||
|
setLikeCount(prevCount);
|
||||||
|
}
|
||||||
|
}, 500);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleHeaderAction = () => {
|
||||||
|
if (!isModal && !authed) {
|
||||||
|
setShowLoginModal(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
onClose?.();
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleCommentFocus = () => {
|
||||||
|
if (!authed) setShowLoginModal(true);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleCommentSubmit = async () => {
|
||||||
|
if (!authed) {
|
||||||
|
setShowLoginModal(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!commentInput.trim() || commentSubmitting) return;
|
||||||
|
setCommentSubmitting(true);
|
||||||
|
try {
|
||||||
|
await postVideoComment(contentId, commentInput.trim(), undefined, 'ssul');
|
||||||
|
setCommentInput('');
|
||||||
|
if (commentTextareaRef.current) {
|
||||||
|
commentTextareaRef.current.style.height = 'auto';
|
||||||
|
}
|
||||||
|
await fetchComments(1);
|
||||||
|
} catch (err) {
|
||||||
|
console.error('Failed to post ssul comment:', err);
|
||||||
|
} finally {
|
||||||
|
setCommentSubmitting(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleDeleteComment = async (commentId: number) => {
|
||||||
|
try {
|
||||||
|
await deleteComment(commentId);
|
||||||
|
await fetchComments(commentsPage);
|
||||||
|
} catch (err) {
|
||||||
|
console.error('Failed to delete ssul comment:', err);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const renderCommentContent = (content_: string | null, isDeleted: boolean) => {
|
||||||
|
if (isDeleted) {
|
||||||
|
return (
|
||||||
|
<span style={{ color: '#6B9EA0', fontStyle: 'italic' }}>
|
||||||
|
{t('videoDetail.deletedComment')}
|
||||||
|
</span>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return content_;
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className={isModal ? 'video-detail-modal-content' : 'video-detail-page-content'}>
|
||||||
|
{/* 헤더 */}
|
||||||
|
<div className="video-detail-header">
|
||||||
|
{isModal ? (
|
||||||
|
<>
|
||||||
|
{/* 제목이 없으면 space-between 인 헤더에서 닫기 버튼이 왼쪽으로 붙는다.
|
||||||
|
문구는 ADO2 상세와 같은 키를 쓴다 — 통합 목록에서 열리는 같은
|
||||||
|
모달이므로 콘텐츠 종류에 따라 제목이 바뀌면 오히려 어색하다. */}
|
||||||
|
<h2 className="video-detail-modal-title">{t('sidebar.ado2Contents')}</h2>
|
||||||
|
<button className="video-detail-close-btn" onClick={handleHeaderAction} aria-label={t('videoDetail.closeAriaLabel')}>
|
||||||
|
<svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
|
||||||
|
<line x1="18" y1="6" x2="6" y2="18" /><line x1="6" y1="6" x2="18" y2="18" />
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
|
</>
|
||||||
|
) : (
|
||||||
|
<button className="video-detail-back-btn" onClick={handleHeaderAction}>
|
||||||
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" stroke="currentColor" strokeWidth="1.5">
|
||||||
|
<path d="M13 4l-6 6 6 6" />
|
||||||
|
</svg>
|
||||||
|
{t('sidebar.ado2Contents')}
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="video-detail-body">
|
||||||
|
{loading ? (
|
||||||
|
<div className="ado2-contents-loading">
|
||||||
|
<div className="loading-spinner"></div>
|
||||||
|
<p>{t('ado2Contents.loading')}</p>
|
||||||
|
</div>
|
||||||
|
) : error ? (
|
||||||
|
<div className="ado2-contents-error"><p>{error}</p></div>
|
||||||
|
) : content ? (
|
||||||
|
<div className={`video-detail-content ${isLandscape ? 'landscape' : ''}`}>
|
||||||
|
<div className="video-detail-player-wrap">
|
||||||
|
<video
|
||||||
|
src={content.video_url}
|
||||||
|
controls
|
||||||
|
autoPlay
|
||||||
|
playsInline
|
||||||
|
controlsList="nodownload"
|
||||||
|
onContextMenu={(e) => e.preventDefault()}
|
||||||
|
className="video-detail-player"
|
||||||
|
onLoadedMetadata={(e) => {
|
||||||
|
const v = e.currentTarget;
|
||||||
|
setIsLandscape(v.videoWidth > v.videoHeight);
|
||||||
|
}}
|
||||||
|
onTimeUpdate={(e) => {
|
||||||
|
if (!content.official_site_url) return;
|
||||||
|
const v = e.currentTarget;
|
||||||
|
// 영상 종료 3초 전부터 공식 홈페이지 오버레이 노출
|
||||||
|
setShowSiteOverlay(
|
||||||
|
Number.isFinite(v.duration) && v.duration - v.currentTime <= 3
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
{showSiteOverlay && isSafeHttpUrl(content.official_site_url) && (
|
||||||
|
<a
|
||||||
|
href={content.official_site_url as string}
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
className="video-site-overlay"
|
||||||
|
>
|
||||||
|
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
|
||||||
|
<circle cx="12" cy="12" r="10"/>
|
||||||
|
<line x1="2" y1="12" x2="22" y2="12"/>
|
||||||
|
<path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"/>
|
||||||
|
</svg>
|
||||||
|
<span className="video-site-overlay-text">
|
||||||
|
<strong>{content.store_name}</strong>
|
||||||
|
{t('videoDetail.siteOverlayLabel')}
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="video-detail-info">
|
||||||
|
<h2 className="video-detail-store">
|
||||||
|
{content.store_name || t('ssulbox.viewer.untitled')}
|
||||||
|
</h2>
|
||||||
|
<p className="video-detail-date">{formatDate(content.created_at)}</p>
|
||||||
|
|
||||||
|
{/* 좋아요 + 공유 */}
|
||||||
|
<div style={{ display: 'flex', gap: '8px', flexWrap: 'wrap' }}>
|
||||||
|
<button
|
||||||
|
className={`video-detail-like-btn ${isLiked ? 'liked' : ''}`}
|
||||||
|
onClick={handleLike}
|
||||||
|
>
|
||||||
|
<svg width="16" height="16" viewBox="0 0 24 24" fill={isLiked ? 'currentColor' : 'none'} stroke="currentColor" strokeWidth="2">
|
||||||
|
<path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z" />
|
||||||
|
</svg>
|
||||||
|
{likeCount}
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
className="video-detail-copy-btn"
|
||||||
|
onClick={handleShareButtonClick}
|
||||||
|
title={t('videoDetail.share')}
|
||||||
|
>
|
||||||
|
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
|
||||||
|
<circle cx="18" cy="5" r="3" /><circle cx="6" cy="12" r="3" /><circle cx="18" cy="19" r="3" />
|
||||||
|
<line x1="8.59" y1="13.51" x2="15.42" y2="17.49" /><line x1="15.41" y1="6.51" x2="8.59" y2="10.49" />
|
||||||
|
</svg>
|
||||||
|
{copied ? t('videoDetail.copied') : t('videoDetail.share')}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* 댓글 섹션 */}
|
||||||
|
<div className="video-detail-comments">
|
||||||
|
<div className="video-detail-comments-header">
|
||||||
|
<h3 className="video-detail-comments-title">{t('videoDetail.commentsTitle')}</h3>
|
||||||
|
<span className="video-detail-comments-count">{commentsTotal}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{authed && currentUser && (
|
||||||
|
<div className="video-detail-comment-profile">
|
||||||
|
{currentUser.profile_image_url && (
|
||||||
|
<img
|
||||||
|
src={currentUser.profile_image_url}
|
||||||
|
alt={currentUser.nickname}
|
||||||
|
className="video-detail-comment-avatar"
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
<span className="video-detail-comment-nickname">{currentUser.nickname}</span>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
<div className="video-detail-comment-input-wrap">
|
||||||
|
<textarea
|
||||||
|
ref={commentTextareaRef}
|
||||||
|
className="video-detail-comment-input"
|
||||||
|
placeholder={authed ? t('videoDetail.commentPlaceholder') : t('videoDetail.commentLoginRequired')}
|
||||||
|
maxLength={500}
|
||||||
|
rows={1}
|
||||||
|
value={commentInput}
|
||||||
|
onChange={(e) => {
|
||||||
|
setCommentInput(e.target.value);
|
||||||
|
e.target.style.height = 'auto';
|
||||||
|
e.target.style.height = `${e.target.scrollHeight}px`;
|
||||||
|
}}
|
||||||
|
onFocus={handleCommentFocus}
|
||||||
|
onKeyDown={(e) => {
|
||||||
|
if (e.key === 'Enter' && !e.shiftKey) {
|
||||||
|
e.preventDefault();
|
||||||
|
handleCommentSubmit();
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
disabled={!authed}
|
||||||
|
/>
|
||||||
|
<button
|
||||||
|
className="video-detail-comment-submit"
|
||||||
|
onClick={handleCommentSubmit}
|
||||||
|
disabled={!authed || !commentInput.trim() || commentSubmitting}
|
||||||
|
>
|
||||||
|
{commentSubmitting ? t('videoDetail.commentSubmitting') : t('videoDetail.commentSubmit')}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{comments.length === 0 && !commentsLoading ? (
|
||||||
|
<p className="video-detail-comments-empty">{t('videoDetail.noComments')}</p>
|
||||||
|
) : (
|
||||||
|
<ul className="video-detail-comment-list">
|
||||||
|
{comments.map((c) => (
|
||||||
|
<li key={c.id} className="video-detail-comment-item">
|
||||||
|
{c.profile_image_url && (
|
||||||
|
<img
|
||||||
|
src={c.profile_image_url}
|
||||||
|
alt={c.nickname || t('videoDetail.anonymous')}
|
||||||
|
className="video-detail-comment-avatar"
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
<div className="video-detail-comment-body">
|
||||||
|
<span className="video-detail-comment-nickname">
|
||||||
|
{c.nickname || t('videoDetail.anonymous')}
|
||||||
|
</span>
|
||||||
|
<p className="video-detail-comment-text">
|
||||||
|
{renderCommentContent(c.content, c.is_deleted)}
|
||||||
|
</p>
|
||||||
|
<div className="video-detail-comment-bottom">
|
||||||
|
<span className="video-detail-comment-date">{formatCommentDate(c.created_at)}</span>
|
||||||
|
{c.is_mine && !c.is_deleted && (
|
||||||
|
<button
|
||||||
|
className="video-detail-comment-delete"
|
||||||
|
onClick={() => handleDeleteComment(c.id)}
|
||||||
|
>
|
||||||
|
{t('videoDetail.deleteComment')}
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{c.replies && c.replies.length > 0 && (
|
||||||
|
<ul className="video-detail-reply-list">
|
||||||
|
{c.replies.map((r) => (
|
||||||
|
<li key={r.id} className="video-detail-reply-item">
|
||||||
|
{r.profile_image_url && (
|
||||||
|
<img
|
||||||
|
src={r.profile_image_url}
|
||||||
|
alt={r.nickname || t('videoDetail.anonymous')}
|
||||||
|
className="video-detail-comment-avatar small"
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
<div className="video-detail-comment-body">
|
||||||
|
<span className="video-detail-comment-nickname">
|
||||||
|
{r.nickname || t('videoDetail.anonymous')}
|
||||||
|
</span>
|
||||||
|
<p className="video-detail-comment-text">
|
||||||
|
{renderCommentContent(r.content, r.is_deleted)}
|
||||||
|
</p>
|
||||||
|
<div className="video-detail-comment-bottom">
|
||||||
|
<span className="video-detail-comment-date">{formatCommentDate(r.created_at)}</span>
|
||||||
|
{r.is_mine && !r.is_deleted && (
|
||||||
|
<button
|
||||||
|
className="video-detail-comment-delete"
|
||||||
|
onClick={() => handleDeleteComment(r.id)}
|
||||||
|
>
|
||||||
|
{t('videoDetail.deleteComment')}
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
))}
|
||||||
|
</ul>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
))}
|
||||||
|
</ul>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{commentsHasNext && (
|
||||||
|
<button
|
||||||
|
className="video-detail-comments-more"
|
||||||
|
onClick={() => fetchComments(commentsPage + 1, true)}
|
||||||
|
disabled={commentsLoading}
|
||||||
|
>
|
||||||
|
{commentsLoading ? t('videoDetail.loadingComments') : t('videoDetail.loadMoreComments')}
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
) : null}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{showLoginModal && (
|
||||||
|
<LoginPromptModal onClose={() => setShowLoginModal(false)} />
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
export default SsulDetailContent;
|
export default SsulDetailContent;
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { SsulTaskStatus, getSsulTask } from '../../utils/api';
|
import { SsulTaskStatus, getSsulTask } from '../../utils/api';
|
||||||
import { SocialUploadableItem } from '../../types/api';
|
import { VideoListItem } from '../../types/api';
|
||||||
import SocialPostingModal from '../../components/SocialPostingModal';
|
import SocialPostingModal from '../../components/SocialPostingModal';
|
||||||
import CompletionView from '../../components/CompletionView';
|
import CompletionView from '../../components/CompletionView';
|
||||||
import { Scen, scenDesc, scenName } from './ssulData';
|
import { Scen, scenDesc, scenName } from './ssulData';
|
||||||
@@ -136,7 +136,7 @@ const SsulResultContent: React.FC<SsulResultContentProps> = ({ taskId, scenario
|
|||||||
created_at: task.created_at,
|
created_at: task.created_at,
|
||||||
like_count: 0,
|
like_count: 0,
|
||||||
comment_count: 0,
|
comment_count: 0,
|
||||||
} as SocialUploadableItem)
|
} as VideoListItem)
|
||||||
: null
|
: null
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -8,12 +8,6 @@
|
|||||||
background-color: var(--color-bg-darker);
|
background-color: var(--color-bg-darker);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 첫 화면 맨 아래 Footer: 페이지 여백을 상쇄해 좌우·아래 끝까지 채운다 */
|
|
||||||
.ado2-contents-page > .landing-footer {
|
|
||||||
width: auto;
|
|
||||||
margin: 48px -32px -32px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ado2-contents-header {
|
.ado2-contents-header {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: baseline;
|
align-items: baseline;
|
||||||
@@ -1359,10 +1353,6 @@
|
|||||||
padding: 16px;
|
padding: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ado2-contents-page > .landing-footer {
|
|
||||||
margin: 32px -16px -16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ado2-contents-header {
|
.ado2-contents-header {
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 8px;
|
gap: 8px;
|
||||||
@@ -1383,10 +1373,6 @@
|
|||||||
padding: 12px;
|
padding: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ado2-contents-page > .landing-footer {
|
|
||||||
margin: 32px -12px -12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ado2-contents-grid {
|
.ado2-contents-grid {
|
||||||
grid-template-columns: repeat(2, 1fr);
|
grid-template-columns: repeat(2, 1fr);
|
||||||
gap: 8px;
|
gap: 8px;
|
||||||
|
|||||||
@@ -2416,6 +2416,14 @@
|
|||||||
max-width: 375px;
|
max-width: 375px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 진입 화면에 들어가는 폼은 대부분 한 줄 입력이라 375px 로 충분하지만,
|
||||||
|
포스터 스타일링(F2)은 템플릿 그리드·입출력 2단이 한 화면에 있는 **도구**라
|
||||||
|
그 폭에서는 못 쓴다.
|
||||||
|
(세로 넘침 처리는 이제 컨테이너 기본 규칙이 담당한다 — 예외를 두지 않는다) */
|
||||||
|
.url-input-content--wide {
|
||||||
|
max-width: 900px;
|
||||||
|
}
|
||||||
|
|
||||||
/* 375px 화면에서는 타일 4개 + 라벨이 폭을 넘긴다. 타일과 글자를 함께 줄여
|
/* 375px 화면에서는 타일 4개 + 라벨이 폭을 넘긴다. 타일과 글자를 함께 줄여
|
||||||
한 줄을 지킨다 — 라벨이 줄바꿈되면 타일 정렬이 어긋난다 */
|
한 줄을 지킨다 — 라벨이 줄바꿈되면 타일 정렬이 어긋난다 */
|
||||||
|
|
||||||
@@ -2521,7 +2529,7 @@
|
|||||||
설명은 탭에 딸린 것이지 폼의 일부가 아니다 */
|
설명은 탭에 딸린 것이지 폼의 일부가 아니다 */
|
||||||
.pipeline-desc {
|
.pipeline-desc {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
margin: 0 0 13px;
|
margin: 0 0 32px;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
line-height: 1.6;
|
line-height: 1.6;
|
||||||
letter-spacing: -0.006em;
|
letter-spacing: -0.006em;
|
||||||
@@ -2552,7 +2560,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.pipeline-desc {
|
.pipeline-desc {
|
||||||
margin-bottom: 13px;
|
margin-bottom: 28px;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,4 +19,3 @@
|
|||||||
|
|
||||||
/* Poster to Video (F1 영상 · F2 스타일링) — 모든 규칙이 `.p2v-scope` 안에 갇혀 있다 */
|
/* Poster to Video (F1 영상 · F2 스타일링) — 모든 규칙이 `.p2v-scope` 안에 갇혀 있다 */
|
||||||
@import './poster-p2v.css';
|
@import './poster-p2v.css';
|
||||||
@import './playreel-p2v.css';
|
|
||||||
@@ -129,7 +129,7 @@
|
|||||||
|
|
||||||
/* Hero Form */
|
/* Hero Form */
|
||||||
.hero-form {
|
.hero-form {
|
||||||
padding-top: 13px;
|
padding-top: 20px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
max-width: 375px;
|
max-width: 375px;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
@@ -1,266 +0,0 @@
|
|||||||
/* =====================================================
|
|
||||||
Playreel(롱컷) — 검수 게이트 화면 스타일
|
|
||||||
|
|
||||||
poster-p2v.css 의 `.p2v-*` 규칙(패널·라벨·버튼·칩·진행바)을 그대로 쓰고,
|
|
||||||
게이트에만 있는 요소(섹션 썸네일 선택, 판정 카드, 경고 박스)만 `.pr-*` 로 더한다.
|
|
||||||
규칙은 poster-p2v.css 와 같다: 모든 선택자를 `.p2v-scope` 안에 가둔다.
|
|
||||||
===================================================== */
|
|
||||||
|
|
||||||
.p2v-scope .pr-gate__eyebrow {
|
|
||||||
margin: 0;
|
|
||||||
font-size: var(--text-sm);
|
|
||||||
font-weight: 700;
|
|
||||||
color: var(--color-mint);
|
|
||||||
}
|
|
||||||
|
|
||||||
.p2v-scope .pr-gate__title {
|
|
||||||
margin: 6px 0 8px;
|
|
||||||
font-size: var(--text-2xl);
|
|
||||||
font-weight: 700;
|
|
||||||
letter-spacing: -0.02em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.p2v-scope .pr-gate__actions {
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
gap: 10px;
|
|
||||||
margin-top: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 좌우 2단. 좁은 화면에서는 자동으로 한 줄씩 쌓인다 */
|
|
||||||
.p2v-scope .pr-two {
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
|
|
||||||
gap: var(--spacing-page-md);
|
|
||||||
align-items: start;
|
|
||||||
}
|
|
||||||
|
|
||||||
.p2v-scope .pr-gap { margin-top: 24px; }
|
|
||||||
|
|
||||||
.p2v-scope .pr-row {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 12px;
|
|
||||||
margin-bottom: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.p2v-scope .pr-row__label {
|
|
||||||
flex-shrink: 0;
|
|
||||||
width: 52px;
|
|
||||||
font-size: var(--text-sm);
|
|
||||||
color: var(--color-text-gray-400);
|
|
||||||
}
|
|
||||||
|
|
||||||
.p2v-scope .pr-row__label--slot {
|
|
||||||
width: 92px;
|
|
||||||
font-size: var(--text-xs);
|
|
||||||
}
|
|
||||||
|
|
||||||
.p2v-scope .pr-row .p2v-input { height: 44px; }
|
|
||||||
|
|
||||||
.p2v-scope .pr-strong {
|
|
||||||
margin: 0;
|
|
||||||
font-weight: 700;
|
|
||||||
}
|
|
||||||
|
|
||||||
.p2v-scope .pr-audio {
|
|
||||||
width: 100%;
|
|
||||||
margin-top: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.p2v-scope .pr-image {
|
|
||||||
max-width: 320px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.p2v-scope .pr-player {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
min-height: 320px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.p2v-scope .pr-player video {
|
|
||||||
display: block;
|
|
||||||
width: 100%;
|
|
||||||
max-height: 520px;
|
|
||||||
border-radius: var(--radius-md);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 연출 칩 — 잠긴 칩은 눌리지 않는다 */
|
|
||||||
.p2v-scope .pr-chip {
|
|
||||||
display: inline-flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 6px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.p2v-scope .pr-chip.locked { cursor: default; }
|
|
||||||
|
|
||||||
/* 상세페이지 섹션 썸네일 선택 */
|
|
||||||
.p2v-scope .pr-sections {
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
|
|
||||||
gap: 8px;
|
|
||||||
max-height: 340px;
|
|
||||||
padding-right: 4px;
|
|
||||||
overflow-y: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.p2v-scope .pr-section {
|
|
||||||
position: relative;
|
|
||||||
padding: 0;
|
|
||||||
overflow: hidden;
|
|
||||||
border: 2px solid var(--color-border-white-10);
|
|
||||||
border-radius: var(--radius-md);
|
|
||||||
background: transparent;
|
|
||||||
text-align: left;
|
|
||||||
cursor: pointer;
|
|
||||||
opacity: 0.5;
|
|
||||||
}
|
|
||||||
|
|
||||||
.p2v-scope .pr-section.selected {
|
|
||||||
border-color: var(--color-mint);
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.p2v-scope .pr-section.locked { cursor: default; }
|
|
||||||
|
|
||||||
.p2v-scope .pr-section img {
|
|
||||||
display: block;
|
|
||||||
width: 100%;
|
|
||||||
aspect-ratio: 3 / 4;
|
|
||||||
object-fit: cover;
|
|
||||||
object-position: top;
|
|
||||||
background: #000;
|
|
||||||
}
|
|
||||||
|
|
||||||
.p2v-scope .pr-section__no {
|
|
||||||
position: absolute;
|
|
||||||
top: 4px;
|
|
||||||
left: 4px;
|
|
||||||
min-width: 16px;
|
|
||||||
padding: 1px 4px;
|
|
||||||
border-radius: 4px;
|
|
||||||
background: rgba(0, 0, 0, 0.65);
|
|
||||||
color: #fff;
|
|
||||||
font-size: 10px;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.p2v-scope .pr-section__cap {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 4px;
|
|
||||||
padding: 3px 5px;
|
|
||||||
background: rgba(0, 0, 0, 0.65);
|
|
||||||
color: var(--color-text-gray-400);
|
|
||||||
font-size: 10px;
|
|
||||||
line-height: 1.3;
|
|
||||||
}
|
|
||||||
|
|
||||||
.p2v-scope .pr-section.selected .pr-section__cap { color: var(--color-mint); }
|
|
||||||
|
|
||||||
.p2v-scope .pr-section__cap span:last-child {
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 경고 박스 — 실패가 아니라 "확인하세요" 라서 호박색으로 구분한다 */
|
|
||||||
.p2v-scope .pr-callout {
|
|
||||||
margin: 12px 0 0;
|
|
||||||
padding: 10px 14px;
|
|
||||||
border: 1px solid rgba(255, 210, 122, 0.35);
|
|
||||||
border-radius: var(--radius-md);
|
|
||||||
background: rgba(255, 210, 122, 0.1);
|
|
||||||
color: #ffd27a;
|
|
||||||
font-size: var(--text-sm);
|
|
||||||
line-height: 1.5;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 예상 길이 */
|
|
||||||
.p2v-scope .pr-stat {
|
|
||||||
margin: 0;
|
|
||||||
font-size: var(--text-2xl);
|
|
||||||
font-weight: 700;
|
|
||||||
color: var(--color-mint);
|
|
||||||
}
|
|
||||||
|
|
||||||
.p2v-scope .pr-stat.warn { color: #ffd27a; }
|
|
||||||
|
|
||||||
/* 제목 훼손 검사 판정 */
|
|
||||||
.p2v-scope .pr-verdict.ok { border-color: var(--color-mint-30); }
|
|
||||||
.p2v-scope .pr-verdict.fail { border-color: rgba(255, 122, 122, 0.4); }
|
|
||||||
.p2v-scope .pr-verdict.ok .pr-strong { color: var(--color-mint); }
|
|
||||||
.p2v-scope .pr-verdict.fail .pr-strong { color: #ff8c8c; }
|
|
||||||
|
|
||||||
/* 자동 확인 항목 */
|
|
||||||
.p2v-scope .pr-check {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 8px;
|
|
||||||
margin: 5px 0;
|
|
||||||
font-size: var(--text-base);
|
|
||||||
color: var(--color-text-gray-300);
|
|
||||||
}
|
|
||||||
|
|
||||||
.p2v-scope .pr-check svg { color: var(--color-mint); }
|
|
||||||
.p2v-scope .pr-check.fail { color: #ff8c8c; }
|
|
||||||
.p2v-scope .pr-check.fail svg { color: #ff8c8c; }
|
|
||||||
|
|
||||||
/* 자동 승인 설정 패널 */
|
|
||||||
.p2v-scope .pr-auto { margin-top: 28px; }
|
|
||||||
|
|
||||||
.p2v-scope .pr-auto__row {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
gap: 16px;
|
|
||||||
padding: 10px 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.p2v-scope .pr-auto__row + .pr-auto__row { border-top: 1px solid var(--color-border-white-5); }
|
|
||||||
.p2v-scope .pr-auto__row--locked { opacity: 0.55; }
|
|
||||||
.p2v-scope .pr-auto__text { min-width: 0; }
|
|
||||||
.p2v-scope .pr-auto__text .p2v-note { margin: 2px 0 0; }
|
|
||||||
|
|
||||||
.p2v-scope .pr-switch {
|
|
||||||
position: relative;
|
|
||||||
flex-shrink: 0;
|
|
||||||
width: 44px;
|
|
||||||
height: 24px;
|
|
||||||
padding: 0;
|
|
||||||
border: 1px solid var(--color-border-white-10);
|
|
||||||
border-radius: var(--radius-full);
|
|
||||||
background: transparent;
|
|
||||||
cursor: pointer;
|
|
||||||
transition: background-color var(--transition-normal), border-color var(--transition-normal);
|
|
||||||
}
|
|
||||||
|
|
||||||
.p2v-scope .pr-switch.on {
|
|
||||||
border-color: var(--color-mint);
|
|
||||||
background: var(--color-mint-20);
|
|
||||||
}
|
|
||||||
|
|
||||||
.p2v-scope .pr-switch__knob {
|
|
||||||
position: absolute;
|
|
||||||
top: 2px;
|
|
||||||
left: 2px;
|
|
||||||
width: 18px;
|
|
||||||
height: 18px;
|
|
||||||
border-radius: 50%;
|
|
||||||
background: var(--color-text-gray-400);
|
|
||||||
transition: transform var(--transition-normal), background-color var(--transition-normal);
|
|
||||||
}
|
|
||||||
|
|
||||||
.p2v-scope .pr-switch.on .pr-switch__knob {
|
|
||||||
transform: translateX(20px);
|
|
||||||
background: var(--color-mint);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 자동 승인 안내 — 진행 화면 아래에 이어서 보인다 */
|
|
||||||
.p2v-scope .pr-auto-note {
|
|
||||||
margin: 14px 0 0;
|
|
||||||
font-size: var(--text-sm);
|
|
||||||
text-align: center;
|
|
||||||
color: var(--color-mint);
|
|
||||||
}
|
|
||||||
+283
-184
@@ -311,188 +311,6 @@
|
|||||||
|
|
||||||
.p2v-scope.p2v-create .p2v-btn-cta { margin-top: 28px; }
|
.p2v-scope.p2v-create .p2v-btn-cta { margin-top: 28px; }
|
||||||
|
|
||||||
.p2v-scope .p2v-create__cost {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
width: 100%;
|
|
||||||
padding: 0 4px;
|
|
||||||
margin-top: 28px;
|
|
||||||
font-size: 12px;
|
|
||||||
color: var(--color-text-gray-400);
|
|
||||||
}
|
|
||||||
|
|
||||||
.p2v-scope .p2v-create__cost-badge {
|
|
||||||
display: inline-flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 5px;
|
|
||||||
font-weight: 700;
|
|
||||||
color: var(--color-mint);
|
|
||||||
}
|
|
||||||
|
|
||||||
.p2v-scope .p2v-create__coin {
|
|
||||||
font-size: 14px;
|
|
||||||
line-height: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.p2v-scope.p2v-create .p2v-create__cost + .p2v-btn-cta {
|
|
||||||
margin-top: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ── 시작 선택 화면 + 소개 카드 (playreel 의 "어떻게 시작할까요?") ── */
|
|
||||||
|
|
||||||
.p2v-scope.p2v-start {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 12px;
|
|
||||||
max-width: 560px;
|
|
||||||
margin: 0 auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.p2v-scope .p2v-start__title {
|
|
||||||
margin: 0;
|
|
||||||
font-size: var(--text-2xl);
|
|
||||||
font-weight: 800;
|
|
||||||
text-align: center;
|
|
||||||
letter-spacing: -0.02em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.p2v-scope .p2v-start__subtitle {
|
|
||||||
margin: 0 0 8px;
|
|
||||||
font-size: var(--text-sm);
|
|
||||||
text-align: center;
|
|
||||||
color: var(--color-text-gray-400);
|
|
||||||
}
|
|
||||||
|
|
||||||
.p2v-scope .p2v-back {
|
|
||||||
align-self: flex-start;
|
|
||||||
margin: 0 0 16px;
|
|
||||||
padding: 0;
|
|
||||||
border: none;
|
|
||||||
background: none;
|
|
||||||
color: var(--color-text-gray-400);
|
|
||||||
font-family: inherit;
|
|
||||||
font-size: var(--text-sm);
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
.p2v-scope .p2v-back:hover { color: var(--color-text-white); }
|
|
||||||
|
|
||||||
.p2v-scope .p2v-intro--hot { border-color: var(--color-mint-30); }
|
|
||||||
|
|
||||||
.p2v-scope .p2v-intro__badge {
|
|
||||||
align-self: flex-start;
|
|
||||||
margin-bottom: -4px;
|
|
||||||
padding: 3px 10px;
|
|
||||||
border-radius: var(--radius-full);
|
|
||||||
background: var(--color-mint);
|
|
||||||
color: var(--color-bg-dark);
|
|
||||||
font-size: 11px;
|
|
||||||
font-weight: 800;
|
|
||||||
letter-spacing: 0.04em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.p2v-scope .p2v-intro .p2v-btn-cta { margin-top: 4px; }
|
|
||||||
|
|
||||||
|
|
||||||
.p2v-scope .p2v-intro {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 14px;
|
|
||||||
padding: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.p2v-scope .p2v-intro__head {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.p2v-scope .p2v-intro__icon {
|
|
||||||
display: grid;
|
|
||||||
flex: none;
|
|
||||||
place-items: center;
|
|
||||||
width: 44px;
|
|
||||||
height: 44px;
|
|
||||||
border-radius: var(--radius-md);
|
|
||||||
background: var(--color-mint-10);
|
|
||||||
color: var(--color-mint);
|
|
||||||
font-size: 12px;
|
|
||||||
font-weight: 800;
|
|
||||||
letter-spacing: 0.04em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.p2v-scope .p2v-intro__title {
|
|
||||||
margin: 0;
|
|
||||||
font-size: var(--text-lg);
|
|
||||||
font-weight: 800;
|
|
||||||
letter-spacing: -0.02em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.p2v-scope .p2v-intro__desc {
|
|
||||||
margin: 2px 0 0;
|
|
||||||
font-size: var(--text-sm);
|
|
||||||
color: var(--color-text-gray-400);
|
|
||||||
}
|
|
||||||
|
|
||||||
.p2v-scope .p2v-intro__flow {
|
|
||||||
display: grid;
|
|
||||||
gap: 10px;
|
|
||||||
margin: 0;
|
|
||||||
padding: 14px;
|
|
||||||
list-style: none;
|
|
||||||
border: 1px solid var(--color-border-white-5);
|
|
||||||
border-radius: var(--radius-md);
|
|
||||||
background: var(--color-bg-card);
|
|
||||||
font-size: var(--text-xs);
|
|
||||||
line-height: 1.6;
|
|
||||||
color: var(--color-text-gray-300);
|
|
||||||
}
|
|
||||||
|
|
||||||
.p2v-scope .p2v-intro__flow li {
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: 22px minmax(0, 1fr);
|
|
||||||
align-items: baseline;
|
|
||||||
gap: 10px;
|
|
||||||
text-align: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
.p2v-scope .p2v-intro__flow-number {
|
|
||||||
color: var(--color-mint);
|
|
||||||
font-weight: 800;
|
|
||||||
font-variant-numeric: tabular-nums;
|
|
||||||
}
|
|
||||||
|
|
||||||
.p2v-scope .p2v-intro__facts {
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: repeat(3, 1fr);
|
|
||||||
gap: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.p2v-scope .p2v-intro__facts div {
|
|
||||||
padding: 8px 10px;
|
|
||||||
border: 1px solid var(--color-bg-card);
|
|
||||||
border-radius: var(--radius-md);
|
|
||||||
background: var(--color-bg-card);
|
|
||||||
}
|
|
||||||
|
|
||||||
.p2v-scope .p2v-intro__facts b {
|
|
||||||
display: block;
|
|
||||||
font-size: var(--text-xs);
|
|
||||||
font-weight: 600;
|
|
||||||
color: var(--color-text-gray-500);
|
|
||||||
}
|
|
||||||
|
|
||||||
.p2v-scope .p2v-intro__facts span {
|
|
||||||
font-size: var(--text-sm);
|
|
||||||
font-weight: 700;
|
|
||||||
font-variant-numeric: tabular-nums;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (max-width: 480px) {
|
|
||||||
.p2v-scope .p2v-intro__facts { grid-template-columns: repeat(2, 1fr); }
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ── F1 진행 화면 ────────────────────────────────── */
|
/* ── F1 진행 화면 ────────────────────────────────── */
|
||||||
|
|
||||||
.p2v-scope.p2v-making {
|
.p2v-scope.p2v-making {
|
||||||
@@ -784,14 +602,294 @@
|
|||||||
|
|
||||||
/* ── F2 스타일링 ─────────────────────────────────── */
|
/* ── F2 스타일링 ─────────────────────────────────── */
|
||||||
|
|
||||||
|
.p2v-scope.p2v-styling {
|
||||||
|
max-width: 900px;
|
||||||
|
margin: 0 auto;
|
||||||
|
padding: 8px 0 40px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.p2v-scope .p2v-styling__scope { margin-bottom: 22px; }
|
||||||
|
|
||||||
|
.p2v-scope .p2v-notice {
|
||||||
|
padding: 12px 18px;
|
||||||
|
border-radius: var(--radius-xl);
|
||||||
|
font-size: var(--text-sm);
|
||||||
|
line-height: 1.6;
|
||||||
|
color: var(--color-text-gray-300);
|
||||||
|
}
|
||||||
|
|
||||||
/* 내부 전용 — 주황 계열. 민트/퍼플과 겹치지 않아야 "제한"으로 읽힌다 */
|
/* 내부 전용 — 주황 계열. 민트/퍼플과 겹치지 않아야 "제한"으로 읽힌다 */
|
||||||
|
.p2v-scope .p2v-notice--warn {
|
||||||
|
border: 1px solid rgba(255, 154, 90, 0.35);
|
||||||
|
background: rgba(255, 154, 90, 0.12);
|
||||||
|
}
|
||||||
|
|
||||||
|
.p2v-scope .p2v-notice--warn b { color: #ffc9a3; }
|
||||||
|
|
||||||
|
.p2v-scope .p2v-notice--unknown {
|
||||||
|
margin-top: 12px;
|
||||||
|
border: 1px solid rgba(166, 130, 255, 0.38);
|
||||||
|
background: rgba(166, 130, 255, 0.14);
|
||||||
|
}
|
||||||
|
|
||||||
|
.p2v-scope .p2v-license {
|
||||||
|
display: inline-block;
|
||||||
|
padding: 2px 8px;
|
||||||
|
border-radius: var(--radius-full);
|
||||||
|
font-size: var(--text-xs);
|
||||||
|
font-weight: 700;
|
||||||
|
line-height: 1.5;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.p2v-scope .p2v-license--ok {
|
||||||
|
border: 1px solid var(--color-mint-30);
|
||||||
|
background: var(--color-mint-10);
|
||||||
|
color: var(--color-mint);
|
||||||
|
}
|
||||||
|
|
||||||
|
.p2v-scope .p2v-license--warn {
|
||||||
|
border: 1px solid rgba(255, 154, 90, 0.35);
|
||||||
|
background: rgba(255, 154, 90, 0.12);
|
||||||
|
color: #ffc9a3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.p2v-scope .p2v-license--unknown {
|
||||||
|
border: 1px solid rgba(166, 130, 255, 0.38);
|
||||||
|
background: rgba(166, 130, 255, 0.14);
|
||||||
|
color: #c9b6ff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.p2v-scope .p2v-collapse {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 12px;
|
||||||
|
width: 100%;
|
||||||
|
padding: 0;
|
||||||
|
border: none;
|
||||||
|
background: none;
|
||||||
|
color: var(--color-text-white);
|
||||||
|
font-family: inherit;
|
||||||
|
text-align: left;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.p2v-scope .p2v-collapse .p2v-label { margin: 0; }
|
||||||
|
|
||||||
|
.p2v-collapse__picked {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
font-size: var(--text-base);
|
||||||
|
}
|
||||||
|
|
||||||
|
.p2v-collapse__picked img {
|
||||||
|
width: 22px;
|
||||||
|
height: 30px;
|
||||||
|
object-fit: cover;
|
||||||
|
border-radius: var(--radius-sm);
|
||||||
|
}
|
||||||
|
|
||||||
|
.p2v-collapse__picked b { color: var(--color-mint); font-weight: 700; }
|
||||||
|
|
||||||
|
.p2v-collapse__empty {
|
||||||
|
font-size: var(--text-base);
|
||||||
|
color: var(--color-text-gray-500);
|
||||||
|
}
|
||||||
|
|
||||||
|
.p2v-collapse__caret {
|
||||||
|
margin-left: auto;
|
||||||
|
color: var(--color-text-gray-400);
|
||||||
|
transition: transform var(--transition-normal);
|
||||||
|
}
|
||||||
|
|
||||||
|
.p2v-collapse__caret.open { transform: rotate(180deg); }
|
||||||
|
|
||||||
|
.p2v-tplgroup { margin-top: 20px; }
|
||||||
|
|
||||||
|
.p2v-tplgroup__title {
|
||||||
|
margin: 0 0 10px;
|
||||||
|
font-size: var(--text-sm);
|
||||||
|
font-weight: 700;
|
||||||
|
color: var(--color-text-gray-400);
|
||||||
|
}
|
||||||
|
|
||||||
|
.p2v-tplgroup__title span {
|
||||||
|
margin-left: 8px;
|
||||||
|
font-weight: 500;
|
||||||
|
color: var(--color-text-gray-500);
|
||||||
|
}
|
||||||
|
|
||||||
|
.p2v-tplgrid {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(5, 1fr);
|
||||||
|
gap: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.p2v-tplcard { position: relative; }
|
||||||
|
|
||||||
|
.p2v-scope .p2v-tpl {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 8px;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
padding: 8px;
|
||||||
|
border: 1px solid var(--color-border-gray-700);
|
||||||
|
border-radius: var(--radius-xl);
|
||||||
|
background: var(--color-bg-card-inner);
|
||||||
|
color: var(--color-text-gray-400);
|
||||||
|
font-family: inherit;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: border-color var(--transition-normal), background-color var(--transition-normal),
|
||||||
|
color var(--transition-normal);
|
||||||
|
}
|
||||||
|
|
||||||
|
.p2v-scope .p2v-tpl:hover { color: var(--color-text-white); }
|
||||||
|
|
||||||
|
.p2v-scope .p2v-tpl.active {
|
||||||
|
border: 1px solid var(--color-mint);
|
||||||
|
background: var(--color-mint-10);
|
||||||
|
color: var(--color-text-white);
|
||||||
|
/* 링을 테두리와 같은 색으로 둔다 — 다르면 두 줄로 갈라져 보인다.
|
||||||
|
테두리 두께를 바꾸지 않아 카드 안 글자도 흔들리지 않는다 */
|
||||||
|
box-shadow: 0 0 0 1px var(--color-mint);
|
||||||
|
}
|
||||||
|
|
||||||
/* 명화는 가로 그림도 있다 — cover 로 자르면 무엇인지 알 수 없다 */
|
/* 명화는 가로 그림도 있다 — cover 로 자르면 무엇인지 알 수 없다 */
|
||||||
|
.p2v-scope .p2v-tpl img {
|
||||||
|
display: block;
|
||||||
|
width: 100%;
|
||||||
|
aspect-ratio: 2 / 3;
|
||||||
|
object-fit: contain;
|
||||||
|
border-radius: var(--radius-md);
|
||||||
|
background: var(--color-bg-darker);
|
||||||
|
}
|
||||||
|
|
||||||
|
.p2v-tpl__name {
|
||||||
|
font-size: var(--text-sm);
|
||||||
|
font-weight: 700;
|
||||||
|
line-height: 1.3;
|
||||||
|
white-space: normal;
|
||||||
|
}
|
||||||
|
|
||||||
/* 제목이 1줄인 카드와 2줄인 카드가 섞인다 — 아래로 밀어야 배지가 같은 선에 선다 */
|
/* 제목이 1줄인 카드와 2줄인 카드가 섞인다 — 아래로 밀어야 배지가 같은 선에 선다 */
|
||||||
|
.p2v-tpl__badge {
|
||||||
|
display: flex;
|
||||||
|
margin-top: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.p2v-tpl__sub {
|
||||||
|
font-size: var(--text-xs);
|
||||||
|
line-height: 1.4;
|
||||||
|
color: var(--color-text-gray-500);
|
||||||
|
white-space: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
.p2v-scope .p2v-tpl--add {
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
gap: 10px;
|
||||||
|
min-height: 200px;
|
||||||
|
border-style: dashed;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.p2v-tpl__plus { font-size: 26px; font-weight: 300; line-height: 1; }
|
||||||
|
|
||||||
|
.p2v-scope .p2v-tpl__remove {
|
||||||
|
position: absolute;
|
||||||
|
top: 10px;
|
||||||
|
right: 10px;
|
||||||
|
width: 26px;
|
||||||
|
height: 26px;
|
||||||
|
border: 1px solid var(--color-border-white-10);
|
||||||
|
border-radius: var(--radius-full);
|
||||||
|
background: rgba(0, 0, 0, 0.62);
|
||||||
|
color: var(--color-text-gray-300);
|
||||||
|
font-family: inherit;
|
||||||
|
font-size: 15px;
|
||||||
|
line-height: 1;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.p2v-styling__io {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 1fr 1fr;
|
||||||
|
gap: var(--spacing-page-md);
|
||||||
|
margin-top: 28px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.p2v-scope .p2v-styling__out {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
aspect-ratio: 4 / 5;
|
||||||
|
max-width: 400px;
|
||||||
|
margin: 0 auto;
|
||||||
|
padding: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.p2v-scope .p2v-styling__out--empty {
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 16px;
|
||||||
|
padding: var(--spacing-page);
|
||||||
|
font-size: var(--text-base);
|
||||||
|
color: var(--color-text-gray-500);
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.p2v-scope .p2v-styling__out img {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
object-fit: contain;
|
||||||
|
}
|
||||||
|
|
||||||
|
.p2v-styling__download {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
margin-top: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.p2v-scope.p2v-styling .p2v-label { margin-top: 26px; }
|
||||||
|
.p2v-scope.p2v-styling .p2v-styling__io .p2v-label { margin-top: 0; }
|
||||||
|
|
||||||
|
.p2v-formats {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(4, 1fr);
|
||||||
|
gap: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.p2v-scope .p2v-select {
|
||||||
|
padding: 12px;
|
||||||
|
border: 1px solid var(--color-border-gray-700);
|
||||||
|
border-radius: var(--radius-xl);
|
||||||
|
background: var(--color-bg-card-inner);
|
||||||
|
color: var(--color-text-gray-400);
|
||||||
|
font-family: inherit;
|
||||||
|
font-size: var(--text-sm);
|
||||||
|
font-weight: 700;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: border-color var(--transition-normal), background-color var(--transition-normal),
|
||||||
|
color var(--transition-normal);
|
||||||
|
}
|
||||||
|
|
||||||
|
.p2v-scope .p2v-select:hover { color: var(--color-text-white); }
|
||||||
|
|
||||||
|
.p2v-scope .p2v-select.active {
|
||||||
|
border-color: var(--color-mint);
|
||||||
|
background: var(--color-mint-10);
|
||||||
|
color: var(--color-text-white);
|
||||||
|
box-shadow: 0 0 0 1px var(--color-mint);
|
||||||
|
}
|
||||||
|
|
||||||
/* ── 모바일 ──────────────────────────────────────── */
|
/* ── 모바일 ──────────────────────────────────────── */
|
||||||
|
|
||||||
|
@media (max-width: 900px) {
|
||||||
|
.p2v-tplgrid { grid-template-columns: repeat(3, 1fr); }
|
||||||
|
}
|
||||||
|
|
||||||
@media (max-width: 768px) {
|
@media (max-width: 768px) {
|
||||||
.p2v-review__grid,
|
.p2v-review__grid,
|
||||||
.p2v-result__grid,
|
.p2v-result__grid,
|
||||||
@@ -807,8 +905,8 @@
|
|||||||
border-top: 2px solid var(--color-mint-20);
|
border-top: 2px solid var(--color-mint-20);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.p2v-tplgrid { grid-template-columns: repeat(2, 1fr); }
|
||||||
|
.p2v-formats { grid-template-columns: repeat(2, 1fr); }
|
||||||
|
|
||||||
/* 검수 화면(모바일) — 2단이 1단으로 접히면서 순서 문제가 생긴다.
|
/* 검수 화면(모바일) — 2단이 1단으로 접히면서 순서 문제가 생긴다.
|
||||||
데스크톱은 좌(편집)·우(포스터)라 나란히 보이지만, 세로로 쌓으면 편집이 먼저 오고
|
데스크톱은 좌(편집)·우(포스터)라 나란히 보이지만, 세로로 쌓으면 편집이 먼저 오고
|
||||||
@@ -838,3 +936,4 @@
|
|||||||
.p2v-scope .p2v-spinner::after { animation: none; }
|
.p2v-scope .p2v-spinner::after { animation: none; }
|
||||||
.p2v-scope .p2v-bar__fill { transition: none; }
|
.p2v-scope .p2v-bar__fill { transition: none; }
|
||||||
}
|
}
|
||||||
|
|
||||||
+7
-11
@@ -270,13 +270,12 @@ export interface UserCreditsResponse {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 비디오 목록 아이템 (갤러리용)
|
// 비디오 목록 아이템 (갤러리용)
|
||||||
/** 좋아요·댓글·공유에서 사용하는 통합 콘텐츠 종류 */
|
|
||||||
export type ContentType = 'video' | 'ssul' | P2vContentType;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* P2V(무빙 포스터·롱컷) 콘텐츠 종류.
|
* 콘텐츠 종류. ADO2 영상·썰박스·P2V 가 한 목록에 섞인다.
|
||||||
|
* p2v_poster 는 영상이 아니라 **이미지**다 — result_movie_url 에 이미지 URL 이 실리므로
|
||||||
|
* <video> 가 아니라 <img> 로 그려야 한다. p2v_* 는 내 콘텐츠 목록에만 나온다.
|
||||||
*/
|
*/
|
||||||
export type P2vContentType = 'p2v_video' | 'p2v_playreel';
|
export type ContentType = 'video' | 'ssul' | 'p2v_video' | 'p2v_poster';
|
||||||
|
|
||||||
export interface VideoListItem {
|
export interface VideoListItem {
|
||||||
/**
|
/**
|
||||||
@@ -286,7 +285,7 @@ export interface VideoListItem {
|
|||||||
* 특히 `DELETE /archive/videos/{id}` 는 `Video.id` 로 지우므로,
|
* 특히 `DELETE /archive/videos/{id}` 는 `Video.id` 로 지우므로,
|
||||||
* 썰박스 항목의 id 를 넘기면 **엉뚱한 ADO2 영상이 삭제된다.**
|
* 썰박스 항목의 id 를 넘기면 **엉뚱한 ADO2 영상이 삭제된다.**
|
||||||
*/
|
*/
|
||||||
type: ContentType | P2vContentType;
|
type: ContentType;
|
||||||
video_id: number;
|
video_id: number;
|
||||||
store_name: string;
|
store_name: string;
|
||||||
region: string;
|
region: string;
|
||||||
@@ -330,9 +329,6 @@ export interface VideosListResponse {
|
|||||||
has_prev: boolean;
|
has_prev: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 소셜 업로드 모달이 받는 항목 — 무빙 포스터(p2v_video)까지 업로드를 지원하고 롱컷(p2v_playreel)은 제외한다 */
|
|
||||||
export type SocialUploadableItem = VideoListItem & { type: Exclude<ContentType, 'p2v_playreel'> };
|
|
||||||
|
|
||||||
// 댓글 대댓글
|
// 댓글 대댓글
|
||||||
export interface CommentReply {
|
export interface CommentReply {
|
||||||
id: number;
|
id: number;
|
||||||
@@ -421,7 +417,7 @@ export interface SocialDisconnectResponse {
|
|||||||
// 유튜브 SEO Description 자동완성 요청
|
// 유튜브 SEO Description 자동완성 요청
|
||||||
export interface YTAutoSeoRequest {
|
export interface YTAutoSeoRequest {
|
||||||
/** 썰박스면 'ssul' + task_id 자리에 ssul_content.id 문자열. 생략 시 video */
|
/** 썰박스면 'ssul' + task_id 자리에 ssul_content.id 문자열. 생략 시 video */
|
||||||
content_type?: SocialUploadableItem['type'];
|
content_type?: ContentType;
|
||||||
task_id: string; // ADO2 는 task_id, 썰박스는 콘텐츠 id 문자열
|
task_id: string; // ADO2 는 task_id, 썰박스는 콘텐츠 id 문자열
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -438,7 +434,7 @@ export interface SocialUploadRequest {
|
|||||||
* 콘텐츠 종류. video.id 와 ssul_content.id 가 겹치므로 생략(=video)한 채
|
* 콘텐츠 종류. video.id 와 ssul_content.id 가 겹치므로 생략(=video)한 채
|
||||||
* 썰박스 id 를 보내면 **엉뚱한 ADO2 영상이 업로드된다.**
|
* 썰박스 id 를 보내면 **엉뚱한 ADO2 영상이 업로드된다.**
|
||||||
*/
|
*/
|
||||||
content_type?: SocialUploadableItem['type'];
|
content_type?: ContentType;
|
||||||
video_id: number; // 콘텐츠 ID (content_type 안에서만 유일)
|
video_id: number; // 콘텐츠 ID (content_type 안에서만 유일)
|
||||||
social_account_id: number; // 선택된 채널 ID
|
social_account_id: number; // 선택된 채널 ID
|
||||||
title: string; // 최대 100자
|
title: string; // 최대 100자
|
||||||
|
|||||||
+7
-13
@@ -1,5 +1,4 @@
|
|||||||
import { clearSessionStorage } from './storageKeys';
|
import { clearSessionStorage } from './storageKeys';
|
||||||
import { classifyAppAuthError } from './authError';
|
|
||||||
import {
|
import {
|
||||||
CrawlingResponse,
|
CrawlingResponse,
|
||||||
LyricGenerateRequest,
|
LyricGenerateRequest,
|
||||||
@@ -860,23 +859,18 @@ export async function authenticatedFetch(
|
|||||||
|
|
||||||
// 401 에러 시 에러 코드에 따라 처리
|
// 401 에러 시 에러 코드에 따라 처리
|
||||||
if (response.status === 401) {
|
if (response.status === 401) {
|
||||||
// 호출부가 본문을 다시 읽을 수 있도록 clone 으로 판별한다
|
const errorBody = await response.json().catch(() => null);
|
||||||
const errorBody = await response.clone().json().catch(() => null);
|
const errorCode = errorBody?.detail?.code;
|
||||||
const authError = classifyAppAuthError(errorBody);
|
|
||||||
|
|
||||||
// 앱 로그인 문제가 아닌 401(YouTube/소셜 재연동 필요 등)은 로그아웃하지 않고
|
// 애초에 토큰이 없던 익명 요청(공개 화면)까지 튕기면 안 되므로 별도 처리
|
||||||
// 호출부가 code 로 처리하도록 응답을 그대로 돌려준다
|
const isMissingToken = errorCode === 'MISSING_TOKEN';
|
||||||
if (authError === null) {
|
|
||||||
return response;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (authError !== 'expired') {
|
if (errorCode !== 'TOKEN_EXPIRED') {
|
||||||
// INVALID_TOKEN 등 갱신으로 해결 불가한 경우 즉시 로그인 이동
|
// INVALID_TOKEN 등 갱신으로 해결 불가한 경우 즉시 로그인 이동
|
||||||
// (애초에 토큰이 없던 익명 요청(공개 화면)은 튕기면 안 되므로 missing 은 제외)
|
if (redirectOnAuthFail && !isMissingToken) {
|
||||||
if (redirectOnAuthFail && authError !== 'missing') {
|
|
||||||
redirectToLogin();
|
redirectToLogin();
|
||||||
}
|
}
|
||||||
throw new Error(errorBody?.detail?.code ?? 'Unauthorized');
|
throw new Error(errorCode ?? 'Unauthorized');
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -1,23 +0,0 @@
|
|||||||
// 401 응답이 "앱 로그인(JWT) 문제"인지 구분한다.
|
|
||||||
// 앱 JWT 오류는 { detail: { code, message } } 형태이고,
|
|
||||||
// YouTube/소셜 외부 플랫폼 토큰 오류는 { detail: string, code } 형태라 서로 다르다.
|
|
||||||
// 외부 플랫폼 401까지 로그아웃 처리하면 재연동 안내 대신 앱에서 튕겨 나간다.
|
|
||||||
|
|
||||||
export type AppAuthErrorKind = 'expired' | 'missing' | 'invalid';
|
|
||||||
|
|
||||||
export function classifyAppAuthError(errorBody: unknown): AppAuthErrorKind | null {
|
|
||||||
const detail = (errorBody as { detail?: unknown } | null)?.detail;
|
|
||||||
if (typeof detail !== 'object' || detail === null) return null;
|
|
||||||
|
|
||||||
switch ((detail as { code?: unknown }).code) {
|
|
||||||
case 'TOKEN_EXPIRED':
|
|
||||||
return 'expired';
|
|
||||||
case 'MISSING_TOKEN':
|
|
||||||
return 'missing';
|
|
||||||
case 'INVALID_TOKEN':
|
|
||||||
case 'TOKEN_REVOKED':
|
|
||||||
return 'invalid';
|
|
||||||
default:
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,5 +1,3 @@
|
|||||||
import type { ContentType } from '../types/api';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 기기의 네이티브 공유 시트를 열고 요청을 처리했는지 반환합니다.
|
* 기기의 네이티브 공유 시트를 열고 요청을 처리했는지 반환합니다.
|
||||||
*
|
*
|
||||||
@@ -34,13 +32,9 @@ export function buildVideoShareUrl(apiBaseUrl: string, videoId: number | string)
|
|||||||
export function buildContentShareUrl(
|
export function buildContentShareUrl(
|
||||||
apiBaseUrl: string,
|
apiBaseUrl: string,
|
||||||
contentId: number | string,
|
contentId: number | string,
|
||||||
contentType: ContentType = 'video',
|
contentType: 'video' | 'ssul' = 'video',
|
||||||
): string {
|
): string {
|
||||||
const base = apiBaseUrl.replace(/\/$/, '');
|
const base = apiBaseUrl.replace(/\/$/, '');
|
||||||
if (contentType === 'p2v_video' || contentType === 'p2v_playreel') {
|
|
||||||
const kind = contentType === 'p2v_video' ? 'f1' : 'playreel';
|
|
||||||
return `${base}/p2v/${kind}/share/${encodeURIComponent(String(contentId))}`;
|
|
||||||
}
|
|
||||||
if (contentType === 'ssul') {
|
if (contentType === 'ssul') {
|
||||||
return `${base}/ssul/share/${encodeURIComponent(String(contentId))}`;
|
return `${base}/ssul/share/${encodeURIComponent(String(contentId))}`;
|
||||||
}
|
}
|
||||||
|
|||||||
+204
-77
@@ -1,18 +1,45 @@
|
|||||||
/**
|
/**
|
||||||
* Poster to Video (P2V) 클라이언트.
|
* Poster to Video (P2V) 클라이언트.
|
||||||
*
|
*
|
||||||
* castad 백엔드의 `/p2v/*` 를 다른 파이프라인(ADO2·썰박스)과 같은 방식으로 부른다 —
|
* **castad 백엔드의 `/p2v/*` 프록시**를 호출한다 (2026-08-25 전환). 이전에는
|
||||||
* `authenticatedFetch` 가 Bearer 토큰을 싣는다. 잡 소유권·크레딧은 백엔드가 맡는다.
|
* P2V 서버(:8010)를 팀 키로 직접 호출했지만, 이제 castad 가 카카오 인증(JWT)·
|
||||||
|
* 크레딧 선차감·Blob 아카이빙을 얹는다. 다른 파이프라인(ADO2·썰박스)과 같은
|
||||||
|
* 인증 축이 됐으므로 `authenticatedFetch` 를 그대로 쓴다 (토큰 갱신·재시도 포함).
|
||||||
*
|
*
|
||||||
* 크레딧은 생성 요청 시점에 선차감되고, 실패하면 환불된다(썰박스와 같다).
|
* 산출물 URL 두 종류:
|
||||||
* 잔액이 모자라면 402 가 오며, 호출부가 충전 화면으로 유도할 수 있게
|
* - 완성 결과물(영상·결과 이미지) → **Azure Blob 공개 URL** (절대 URL 그대로 사용)
|
||||||
* `InsufficientCreditError` 로 던진다.
|
* - 템플릿 썸네일·검수 이미지 → castad 프록시 경로(`/p2v/files/...`).
|
||||||
|
* 썸네일은 공개라 <img src> 로 바로 되고, 검수 이미지(regions/)는 인증이
|
||||||
|
* 필요해 fetchP2vImage() 로 blob URL 을 만들어 넣는다.
|
||||||
*/
|
*/
|
||||||
import { ContentType, P2vContentType } from '../types/api';
|
|
||||||
import { API_URL, InsufficientCreditError, authenticatedFetch } from './api';
|
import { API_URL, InsufficientCreditError, authenticatedFetch } from './api';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 404 — 서버에 그 잡이 없다(지워졌거나 내 것이 아니다). 화면은 처음으로 되돌려야 한다.
|
* (구) P2V 접근 키 저장소 — 프록시 전환으로 더 이상 쓰지 않는다.
|
||||||
|
* P2vKeyGate 가 아직 import 하고 있어 심볼만 유지한다. 게이트가 뜰 일은 없다
|
||||||
|
* (401 은 authenticatedFetch 가 토큰 갱신/로그인 이동으로 처리한다).
|
||||||
|
*/
|
||||||
|
const KEY_STORAGE = 'castad_p2v_key';
|
||||||
|
|
||||||
|
export const getP2vKey = (): string => localStorage.getItem(KEY_STORAGE) ?? '';
|
||||||
|
export const setP2vKey = (key: string): void => localStorage.setItem(KEY_STORAGE, key.trim());
|
||||||
|
export const clearP2vKey = (): void => localStorage.removeItem(KEY_STORAGE);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* (구) 401 — P2V 키 입력이 필요하던 상황. 프록시 전환 후에는 castad 로그인 문제라
|
||||||
|
* authenticatedFetch 가 갱신/리다이렉트로 처리하므로 이 예외는 던져지지 않는다.
|
||||||
|
* 컴포넌트들의 instanceof 분기가 남아 있어 타입만 유지한다.
|
||||||
|
*/
|
||||||
|
export class P2vAuthError extends Error {
|
||||||
|
constructor() {
|
||||||
|
super('P2V_AUTH_REQUIRED');
|
||||||
|
this.name = 'P2vAuthError';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 404 — 서버에 그 잡이 없다. 화면은 처음으로 되돌려야 한다.
|
||||||
*
|
*
|
||||||
* 상태 코드로 판정하는 이유: 서버 detail 문구("잡 없음")를 문자열로 맞추려다
|
* 상태 코드로 판정하는 이유: 서버 detail 문구("잡 없음")를 문자열로 맞추려다
|
||||||
* 실제로 한 번 놓쳤다. 문구는 서버 사정으로 바뀌고 번역도 되지만 코드는 안 바뀐다.
|
* 실제로 한 번 놓쳤다. 문구는 서버 사정으로 바뀌고 번역도 되지만 코드는 안 바뀐다.
|
||||||
@@ -25,7 +52,7 @@ export class P2vNotFoundError extends Error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function p2vFetch<T>(path: string, init?: RequestInit): Promise<T> {
|
export async function p2vFetch<T>(path: string, init?: RequestInit): Promise<T> {
|
||||||
const res = await authenticatedFetch(`${API_URL}${path}`, init);
|
const res = await authenticatedFetch(`${API_URL}/p2v${path}`, init);
|
||||||
|
|
||||||
if (res.status === 402) throw new InsufficientCreditError();
|
if (res.status === 402) throw new InsufficientCreditError();
|
||||||
|
|
||||||
@@ -44,7 +71,65 @@ export async function p2vFetch<T>(path: string, init?: RequestInit): Promise<T>
|
|||||||
return res.json() as Promise<T>;
|
return res.json() as Promise<T>;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ── 타입 (백엔드 app/p2v/api/routers/v1/view.py 와 1:1) ───────────────
|
/**
|
||||||
|
* 산출물 URL 해석.
|
||||||
|
*
|
||||||
|
* - Azure Blob 공개 URL(절대 URL) → 그대로 (완성 영상·썸네일·결과 이미지)
|
||||||
|
* - `/p2v/files/...` 프록시 경로 → castad 오리진을 붙인다 (템플릿 썸네일 등 공개 파일)
|
||||||
|
*/
|
||||||
|
export const p2vFile = (path: string | null | undefined): string => {
|
||||||
|
if (!path) return '';
|
||||||
|
if (/^https?:\/\//.test(path)) return path;
|
||||||
|
return `${API_URL}${path}`;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 인증이 필요한 프록시 이미지(검수용 regions/)를 <img> 에 넣을 blob URL 로 받는다.
|
||||||
|
* <img src> 는 Authorization 헤더를 못 실으므로 fetch 를 경유한다.
|
||||||
|
* 반환된 URL 은 쓰는 쪽이 URL.revokeObjectURL 로 정리한다.
|
||||||
|
*/
|
||||||
|
export async function fetchP2vImage(path: string): Promise<string> {
|
||||||
|
const res = await authenticatedFetch(`${API_URL}${path}`);
|
||||||
|
if (!res.ok) throw new Error(`이미지 로드 실패 (${res.status})`);
|
||||||
|
return URL.createObjectURL(await res.blob());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 결과물 다운로드.
|
||||||
|
*
|
||||||
|
* **Blob URL 을 `<a download>` 에 그대로 걸면 다운로드가 아니라 열람 화면으로
|
||||||
|
* 이동한다** — `download` 속성은 교차 출처 URL 에서 무시되고, 결과물은 Azure Blob
|
||||||
|
* 도메인에 있어 앱과 출처가 다르기 때문이다. 썰박스(SsulResultContent)와 동일하게
|
||||||
|
* fetch → Blob → 동일 출처 objectURL 로 바꿔 내려받는다.
|
||||||
|
*
|
||||||
|
* fetch 가 실패하면(CORS 등) 새 탭으로라도 열어준다 — 사용자가 거기서
|
||||||
|
* 직접 저장할 수 있으므로 아무 일도 안 일어나는 것보다 낫다.
|
||||||
|
*/
|
||||||
|
export async function downloadP2vFile(url: string, fileName: string): Promise<void> {
|
||||||
|
try {
|
||||||
|
const response = await fetch(url);
|
||||||
|
if (!response.ok) throw new Error(`HTTP ${response.status}`);
|
||||||
|
const blobUrl = URL.createObjectURL(await response.blob());
|
||||||
|
const link = document.createElement('a');
|
||||||
|
link.href = blobUrl;
|
||||||
|
link.download = fileName;
|
||||||
|
document.body.appendChild(link);
|
||||||
|
link.click();
|
||||||
|
document.body.removeChild(link);
|
||||||
|
URL.revokeObjectURL(blobUrl);
|
||||||
|
} catch {
|
||||||
|
const link = document.createElement('a');
|
||||||
|
link.href = url;
|
||||||
|
link.download = fileName;
|
||||||
|
link.target = '_blank';
|
||||||
|
link.rel = 'noopener';
|
||||||
|
document.body.appendChild(link);
|
||||||
|
link.click();
|
||||||
|
document.body.removeChild(link);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ── 타입 (서버 jobs.py / routers 와 1:1) ──────────────────────────────
|
||||||
|
|
||||||
export type P2vStageStatus = 'idle' | 'running' | 'done' | 'failed';
|
export type P2vStageStatus = 'idle' | 'running' | 'done' | 'failed';
|
||||||
|
|
||||||
@@ -64,114 +149,152 @@ export interface PosterMeta {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface P2vJob {
|
export interface P2vJob {
|
||||||
id: number;
|
/** castad 잡 id (정수). 이전 P2V 직접 호출 시절엔 문자열 슬러그였다 */
|
||||||
kind: 'f1';
|
id: number | string;
|
||||||
name: string;
|
kind?: 'f1' | 'f2';
|
||||||
status: 'queued' | 'running' | 'awaiting_review' | 'failed' | 'done';
|
name?: string | null;
|
||||||
stage: string | null;
|
/** 'archiving' = 완성본을 Blob 으로 옮기는 중 — 진행 중으로 취급한다 */
|
||||||
stages: Record<string, P2vStageState>;
|
status: 'queued' | 'running' | 'awaiting_review' | 'archiving' | 'failed' | 'done';
|
||||||
narration: string[] | null;
|
stage?: string | null;
|
||||||
|
/** 진행 중에만 내려온다 (아카이브 후 조회는 DB 미러라 없음) */
|
||||||
|
stages?: Record<string, P2vStageState> | null;
|
||||||
|
narration?: string[] | null;
|
||||||
motion_elements?: string[] | null;
|
motion_elements?: string[] | null;
|
||||||
metadata: PosterMeta | null;
|
metadata?: PosterMeta | null;
|
||||||
error: { stage: string; detail: string } | null;
|
error?: { stage: string; detail: string } | null;
|
||||||
/** 산출물은 Azure Blob 의 절대 URL 이다 */
|
|
||||||
artifacts: Record<string, string>;
|
artifacts: Record<string, string>;
|
||||||
created_at: number;
|
created_at?: number;
|
||||||
|
queue_size?: number;
|
||||||
|
template_id?: string | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 잡 id. 서버는 숫자로 주고, 화면은 localStorage 때문에 문자열로도 든다 */
|
/** 배포 등급. public-domain 만 외부 공개 가능 — 나머지는 내부 시연 한정 */
|
||||||
export type P2vJobId = string | number;
|
export type P2vLicense = 'public-domain' | 'internal-only' | 'user-uploaded';
|
||||||
|
|
||||||
|
export interface F2Template {
|
||||||
|
id: string;
|
||||||
|
name_ko: string;
|
||||||
|
thumb_url: string;
|
||||||
|
category: string;
|
||||||
|
license: P2vLicense;
|
||||||
|
attribution: string;
|
||||||
|
license_note: string;
|
||||||
|
/** 사용자가 올린 레퍼런스인가 (삭제 가능) */
|
||||||
|
removable: boolean;
|
||||||
|
small_ref: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface F2Category { id: string; label: string }
|
||||||
|
export interface F2Format { id: string; label: string }
|
||||||
|
export interface F2UploadHint { enabled: boolean; min_long_edge: number }
|
||||||
|
|
||||||
// ── F1 (포스터 → 영상) ────────────────────────────────────────────────
|
// ── F1 (포스터 → 영상) ────────────────────────────────────────────────
|
||||||
|
|
||||||
/** 포스터 업로드 → 잡 생성. 반환된 id 로 폴링한다. 크레딧이 먼저 차감된다 */
|
/** 포스터 업로드 → 잡 생성. 반환된 id 로 폴링한다 */
|
||||||
export async function createPosterJob(poster: File, name: string): Promise<{ id: string }> {
|
export async function createPosterJob(poster: File, name: string): Promise<{ id: string }> {
|
||||||
const fd = new FormData();
|
const fd = new FormData();
|
||||||
fd.append('poster', poster);
|
fd.append('poster', poster);
|
||||||
fd.append('name', name);
|
fd.append('name', name);
|
||||||
const { id } = await p2vFetch<{ id: number }>('/p2v/f1/jobs', { method: 'POST', body: fd });
|
return p2vFetch<{ id: string }>('/f1/jobs', { method: 'POST', body: fd });
|
||||||
// 화면은 잡 id 를 localStorage 문자열로 들고 있어 경계에서 맞춘다
|
|
||||||
return { id: String(id) };
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const getPosterJob = (id: P2vJobId): Promise<P2vJob> =>
|
export const getPosterJob = (id: string | number): Promise<P2vJob> =>
|
||||||
p2vFetch<P2vJob>(`/p2v/f1/jobs/${id}`);
|
p2vFetch<P2vJob>(`/f1/jobs/${id}`);
|
||||||
|
|
||||||
export const updatePosterNarration = (id: P2vJobId, narration: string[]): Promise<unknown> =>
|
export const updatePosterNarration = (id: string | number, narration: string[]): Promise<unknown> =>
|
||||||
p2vFetch(`/p2v/f1/jobs/${id}/narration`, {
|
p2vFetch(`/f1/jobs/${id}/narration`, {
|
||||||
method: 'PUT',
|
method: 'PUT',
|
||||||
headers: { 'Content-Type': 'application/json' },
|
headers: { 'Content-Type': 'application/json' },
|
||||||
body: JSON.stringify({ narration }),
|
body: JSON.stringify({ narration }),
|
||||||
});
|
});
|
||||||
|
|
||||||
export const updatePosterMetadata = (
|
export const updatePosterMetadata = (
|
||||||
id: P2vJobId,
|
id: string | number,
|
||||||
meta: { event_name: string; date_text: string; place: string },
|
meta: { event_name: string; date_text: string; place: string },
|
||||||
): Promise<unknown> =>
|
): Promise<unknown> =>
|
||||||
p2vFetch(`/p2v/f1/jobs/${id}/metadata`, {
|
p2vFetch(`/f1/jobs/${id}/metadata`, {
|
||||||
method: 'PUT',
|
method: 'PUT',
|
||||||
headers: { 'Content-Type': 'application/json' },
|
headers: { 'Content-Type': 'application/json' },
|
||||||
body: JSON.stringify(meta),
|
body: JSON.stringify(meta),
|
||||||
});
|
});
|
||||||
|
|
||||||
/** 검수 승인 → TTS·BGM·애니메이션·렌더가 이어진다. motions 를 넘기면 모션 선정을 덮어쓴다 */
|
/** 검수 승인 → TTS·BGM·애니메이션·렌더가 이어진다. motions 를 넘기면 모션 선정을 덮어쓴다 */
|
||||||
export const approvePosterJob = (id: P2vJobId, motions?: string[] | null): Promise<unknown> =>
|
export const approvePosterJob = (id: string | number, motions?: string[] | null): Promise<unknown> =>
|
||||||
p2vFetch(`/p2v/f1/jobs/${id}/approve`, {
|
p2vFetch(`/f1/jobs/${id}/approve`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
...(motions
|
...(motions
|
||||||
? { headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ motions }) }
|
? { headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ motions }) }
|
||||||
: {}),
|
: {}),
|
||||||
});
|
});
|
||||||
|
|
||||||
export const deletePosterJob = (id: P2vJobId): Promise<unknown> =>
|
|
||||||
p2vFetch(`/p2v/f1/jobs/${id}`, { method: 'DELETE' });
|
|
||||||
|
|
||||||
// ── 통합 콘텐츠 목록 ──────────────────────────────────────────────────
|
|
||||||
|
|
||||||
export const isP2vContent = (type: ContentType | P2vContentType): type is P2vContentType =>
|
|
||||||
type === 'p2v_video' || type === 'p2v_playreel';
|
|
||||||
|
|
||||||
export interface P2vDetailItem {
|
|
||||||
type: P2vContentType;
|
|
||||||
content_id: number;
|
|
||||||
video_url: string;
|
|
||||||
poster_url: string | null;
|
|
||||||
title: string | null;
|
|
||||||
created_at: string;
|
|
||||||
like_count: number;
|
|
||||||
is_liked_by_me: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 비로그인도 보는 공개 상세. 소유자 전용 /jobs/{id} API 와 구분한다. */
|
|
||||||
export async function getP2vContentById(type: P2vContentType, id: string): Promise<P2vDetailItem> {
|
|
||||||
const kind = type === 'p2v_video' ? 'f1' : 'playreel';
|
|
||||||
const response = await authenticatedFetch(
|
|
||||||
`${API_URL}/p2v/${kind}/${encodeURIComponent(id)}`,
|
|
||||||
{ method: 'GET' },
|
|
||||||
{ redirectOnAuthFail: false },
|
|
||||||
);
|
|
||||||
if (!response.ok) throw new Error(`HTTP error! status: ${response.status}`);
|
|
||||||
return response.json();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 내 콘텐츠에서 P2V 항목 삭제. 종류마다 테이블이 달라 경로가 갈린다.
|
* 실패 무시하고 진행 — i2v 게이트(제목 훼손 등) 실패 전용.
|
||||||
* ⚠️ `deleteVideo`(`/archive/videos/{id}`, Video.id 기준)와 혼용하면 id 가 겹치는
|
* 이미 생성된 클립으로 렌더만 이으므로 재시도와 달리 Higgsfield 재생성 비용이 없다.
|
||||||
* 엉뚱한 ADO2 영상이 지워진다.
|
* 클립 없는 실패는 서버가 409 로 거절한다.
|
||||||
*/
|
*/
|
||||||
export const deleteP2vContent = (type: P2vContentType, id: number): Promise<unknown> =>
|
export const forcePosterJob = (id: string | number): Promise<unknown> =>
|
||||||
p2vFetch(`/p2v/${type === 'p2v_video' ? 'f1' : 'playreel'}/jobs/${id}`, { method: 'DELETE' });
|
p2vFetch(`/f1/jobs/${id}/force`, { method: 'POST' });
|
||||||
|
|
||||||
|
export const retryPosterJob = (id: string | number, motions?: string[] | null): Promise<unknown> =>
|
||||||
|
p2vFetch(`/f1/jobs/${id}/retry`, {
|
||||||
|
method: 'POST',
|
||||||
|
...(motions
|
||||||
|
? { headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ motions }) }
|
||||||
|
: {}),
|
||||||
|
});
|
||||||
|
|
||||||
|
export const deletePosterJob = (id: string | number): Promise<unknown> =>
|
||||||
|
p2vFetch(`/f1/jobs/${id}`, { method: 'DELETE' });
|
||||||
|
|
||||||
|
// ── F2 (포스터 스타일링) ──────────────────────────────────────────────
|
||||||
|
|
||||||
|
export const listF2Templates = (): Promise<F2Template[]> => p2vFetch<F2Template[]>('/f2/templates');
|
||||||
|
export const listF2Categories = (): Promise<F2Category[]> => p2vFetch<F2Category[]>('/f2/categories');
|
||||||
|
export const listF2Formats = (): Promise<F2Format[]> => p2vFetch<F2Format[]>('/f2/formats');
|
||||||
|
export const getF2UploadHint = (): Promise<F2UploadHint> => p2vFetch<F2UploadHint>('/f2/upload-hint');
|
||||||
|
|
||||||
|
/** 레퍼런스 업로드 — 저장 + 화풍 분석까지 서버가 동기로 끝낸다(10초 안팎) */
|
||||||
|
export async function createF2Template(reference: File, name: string): Promise<F2Template> {
|
||||||
|
const fd = new FormData();
|
||||||
|
fd.append('reference', reference);
|
||||||
|
fd.append('name', name);
|
||||||
|
return p2vFetch<F2Template>('/f2/templates', { method: 'POST', body: fd });
|
||||||
|
}
|
||||||
|
|
||||||
|
export const deleteF2Template = (id: string): Promise<unknown> =>
|
||||||
|
p2vFetch(`/f2/templates/${id}`, { method: 'DELETE' });
|
||||||
|
|
||||||
|
export async function createStylingJob(
|
||||||
|
poster: File,
|
||||||
|
templateId: string,
|
||||||
|
format: string,
|
||||||
|
): Promise<{ id: string }> {
|
||||||
|
const fd = new FormData();
|
||||||
|
fd.append('poster', poster);
|
||||||
|
fd.append('template_id', templateId);
|
||||||
|
fd.append('format', format);
|
||||||
|
return p2vFetch<{ id: string }>('/f2/jobs', { method: 'POST', body: fd });
|
||||||
|
}
|
||||||
|
|
||||||
|
export const getStylingJob = (id: string | number): Promise<P2vJob> =>
|
||||||
|
p2vFetch<P2vJob>(`/f2/jobs/${id}`);
|
||||||
|
|
||||||
|
/** 스타일링 잡 삭제 — 내 콘텐츠 목록에서 제거. 미완성 잡은 서버가 크레딧을 환불한다 */
|
||||||
|
export const deleteStylingJob = (id: string | number): Promise<unknown> =>
|
||||||
|
p2vFetch(`/f2/jobs/${id}`, { method: 'DELETE' });
|
||||||
|
|
||||||
// ── 진행 계산 ────────────────────────────────────────────────────────
|
// ── 진행 계산 ────────────────────────────────────────────────────────
|
||||||
|
|
||||||
/** 아직 도는 중인가. 이 두 상태에서만 폴링을 계속한다 */
|
/** 아직 도는 중인가. 이 상태들에서만 폴링을 계속한다 (archiving = Blob 업로드 중) */
|
||||||
export const isP2vActive = (job: P2vJob | null): boolean =>
|
export const isP2vActive = (job: P2vJob | null): boolean =>
|
||||||
job !== null && (job.status === 'queued' || job.status === 'running');
|
job !== null
|
||||||
|
&& (job.status === 'queued' || job.status === 'running' || job.status === 'archiving');
|
||||||
|
|
||||||
/** 스테이지 진행률(%) — 선형 진행바용. 도는 중인 스테이지는 절반으로 친다 */
|
/** 스테이지 진행률(%) — 선형 진행바용. 도는 중인 스테이지는 절반으로 친다 */
|
||||||
export function p2vProgress(job: Pick<P2vJob, 'stages'> | null): number {
|
export function p2vProgress(job: P2vJob | null): number {
|
||||||
if (!job) return 0;
|
if (!job) return 0;
|
||||||
const states = Object.values(job.stages);
|
if (job.status === 'archiving') return 99; // 렌더 끝, 업로드만 남음
|
||||||
|
const states = Object.values(job.stages ?? {});
|
||||||
if (states.length === 0) return 0;
|
if (states.length === 0) return 0;
|
||||||
const done = states.filter((s) => s.status === 'done').length;
|
const done = states.filter((s) => s.status === 'done').length;
|
||||||
const running = states.some((s) => s.status === 'running') ? 0.5 : 0;
|
const running = states.some((s) => s.status === 'running') ? 0.5 : 0;
|
||||||
@@ -188,6 +311,10 @@ export function p2vProgress(job: Pick<P2vJob, 'stages'> | null): number {
|
|||||||
*/
|
*/
|
||||||
const POST_REVIEW_STAGE = 'tts';
|
const POST_REVIEW_STAGE = 'tts';
|
||||||
|
|
||||||
export const isPastReview = (job: P2vJob | null): boolean =>
|
export const isPastReview = (job: P2vJob | null): boolean => {
|
||||||
!!job && job.stages[POST_REVIEW_STAGE]?.status !== undefined
|
if (!job) return false;
|
||||||
&& job.stages[POST_REVIEW_STAGE].status !== 'idle';
|
// 아카이브 이후 조회는 stages 가 없다 — done/archiving 이면 당연히 검수 뒤다
|
||||||
|
if (job.status === 'done' || job.status === 'archiving') return true;
|
||||||
|
const st = job.stages?.[POST_REVIEW_STAGE]?.status;
|
||||||
|
return st !== undefined && st !== 'idle';
|
||||||
|
};
|
||||||
@@ -1,170 +0,0 @@
|
|||||||
/**
|
|
||||||
* Playreel(롱컷) 클라이언트 — 공연 상품페이지 URL → 30초 세로 예고편.
|
|
||||||
*
|
|
||||||
* castad 백엔드의 `/p2v/playreel/*` 를 부른다(p2vApi.ts 의 `p2vFetch` 를 공유).
|
|
||||||
* 이 파이프라인은 사람이 확인하는 **게이트 5개**에서 멈춘다. 게이트마다 검수 페이로드
|
|
||||||
* (`review`)가 오고, 승인할 때 고친 값(`edits`)을 함께 보낸다.
|
|
||||||
*
|
|
||||||
* 크레딧은 생성 요청 시점에 선차감되고, 실패하면 환불된다. 실패한 잡은 다시 돌릴 수
|
|
||||||
* 없다(새로 만든다). 다시 돌릴 수 있는 것은 클립 검수 게이트의 "다시 만들기" 뿐이다.
|
|
||||||
*/
|
|
||||||
import { P2vJobId, P2vStageState, p2vFetch } from './p2vApi';
|
|
||||||
|
|
||||||
export type GateKey =
|
|
||||||
| 'fetch_confirm'
|
|
||||||
| 'analysis_confirm'
|
|
||||||
| 'narration_confirm'
|
|
||||||
| 'clip_confirm'
|
|
||||||
| 'final_confirm';
|
|
||||||
|
|
||||||
export const GATE_ORDER: readonly GateKey[] = [
|
|
||||||
'fetch_confirm', 'analysis_confirm', 'narration_confirm', 'clip_confirm', 'final_confirm',
|
|
||||||
];
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 게이트 진행 상태. 문구는 locales 의 `playreel.gates.<key>` 에 있다.
|
|
||||||
* 되돌리기는 크레딧을 이미 쓴 지점 뒤로는 서버가 거절한다(`REVERSIBLE_GATES`).
|
|
||||||
*/
|
|
||||||
export const GATE_CAN_BACK: Record<GateKey, boolean> = {
|
|
||||||
fetch_confirm: false,
|
|
||||||
analysis_confirm: true,
|
|
||||||
narration_confirm: true,
|
|
||||||
clip_confirm: false,
|
|
||||||
final_confirm: false,
|
|
||||||
};
|
|
||||||
|
|
||||||
// ── 게이트별 검수 페이로드 (백엔드 app/p2v/worker/gate.py 와 1:1) ──────────
|
|
||||||
|
|
||||||
export interface DetailSection {
|
|
||||||
id: string;
|
|
||||||
tag: string;
|
|
||||||
label: string;
|
|
||||||
thumb_url: string;
|
|
||||||
height: number;
|
|
||||||
/** 캐스팅 스케줄은 항상 포함 */
|
|
||||||
required?: boolean;
|
|
||||||
selected: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface FetchReview {
|
|
||||||
poster_url: string;
|
|
||||||
/** 800px 이하면 저해상 경고 */
|
|
||||||
poster_width: number;
|
|
||||||
meta: { title: string; date_text: string; place: string; cast: string[]; genre: string };
|
|
||||||
sections: DetailSection[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AnalysisReview {
|
|
||||||
grid_url: string;
|
|
||||||
movable: { key: string; label: string; on: boolean }[];
|
|
||||||
fixed: { key: string; label: string; on: boolean }[];
|
|
||||||
model: string;
|
|
||||||
ip_risk: boolean;
|
|
||||||
has_qr: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface NarrationReview {
|
|
||||||
lines: { slot: string; text: string }[];
|
|
||||||
voice: { id: string; name: string; sample_url: string };
|
|
||||||
est_seconds: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ClipReview {
|
|
||||||
clip_url: string;
|
|
||||||
frames_url: string;
|
|
||||||
title_mae: number;
|
|
||||||
gate_passed: boolean;
|
|
||||||
gate_reason: string | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface FinalReview {
|
|
||||||
video_url: string;
|
|
||||||
proof_url: string;
|
|
||||||
duration: number;
|
|
||||||
checks: { key: string; label: string; ok: boolean }[];
|
|
||||||
version: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
export type GateReview =
|
|
||||||
| { gate: 'fetch_confirm'; data: FetchReview }
|
|
||||||
| { gate: 'analysis_confirm'; data: AnalysisReview }
|
|
||||||
| { gate: 'narration_confirm'; data: NarrationReview }
|
|
||||||
| { gate: 'clip_confirm'; data: ClipReview }
|
|
||||||
| { gate: 'final_confirm'; data: FinalReview };
|
|
||||||
|
|
||||||
/** 승인할 때 함께 보내는 고친 값. 게이트마다 모양이 다르다 */
|
|
||||||
export type GateEdits =
|
|
||||||
| { sections: string[]; meta: FetchReview['meta'] }
|
|
||||||
| { movable: string[]; fixed: string[]; model: string }
|
|
||||||
| { lines: string[]; voice_id: string };
|
|
||||||
|
|
||||||
export interface PlayreelJob {
|
|
||||||
id: number;
|
|
||||||
kind: 'playreel';
|
|
||||||
name: string;
|
|
||||||
status: 'queued' | 'running' | 'awaiting_review' | 'failed' | 'done';
|
|
||||||
stage: string | null;
|
|
||||||
stages: Record<string, P2vStageState>;
|
|
||||||
error: { stage: string; detail: string } | null;
|
|
||||||
/** 산출물은 Azure Blob 의 절대 URL 이다 */
|
|
||||||
artifacts: Record<string, string>;
|
|
||||||
created_at: number;
|
|
||||||
source: { url: string; goods_id: string; slug: string };
|
|
||||||
gate: GateKey | null;
|
|
||||||
review: GateReview | null;
|
|
||||||
version: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ── URL 인식 ────────────────────────────────────────────────────────────
|
|
||||||
|
|
||||||
/**
|
|
||||||
* NOL티켓/인터파크 상품 URL 에서 goodsId 를 뽑는다. 못 뽑으면 null.
|
|
||||||
* 입력 도중의 안내용이고, 판정은 서버가 같은 규칙으로 다시 한다.
|
|
||||||
*/
|
|
||||||
export function parseGoodsId(url: string): string | null {
|
|
||||||
const s = url.trim();
|
|
||||||
if (!s) return null;
|
|
||||||
const m =
|
|
||||||
// 인터파크 주소는 야놀자로 리다이렉트된다. 상품 번호는 양쪽이 같다
|
|
||||||
s.match(/nol\.yanolja\.com\/ticket\/products\/(\d{5,})/i) ??
|
|
||||||
s.match(/tickets\.interpark\.com\/goods\/(\d{5,})/i) ??
|
|
||||||
s.match(/nol\.interpark\.com\/[^?]*?(\d{8,})/i) ??
|
|
||||||
s.match(/[?&]goodsCode=(\d{5,})/i) ??
|
|
||||||
s.match(/^(\d{8,})$/);
|
|
||||||
return m ? m[1] : null;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ── API ─────────────────────────────────────────────────────────────────
|
|
||||||
|
|
||||||
const jsonBody = (body: unknown): RequestInit => ({
|
|
||||||
method: 'POST',
|
|
||||||
headers: { 'Content-Type': 'application/json' },
|
|
||||||
body: JSON.stringify(body),
|
|
||||||
});
|
|
||||||
|
|
||||||
/** 상품페이지 주소 → 잡 생성. 크레딧이 먼저 차감된다 */
|
|
||||||
export async function createPlayreelJob(url: string): Promise<{ id: string }> {
|
|
||||||
const { id } = await p2vFetch<{ id: number }>('/p2v/playreel/jobs', jsonBody({ url: url.trim() }));
|
|
||||||
// 화면은 잡 id 를 localStorage 문자열로 들고 있어 경계에서 맞춘다
|
|
||||||
return { id: String(id) };
|
|
||||||
}
|
|
||||||
|
|
||||||
export const getPlayreelJob = (id: P2vJobId): Promise<PlayreelJob> =>
|
|
||||||
p2vFetch<PlayreelJob>(`/p2v/playreel/jobs/${id}`);
|
|
||||||
|
|
||||||
/** 게이트 승인. gate 를 함께 보내 화면과 서버의 게이트가 어긋나면 서버가 409 로 막는다 */
|
|
||||||
export const approvePlayreelGate = (
|
|
||||||
id: P2vJobId, gate: GateKey, edits: GateEdits | null,
|
|
||||||
): Promise<PlayreelJob> =>
|
|
||||||
p2vFetch<PlayreelJob>(`/p2v/playreel/jobs/${id}/approve`, jsonBody({ gate, edits }));
|
|
||||||
|
|
||||||
/** 직전 게이트로 되돌린다 */
|
|
||||||
export const backPlayreelGate = (id: P2vJobId): Promise<PlayreelJob> =>
|
|
||||||
p2vFetch<PlayreelJob>(`/p2v/playreel/jobs/${id}/back`, { method: 'POST' });
|
|
||||||
|
|
||||||
/** 클립 검수 게이트에서 영상을 다시 만든다. 추가 크레딧은 차감되지 않는다 */
|
|
||||||
export const retryPlayreelClip = (id: P2vJobId): Promise<PlayreelJob> =>
|
|
||||||
p2vFetch<PlayreelJob>(`/p2v/playreel/jobs/${id}/retry`, { method: 'POST' });
|
|
||||||
|
|
||||||
export const deletePlayreelJob = (id: P2vJobId): Promise<unknown> =>
|
|
||||||
p2vFetch(`/p2v/playreel/jobs/${id}`, { method: 'DELETE' });
|
|
||||||
@@ -1,72 +0,0 @@
|
|||||||
import { useSyncExternalStore } from 'react';
|
|
||||||
import { GateKey } from './playreelApi';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 롱컷 게이트 자동 승인 설정 — playreel 원본(`lib/prefs.ts`)과 같은 방식이다.
|
|
||||||
*
|
|
||||||
* 대상은 되돌릴 수 있는 게이트(① 수집 확인, ③ 나레이션 확인)뿐이다.
|
|
||||||
* ②·④·⑤ 는 크레딧을 쓰거나 결과를 고정하는 비가역 단계라 항상 사람이 확인한다.
|
|
||||||
*
|
|
||||||
* 브라우저 localStorage 에만 저장하고 서버에는 보내지 않는다. `storageKeys.K` 에 넣지 않은 것도
|
|
||||||
* 의도적이다 — 그쪽 키는 새 프로젝트·로그아웃 때 지워지는데, 이건 사용자의 취향이라
|
|
||||||
* 생성할 때마다 다시 켜게 만들면 안 된다.
|
|
||||||
*/
|
|
||||||
export const AUTO_APPROVABLE = ['fetch_confirm', 'narration_confirm'] as const satisfies readonly GateKey[];
|
|
||||||
export type AutoApprovable = (typeof AUTO_APPROVABLE)[number];
|
|
||||||
export type AutoApprovePrefs = Partial<Record<AutoApprovable, boolean>>;
|
|
||||||
|
|
||||||
export const isAutoApprovable = (gate: GateKey | null | undefined): gate is AutoApprovable =>
|
|
||||||
!!gate && (AUTO_APPROVABLE as readonly string[]).includes(gate);
|
|
||||||
|
|
||||||
const STORAGE_KEY = 'castad_playreel_auto_approve';
|
|
||||||
const CHANGE_EVENT = 'castad:playreel-prefs';
|
|
||||||
const EMPTY: AutoApprovePrefs = {};
|
|
||||||
|
|
||||||
// useSyncExternalStore 는 같은 값이면 같은 참조를 돌려줘야 한다
|
|
||||||
let cache: { raw: string | null; value: AutoApprovePrefs } = { raw: null, value: EMPTY };
|
|
||||||
|
|
||||||
export function readAutoApprove(): AutoApprovePrefs {
|
|
||||||
let raw: string | null = null;
|
|
||||||
try {
|
|
||||||
raw = localStorage.getItem(STORAGE_KEY);
|
|
||||||
} catch {
|
|
||||||
return EMPTY; // 저장소를 못 쓰면 항상 사람이 확인한다
|
|
||||||
}
|
|
||||||
if (raw === cache.raw) return cache.value;
|
|
||||||
let value: AutoApprovePrefs = EMPTY;
|
|
||||||
try {
|
|
||||||
const parsed = raw ? JSON.parse(raw) : {};
|
|
||||||
value = Object.fromEntries(
|
|
||||||
AUTO_APPROVABLE.filter((gate) => parsed?.[gate] === true).map((gate) => [gate, true]),
|
|
||||||
);
|
|
||||||
} catch {
|
|
||||||
/* 깨진 값은 꺼진 것으로 본다 */
|
|
||||||
}
|
|
||||||
cache = { raw, value };
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function setAutoApprove(gate: AutoApprovable, on: boolean): void {
|
|
||||||
const next = { ...readAutoApprove() };
|
|
||||||
if (on) next[gate] = true;
|
|
||||||
else delete next[gate];
|
|
||||||
try {
|
|
||||||
localStorage.setItem(STORAGE_KEY, JSON.stringify(next));
|
|
||||||
} catch {
|
|
||||||
/* 프라이빗 모드 등 — 이 세션에서만 유지되지 않는다 */
|
|
||||||
}
|
|
||||||
window.dispatchEvent(new Event(CHANGE_EVENT));
|
|
||||||
}
|
|
||||||
|
|
||||||
function subscribe(onChange: () => void): () => void {
|
|
||||||
window.addEventListener(CHANGE_EVENT, onChange);
|
|
||||||
window.addEventListener('storage', onChange); // 다른 탭에서 바꾼 경우
|
|
||||||
return () => {
|
|
||||||
window.removeEventListener(CHANGE_EVENT, onChange);
|
|
||||||
window.removeEventListener('storage', onChange);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
export function useAutoApprove(): AutoApprovePrefs {
|
|
||||||
return useSyncExternalStore(subscribe, readAutoApprove, () => EMPTY);
|
|
||||||
}
|
|
||||||
@@ -50,11 +50,6 @@ export const K = {
|
|||||||
* 로그아웃으로 지워지면 시연 중 매번 다시 물어야 한다 (utils/p2vApi.ts 참조).
|
* 로그아웃으로 지워지면 시연 중 매번 다시 물어야 한다 (utils/p2vApi.ts 참조).
|
||||||
*/
|
*/
|
||||||
POSTER_JOB_ID: 'castad_poster_job_id',
|
POSTER_JOB_ID: 'castad_poster_job_id',
|
||||||
/**
|
|
||||||
* 롱컷(Playreel) 진행 중 잡 id. 포스터 영상과 같은 이유로 새로고침 복구의 근거다.
|
|
||||||
* 잡이 사라졌으면 조회가 404 로 떨어지고 GenerationFlow 가 이 키를 정리한다.
|
|
||||||
*/
|
|
||||||
PLAYREEL_JOB_ID: 'castad_playreel_job_id',
|
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -72,7 +67,6 @@ export const PROJECT_KEYS: readonly string[] = [
|
|||||||
K.PIPELINE,
|
K.PIPELINE,
|
||||||
K.SSUL_TASK_ID,
|
K.SSUL_TASK_ID,
|
||||||
K.POSTER_JOB_ID,
|
K.POSTER_JOB_ID,
|
||||||
K.PLAYREEL_JOB_ID,
|
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,91 +0,0 @@
|
|||||||
/**
|
|
||||||
* 사이트 방문 비콘 — 백엔드 `POST /track/view` 로 페이지 방문 1건을 보낸다.
|
|
||||||
*
|
|
||||||
* 쿠키·식별자를 남기지 않는다. 방문자 구분은 서버가 IP·UA·월로 만든 해시로만 한다
|
|
||||||
* (개인정보처리방침 "쿠키 없는 익명 방문 통계").
|
|
||||||
* 이 앱은 화면 이동이 모두 전체 페이지 로드라 페이지가 열릴 때 한 번만 보내면 된다.
|
|
||||||
* 로그인 콜백이 replaceState 로 쿼리를 지우기 전에 보내야 utm_source 가 남으므로 App 모듈 최상단에서 부른다.
|
|
||||||
*
|
|
||||||
* 운영자 본인 방문 제외: 그 브라우저 콘솔에서 localStorage.setItem('ado2.stats.disabled', '1')
|
|
||||||
*/
|
|
||||||
|
|
||||||
export const STATS_DISABLED_KEY = 'ado2.stats.disabled';
|
|
||||||
|
|
||||||
/** OAuth 콜백 화면 — 방문으로 치지 않는다(백엔드도 거른다) */
|
|
||||||
const EXCLUDED_PREFIXES = ['/social/'];
|
|
||||||
|
|
||||||
export interface VisitPayload {
|
|
||||||
path: string;
|
|
||||||
referrer: string | null;
|
|
||||||
utm_source: string | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function buildVisitPayload(pathname: string, search: string, referrer: string): VisitPayload {
|
|
||||||
return {
|
|
||||||
path: pathname || '/',
|
|
||||||
referrer: referrer || null,
|
|
||||||
utm_source: new URLSearchParams(search).get('utm_source'),
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
export function isExcludedPath(pathname: string): boolean {
|
|
||||||
return EXCLUDED_PREFIXES.some((prefix) => pathname.startsWith(prefix));
|
|
||||||
}
|
|
||||||
|
|
||||||
export function isStatsDisabled(storage: Pick<Storage, 'getItem'> | undefined): boolean {
|
|
||||||
try {
|
|
||||||
return storage?.getItem(STATS_DISABLED_KEY) === '1';
|
|
||||||
} catch (error) {
|
|
||||||
// 저장소가 막힌 브라우저(사생활 보호 모드 등) — 끄기 설정을 못 읽을 뿐 방문은 센다
|
|
||||||
console.warn('[VisitBeacon] localStorage unavailable:', error);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface BeaconEnv {
|
|
||||||
pathname: string;
|
|
||||||
search: string;
|
|
||||||
referrer: string;
|
|
||||||
storage: Pick<Storage, 'getItem'> | undefined;
|
|
||||||
sendBeacon: ((url: string, data: string) => boolean) | undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 개발 서버에서 비콘을 막을지. 기본은 막는다(새로고침마다 통계가 쌓이지 않게).
|
|
||||||
* 로컬에서 집계를 확인할 때만 `.env` 에 `VITE_TRAFFIC_BEACON_IN_DEV=true` 를 두고 개발 서버를 다시 띄운다.
|
|
||||||
*/
|
|
||||||
export function isBlockedInDev(isDev: boolean, enableInDev: unknown): boolean {
|
|
||||||
return isDev && String(enableInDev).trim().toLowerCase() !== 'true';
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 보냈으면 true. 개발 서버(옵션으로 끄지 않은 경우)·제외 경로·끄기 설정·sendBeacon 미지원이면 보내지 않는다. */
|
|
||||||
export function sendVisitBeacon(apiUrl: string, blockedInDev: boolean, env: BeaconEnv): boolean {
|
|
||||||
if (blockedInDev || !env.sendBeacon) return false;
|
|
||||||
if (isExcludedPath(env.pathname) || isStatsDisabled(env.storage)) return false;
|
|
||||||
|
|
||||||
const body = JSON.stringify(buildVisitPayload(env.pathname, env.search, env.referrer));
|
|
||||||
try {
|
|
||||||
// 문자열 본문은 text/plain 단순 요청이라 CORS 사전 요청이 없다
|
|
||||||
return env.sendBeacon(`${apiUrl.replace(/\/$/, '')}/track/view`, body);
|
|
||||||
} catch (error) {
|
|
||||||
console.warn('[VisitBeacon] send failed:', error);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 브라우저 값으로 한 번 보낸다. */
|
|
||||||
export function sendVisitBeaconFromBrowser(apiUrl: string, blockedInDev: boolean): boolean {
|
|
||||||
let storage: Storage | undefined;
|
|
||||||
try {
|
|
||||||
storage = window.localStorage;
|
|
||||||
} catch (error) {
|
|
||||||
console.warn('[VisitBeacon] localStorage unavailable:', error);
|
|
||||||
}
|
|
||||||
return sendVisitBeacon(apiUrl, blockedInDev, {
|
|
||||||
pathname: window.location.pathname,
|
|
||||||
search: window.location.search,
|
|
||||||
referrer: document.referrer,
|
|
||||||
storage,
|
|
||||||
sendBeacon: typeof navigator.sendBeacon === 'function' ? navigator.sendBeacon.bind(navigator) : undefined,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
@@ -10,6 +10,13 @@ export default defineConfig({
|
|||||||
server: {
|
server: {
|
||||||
port: 3000,
|
port: 3000,
|
||||||
host: '0.0.0.0',
|
host: '0.0.0.0',
|
||||||
|
// 도커 컨테이너가 Windows 바인드 마운트를 감시할 때 inotify 이벤트가 오지 않아
|
||||||
|
// HMR 이 전혀 동작하지 않는다(호스트에서 파일을 고쳐도 옛 모듈을 계속 서빙).
|
||||||
|
// 2026-08-26 실측: 1시간 편집에 HMR 이벤트 0건 → 폴링으로 전환.
|
||||||
|
watch: {
|
||||||
|
usePolling: true,
|
||||||
|
interval: 500,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
plugins: [react()],
|
plugins: [react()],
|
||||||
resolve: {
|
resolve: {
|
||||||
|
|||||||
Reference in new issue
Block a user