Compare commits

..
13 Commits
Author SHA1 Message Date
skkim 2e187ec193 feat: SEO/AEO용 FAQ 페이지 및 메타데이터 추가
- faq.html 신설: 소상공인 매장 홍보 영상 비브랜드 검색어 대상 Q&A 26개 + FAQPage JSON-LD
- index.html: title/description 보강, canonical·OG·Twitter Card, Organization/WebSite/SoftwareApplication JSON-LD
- robots.txt, sitemap.xml, llms.txt 추가
2026-10-12 13:45:06 +09:00
HyeongBaeYang 1128712170 Merge branch 'feature/video-official-site-overlay': 영상 종료 전 공식 링크 오버레이 2026-08-21 11:46:37 +09:00
HyeongBaeYangandClaude Fable 5 e328fc950c feat: 업체 직접 입력 시 공식 홈페이지 링크 입력란 추가
- BusinessNameInputModal에 선택 입력 URL 필드 추가 (프로토콜 미입력 시 https:// 보정)
- onManualInput 콜백 체인(officialSiteUrl) 확장
- POST /marketing 요청 body에 official_site_url 전달 (미입력 시 null)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DKTAqpFj8pbWzgvq7MRDHk
2026-08-21 10:56:39 +09:00
HyeongBaeYangandClaude Fable 5 547dd415c5 fix: 영상 링크 오버레이 문구를 '자세히 보기'로 변경
official_site_url이 네이버 플레이스/인스타그램 등 업체 대표 링크일 수 있어
중립적인 문구로 조정

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DKTAqpFj8pbWzgvq7MRDHk
2026-08-21 10:50:23 +09:00
HyeongBaeYangandClaude Fable 5 cea60e70db feat: 영상 종료 3초 전 공식 홈페이지 링크 오버레이 표시
- VideoDetailItem/VideoListItem에 official_site_url 필드 추가
- 플레이어 onTimeUpdate로 잔여 3초 감지, 링크 카드 오버레이 노출
- official_site_url이 null이면 오버레이 미렌더링

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DKTAqpFj8pbWzgvq7MRDHk
2026-08-21 10:45:15 +09:00
skkim 0d3167c1a2 fix: 공유하기 수정 2026-08-20 16:35:17 +09:00
skkim bdb581459d feat(social): 업로드 폼에 저장된 영상 SEO 메타데이터를 표시
값이 있으면 DB 결과를 바로 채우고, 없으면 video_id 기준으로 한 번만 생성한다.
2026-08-19 10:19:54 +09:00
skkim 63d60caabd fix: 이전 공유하기 기능 제거 2026-08-18 17:23:42 +09:00
skkim e400884eb7 fix: 공통으로 공유하기 사용하도록 변경 2026-08-18 14:56:38 +09:00
skkim 3566c1f7bc feat: 영상 공유·포스터 썸네일·좋아요 상태를 서버 연동으로 전환 2026-08-18 11:02:29 +09:00
skkim 9c0c3de35f UI 수정 2026-08-14 15:29:39 +09:00
skkim 1cdb47ec2e perf: 이미지 미리보기를 축소 썸네일로 전환
- 원본 대신 400px 썸네일을 렌더해 디코딩/메모리 부담 감소
- 중복 파일은 추가하지 않고 안내
- 이미지 개수 카운터(n/100) 표시
- objectURL 해제 누락 지점 보완
2026-08-12 10:58:13 +09:00
skkim 23938871b0 feat: 이미지 업로드를 압축 후 순차 전송 방식으로 전환 2026-08-11 17:07:57 +09:00
30 changed files with 1604 additions and 417 deletions

No files matched your search

+62 -4
View File
@@ -4,15 +4,73 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>ADO2</title>
<title>ADO2 - AI 마케팅 영상 자동 제작·SNS 배포 플랫폼</title>
<!-- ① 페이지 설명 -->
<meta name="description" content="ADO2는 ㈜에이아이오투오의 AI 기반 마케팅 자동화 플랫폼입니다. 콘텐츠 제작부터 채널 배포까지 자동으로 처리합니다." />
<meta name="description" content="ADO2는 ㈜에이아이오투오의 AI 기반 마케팅 자동화 플랫폼입니다. 업체명이나 네이버 지도 URL만 입력하면 비즈니스 정보를 분석해 홍보용 음악·자막·영상을 자동으로 만들고 SNS에 바로 배포합니다." />
<link rel="canonical" href="https://ado2.o2osolution.ai/" />
<!-- ② Open Graph 제목 -->
<meta property="og:title" content="ADO2 - AI 마케팅 자동화 플랫폼" />
<meta property="og:title" content="ADO2 - AI 마케팅 영상 자동 제작·SNS 배포 플랫폼" />
<!-- ③ Open Graph 설명 -->
<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: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="네이버 지도 URL이나 업체명만 입력하면 AI가 매장을 분석해 홍보 음악과 숏폼 영상을 만들고 YouTube까지 자동으로 배포합니다." />
<meta name="twitter:image" content="https://ado2.o2osolution.ai/assets/images/ado2_image.png" />
<!-- ④ 구조화 데이터 (검색엔진·AI 답변 엔진용) -->
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@graph": [
{
"@type": "Organization",
"@id": "https://ado2.o2osolution.ai/#organization",
"name": "㈜에이아이오투오",
"url": "https://ado2.o2osolution.ai/",
"logo": "https://ado2.o2osolution.ai/assets/images/ado2_image.png",
"email": "o2oteam@o2o.kr",
"telephone": "+82-70-4260-8310",
"address": {
"@type": "PostalAddress",
"streetAddress": "옥산로 111, 5층 유니콘랩 대구 A05호",
"addressLocality": "북구",
"addressRegion": "대구광역시",
"addressCountry": "KR"
}
},
{
"@type": "WebSite",
"@id": "https://ado2.o2osolution.ai/#website",
"name": "ADO2",
"url": "https://ado2.o2osolution.ai/",
"inLanguage": "ko-KR",
"publisher": { "@id": "https://ado2.o2osolution.ai/#organization" }
},
{
"@type": "SoftwareApplication",
"name": "ADO2",
"url": "https://ado2.o2osolution.ai/",
"applicationCategory": "BusinessApplication",
"operatingSystem": "Web",
"inLanguage": "ko-KR",
"description": "업체명이나 네이버 지도 URL만 입력하면 AI가 비즈니스 정보를 분석해 홍보용 음악·자막·영상을 자동으로 제작하고, 완성된 영상을 다운로드하거나 SNS에 바로 업로드할 수 있는 마케팅 자동화 플랫폼입니다.",
"featureList": [
"비즈니스 핵심 정보 분석 (홈페이지, 네이버 지도, 블로그 URL)",
"홍보 콘텐츠 자동 제작 (음악, 자막, 영상)",
"멀티채널 자동 배포 (SNS 업로드)"
],
"publisher": { "@id": "https://ado2.o2osolution.ai/#organization" }
}
]
}
</script>
<link rel="icon" type="image/svg+xml" href="/favicon_32.svg" sizes="32x32">
<link rel="icon" type="image/svg+xml" href="/favicon_48.svg" sizes="48x48">
<!-- Meta Pixel Code -->
Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

+364
View File
@@ -0,0 +1,364 @@
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>소상공인 매장 홍보 영상 만들기 FAQ - 펜션·음식점·카페·미용실 | ADO2</title>
<meta name="description" content="가게 홍보 영상 만드는 법, 펜션·음식점·카페·미용실 유튜브 쇼츠 제작 팁, 홍보 음악과 사진 준비 방법까지. 영상 편집 없이 AI로 매장 홍보 영상을 만드는 방법을 정리했습니다." />
<link rel="canonical" href="https://ado2.o2osolution.ai/faq.html" />
<meta property="og:title" content="소상공인 매장 홍보 영상 만들기 FAQ - 펜션·음식점·카페·미용실 | ADO2" />
<meta property="og:description" content="가게 홍보 영상 만드는 법, 펜션·음식점·카페·미용실 유튜브 쇼츠 제작 팁, 홍보 음악과 사진 준비 방법까지. 영상 편집 없이 AI로 매장 홍보 영상을 만드는 방법을 정리했습니다." />
<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" />
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "FAQPage",
"url": "https://ado2.o2osolution.ai/faq.html",
"inLanguage": "ko-KR",
"dateModified": "2026-10-12",
"publisher": {
"@type": "Organization",
"name": "㈜에이아이오투오",
"url": "https://ado2.o2osolution.ai/"
},
"mainEntity": [
{
"@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": "단골 고객에게는 카카오톡처럼 평소 연락하는 채널로 영상을 직접 보내는 것이 가장 확실합니다. 영상 링크를 보내면 고객이 지인에게 다시 공유하기도 쉬워 입소문 효과를 기대할 수 있습니다. ADO2 영상 페이지에서는 카카오톡, 페이스북, X(트위터)로 바로 공유하거나 영상 URL을 복사할 수 있고, MP4 파일로 내려받아 원하는 곳에 올릴 수도 있습니다."
}
},
{
"@type": "Question",
"name": "ADO2는 어떤 서비스인가요?",
"acceptedAnswer": {
"@type": "Answer",
"text": "ADO2는 ㈜에이아이오투오가 운영하는 AI 마케팅 자동화 플랫폼입니다. 매장 정보를 입력하면 AI가 브랜드를 분석하고, 홍보용 음악과 자막이 들어간 영상을 자동으로 제작한 뒤 YouTube 업로드와 예약 게시까지 한 번에 처리합니다. 펜션, 음식점, 카페, 미용실처럼 지역 기반으로 운영되는 소상공인을 위해 만들어졌습니다."
}
},
{
"@type": "Question",
"name": "ADO2로 홍보 영상을 만드는 데 시간이 얼마나 걸리나요?",
"acceptedAnswer": {
"@type": "Answer",
"text": "ADO2에서 가사 생성은 약 30~60초, 음악 생성은 약 1~2분, 영상 생성은 약 2~3분이 걸립니다. 이미지를 고르는 시간을 포함해도 대부분 10분 안팎으로 홍보 영상 한 편을 완성할 수 있습니다."
}
},
{
"@type": "Question",
"name": "ADO2의 AI 브랜드 분석에서는 무엇을 알려주나요?",
"acceptedAnswer": {
"@type": "Answer",
"text": "ADO2의 브랜드 분석은 매장 정보를 바탕으로 브랜드 정체성, 입지 특성, 시장 포지셔닝, 핵심 가치, 주요 고객 유형, 주요 셀링 포인트, 추천 타겟 키워드를 정리해 줍니다. 이 분석 결과는 이후 가사와 영상 제작에 그대로 반영됩니다."
}
},
{
"@type": "Question",
"name": "ADO2는 어떻게 시작하나요?",
"acceptedAnswer": {
"@type": "Answer",
"text": "ADO2는 카카오 계정으로 간편하게 가입하고 로그인할 수 있습니다. 음악과 영상을 생성할 때는 크레딧이 사용되며, 보유 크레딧은 내 정보 화면에서 확인하고 부족하면 서비스 안에서 충전을 요청할 수 있습니다."
}
},
{
"@type": "Question",
"name": "다른 매장이 ADO2로 만든 홍보 영상 예시를 볼 수 있나요?",
"acceptedAnswer": {
"@type": "Answer",
"text": "네, ADO2 콘텐츠 메뉴에서 다른 매장들이 만든 홍보 영상을 볼 수 있습니다. 지역과 업체명으로 검색할 수 있고, 최신순, 좋아요 많은순, 댓글 많은순으로 정렬해 업종별 영상 예시를 참고할 수 있습니다."
}
},
{
"@type": "Question",
"name": "ADO2를 운영하는 회사는 어디인가요?",
"acceptedAnswer": {
"@type": "Answer",
"text": "ADO2는 ㈜에이아이오투오가 개발하고 운영합니다. 본사는 대구광역시 북구 옥산로 111에 있으며, 연구소는 경기도 성남시 수정구 금토로 32 KT 판교빌딩에 있습니다. 서비스 문의는 이메일 o2oteam@o2o.kr로 할 수 있습니다."
}
}
]
}
</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>소상공인 매장 홍보 영상 만들기 FAQ</h1>
<p class="updated"><strong>최종 수정일:</strong> <time datetime="2026-10-12">2026년 10월 12일</time></p>
<p>펜션, 음식점, 카페, 미용실을 운영하는 소상공인이 매장 홍보 영상을 만들 때 자주 묻는 질문을 정리했습니다. 영상 편집 경험이 없어도 AI로 홍보 영상을 만드는 방법과 업종별 촬영·업로드 팁을 안내합니다.</p>
<nav>
<ul>
<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="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&amp;B나 힙합이 잘 어울리는 편입니다. ADO2에서는 K-POP, POP, 발라드, Hip-Hop, R&amp;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>단골 고객에게는 카카오톡처럼 평소 연락하는 채널로 영상을 직접 보내는 것이 가장 확실합니다. 영상 링크를 보내면 고객이 지인에게 다시 공유하기도 쉬워 입소문 효과를 기대할 수 있습니다. ADO2 영상 페이지에서는 카카오톡, 페이스북, X(트위터)로 바로 공유하거나 영상 URL을 복사할 수 있고, MP4 파일로 내려받아 원하는 곳에 올릴 수도 있습니다.</p>
</section>
<section id="ado2">
<h2>ADO2 이용 안내</h2>
<h3>ADO2는 어떤 서비스인가요?</h3>
<p>ADO2는 ㈜에이아이오투오가 운영하는 AI 마케팅 자동화 플랫폼입니다. 매장 정보를 입력하면 AI가 브랜드를 분석하고, 홍보용 음악과 자막이 들어간 영상을 자동으로 제작한 뒤 YouTube 업로드와 예약 게시까지 한 번에 처리합니다. 펜션, 음식점, 카페, 미용실처럼 지역 기반으로 운영되는 소상공인을 위해 만들어졌습니다.</p>
<h3>ADO2로 홍보 영상을 만드는 데 시간이 얼마나 걸리나요?</h3>
<p>ADO2에서 가사 생성은 약 30~60초, 음악 생성은 약 1~2분, 영상 생성은 약 2~3분이 걸립니다. 이미지를 고르는 시간을 포함해도 대부분 10분 안팎으로 홍보 영상 한 편을 완성할 수 있습니다.</p>
<h3>ADO2의 AI 브랜드 분석에서는 무엇을 알려주나요?</h3>
<p>ADO2의 브랜드 분석은 매장 정보를 바탕으로 브랜드 정체성, 입지 특성, 시장 포지셔닝, 핵심 가치, 주요 고객 유형, 주요 셀링 포인트, 추천 타겟 키워드를 정리해 줍니다. 이 분석 결과는 이후 가사와 영상 제작에 그대로 반영됩니다.</p>
<h3>ADO2는 어떻게 시작하나요?</h3>
<p>ADO2는 카카오 계정으로 간편하게 가입하고 로그인할 수 있습니다. 음악과 영상을 생성할 때는 크레딧이 사용되며, 보유 크레딧은 내 정보 화면에서 확인하고 부족하면 서비스 안에서 충전을 요청할 수 있습니다.</p>
<h3>다른 매장이 ADO2로 만든 홍보 영상 예시를 볼 수 있나요?</h3>
<p>네, ADO2 콘텐츠 메뉴에서 다른 매장들이 만든 홍보 영상을 볼 수 있습니다. 지역과 업체명으로 검색할 수 있고, 최신순, 좋아요 많은순, 댓글 많은순으로 정렬해 업종별 영상 예시를 참고할 수 있습니다.</p>
<h3>ADO2를 운영하는 회사는 어디인가요?</h3>
<p>ADO2는 ㈜에이아이오투오가 개발하고 운영합니다. 본사는 대구광역시 북구 옥산로 111에 있으며, 연구소는 경기도 성남시 수정구 금토로 32 KT 판교빌딩에 있습니다. 서비스 문의는 이메일 o2oteam@o2o.kr로 할 수 있습니다.</p>
</section>
<p style="margin-top:40px; font-size:14px; color:#999;"><a href="/">ADO2 홈</a> · <a href="/terms.html">서비스 약관</a> · <a href="/privacy.html">개인정보처리방침</a></p>
</body>
</html>
+21
View File
@@ -0,0 +1,21 @@
# ADO2
> ADO2는 ㈜에이아이오투오가 운영하는 AI 기반 마케팅 자동화 플랫폼입니다. 업체명이나 네이버 지도 URL만 입력하면 비즈니스 정보를 분석해 홍보용 음악·자막·영상을 자동으로 제작하고, 완성된 영상을 다운로드하거나 SNS에 바로 업로드할 수 있습니다.
## 주요 기능
- 비즈니스 핵심 정보 분석: 홈페이지, 네이버 지도, 블로그 등의 URL이나 업체명을 입력하면 업체 정보를 자동으로 가져와 분석합니다.
- 홍보 콘텐츠 자동 제작: 분석한 정보를 바탕으로 비즈니스에 맞는 가사, 음악, 자막, 영상을 자동으로 제작합니다.
- 멀티채널 자동 배포: 완성된 영상을 다운로드하거나 SNS 채널에 바로 업로드할 수 있습니다.
- 직접 입력 지원: 네이버 지도/플레이스에 등록되지 않은 업체도 업체명, 지역, 상세 주소, 업종만 입력하면 영상 제작까지 가능합니다.
## 페이지
- [소상공인 매장 홍보 영상 만들기 FAQ](https://ado2.o2osolution.ai/faq.html): 가게 홍보 영상 만드는 법, 펜션·음식점·카페·미용실 업종별 숏폼 제작 팁, 홍보 음악·사진 준비, ADO2 이용 안내
- [서비스 약관](https://ado2.o2osolution.ai/terms.html)
- [개인정보처리방침](https://ado2.o2osolution.ai/privacy.html)
## 운영사
- 회사명: ㈜에이아이오투오
- 문의: o2oteam@o2o.kr
+29
View File
@@ -0,0 +1,29 @@
User-agent: *
Allow: /
Disallow: /social/
User-agent: GPTBot
Allow: /
Disallow: /social/
User-agent: OAI-SearchBot
Allow: /
Disallow: /social/
User-agent: ClaudeBot
Allow: /
Disallow: /social/
User-agent: PerplexityBot
Allow: /
Disallow: /social/
User-agent: Google-Extended
Allow: /
Disallow: /social/
User-agent: Yeti
Allow: /
Disallow: /social/
Sitemap: https://ado2.o2osolution.ai/sitemap.xml
+19
View File
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://ado2.o2osolution.ai/</loc>
<lastmod>2026-10-12</lastmod>
</url>
<url>
<loc>https://ado2.o2osolution.ai/faq.html</loc>
<lastmod>2026-10-12</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>
+2 -2
View File
@@ -354,14 +354,14 @@ const App: React.FC = () => {
};
// 업체명·주소 수동 입력으로 마케팅 분석 API 호출
const handleManualInput = async (businessName: string, address: string, category: string) => {
const handleManualInput = async (businessName: string, address: string, category: string, officialSiteUrl?: string) => {
setAfterLoadTarget('generation_flow');
setViewMode('loading');
setIsAnalysisComplete(false);
setError(null);
try {
const data = await marketingAnalysis(businessName, address, category);
const data = await marketingAnalysis(businessName, address, category, officialSiteUrl);
if (!validateCrawlingResponse(data)) {
throw new Error(t('app.autocompleteError'));
+21 -2
View File
@@ -5,7 +5,7 @@ import CitySelectModal, { REGIONS } from './CitySelectModal';
interface BusinessNameInputModalProps {
onClose: () => void;
onSubmit: (businessName: string, address: string, category: string) => void;
onSubmit: (businessName: string, address: string, category: string, officialSiteUrl: string) => void;
}
const BusinessNameInputModal: React.FC<BusinessNameInputModalProps> = ({ onClose, onSubmit }) => {
@@ -14,6 +14,7 @@ const BusinessNameInputModal: React.FC<BusinessNameInputModalProps> = ({ onClose
const [selectedCity, setSelectedCity] = useState('');
const [detailAddress, setDetailAddress] = useState('');
const [category, setCategory] = useState('');
const [officialSiteUrl, setOfficialSiteUrl] = useState('');
const [isCityModalOpen, setIsCityModalOpen] = useState(false);
useEffect(() => {
@@ -42,7 +43,12 @@ const BusinessNameInputModal: React.FC<BusinessNameInputModalProps> = ({ onClose
const handleSubmit = () => {
if (!isValid) return;
const fullAddress = `${selectedCity} ${detailAddress.trim()}`;
onSubmit(businessName.trim(), fullAddress, category.trim());
// 프로토콜 없이 입력하면 https:// 를 붙여서 전달
const trimmedUrl = officialSiteUrl.trim();
const normalizedUrl = trimmedUrl && !/^https?:\/\//i.test(trimmedUrl)
? `https://${trimmedUrl}`
: trimmedUrl;
onSubmit(businessName.trim(), fullAddress, category.trim(), normalizedUrl);
onClose();
};
@@ -118,6 +124,19 @@ const BusinessNameInputModal: React.FC<BusinessNameInputModalProps> = ({ onClose
/>
</div>
<div className="manual-modal-field">
<label className="manual-modal-label">{t('landing.hero.manualLabelSiteUrl')}</label>
<input
type="url"
className="manual-modal-input"
placeholder={t('landing.hero.manualPlaceholderSiteUrl')}
value={officialSiteUrl}
onChange={e => setOfficialSiteUrl(e.target.value)}
onKeyDown={handleKeyDown}
maxLength={2048}
/>
</div>
<div className="manual-modal-actions">
<button type="button" className="manual-modal-cancel" onClick={onClose}>
{t('common.cancel')}
+15 -136
View File
@@ -1,12 +1,13 @@
import React, { useEffect, useLayoutEffect, useRef, useState } from 'react';
import { createPortal } from 'react-dom';
import React, { useRef, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { toggleVideoLike } from '../utils/api';
import { API_URL, toggleVideoLike } from '../utils/api';
import { buildVideoShareUrl, tryNativeShare } from '../utils/nativeShare';
interface ContentCardSocialActionsProps {
videoId: number;
storeName: string;
region?: string;
title?: string | null;
commentCount: number;
initialLikeCount: number;
initialIsLiked?: boolean;
@@ -15,7 +16,7 @@ interface ContentCardSocialActionsProps {
const ContentCardSocialActions: React.FC<ContentCardSocialActionsProps> = ({
videoId,
storeName,
region,
title,
commentCount,
initialLikeCount,
initialIsLiked = false,
@@ -24,101 +25,27 @@ const ContentCardSocialActions: React.FC<ContentCardSocialActionsProps> = ({
const [likeCount, setLikeCount] = useState(initialLikeCount);
const [isLiked, setIsLiked] = useState(initialIsLiked);
const [copied, setCopied] = useState(false);
const [shareMenuOpen, setShareMenuOpen] = useState(false);
const [menuPos, setMenuPos] = useState<{ top: number; left: number } | null>(null);
const [anchorRect, setAnchorRect] = useState<{ top: number; bottom: number; left: number } | null>(null);
const shareBtnRef = useRef<HTMLButtonElement>(null);
const shareMenuRef = useRef<HTMLDivElement>(null);
const likeDebounceRef = useRef<ReturnType<typeof setTimeout> | null>(null);
const shareUrl = `${window.location.origin}/video/${videoId}`;
const shareUrl = buildVideoShareUrl(API_URL, videoId);
const shareTitle = title || storeName || t('videoDetail.kakaoDefaultTitle');
useEffect(() => {
if (!shareMenuOpen) return;
const handleShareBtnClick = async (e: React.MouseEvent) => {
e.stopPropagation();
const closeMenu = () => setShareMenuOpen(false);
const handleClickOutside = (e: MouseEvent) => {
if (
shareMenuRef.current && !shareMenuRef.current.contains(e.target as Node) &&
shareBtnRef.current && !shareBtnRef.current.contains(e.target as Node)
) {
closeMenu();
}
};
document.addEventListener('mousedown', handleClickOutside);
window.addEventListener('scroll', closeMenu, true);
window.addEventListener('resize', closeMenu);
return () => {
document.removeEventListener('mousedown', handleClickOutside);
window.removeEventListener('scroll', closeMenu, true);
window.removeEventListener('resize', closeMenu);
};
}, [shareMenuOpen]);
// 메뉴가 뷰포트 밖으로 넘어가지 않도록 실제 렌더된 크기 기준으로 위치 보정
useLayoutEffect(() => {
if (!shareMenuOpen || !anchorRect || !shareMenuRef.current) return;
const margin = 8;
const menuRect = shareMenuRef.current.getBoundingClientRect();
let left = anchorRect.left;
if (left + menuRect.width > window.innerWidth - margin) {
left = window.innerWidth - menuRect.width - margin;
const handled = await tryNativeShare({
title: shareTitle,
url: shareUrl,
});
if (handled) {
return;
}
left = Math.max(margin, left);
let top = anchorRect.bottom + 6;
if (top + menuRect.height > window.innerHeight - margin) {
top = anchorRect.top - menuRect.height - 6;
}
top = Math.max(margin, top);
setMenuPos((prev) => (prev && prev.top === top && prev.left === left ? prev : { top, left }));
}, [shareMenuOpen, anchorRect]);
const handleCopyLink = async () => {
try {
await navigator.clipboard.writeText(shareUrl);
} catch {
// clipboard API 미지원 환경에서는 무시
}
setCopied(true);
setTimeout(() => setCopied(false), 2000);
};
const handleKakaoShare = () => {
const kakao = window.Kakao;
if (kakao?.Share) {
kakao.Share.sendDefault({
objectType: 'feed',
content: {
title: storeName || t('videoDetail.kakaoDefaultTitle'),
description: t('videoDetail.kakaoDescription', { region: region ?? '' }),
imageUrl: 'https://ado2.o2osolution.ai/favicon_48.svg',
link: { mobileWebUrl: shareUrl, webUrl: shareUrl },
},
buttons: [{ title: t('videoDetail.kakaoButtonTitle'), link: { mobileWebUrl: shareUrl, webUrl: shareUrl } }],
});
} else if (navigator.share) {
navigator.share({ url: shareUrl }).catch(() => {});
} else {
handleCopyLink();
}
setShareMenuOpen(false);
};
const handleFacebookShare = () => {
window.open(`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(shareUrl)}`, '_blank', 'noopener,width=600,height=600');
setShareMenuOpen(false);
};
const handleTwitterShare = () => {
window.open(`https://twitter.com/intent/tweet?url=${encodeURIComponent(shareUrl)}`, '_blank', 'noopener,width=600,height=600');
setShareMenuOpen(false);
};
const handleLikeClick = (e: React.MouseEvent) => {
@@ -144,17 +71,6 @@ const ContentCardSocialActions: React.FC<ContentCardSocialActionsProps> = ({
}, 500);
};
const handleShareBtnClick = (e: React.MouseEvent) => {
e.stopPropagation();
const rect = shareBtnRef.current?.getBoundingClientRect();
if (rect) {
// 초기 추정 위치(측정 전 첫 렌더용) — useLayoutEffect가 실제 크기 기준으로 다시 보정한다
setAnchorRect({ top: rect.top, bottom: rect.bottom, left: rect.left });
setMenuPos({ top: rect.bottom + 6, left: rect.left });
}
setShareMenuOpen((v) => !v);
};
return (
<div className="content-card-social" onClick={(e) => e.stopPropagation()}>
<button
@@ -175,7 +91,6 @@ const ContentCardSocialActions: React.FC<ContentCardSocialActionsProps> = ({
</span>
<button
ref={shareBtnRef}
className="content-card-share-btn"
onClick={handleShareBtnClick}
title={t('videoDetail.share')}
@@ -185,42 +100,6 @@ const ContentCardSocialActions: React.FC<ContentCardSocialActionsProps> = ({
<line x1="8.59" y1="13.51" x2="15.42" y2="17.49" /><line x1="15.41" y1="6.51" x2="8.59" y2="10.49" />
</svg>
</button>
{shareMenuOpen && menuPos && createPortal(
<div
ref={shareMenuRef}
className="video-detail-share-menu"
style={{ position: 'fixed', top: menuPos.top, left: menuPos.left }}
>
<button className="video-detail-share-item" onClick={handleKakaoShare}>
<svg width="18" height="18" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="20" height="20" rx="4" fill="#FEE500" />
<path fillRule="evenodd" clipRule="evenodd" d="M10 3.5C6.134 3.5 3 6.01 3 9.1c0 1.98 1.2 3.72 3.01 4.76l-.74 2.75a.19.19 0 0 0 .28.21l3.37-2.23c.34.04.69.06 1.06.06 3.866 0 7-2.51 7-5.6S13.866 3.5 10 3.5z" fill="#3C1E1E" />
</svg>
{t('videoDetail.shareKakao')}
</button>
<button className="video-detail-share-item" onClick={handleFacebookShare}>
<svg width="18" height="18" viewBox="0 0 24 24" fill="#1877F2">
<path d="M24 12.073C24 5.405 18.627 0 12 0S0 5.405 0 12.073C0 18.1 4.388 23.094 10.125 24v-8.437H7.078v-3.49h3.047V9.41c0-3.025 1.792-4.697 4.533-4.697 1.312 0 2.686.235 2.686.235v2.97h-1.513c-1.491 0-1.956.93-1.956 1.887v2.268h3.328l-.532 3.49h-2.796V24C19.612 23.094 24 18.1 24 12.073z" />
</svg>
{t('videoDetail.shareFacebook')}
</button>
<button className="video-detail-share-item" onClick={handleTwitterShare}>
<svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor">
<path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z" />
</svg>
{t('videoDetail.shareTwitter')}
</button>
<button className="video-detail-share-item" onClick={() => { handleCopyLink(); setShareMenuOpen(false); }}>
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
<rect x="9" y="9" width="13" height="13" rx="2" />
<path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" />
</svg>
{copied ? t('videoDetail.copied') : t('videoDetail.copyUrl')}
</button>
</div>,
document.body
)}
</div>
);
};
+3 -3
View File
@@ -38,7 +38,7 @@ const extractUrl = (text: string): string | null => {
interface SearchInputFormProps {
onAnalyze?: (value: string, type: SearchType) => void;
onAutocomplete?: (data: AutocompleteRequest) => void;
onManualInput?: (businessName: string, address: string, category: string) => void;
onManualInput?: (businessName: string, address: string, category: string, officialSiteUrl?: string) => void;
/** 직접입력 버튼 클릭 시 기본 동작(모달 열기)을 대체합니다. 제공 시 모달을 직접 관리해야 합니다. */
onManualButtonClick?: () => void;
error?: string | null;
@@ -340,9 +340,9 @@ const SearchInputForm: React.FC<SearchInputFormProps> = ({
{!onManualButtonClick && isManualModalOpen && (
<BusinessNameInputModal
onClose={() => setIsManualModalOpen(false)}
onSubmit={(businessName, address, category) => {
onSubmit={(businessName, address, category, officialSiteUrl) => {
setIsManualModalOpen(false);
onManualInput?.(businessName, address, category);
onManualInput?.(businessName, address, category, officialSiteUrl);
}}
/>
)}
+23 -33
View File
@@ -142,10 +142,7 @@ const SocialPostingModal: React.FC<SocialPostingModalProps> = ({
const channelDropdownRef = useRef<HTMLDivElement>(null);
const privacyDropdownRef = useRef<HTMLDivElement>(null);
const hasBeenOpenedRef = useRef(false);
const loadedForTaskIdRef = useRef<string | null>(null);
const loadedAtRef = useRef<number>(0);
const seoCache = useRef<Map<string, { title: string; description: string; tags: string }>>(new Map());
const SEO_CACHE_TTL = 50 * 60 * 1000;
const loadedForVideoIdRef = useRef<number | null>(null);
// Upload progress modal state
const [showUploadProgress, setShowUploadProgress] = useState(false);
@@ -212,28 +209,30 @@ const SocialPostingModal: React.FC<SocialPostingModalProps> = ({
// 소셜 계정 로드
useEffect(() => {
if (!isOpen) return;
const now = Date.now();
if (!isOpen) {
loadedForVideoIdRef.current = null;
return;
}
loadSocialAccounts();
const taskId = video?.task_id ?? null;
const expired = now - loadedAtRef.current > SEO_CACHE_TTL;
if (taskId && (taskId !== loadedForTaskIdRef.current || expired)) {
loadedForTaskIdRef.current = taskId;
loadedAtRef.current = now;
loadAutocomplete();
} else if (taskId) {
const cached = seoCache.current.get(taskId);
if (cached) {
setTitle(cached.title);
setDescription(cached.description);
setTags(cached.tags);
}
const videoId = video?.video_id ?? null;
if (!videoId || videoId === loadedForVideoIdRef.current) {
return;
}
}, [isOpen, video?.task_id]);
loadedForVideoIdRef.current = videoId;
if (video?.title) {
setTitle(video.title);
setDescription(video.description || '');
setTags((video.hashtags || []).join(','));
setIsLoadingAutoDescription(false);
return;
}
loadAutocomplete();
}, [isOpen, video?.video_id, video?.title, video?.description, video?.hashtags]);
const loadSocialAccounts = async () => {
setIsLoadingAccounts(true);
@@ -259,29 +258,20 @@ const SocialPostingModal: React.FC<SocialPostingModalProps> = ({
};
const loadAutocomplete = async () => {
if (!video?.task_id) return;
if (!video?.video_id) return;
setIsLoadingAutoDescription(true);
try {
const requestPayload = {
task_id : video.task_id,
video_id: video.video_id,
};
// Call autoSEO API
console.log('[Upload] Request payload:', requestPayload);
const autoSeoResponse = await getAutoSeoYoutube(requestPayload);
// 각 필드가 있을 때만 덮어씌움 (기존 값 보호)
if (autoSeoResponse.title) setTitle(autoSeoResponse.title);
if (autoSeoResponse.description) setDescription(autoSeoResponse.description);
if (autoSeoResponse.keywords) setTags(autoSeoResponse.keywords.join(','));
seoCache.current.set(video.task_id, {
title: autoSeoResponse.title || '',
description: autoSeoResponse.description || '',
tags: autoSeoResponse.keywords?.join(',') || '',
});
} catch (error) {
console.error('Failed to load autocomplete:', error);
// 실패해도 사용자에게 별도 알림 없이 조용히 처리
} finally {
setIsLoadingAutoDescription(false);
}
+100 -143
View File
@@ -7,8 +7,11 @@ import {
deleteComment,
toggleVideoLike,
isLoggedIn,
getUserMe,
API_URL,
} from '../utils/api';
import { VideoDetailItem, CommentItem } from '../types/api';
import { VideoDetailItem, CommentItem, UserMeResponse } from '../types/api';
import { buildVideoShareUrl, tryNativeShare } from '../utils/nativeShare';
import LoginPromptModal from './LoginPromptModal';
interface VideoDetailContentProps {
@@ -29,8 +32,8 @@ const VideoDetailContent: React.FC<VideoDetailContentProps> = ({ videoId, isModa
const [isLiked, setIsLiked] = useState(false);
const [copied, setCopied] = useState(false);
const [shareMenuOpen, setShareMenuOpen] = useState(false);
const [isLandscape, setIsLandscape] = useState(false);
const [showSiteOverlay, setShowSiteOverlay] = useState(false);
const [showLoginModal, setShowLoginModal] = useState(false);
const [comments, setComments] = useState<CommentItem[]>([]);
@@ -42,16 +45,7 @@ const VideoDetailContent: React.FC<VideoDetailContentProps> = ({ videoId, isModa
const [commentSubmitting, setCommentSubmitting] = useState(false);
const commentTextareaRef = useRef<HTMLTextAreaElement>(null);
const [commentNickname, setCommentNickname] = useState('');
const [commentAvatarSeedIdx, setCommentAvatarSeedIdx] = useState(0);
// 고정 seed 목록: 브라우저가 캐싱하여 중복 요청 없음
const AVATAR_SEEDS = ['42', '77', '123', '256', '512', '888', '1024', '2048', '3141', '9999'];
const commentAvatarSeed = AVATAR_SEEDS[commentAvatarSeedIdx % AVATAR_SEEDS.length];
const handleChangeAvatar = useCallback(() => {
setCommentAvatarSeedIdx(prev => (prev + 1) % AVATAR_SEEDS.length);
}, []);
const [currentUser, setCurrentUser] = useState<UserMeResponse | null>(null);
const fetchComments = useCallback(async (page: number, append = false) => {
setCommentsLoading(true);
@@ -75,6 +69,7 @@ const VideoDetailContent: React.FC<VideoDetailContentProps> = ({ videoId, isModa
const fetchVideo = async () => {
setLoading(true);
setError(null);
setShowSiteOverlay(false);
try {
const data = await getVideoById(videoId);
setVideo(data);
@@ -92,6 +87,13 @@ const VideoDetailContent: React.FC<VideoDetailContentProps> = ({ videoId, isModa
fetchComments(1);
}, [videoId, fetchComments]);
useEffect(() => {
if (!authed) return;
getUserMe().then(setCurrentUser).catch((err) => {
console.error('Failed to fetch current user:', err);
});
}, [authed]);
const formatDate = (dateString: string) => {
const date = new Date(dateString);
return t('videoDetail.dateFormat', { year: date.getFullYear(), month: date.getMonth() + 1, day: date.getDate() });
@@ -102,7 +104,8 @@ const VideoDetailContent: React.FC<VideoDetailContentProps> = ({ videoId, isModa
return `${date.getFullYear()}.${String(date.getMonth() + 1).padStart(2, '0')}.${String(date.getDate()).padStart(2, '0')}`;
};
const shareUrl = `${window.location.origin}/video/${videoId}`;
const shareUrl = buildVideoShareUrl(API_URL, videoId);
const shareTitle = video?.title || video?.store_name || t('videoDetail.kakaoDefaultTitle');
const handleCopyLink = async () => {
try {
@@ -114,50 +117,17 @@ const VideoDetailContent: React.FC<VideoDetailContentProps> = ({ videoId, isModa
setTimeout(() => setCopied(false), 2000);
};
const handleKakaoShare = () => {
const kakao = window.Kakao;
if (kakao?.Share) {
kakao.Share.sendDefault({
objectType: 'feed',
content: {
title: video?.store_name ?? t('videoDetail.kakaoDefaultTitle'),
description: t('videoDetail.kakaoDescription', { region: video?.region ?? '' }),
imageUrl: 'https://ado2.o2osolution.ai/favicon_48.svg',
link: { mobileWebUrl: shareUrl, webUrl: shareUrl },
},
buttons: [{ title: t('videoDetail.kakaoButtonTitle'), link: { mobileWebUrl: shareUrl, webUrl: shareUrl } }],
});
} else if (navigator.share) {
navigator.share({ url: shareUrl }).catch(() => {});
} else {
handleCopyLink();
const handleShareButtonClick = async () => {
const handled = await tryNativeShare({
title: shareTitle,
url: shareUrl,
});
if (handled) {
return;
}
setShareMenuOpen(false);
await handleCopyLink();
};
const handleFacebookShare = () => {
window.open(`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(shareUrl)}`, '_blank', 'noopener,width=600,height=600');
setShareMenuOpen(false);
};
const handleTwitterShare = () => {
window.open(`https://twitter.com/intent/tweet?url=${encodeURIComponent(shareUrl)}`, '_blank', 'noopener,width=600,height=600');
setShareMenuOpen(false);
};
const shareMenuRef = React.useRef<HTMLDivElement>(null);
useEffect(() => {
if (!shareMenuOpen) return;
const handleClickOutside = (e: MouseEvent) => {
if (shareMenuRef.current && !shareMenuRef.current.contains(e.target as Node)) {
setShareMenuOpen(false);
}
};
document.addEventListener('mousedown', handleClickOutside);
return () => document.removeEventListener('mousedown', handleClickOutside);
}, [shareMenuOpen]);
const likeDebounceRef = React.useRef<ReturnType<typeof setTimeout> | null>(null);
const handleLike = () => {
@@ -197,13 +167,11 @@ const VideoDetailContent: React.FC<VideoDetailContentProps> = ({ videoId, isModa
if (!commentInput.trim() || commentSubmitting) return;
setCommentSubmitting(true);
try {
await postVideoComment(videoId, commentInput.trim(), commentNickname);
await postVideoComment(videoId, commentInput.trim());
setCommentInput('');
if (commentTextareaRef.current) {
commentTextareaRef.current.style.height = 'auto';
}
setCommentNickname('');
setCommentAvatarSeedIdx(prev => (prev + 1) % AVATAR_SEEDS.length);
await fetchComments(1);
} catch (err) {
console.error('Failed to post comment:', err);
@@ -255,18 +223,46 @@ const VideoDetailContent: React.FC<VideoDetailContentProps> = ({ videoId, isModa
<div className="ado2-contents-error"><p>{error}</p></div>
) : video ? (
<div className={`video-detail-content ${isLandscape ? 'landscape' : ''}`}>
<video
src={video.result_movie_url}
controls
autoPlay
controlsList="nodownload"
onContextMenu={(e) => e.preventDefault()}
className="video-detail-player"
onLoadedMetadata={(e) => {
const v = e.currentTarget;
setIsLandscape(v.videoWidth > v.videoHeight);
}}
/>
<div className="video-detail-player-wrap">
<video
src={video.result_movie_url}
controls
autoPlay
controlsList="nodownload"
onContextMenu={(e) => e.preventDefault()}
className="video-detail-player"
onLoadedMetadata={(e) => {
const v = e.currentTarget;
setIsLandscape(v.videoWidth > v.videoHeight);
}}
onTimeUpdate={(e) => {
if (!video.official_site_url) return;
const v = e.currentTarget;
// 영상 종료 3초 전부터 공식 홈페이지 오버레이 노출
setShowSiteOverlay(
Number.isFinite(v.duration) && v.duration - v.currentTime <= 3
);
}}
/>
{video.official_site_url && showSiteOverlay && (
<a
href={video.official_site_url}
target="_blank"
rel="noopener noreferrer"
className="video-site-overlay"
>
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
<circle cx="12" cy="12" r="10"/>
<line x1="2" y1="12" x2="22" y2="12"/>
<path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"/>
</svg>
<span className="video-site-overlay-text">
<strong>{video.store_name}</strong>
{t('videoDetail.siteOverlayLabel')}
</span>
</a>
)}
</div>
<div className="video-detail-info">
<h2 className="video-detail-store">{video.store_name}</h2>
@@ -284,52 +280,17 @@ const VideoDetailContent: React.FC<VideoDetailContentProps> = ({ videoId, isModa
</svg>
{likeCount}
</button>
<div style={{ position: 'relative' }} ref={shareMenuRef}>
<button
className="video-detail-copy-btn"
onClick={() => setShareMenuOpen(v => !v)}
>
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
<circle cx="18" cy="5" r="3"/><circle cx="6" cy="12" r="3"/><circle cx="18" cy="19" r="3"/>
<line x1="8.59" y1="13.51" x2="15.42" y2="17.49"/><line x1="15.41" y1="6.51" x2="8.59" y2="10.49"/>
</svg>
{copied ? t('videoDetail.copied') : t('videoDetail.share')}
</button>
{shareMenuOpen && (
<div className="video-detail-share-menu">
{/* 카카오톡 */}
<button className="video-detail-share-item" onClick={handleKakaoShare}>
<svg width="18" height="18" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="20" height="20" rx="4" fill="#FEE500"/>
<path fillRule="evenodd" clipRule="evenodd" d="M10 3.5C6.134 3.5 3 6.01 3 9.1c0 1.98 1.2 3.72 3.01 4.76l-.74 2.75a.19.19 0 0 0 .28.21l3.37-2.23c.34.04.69.06 1.06.06 3.866 0 7-2.51 7-5.6S13.866 3.5 10 3.5z" fill="#3C1E1E"/>
</svg>
{t('videoDetail.shareKakao')}
</button>
{/* 페이스북 */}
<button className="video-detail-share-item" onClick={handleFacebookShare}>
<svg width="18" height="18" viewBox="0 0 24 24" fill="#1877F2">
<path d="M24 12.073C24 5.405 18.627 0 12 0S0 5.405 0 12.073C0 18.1 4.388 23.094 10.125 24v-8.437H7.078v-3.49h3.047V9.41c0-3.025 1.792-4.697 4.533-4.697 1.312 0 2.686.235 2.686.235v2.97h-1.513c-1.491 0-1.956.93-1.956 1.887v2.268h3.328l-.532 3.49h-2.796V24C19.612 23.094 24 18.1 24 12.073z"/>
</svg>
{t('videoDetail.shareFacebook')}
</button>
{/* X (트위터) */}
<button className="video-detail-share-item" onClick={handleTwitterShare}>
<svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor">
<path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"/>
</svg>
{t('videoDetail.shareTwitter')}
</button>
{/* URL 복사 */}
<button className="video-detail-share-item" onClick={() => { handleCopyLink(); setShareMenuOpen(false); }}>
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
<rect x="9" y="9" width="13" height="13" rx="2"/>
<path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/>
</svg>
{copied ? t('videoDetail.copied') : t('videoDetail.copyUrl')}
</button>
</div>
)}
</div>
<button
className="video-detail-copy-btn"
onClick={handleShareButtonClick}
title={t('videoDetail.share')}
>
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
<circle cx="18" cy="5" r="3"/><circle cx="6" cy="12" r="3"/><circle cx="18" cy="19" r="3"/>
<line x1="8.59" y1="13.51" x2="15.42" y2="17.49"/><line x1="15.41" y1="6.51" x2="8.59" y2="10.49"/>
</svg>
{copied ? t('videoDetail.copied') : t('videoDetail.share')}
</button>
</div>
{/* 댓글 섹션 */}
@@ -339,25 +300,17 @@ const VideoDetailContent: React.FC<VideoDetailContentProps> = ({ videoId, isModa
<span className="video-detail-comments-count">{commentsTotal}</span>
</div>
{/* 댓글 작성자 프로필 선택 */}
{authed && (
{/* 댓글 작성자 프로필 (카카오 로그인 정보) */}
{authed && currentUser && (
<div className="video-detail-comment-profile">
<img
src={`https://api.dicebear.com/9.x/pixel-art/svg?seed=${commentAvatarSeed}`}
alt={t('videoDetail.changeAvatarTitle')}
className="video-detail-comment-avatar"
onClick={handleChangeAvatar}
style={{ cursor: 'pointer' }}
title={t('videoDetail.changeAvatarTitle')}
/>
<input
className="video-detail-nickname-input"
type="text"
placeholder={t('videoDetail.nicknamePlaceholder')}
value={commentNickname}
onChange={(e) => setCommentNickname(e.target.value)}
maxLength={20}
/>
{currentUser.profile_image_url && (
<img
src={currentUser.profile_image_url}
alt={currentUser.nickname}
className="video-detail-comment-avatar"
/>
)}
<span className="video-detail-comment-nickname">{currentUser.nickname}</span>
</div>
)}
@@ -398,11 +351,13 @@ const VideoDetailContent: React.FC<VideoDetailContentProps> = ({ videoId, isModa
<ul className="video-detail-comment-list">
{comments.map((c) => (
<li key={c.id} className="video-detail-comment-item">
<img
src={`https://api.dicebear.com/9.x/pixel-art/svg?seed=${c.id}`}
alt="avatar"
className="video-detail-comment-avatar"
/>
{c.profile_image_url && (
<img
src={c.profile_image_url}
alt={c.nickname || t('videoDetail.anonymous')}
className="video-detail-comment-avatar"
/>
)}
<div className="video-detail-comment-body">
<span className="video-detail-comment-nickname">
{c.nickname || t('videoDetail.anonymous')}
@@ -427,11 +382,13 @@ const VideoDetailContent: React.FC<VideoDetailContentProps> = ({ videoId, isModa
<ul className="video-detail-reply-list">
{c.replies.map((r) => (
<li key={r.id} className="video-detail-reply-item">
<img
src={`https://api.dicebear.com/9.x/pixel-art/svg?seed=${r.id}`}
alt="avatar"
className="video-detail-comment-avatar small"
/>
{r.profile_image_url && (
<img
src={r.profile_image_url}
alt={r.nickname || t('videoDetail.anonymous')}
className="video-detail-comment-avatar small"
/>
)}
<div className="video-detail-comment-body">
<span className="video-detail-comment-nickname">
{r.nickname || t('videoDetail.anonymous')}
+11 -5
View File
@@ -208,7 +208,9 @@
"manualPlaceholderAddress": "Enter the address",
"manualPlaceholderRegion": "Select a region",
"manualPlaceholderDetail": "Enter detail address (e.g. Gangnam-gu Teheran-ro 123)",
"manualPlaceholderCategory": "Enter the business category (e.g. pension, cafe, salon)"
"manualPlaceholderCategory": "Enter the business category (e.g. pension, cafe, salon)",
"manualLabelSiteUrl": "Website link (optional)",
"manualPlaceholderSiteUrl": "Enter the official website URL (e.g. https://example.com)"
},
"welcome": {
"title": "Welcome to ADO2.AI",
@@ -260,15 +262,21 @@
"selectedImages": "Selected Images",
"imageAlt": "Image",
"uploadBadge": "Uploaded",
"previewUnavailable": "No preview",
"imageUpload": "Image Upload",
"dragAndDrop": "Drag & drop or\nclick to upload",
"videoRatio": "Video Ratio",
"minImages": "Min. 5 images",
"minImages": "Recommended 30+ images",
"youtubeShorts": "YouTube Shorts",
"youtubeVideo": "YouTube Video",
"back": "Go Back",
"loadMore": "Load more",
"uploadFailed": "Image upload failed.",
"uploadErrorTitle": "Image Upload Error",
"uploadErrorConfirm": "OK",
"duplicateSkippedTitle": "Duplicate Images Skipped",
"duplicateSkippedMessage": "Skipped {{count}} image(s) that were already added.",
"preparingPreviews": "Preparing previews ({{done}} / {{total}})",
"uploading": "Uploading... (30 sec – 1 min)",
"nextStep": "Next Step"
},
@@ -614,18 +622,16 @@
"dateFormat": "{{month}}/{{day}}/{{year}}",
"kakaoDefaultTitle": "ADO2 Video",
"kakaoDescription": "{{region}} · ADO2 AI Marketing Video",
"kakaoButtonTitle": "Watch Video",
"deletedComment": "(This comment has been deleted.)",
"closeAriaLabel": "Close",
"share": "Share",
"copied": "Copied!",
"siteOverlayLabel": "View more",
"shareKakao": "KakaoTalk",
"shareFacebook": "Facebook",
"shareTwitter": "X (Twitter)",
"copyUrl": "Copy URL",
"commentsTitle": "Comments",
"changeAvatarTitle": "Click to change avatar",
"nicknamePlaceholder": "Author name",
"commentPlaceholder": "Write a comment...",
"commentLoginRequired": "Please log in to write a comment",
"commentSubmitting": "Submitting",
+11 -5
View File
@@ -207,7 +207,9 @@
"manualPlaceholderAddress": "주소를 입력하세요.",
"manualPlaceholderRegion": "지역을 선택하세요.",
"manualPlaceholderDetail": "상세 주소를 입력하세요. (예: 강남구 테헤란로 123)",
"manualPlaceholderCategory": "업종을 입력하세요. (예: 펜션, 카페, 미용실)"
"manualPlaceholderCategory": "업종을 입력하세요. (예: 펜션, 카페, 미용실)",
"manualLabelSiteUrl": "홈페이지 링크 (선택)",
"manualPlaceholderSiteUrl": "공식 홈페이지 주소를 입력하세요. (예: https://example.com)"
},
"welcome": {
"title": "ADO2.AI에 오신 것을 환영합니다.",
@@ -259,15 +261,21 @@
"selectedImages": "선택된 이미지",
"imageAlt": "이미지",
"uploadBadge": "업로드",
"previewUnavailable": "미리보기 없음",
"imageUpload": "이미지 업로드",
"dragAndDrop": "이미지를 끌어다 놓거나\n클릭하여 업로드",
"videoRatio": "영상 비율",
"minImages": "최소 5장",
"minImages": "권장 30장 이상",
"youtubeShorts": "유튜브 쇼츠",
"youtubeVideo": "유튜브 일반",
"back": "뒤로가기",
"loadMore": "더보기",
"uploadFailed": "이미지 업로드에 실패했습니다.",
"uploadErrorTitle": "이미지 업로드 초과",
"uploadErrorConfirm": "확인",
"duplicateSkippedTitle": "중복 이미지 제외",
"duplicateSkippedMessage": "이미 추가된 이미지 {{count}}장을 제외했습니다.",
"preparingPreviews": "미리보기 준비 중 ({{done}} / {{total}})",
"uploading": "업로드 중 (30~60초 소요)",
"nextStep": "다음 단계"
},
@@ -613,18 +621,16 @@
"dateFormat": "{{year}}년 {{month}}월 {{day}}일",
"kakaoDefaultTitle": "ADO2 영상",
"kakaoDescription": "{{region}} · ADO2 AI 마케팅 영상",
"kakaoButtonTitle": "영상 보기",
"deletedComment": "(삭제된 댓글입니다.)",
"closeAriaLabel": "닫기",
"share": "공유하기",
"copied": "복사됨!",
"siteOverlayLabel": "자세히 보기",
"shareKakao": "카카오톡",
"shareFacebook": "페이스북",
"shareTwitter": "X (트위터)",
"copyUrl": "URL 복사",
"commentsTitle": "댓글",
"changeAvatarTitle": "클릭하여 아바타 변경",
"nicknamePlaceholder": "작성자 이름",
"commentPlaceholder": "댓글을 입력하세요...",
"commentLoginRequired": "로그인 후 댓글을 작성할 수 있습니다",
"commentSubmitting": "작성 중",
+10 -1
View File
@@ -151,7 +151,15 @@ const ADO2ContentsPage: React.FC<ADO2ContentsPageProps> = () => {
onKeyDown={(e) => e.key === 'Enter' && handleCardClick(video.video_id)}
>
<div className="content-card-thumbnail ado2-gallery-thumbnail-wrap">
{video.thumbnail_url ? (
{video.poster_url ? (
<img
src={video.poster_url}
alt={video.store_name}
loading="lazy"
decoding="async"
className="content-video-preview"
/>
) : video.thumbnail_url ? (
<img
src={video.thumbnail_url}
alt={video.store_name}
@@ -186,6 +194,7 @@ const ADO2ContentsPage: React.FC<ADO2ContentsPageProps> = () => {
videoId={video.video_id}
storeName={video.store_name}
region={video.region}
title={video.title}
commentCount={video.comment_count ?? 0}
initialLikeCount={video.like_count ?? 0}
initialIsLiked={video.is_liked_by_me}
+152 -35
View File
@@ -3,13 +3,19 @@ import React, { useRef, useState, useEffect } from 'react';
import { useTranslation } from 'react-i18next';
import { ImageItem, ImageUrlItem } from '../../types/api';
import { uploadImages } from '../../utils/api';
import { isImageInputFile } from '../../utils/imageCompression.ts';
import { MAX_IMAGES_PER_UPLOAD_TASK } from '../../utils/imageUpload.ts';
import { splitDuplicateFiles } from '../../utils/imageDedup.ts';
interface AssetManagementContentProps {
onNext: (imageTaskId: string) => void;
onBack?: () => void;
imageList: ImageItem[];
onRemoveImage: (index: number) => void;
onAddImages: (files: File[]) => void;
onAddImages: (
files: File[],
onProgress: (done: number, total: number) => void
) => Promise<void>;
}
type VideoRatio = 'vertical' | 'horizontal';
@@ -27,9 +33,11 @@ const AssetManagementContent: React.FC<AssetManagementContentProps> = ({
const fileInputRef = useRef<HTMLInputElement>(null);
const [isUploading, setIsUploading] = useState(false);
const [uploadProgress, setUploadProgress] = useState(0);
const [uploadError, setUploadError] = useState<string | null>(null);
// 업로드 실패와 중복 제외 안내가 같은 다이얼로그 마크업을 공유한다.
const [dialog, setDialog] = useState<{ title: string; message: string } | null>(null);
const [videoRatio, setVideoRatio] = useState<VideoRatio>('vertical');
const [displayCount, setDisplayCount] = useState(IMAGES_PER_PAGE);
const [thumbnailProgress, setThumbnailProgress] = useState<{ done: number; total: number } | null>(null);
useEffect(() => {
const savedRatio = localStorage.getItem('castad_video_ratio') as VideoRatio;
@@ -38,12 +46,26 @@ const AssetManagementContent: React.FC<AssetManagementContentProps> = ({
}
}, []);
useEffect(() => {
if (!dialog) return;
const handleEscape = (event: KeyboardEvent) => {
if (event.key === 'Escape') {
event.preventDefault();
setDialog(null);
}
};
window.addEventListener('keydown', handleEscape);
return () => window.removeEventListener('keydown', handleEscape);
}, [dialog]);
const handleVideoRatioChange = (ratio: VideoRatio) => {
setVideoRatio(ratio);
localStorage.setItem('castad_video_ratio', ratio);
};
const getImageSrc = (item: ImageItem): string => {
const getImageSrc = (item: ImageItem): string | null => {
return item.type === 'url' ? item.preview_url : item.preview;
};
@@ -52,7 +74,7 @@ const AssetManagementContent: React.FC<AssetManagementContentProps> = ({
setIsUploading(true);
setUploadProgress(0);
setUploadError(null);
setDialog(null);
const interval = setInterval(() => {
setUploadProgress(prev => {
@@ -85,13 +107,37 @@ const AssetManagementContent: React.FC<AssetManagementContentProps> = ({
} catch (error) {
clearInterval(interval);
console.error('Image upload failed:', error);
setUploadError(error instanceof Error ? error.message : t('assetManagement.uploadFailed'));
setDialog({
title: t('assetManagement.uploadErrorTitle'),
message: error instanceof Error ? error.message : t('assetManagement.uploadFailed'),
});
} finally {
setIsUploading(false);
setUploadProgress(0);
}
};
const runAddImages = async (files: File[]) => {
const { newFiles, duplicateCount } = splitDuplicateFiles(imageList, files);
if (newFiles.length > 0) {
setThumbnailProgress({ done: 0, total: newFiles.length });
try {
await onAddImages(newFiles, (done, total) => setThumbnailProgress({ done, total }));
} finally {
setThumbnailProgress(null);
}
}
// 썸네일 생성 오버레이에 가려지지 않도록 작업이 끝난 뒤에 안내한다.
if (duplicateCount > 0) {
setDialog({
title: t('assetManagement.duplicateSkippedTitle'),
message: t('assetManagement.duplicateSkippedMessage', { count: duplicateCount }),
});
}
};
const handleDragOver = (e: React.DragEvent) => {
e.preventDefault();
e.stopPropagation();
@@ -100,10 +146,8 @@ const AssetManagementContent: React.FC<AssetManagementContentProps> = ({
const handleDrop = (e: React.DragEvent) => {
e.preventDefault();
e.stopPropagation();
const files = Array.from(e.dataTransfer.files).filter((file: File) =>
file.type.startsWith('image/')
);
if (files.length > 0) onAddImages(files);
const files = Array.from(e.dataTransfer.files).filter(isImageInputFile);
if (files.length > 0) void runAddImages(files);
};
const handleFileSelect = () => {
@@ -113,7 +157,7 @@ const AssetManagementContent: React.FC<AssetManagementContentProps> = ({
const handleFileChange = (e: React.ChangeEvent<HTMLInputElement>) => {
const files = e.target.files;
if (files && files.length > 0) {
onAddImages(Array.from(files));
void runAddImages(Array.from(files));
e.target.value = '';
}
};
@@ -123,6 +167,25 @@ const AssetManagementContent: React.FC<AssetManagementContentProps> = ({
return (
<main className="asset-page">
{thumbnailProgress && (
<div className="asset-upload-overlay">
<div className="asset-upload-overlay-content">
<div className="loading-spinner">
<div className="loading-ring"></div>
<div className="loading-dot">
<div className="loading-dot-inner"></div>
</div>
</div>
<p className="comp2-loading-text">
{t('assetManagement.preparingPreviews', {
done: thumbnailProgress.done,
total: thumbnailProgress.total,
})}
</p>
</div>
</div>
)}
{isUploading && (
<div className="asset-upload-overlay">
<div className="asset-upload-overlay-content">
@@ -146,6 +209,37 @@ const AssetManagementContent: React.FC<AssetManagementContentProps> = ({
</div>
)}
{dialog && (
<div
className="asset-upload-error-overlay"
onClick={() => setDialog(null)}
>
<div
className="asset-upload-error-dialog"
role="alertdialog"
aria-modal="true"
aria-labelledby="asset-upload-error-title"
aria-describedby="asset-upload-error-message"
onClick={(event) => event.stopPropagation()}
>
<h2 id="asset-upload-error-title" className="asset-upload-error-title">
{dialog.title}
</h2>
<p id="asset-upload-error-message" className="asset-upload-error-message">
{dialog.message}
</p>
<button
type="button"
className="asset-upload-error-confirm"
onClick={() => setDialog(null)}
autoFocus
>
{t('assetManagement.uploadErrorConfirm')}
</button>
</div>
</div>
)}
{/* Fixed Header - 뒤로가기 버튼 */}
<div className="asset-sticky-header">
{onBack && (
@@ -169,6 +263,13 @@ const AssetManagementContent: React.FC<AssetManagementContentProps> = ({
<div className="asset-section-header-left">
<h3 className="asset-section-title">{t('assetManagement.selectedImages')}</h3>
<span className="asset-section-subtitle">{t('assetManagement.minImages')}</span>
<span
className={`asset-section-count${
imageList.length > MAX_IMAGES_PER_UPLOAD_TASK ? ' asset-section-count-over' : ''
}`}
>
{imageList.length} / {MAX_IMAGES_PER_UPLOAD_TASK}
</span>
</div>
<button onClick={handleFileSelect} className="asset-mobile-upload-btn">
<svg width="16" height="16" viewBox="0 0 16 16" fill="none">
@@ -182,27 +283,46 @@ const AssetManagementContent: React.FC<AssetManagementContentProps> = ({
<div className="asset-image-list">
{visibleImages.length > 0 && (
<div className="asset-image-grid">
{visibleImages.map((item, i) => (
<div key={i} className="asset-image-item">
<img
src={getImageSrc(item)}
alt={`${t('assetManagement.imageAlt')} ${i + 1}`}
referrerPolicy="no-referrer"
/>
{item.type === 'file' && (
<div className="asset-image-badge">{t('assetManagement.uploadBadge')}</div>
)}
<button
onClick={() => onRemoveImage(i)}
className="asset-image-remove"
>
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5">
<line x1="18" y1="6" x2="6" y2="18"/>
<line x1="6" y1="6" x2="18" y2="18"/>
</svg>
</button>
</div>
))}
{visibleImages.map((item, i) => {
const src = getImageSrc(item);
const fileName = item.type === 'file' ? item.file.name : '';
return (
<div key={i} className="asset-image-item">
{src ? (
<img
src={src}
alt={`${t('assetManagement.imageAlt')} ${i + 1}`}
referrerPolicy="no-referrer"
loading="lazy"
decoding="async"
/>
) : (
<div className="asset-image-placeholder" title={fileName}>
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
<rect x="3" y="3" width="18" height="18" rx="2"/>
<circle cx="8.5" cy="8.5" r="1.5"/>
<path d="M21 15l-5-5L5 21"/>
</svg>
<span className="asset-image-placeholder-name">
{fileName || t('assetManagement.previewUnavailable')}
</span>
</div>
)}
{item.type === 'file' && (
<div className="asset-image-badge">{t('assetManagement.uploadBadge')}</div>
)}
<button
onClick={() => onRemoveImage(i)}
className="asset-image-remove"
>
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5">
<line x1="18" y1="6" x2="6" y2="18"/>
<line x1="6" y1="6" x2="18" y2="18"/>
</svg>
</button>
</div>
);
})}
</div>
)}
</div>
@@ -268,9 +388,6 @@ const AssetManagementContent: React.FC<AssetManagementContentProps> = ({
{/* Fixed Footer - 다음 단계 버튼 */}
<div className="asset-sticky-footer">
{uploadError && (
<p className="text-red-500 text-sm mb-2">{uploadError}</p>
)}
<button
onClick={handleNextWithUpload}
disabled={imageList.length === 0 || isUploading}
@@ -283,7 +400,7 @@ const AssetManagementContent: React.FC<AssetManagementContentProps> = ({
<input
ref={fileInputRef}
type="file"
accept="image/*"
accept="image/*,.heic,.heif"
multiple
onChange={handleFileChange}
className="hidden"
@@ -563,6 +563,7 @@ const CompletionContent: React.FC<CompletionContentProps> = ({
created_at: new Date().toISOString(),
like_count: 0,
comment_count: 0,
is_liked_by_me: false,
} : null}
/>
+47 -11
View File
@@ -20,6 +20,7 @@ import { useTutorial } from '../../components/Tutorial/useTutorial';
import { TUTORIAL_KEYS } from '../../components/Tutorial/tutorialSteps';
import TutorialOverlay, { TutorialRestartPopup } from '../../components/Tutorial/TutorialOverlay';
import WizardStepper from '../../components/WizardStepper';
import { createPreviewThumbnail } from '../../utils/imageCompression.ts';
const WIZARD_STEP_KEY = 'castad_wizard_step';
const ACTIVE_ITEM_KEY = 'castad_active_item';
@@ -28,6 +29,15 @@ const IMAGE_TASK_ID_KEY = 'castad_image_task_id';
const ANALYSIS_DATA_KEY = 'castad_analysis_data';
import { saveSearchHistory } from '../../components/SearchHistory/useSearchHistory';
/** 파일 이미지의 썸네일 objectURL 을 일괄 해제한다. preview 가 null 인 항목은 건너뛴다. */
const revokeAllPreviews = (items: ImageItem[]) => {
items.forEach(item => {
if (item.type === 'file' && item.preview) {
URL.revokeObjectURL(item.preview);
}
});
};
// 다른 컴포넌트에서 사용하는 storage key들 (초기화용)
const SONG_GENERATION_KEY = 'castad_song_generation';
const VIDEO_GENERATION_KEY = 'castad_video_generation';
@@ -175,6 +185,15 @@ const GenerationFlow: React.FC<GenerationFlowProps> = ({
};
const [imageList, setImageList] = useState<ImageItem[]>(getInitialImageList());
const imageListRef = useRef<ImageItem[]>(imageList);
imageListRef.current = imageList;
// 의존성 배열에 imageList 를 넣으면 이미지를 추가할 때마다 cleanup 이 돌아
// 방금 만든 썸네일이 즉시 revoke 된다. 반드시 빈 배열이어야 한다.
useEffect(() => {
return () => revokeAllPreviews(imageListRef.current);
}, []);
const prevAnalysisMIdRef = useRef<number | null | undefined>(analysisData?.m_id);
// analysisData 변경 시 m_id가 바뀐 경우(새로운 분석)에만 imageList 업데이트
@@ -183,6 +202,8 @@ const GenerationFlow: React.FC<GenerationFlowProps> = ({
console.log('[GenerationFlow] analysisData updated, m_id:', analysisData?.m_id);
if (analysisData?.image_list && analysisData.image_list.length > 0) {
if (prevAnalysisMIdRef.current !== analysisData.m_id) {
// 목록을 통째로 교체하므로 기존 파일 썸네일을 먼저 해제한다.
revokeAllPreviews(imageListRef.current);
setImageList(analysisData.image_list.map(item => ({ type: 'url' as const, url: item.original, preview_url: item.preview })));
}
}
@@ -192,21 +213,35 @@ const GenerationFlow: React.FC<GenerationFlowProps> = ({
const handleRemoveImage = (index: number) => {
setImageList(prev => {
const item = prev[index];
// 파일 이미지인 경우 메모리 해제
if (item.type === 'file') {
// 파일 이미지인 경우 썸네일 메모리 해제 (생성 실패 시 preview 는 null)
if (item.type === 'file' && item.preview) {
URL.revokeObjectURL(item.preview);
}
return prev.filter((_, i) => i !== index);
});
};
const handleAddImages = (files: File[]) => {
const newImages: ImageItem[] = files.map(file => ({
type: 'file',
file,
preview: URL.createObjectURL(file),
}));
// 새로 업로드된 이미지를 배열 앞에 추가 (최신 이미지가 상단에 표시)
const handleAddImages = async (
files: File[],
onProgress: (done: number, total: number) => void
) => {
const total = files.length;
const newImages: ImageItem[] = [];
onProgress(0, total);
// 반드시 순차 처리한다. Promise.all 로 동시에 돌리면 원본 크기 비트맵이
// 한꺼번에 메모리에 올라가, 이 작업이 없애려던 문제가 그대로 재현된다.
for (const file of files) {
const preview = await createPreviewThumbnail(file);
newImages.push({ type: 'file', file, preview });
onProgress(newImages.length, total);
// 진행률이 실제로 화면에 그려지도록 매 장마다 렌더링 기회를 넘긴다.
await new Promise(resolve => setTimeout(resolve, 0));
}
// 장마다 setState 하면 그리드가 N 번 재조정된다. 전부 끝난 뒤 한 번만 반영한다.
// 새로 추가된 이미지를 배열 앞에 둔다 (최신 이미지가 상단에 표시)
setImageList(prev => [...newImages, ...prev]);
};
@@ -218,6 +253,7 @@ const GenerationFlow: React.FC<GenerationFlowProps> = ({
setSongTaskId(null);
setImageTaskId(null);
setAnalysisData(null);
revokeAllPreviews(imageListRef.current);
setImageList([]);
onHome();
};
@@ -263,13 +299,13 @@ const GenerationFlow: React.FC<GenerationFlowProps> = ({
};
// 업체명·주소 수동 입력으로 마케팅 분석 API 호출
const handleManualInput = async (businessName: string, address: string, category: string) => {
const handleManualInput = async (businessName: string, address: string, category: string, officialSiteUrl?: string) => {
goToWizardStep(-1);
setIsAnalysisComplete(false);
setAnalysisError(null);
try {
const data = await marketingAnalysis(businessName, address, category);
const data = await marketingAnalysis(businessName, address, category, officialSiteUrl);
if (data.processed_info) {
data.processed_info.customer_name = data.processed_info.customer_name || businessName;
+10 -1
View File
@@ -248,7 +248,15 @@ const MyContentsPage: React.FC<MyContentsPageProps> = ({ onNavigate }) => {
style={{ cursor: 'pointer' }}
onClick={() => setSelectedVideoId(video.video_id)}
>
{video.result_movie_url ? (
{video.poster_url ? (
<img
src={video.poster_url}
alt={video.store_name}
loading="lazy"
decoding="async"
className="content-video-preview"
/>
) : video.result_movie_url ? (
<VideoPreviewCard
src={video.result_movie_url}
className="content-video-preview"
@@ -283,6 +291,7 @@ const MyContentsPage: React.FC<MyContentsPageProps> = ({ onNavigate }) => {
videoId={video.video_id}
storeName={video.store_name}
region={video.region}
title={video.title}
commentCount={video.comment_count ?? 0}
initialLikeCount={video.like_count ?? 0}
initialIsLiked={video.is_liked_by_me}
+1 -1
View File
@@ -5,7 +5,7 @@ import SearchInputForm, { SearchType } from '../../components/SearchInputForm';
interface UrlInputContentProps {
onAnalyze: (value: string, type?: SearchType) => void;
onAutocomplete?: (data: AutocompleteRequest) => void;
onManualInput?: (businessName: string, address: string, category: string) => void;
onManualInput?: (businessName: string, address: string, category: string, officialSiteUrl?: string) => void;
error: string | null;
}
+3 -3
View File
@@ -35,7 +35,7 @@ const orbConfigs: OrbConfig[] = [
interface HeroSectionProps {
onAnalyze?: (value: string, type?: SearchType) => void;
onAutocomplete?: (data: AutocompleteRequest) => void;
onManualInput?: (businessName: string, address: string, category: string) => void;
onManualInput?: (businessName: string, address: string, category: string, officialSiteUrl?: string) => void;
onNext?: () => void;
error?: string | null;
scrollProgress?: number;
@@ -184,10 +184,10 @@ const HeroSection: React.FC<HeroSectionProps> = ({ onAnalyze, onAutocomplete, on
{isManualModalOpen && (
<BusinessNameInputModal
onClose={() => setIsManualModalOpen(false)}
onSubmit={(businessName, address, category) => {
onSubmit={(businessName, address, category, officialSiteUrl) => {
if (tutorial.isActive) tutorial.nextHint();
setIsManualModalOpen(false);
onManualInput?.(businessName, address, category);
onManualInput?.(businessName, address, category, officialSiteUrl);
}}
/>
)}
+64 -9
View File
@@ -689,10 +689,6 @@
flex-direction: column;
}
.video-detail-header {
/* margin-bottom: 24px; */
}
.video-detail-back-btn {
display: flex;
align-items: center;
@@ -724,18 +720,77 @@
flex-direction: column;
}
.video-detail-player-wrap {
position: relative;
width: 100%;
max-width: 360px;
flex-shrink: 0;
}
.video-detail-content.landscape .video-detail-player-wrap {
max-width: 100%;
width: 100%;
}
.video-detail-player {
display: block;
width: 100%;
height: auto;
max-width: 360px;
border-radius: 12px;
}
/* 영상 종료 직전 공식 홈페이지 링크 오버레이 (유튜브 엔드스크린 스타일) */
.video-site-overlay {
position: absolute;
left: 12px;
right: 12px;
bottom: 64px; /* 네이티브 컨트롤 바를 가리지 않도록 */
display: flex;
align-items: center;
gap: 10px;
padding: 10px 14px;
background: rgba(0, 0, 0, 0.75);
border: 1px solid rgba(255, 255, 255, 0.25);
border-radius: 10px;
color: #fff;
text-decoration: none;
font-size: 13px;
line-height: 1.35;
backdrop-filter: blur(4px);
animation: video-site-overlay-in 0.3s ease-out;
transition: background 0.2s;
}
.video-site-overlay:hover {
background: rgba(0, 0, 0, 0.9);
}
.video-site-overlay svg {
flex-shrink: 0;
}
.video-detail-content.landscape .video-detail-player {
max-width: 100%;
width: 100%;
.video-site-overlay-text {
display: flex;
flex-direction: column;
min-width: 0;
}
.video-site-overlay-text strong {
font-weight: 600;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
@keyframes video-site-overlay-in {
from {
opacity: 0;
transform: translateY(8px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.video-detail-info {
@@ -1162,7 +1217,7 @@
.video-detail-content {
flex-direction: column;
}
.video-detail-player {
.video-detail-player-wrap {
max-width: 100%;
width: 100%;
}
+1
View File
@@ -2805,6 +2805,7 @@
.wizard-stepper {
padding: 2rem;
max-width: 100%;
margin-top: 30px;
}
.wizard-stepper-node {
+134
View File
@@ -832,6 +832,72 @@
gap: 0;
}
/* Upload Error Dialog */
.asset-upload-error-overlay {
position: fixed;
inset: 0;
z-index: 1100;
display: flex;
align-items: center;
justify-content: center;
padding: 1rem;
background: rgba(0, 17, 18, 0.82);
backdrop-filter: blur(4px);
}
.asset-upload-error-dialog {
width: min(100%, 420px);
padding: 1.5rem;
background: #01393B;
border: 1px solid #379599;
border-radius: 20px;
box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
}
.asset-upload-error-title {
margin: 0;
color: #94FBE0;
font-size: 1.25rem;
font-weight: 700;
line-height: 1.3;
}
.asset-upload-error-message {
margin: 0.75rem 0 1.5rem;
color: #E5F1F2;
font-size: 0.9375rem;
line-height: 1.6;
overflow-wrap: anywhere;
white-space: pre-wrap;
}
.asset-upload-error-confirm {
width: 100%;
min-height: 44px;
padding: 0.75rem 1rem;
color: #002224;
background: #94FBE0;
border: 0;
border-radius: 999px;
font-size: 0.9375rem;
font-weight: 700;
cursor: pointer;
transition: background-color 0.2s, transform 0.2s;
}
.asset-upload-error-confirm:hover {
background: #B8FFE9;
}
.asset-upload-error-confirm:active {
transform: translateY(1px);
}
.asset-upload-error-confirm:focus-visible {
outline: 3px solid #CFABFB;
outline-offset: 3px;
}
/* Fixed Header - 뒤로가기 */
.asset-sticky-header {
@@ -1032,6 +1098,20 @@
letter-spacing: -0.006em;
}
.asset-section-count {
font-size: 0.875rem;
font-weight: 600;
color: #9BCACC;
line-height: 1.19;
letter-spacing: -0.006em;
font-variant-numeric: tabular-nums;
}
/* 업로드 상한(100장)을 넘긴 상태. 추가 자체는 막지 않고 시각적으로만 경고한다. */
.asset-section-count-over {
color: #fca5a5;
}
/* Asset Section Title */
.asset-section-title {
font-size: 1.5rem;
@@ -1066,6 +1146,36 @@
}
}
/* 모바일: 제목은 한 줄로 유지하고, 권장 수량/카운트는 그 아래 줄로 내린다 */
@media (max-width: 1023px) {
.asset-section-header {
align-items: flex-start;
}
.asset-section-header-left {
flex: 1;
min-width: 0;
flex-wrap: wrap;
row-gap: 4px;
}
.asset-section-header-left .asset-section-title {
order: 1;
white-space: nowrap;
}
.asset-section-header-left .asset-section-count {
order: 2;
white-space: nowrap;
}
.asset-section-header-left .asset-section-subtitle {
order: 3;
width: 100%;
white-space: nowrap;
}
}
/* Asset Image List */
.asset-image-list {
background-color: #002224;
@@ -1134,6 +1244,30 @@
object-fit: cover;
}
.asset-image-placeholder {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 6px;
padding: 8px;
background-color: #001416;
color: #379599;
text-align: center;
}
.asset-image-placeholder-name {
width: 100%;
font-size: 0.6875rem;
line-height: 1.2;
color: #9BCACC;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.asset-image-badge {
position: absolute;
top: 8px;
+15 -4
View File
@@ -61,8 +61,8 @@ export interface UrlImage {
// 업로드된 파일 이미지
export interface FileImage {
type: 'file';
file: File;
preview: string; // createObjectURL로 생성된 미리보기 URL
file: File; // 업로드용 원본. 썸네일로 대체하지 않는다.
preview: string | null; // 미리보기용 축소 썸네일 objectURL. 생성 실패 시 null.
}
export type ImageItem = UrlImage | FileImage;
@@ -276,19 +276,28 @@ export interface VideoListItem {
region: string;
task_id: string;
result_movie_url: string;
poster_url?: string | null;
thumbnail_url?: string;
title?: string | null;
description?: string | null;
hashtags?: string[] | null;
official_site_url?: string | null;
created_at: string;
like_count: number;
comment_count: number;
is_liked_by_me?: boolean;
is_liked_by_me: boolean;
}
// 비디오 상세 아이템
export interface VideoDetailItem {
video_id: number;
result_movie_url: string;
poster_url?: string | null;
store_name: string;
region: string;
title?: string | null;
description?: string | null;
official_site_url?: string | null;
created_at: string;
like_count: number;
is_liked_by_me: boolean;
@@ -309,6 +318,7 @@ export interface VideosListResponse {
export interface CommentReply {
id: number;
nickname: string;
profile_image_url: string | null;
content: string | null;
is_deleted: boolean;
is_mine: boolean;
@@ -319,6 +329,7 @@ export interface CommentReply {
export interface CommentItem {
id: number;
nickname: string;
profile_image_url: string | null;
content: string | null;
is_deleted: boolean;
is_mine: boolean;
@@ -390,7 +401,7 @@ export interface SocialDisconnectResponse {
// 유튜브 SEO Description 자동완성 요청
export interface YTAutoSeoRequest {
task_id: string; // 아카이브의 비디오 ID
video_id: number;
}
// 유튜브 SEO Description 자동완성 응답
+19 -19
View File
@@ -35,6 +35,7 @@ import {
CommentItem,
LikeToggleResponse,
} from '../types/api';
import { uploadImagesSequentially } from './imageUpload.ts';
export const API_URL = import.meta.env.VITE_API_URL || 'http://40.82.133.44';
console.log('[API] API_URL:', API_URL);
@@ -608,12 +609,12 @@ export async function getVideoComments(videoId: string, page: number = 1, pageSi
return response.json();
}
// 댓글 작성
export async function postVideoComment(videoId: string, content: string, nickname?: string, parentId?: number): Promise<CommentItem> {
// 댓글 작성 (작성자 닉네임/프로필은 서버가 로그인된 카카오 정보로 채움)
export async function postVideoComment(videoId: string, content: string, parentId?: number): Promise<CommentItem> {
const response = await authenticatedFetch(`${API_URL}/comment/video/${videoId}`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ content, nickname: nickname || '익명', parent_id: parentId ?? null }),
body: JSON.stringify({ content, parent_id: parentId ?? null }),
});
if (!response.ok) {
@@ -655,18 +656,10 @@ export async function uploadImages(
imageUrls: ImageUrlItem[],
files: File[]
): Promise<ImageUploadResponse> {
const formData = new FormData();
// URL 이미지들을 images_json으로 전달
if (imageUrls.length > 0) {
formData.append('images_json', JSON.stringify(imageUrls));
}
// 파일들을 files로 전달
files.forEach((file) => {
formData.append('files', file);
});
return uploadImagesSequentially(imageUrls, files, postImageUpload);
}
async function postImageUpload(formData: FormData): Promise<ImageUploadResponse> {
const controller = new AbortController();
const timeoutId = setTimeout(() => controller.abort(), IMAGE_UPLOAD_TIMEOUT);
@@ -677,19 +670,21 @@ export async function uploadImages(
signal: controller.signal,
});
clearTimeout(timeoutId);
if (!response.ok) {
if (response.status === 413) {
throw new Error('이미지 파일이 너무 커서 업로드할 수 없습니다. 더 작은 이미지를 선택해주세요.');
}
throw new Error(`HTTP error! status: ${response.status}`);
}
return response.json();
} catch (error) {
clearTimeout(timeoutId);
if (error instanceof Error && error.name === 'AbortError') {
throw new Error('이미지 업로드 시간이 초과되었습니다. 다시 시도해주세요.');
}
throw error;
} finally {
clearTimeout(timeoutId);
}
}
@@ -1098,7 +1093,7 @@ export async function autocomplete(request: AutocompleteRequest): Promise<Crawli
}
// 업체명·주소 직접 입력으로 마케팅 분석
export async function marketingAnalysis(storeName: string, address: string, category = ''): Promise<CrawlingResponse> {
export async function marketingAnalysis(storeName: string, address: string, category = '', officialSiteUrl?: string): Promise<CrawlingResponse> {
const controller = new AbortController();
const timeoutId = setTimeout(() => controller.abort(), CRAWL_TIMEOUT);
@@ -1108,7 +1103,12 @@ export async function marketingAnalysis(storeName: string, address: string, cate
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({ store_name: storeName, address, category }),
body: JSON.stringify({
store_name: storeName,
address,
category,
official_site_url: officialSiteUrl?.trim() || null,
}),
signal: controller.signal,
});
+305
View File
@@ -0,0 +1,305 @@
export const MAX_UPLOAD_IMAGE_BYTES = 2 * 1024 * 1024;
export const MAX_UPLOAD_IMAGE_DIMENSION = 2048;
export const MAX_FALLBACK_UPLOAD_IMAGE_BYTES = 15 * 1024 * 1024;
const OUTPUT_MIME_TYPE = 'image/jpeg';
const OUTPUT_EXTENSION = 'jpg';
const BACKEND_IMAGE_EXTENSIONS = new Set(['jpg', 'jpeg', 'png', 'webp', 'heic', 'heif']);
const BACKEND_IMAGE_MIME_TYPES = new Set([
'image/jpeg',
'image/png',
'image/webp',
'image/heic',
'image/heif',
'image/heic-sequence',
'image/heif-sequence',
]);
interface ImageDimensions {
width: number;
height: number;
}
interface DecodedImage extends ImageDimensions {
source: CanvasImageSource;
dispose: () => void;
}
interface CompressionAttempt {
scale: number;
quality: number;
}
const COMPRESSION_ATTEMPTS: CompressionAttempt[] = [
{ scale: 1, quality: 0.86 },
{ scale: 1, quality: 0.74 },
{ scale: 1, quality: 0.62 },
{ scale: 1, quality: 0.5 },
{ scale: 0.85, quality: 0.7 },
{ scale: 0.7, quality: 0.65 },
{ scale: 0.55, quality: 0.6 },
{ scale: 0.4, quality: 0.55 },
];
export function calculateTargetDimensions(
width: number,
height: number,
maxDimension = MAX_UPLOAD_IMAGE_DIMENSION
): ImageDimensions {
if (
!Number.isFinite(width) ||
!Number.isFinite(height) ||
!Number.isFinite(maxDimension) ||
width <= 0 ||
height <= 0 ||
maxDimension <= 0
) {
throw new Error('Image dimensions must be positive finite numbers.');
}
const scale = Math.min(1, maxDimension / Math.max(width, height));
return {
width: Math.max(1, Math.round(width * scale)),
height: Math.max(1, Math.round(height * scale)),
};
}
export function shouldCompressImage(
fileSize: number,
dimensions: ImageDimensions,
maxBytes = MAX_UPLOAD_IMAGE_BYTES,
maxDimension = MAX_UPLOAD_IMAGE_DIMENSION
): boolean {
return (
fileSize > maxBytes ||
dimensions.width > maxDimension ||
dimensions.height > maxDimension
);
}
export function buildCompressedFileName(fileName: string): string {
const extensionIndex = fileName.lastIndexOf('.');
const baseName = extensionIndex > 0 ? fileName.slice(0, extensionIndex) : fileName;
return `${baseName || 'image'}.${OUTPUT_EXTENSION}`;
}
function getFileExtension(fileName: string): string {
const extensionIndex = fileName.lastIndexOf('.');
return extensionIndex >= 0 ? fileName.slice(extensionIndex + 1).toLowerCase() : '';
}
export function isImageInputFile(file: Pick<File, 'name' | 'type'>): boolean {
return file.type.startsWith('image/') || BACKEND_IMAGE_EXTENSIONS.has(getFileExtension(file.name));
}
export function canUploadOriginalImage(file: Pick<File, 'name' | 'type'>): boolean {
const hasAllowedExtension = BACKEND_IMAGE_EXTENSIONS.has(getFileExtension(file.name));
const hasAllowedMimeType = file.type === '' || BACKEND_IMAGE_MIME_TYPES.has(file.type.toLowerCase());
return hasAllowedExtension && hasAllowedMimeType;
}
export function canUploadOriginalAfterCompressionFailure(
fileSize: number,
maxBytes = MAX_FALLBACK_UPLOAD_IMAGE_BYTES
): boolean {
return fileSize <= maxBytes;
}
function useOriginalOrThrow(file: File, cause: unknown): File {
if (!canUploadOriginalImage(file)) {
throw new Error(
`${file.name} 파일을 지원하는 이미지 형식으로 변환할 수 없습니다. ` +
'JPEG, PNG 또는 WebP로 변환한 뒤 다시 시도해주세요.',
{ cause }
);
}
if (!canUploadOriginalAfterCompressionFailure(file.size)) {
throw new Error(
`${file.name} 파일은 15 MB보다 크고 브라우저에서 크기를 줄일 수 없습니다. ` +
'JPEG나 PNG로 변환하거나 더 작은 이미지를 선택해주세요.',
{ cause }
);
}
console.warn(`Image compression was unavailable for ${file.name}; uploading the original.`, cause);
return file;
}
function decodeWithImageElement(file: File): Promise<DecodedImage> {
return new Promise((resolve, reject) => {
const objectUrl = URL.createObjectURL(file);
const image = new Image();
image.onload = () => {
resolve({
source: image,
width: image.naturalWidth,
height: image.naturalHeight,
dispose: () => URL.revokeObjectURL(objectUrl),
});
};
image.onerror = () => {
URL.revokeObjectURL(objectUrl);
reject(new Error(`Unable to decode image: ${file.name}`));
};
image.src = objectUrl;
});
}
async function decodeImage(file: File): Promise<DecodedImage> {
if (typeof createImageBitmap === 'function') {
const bitmap = await createImageBitmap(file);
return {
source: bitmap,
width: bitmap.width,
height: bitmap.height,
dispose: () => bitmap.close(),
};
}
return decodeWithImageElement(file);
}
function canvasToBlob(canvas: HTMLCanvasElement, quality: number): Promise<Blob> {
return new Promise((resolve, reject) => {
canvas.toBlob(
(blob) => {
if (blob) {
resolve(blob);
} else {
reject(new Error('The browser could not compress the image.'));
}
},
OUTPUT_MIME_TYPE,
quality
);
});
}
export async function compressImageForUpload(file: File): Promise<File> {
if (!isImageInputFile(file)) {
throw new Error(`지원하지 않는 이미지 파일입니다: ${file.name}`);
}
let decoded: DecodedImage;
try {
decoded = await decodeImage(file);
} catch (error) {
return useOriginalOrThrow(file, error);
}
try {
if (
canUploadOriginalImage(file) &&
!shouldCompressImage(file.size, {
width: decoded.width,
height: decoded.height,
})
) {
return file;
}
const baseDimensions = calculateTargetDimensions(decoded.width, decoded.height);
let smallestBlob: Blob | null = null;
try {
const canvas = document.createElement('canvas');
const context = canvas.getContext('2d');
if (!context) {
throw new Error('The browser does not support image compression.');
}
for (const attempt of COMPRESSION_ATTEMPTS) {
canvas.width = Math.max(1, Math.round(baseDimensions.width * attempt.scale));
canvas.height = Math.max(1, Math.round(baseDimensions.height * attempt.scale));
// JPEG has no alpha channel. A white background avoids transparent pixels
// becoming black when PNG/WebP images are converted.
context.fillStyle = '#ffffff';
context.fillRect(0, 0, canvas.width, canvas.height);
context.drawImage(decoded.source, 0, 0, canvas.width, canvas.height);
const blob = await canvasToBlob(canvas, attempt.quality);
if (!smallestBlob || blob.size < smallestBlob.size) {
smallestBlob = blob;
}
if (blob.size <= MAX_UPLOAD_IMAGE_BYTES) {
return new File([blob], buildCompressedFileName(file.name), {
type: blob.type || OUTPUT_MIME_TYPE,
lastModified: file.lastModified,
});
}
}
} catch (error) {
return useOriginalOrThrow(file, error);
}
const measuredSize = smallestBlob?.size ?? file.size;
throw new Error(
`${file.name} 파일을 ${Math.round(MAX_UPLOAD_IMAGE_BYTES / (1024 * 1024))} MB 이하로 ` +
`압축할 수 없습니다(압축 결과: ${Math.ceil(measuredSize / (1024 * 1024))} MB).`
);
} finally {
decoded.dispose();
}
}
export const MAX_PREVIEW_DIMENSION = 400;
export const PREVIEW_QUALITY = 0.7;
/**
* 그리드 미리보기 전용 축소 썸네일을 만든다.
*
* 업로드에는 원본 File 을 그대로 쓰고, 여기서 만든 objectURL 은 <img> 에만 쓰인다.
* 핵심은 finally 의 dispose() 로, createImageBitmap 경로에서 원본 비트맵을 즉시
* 해제해 메모리에 원본 크기 비트맵이 남지 않게 한다.
*
* 실패해도 예외를 던지지 않고 null 을 돌려준다. 호출부가 자리표시자를 그린다.
*/
export async function createPreviewThumbnail(file: File): Promise<string | null> {
if (!isImageInputFile(file)) {
return null;
}
let decoded: DecodedImage;
try {
decoded = await decodeImage(file);
} catch (error) {
console.warn(`미리보기 썸네일 디코딩 실패: ${file.name}`, error);
return null;
}
try {
const { width, height } = calculateTargetDimensions(
decoded.width,
decoded.height,
MAX_PREVIEW_DIMENSION
);
const canvas = document.createElement('canvas');
canvas.width = width;
canvas.height = height;
const context = canvas.getContext('2d');
if (!context) {
return null;
}
// JPEG 에는 알파 채널이 없다. 투명 픽셀이 검게 나오지 않도록 흰 배경을 깐다.
context.fillStyle = '#ffffff';
context.fillRect(0, 0, width, height);
context.drawImage(decoded.source, 0, 0, width, height);
const blob = await canvasToBlob(canvas, PREVIEW_QUALITY);
return URL.createObjectURL(blob);
} catch (error) {
console.warn(`미리보기 썸네일 생성 실패: ${file.name}`, error);
return null;
} finally {
decoded.dispose();
}
}
+49
View File
@@ -0,0 +1,49 @@
import type { ImageItem } from '../types/api';
/**
* 같은 파일을 가리키는지 판별하기 위한 키.
*
* 브라우저는 동일한 파일에 대해 name/size/lastModified 를 항상 동일하게 주므로,
* 내용 해시를 계산하지 않고도 비용 없이 중복을 걸러낼 수 있다.
*/
export function getFileIdentity(file: Pick<File, 'name' | 'size' | 'lastModified'>): string {
return `${file.name}|${file.size}|${file.lastModified}`;
}
export interface FileDedupResult {
/** 목록에 새로 넣어야 할 파일 */
newFiles: File[];
/** 중복이라 제외된 파일 수 */
duplicateCount: number;
}
/**
* 이미 목록에 있는 파일, 그리고 이번 배치 안에서 서로 겹치는 파일을 걸러낸다.
*
* url 타입 이미지(크롤링으로 가져온 원격 이미지)는 로컬 파일과 비교할 수단이
* 없으므로 비교 대상에서 제외한다.
*/
export function splitDuplicateFiles(existing: ImageItem[], incoming: File[]): FileDedupResult {
const seen = new Set<string>();
for (const item of existing) {
if (item.type === 'file') {
seen.add(getFileIdentity(item.file));
}
}
const newFiles: File[] = [];
let duplicateCount = 0;
for (const file of incoming) {
const identity = getFileIdentity(file);
if (seen.has(identity)) {
duplicateCount += 1;
continue;
}
seen.add(identity);
newFiles.push(file);
}
return { newFiles, duplicateCount };
}
+83
View File
@@ -0,0 +1,83 @@
import type { ImageUploadResponse, ImageUrlItem } from '../types/api';
import { compressImageForUpload } from './imageCompression.ts';
export const MAX_IMAGES_PER_UPLOAD_TASK = 100;
export type ImageUploadRequest = (formData: FormData) => Promise<ImageUploadResponse>;
export type ImageCompressor = (file: File) => Promise<File>;
interface ImageUploadFormOptions {
imageUrls?: ImageUrlItem[];
file?: File;
taskId?: string;
finalize?: boolean;
}
export function createImageUploadFormData({
imageUrls = [],
file,
taskId,
finalize,
}: ImageUploadFormOptions): FormData {
const formData = new FormData();
if (imageUrls.length > 0) {
formData.append('images_json', JSON.stringify(imageUrls));
}
if (taskId) {
formData.append('task_id', taskId);
}
if (finalize !== undefined) {
formData.append('finalize', String(finalize));
}
if (file) {
formData.append('files', file);
}
return formData;
}
export async function uploadImagesSequentially(
imageUrls: ImageUrlItem[],
files: File[],
sendRequest: ImageUploadRequest,
compressFile: ImageCompressor = compressImageForUpload
): Promise<ImageUploadResponse> {
const totalImageCount = imageUrls.length + files.length;
if (totalImageCount > MAX_IMAGES_PER_UPLOAD_TASK) {
throw new Error(`이미지는 최대 ${MAX_IMAGES_PER_UPLOAD_TASK}장까지 업로드할 수 있습니다.`);
}
if (files.length === 0) {
return sendRequest(createImageUploadFormData({ imageUrls }));
}
let taskId: string | undefined;
let finalResponse: ImageUploadResponse | undefined;
for (let index = 0; index < files.length; index += 1) {
// Compress and upload one source at a time. This prevents both decoded
// image buffers and multipart request bodies from accumulating in memory.
const compressedFile = await compressFile(files[index]);
const isFirstRequest = index === 0;
const isLastRequest = index === files.length - 1;
const formData = createImageUploadFormData({
imageUrls: isFirstRequest ? imageUrls : [],
file: compressedFile,
taskId,
finalize: isLastRequest,
});
finalResponse = await sendRequest(formData);
if (!finalResponse.task_id) {
throw new Error('이미지 업로드 응답에 작업 ID가 없습니다.');
}
if (taskId && finalResponse.task_id !== taskId) {
throw new Error('이미지 업로드 작업 ID가 요청 사이에 변경되었습니다. 다시 시도해주세요.');
}
taskId = finalResponse.task_id;
}
// files.length > 0 guarantees that the loop produced a response.
return finalResponse as ImageUploadResponse;
}
+29
View File
@@ -0,0 +1,29 @@
/**
* 기기의 네이티브 공유 시트를 열고 요청을 처리했는지 반환합니다.
*
* 긴 `text`를 넣으면 카카오 등이 URL을 미리보기가 아니라 본문 텍스트로만 보냅니다.
* 제목·설명은 OG 페이지(`og:title`, `og:description`)에 두고, 여기에는 url(과 짧은 title)만 넘깁니다.
*
* 사용자가 공유 시트를 닫은 경우도 정상적으로 처리된 것으로 간주합니다.
*/
export async function tryNativeShare(data: ShareData): Promise<boolean> {
if (typeof navigator.share !== 'function') {
return false;
}
try {
await navigator.share(data);
return true;
} catch (error) {
if (error instanceof Error && error.name === 'AbortError') {
return true;
}
return false;
}
}
/** API 서버가 제공하는 영상별 Open Graph 공유 페이지 URL을 만듭니다. */
export function buildVideoShareUrl(apiBaseUrl: string, videoId: number | string): string {
return `${apiBaseUrl.replace(/\/$/, '')}/video/share/${encodeURIComponent(String(videoId))}`;
}