Compare commits
19
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
044fd21b2d | ||
|
|
29cee13da7 | ||
|
|
6675b5301f | ||
|
|
2b975a09eb | ||
|
|
b1c3dd49e9 | ||
|
|
dd1f873a6e | ||
|
|
1daf6b0eb2 | ||
|
|
8734d3388d | ||
|
|
f0d9106860 | ||
|
|
5407812889 | ||
|
|
faaca0f4fb | ||
|
|
d7cb0167ec | ||
|
|
e7814742e5 | ||
|
|
7c3c0b4508 | ||
|
|
5b6fab8ef4 | ||
|
|
eceea6a5a4 | ||
|
|
a7c1d1ec76 | ||
|
|
5ec50e66de | ||
|
|
8be7b7adcf |
No files matched your search
Vendored
-3
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"recommendations": []
|
||||
}
|
||||
@@ -86,6 +86,7 @@
|
||||
}
|
||||
|
||||
.landing-section {
|
||||
background: var(--Color-teal-800, #002224);
|
||||
min-height: 100dvh;
|
||||
width: 100%;
|
||||
}
|
||||
@@ -860,6 +861,39 @@
|
||||
background: rgba(255, 255, 255, 0.15);
|
||||
}
|
||||
|
||||
/* Sidebar Footer Actions */
|
||||
.sidebar-footer-actions {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.sidebar-footer-actions .logout-btn {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.sidebar-inquiry-btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.75rem;
|
||||
padding: 0.75rem 1rem;
|
||||
color: var(--color-text-gray-400);
|
||||
text-decoration: none;
|
||||
transition: color var(--transition-normal);
|
||||
white-space: nowrap;
|
||||
font-size: var(--text-sm);
|
||||
font-weight: 700;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.sidebar-inquiry-btn:hover {
|
||||
color: var(--color-text-white);
|
||||
}
|
||||
|
||||
.sidebar-inquiry-btn.collapsed {
|
||||
justify-content: center;
|
||||
padding: 0.75rem;
|
||||
}
|
||||
|
||||
/* Logout Button */
|
||||
.logout-btn {
|
||||
width: 100%;
|
||||
@@ -2042,31 +2076,9 @@
|
||||
height: 64px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.comp2-inquiry-btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
padding: 8px 16px;
|
||||
background: transparent;
|
||||
border: 1px solid rgba(255, 255, 255, 0.3);
|
||||
border-radius: 8px;
|
||||
color: rgba(255, 255, 255, 0.8);
|
||||
font-size: 14px;
|
||||
text-decoration: none;
|
||||
cursor: pointer;
|
||||
transition: background 0.2s, border-color 0.2s, color 0.2s;
|
||||
}
|
||||
|
||||
.comp2-inquiry-btn:hover {
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
border-color: rgba(255, 255, 255, 0.6);
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.comp2-back-btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -3920,7 +3932,7 @@
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
max-width: 600px;
|
||||
max-width: 400px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
@@ -3961,7 +3973,7 @@
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 16px;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.url-input-wrapper {
|
||||
@@ -3994,19 +4006,21 @@
|
||||
|
||||
|
||||
.url-input-button {
|
||||
padding: 12px 32px;
|
||||
background-color: #AE72F9;
|
||||
border: none;
|
||||
margin: auto;
|
||||
max-width: 400px;
|
||||
width: 100%;
|
||||
padding: 11px 16px;
|
||||
border-radius: 12px;
|
||||
font-family: 'Pretendard', sans-serif;
|
||||
font-size: 16px;
|
||||
background-color: #AE72F9;
|
||||
color: #ffffff;
|
||||
font-weight: 600;
|
||||
color: #FFFFFF;
|
||||
font-size: 16px;
|
||||
letter-spacing: -0.006em;
|
||||
box-shadow: 0px 4px 24px 0px rgba(174, 114, 249, 0.4);
|
||||
transition: all var(--transition-normal);
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
transition: background-color 0.2s ease;
|
||||
white-space: nowrap;
|
||||
display: block;
|
||||
margin: 0 auto;
|
||||
animation: button-glow 1.5s ease-in-out infinite;
|
||||
}
|
||||
|
||||
.url-input-button:hover:not(:disabled) {
|
||||
@@ -4030,7 +4044,8 @@
|
||||
font-family: 'Pretendard', sans-serif;
|
||||
font-size: 14px;
|
||||
color: #6AB0B3;
|
||||
margin: 24px 0 0 0;
|
||||
margin: 0 0 10px;
|
||||
white-space: pre-line;
|
||||
}
|
||||
|
||||
/* URL Input Dropdown */
|
||||
@@ -4113,10 +4128,10 @@
|
||||
|
||||
.url-input-autocomplete-dropdown {
|
||||
position: absolute;
|
||||
top: calc(100% + 8px);
|
||||
top: calc(100% + 4px);
|
||||
left: 0;
|
||||
right: 0;
|
||||
background-color: #002224;
|
||||
background-color: #01393B;
|
||||
border: 1px solid rgba(148, 251, 224, 0.2);
|
||||
border-radius: 12px;
|
||||
max-height: 300px;
|
||||
@@ -4232,8 +4247,9 @@
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
z-index: 10;
|
||||
z-index: 20;
|
||||
position: relative;
|
||||
margin-top: 50px;
|
||||
}
|
||||
|
||||
.hero-logo {
|
||||
@@ -4299,8 +4315,9 @@
|
||||
|
||||
/* Hero Form */
|
||||
.hero-form {
|
||||
padding-top: 50px;
|
||||
width: 100%;
|
||||
max-width: 400px;
|
||||
max-width: 375px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
@@ -4330,16 +4347,14 @@
|
||||
}
|
||||
|
||||
.hero-input-wrapper {
|
||||
width: 100%;
|
||||
background-color: #ffffff;
|
||||
border-radius: 999px;
|
||||
padding: 11px 24px;
|
||||
display: flex;
|
||||
width: 100%;
|
||||
height: 48px;
|
||||
padding: 11px 24px;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
transition: box-shadow 0.2s ease;
|
||||
box-sizing: border-box;
|
||||
overflow: visible;
|
||||
border-radius: 999px;
|
||||
background: var(--Color-white, #FFF);
|
||||
position: relative;
|
||||
}
|
||||
|
||||
@@ -4432,7 +4447,7 @@
|
||||
|
||||
.hero-dropdown-menu {
|
||||
position: absolute;
|
||||
top: calc(100% + 8px);
|
||||
top: calc(100% + 4px);
|
||||
left: 0;
|
||||
min-width: 100px;
|
||||
background-color: #ffffff;
|
||||
@@ -4470,15 +4485,14 @@
|
||||
/* Hero Autocomplete */
|
||||
.hero-input-container {
|
||||
flex: 1;
|
||||
position: relative;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.hero-autocomplete-dropdown {
|
||||
position: absolute;
|
||||
top: calc(100% + 8px);
|
||||
left: -24px;
|
||||
right: -60px;
|
||||
top: calc(100% + 4px);
|
||||
left: 90px;
|
||||
right: 0;
|
||||
background-color: #ffffff;
|
||||
border: 1px solid #E5E7EB;
|
||||
border-radius: 12px;
|
||||
@@ -4536,11 +4550,12 @@
|
||||
}
|
||||
|
||||
.hero-input-hint {
|
||||
font-size: 12px;
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
color: #CEE5E6;
|
||||
letter-spacing: -0.006em;
|
||||
margin-bottom: 16px;
|
||||
margin: 10px;
|
||||
white-space: pre-line;
|
||||
}
|
||||
|
||||
.hero-error {
|
||||
@@ -4550,6 +4565,12 @@
|
||||
}
|
||||
|
||||
.hero-button {
|
||||
display: flex;
|
||||
height: 48px;
|
||||
padding: 11px 16px;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
width: 100%;
|
||||
padding: 11px 16px;
|
||||
border-radius: 999px;
|
||||
@@ -4686,7 +4707,7 @@
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
padding: 4rem 1rem 6rem;
|
||||
padding: 6rem 1rem 6rem;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
@@ -4770,7 +4791,7 @@
|
||||
|
||||
@media (min-width: 640px) {
|
||||
.feature-grid {
|
||||
gap: 1.5rem;
|
||||
gap: 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4779,7 +4800,7 @@
|
||||
flex-direction: row;
|
||||
gap: 24px;
|
||||
justify-content: center;
|
||||
padding: 0 2rem;
|
||||
padding: 0 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4795,7 +4816,7 @@
|
||||
position: relative;
|
||||
background-color: #01393B;
|
||||
border-radius: 40px;
|
||||
padding: 24px 32px;
|
||||
padding: 24px 24px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
@@ -4811,7 +4832,7 @@
|
||||
max-width: 280px;
|
||||
min-height: 340px;
|
||||
padding: 24px 24px;
|
||||
gap: 20px;
|
||||
gap: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4819,8 +4840,8 @@
|
||||
.feature-card {
|
||||
max-width: 500px;
|
||||
min-height: 440px;
|
||||
padding: 24px 40px;
|
||||
gap: 24px;
|
||||
padding: 24px 24px;
|
||||
gap: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5137,6 +5158,7 @@
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 50px 16px 0 16px;
|
||||
}
|
||||
|
||||
/* Display Frames Container */
|
||||
@@ -5145,7 +5167,7 @@
|
||||
flex-direction: row;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
gap: 1rem;
|
||||
gap: 2rem;
|
||||
margin-bottom: 2rem;
|
||||
width: 100%;
|
||||
max-width: 72rem;
|
||||
@@ -5153,14 +5175,13 @@
|
||||
|
||||
@media (min-width: 640px) {
|
||||
.display-frames {
|
||||
gap: 1.5rem;
|
||||
gap: 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
.display-frames {
|
||||
gap: 2rem;
|
||||
margin-bottom: 3rem;
|
||||
gap: 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5173,32 +5194,22 @@
|
||||
/* Display Frame - 가로 크기는 feature-card와 일치, 세로는 9:16 비율 */
|
||||
.display-frame {
|
||||
display: flex;
|
||||
width: 120px;
|
||||
height: 213px;
|
||||
aspect-ratio: 9 / 16;
|
||||
border-radius: 2.5rem;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
transition: all var(--transition-normal);
|
||||
}
|
||||
|
||||
@media (min-width: 640px) {
|
||||
.display-frame {
|
||||
width: 160px;
|
||||
height: 284px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
.display-frame {
|
||||
width: 280px;
|
||||
height: 498px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 1024px) {
|
||||
.display-frame {
|
||||
width: 340px;
|
||||
height: 604px;
|
||||
width: 360px;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5377,7 +5388,7 @@
|
||||
transition: all var(--transition-normal);
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
margin-bottom: 2rem;
|
||||
margin-top: 30px;
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
@@ -5680,6 +5691,37 @@
|
||||
}
|
||||
}
|
||||
|
||||
/* Loading Progress Bar */
|
||||
.loading-progress-wrapper {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
margin-top: 24px;
|
||||
width: 240px;
|
||||
}
|
||||
|
||||
.loading-progress-bar {
|
||||
width: 100%;
|
||||
height: 4px;
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
border-radius: 2px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.loading-progress-fill {
|
||||
height: 100%;
|
||||
background: #a6ffea;
|
||||
border-radius: 2px;
|
||||
transition: width 0.1s linear;
|
||||
}
|
||||
|
||||
.loading-progress-text {
|
||||
font-size: 13px;
|
||||
color: rgba(255, 255, 255, 0.5);
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
|
||||
/* Loading Spinner Wrapper */
|
||||
.loading-spinner-wrapper {
|
||||
width: 120px;
|
||||
@@ -7202,7 +7244,7 @@
|
||||
/* Landing Footer */
|
||||
.landing-footer {
|
||||
width: 100%;
|
||||
background-color: #002224;
|
||||
background: var(--Color-teal-800, #002224);
|
||||
padding: 40px 1.5rem;
|
||||
}
|
||||
|
||||
@@ -7214,7 +7256,7 @@
|
||||
|
||||
@media (min-width: 1024px) {
|
||||
.landing-footer {
|
||||
padding: 60px 148px;
|
||||
padding: 60px 100px;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7236,6 +7278,7 @@
|
||||
}
|
||||
|
||||
.footer-left {
|
||||
min-width: 262px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1rem;
|
||||
@@ -7256,6 +7299,7 @@
|
||||
}
|
||||
|
||||
.footer-right {
|
||||
max-width: 600px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 4px;
|
||||
@@ -7291,7 +7335,7 @@
|
||||
top: 16px;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
z-index: 100;
|
||||
z-index: 10100;
|
||||
background: rgba(0, 34, 36, 0.3);
|
||||
border: 1px solid rgba(229, 241, 242, 0.2);
|
||||
border-radius: 999px;
|
||||
@@ -7414,7 +7458,6 @@
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
text-align: center;
|
||||
padding: 0 1rem;
|
||||
}
|
||||
|
||||
|
||||
@@ -7667,6 +7710,10 @@
|
||||
border-color: var(--color-mint);
|
||||
}
|
||||
|
||||
.sound-type-btn.active:hover:not(:disabled) {
|
||||
border-color: var(--color-mint);
|
||||
}
|
||||
|
||||
.sound-type-btn:disabled {
|
||||
opacity: 0.5;
|
||||
cursor: not-allowed;
|
||||
@@ -7706,6 +7753,10 @@
|
||||
border-color: rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
|
||||
.genre-btn.active:hover:not(:disabled) {
|
||||
border-color: var(--color-mint);
|
||||
}
|
||||
|
||||
.genre-btn.active {
|
||||
border-color: var(--color-mint);
|
||||
}
|
||||
@@ -7783,7 +7834,7 @@
|
||||
top: calc(100% + 0.5rem);
|
||||
left: 0;
|
||||
right: 0;
|
||||
max-height: 240px;
|
||||
max-height: 220px;
|
||||
background-color: #002224;
|
||||
border: 1px solid #046266;
|
||||
border-radius: 8px;
|
||||
@@ -7956,7 +8007,7 @@
|
||||
|
||||
/* Generate Sound Button */
|
||||
.btn-generate-sound {
|
||||
height: 48px;
|
||||
height: 40px;
|
||||
min-width: 120px;
|
||||
padding: 0.625rem 1.25rem;
|
||||
background-color: #94FBE0;
|
||||
@@ -7973,6 +8024,7 @@
|
||||
gap: 0.5rem;
|
||||
line-height: 1.19;
|
||||
letter-spacing: -0.006em;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.btn-generate-sound:hover:not(.disabled) {
|
||||
@@ -7984,6 +8036,12 @@
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.regenerate-hint {
|
||||
font-size: 14px;
|
||||
color: #CEE5E6;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/* Video Generate Button */
|
||||
.btn-video-generate {
|
||||
padding: 0.625rem 2.5rem;
|
||||
@@ -7991,6 +8049,7 @@
|
||||
border: none;
|
||||
border-radius: var(--radius-full);
|
||||
color: #FFFFFF;
|
||||
height: 40px;
|
||||
font-size: var(--text-sm);
|
||||
font-weight: 600;
|
||||
cursor: pointer;
|
||||
@@ -8065,10 +8124,12 @@
|
||||
color: var(--color-mint);
|
||||
font-size: var(--text-sm);
|
||||
text-align: center;
|
||||
white-space: pre-line;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 0.5rem;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
/* Responsive Styles for Sound Studio */
|
||||
@@ -8240,8 +8301,20 @@
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
.asset-sticky-footer {
|
||||
left: 240px;
|
||||
body:has(.sidebar.expanded) .asset-sticky-footer {
|
||||
left: 15rem;
|
||||
right: 0;
|
||||
width: auto;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
body:has(.sidebar.collapsed) .asset-sticky-footer {
|
||||
left: 5rem;
|
||||
right: 0;
|
||||
width: auto;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9744,6 +9817,47 @@
|
||||
color: rgba(255, 255, 255, 0.3);
|
||||
}
|
||||
|
||||
/* SEO 자동 생성 shimmer 효과 */
|
||||
@keyframes seo-shimmer {
|
||||
0% { background-position: 200% center; }
|
||||
100% { background-position: -200% center; }
|
||||
}
|
||||
|
||||
.seo-input-wrapper {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.seo-input-wrapper .social-posting-input,
|
||||
.seo-input-wrapper .social-posting-textarea {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.seo-shimmer-text {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 12px;
|
||||
transform: translateY(-50%);
|
||||
pointer-events: none;
|
||||
font-size: 14px;
|
||||
font-family: 'Pretendard', sans-serif;
|
||||
background: linear-gradient(
|
||||
90deg,
|
||||
rgba(166, 255, 234, 0.25) 0%,
|
||||
#a6ffea 40%,
|
||||
rgba(166, 255, 234, 0.25) 80%
|
||||
);
|
||||
background-size: 200% 100%;
|
||||
-webkit-background-clip: text;
|
||||
background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
animation: seo-shimmer 3s linear infinite;
|
||||
}
|
||||
|
||||
.seo-input-wrapper:has(.social-posting-textarea) .seo-shimmer-text {
|
||||
top: 14px;
|
||||
transform: none;
|
||||
}
|
||||
|
||||
.social-posting-input:focus,
|
||||
.social-posting-select:focus,
|
||||
.social-posting-textarea:focus {
|
||||
@@ -10512,3 +10626,412 @@
|
||||
cursor: not-allowed;
|
||||
transform: none;
|
||||
}
|
||||
|
||||
/* Calendar panel scrollbar */
|
||||
.calendar-panel-scroll::-webkit-scrollbar {
|
||||
width: 4px;
|
||||
}
|
||||
|
||||
.calendar-panel-scroll::-webkit-scrollbar-track {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.calendar-panel-scroll::-webkit-scrollbar-thumb {
|
||||
background: #067C80;
|
||||
border-radius: 999px;
|
||||
}
|
||||
|
||||
.calendar-panel-scroll::-webkit-scrollbar-thumb:hover {
|
||||
background: #088a8e;
|
||||
}
|
||||
|
||||
/* Firefox */
|
||||
.calendar-panel-scroll {
|
||||
scrollbar-width: thin;
|
||||
scrollbar-color: #067C80 transparent;
|
||||
}
|
||||
|
||||
/* =====================================================
|
||||
Tutorial Overlay
|
||||
===================================================== */
|
||||
|
||||
.tutorial-overlay-root {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
z-index: 10000;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.tutorial-overlay-svg {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
pointer-events: none;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.tutorial-overlay-blocker {
|
||||
position: fixed;
|
||||
background: rgba(0, 0, 0, 0.72);
|
||||
pointer-events: all;
|
||||
}
|
||||
|
||||
@keyframes tutorial-pulse {
|
||||
0%, 100% {
|
||||
border-color: rgba(166, 255, 234, 0.9);
|
||||
box-shadow: 0 0 0 2px rgba(166, 255, 234, 0.3),
|
||||
0 0 16px 4px rgba(166, 255, 234, 0.35),
|
||||
0 0 40px 8px rgba(166, 255, 234, 0.15);
|
||||
}
|
||||
50% {
|
||||
border-color: rgba(166, 255, 234, 0.5);
|
||||
box-shadow: 0 0 0 5px rgba(166, 255, 234, 0.12),
|
||||
0 0 32px 10px rgba(166, 255, 234, 0.5),
|
||||
0 0 64px 20px rgba(166, 255, 234, 0.2);
|
||||
}
|
||||
}
|
||||
|
||||
.tutorial-spotlight-ring {
|
||||
position: fixed;
|
||||
border: 4px solid rgba(166, 255, 234, 0.85);
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 0 0 1px rgba(166, 255, 234, 0.2), 0 0 12px 2px rgba(166, 255, 234, 0.15);
|
||||
pointer-events: none;
|
||||
z-index: 10001;
|
||||
animation: tutorial-pulse 2s ease-in-out infinite;
|
||||
}
|
||||
|
||||
.tutorial-tooltip {
|
||||
position: fixed;
|
||||
pointer-events: all;
|
||||
z-index: 10002;
|
||||
display: flex;
|
||||
width: 370px;
|
||||
padding: 20px;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
border-radius: 12px;
|
||||
border: 1px solid var(--Color-teal-600, #046266);
|
||||
background: var(--Color-teal-800, #002224);
|
||||
}
|
||||
|
||||
.tutorial-tooltip-title {
|
||||
align-self: stretch;
|
||||
color: rgba(255, 255, 255, 0.70);
|
||||
/* 14 */
|
||||
font-family: Pretendard;
|
||||
font-size: 14px;
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
line-height: 18px; /* 128.571% */
|
||||
}
|
||||
|
||||
.tutorial-tooltip-desc {
|
||||
display: flex;
|
||||
padding-bottom: 16px;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
gap: 4px;
|
||||
align-self: stretch;
|
||||
line-height: 1.5;
|
||||
white-space: pre-line;
|
||||
align-self: stretch;
|
||||
color: var(--Color-white, #FFF);
|
||||
font-family: Pretendard;
|
||||
font-size: 18px;
|
||||
font-style: normal;
|
||||
font-weight: 600;
|
||||
line-height: 24px; /* 133.333% */
|
||||
letter-spacing: -0.108px;
|
||||
}
|
||||
|
||||
.tutorial-tooltip-note {
|
||||
align-self: stretch;
|
||||
color: rgba(255, 255, 255, 0.60);
|
||||
font-family: Pretendard;
|
||||
font-size: 12px;
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
line-height: 100%;
|
||||
letter-spacing: -0.072px;
|
||||
margin: -8px 0 14px;
|
||||
white-space: pre-line;
|
||||
}
|
||||
|
||||
.tutorial-tooltip-footer {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.tutorial-tooltip-footer-left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.tutorial-tooltip-counter {
|
||||
color: rgba(255, 255, 255, 0.60);
|
||||
font-family: Pretendard;
|
||||
font-size: 12px;
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
line-height: 100%; /* 12px */
|
||||
letter-spacing: -0.072px;
|
||||
}
|
||||
|
||||
.tutorial-tooltip-actions {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.tutorial-btn-skip {
|
||||
color: rgba(255, 255, 255, 0.60);
|
||||
font-family: Pretendard;
|
||||
font-size: 12px;
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
line-height: 100%; /* 12px */
|
||||
letter-spacing: -0.072px;
|
||||
}
|
||||
|
||||
.tutorial-btn-skip:hover {
|
||||
color: rgba(255, 255, 255, 0.7);
|
||||
}
|
||||
|
||||
.tutorial-btn-prev {
|
||||
display: flex;
|
||||
padding: 8px 12px;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
border-radius: 4px;
|
||||
background: var(--Color-teal-200, #9BCACC);
|
||||
color: var(--Color-teal-800, #002224);
|
||||
font-family: Pretendard;
|
||||
font-size: 13px;
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
line-height: 100%; /* 13px */
|
||||
letter-spacing: -0.078px;
|
||||
}
|
||||
|
||||
.tutorial-btn-prev:hover {
|
||||
background: rgba(255, 255, 255, 0.14);
|
||||
}
|
||||
|
||||
.tutorial-btn-next {
|
||||
display: flex;
|
||||
padding: 8px 12px;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
border-radius: 4px;
|
||||
background: var(--Color-teal-200, #9BCACC);
|
||||
color: var(--Color-teal-800, #002224);
|
||||
font-family: Pretendard;
|
||||
font-size: 13px;
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
line-height: 100%; /* 13px */
|
||||
letter-spacing: -0.078px;
|
||||
}
|
||||
|
||||
.tutorial-btn-next:hover {
|
||||
background: rgba(255, 255, 255, 0.14);
|
||||
}
|
||||
|
||||
/* 말풍선 variant — 색상은 기본 tooltip과 동일, 꼬리만 추가 */
|
||||
.tutorial-tooltip-bubble {
|
||||
border-radius: 12px;
|
||||
}
|
||||
|
||||
/* 꼬리 (화살표) */
|
||||
.tutorial-tooltip-bubble::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
width: 0;
|
||||
height: 0;
|
||||
border: 10px solid transparent;
|
||||
}
|
||||
|
||||
.tutorial-tooltip-bubble--bottom::before {
|
||||
bottom: 100%;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
border-bottom-color: #1a2630;
|
||||
}
|
||||
|
||||
.tutorial-tooltip-bubble--top::before {
|
||||
top: 100%;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
border-top-color: #1a2630;
|
||||
}
|
||||
|
||||
.tutorial-tooltip-bubble--right::before {
|
||||
right: 100%;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
border-right-color: #1a2630;
|
||||
}
|
||||
|
||||
.tutorial-tooltip-bubble--left::before {
|
||||
left: 100%;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
border-left-color: #1a2630;
|
||||
}
|
||||
|
||||
.tutorial-tooltip-action-hint {
|
||||
font-size: 11px;
|
||||
color: #a6ffea;
|
||||
margin: 8px 0 0;
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
/* 튜토리얼 재시작 팝업 */
|
||||
.tutorial-restart-backdrop {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
z-index: 10100;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
|
||||
.tutorial-restart-popup {
|
||||
background: #1a2630;
|
||||
border: 1px solid rgba(166, 255, 234, 0.25);
|
||||
border-radius: 14px;
|
||||
padding: 24px 28px;
|
||||
width: 320px;
|
||||
box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
|
||||
}
|
||||
|
||||
.tutorial-restart-title {
|
||||
font-size: 16px;
|
||||
font-weight: 700;
|
||||
color: #a6ffea;
|
||||
margin: 0 0 10px;
|
||||
}
|
||||
|
||||
.tutorial-restart-desc {
|
||||
font-size: 13px;
|
||||
color: rgba(255, 255, 255, 0.65);
|
||||
margin: 0 0 20px;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.tutorial-restart-actions {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.tutorial-restart-cancel {
|
||||
font-size: 13px;
|
||||
color: rgba(255, 255, 255, 0.5);
|
||||
background: rgba(255, 255, 255, 0.08);
|
||||
border: none;
|
||||
border-radius: 8px;
|
||||
cursor: pointer;
|
||||
padding: 7px 16px;
|
||||
}
|
||||
|
||||
.tutorial-restart-cancel:hover {
|
||||
background: rgba(255, 255, 255, 0.14);
|
||||
color: rgba(255, 255, 255, 0.8);
|
||||
}
|
||||
|
||||
.tutorial-restart-confirm {
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
color: #0d1a1f;
|
||||
background: #a6ffea;
|
||||
border: none;
|
||||
border-radius: 8px;
|
||||
cursor: pointer;
|
||||
padding: 7px 18px;
|
||||
}
|
||||
|
||||
.tutorial-restart-confirm:hover {
|
||||
background: #c0fff2;
|
||||
}
|
||||
|
||||
/* 사이드바 튜토리얼 버튼 */
|
||||
.tutorial-restart-fab {
|
||||
position: fixed;
|
||||
top: 16px;
|
||||
right: 20px;
|
||||
z-index: 900;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
padding: 7px 14px;
|
||||
background: rgba(0, 34, 36, 0.85);
|
||||
border: 1px solid rgba(166, 255, 234, 0.25);
|
||||
border-radius: 20px;
|
||||
color: rgba(255, 255, 255, 0.65);
|
||||
cursor: pointer;
|
||||
font-size: 13px;
|
||||
backdrop-filter: blur(6px);
|
||||
transition: background 0.15s, color 0.15s, border-color 0.15s;
|
||||
}
|
||||
|
||||
.tutorial-restart-fab:hover {
|
||||
background: rgba(166, 255, 234, 0.12);
|
||||
border-color: rgba(166, 255, 234, 0.5);
|
||||
color: #a6ffea;
|
||||
}
|
||||
|
||||
/* 튜토리얼 토글 버튼 */
|
||||
.tutorial-toggle-fab {
|
||||
position: fixed;
|
||||
top: 16px;
|
||||
right: 20px;
|
||||
z-index: 900;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
padding: 7px 14px;
|
||||
background: rgba(0, 34, 36, 0.85);
|
||||
border: 1px solid rgba(166, 255, 234, 0.25);
|
||||
border-radius: 20px;
|
||||
color: rgba(255, 255, 255, 0.5);
|
||||
cursor: pointer;
|
||||
font-size: 13px;
|
||||
backdrop-filter: blur(6px);
|
||||
transition: background 0.15s, color 0.15s, border-color 0.15s;
|
||||
}
|
||||
|
||||
.tutorial-toggle-fab:hover {
|
||||
background: rgba(166, 255, 234, 0.12);
|
||||
border-color: rgba(166, 255, 234, 0.5);
|
||||
color: #a6ffea;
|
||||
}
|
||||
|
||||
.tutorial-toggle-fab.active {
|
||||
color: #a6ffea;
|
||||
border-color: rgba(166, 255, 234, 0.4);
|
||||
}
|
||||
|
||||
.tutorial-toggle-badge {
|
||||
font-size: 10px;
|
||||
font-weight: 700;
|
||||
padding: 2px 6px;
|
||||
border-radius: 4px;
|
||||
transition: background 0.15s, color 0.15s;
|
||||
}
|
||||
|
||||
.tutorial-toggle-badge.on {
|
||||
background: #a6ffea;
|
||||
color: #002224;
|
||||
}
|
||||
|
||||
.tutorial-toggle-badge.off {
|
||||
background: rgba(255, 255, 255, 0.12);
|
||||
color: rgba(255, 255, 255, 0.4);
|
||||
}
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
||||
<title>CASTAD</title>
|
||||
<title>ADO2</title>
|
||||
<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">
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
|
||||
+16
-4
@@ -13,6 +13,7 @@ import SocialConnectSuccess from './pages/Social/SocialConnectSuccess';
|
||||
import SocialConnectError from './pages/Social/SocialConnectError';
|
||||
import YouTubeOAuthCallback from './pages/Social/YouTubeOAuthCallback';
|
||||
import { crawlUrl, autocomplete, kakaoCallback, isLoggedIn, saveTokens, AutocompleteRequest } from './utils/api';
|
||||
import { saveSearchHistory } from './components/SearchHistory/useSearchHistory';
|
||||
import { CrawlingResponse } from './types/api';
|
||||
|
||||
type ViewMode = 'landing' | 'loading' | 'analysis' | 'login' | 'generation_flow';
|
||||
@@ -96,6 +97,7 @@ const App: React.FC = () => {
|
||||
parseSavedAnalysisData()
|
||||
);
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
const [isAnalysisComplete, setIsAnalysisComplete] = useState(false);
|
||||
const [scrollProgress, setScrollProgress] = useState(0);
|
||||
const [isProcessingCallback, setIsProcessingCallback] = useState(false);
|
||||
|
||||
@@ -256,6 +258,7 @@ const App: React.FC = () => {
|
||||
if (!url.trim()) return;
|
||||
|
||||
setViewMode('loading');
|
||||
setIsAnalysisComplete(false);
|
||||
setError(null);
|
||||
|
||||
try {
|
||||
@@ -268,7 +271,8 @@ const App: React.FC = () => {
|
||||
|
||||
setAnalysisData(data);
|
||||
localStorage.setItem(ANALYSIS_DATA_KEY, JSON.stringify(data));
|
||||
setViewMode('analysis');
|
||||
saveSearchHistory({ type: 'url', value: url });
|
||||
setIsAnalysisComplete(true);
|
||||
} catch (err) {
|
||||
console.error('Crawling failed:', err);
|
||||
const errorMessage = err instanceof Error ? err.message : t('app.analysisError');
|
||||
@@ -280,6 +284,7 @@ const App: React.FC = () => {
|
||||
// 업체명 자동완성으로 분석 시작
|
||||
const handleAutocomplete = async (request: AutocompleteRequest) => {
|
||||
setViewMode('loading');
|
||||
setIsAnalysisComplete(false);
|
||||
setError(null);
|
||||
|
||||
try {
|
||||
@@ -292,10 +297,12 @@ const App: React.FC = () => {
|
||||
|
||||
setAnalysisData(data);
|
||||
localStorage.setItem(ANALYSIS_DATA_KEY, JSON.stringify(data));
|
||||
setViewMode('analysis');
|
||||
saveSearchHistory({ type: 'name', value: request.title.replace(/<[^>]*>/g, ''), address: request.address, roadAddress: request.roadAddress });
|
||||
setIsAnalysisComplete(true);
|
||||
} catch (err) {
|
||||
console.error('Autocomplete failed:', err);
|
||||
const errorMessage = err instanceof Error ? err.message : t('app.autocompleteGeneralError');
|
||||
const is404 = err instanceof Error && err.message.includes('status: 404');
|
||||
const errorMessage = is404 ? t('app.autocompleteError') : (err instanceof Error ? err.message : t('app.autocompleteGeneralError'));
|
||||
setError(errorMessage);
|
||||
setViewMode('landing');
|
||||
}
|
||||
@@ -395,7 +402,12 @@ const App: React.FC = () => {
|
||||
}
|
||||
|
||||
if (viewMode === 'loading') {
|
||||
return <LoadingSection />;
|
||||
return (
|
||||
<LoadingSection
|
||||
isComplete={isAnalysisComplete}
|
||||
onComplete={() => setViewMode('analysis')}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
if (viewMode === 'analysis' && analysisData) {
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
import React from 'react';
|
||||
import { SearchHistoryItem } from './useSearchHistory';
|
||||
|
||||
interface SearchHistoryDropdownProps {
|
||||
items: SearchHistoryItem[];
|
||||
onSelect: (item: SearchHistoryItem) => void;
|
||||
onDelete: (e: React.MouseEvent, value: string) => void;
|
||||
className?: string;
|
||||
itemClassName?: string;
|
||||
titleClassName?: string;
|
||||
addressClassName?: string;
|
||||
}
|
||||
|
||||
const SearchHistoryDropdown: React.FC<SearchHistoryDropdownProps> = ({
|
||||
items,
|
||||
onSelect,
|
||||
onDelete,
|
||||
className = 'url-input-autocomplete-dropdown',
|
||||
itemClassName = 'url-input-autocomplete-item',
|
||||
titleClassName = 'url-input-autocomplete-title',
|
||||
addressClassName = 'url-input-autocomplete-address',
|
||||
}) => {
|
||||
if (items.length === 0) return null;
|
||||
|
||||
return (
|
||||
<div className={className}>
|
||||
{items.map((item, index) => (
|
||||
<div
|
||||
key={index}
|
||||
className={itemClassName}
|
||||
style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}
|
||||
>
|
||||
<button
|
||||
type="button"
|
||||
style={{ flex: 1, textAlign: 'left', background: 'none', border: 'none', padding: 0, cursor: 'pointer' }}
|
||||
onMouseDown={(e) => { e.preventDefault(); onSelect(item); }}
|
||||
>
|
||||
<div className={titleClassName}>{item.value}</div>
|
||||
{item.roadAddress && (
|
||||
<div className={addressClassName}>{item.roadAddress}</div>
|
||||
)}
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
onMouseDown={(e) => onDelete(e, item.value)}
|
||||
style={{ color:'#737983', background: 'none', border: 'none', cursor: 'pointer', padding: '0 4px', opacity: 0.8, flexShrink: 0 }}
|
||||
>
|
||||
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="3">
|
||||
<line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default SearchHistoryDropdown;
|
||||
@@ -0,0 +1,56 @@
|
||||
import { useState, useEffect } from 'react';
|
||||
|
||||
export const SEARCH_HISTORY_KEY = 'castad_search_history';
|
||||
export const SEARCH_HISTORY_MAX = 5;
|
||||
|
||||
export interface SearchHistoryItem {
|
||||
type: 'url' | 'name';
|
||||
value: string;
|
||||
address?: string;
|
||||
roadAddress?: string;
|
||||
}
|
||||
|
||||
export const saveSearchHistory = (item: SearchHistoryItem) => {
|
||||
try {
|
||||
const saved = localStorage.getItem(SEARCH_HISTORY_KEY);
|
||||
const history: SearchHistoryItem[] = saved ? JSON.parse(saved) : [];
|
||||
const filtered = history.filter(h => h.value !== item.value);
|
||||
const updated = [item, ...filtered].slice(0, SEARCH_HISTORY_MAX);
|
||||
localStorage.setItem(SEARCH_HISTORY_KEY, JSON.stringify(updated));
|
||||
} catch { /* ignore */ }
|
||||
};
|
||||
|
||||
export const useSearchHistory = (searchType: 'url' | 'name') => {
|
||||
const [history, setHistory] = useState<SearchHistoryItem[]>([]);
|
||||
const [showHistory, setShowHistory] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
try {
|
||||
const saved = localStorage.getItem(SEARCH_HISTORY_KEY);
|
||||
if (saved) setHistory(JSON.parse(saved));
|
||||
} catch { /* ignore */ }
|
||||
}, []);
|
||||
|
||||
const filteredHistory = history.filter(h => h.type === searchType);
|
||||
|
||||
const deleteItem = (value: string) => {
|
||||
const updated = history.filter(h => h.value !== value);
|
||||
setHistory(updated);
|
||||
localStorage.setItem(SEARCH_HISTORY_KEY, JSON.stringify(updated));
|
||||
if (updated.filter(h => h.type === searchType).length === 0) {
|
||||
setShowHistory(false);
|
||||
}
|
||||
};
|
||||
|
||||
const openHistory = (inputValue: string) => {
|
||||
if (!inputValue && filteredHistory.length > 0) setShowHistory(true);
|
||||
};
|
||||
|
||||
const closeHistory = () => setShowHistory(false);
|
||||
|
||||
const hideOnInput = (value: string) => {
|
||||
if (value) setShowHistory(false);
|
||||
};
|
||||
|
||||
return { filteredHistory, showHistory, openHistory, closeHistory, hideOnInput, deleteItem };
|
||||
};
|
||||
+36
-13
@@ -12,11 +12,13 @@ interface SidebarItemProps {
|
||||
isCollapsed: boolean;
|
||||
isDisabled?: boolean;
|
||||
onClick?: () => void;
|
||||
id?: string;
|
||||
}
|
||||
|
||||
const SidebarItem: React.FC<SidebarItemProps> = ({ icon, label, isActive, isCollapsed, isDisabled, onClick }) => {
|
||||
const SidebarItem: React.FC<SidebarItemProps> = ({ icon, label, isActive, isCollapsed, isDisabled, onClick, id }) => {
|
||||
return (
|
||||
<div
|
||||
id={id}
|
||||
onClick={isDisabled ? undefined : onClick}
|
||||
className={`sidebar-item ${isActive ? 'active' : ''} ${isCollapsed ? 'collapsed' : ''} ${isDisabled ? 'disabled' : ''}`}
|
||||
title={isCollapsed ? label : ""}
|
||||
@@ -82,8 +84,8 @@ const Sidebar: React.FC<SidebarProps> = ({ activeItem, onNavigate, onHome, userI
|
||||
{ id: '대시보드', label: t('sidebar.dashboard'), disabled: false, icon: <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5"><rect x="3" y="3" width="7" height="9"/><rect x="14" y="3" width="7" height="5"/><rect x="14" y="12" width="7" height="9"/><rect x="3" y="16" width="7" height="5"/></svg> },
|
||||
{ id: '새 프로젝트 만들기', label: t('sidebar.newProject'), disabled: false, icon: <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5"><line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/></svg> },
|
||||
{ id: 'ADO2 콘텐츠', label: t('sidebar.ado2Contents'), disabled: false, icon: <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5"><path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"/></svg> },
|
||||
// { id: '내 콘텐츠', label: t('sidebar.myContents'), disabled: true, icon: <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"/><circle cx="8.5" cy="8.5" r="1.5"/><polyline points="21 15 16 10 5 21"/></svg> },
|
||||
{ id: '콘텐츠 캘린더', label: '콘텐츠 캘린더', disabled: false, icon: <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"/><line x1="16" y1="2" x2="16" y2="6"/><line x1="8" y1="2" x2="8" y2="6"/><line x1="3" y1="10" x2="21" y2="10"/></svg> },
|
||||
{ id: '내 콘텐츠', label: t('sidebar.myContents'), disabled: true, icon: <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"/><circle cx="8.5" cy="8.5" r="1.5"/><polyline points="21 15 16 10 5 21"/></svg> },
|
||||
{ id: '콘텐츠 캘린더', label: t('contentCalendar.title'), disabled: false, icon: <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"/><line x1="16" y1="2" x2="16" y2="6"/><line x1="8" y1="2" x2="8" y2="6"/><line x1="3" y1="10" x2="21" y2="10"/></svg> },
|
||||
{ id: '내 정보', label: t('sidebar.myInfo'), disabled: false, icon: <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5"><path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"/><circle cx="12" cy="7" r="4"/></svg> },
|
||||
];
|
||||
|
||||
@@ -138,6 +140,13 @@ const Sidebar: React.FC<SidebarProps> = ({ activeItem, onNavigate, onHome, userI
|
||||
{menuItems.map(item => (
|
||||
<SidebarItem
|
||||
key={item.id}
|
||||
id={
|
||||
item.id === '내 정보'
|
||||
? 'sidebar-my-info'
|
||||
: item.id === 'ADO2 콘텐츠'
|
||||
? 'sidebar-ado2-contents'
|
||||
: undefined
|
||||
}
|
||||
icon={item.icon}
|
||||
label={item.label}
|
||||
isCollapsed={isCollapsed}
|
||||
@@ -175,16 +184,30 @@ const Sidebar: React.FC<SidebarProps> = ({ activeItem, onNavigate, onHome, userI
|
||||
)}
|
||||
</div>
|
||||
|
||||
<button
|
||||
className={`logout-btn ${isCollapsed ? 'collapsed' : ''}`}
|
||||
onClick={handleLogout}
|
||||
disabled={isLoggingOut}
|
||||
>
|
||||
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5">
|
||||
<path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"/><polyline points="16 17 21 12 16 7"/><line x1="21" y1="12" x2="9" y2="12"/>
|
||||
</svg>
|
||||
{!isCollapsed && <span className="logout-btn-label">{isLoggingOut ? t('sidebar.loggingOut') : t('sidebar.logout')}</span>}
|
||||
</button>
|
||||
<div className="sidebar-footer-actions">
|
||||
<button
|
||||
className={`logout-btn ${isCollapsed ? 'collapsed' : ''}`}
|
||||
onClick={handleLogout}
|
||||
disabled={isLoggingOut}
|
||||
>
|
||||
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5">
|
||||
<path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"/><polyline points="16 17 21 12 16 7"/><line x1="21" y1="12" x2="9" y2="12"/>
|
||||
</svg>
|
||||
{!isCollapsed && <span className="logout-btn-label">{isLoggingOut ? t('sidebar.loggingOut') : t('sidebar.logout')}</span>}
|
||||
</button>
|
||||
<a
|
||||
href="https://forms.gle/4a8mGebBYtdesvby9"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className={`sidebar-inquiry-btn ${isCollapsed ? 'collapsed' : ''}`}
|
||||
title={t('sidebar.inquiry')}
|
||||
>
|
||||
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5">
|
||||
<path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" />
|
||||
</svg>
|
||||
{!isCollapsed && <span>{t('sidebar.inquiry')}</span>}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
|
||||
@@ -4,6 +4,9 @@ import { useTranslation } from 'react-i18next';
|
||||
import { getSocialAccounts, uploadToSocial, waitForUploadComplete, TokenExpiredError, handleSocialReconnect, getAutoSeoYoutube } from '../utils/api';
|
||||
import { SocialAccount, VideoListItem, SocialUploadStatusResponse } from '../types/api';
|
||||
import UploadProgressModal, { UploadStatus } from './UploadProgressModal';
|
||||
import { useTutorial } from './Tutorial/useTutorial';
|
||||
import { TUTORIAL_KEYS } from './Tutorial/tutorialSteps';
|
||||
import TutorialOverlay from './Tutorial/TutorialOverlay';
|
||||
|
||||
interface SocialPostingModalProps {
|
||||
isOpen: boolean;
|
||||
@@ -116,6 +119,7 @@ const SocialPostingModal: React.FC<SocialPostingModalProps> = ({
|
||||
video
|
||||
}) => {
|
||||
const { t } = useTranslation();
|
||||
const tutorial = useTutorial();
|
||||
const [socialAccounts, setSocialAccounts] = useState<SocialAccount[]>([]);
|
||||
const [selectedChannel, setSelectedChannel] = useState<string>('');
|
||||
const [title, setTitle] = useState('');
|
||||
@@ -135,6 +139,7 @@ const SocialPostingModal: React.FC<SocialPostingModalProps> = ({
|
||||
const [videoMeta, setVideoMeta] = useState<{ width: number; height: number; duration: number } | null>(null);
|
||||
const channelDropdownRef = useRef<HTMLDivElement>(null);
|
||||
const privacyDropdownRef = useRef<HTMLDivElement>(null);
|
||||
const hasBeenOpenedRef = useRef(false);
|
||||
|
||||
// Upload progress modal state
|
||||
const [showUploadProgress, setShowUploadProgress] = useState(false);
|
||||
@@ -171,6 +176,32 @@ const SocialPostingModal: React.FC<SocialPostingModalProps> = ({
|
||||
return () => { document.body.style.overflow = ''; };
|
||||
}, [isOpen]);
|
||||
|
||||
// 모달 오픈/닫힘 시 튜토리얼 트리거
|
||||
useEffect(() => {
|
||||
if (isOpen) {
|
||||
hasBeenOpenedRef.current = true;
|
||||
if (!tutorial.hasSeen(TUTORIAL_KEYS.UPLOAD_MODAL)) {
|
||||
const timer = setTimeout(() => {
|
||||
tutorial.startTutorial(TUTORIAL_KEYS.UPLOAD_MODAL);
|
||||
}, 400);
|
||||
return () => clearTimeout(timer);
|
||||
}
|
||||
} else if (hasBeenOpenedRef.current && !tutorial.hasSeen(TUTORIAL_KEYS.FEEDBACK)) {
|
||||
hasBeenOpenedRef.current = false;
|
||||
tutorial.startTutorial(TUTORIAL_KEYS.FEEDBACK);
|
||||
}
|
||||
}, [isOpen]);
|
||||
|
||||
// SEO 생성 완료 시 UPLOAD_FORM 튜토리얼 트리거
|
||||
useEffect(() => {
|
||||
if (!isLoadingAutoDescription && isOpen && !tutorial.hasSeen(TUTORIAL_KEYS.UPLOAD_FORM)) {
|
||||
const timer = setTimeout(() => {
|
||||
tutorial.startTutorial(TUTORIAL_KEYS.UPLOAD_FORM);
|
||||
}, 400);
|
||||
return () => clearTimeout(timer);
|
||||
}
|
||||
}, [isLoadingAutoDescription]);
|
||||
|
||||
// 소셜 계정 로드
|
||||
useEffect(() => {
|
||||
if (isOpen) {
|
||||
@@ -399,8 +430,21 @@ const SocialPostingModal: React.FC<SocialPostingModalProps> = ({
|
||||
);
|
||||
|
||||
if (!isOpen || !video) {
|
||||
// Still render upload progress modal even when main modal is closed
|
||||
return showUploadProgress ? uploadProgressModalElement : null;
|
||||
return (
|
||||
<>
|
||||
{showUploadProgress && uploadProgressModalElement}
|
||||
{tutorial.isActive && (
|
||||
<TutorialOverlay
|
||||
hints={tutorial.hints}
|
||||
currentIndex={tutorial.currentHintIndex}
|
||||
onNext={tutorial.nextHint}
|
||||
onPrev={tutorial.prevHint}
|
||||
onSkip={tutorial.skipTutorial}
|
||||
groupProgress={tutorial.groupProgress}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
@@ -522,48 +566,60 @@ const SocialPostingModal: React.FC<SocialPostingModalProps> = ({
|
||||
<label className="social-posting-label">
|
||||
{t('social.postTitleLabel')} <span className="required">*</span>
|
||||
</label>
|
||||
<input
|
||||
type="text"
|
||||
value={title}
|
||||
onChange={(e) => setTitle(e.target.value)}
|
||||
placeholder={isLoadingAutoDescription ? t('social.autoSeoTitle') : t('social.postTitlePlaceholder')}
|
||||
// placeholder={t('social.postTitlePlaceholder')}
|
||||
className="social-posting-input"
|
||||
maxLength={100}
|
||||
disabled={isLoadingAutoDescription}
|
||||
/>
|
||||
<div className="seo-input-wrapper">
|
||||
<input
|
||||
type="text"
|
||||
value={title}
|
||||
onChange={(e) => setTitle(e.target.value)}
|
||||
placeholder={isLoadingAutoDescription ? '' : t('social.postTitlePlaceholder')}
|
||||
className="social-posting-input"
|
||||
maxLength={100}
|
||||
disabled={isLoadingAutoDescription}
|
||||
/>
|
||||
{isLoadingAutoDescription && (
|
||||
<span className="seo-shimmer-text">{t('social.autoSeoTitle')}</span>
|
||||
)}
|
||||
</div>
|
||||
<span className="social-posting-char-count">{title.length}/100</span>
|
||||
</div>
|
||||
|
||||
{/* Description */}
|
||||
<div className="social-posting-field">
|
||||
<label className="social-posting-label">{t('social.postContentLabel')}</label>
|
||||
<textarea
|
||||
value={description}
|
||||
onChange={(e) => setDescription(e.target.value)}
|
||||
placeholder={t(isLoadingAutoDescription ? t('social.autoSeoDescription') : t('social.postContentPlaceholder'))}
|
||||
// placeholder={t('social.postContentPlaceholder')}
|
||||
className="social-posting-textarea"
|
||||
maxLength={5000}
|
||||
rows={4}
|
||||
disabled={isLoadingAutoDescription}
|
||||
/>
|
||||
<div className="seo-input-wrapper">
|
||||
<textarea
|
||||
value={description}
|
||||
onChange={(e) => setDescription(e.target.value)}
|
||||
placeholder={isLoadingAutoDescription ? '' : t('social.postContentPlaceholder')}
|
||||
className="social-posting-textarea"
|
||||
maxLength={5000}
|
||||
rows={4}
|
||||
disabled={isLoadingAutoDescription}
|
||||
/>
|
||||
{isLoadingAutoDescription && (
|
||||
<span className="seo-shimmer-text">{t('social.autoSeoDescription')}</span>
|
||||
)}
|
||||
</div>
|
||||
<span className="social-posting-char-count">{description.length}/5,000</span>
|
||||
</div>
|
||||
|
||||
{/* Tags */}
|
||||
<div className="social-posting-field">
|
||||
<label className="social-posting-label">{t('social.tagsLabel')}</label>
|
||||
<input
|
||||
type="text"
|
||||
value={tags}
|
||||
onChange={(e) => setTags(e.target.value)}
|
||||
placeholder={t(isLoadingAutoDescription ? t('social.autoSeoTags') : t('social.tagsPlaceholder'))}
|
||||
// placeholder={t('social.tagsPlaceholder')}
|
||||
className="social-posting-input"
|
||||
maxLength={500}
|
||||
disabled={isLoadingAutoDescription}
|
||||
/>
|
||||
<div className="seo-input-wrapper">
|
||||
<input
|
||||
type="text"
|
||||
value={tags}
|
||||
onChange={(e) => setTags(e.target.value)}
|
||||
placeholder={isLoadingAutoDescription ? '' : t('social.tagsPlaceholder')}
|
||||
className="social-posting-input"
|
||||
maxLength={500}
|
||||
disabled={isLoadingAutoDescription}
|
||||
/>
|
||||
{isLoadingAutoDescription && (
|
||||
<span className="seo-shimmer-text">{t('social.autoSeoTags')}</span>
|
||||
)}
|
||||
</div>
|
||||
<span className="social-posting-char-count">{tags.length}/500</span>
|
||||
</div>
|
||||
|
||||
@@ -761,6 +817,16 @@ const SocialPostingModal: React.FC<SocialPostingModalProps> = ({
|
||||
</div>
|
||||
</div>
|
||||
{uploadProgressModalElement}
|
||||
{tutorial.isActive && (
|
||||
<TutorialOverlay
|
||||
hints={tutorial.hints}
|
||||
currentIndex={tutorial.currentHintIndex}
|
||||
onNext={tutorial.nextHint}
|
||||
onPrev={tutorial.prevHint}
|
||||
onSkip={tutorial.skipTutorial}
|
||||
groupProgress={tutorial.groupProgress}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -0,0 +1,306 @@
|
||||
import React, { useEffect, useState, useCallback } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { TutorialHint } from './tutorialSteps';
|
||||
|
||||
interface Rect {
|
||||
top: number;
|
||||
left: number;
|
||||
width: number;
|
||||
height: number;
|
||||
bottom: number;
|
||||
}
|
||||
|
||||
interface TooltipPos {
|
||||
top: number;
|
||||
left: number;
|
||||
}
|
||||
|
||||
interface TutorialOverlayProps {
|
||||
hints: TutorialHint[];
|
||||
currentIndex: number;
|
||||
onNext: () => void;
|
||||
onPrev: () => void;
|
||||
onSkip: () => void;
|
||||
groupProgress?: { groupTotal: number; groupOffset: number; isLastKeyInGroup: boolean } | null;
|
||||
}
|
||||
|
||||
const PADDING = 8;
|
||||
|
||||
function getTargetRect(selector: string): Rect | null {
|
||||
const el = document.querySelector(selector);
|
||||
if (!el) return null;
|
||||
const r = el.getBoundingClientRect();
|
||||
return { top: r.top, left: r.left, width: r.width, height: r.height, bottom: r.bottom };
|
||||
}
|
||||
|
||||
function getSpotlightRect(
|
||||
rect: Rect,
|
||||
padding: number,
|
||||
override?: { top?: number; right?: number; bottom?: number; left?: number }
|
||||
): Rect {
|
||||
const pTop = override?.top ?? padding;
|
||||
const pRight = override?.right ?? padding;
|
||||
const pBottom = override?.bottom ?? padding;
|
||||
const pLeft = override?.left ?? padding;
|
||||
const left = Math.max(0, Math.floor(rect.left - pLeft));
|
||||
const top = Math.max(0, Math.floor(rect.top - pTop));
|
||||
const right = Math.min(window.innerWidth, Math.ceil(rect.left + rect.width + pRight));
|
||||
const bottom = Math.min(window.innerHeight, Math.ceil(rect.top + rect.height + pBottom));
|
||||
|
||||
return {
|
||||
top,
|
||||
bottom,
|
||||
left,
|
||||
width: Math.max(0, right - left),
|
||||
height: Math.max(0, bottom - top),
|
||||
};
|
||||
}
|
||||
|
||||
function calcTooltipPos(rect: Rect, position: TutorialHint['position'], tooltipW = 300, tooltipH = 160): TooltipPos {
|
||||
|
||||
switch (position) {
|
||||
case 'bottom':
|
||||
return {
|
||||
top: Math.min(rect.top + rect.height + PADDING, window.innerHeight - tooltipH - 8),
|
||||
left: Math.min(Math.max(rect.left + rect.width / 2 - tooltipW / 2, 8), window.innerWidth - tooltipW - 8),
|
||||
};
|
||||
case 'top':
|
||||
return {
|
||||
top: Math.max(rect.top - tooltipH - PADDING, 8),
|
||||
left: Math.min(Math.max(rect.left + rect.width / 2 - tooltipW / 2, 8), window.innerWidth - tooltipW - 8),
|
||||
};
|
||||
case 'right':
|
||||
return {
|
||||
top: Math.min(Math.max(rect.top + rect.height / 2 - tooltipH / 2, 8), window.innerHeight - tooltipH - 8),
|
||||
left: Math.min(rect.left + rect.width + PADDING, window.innerWidth - tooltipW - 8),
|
||||
};
|
||||
case 'left':
|
||||
return {
|
||||
top: Math.min(Math.max(rect.top + rect.height / 2 - tooltipH / 2, 8), window.innerHeight - tooltipH - 8),
|
||||
left: Math.max(rect.left - tooltipW - PADDING, 8),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
const TutorialOverlay: React.FC<TutorialOverlayProps> = ({
|
||||
hints,
|
||||
currentIndex,
|
||||
onNext,
|
||||
onPrev,
|
||||
onSkip,
|
||||
groupProgress,
|
||||
}) => {
|
||||
const { t } = useTranslation();
|
||||
const [targetRect, setTargetRect] = useState<Rect | null>(null);
|
||||
const tooltipRef = React.useRef<HTMLDivElement>(null);
|
||||
const [tooltipSize, setTooltipSize] = useState({ w: 300, h: 160 });
|
||||
|
||||
const hint = hints[currentIndex];
|
||||
const isLast = currentIndex === hints.length - 1;
|
||||
// 그룹이 있으면 그룹의 마지막 키 + 마지막 힌트일 때만 완료, 그룹 없으면 기존대로
|
||||
const isFinish = isLast && (groupProgress ? groupProgress.isLastKeyInGroup : true);
|
||||
|
||||
const updateRect = useCallback(() => {
|
||||
if (!hint) return;
|
||||
setTargetRect(getTargetRect(hint.targetSelector));
|
||||
}, [hint]);
|
||||
|
||||
useEffect(() => {
|
||||
updateRect();
|
||||
window.addEventListener('resize', updateRect);
|
||||
window.addEventListener('scroll', updateRect, true);
|
||||
return () => {
|
||||
window.removeEventListener('resize', updateRect);
|
||||
window.removeEventListener('scroll', updateRect, true);
|
||||
};
|
||||
}, [updateRect]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!hint) return;
|
||||
let retryTimer: number | undefined;
|
||||
let rectTimer: number | undefined;
|
||||
let cleanupTarget: (() => void) | undefined;
|
||||
|
||||
const bindToTarget = (el: HTMLElement) => {
|
||||
el.scrollIntoView({ behavior: 'smooth', block: 'center' });
|
||||
rectTimer = window.setTimeout(updateRect, 200);
|
||||
|
||||
const shouldClickAdvance = hint.clickToAdvance !== false;
|
||||
if (shouldClickAdvance) {
|
||||
el.style.cursor = 'pointer';
|
||||
el.addEventListener('click', onNext);
|
||||
cleanupTarget = () => {
|
||||
el.style.cursor = '';
|
||||
el.removeEventListener('click', onNext);
|
||||
};
|
||||
} else {
|
||||
cleanupTarget = () => {};
|
||||
}
|
||||
};
|
||||
|
||||
const tryBind = (): boolean => {
|
||||
const el = document.querySelector(hint.targetSelector) as HTMLElement | null;
|
||||
if (!el) return false;
|
||||
bindToTarget(el);
|
||||
return true;
|
||||
};
|
||||
|
||||
if (!tryBind()) {
|
||||
retryTimer = window.setInterval(() => {
|
||||
if (tryBind() && retryTimer) {
|
||||
window.clearInterval(retryTimer);
|
||||
retryTimer = undefined;
|
||||
}
|
||||
}, 80);
|
||||
}
|
||||
|
||||
return () => {
|
||||
if (retryTimer) window.clearInterval(retryTimer);
|
||||
if (rectTimer) window.clearTimeout(rectTimer);
|
||||
cleanupTarget?.();
|
||||
};
|
||||
}, [hint, updateRect, onNext]);
|
||||
|
||||
// 툴팁 DOM 크기 측정 — 힌트가 바뀔 때만 재측정
|
||||
useEffect(() => {
|
||||
const el = tooltipRef.current;
|
||||
if (!el) return;
|
||||
const { offsetWidth, offsetHeight } = el;
|
||||
if (offsetWidth && offsetHeight) {
|
||||
setTooltipSize(prev =>
|
||||
prev.w === offsetWidth && prev.h === offsetHeight
|
||||
? prev
|
||||
: { w: offsetWidth, h: offsetHeight }
|
||||
);
|
||||
}
|
||||
}, [currentIndex, hints]);
|
||||
|
||||
if (!hint) return null;
|
||||
|
||||
const isTargetVisible = targetRect
|
||||
? targetRect.top + 60 < window.innerHeight && targetRect.bottom > 60
|
||||
: true;
|
||||
|
||||
if (!isTargetVisible) return null;
|
||||
|
||||
const spotlightPadding = hint.spotlightPadding ?? PADDING;
|
||||
const spotlightRect = (targetRect && !hint.noSpotlight) ? getSpotlightRect(targetRect, spotlightPadding, hint.spotlightPaddingOverride) : null;
|
||||
|
||||
// 툴팁은 spotlightRect 기준으로 배치해야 스포트라이트와 겹치지 않음
|
||||
const tooltipPos: TooltipPos = (spotlightRect ?? targetRect)
|
||||
? calcTooltipPos((spotlightRect ?? targetRect)!, hint.position, tooltipSize.w, tooltipSize.h)
|
||||
: {
|
||||
top: window.innerHeight / 2 - tooltipSize.h / 2,
|
||||
left: window.innerWidth / 2 - tooltipSize.w / 2,
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="tutorial-overlay-root">
|
||||
{spotlightRect ? (
|
||||
<>
|
||||
<div
|
||||
className="tutorial-overlay-blocker"
|
||||
style={{ top: 0, left: 0, right: 0, height: spotlightRect.top }}
|
||||
/>
|
||||
<div
|
||||
className="tutorial-overlay-blocker"
|
||||
style={{
|
||||
top: spotlightRect.top,
|
||||
left: 0,
|
||||
width: spotlightRect.left,
|
||||
height: spotlightRect.height,
|
||||
}}
|
||||
/>
|
||||
<div
|
||||
className="tutorial-overlay-blocker"
|
||||
style={{
|
||||
top: spotlightRect.top,
|
||||
left: spotlightRect.left + spotlightRect.width,
|
||||
right: 0,
|
||||
height: spotlightRect.height,
|
||||
}}
|
||||
/>
|
||||
<div
|
||||
className="tutorial-overlay-blocker"
|
||||
style={{
|
||||
top: spotlightRect.top + spotlightRect.height,
|
||||
left: 0,
|
||||
right: 0,
|
||||
bottom: 0,
|
||||
}}
|
||||
/>
|
||||
<div
|
||||
className="tutorial-spotlight-ring"
|
||||
style={{
|
||||
top: spotlightRect.top,
|
||||
left: spotlightRect.left,
|
||||
width: spotlightRect.width,
|
||||
height: spotlightRect.height,
|
||||
}}
|
||||
/>
|
||||
</>
|
||||
) : null}
|
||||
|
||||
<div
|
||||
ref={tooltipRef}
|
||||
className={`tutorial-tooltip${hint.variant === 'bubble' ? ` tutorial-tooltip-bubble tutorial-tooltip-bubble--${hint.position}` : ''}`}
|
||||
style={{ top: tooltipPos.top, left: tooltipPos.left }}
|
||||
onClick={(e) => e.stopPropagation()}
|
||||
>
|
||||
<p className="tutorial-tooltip-title">{t(hint.titleKey)}</p>
|
||||
<p className="tutorial-tooltip-desc">{t(hint.descriptionKey)}</p>
|
||||
{hint.noteKey && (
|
||||
<p className="tutorial-tooltip-note">{t(hint.noteKey)}</p>
|
||||
)}
|
||||
|
||||
<div className="tutorial-tooltip-footer">
|
||||
<span className="tutorial-tooltip-counter">
|
||||
{groupProgress ? groupProgress.groupOffset + 1 : currentIndex + 1} / {groupProgress ? groupProgress.groupTotal : hints.length}
|
||||
</span>
|
||||
<div className="tutorial-tooltip-actions">
|
||||
<button className="tutorial-btn-skip" onClick={onSkip}>
|
||||
{t('tutorial.skip')}
|
||||
</button>
|
||||
{currentIndex > 0 && (
|
||||
<button className="tutorial-btn-prev" onClick={onPrev}>
|
||||
{t('tutorial.prev')}
|
||||
</button>
|
||||
)}
|
||||
{(hint.clickToAdvance !== true || isFinish) && (
|
||||
<button className="tutorial-btn-next" onClick={onNext}>
|
||||
{isFinish ? t('tutorial.finish') : t('tutorial.next')}
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default TutorialOverlay;
|
||||
|
||||
interface TutorialRestartPopupProps {
|
||||
onConfirm: () => void;
|
||||
onCancel: () => void;
|
||||
}
|
||||
|
||||
export const TutorialRestartPopup: React.FC<TutorialRestartPopupProps> = ({ onConfirm, onCancel }) => {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<div className="tutorial-restart-backdrop">
|
||||
<div className="tutorial-restart-popup" onClick={(e) => e.stopPropagation()}>
|
||||
<p className="tutorial-restart-title">{t('tutorial.restart.title')}</p>
|
||||
<p className="tutorial-restart-desc">{t('tutorial.restart.desc')}</p>
|
||||
<div className="tutorial-restart-actions">
|
||||
<button className="tutorial-restart-cancel" onClick={onCancel}>
|
||||
{t('tutorial.restart.cancel')}
|
||||
</button>
|
||||
<button className="tutorial-restart-confirm" onClick={onConfirm}>
|
||||
{t('tutorial.restart.confirm')}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,377 @@
|
||||
export interface TutorialHint {
|
||||
targetSelector: string;
|
||||
titleKey: string;
|
||||
descriptionKey: string;
|
||||
position: 'top' | 'bottom' | 'left' | 'right';
|
||||
noteKey?: string;
|
||||
variant?: 'bubble';
|
||||
clickToAdvance?: boolean;
|
||||
advanceSelector?: string;
|
||||
noSpotlight?: boolean;
|
||||
spotlightPadding?: number;
|
||||
spotlightPaddingOverride?: { top?: number; right?: number; bottom?: number; left?: number };
|
||||
}
|
||||
|
||||
export interface TutorialStepDef {
|
||||
key: string;
|
||||
hints: TutorialHint[];
|
||||
}
|
||||
|
||||
export const TUTORIAL_KEYS = {
|
||||
LANDING: 'landing',
|
||||
ANALYSIS: 'analysis',
|
||||
ASSET: 'asset',
|
||||
SOUND: 'sound',
|
||||
SOUND_LYRICS: 'soundLyrics',
|
||||
SOUND_AUDIO: 'soundAudio',
|
||||
GENERATING:'generating',
|
||||
COMPLETION: 'completion',
|
||||
MY_INFO: 'myInfo',
|
||||
ADO2_CONTENTS: 'ado2Contents',
|
||||
UPLOAD_MODAL: 'uploadModal',
|
||||
UPLOAD_FORM: 'uploadForm',
|
||||
DASHBOARD: 'dashboard',
|
||||
CONTENT_CALENDAR: 'contentCalendar',
|
||||
FEEDBACK: 'feedback',
|
||||
} as const;
|
||||
|
||||
// 같은 페이지에 속하는 튜토리얼 키 그룹 — 진행 카운터를 합산해서 표시
|
||||
export const TUTORIAL_PAGE_GROUPS: string[][] = [
|
||||
[TUTORIAL_KEYS.SOUND, TUTORIAL_KEYS.SOUND_LYRICS, TUTORIAL_KEYS.SOUND_AUDIO],
|
||||
[TUTORIAL_KEYS.GENERATING, TUTORIAL_KEYS.COMPLETION],
|
||||
[TUTORIAL_KEYS.UPLOAD_MODAL, TUTORIAL_KEYS.UPLOAD_FORM],
|
||||
];
|
||||
|
||||
export const tutorialSteps: TutorialStepDef[] = [
|
||||
{
|
||||
key: TUTORIAL_KEYS.LANDING,
|
||||
hints: [
|
||||
{
|
||||
targetSelector: '.hero-dropdown-trigger',
|
||||
titleKey: 'tutorial.landing.dropdown.title',
|
||||
descriptionKey: 'tutorial.landing.dropdown.desc',
|
||||
position: 'left',
|
||||
clickToAdvance: false,
|
||||
noSpotlight: true,
|
||||
variant: 'bubble',
|
||||
},
|
||||
{
|
||||
targetSelector: '.hero-input-wrapper',
|
||||
titleKey: 'tutorial.landing.field.title',
|
||||
descriptionKey: 'tutorial.landing.field.desc',
|
||||
position: 'right',
|
||||
clickToAdvance: false,
|
||||
noSpotlight: true,
|
||||
variant: 'bubble',
|
||||
},
|
||||
{
|
||||
targetSelector: '.hero-button',
|
||||
titleKey: 'tutorial.landing.button.title',
|
||||
descriptionKey: 'tutorial.landing.button.desc',
|
||||
position: 'right',
|
||||
clickToAdvance: true,
|
||||
noSpotlight: true,
|
||||
variant: 'bubble',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
key: TUTORIAL_KEYS.ASSET,
|
||||
hints: [
|
||||
{
|
||||
targetSelector: '.asset-column.asset-column-left',
|
||||
titleKey: 'tutorial.asset.image.title',
|
||||
descriptionKey: 'tutorial.asset.image.desc',
|
||||
position: 'left',
|
||||
clickToAdvance: false,
|
||||
},
|
||||
{
|
||||
targetSelector: '.asset-upload-zone',
|
||||
titleKey: 'tutorial.asset.upload.title',
|
||||
descriptionKey: 'tutorial.asset.upload.desc',
|
||||
position: 'left',
|
||||
clickToAdvance: false,
|
||||
},
|
||||
{
|
||||
targetSelector: '.asset-ratio-section',
|
||||
titleKey: 'tutorial.asset.ratio.title',
|
||||
descriptionKey: 'tutorial.asset.ratio.desc',
|
||||
position: 'left',
|
||||
clickToAdvance: false,
|
||||
},
|
||||
{
|
||||
targetSelector: '.asset-next-button',
|
||||
titleKey: 'tutorial.asset.next.title',
|
||||
descriptionKey: 'tutorial.asset.next.desc',
|
||||
position: 'top',
|
||||
clickToAdvance: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
key: TUTORIAL_KEYS.SOUND,
|
||||
hints: [
|
||||
{
|
||||
targetSelector: '.genre-grid',
|
||||
titleKey: 'tutorial.sound.genre.title',
|
||||
descriptionKey: 'tutorial.sound.genre.desc',
|
||||
position: 'top',
|
||||
clickToAdvance: false,
|
||||
},
|
||||
{
|
||||
targetSelector: '.language-grid',
|
||||
titleKey: 'tutorial.sound.language.title',
|
||||
descriptionKey: 'tutorial.sound.language.desc',
|
||||
position: 'top',
|
||||
clickToAdvance: false,
|
||||
},
|
||||
{
|
||||
targetSelector: '.btn-generate-sound',
|
||||
titleKey: 'tutorial.sound.generate.title',
|
||||
descriptionKey: 'tutorial.sound.generate.desc',
|
||||
position: 'right',
|
||||
clickToAdvance: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
key: TUTORIAL_KEYS.SOUND_LYRICS,
|
||||
hints: [
|
||||
{
|
||||
targetSelector: '.lyrics-display',
|
||||
titleKey: 'tutorial.sound.lyrics.title',
|
||||
descriptionKey: 'tutorial.sound.lyrics.desc',
|
||||
position: 'left',
|
||||
clickToAdvance: false,
|
||||
},
|
||||
{
|
||||
targetSelector: '.status-message-new',
|
||||
titleKey: 'tutorial.sound.lyricsWait.title',
|
||||
descriptionKey: 'tutorial.sound.lyricsWait.desc',
|
||||
position: 'right',
|
||||
clickToAdvance: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
key: TUTORIAL_KEYS.SOUND_AUDIO,
|
||||
hints: [
|
||||
{
|
||||
targetSelector: '.audio-player',
|
||||
titleKey: 'tutorial.sound.audioPlayer.title',
|
||||
descriptionKey: 'tutorial.sound.audioPlayer.desc',
|
||||
position: 'left',
|
||||
clickToAdvance: false,
|
||||
},
|
||||
{
|
||||
targetSelector: '.btn-video-generate',
|
||||
titleKey: 'tutorial.sound.video.title',
|
||||
descriptionKey: 'tutorial.sound.video.desc',
|
||||
position: 'top',
|
||||
clickToAdvance: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
key: TUTORIAL_KEYS.MY_INFO,
|
||||
hints: [
|
||||
{
|
||||
targetSelector: '.youtube-connect-section',
|
||||
titleKey: 'tutorial.myInfo.myInfo.title',
|
||||
descriptionKey: 'tutorial.myInfo.myInfo.desc',
|
||||
position: 'top',
|
||||
clickToAdvance: false,
|
||||
},
|
||||
{
|
||||
targetSelector: '.myinfo-social-btn',
|
||||
titleKey: 'tutorial.myInfo.connect.title',
|
||||
descriptionKey: 'tutorial.myInfo.connect.desc',
|
||||
noteKey: 'tutorial.myInfo.connect.note',
|
||||
position: 'top',
|
||||
clickToAdvance: true,
|
||||
},
|
||||
{
|
||||
targetSelector: '.myinfo-connected-accounts',
|
||||
titleKey: 'tutorial.myInfo.connected.title',
|
||||
descriptionKey: 'tutorial.myInfo.connected.desc',
|
||||
position: 'top',
|
||||
clickToAdvance: false,
|
||||
},
|
||||
{
|
||||
targetSelector: '#sidebar-ado2-contents',
|
||||
titleKey: 'tutorial.myInfo.ado2.title',
|
||||
descriptionKey: 'tutorial.myInfo.ado2.desc',
|
||||
position: 'right',
|
||||
clickToAdvance: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
key: TUTORIAL_KEYS.ADO2_CONTENTS,
|
||||
hints: [
|
||||
{
|
||||
targetSelector: '.ado2-content-card',
|
||||
titleKey: 'tutorial.ado2.list.title',
|
||||
descriptionKey: 'tutorial.ado2.list.desc',
|
||||
position: 'right',
|
||||
clickToAdvance: false,
|
||||
},
|
||||
{
|
||||
targetSelector: '.content-upload-btn',
|
||||
titleKey: 'tutorial.ado2.download.title',
|
||||
descriptionKey: 'tutorial.ado2.download.desc',
|
||||
position: 'right',
|
||||
clickToAdvance: false,
|
||||
},
|
||||
{
|
||||
targetSelector: '.content-delete-btn',
|
||||
titleKey: 'tutorial.ado2.delete.title',
|
||||
descriptionKey: 'tutorial.ado2.delete.desc',
|
||||
position: 'right',
|
||||
clickToAdvance: false,
|
||||
},
|
||||
{
|
||||
targetSelector: '.content-download-btn',
|
||||
titleKey: 'tutorial.ado2.upload.title',
|
||||
descriptionKey: 'tutorial.ado2.upload.desc',
|
||||
position: 'right',
|
||||
clickToAdvance: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
key: TUTORIAL_KEYS.GENERATING,
|
||||
hints:[
|
||||
{
|
||||
targetSelector: '.comp2-info-section',
|
||||
titleKey: 'tutorial.completion.contentInfo.title',
|
||||
descriptionKey: 'tutorial.completion.contentInfo.desc',
|
||||
position: 'left',
|
||||
},
|
||||
{
|
||||
targetSelector: '.comp2-video-section',
|
||||
titleKey: 'tutorial.completion.generating.title',
|
||||
descriptionKey: 'tutorial.completion.generating.desc',
|
||||
position: 'right',
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
key: TUTORIAL_KEYS.COMPLETION,
|
||||
hints: [
|
||||
{
|
||||
targetSelector: '.comp2-video-section',
|
||||
titleKey: 'tutorial.completion.completion.title',
|
||||
descriptionKey: 'tutorial.completion.completion.desc',
|
||||
position: 'right',
|
||||
clickToAdvance: false,
|
||||
},
|
||||
{
|
||||
targetSelector: '#sidebar-my-info',
|
||||
titleKey: 'tutorial.completion.myInfo.title',
|
||||
descriptionKey: 'tutorial.completion.myInfo.desc',
|
||||
position: 'right',
|
||||
clickToAdvance: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
key: TUTORIAL_KEYS.UPLOAD_MODAL,
|
||||
hints: [
|
||||
{
|
||||
targetSelector: '.social-posting-content',
|
||||
titleKey: 'tutorial.upload.seo.title',
|
||||
descriptionKey: 'tutorial.upload.seo.desc',
|
||||
position: 'right',
|
||||
clickToAdvance: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
key: TUTORIAL_KEYS.UPLOAD_FORM,
|
||||
hints: [
|
||||
{
|
||||
targetSelector: '.social-posting-form',
|
||||
titleKey: 'tutorial.upload.required.title',
|
||||
descriptionKey: 'tutorial.upload.required.desc',
|
||||
position: 'left',
|
||||
clickToAdvance: false,
|
||||
},
|
||||
{
|
||||
targetSelector: '.social-posting-radio-group',
|
||||
titleKey: 'tutorial.upload.schedule.title',
|
||||
descriptionKey: 'tutorial.upload.schedule.desc',
|
||||
position: 'left',
|
||||
clickToAdvance: false,
|
||||
},
|
||||
{
|
||||
targetSelector: '.social-posting-btn:not(.cancel)',
|
||||
titleKey: 'tutorial.upload.submit.title',
|
||||
descriptionKey: 'tutorial.upload.submit.desc',
|
||||
position: 'top',
|
||||
clickToAdvance: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
key: TUTORIAL_KEYS.DASHBOARD,
|
||||
hints: [
|
||||
{
|
||||
targetSelector: '.stats-grid-8',
|
||||
titleKey: 'tutorial.dashboard.metrics.title',
|
||||
descriptionKey: 'tutorial.dashboard.metrics.desc',
|
||||
position: 'bottom',
|
||||
},
|
||||
{
|
||||
targetSelector: '.yoy-chart-card',
|
||||
titleKey: 'tutorial.dashboard.chart.title',
|
||||
descriptionKey: 'tutorial.dashboard.chart.desc',
|
||||
position: 'right',
|
||||
},
|
||||
{
|
||||
targetSelector: '.tutorial-center-anchor',
|
||||
titleKey: 'tutorial.dashboard.more.title',
|
||||
descriptionKey: 'tutorial.dashboard.more.desc',
|
||||
position: 'bottom',
|
||||
clickToAdvance: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
key: TUTORIAL_KEYS.CONTENT_CALENDAR,
|
||||
hints: [
|
||||
{
|
||||
targetSelector: '.calendar-grid-area',
|
||||
titleKey: 'tutorial.contentCalendar.grid.title',
|
||||
descriptionKey: 'tutorial.contentCalendar.grid.desc',
|
||||
position: 'top',
|
||||
clickToAdvance: false,
|
||||
},
|
||||
{
|
||||
targetSelector: '.calendar-side-panel',
|
||||
titleKey: 'tutorial.contentCalendar.panel.title',
|
||||
descriptionKey: 'tutorial.contentCalendar.panel.desc',
|
||||
position: 'left',
|
||||
clickToAdvance: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
key: TUTORIAL_KEYS.FEEDBACK,
|
||||
hints: [
|
||||
{
|
||||
targetSelector: '.tutorial-center-anchor',
|
||||
titleKey: 'tutorial.feedback.complete.title',
|
||||
descriptionKey: 'tutorial.feedback.complete.desc',
|
||||
position: 'bottom',
|
||||
clickToAdvance: false,
|
||||
},
|
||||
{
|
||||
targetSelector: '.sidebar-inquiry-btn',
|
||||
titleKey: 'tutorial.feedback.title',
|
||||
descriptionKey: 'tutorial.feedback.desc',
|
||||
position: 'right',
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
@@ -0,0 +1,210 @@
|
||||
import React, { useState, useCallback } from 'react';
|
||||
import { tutorialSteps, TutorialHint, TUTORIAL_PAGE_GROUPS } from './tutorialSteps';
|
||||
|
||||
// 현재 키가 속한 그룹의 전체 힌트 수와 현재까지의 offset 반환
|
||||
function getGroupProgress(key: string, currentIndex: number): { groupTotal: number; groupOffset: number; isLastKeyInGroup: boolean } | null {
|
||||
const group = TUTORIAL_PAGE_GROUPS.find(g => g.includes(key));
|
||||
if (!group) return null;
|
||||
let offset = 0;
|
||||
let total = 0;
|
||||
for (const k of group) {
|
||||
const step = tutorialSteps.find(s => s.key === k);
|
||||
const count = step?.hints.length ?? 0;
|
||||
if (k === key) offset = total;
|
||||
total += count;
|
||||
}
|
||||
const isLastKeyInGroup = group[group.length - 1] === key;
|
||||
return { groupTotal: total, groupOffset: offset + currentIndex, isLastKeyInGroup };
|
||||
}
|
||||
|
||||
const SEEN_KEY = 'ado2_tutorial_seen';
|
||||
const PROGRESS_KEY = 'ado2_tutorial_progress';
|
||||
const ENABLED_KEY = 'ado2_tutorial_enabled';
|
||||
|
||||
// 전역 단일 활성 튜토리얼 관리 — 새 튜토리얼 시작 시 이전 것을 skip 처리
|
||||
let globalSkip: (() => void) | null = null;
|
||||
|
||||
function getSeenKeys(): string[] {
|
||||
try {
|
||||
return JSON.parse(localStorage.getItem(SEEN_KEY) || '[]');
|
||||
} catch {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
function markSeen(key: string) {
|
||||
const seen = getSeenKeys();
|
||||
if (!seen.includes(key)) {
|
||||
localStorage.setItem(SEEN_KEY, JSON.stringify([...seen, key]));
|
||||
}
|
||||
clearProgress(key);
|
||||
}
|
||||
|
||||
function saveProgress(key: string, index: number) {
|
||||
try {
|
||||
const progress = JSON.parse(localStorage.getItem(PROGRESS_KEY) || '{}');
|
||||
progress[key] = index;
|
||||
localStorage.setItem(PROGRESS_KEY, JSON.stringify(progress));
|
||||
} catch {}
|
||||
}
|
||||
|
||||
function loadProgress(key: string): number {
|
||||
try {
|
||||
const progress = JSON.parse(localStorage.getItem(PROGRESS_KEY) || '{}');
|
||||
return progress[key] ?? 0;
|
||||
} catch {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
function clearProgress(key: string) {
|
||||
try {
|
||||
const progress = JSON.parse(localStorage.getItem(PROGRESS_KEY) || '{}');
|
||||
delete progress[key];
|
||||
localStorage.setItem(PROGRESS_KEY, JSON.stringify(progress));
|
||||
} catch {}
|
||||
}
|
||||
|
||||
interface UseTutorialReturn {
|
||||
isActive: boolean;
|
||||
isEnabled: boolean;
|
||||
isRestartPopupVisible: boolean;
|
||||
currentHintIndex: number;
|
||||
hints: TutorialHint[];
|
||||
tutorialKey: string | null;
|
||||
groupProgress: { groupTotal: number; groupOffset: number; isLastKeyInGroup: boolean } | null;
|
||||
startTutorial: (key: string, onComplete?: () => void, forceFromStart?: boolean) => void;
|
||||
nextHint: () => void;
|
||||
prevHint: () => void;
|
||||
skipTutorial: () => void;
|
||||
toggleTutorial: (currentKey: string | null) => void;
|
||||
showRestartPopup: (key: string) => void;
|
||||
confirmRestart: () => void;
|
||||
cancelRestart: () => void;
|
||||
hasSeen: (key: string) => boolean;
|
||||
}
|
||||
|
||||
export function useTutorial(): UseTutorialReturn {
|
||||
const [isActive, setIsActive] = useState(false);
|
||||
const [isEnabled, setIsEnabled] = useState(() => localStorage.getItem(ENABLED_KEY) !== 'false');
|
||||
const [isRestartPopupVisible, setIsRestartPopupVisible] = useState(false);
|
||||
const [pendingRestartKey, setPendingRestartKey] = useState<string | null>(null);
|
||||
const [currentHintIndex, setCurrentHintIndex] = useState(0);
|
||||
const [hints, setHints] = useState<TutorialHint[]>([]);
|
||||
const [tutorialKey, setTutorialKey] = useState<string | null>(null);
|
||||
const onCompleteRef = React.useRef<(() => void) | undefined>(undefined);
|
||||
|
||||
const startTutorial = useCallback((key: string, onComplete?: () => void, forceFromStart?: boolean) => {
|
||||
if (localStorage.getItem(ENABLED_KEY) === 'false') return;
|
||||
const step = tutorialSteps.find(s => s.key === key);
|
||||
if (!step || step.hints.length === 0) return;
|
||||
// 다른 인스턴스에서 활성화된 튜토리얼이 있으면 skip 처리
|
||||
globalSkip?.();
|
||||
const savedIndex = forceFromStart ? 0 : loadProgress(key);
|
||||
const resumeIndex = savedIndex < step.hints.length ? savedIndex : 0;
|
||||
onCompleteRef.current = onComplete;
|
||||
setHints(step.hints);
|
||||
setTutorialKey(key);
|
||||
setCurrentHintIndex(resumeIndex);
|
||||
setIsActive(true);
|
||||
// 이 인스턴스의 skip을 전역에 등록
|
||||
globalSkip = () => {
|
||||
if (key) saveProgress(key, resumeIndex);
|
||||
setIsActive(false);
|
||||
setCurrentHintIndex(0);
|
||||
globalSkip = null;
|
||||
};
|
||||
}, []);
|
||||
|
||||
const nextHint = useCallback(() => {
|
||||
setCurrentHintIndex(prev => {
|
||||
if (prev < hints.length - 1) {
|
||||
const next = prev + 1;
|
||||
if (tutorialKey) saveProgress(tutorialKey, next);
|
||||
return next;
|
||||
}
|
||||
// 마지막 힌트 완료 → seen 기록 + 진행 상태 삭제
|
||||
setIsActive(false);
|
||||
if (tutorialKey) markSeen(tutorialKey);
|
||||
globalSkip = null; // 완료된 튜토리얼은 globalSkip 해제
|
||||
onCompleteRef.current?.();
|
||||
onCompleteRef.current = undefined;
|
||||
return 0;
|
||||
});
|
||||
}, [hints.length, tutorialKey]);
|
||||
|
||||
const prevHint = useCallback(() => {
|
||||
setCurrentHintIndex(prev => Math.max(0, prev - 1));
|
||||
}, []);
|
||||
|
||||
// 건너뛰기: 현재 진행 인덱스 저장 후 오버레이 닫기 → 다음 방문 시 이어서 표시
|
||||
const skipTutorial = useCallback(() => {
|
||||
if (tutorialKey) saveProgress(tutorialKey, currentHintIndex);
|
||||
setIsActive(false);
|
||||
setCurrentHintIndex(0);
|
||||
}, [tutorialKey, currentHintIndex]);
|
||||
|
||||
const toggleTutorial = useCallback((currentKey: string | null) => {
|
||||
if (isEnabled) {
|
||||
// off: 튜토리얼 중단 + 비활성화
|
||||
setIsActive(false);
|
||||
setIsEnabled(false);
|
||||
localStorage.setItem(ENABLED_KEY, 'false');
|
||||
} else {
|
||||
// on: seen/progress 초기화 + 현재 화면 튜토리얼 시작
|
||||
localStorage.removeItem(SEEN_KEY);
|
||||
localStorage.removeItem(PROGRESS_KEY);
|
||||
localStorage.setItem(ENABLED_KEY, 'true');
|
||||
setIsEnabled(true);
|
||||
if (currentKey) {
|
||||
startTutorial(currentKey, undefined, true);
|
||||
}
|
||||
}
|
||||
}, [isEnabled, startTutorial]);
|
||||
|
||||
// 튜토리얼 다시 보기: 팝업 표시만
|
||||
const showRestartPopup = useCallback((key: string) => {
|
||||
setPendingRestartKey(key);
|
||||
setIsRestartPopupVisible(true);
|
||||
}, []);
|
||||
|
||||
// 팝업에서 확인 → seen/progress 초기화 후 튜토리얼 시작
|
||||
const confirmRestart = useCallback(() => {
|
||||
setIsRestartPopupVisible(false);
|
||||
if (pendingRestartKey) {
|
||||
localStorage.removeItem(SEEN_KEY);
|
||||
localStorage.removeItem(PROGRESS_KEY);
|
||||
startTutorial(pendingRestartKey, undefined, true);
|
||||
}
|
||||
setPendingRestartKey(null);
|
||||
}, [pendingRestartKey, startTutorial]);
|
||||
|
||||
// 팝업에서 취소
|
||||
const cancelRestart = useCallback(() => {
|
||||
setIsRestartPopupVisible(false);
|
||||
setPendingRestartKey(null);
|
||||
}, []);
|
||||
|
||||
const hasSeen = useCallback((key: string) => {
|
||||
return getSeenKeys().includes(key);
|
||||
}, []);
|
||||
|
||||
return {
|
||||
isActive,
|
||||
isEnabled,
|
||||
isRestartPopupVisible,
|
||||
currentHintIndex,
|
||||
hints,
|
||||
tutorialKey,
|
||||
groupProgress: tutorialKey ? getGroupProgress(tutorialKey, currentHintIndex) : null,
|
||||
startTutorial,
|
||||
nextHint,
|
||||
prevHint,
|
||||
skipTutorial,
|
||||
toggleTutorial,
|
||||
showRestartPopup,
|
||||
confirmRestart,
|
||||
cancelRestart,
|
||||
hasSeen,
|
||||
};
|
||||
}
|
||||
+162
-13
@@ -13,7 +13,83 @@
|
||||
"myInfo": "My Info",
|
||||
"defaultUser": "User",
|
||||
"loggingOut": "Logging out...",
|
||||
"logout": "Log Out"
|
||||
"logout": "Log Out",
|
||||
"tutorialRestart": "Restart Tutorial",
|
||||
"tutorial": "Tutorial",
|
||||
"tutorialOn": "Enable Tutorial",
|
||||
"tutorialOff": "Disable Tutorial",
|
||||
"inquiry": "Feedback"
|
||||
},
|
||||
"tutorial": {
|
||||
"skip": "Skip",
|
||||
"next": "Next",
|
||||
"prev": "Back",
|
||||
"finish": "Done",
|
||||
"landing": {
|
||||
"intro": { "title": "Welcome to ADO2 Tutorial", "desc": "We'll guide you through ADO2 step by step." },
|
||||
"dropdown": { "title": "Choose Search Type", "desc": "Select URL or business name from the dropdown." },
|
||||
"field": { "title": "Enter Search Term", "desc": "For URL, paste a Naver Maps share URL.\nFor business name, type the name and select from the list." },
|
||||
"button": { "title": "Start Brand Analysis", "desc": "Click the button to let AI start analyzing your brand." }
|
||||
},
|
||||
"asset": {
|
||||
"image": { "title": "Image List", "desc": "Photos from Naver Place. Tap 'Show more' to see the rest, or X to remove any." },
|
||||
"upload": { "title": "Add Images", "desc": "You can freely add more images." },
|
||||
"ratio": { "title": "Select Video Ratio", "desc": "Choose the ratio for the video to be generated." },
|
||||
"next": { "title": "Next Step", "desc": "Proceed to the next step when ready." }
|
||||
},
|
||||
"sound": {
|
||||
"genre": { "title": "Select Genre", "desc": "Pick a music genre that fits your brand.", "note": "Background music is coming soon." },
|
||||
"language": { "title": "Select Language", "desc": "You can choose the language for the sound.\nWant to continue with Korean?" },
|
||||
"generate": { "title": "Generate Sound", "desc": "Click the button and AI will generate lyrics and music in your chosen genre and language." },
|
||||
"lyrics": { "title": "Lyrics Complete", "desc": "AI wrote lyrics in your selected language.\nCheck the generated lyrics." },
|
||||
"lyricsWait": { "title": "Generating Music", "desc": "AI is composing music based on the lyrics.\nPlease wait a moment." },
|
||||
"audioPlayer": { "title": "Preview the Music", "desc": "Music generation is complete.\nPress play to listen to the generated music." },
|
||||
"video": { "title": "Generate Video", "desc": "Click the button to start generating your video." }
|
||||
},
|
||||
"myInfo": {
|
||||
"myInfo": { "title": "My Info", "desc": "In My Info, you can manage your social connections and view connected accounts." },
|
||||
"connect": { "title": "Connect Now", "desc": "Click the YouTube connect button to go to the connection page.", "note": "Instagram connection is coming soon." },
|
||||
"connected": { "title": "Connected Accounts", "desc": "Your linked social accounts appear here.\nCheck after connecting." },
|
||||
"ado2": { "title": "ADO2 Contents", "desc": "You can now upload the generated video.\nClick to navigate." }
|
||||
},
|
||||
"ado2": {
|
||||
"list": { "title": "Generated Videos", "desc": "View all AI-created videos here." },
|
||||
"download": { "title": "Download", "desc": "Download the video to your device." },
|
||||
"delete": { "title": "Delete", "desc": "Remove videos you no longer need." },
|
||||
"upload": { "title": "Upload to Social Media", "desc": "Select a video and upload it to social media." }
|
||||
},
|
||||
"completion": {
|
||||
"contentInfo": { "title": "Content Info", "desc": "Check the title, genre, resolution, and lyrics of the generated content." },
|
||||
"generating": { "title": "Generating Video", "desc": "AI is creating your video.\nPlease wait a moment." },
|
||||
"completion": { "title": "Video Complete!", "desc": "Your video is ready. Want to take a look?" },
|
||||
"myInfo": { "title": "Connect Social Account", "desc": "To upload your video to YouTube, connect your social account in My Info. Click to go there." }
|
||||
},
|
||||
"upload": {
|
||||
"seo": { "title": "Title & Description", "desc": "AI is generating the title and description for your video. Please wait a moment." },
|
||||
"required": { "title": "Required Fields", "desc": "Fields marked with * are required.\nPlease check them before uploading." },
|
||||
"schedule": { "title": "Schedule Upload", "desc": "Post now or schedule for a specific time." },
|
||||
"submit": { "title": "Start Upload", "desc": "Click the Post button to start uploading." }
|
||||
},
|
||||
"dashboard": {
|
||||
"metrics": { "title": "Key Metrics", "desc": "Check views, subscribers, and other stats for content uploaded via ADO2." },
|
||||
"chart": { "title": "Growth Chart", "desc": "Track your channel's growth over time." },
|
||||
"more": { "title": "More Analytics", "desc": "Even more statistics are available at a glance on the dashboard." }
|
||||
},
|
||||
"contentCalendar": {
|
||||
"grid": { "title": "Content Calendar", "desc": "View your content schedule by date.\nWhy not select today?" },
|
||||
"panel": { "title": "Content List", "desc": "Check the detailed content schedule here." }
|
||||
},
|
||||
"feedback": {
|
||||
"complete": { "title": "Tutorial Complete 🎉", "desc": "You've completed the full flow from brand analysis to YouTube upload.\nTo replay the tutorial, click the button in the top right." },
|
||||
"title": "Customer Feedback",
|
||||
"desc": "Share any issues or suggestions to help us improve."
|
||||
},
|
||||
"restart": {
|
||||
"title": "Restart Tutorial?",
|
||||
"desc": "The tutorial will restart from the current screen.",
|
||||
"confirm": "Start",
|
||||
"cancel": "Cancel"
|
||||
}
|
||||
},
|
||||
"footer": {
|
||||
"company":"O2O Inc.",
|
||||
@@ -55,9 +131,9 @@
|
||||
"invalidVideoInfo": "Video information is invalid. (missing video_id)",
|
||||
"uploadStartFailed": "Failed to start upload.",
|
||||
"uploadFailed": "Upload failed.",
|
||||
"autoSeoTitle": "This will be automatically generated. please wait.",
|
||||
"autoSeoDescription": "This will be automatically generated. please wait.",
|
||||
"autoSeoTags": "This will be automatically generated. please wait."
|
||||
"autoSeoTitle": "Auto-generating... (30–60 sec)",
|
||||
"autoSeoDescription": "Auto-generating... (30–60 sec)",
|
||||
"autoSeoTags": "Auto-generating... (30–60 sec)"
|
||||
},
|
||||
"upload": {
|
||||
"title": "YouTube Upload",
|
||||
@@ -79,7 +155,7 @@
|
||||
"hero": {
|
||||
"searchTypeBusinessName": "Business Name",
|
||||
"placeholderBusinessName": "Enter a business name",
|
||||
"guideUrl": "A video will be automatically generated from the information gathered from the URL.",
|
||||
"guideUrl": "Search for a place on Naver Maps, tap Share,\nthen paste the URL here.",
|
||||
"guideBusinessName": "Search by business name to retrieve information.",
|
||||
"errorUrlRequired": "Please enter a URL.",
|
||||
"errorNameRequired": "Please enter a business name.",
|
||||
@@ -97,7 +173,7 @@
|
||||
"feature1Title": "Business Core Information Analysis",
|
||||
"feature1Desc": "Enter the URL of your homepage,\nNaver Map, blog, etc.",
|
||||
"feature2Title": "Automated Promotional Content Creation",
|
||||
"feature2Desc": "Based on analyzed information,\nautomatically create music, subtitles, songs,\nand videos tailored to your business",
|
||||
"feature2Desc": "Based on analyzed information,\nautomatically create music, subtitles,\nand videos tailored to your business",
|
||||
"feature3Title": "Multi-Channel Auto Distribution",
|
||||
"feature3Desc": "Completed videos can be downloaded\nor uploaded directly to social media"
|
||||
},
|
||||
@@ -115,7 +191,7 @@
|
||||
"urlInput": {
|
||||
"searchTypeBusinessName": "Business Name",
|
||||
"placeholderBusinessName": "Enter a business name",
|
||||
"guideUrl": "A video will be automatically generated from the information gathered from the URL.",
|
||||
"guideUrl": "Search for a place on Naver Maps, tap Share, then paste the URL here.",
|
||||
"guideBusinessName": "Search by business name to retrieve information.",
|
||||
"searchButton": "Search",
|
||||
"searching": "Searching...",
|
||||
@@ -136,7 +212,7 @@
|
||||
"back": "Go Back",
|
||||
"loadMore": "Load more",
|
||||
"uploadFailed": "Image upload failed.",
|
||||
"uploading": "Uploading...",
|
||||
"uploading": "Uploading... (30 sec – 2 min)",
|
||||
"nextStep": "Next Step"
|
||||
},
|
||||
"soundStudio": {
|
||||
@@ -155,13 +231,15 @@
|
||||
"lyricsHint": "Select the lyrics area to edit",
|
||||
"lyricsPlaceholder": "Lyrics will be displayed when sound is generated.",
|
||||
"generateButton": "Generate Sound",
|
||||
"regenerateButton": "Regenerate",
|
||||
"regenerateHint": "Press the regenerate button to create new lyrics and music.",
|
||||
"generating": "Generating...",
|
||||
"generateVideo": "Generate Video",
|
||||
"videoGenerating": "Generating Video",
|
||||
"noBusinessInfo": "No business information. Please try again.",
|
||||
"noImageUploadInfo": "No image upload information. Please go back to the previous step and try again.",
|
||||
"generatingLyrics": "Generating lyrics...",
|
||||
"generatingSong": "Generating song...",
|
||||
"generatingLyrics": "Generating lyrics...\n(30–60 sec)",
|
||||
"generatingSong": "Generating music...\n(1–2 min)",
|
||||
"songQueued": "Song generation queued...",
|
||||
"retryMessage": "Regenerating due to timeout... ({{count}}/{{max}})",
|
||||
"lyricGenerationFailed": "Lyrics generation request failed.",
|
||||
@@ -191,7 +269,7 @@
|
||||
"statusPlanned": "Scheduled",
|
||||
"statusWaiting": "Waiting",
|
||||
"statusTranscribing": "Transcribing",
|
||||
"statusRendering": "Rendering",
|
||||
"statusRendering": "Rendering (2–3 min)",
|
||||
"statusSucceeded": "Completed",
|
||||
"statusDefault": "Processing...",
|
||||
"aiOptimization": "AI Optimization",
|
||||
@@ -213,7 +291,17 @@
|
||||
"videoNotReady": "The video is not ready yet.",
|
||||
"youtubeUploadMessage": "Uploading video to YouTube channel \"{{channelName}}\".\n\n(Upload feature coming soon)",
|
||||
"deployComingSoon": "The deployment feature for the selected social channel is coming soon.",
|
||||
"youtubeExpiredAlert": "YouTube authentication has expired. Redirecting to reconnect page."
|
||||
"youtubeExpiredAlert": "YouTube authentication has expired. Redirecting to reconnect page.",
|
||||
"contentComplete": "Content Creation Complete",
|
||||
"contentCompleteDesc": "Your optimized content has been created through AI analysis and editing",
|
||||
"contentInfo": "File Name",
|
||||
"genre": "Genre",
|
||||
"resolution": "Resolution",
|
||||
"lyrics": "Lyrics",
|
||||
"sampleLyrics": "Loading lyrics...",
|
||||
"downloading": "Downloading...",
|
||||
"download": "Download",
|
||||
"uploadToSocial": "Upload to Social"
|
||||
},
|
||||
"dashboard": {
|
||||
"title": "Dashboard",
|
||||
@@ -286,7 +374,38 @@
|
||||
"stayIntroReel": "Stay Meomum Introduction Reel",
|
||||
"newYearEvent": "New Year Special Event",
|
||||
"nightTimelapse": "Pension Night View Timelapse"
|
||||
}
|
||||
},
|
||||
"metricTotalViews": "Views",
|
||||
"metricWatchTime": "Watch Time",
|
||||
"metricAvgViewDuration": "Avg. Watch Duration",
|
||||
"metricNewSubscribers": "New Subscribers",
|
||||
"metricUploadedVideos": "Uploaded Videos",
|
||||
"unitHours": "h",
|
||||
"unitMinutes": "m",
|
||||
"noDataInPeriod": "No data available for this period.",
|
||||
"dataLoading": "Loading data...",
|
||||
"noUploadsTitle": "No uploaded videos yet.",
|
||||
"noUploadsDesc": "Upload videos via ADO2 to see real stats.",
|
||||
"reconnectButton": "Reconnect →",
|
||||
"connectButton": "Connect →",
|
||||
"retryButton": "Retry →",
|
||||
"selectAccount": "Select an account",
|
||||
"modeAnnual": "Annual",
|
||||
"modeMonthly": "Monthly",
|
||||
"chartThisYear": "This Year",
|
||||
"chartLastYear": "Last Year",
|
||||
"chartThisMonth": "This Month",
|
||||
"chartLastMonth": "Last Month",
|
||||
"monthOverMonth": "Month-over-Month Growth",
|
||||
"noAudienceData": "Not enough data to show real audience insights.",
|
||||
"mockContentNotice": "The content shown below is sample data, not your actual content.",
|
||||
"dataDelayTitle": "Data is being prepared",
|
||||
"dataDelayDesc": "According to YouTube's policy, analytics data may take up to 48 hours to be reflected after a video is uploaded. Please check back later.",
|
||||
"sampleHide": "Hide Sample",
|
||||
"sampleShow": "Show Sample",
|
||||
"recentVideosDesc": "Showing stats for the latest 30 videos uploaded via ADO2.",
|
||||
"channelStatsDesc": "Showing stats for the selected channel.",
|
||||
"youtubeApiFailed": "Failed to call YouTube Analytics API."
|
||||
},
|
||||
"myInfo": {
|
||||
"title": "My Info",
|
||||
@@ -367,6 +486,36 @@
|
||||
"required": "*",
|
||||
"unknown": "Unknown"
|
||||
},
|
||||
"contentCalendar": {
|
||||
"title": "Content Calendar",
|
||||
"tabs": {
|
||||
"all": "All",
|
||||
"completed": "Completed",
|
||||
"scheduled": "Scheduled",
|
||||
"failed": "Failed"
|
||||
},
|
||||
"status": {
|
||||
"completed": "Completed",
|
||||
"scheduled": "Scheduled",
|
||||
"failed": "Failed"
|
||||
},
|
||||
"months": ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],
|
||||
"days": ["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],
|
||||
"yearMonth": "{{month}} {{year}}",
|
||||
"monthDay": "{{month}} {{day}}",
|
||||
"loading": "Loading...",
|
||||
"noResults": "No recent results",
|
||||
"noResultsDesc": "Upload your content to social channels",
|
||||
"ado2Contents": "ADO2 Contents",
|
||||
"cancel": "Cancel",
|
||||
"retry": "Retry",
|
||||
"cancelConfirm": "Are you sure you want to cancel this reservation?",
|
||||
"cancelFailed": "Failed to cancel.",
|
||||
"retryFailed": "Failed to retry.",
|
||||
"completedCount": "Done {{count}}",
|
||||
"scheduledCount": "Sched {{count}}",
|
||||
"failedCount": "Fail {{count}}"
|
||||
},
|
||||
"app": {
|
||||
"loginProcessing": "Processing login...",
|
||||
"loginFailed": "Login processing failed. Please try again.",
|
||||
|
||||
+167
-18
@@ -13,7 +13,83 @@
|
||||
"myInfo": "내 정보",
|
||||
"defaultUser": "사용자",
|
||||
"loggingOut": "로그아웃 중...",
|
||||
"logout": "로그아웃"
|
||||
"logout": "로그아웃",
|
||||
"tutorialRestart": "튜토리얼 다시 보기",
|
||||
"tutorial": "튜토리얼",
|
||||
"tutorialOn": "튜토리얼 켜기",
|
||||
"tutorialOff": "튜토리얼 끄기",
|
||||
"inquiry": "고객의견"
|
||||
},
|
||||
"tutorial": {
|
||||
"skip": "건너뛰기",
|
||||
"next": "다음",
|
||||
"prev": "이전",
|
||||
"finish": "완료",
|
||||
"landing": {
|
||||
"intro": { "title": "ADO2 튜토리얼 시작", "desc": "ADO2 사용 방법을 단계별로 안내해 드릴게요." },
|
||||
"dropdown": { "title": "검색 방식 선택", "desc": "드롭다운에서 URL 또는 업체명 중 원하는 방식을 선택하세요." },
|
||||
"field": { "title": "입력하기", "desc": "URL 방식이라면 네이버 지도 공유 URL,\n업체명 방식이라면 업체명을 입력하고 목록에서 선택하세요." },
|
||||
"button": { "title": "브랜드 분석 시작", "desc": "버튼을 누르면 AI가 브랜드를 분석하기 시작해요." }
|
||||
},
|
||||
"asset": {
|
||||
"image": { "title": "이미지 목록", "desc": "네이버 Place에서 가져 온 사진이에요. \n더보기를 누르면 나머지 사진도 볼 수 있고 X를 눌러 삭제 할 수 있어요." },
|
||||
"upload": { "title": "이미지 추가", "desc": "이미지를 자유롭게 추가 할 수 있어요." },
|
||||
"ratio": { "title": "영상 비율 선택", "desc": "생성 할 영상의 비율을 선택하세요." },
|
||||
"next": { "title": "다음 단계로", "desc": "설정이 완료되면 다음 단계로 진행하세요." }
|
||||
},
|
||||
"sound": {
|
||||
"genre": { "title": "장르 선택", "desc": "영상에 어울리는 음악 장르를 선택하세요.", "note": "배경음악은 이후 오픈 예정입니다." },
|
||||
"language": { "title": "언어 선택", "desc": "음악의 언어를 선택할 수 있어요. \n이미 선택된 한국어로 진행해볼까요?" },
|
||||
"generate": { "title": "사운드 생성", "desc": "버튼을 클릭하면 AI가 가사와 음악을 생성해요."},
|
||||
"lyrics": { "title": "가사 생성 완료", "desc": "AI가 선택한 언어로 가사를 만들었어요.\n생성된 가사를 확인하세요." },
|
||||
"lyricsWait": { "title": "음악 생성 중", "desc": "가사를 바탕으로 AI가 음악을 만들고 있어요.\n잠시만 기다려 주세요." },
|
||||
"audioPlayer": { "title": "음악 미리 듣기", "desc": "음악 생성이 완료되었어요.\n재생 버튼을 눌러 생성된 음악을 들어보세요." },
|
||||
"video": { "title": "영상 생성", "desc": "버튼을 클릭해서 영상 생성을 시작하세요." }
|
||||
},
|
||||
"completion": {
|
||||
"contentInfo": { "title": "콘텐츠 정보", "desc": "콘텐츠의 파일명, 장르, 규격, 가사를 확인하세요." },
|
||||
"generating": { "title": "영상 제작 중", "desc": "AI가 영상을 만들고 있어요. \n잠시만 기다려 주세요." },
|
||||
"completion": { "title": "영상 완성!", "desc": "영상 제작이 완료되었어요. \n영상을 확인해 볼까요?" },
|
||||
"myInfo": { "title": "소셜 계정 연동", "desc": "영상을 유튜브에 업로드하려면 내 정보에서 소셜 계정을 연동해야 해요. \n클릭해서 이동하세요." }
|
||||
},
|
||||
"myInfo": {
|
||||
"myInfo": { "title": "내 정보", "desc": "내 정보에서는 소셜 연결과 연결된 계정을 확인 할 수 있어요." },
|
||||
"connect": { "title": "연결하기", "desc": "YouTube 연결 버튼을 누르면 연결 페이지로 이동합니다.", "note": "Instargram 연결은 오픈 예정입니다." },
|
||||
"connected": { "title": "연결 계정", "desc": "연결된 소셜 계정 목록이에요. \n연결 후 여기서 확인할 수 있어요." },
|
||||
"ado2": { "title": "ADO2 콘텐츠", "desc": "이제 생성된 영상을 업로드할 수 있어요. \n클릭해서 이동하세요." }
|
||||
},
|
||||
"ado2": {
|
||||
"list": { "title": "생성된 영상 목록", "desc": "ADO2에서 만든 영상들을 확인할 수 있어요." },
|
||||
"download": { "title": "다운로드", "desc": "영상을 다운로드 할 수 있어요." },
|
||||
"delete": { "title": "삭제", "desc": "필요없는 영상을 삭제할 수 있어요." },
|
||||
"upload": { "title": "소셜 업로드", "desc": "선택해서 소셜미디어에 업로드하세요." }
|
||||
},
|
||||
"upload": {
|
||||
"seo": { "title": "제목 및 설명", "desc": "영상의 제목과 설명을 AI가 만들고 있어요. 잠시만 기다려 주세요." },
|
||||
"required": { "title": "필수 항목", "desc": "영상을 업로드 하기 전 *는 필수 항목으로 \n반드시 확인해 주세요." },
|
||||
"schedule": { "title": "업로드 예약", "desc": "지금 게시하거나 원하는 시간에 예약할 수 있어요." },
|
||||
"submit": { "title": "업로드 시작", "desc": "게시 버튼을 눌러 업로드를 시작하세요." }
|
||||
},
|
||||
"dashboard": {
|
||||
"metrics": { "title": "핵심 지표", "desc": "조회수, 구독자 등 ADO2로 업로드한 콘텐츠의 주요 통계를 확인하세요." },
|
||||
"chart": { "title": "성장 추이 차트", "desc": "기간별 성장 추이를 그래프로 확인할 수 있어요." },
|
||||
"more": { "title": "더 많은 통계", "desc": "그 외에도 다양한 통계를 대시보드에서 한눈에 확인할 수 있어요." }
|
||||
},
|
||||
"contentCalendar": {
|
||||
"grid": { "title": "콘텐츠 캘린더", "desc": "날짜별로 콘텐츠 스케줄을 확인할 수 있어요. \n오늘 날짜를 선택해 볼까요?" },
|
||||
"panel": { "title": "콘텐츠 목록", "desc": "자세한 콘텐츠 스케줄을 확인 할수 있어요." }
|
||||
},
|
||||
"feedback": {
|
||||
"complete": { "title": "튜토리얼 완료 🎉", "desc": "유튜브 업로드까지 모든 과정을 완료했어요. \n튜토리얼을 다시보고 싶다면 우측 상단의 버튼을 눌러주세요." },
|
||||
"title": "고객의견",
|
||||
"desc": "서비스 이용 중 불편한 점이나 개선 의견을 보내주세요."
|
||||
},
|
||||
"restart": {
|
||||
"title": "튜토리얼을 다시 시작할까요?",
|
||||
"desc": "현재 화면부터 튜토리얼이 다시 시작됩니다.",
|
||||
"confirm": "시작하기",
|
||||
"cancel": "취소"
|
||||
}
|
||||
},
|
||||
"footer": {
|
||||
"company":"㈜에이아이오투오",
|
||||
@@ -55,9 +131,9 @@
|
||||
"invalidVideoInfo": "영상 정보가 올바르지 않습니다. (video_id 누락)",
|
||||
"uploadStartFailed": "업로드 시작에 실패했습니다.",
|
||||
"uploadFailed": "업로드에 실패했습니다.",
|
||||
"autoSeoTitle": "자동으로 작성중입니다. 기다려주세요.",
|
||||
"autoSeoDescription": "자동으로 작성중입니다. 기다려주세요.",
|
||||
"autoSeoTags": "자동으로 작성중입니다. 기다려주세요."
|
||||
"autoSeoTitle": "자동으로 작성중입니다. (30~60초 소요)",
|
||||
"autoSeoDescription": "자동으로 작성중입니다. (30~60초 소요)",
|
||||
"autoSeoTags": "자동으로 작성중입니다. (30~60초 소요)"
|
||||
},
|
||||
"upload": {
|
||||
"title": "YouTube 업로드",
|
||||
@@ -78,8 +154,8 @@
|
||||
"landing": {
|
||||
"hero": {
|
||||
"searchTypeBusinessName": "업체명",
|
||||
"placeholderBusinessName": "업체명을 입력하세요",
|
||||
"guideUrl": "URL에서 가져온 정보로 영상이 자동 생성됩니다.",
|
||||
"placeholderBusinessName": "업체명을 입력하세요.",
|
||||
"guideUrl": "네이버지도에서 장소를 검색하고 공유 선택, \n나오는 URL을 붙여 넣어 주세요.",
|
||||
"guideBusinessName": "업체명으로 검색하여 정보를 가져옵니다.",
|
||||
"errorUrlRequired": "URL을 입력해주세요.",
|
||||
"errorNameRequired": "업체명을 입력해주세요.",
|
||||
@@ -95,9 +171,9 @@
|
||||
"title": "ADO2.AI에 오신 것을 환영합니다.",
|
||||
"subtitle": "분석, 제작, 배포까지 콘텐츠 마케팅의 전과정을 자동화",
|
||||
"feature1Title": "비즈니스 핵심 정보 분석",
|
||||
"feature1Desc": "홈페이지, 네이버 지도, 블로그 등의\nURL을 입력하세요",
|
||||
"feature1Desc": "홈페이지, 네이버 지도, 블로그 등의\nURL을 입력하세요.",
|
||||
"feature2Title": "홍보 콘텐츠 자동 제작",
|
||||
"feature2Desc": "분석된 정보를 바탕으로\n비즈니스에 맞는 음악, 자막, 노래, 영상을\n자동으로 제작해요",
|
||||
"feature2Desc": "분석된 정보를 바탕으로\n비즈니스에 맞는 음악, 자막, 영상을\n자동으로 제작해요",
|
||||
"feature3Title": "멀티채널 자동 배포",
|
||||
"feature3Desc": "완성된 영상은 다운로드하거나\n바로 SNS에 업로드 할 수 있어요"
|
||||
},
|
||||
@@ -114,8 +190,8 @@
|
||||
},
|
||||
"urlInput": {
|
||||
"searchTypeBusinessName": "업체명",
|
||||
"placeholderBusinessName": "업체명을 입력하세요",
|
||||
"guideUrl": "URL에서 가져온 정보로 영상이 자동 생성됩니다.",
|
||||
"placeholderBusinessName": "업체명을 입력하세요.",
|
||||
"guideUrl": "네이버지도에서 장소를 검색하고 공유 선택, \n나오는 URL을 붙여 넣어 주세요.",
|
||||
"guideBusinessName": "업체명으로 검색하여 정보를 가져옵니다.",
|
||||
"searchButton": "검색하기",
|
||||
"searching": "검색 중...",
|
||||
@@ -136,7 +212,7 @@
|
||||
"back": "뒤로가기",
|
||||
"loadMore": "더보기",
|
||||
"uploadFailed": "이미지 업로드에 실패했습니다.",
|
||||
"uploading": "업로드 중...",
|
||||
"uploading": "업로드 중 (30초~2분 소요)",
|
||||
"nextStep": "다음 단계"
|
||||
},
|
||||
"soundStudio": {
|
||||
@@ -149,20 +225,22 @@
|
||||
"genreLabel": "장르 선택",
|
||||
"genreAuto": "자동 선택",
|
||||
"genreBallad": "발라드",
|
||||
"languageLabel": "언어",
|
||||
"languageLabel": "언어 선택",
|
||||
"languageKorean": "한국어",
|
||||
"lyricsColumn": "가사",
|
||||
"lyricsHint": "가사 영역을 선택해서 수정 가능해요",
|
||||
"lyricsPlaceholder": "사운드 생성 시 가사 표시됩니다.",
|
||||
"generateButton": "사운드 생성",
|
||||
"regenerateButton": "재생성 하기",
|
||||
"regenerateHint": "재생성 버튼을 누르면 가사와 음악을 다시 만들 수 있어요.",
|
||||
"generating": "생성 중...",
|
||||
"generateVideo": "영상 생성하기",
|
||||
"videoGenerating": "영상 생성 중",
|
||||
"noBusinessInfo": "비즈니스 정보가 없습니다. 다시 시도해주세요.",
|
||||
"noImageUploadInfo": "이미지 업로드 정보가 없습니다. 이전 단계로 돌아가 다시 시도해주세요.",
|
||||
"generatingLyrics": "가사를 생성하고 있습니다...",
|
||||
"generatingSong": "노래를 생성하고 있습니다...",
|
||||
"songQueued": "노래 생성 대기 중...",
|
||||
"generatingLyrics": "가사를 생성하고 있습니다. (30~60초 소요)",
|
||||
"generatingSong": "음악을 생성하고 있습니다. (1~2분 소요)",
|
||||
"songQueued": "음악 생성 대기 중...",
|
||||
"retryMessage": "시간 초과로 재생성 중... ({{count}}/{{max}})",
|
||||
"lyricGenerationFailed": "가사 생성 요청에 실패했습니다.",
|
||||
"lyricNotReceived": "가사를 받지 못했습니다.",
|
||||
@@ -191,7 +269,7 @@
|
||||
"statusPlanned": "예약됨",
|
||||
"statusWaiting": "대기 중",
|
||||
"statusTranscribing": "트랜스크립션 중",
|
||||
"statusRendering": "렌더링 중",
|
||||
"statusRendering": "생성 중 (2~3분 소요)",
|
||||
"statusSucceeded": "완료",
|
||||
"statusDefault": "처리 중...",
|
||||
"aiOptimization": "AI 최적화",
|
||||
@@ -213,7 +291,17 @@
|
||||
"videoNotReady": "영상이 아직 준비되지 않았습니다.",
|
||||
"youtubeUploadMessage": "YouTube 채널 \"{{channelName}}\"에 영상을 업로드합니다.\n\n(업로드 기능 준비 중)",
|
||||
"deployComingSoon": "선택한 소셜 채널에 배포 기능이 준비 중입니다.",
|
||||
"youtubeExpiredAlert": "YouTube 인증이 만료되었습니다. 재연동 페이지로 이동합니다."
|
||||
"youtubeExpiredAlert": "YouTube 인증이 만료되었습니다. 재연동 페이지로 이동합니다.",
|
||||
"contentComplete": "콘텐츠 제작 완료",
|
||||
"contentCompleteDesc": "AI 분석 및 편집을 통해 최적화된 콘텐츠가 완성되었습니다",
|
||||
"contentInfo": "파일명",
|
||||
"genre": "장르",
|
||||
"resolution": "규격",
|
||||
"lyrics": "가사",
|
||||
"sampleLyrics": "가사를 불러오는 중...",
|
||||
"downloading": "다운로드 중...",
|
||||
"download": "다운로드",
|
||||
"uploadToSocial": "소셜 채널 업로드"
|
||||
},
|
||||
"dashboard": {
|
||||
"title": "대시보드",
|
||||
@@ -286,7 +374,38 @@
|
||||
"stayIntroReel": "스테이 머뭄 소개 릴스",
|
||||
"newYearEvent": "신년 특가 이벤트 안내",
|
||||
"nightTimelapse": "펜션 야경 타임랩스"
|
||||
}
|
||||
},
|
||||
"metricTotalViews": "조회수",
|
||||
"metricWatchTime": "시청시간",
|
||||
"metricAvgViewDuration": "평균 시청시간",
|
||||
"metricNewSubscribers": "신규 구독자",
|
||||
"metricUploadedVideos": "업로드 영상",
|
||||
"unitHours": "시간",
|
||||
"unitMinutes": "분",
|
||||
"noDataInPeriod": "이 기간에 데이터가 없습니다.",
|
||||
"dataLoading": "데이터 로딩 중...",
|
||||
"noUploadsTitle": "아직 업로드된 영상이 없습니다.",
|
||||
"noUploadsDesc": "ADO2에서 영상을 업로드하면 실제 통계가 표시됩니다.",
|
||||
"reconnectButton": "재연동하러 가기 →",
|
||||
"connectButton": "연동하러 가기 →",
|
||||
"retryButton": "재시도 →",
|
||||
"selectAccount": "계정을 선택하세요",
|
||||
"modeAnnual": "연간",
|
||||
"modeMonthly": "월간",
|
||||
"chartThisYear": "올해",
|
||||
"chartLastYear": "작년",
|
||||
"chartThisMonth": "이번달",
|
||||
"chartLastMonth": "지난달",
|
||||
"monthOverMonth": "전월 대비 성장",
|
||||
"noAudienceData": "누적 데이터가 부족하여 실제 시청자 정보가 없습니다.",
|
||||
"mockContentNotice": "현재 표시된 콘텐츠는 실제 데이터가 아닌 샘플 데이터입니다.",
|
||||
"dataDelayTitle": "데이터 준비 중",
|
||||
"dataDelayDesc": "유튜브 정책에 따라 분석 데이터는 영상 업로드 후 최대 48시간이 지나야 반영됩니다. 나중에 다시 확인해 주세요.",
|
||||
"sampleHide": "Sample 숨기기",
|
||||
"sampleShow": "Sample 보기",
|
||||
"recentVideosDesc": "ADO2에서 업로드한 최근 30개의 영상 통계가 표시됩니다.",
|
||||
"channelStatsDesc": "선택한 채널의 통계가 표시됩니다.",
|
||||
"youtubeApiFailed": "YouTube Analytics API 호출에 실패했습니다."
|
||||
},
|
||||
"myInfo": {
|
||||
"title": "내 정보",
|
||||
@@ -367,6 +486,36 @@
|
||||
"required": "*",
|
||||
"unknown": "알 수 없음"
|
||||
},
|
||||
"contentCalendar": {
|
||||
"title": "콘텐츠 캘린더",
|
||||
"tabs": {
|
||||
"all": "전체",
|
||||
"completed": "완료",
|
||||
"scheduled": "예약",
|
||||
"failed": "실패"
|
||||
},
|
||||
"status": {
|
||||
"completed": "완료",
|
||||
"scheduled": "예약",
|
||||
"failed": "실패"
|
||||
},
|
||||
"months": ["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"],
|
||||
"days": ["일","월","화","수","목","금","토"],
|
||||
"yearMonth": "{{year}}년 {{month}}",
|
||||
"monthDay": "{{month}}월 {{day}}",
|
||||
"loading": "불러오는 중...",
|
||||
"noResults": "최근 결과 없음",
|
||||
"noResultsDesc": "제작한 콘텐츠를 소셜 채널에 업로드해 보세요",
|
||||
"ado2Contents": "ADO2 콘텐츠",
|
||||
"cancel": "취소",
|
||||
"retry": "재시도",
|
||||
"cancelConfirm": "예약을 취소하시겠습니까?",
|
||||
"cancelFailed": "취소에 실패했습니다.",
|
||||
"retryFailed": "재시도에 실패했습니다.",
|
||||
"completedCount": "완료 {{count}}",
|
||||
"scheduledCount": "예약 {{count}}",
|
||||
"failedCount": "실패 {{count}}"
|
||||
},
|
||||
"app": {
|
||||
"loginProcessing": "로그인 처리 중...",
|
||||
"loginFailed": "로그인 처리에 실패했습니다. 다시 시도해주세요.",
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
|
||||
import React from 'react';
|
||||
import React, { useEffect } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { CrawlingResponse, TargetPersona } from '../../types/api';
|
||||
import { GeometricChart } from './GeometricChart';
|
||||
import { useTutorial } from '../../components/Tutorial/useTutorial';
|
||||
import { TUTORIAL_KEYS } from '../../components/Tutorial/tutorialSteps';
|
||||
import TutorialOverlay from '../../components/Tutorial/TutorialOverlay';
|
||||
|
||||
interface AnalysisResultSectionProps {
|
||||
onBack: () => void;
|
||||
@@ -12,8 +14,19 @@ interface AnalysisResultSectionProps {
|
||||
|
||||
const AnalysisResultSection: React.FC<AnalysisResultSectionProps> = ({ onBack, onGenerate, data }) => {
|
||||
const { t } = useTranslation();
|
||||
const tutorial = useTutorial();
|
||||
const { processed_info, marketing_analysis } = data;
|
||||
|
||||
useEffect(() => {
|
||||
const timer = setTimeout(() => {
|
||||
if (!tutorial.hasSeen(TUTORIAL_KEYS.ANALYSIS)) {
|
||||
tutorial.startTutorial(TUTORIAL_KEYS.ANALYSIS);
|
||||
}
|
||||
}, 600);
|
||||
return () => clearTimeout(timer);
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, []);
|
||||
|
||||
const brandIdentity = marketing_analysis?.brand_identity;
|
||||
const marketPositioning = marketing_analysis?.market_positioning;
|
||||
const targetPersonas = marketing_analysis?.target_persona || [];
|
||||
@@ -24,6 +37,7 @@ const AnalysisResultSection: React.FC<AnalysisResultSectionProps> = ({ onBack, o
|
||||
const sortedSellingPoints = [...sellingPoints].sort((a, b) => b.score - a.score);
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="bi2-page">
|
||||
{/* Header */}
|
||||
<div className="bi2-header">
|
||||
@@ -175,6 +189,18 @@ const AnalysisResultSection: React.FC<AnalysisResultSectionProps> = ({ onBack, o
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{tutorial.isActive && (
|
||||
<TutorialOverlay
|
||||
hints={tutorial.hints}
|
||||
currentIndex={tutorial.currentHintIndex}
|
||||
onNext={tutorial.nextHint}
|
||||
onPrev={tutorial.prevHint}
|
||||
onSkip={tutorial.skipTutorial}
|
||||
groupProgress={tutorial.groupProgress}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -1,9 +1,43 @@
|
||||
|
||||
import React from 'react';
|
||||
import React, { useEffect, useRef, useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
const LoadingSection: React.FC = () => {
|
||||
interface LoadingSectionProps {
|
||||
onComplete?: () => void;
|
||||
isComplete?: boolean;
|
||||
}
|
||||
|
||||
const LoadingSection: React.FC<LoadingSectionProps> = ({ onComplete, isComplete }) => {
|
||||
const { t } = useTranslation();
|
||||
const [progress, setProgress] = useState(0);
|
||||
const intervalRef = useRef<ReturnType<typeof setInterval> | null>(null);
|
||||
|
||||
useEffect(() => {
|
||||
intervalRef.current = setInterval(() => {
|
||||
setProgress(prev => {
|
||||
if (prev >= 100) {
|
||||
if (intervalRef.current) clearInterval(intervalRef.current);
|
||||
return 100;
|
||||
}
|
||||
const increment = prev < 70 ? 0.5 : prev < 90 ? 0.2 : 0.1;
|
||||
return Math.min(prev + increment, 100);
|
||||
});
|
||||
}, 100);
|
||||
return () => {
|
||||
if (intervalRef.current) clearInterval(intervalRef.current);
|
||||
};
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
if (!isComplete) return;
|
||||
if (intervalRef.current) clearInterval(intervalRef.current);
|
||||
setProgress(100);
|
||||
const timer = setTimeout(() => {
|
||||
onComplete?.();
|
||||
}, 400);
|
||||
return () => clearTimeout(timer);
|
||||
}, [isComplete]);
|
||||
|
||||
return (
|
||||
<div className="loading-container">
|
||||
<div className="loading-content">
|
||||
@@ -23,6 +57,16 @@ const LoadingSection: React.FC = () => {
|
||||
className="loading-spinner-icon"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="loading-progress-wrapper">
|
||||
<div className="loading-progress-bar">
|
||||
<div
|
||||
className="loading-progress-fill"
|
||||
style={{ width: `${progress}%` }}
|
||||
/>
|
||||
</div>
|
||||
<span className="loading-progress-text">{Math.floor(progress)}%</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -3,6 +3,9 @@ import React, { useState, useEffect, useRef } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { generateVideo, waitForVideoComplete } from '../../utils/api';
|
||||
import SocialPostingModal from '../../components/SocialPostingModal';
|
||||
import { useTutorial } from '../../components/Tutorial/useTutorial';
|
||||
import { TUTORIAL_KEYS } from '../../components/Tutorial/tutorialSteps';
|
||||
import TutorialOverlay from '../../components/Tutorial/TutorialOverlay';
|
||||
|
||||
interface CompletionContentProps {
|
||||
onBack: () => void;
|
||||
@@ -37,7 +40,23 @@ const CompletionContent: React.FC<CompletionContentProps> = ({
|
||||
const [errorMessage, setErrorMessage] = useState<string | null>(null);
|
||||
const [statusMessage, setStatusMessage] = useState('');
|
||||
const [renderProgress, setRenderProgress] = useState(0);
|
||||
const [displayProgress, setDisplayProgress] = useState(0);
|
||||
const hasStartedGeneration = useRef(false);
|
||||
const displayIntervalRef = useRef<ReturnType<typeof setInterval> | null>(null);
|
||||
|
||||
const tutorial = useTutorial();
|
||||
|
||||
// 영상 생성 중 튜토리얼 트리거 (생성 상태 안내 -> 콘텐츠 정보 -> 내 정보 이동)
|
||||
useEffect(() => {
|
||||
const isComplete = videoStatus === 'complete';
|
||||
const isProcessing = videoStatus === 'generating' || videoStatus === 'polling';
|
||||
|
||||
if (isProcessing && !tutorial.isActive && !tutorial.hasSeen(TUTORIAL_KEYS.GENERATING)) {
|
||||
tutorial.startTutorial(TUTORIAL_KEYS.GENERATING);
|
||||
} else if (isComplete && !tutorial.isActive && !tutorial.hasSeen(TUTORIAL_KEYS.COMPLETION)) {
|
||||
tutorial.startTutorial(TUTORIAL_KEYS.COMPLETION);
|
||||
}
|
||||
}, [videoStatus, tutorial, tutorial.isActive]);
|
||||
|
||||
// 소셜 미디어 포스팅 모달
|
||||
const [showSocialModal, setShowSocialModal] = useState(false);
|
||||
@@ -66,6 +85,31 @@ const CompletionContent: React.FC<CompletionContentProps> = ({
|
||||
}
|
||||
}, [renderProgress, onVideoProgressChange]);
|
||||
|
||||
useEffect(() => {
|
||||
if (displayIntervalRef.current) clearInterval(displayIntervalRef.current);
|
||||
|
||||
if (renderProgress === 100) {
|
||||
setDisplayProgress(100);
|
||||
return;
|
||||
}
|
||||
|
||||
// renderProgress에 도달한 후에도 99%까지 서서히 크리핑
|
||||
const CREEP_MAX = 99;
|
||||
|
||||
displayIntervalRef.current = setInterval(() => {
|
||||
setDisplayProgress(prev => {
|
||||
const target = Math.max(prev, renderProgress);
|
||||
if (prev >= CREEP_MAX) return prev;
|
||||
const increment = prev < 70 ? 0.2 : prev < 90 ? 0.04 : 0.01;
|
||||
return Math.min(prev + increment, Math.max(target, Math.min(prev + increment, CREEP_MAX)));
|
||||
});
|
||||
}, 100);
|
||||
|
||||
return () => {
|
||||
if (displayIntervalRef.current) clearInterval(displayIntervalRef.current);
|
||||
};
|
||||
}, [renderProgress]);
|
||||
|
||||
const saveToStorage = (videoTaskId: string, currentSongTaskId: string, status: VideoStatus, url: string | null, dbId?: number) => {
|
||||
const data: SavedVideoState = {
|
||||
videoTaskId,
|
||||
@@ -237,6 +281,7 @@ const CompletionContent: React.FC<CompletionContentProps> = ({
|
||||
setVideoUrl(completeVideo.videoUrl);
|
||||
if (completeVideo.videoDbId) setVideoDbId(completeVideo.videoDbId);
|
||||
setVideoStatus('complete');
|
||||
setShowComplete(true);
|
||||
hasStartedGeneration.current = true;
|
||||
return;
|
||||
}
|
||||
@@ -248,6 +293,7 @@ const CompletionContent: React.FC<CompletionContentProps> = ({
|
||||
setVideoUrl(savedState.videoUrl);
|
||||
if (savedState.videoDbId) setVideoDbId(savedState.videoDbId);
|
||||
setVideoStatus('complete');
|
||||
setShowComplete(true);
|
||||
hasStartedGeneration.current = true;
|
||||
} else if (savedState.status === 'polling') {
|
||||
setVideoStatus('polling');
|
||||
@@ -279,15 +325,32 @@ const CompletionContent: React.FC<CompletionContentProps> = ({
|
||||
}
|
||||
}, []);
|
||||
|
||||
const handleDownload = () => {
|
||||
if (videoUrl) {
|
||||
const [isDownloading, setIsDownloading] = useState(false);
|
||||
|
||||
const handleDownload = async () => {
|
||||
if (!videoUrl || isDownloading) return;
|
||||
setIsDownloading(true);
|
||||
try {
|
||||
const response = await fetch(videoUrl);
|
||||
const blob = await response.blob();
|
||||
const blobUrl = URL.createObjectURL(blob);
|
||||
const link = document.createElement('a');
|
||||
link.href = blobUrl;
|
||||
link.download = getFileName();
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
document.body.removeChild(link);
|
||||
URL.revokeObjectURL(blobUrl);
|
||||
} catch {
|
||||
const link = document.createElement('a');
|
||||
link.href = videoUrl;
|
||||
link.download = 'castad_video.mp4';
|
||||
link.download = getFileName();
|
||||
link.target = '_blank';
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
document.body.removeChild(link);
|
||||
} finally {
|
||||
setIsDownloading(false);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -304,11 +367,20 @@ const CompletionContent: React.FC<CompletionContentProps> = ({
|
||||
setVideoStatus('idle');
|
||||
setVideoUrl(null);
|
||||
setErrorMessage(null);
|
||||
setShowComplete(false);
|
||||
clearStorage();
|
||||
startVideoGeneration();
|
||||
};
|
||||
|
||||
const isLoading = videoStatus === 'generating' || videoStatus === 'polling';
|
||||
const [showComplete, setShowComplete] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
if (displayProgress < 100) return;
|
||||
const timer = setTimeout(() => setShowComplete(true), 500);
|
||||
return () => clearTimeout(timer);
|
||||
}, [displayProgress]);
|
||||
|
||||
const isLoading = videoStatus === 'generating' || videoStatus === 'polling' || (videoStatus === 'complete' && !showComplete);
|
||||
|
||||
// 비디오 해상도 계산
|
||||
const getVideoResolution = () => {
|
||||
@@ -331,22 +403,11 @@ const CompletionContent: React.FC<CompletionContentProps> = ({
|
||||
</svg>
|
||||
<span>{t('completion.back')}</span>
|
||||
</button>
|
||||
<a
|
||||
href="https://forms.gle/4a8mGebBYtdesvby9"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="comp2-inquiry-btn"
|
||||
>
|
||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
|
||||
<path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" />
|
||||
</svg>
|
||||
<span>문의하기</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div className="comp2-title-row">
|
||||
<h1 className="comp2-page-title">{t('completion.contentComplete', { defaultValue: '콘텐츠 제작 완료' })}</h1>
|
||||
<p className="comp2-page-subtitle">{t('completion.contentCompleteDesc', { defaultValue: 'AI 분석 및 편집을 통해 최적화된 콘텐츠가 완성되었습니다' })}</p>
|
||||
<h1 className="comp2-page-title">{t('completion.contentComplete')}</h1>
|
||||
<p className="comp2-page-subtitle">{t('completion.contentCompleteDesc')}</p>
|
||||
</div>
|
||||
|
||||
<div className="comp2-container">
|
||||
@@ -363,6 +424,15 @@ const CompletionContent: React.FC<CompletionContentProps> = ({
|
||||
</div>
|
||||
</div>
|
||||
<p className="comp2-loading-text">{statusMessage}</p>
|
||||
<div className="loading-progress-wrapper">
|
||||
<div className="loading-progress-bar">
|
||||
<div
|
||||
className="loading-progress-fill"
|
||||
style={{ width: `${displayProgress}%` }}
|
||||
/>
|
||||
</div>
|
||||
<span className="loading-progress-text">{Math.floor(displayProgress)}%</span>
|
||||
</div>
|
||||
</div>
|
||||
) : videoStatus === 'error' ? (
|
||||
<div className="comp2-video-error">
|
||||
@@ -391,7 +461,7 @@ const CompletionContent: React.FC<CompletionContentProps> = ({
|
||||
{/* 오른쪽: 콘텐츠 정보 */}
|
||||
<div className="comp2-info-section">
|
||||
<div className="comp2-info-header">
|
||||
<span className="comp2-info-label">{t('completion.contentInfo', { defaultValue: '콘텐츠 정보' })}</span>
|
||||
<span className="comp2-info-label">{t('completion.contentInfo')}</span>
|
||||
</div>
|
||||
<div className="comp2-info-content">
|
||||
<div className="comp2-file-info">
|
||||
@@ -400,17 +470,17 @@ const CompletionContent: React.FC<CompletionContentProps> = ({
|
||||
</div>
|
||||
<div className="comp2-meta-grid">
|
||||
<div className="comp2-meta-item">
|
||||
<span className="comp2-meta-label">{t('completion.genre', { defaultValue: '장르' })} : {songCompletionData?.genre || 'K-POP'}</span>
|
||||
<span className="comp2-meta-label">{t('completion.genre')} : {songCompletionData?.genre || 'K-POP'}</span>
|
||||
</div>
|
||||
<div className="comp2-meta-divider"></div>
|
||||
<div className="comp2-meta-item">
|
||||
<span className="comp2-meta-label">{t('completion.resolution', { defaultValue: '규격' })} : {getVideoResolution()}</span>
|
||||
<span className="comp2-meta-label">{t('completion.resolution')} : {getVideoResolution()}</span>
|
||||
</div>
|
||||
<div className="comp2-meta-divider"></div>
|
||||
<div className="comp2-lyrics-section">
|
||||
<span className="comp2-meta-label">{t('completion.lyrics', { defaultValue: '가사' })}</span>
|
||||
<span className="comp2-meta-label">{t('completion.lyrics')}</span>
|
||||
<p className="comp2-lyrics-text">
|
||||
{songCompletionData?.lyrics || t('completion.sampleLyrics', { defaultValue: '가사를 불러오는 중...' })}
|
||||
{songCompletionData?.lyrics || t('completion.sampleLyrics')}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -419,17 +489,17 @@ const CompletionContent: React.FC<CompletionContentProps> = ({
|
||||
<div className="comp2-buttons">
|
||||
<button
|
||||
onClick={handleDownload}
|
||||
disabled={videoStatus !== 'complete' || !videoUrl}
|
||||
disabled={videoStatus !== 'complete' || !videoUrl || isDownloading}
|
||||
className="comp2-btn comp2-btn-secondary"
|
||||
>
|
||||
{t('completion.download', { defaultValue: '다운로드' })}
|
||||
{isDownloading ? t('completion.downloading') : t('completion.download')}
|
||||
</button>
|
||||
<button
|
||||
onClick={handleOpenSocialConnect}
|
||||
disabled={videoStatus !== 'complete' || !videoDbId}
|
||||
className="comp2-btn comp2-btn-primary"
|
||||
>
|
||||
{t('completion.uploadToSocial', { defaultValue: '소셜 채널 업로드' })}
|
||||
{t('completion.uploadToSocial')}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -449,6 +519,17 @@ const CompletionContent: React.FC<CompletionContentProps> = ({
|
||||
created_at: new Date().toISOString(),
|
||||
} : null}
|
||||
/>
|
||||
|
||||
{tutorial.isActive && (
|
||||
<TutorialOverlay
|
||||
hints={tutorial.hints}
|
||||
currentIndex={tutorial.currentHintIndex}
|
||||
onNext={tutorial.nextHint}
|
||||
onPrev={tutorial.prevHint}
|
||||
onSkip={tutorial.skipTutorial}
|
||||
groupProgress={tutorial.groupProgress}
|
||||
/>
|
||||
)}
|
||||
</main>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
|
||||
import React, { useState, useEffect, useCallback, useRef } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { UploadHistoryItem } from '../../types/api';
|
||||
import { getUploadHistory, cancelUpload, retryUpload } from '../../utils/api';
|
||||
|
||||
@@ -53,13 +54,13 @@ const statusColor = (status: UploadStatus) => {
|
||||
}
|
||||
};
|
||||
|
||||
// 상태 라벨
|
||||
const statusLabel = (status: UploadStatus) => {
|
||||
// 상태 라벨 (컴포넌트 내부에서 t()로 처리)
|
||||
const statusLabelKey = (status: UploadStatus) => {
|
||||
switch (status) {
|
||||
case 'completed': return '완료';
|
||||
case 'completed': return 'contentCalendar.status.completed';
|
||||
case 'scheduled':
|
||||
case 'pending': return '예약';
|
||||
case 'failed': return '실패';
|
||||
case 'pending': return 'contentCalendar.status.scheduled';
|
||||
case 'failed': return 'contentCalendar.status.failed';
|
||||
default: return status;
|
||||
}
|
||||
};
|
||||
@@ -69,6 +70,7 @@ interface ContentCalendarContentProps {
|
||||
}
|
||||
|
||||
const ContentCalendarContent: React.FC<ContentCalendarContentProps> = ({ onNavigate }) => {
|
||||
const { t } = useTranslation();
|
||||
const today = new Date();
|
||||
const [year, setYear] = useState(today.getFullYear());
|
||||
const [month, setMonth] = useState(today.getMonth());
|
||||
@@ -203,7 +205,7 @@ const ContentCalendarContent: React.FC<ContentCalendarContentProps> = ({ onNavig
|
||||
|
||||
// 취소
|
||||
const handleCancel = async (uploadId: number) => {
|
||||
if (!window.confirm('예약을 취소하시겠습니까?')) return;
|
||||
if (!window.confirm(t('contentCalendar.cancelConfirm'))) return;
|
||||
// 낙관적 업데이트: 먼저 UI에서 제거
|
||||
setAllItems(prev => prev.filter(i => i.upload_id !== uploadId));
|
||||
setPanelItems(prev => prev.filter(i => i.upload_id !== uploadId));
|
||||
@@ -212,7 +214,7 @@ const ContentCalendarContent: React.FC<ContentCalendarContentProps> = ({ onNavig
|
||||
} catch {
|
||||
// 실패 시 다시 불러오기
|
||||
refreshAll();
|
||||
alert('취소에 실패했습니다.');
|
||||
alert(t('contentCalendar.cancelFailed'));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -222,7 +224,7 @@ const ContentCalendarContent: React.FC<ContentCalendarContentProps> = ({ onNavig
|
||||
await retryUpload(uploadId);
|
||||
refreshAll();
|
||||
} catch {
|
||||
alert('재시도에 실패했습니다.');
|
||||
alert(t('contentCalendar.retryFailed'));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -234,10 +236,11 @@ const ContentCalendarContent: React.FC<ContentCalendarContentProps> = ({ onNavig
|
||||
return `${String(d.getHours()).padStart(2, '0')}:${String(d.getMinutes()).padStart(2, '0')}`;
|
||||
};
|
||||
|
||||
// 날짜 표시 (M월 D)
|
||||
// 날짜 표시
|
||||
const formatDateLabel = (key: string) => {
|
||||
const [, m, d] = key.split('-');
|
||||
return `${parseInt(m)}월 ${parseInt(d)}`;
|
||||
const months = t('contentCalendar.months', { returnObjects: true }) as string[];
|
||||
return t('contentCalendar.monthDay', { month: months[parseInt(m) - 1], day: parseInt(d) });
|
||||
};
|
||||
|
||||
const buildCalendarDays = (): CalendarDay[] => {
|
||||
@@ -266,9 +269,15 @@ const ContentCalendarContent: React.FC<ContentCalendarContentProps> = ({ onNavig
|
||||
};
|
||||
|
||||
const calendarDays = buildCalendarDays();
|
||||
const monthNames = ['1월','2월','3월','4월','5월','6월','7월','8월','9월','10월','11월','12월'];
|
||||
const dayLabels = ['일','월','화','수','목','금','토'];
|
||||
const monthNames = t('contentCalendar.months', { returnObjects: true }) as string[];
|
||||
const dayLabels = t('contentCalendar.days', { returnObjects: true }) as string[];
|
||||
const tabs: TabType[] = ['전체','완료','예약','실패'];
|
||||
const tabLabels: Record<TabType, string> = {
|
||||
'전체': t('contentCalendar.tabs.all'),
|
||||
'완료': t('contentCalendar.tabs.completed'),
|
||||
'예약': t('contentCalendar.tabs.scheduled'),
|
||||
'실패': t('contentCalendar.tabs.failed'),
|
||||
};
|
||||
|
||||
// ── 캘린더 그리드 ──────────────────────────────────────────────
|
||||
const renderCalendarGrid = () => {
|
||||
@@ -388,7 +397,7 @@ const ContentCalendarContent: React.FC<ContentCalendarContentProps> = ({ onNavig
|
||||
<div style={{ display: 'flex', alignItems: 'center', gap: 4 }}>
|
||||
<div style={{ width: 8, height: 8, borderRadius: '50%', backgroundColor: '#1ba64f', flexShrink: 0 }} />
|
||||
<span style={{ fontFamily: 'Pretendard, sans-serif', fontWeight: 500, fontSize: 11, color: '#01191a', lineHeight: 1, whiteSpace: 'nowrap' }}>
|
||||
완료 {summary.completed}
|
||||
{t('contentCalendar.completedCount', { count: summary.completed })}
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
@@ -396,7 +405,7 @@ const ContentCalendarContent: React.FC<ContentCalendarContentProps> = ({ onNavig
|
||||
<div style={{ display: 'flex', alignItems: 'center', gap: 4 }}>
|
||||
<div style={{ width: 8, height: 8, borderRadius: '50%', backgroundColor: '#2563eb', flexShrink: 0 }} />
|
||||
<span style={{ fontFamily: 'Pretendard, sans-serif', fontWeight: 500, fontSize: 11, color: '#01191a', lineHeight: 1, whiteSpace: 'nowrap' }}>
|
||||
예약 {summary.scheduled}
|
||||
{t('contentCalendar.scheduledCount', { count: summary.scheduled })}
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
@@ -404,7 +413,7 @@ const ContentCalendarContent: React.FC<ContentCalendarContentProps> = ({ onNavig
|
||||
<div style={{ display: 'flex', alignItems: 'center', gap: 4 }}>
|
||||
<div style={{ width: 8, height: 8, borderRadius: '50%', backgroundColor: '#e15252', flexShrink: 0 }} />
|
||||
<span style={{ fontFamily: 'Pretendard, sans-serif', fontWeight: 500, fontSize: 11, color: '#01191a', lineHeight: 1, whiteSpace: 'nowrap' }}>
|
||||
실패 {summary.failed}
|
||||
{t('contentCalendar.failedCount', { count: summary.failed })}
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
@@ -432,7 +441,7 @@ const ContentCalendarContent: React.FC<ContentCalendarContentProps> = ({ onNavig
|
||||
letterSpacing: '-0.096px', lineHeight: '22px', whiteSpace: 'nowrap',
|
||||
}}
|
||||
>
|
||||
{tab}
|
||||
{tabLabels[tab]}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
@@ -442,9 +451,9 @@ const ContentCalendarContent: React.FC<ContentCalendarContentProps> = ({ onNavig
|
||||
const renderStats = () => (
|
||||
<div style={{ display: 'flex', gap: 16, alignItems: 'center' }}>
|
||||
{[
|
||||
{ label: '예약', value: totalStats.scheduled },
|
||||
{ label: '완료', value: totalStats.completed },
|
||||
{ label: '실패', value: totalStats.failed },
|
||||
{ label: t('contentCalendar.tabs.scheduled'), value: totalStats.scheduled },
|
||||
{ label: t('contentCalendar.tabs.completed'), value: totalStats.completed },
|
||||
{ label: t('contentCalendar.tabs.failed'), value: totalStats.failed },
|
||||
].map((item, idx) => (
|
||||
<React.Fragment key={item.label}>
|
||||
{idx > 0 && <div style={{ width: 0, height: 14, borderLeft: '1px solid #379599' }} />}
|
||||
@@ -483,7 +492,7 @@ const ContentCalendarContent: React.FC<ContentCalendarContentProps> = ({ onNavig
|
||||
color: '#e5f1f2', letterSpacing: '-0.096px', lineHeight: '22px',
|
||||
margin: 0, whiteSpace: 'nowrap',
|
||||
}}>
|
||||
{year}년 {monthNames[month]}
|
||||
{t('contentCalendar.yearMonth', { year, month: monthNames[month] })}
|
||||
</p>
|
||||
<button
|
||||
onClick={handleNextMonth}
|
||||
@@ -529,7 +538,7 @@ const ContentCalendarContent: React.FC<ContentCalendarContentProps> = ({ onNavig
|
||||
fontFamily: 'Pretendard, sans-serif', fontWeight: 500, fontSize: 13,
|
||||
color: statusColor(item.status as UploadStatus), lineHeight: 1,
|
||||
}}>
|
||||
{statusLabel(item.status as UploadStatus)}
|
||||
{t(statusLabelKey(item.status as UploadStatus))}
|
||||
</span>
|
||||
<span style={{
|
||||
fontFamily: 'Pretendard, sans-serif', fontWeight: 400, fontSize: 13,
|
||||
@@ -575,7 +584,7 @@ const ContentCalendarContent: React.FC<ContentCalendarContentProps> = ({ onNavig
|
||||
color: '#9bcacc', cursor: 'pointer',
|
||||
}}
|
||||
>
|
||||
취소
|
||||
{t('contentCalendar.cancel')}
|
||||
</button>
|
||||
)}
|
||||
{isFailed && (
|
||||
@@ -588,7 +597,7 @@ const ContentCalendarContent: React.FC<ContentCalendarContentProps> = ({ onNavig
|
||||
color: '#ffffff', cursor: 'pointer',
|
||||
}}
|
||||
>
|
||||
재시도
|
||||
{t('contentCalendar.retry')}
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
@@ -602,7 +611,7 @@ const ContentCalendarContent: React.FC<ContentCalendarContentProps> = ({ onNavig
|
||||
if (panelLoading) {
|
||||
return (
|
||||
<div style={{ flex: 1, display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
|
||||
<span style={{ color: '#9bcacc', fontFamily: 'Pretendard, sans-serif', fontSize: 14 }}>불러오는 중...</span>
|
||||
<span style={{ color: '#9bcacc', fontFamily: 'Pretendard, sans-serif', fontSize: 14 }}>{t('contentCalendar.loading')}</span>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -617,13 +626,13 @@ const ContentCalendarContent: React.FC<ContentCalendarContentProps> = ({ onNavig
|
||||
fontFamily: 'Pretendard, sans-serif', fontWeight: 700, fontSize: 16,
|
||||
color: '#e5f1f2', letterSpacing: '-0.096px', lineHeight: '22px', margin: 0,
|
||||
}}>
|
||||
최근 결과 없음
|
||||
{t('contentCalendar.noResults')}
|
||||
</p>
|
||||
<p style={{
|
||||
fontFamily: 'Pretendard, sans-serif', fontWeight: 500, fontSize: 12,
|
||||
color: '#9bcacc', letterSpacing: '-0.072px', lineHeight: 1, margin: 0,
|
||||
}}>
|
||||
제작한 콘텐츠를 소셜 채널에 업로드해 보세요
|
||||
{t('contentCalendar.noResultsDesc')}
|
||||
</p>
|
||||
</div>
|
||||
<button
|
||||
@@ -635,7 +644,7 @@ const ContentCalendarContent: React.FC<ContentCalendarContentProps> = ({ onNavig
|
||||
color: '#ffffff',
|
||||
}}
|
||||
>
|
||||
ADO2 콘텐츠
|
||||
{t('contentCalendar.ado2Contents')}
|
||||
</button>
|
||||
</div>
|
||||
);
|
||||
@@ -643,7 +652,8 @@ const ContentCalendarContent: React.FC<ContentCalendarContentProps> = ({ onNavig
|
||||
return (
|
||||
<div
|
||||
ref={panelRef}
|
||||
style={{ flex: 1, overflowY: 'auto', padding: '12px 16px', display: 'flex', flexDirection: 'column', gap: 20 }}
|
||||
className="calendar-panel-scroll"
|
||||
style={{ flex: 1, overflowY: 'auto', padding: '12px 16px', display: 'flex', flexDirection: 'column', gap: 20, maxHeight: 700 }}
|
||||
>
|
||||
{sortedDateKeys.map(dateKey => (
|
||||
<div
|
||||
@@ -680,7 +690,7 @@ const ContentCalendarContent: React.FC<ContentCalendarContentProps> = ({ onNavig
|
||||
fontFamily: 'Pretendard, sans-serif', fontWeight: 700, fontSize: 30,
|
||||
color: '#ffffff', letterSpacing: '-0.18px', lineHeight: 1.3, margin: 0,
|
||||
}}>
|
||||
콘텐츠 캘린더
|
||||
{t('contentCalendar.title')}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -735,7 +745,7 @@ const ContentCalendarContent: React.FC<ContentCalendarContentProps> = ({ onNavig
|
||||
return (
|
||||
<div style={{
|
||||
display: 'flex', flexDirection: 'column', alignItems: 'center',
|
||||
padding: '80px 32px',
|
||||
padding: '32px',
|
||||
width: '100%',
|
||||
minWidth: 1400,
|
||||
height: '100%', boxSizing: 'border-box',
|
||||
@@ -745,7 +755,7 @@ const ContentCalendarContent: React.FC<ContentCalendarContentProps> = ({ onNavig
|
||||
fontFamily: 'Pretendard, sans-serif', fontWeight: 700, fontSize: 30,
|
||||
color: '#ffffff', letterSpacing: '-0.18px', lineHeight: 1.3, margin: 0,
|
||||
}}>
|
||||
콘텐츠 캘린더
|
||||
{t('contentCalendar.title')}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -757,7 +767,7 @@ const ContentCalendarContent: React.FC<ContentCalendarContentProps> = ({ onNavig
|
||||
flex: 1, minHeight: 0,
|
||||
}}>
|
||||
{/* 캘린더 영역 */}
|
||||
<div style={{
|
||||
<div className="calendar-grid-area" style={{
|
||||
gridColumn: '1 / span 8',
|
||||
backgroundColor: '#01393b',
|
||||
borderRadius: 20, padding: 16,
|
||||
@@ -773,13 +783,13 @@ const ContentCalendarContent: React.FC<ContentCalendarContentProps> = ({ onNavig
|
||||
</div>
|
||||
{loading ? (
|
||||
<div style={{ flex: 1, display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
|
||||
<span style={{ color: '#9bcacc', fontFamily: 'Pretendard, sans-serif', fontSize: 14 }}>불러오는 중...</span>
|
||||
<span style={{ color: '#9bcacc', fontFamily: 'Pretendard, sans-serif', fontSize: 14 }}>{t('contentCalendar.loading')}</span>
|
||||
</div>
|
||||
) : renderCalendarGrid()}
|
||||
</div>
|
||||
|
||||
{/* 오른쪽 패널 */}
|
||||
<div style={{
|
||||
<div className="calendar-side-panel" style={{
|
||||
gridColumn: '9 / span 1',
|
||||
backgroundColor: '#01393b', borderRadius: 20,
|
||||
display: 'flex', flexDirection: 'column', overflow: 'hidden',
|
||||
|
||||
@@ -34,21 +34,6 @@ interface DailyData {
|
||||
lastPeriod: number;
|
||||
}
|
||||
|
||||
// interface PlatformMetric { // 미사용 — platform_data 기능 예정
|
||||
// id: string;
|
||||
// label: string;
|
||||
// value: string;
|
||||
// unit?: string;
|
||||
// trend: number;
|
||||
// trendDirection: 'up' | 'down';
|
||||
// }
|
||||
|
||||
// interface PlatformData { // 미사용 — platform_data 기능 예정
|
||||
// platform: 'youtube' | 'instagram';
|
||||
// displayName: string;
|
||||
// metrics: PlatformMetric[];
|
||||
// }
|
||||
|
||||
interface TopContent {
|
||||
id: string;
|
||||
title: string;
|
||||
@@ -65,6 +50,12 @@ interface AudienceData {
|
||||
topRegions: { region: string; percentage: number }[];
|
||||
}
|
||||
|
||||
interface DashboardError {
|
||||
code: string;
|
||||
message: string;
|
||||
reconnect_url?: string;
|
||||
}
|
||||
|
||||
interface DashboardResponse {
|
||||
contentMetrics: ContentMetric[];
|
||||
monthlyData: MonthlyData[];
|
||||
@@ -72,7 +63,7 @@ interface DashboardResponse {
|
||||
topContent: TopContent[];
|
||||
audienceData: AudienceData;
|
||||
hasUploads: boolean; // 업로드 영상 존재 여부 (false 시 mock 데이터 + 안내 메시지 표시)
|
||||
// platformData: PlatformData[]; // 미사용
|
||||
error: DashboardError | null;
|
||||
}
|
||||
|
||||
interface ConnectedAccount {
|
||||
@@ -90,29 +81,29 @@ interface ConnectedAccount {
|
||||
// =====================================================
|
||||
|
||||
const MOCK_CONTENT_METRICS: ContentMetric[] = [
|
||||
{ id: 'total-views', label: '조회수', value: 240000, unit: 'count', trend: 3800, trendDirection: 'up' },
|
||||
{ id: 'total-watch-time', label: '시청시간', value: 85.3, unit: 'hours', trend: 21.5, trendDirection: 'up' },
|
||||
{ id: 'avg-view-duration',label: '평균 시청시간', value: 41, unit: 'minutes', trend: 2.4, trendDirection: 'up' },
|
||||
{ id: 'new-subscribers', label: '신규 구독자', value: 483, unit: 'count', trend: 50, trendDirection: 'up' },
|
||||
{ id: 'likes', label: '좋아요', value: 15800, unit: 'count', trend: 180, trendDirection: 'up' },
|
||||
{ id: 'comments', label: '댓글', value: 2500, unit: 'count', trend: 50, trendDirection: 'down' },
|
||||
{ id: 'shares', label: '공유', value: 840, unit: 'count', trend: 15, trendDirection: 'up' },
|
||||
{ id: 'uploaded-videos', label: '업로드 영상', value: 17, unit: 'count', trend: 4, trendDirection: 'up' },
|
||||
{ id: 'total-views', label: 'dashboard.metricTotalViews', value: 240000, unit: 'count', trend: 3800, trendDirection: 'up' },
|
||||
{ id: 'total-watch-time', label: 'dashboard.metricWatchTime', value: 85.3, unit: 'hours', trend: 21.5, trendDirection: 'up' },
|
||||
{ id: 'avg-view-duration',label: 'dashboard.metricAvgViewDuration', value: 41, unit: 'minutes', trend: 2.4, trendDirection: 'up' },
|
||||
{ id: 'new-subscribers', label: 'dashboard.metricNewSubscribers', value: 483, unit: 'count', trend: 50, trendDirection: 'up' },
|
||||
{ id: 'likes', label: 'dashboard.metricLikes', value: 15800, unit: 'count', trend: 180, trendDirection: 'up' },
|
||||
{ id: 'comments', label: 'dashboard.metricComments', value: 2500, unit: 'count', trend: 50, trendDirection: 'down' },
|
||||
{ id: 'shares', label: 'dashboard.metricShares', value: 840, unit: 'count', trend: 15, trendDirection: 'up' },
|
||||
{ id: 'uploaded-videos', label: 'dashboard.metricUploadedVideos', value: 17, unit: 'count', trend: 4, trendDirection: 'up' },
|
||||
];
|
||||
|
||||
const MOCK_MONTHLY_DATA: MonthlyData[] = [
|
||||
{ month: '1월', thisYear: 18000, lastYear: 14500 },
|
||||
{ month: '2월', thisYear: 19500, lastYear: 15800 },
|
||||
{ month: '3월', thisYear: 21000, lastYear: 17200 },
|
||||
{ month: '4월', thisYear: 18500, lastYear: 16800 },
|
||||
{ month: '5월', thisYear: 24000, lastYear: 19500 },
|
||||
{ month: '6월', thisYear: 27500, lastYear: 21000 },
|
||||
{ month: '7월', thisYear: 32000, lastYear: 23500 },
|
||||
{ month: '8월', thisYear: 29500, lastYear: 24800 },
|
||||
{ month: '9월', thisYear: 31000, lastYear: 26200 },
|
||||
{ month: '10월', thisYear: 28500, lastYear: 25500 },
|
||||
{ month: '11월', thisYear: 34000, lastYear: 27800 },
|
||||
{ month: '12월', thisYear: 38000, lastYear: 29500 },
|
||||
{ month: 'dashboard.months.jan', thisYear: 18000, lastYear: 14500 },
|
||||
{ month: 'dashboard.months.feb', thisYear: 19500, lastYear: 15800 },
|
||||
{ month: 'dashboard.months.mar', thisYear: 21000, lastYear: 17200 },
|
||||
{ month: 'dashboard.months.apr', thisYear: 18500, lastYear: 16800 },
|
||||
{ month: 'dashboard.months.may', thisYear: 24000, lastYear: 19500 },
|
||||
{ month: 'dashboard.months.jun', thisYear: 27500, lastYear: 21000 },
|
||||
{ month: 'dashboard.months.jul', thisYear: 32000, lastYear: 23500 },
|
||||
{ month: 'dashboard.months.aug', thisYear: 29500, lastYear: 24800 },
|
||||
{ month: 'dashboard.months.sep', thisYear: 31000, lastYear: 26200 },
|
||||
{ month: 'dashboard.months.oct', thisYear: 28500, lastYear: 25500 },
|
||||
{ month: 'dashboard.months.nov', thisYear: 34000, lastYear: 27800 },
|
||||
{ month: 'dashboard.months.dec', thisYear: 38000, lastYear: 29500 },
|
||||
];
|
||||
|
||||
const MOCK_DAILY_DATA: DailyData[] = Array.from({ length: 30 }, (_, i) => {
|
||||
@@ -210,18 +201,16 @@ const formatNumber = (num: number): string => {
|
||||
return num.toString();
|
||||
};
|
||||
|
||||
// unit에 따라 value를 표시용 문자열로 변환 (언어별 suffix는 호출부에서 처리)
|
||||
const formatValue = (value: number, unit: string): string => {
|
||||
if (unit === 'hours') return value.toFixed(1) + '시간';
|
||||
if (unit === 'minutes') return Math.round(value) + '분';
|
||||
const formatValue = (value: number, unit: string, unitHours: string, unitMinutes: string): string => {
|
||||
if (unit === 'hours') return value.toFixed(1) + unitHours;
|
||||
if (unit === 'minutes') return Math.round(value) + unitMinutes;
|
||||
return formatNumber(Math.round(value));
|
||||
};
|
||||
|
||||
// unit에 따라 trend 절댓값을 표시용 문자열로 변환
|
||||
const formatTrend = (trend: number, unit: string): string => {
|
||||
const formatTrend = (trend: number, unit: string, unitHours: string, unitMinutes: string): string => {
|
||||
const abs = Math.abs(trend);
|
||||
if (unit === 'hours') return abs.toFixed(1) + '시간';
|
||||
if (unit === 'minutes') return Math.round(abs) + '분';
|
||||
if (unit === 'hours') return abs.toFixed(1) + unitHours;
|
||||
if (unit === 'minutes') return Math.round(abs) + unitMinutes;
|
||||
return formatNumber(Math.round(abs));
|
||||
};
|
||||
|
||||
@@ -248,19 +237,22 @@ const TrendIcon: React.FC<{ direction: 'up' | 'down' }> = ({ direction }) => (
|
||||
);
|
||||
|
||||
const StatCard: React.FC<ContentMetric> = ({ label, value, unit, trend, trendDirection }) => {
|
||||
const { t } = useTranslation();
|
||||
const unitHours = t('dashboard.unitHours');
|
||||
const unitMinutes = t('dashboard.unitMinutes');
|
||||
const isNeutral = trend === 0 || trendDirection === '-';
|
||||
const isUp = trendDirection === 'up';
|
||||
return (
|
||||
<div className="stat-card">
|
||||
<span className="stat-label">{label}</span>
|
||||
<h3 className="stat-value">{formatValue(value, unit)}</h3>
|
||||
<span className="stat-label">{t(label)}</span>
|
||||
<h3 className="stat-value">{formatValue(value, unit, unitHours, unitMinutes)}</h3>
|
||||
<div className="stat-trend-wrapper">
|
||||
{isNeutral ? (
|
||||
<span className="stat-trend neutral">─</span>
|
||||
) : (
|
||||
<span className={`stat-trend ${isUp ? 'up' : 'down'}`}>
|
||||
<TrendIcon direction={isUp ? 'up' : 'down'} />
|
||||
{isUp ? '+' : '-'}{formatTrend(trend, unit)}
|
||||
{isUp ? '+' : '-'}{formatTrend(trend, unit, unitHours, unitMinutes)}
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
@@ -285,11 +277,12 @@ const YearOverYearChart: React.FC<{
|
||||
currentLabel: string;
|
||||
previousLabel: string;
|
||||
mode: 'day' | 'month';
|
||||
}> = ({ data, currentLabel, previousLabel, mode }) => {
|
||||
noDataLabel: string;
|
||||
}> = ({ data, currentLabel, previousLabel, mode, noDataLabel }) => {
|
||||
if (data.length === 0) {
|
||||
return (
|
||||
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', height: '200px', opacity: 0.4 }}>
|
||||
<span>이 기간에 데이터가 없습니다.</span>
|
||||
<span>{noDataLabel}</span>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -371,14 +364,14 @@ const YearOverYearChart: React.FC<{
|
||||
// Icon Components
|
||||
// =====================================================
|
||||
|
||||
const YouTubeIcon: React.FC<{ className?: string }> = ({ className }) => (
|
||||
<svg className={className || "platform-tab-icon"} viewBox="0 0 24 24" fill="currentColor">
|
||||
const YouTubeIcon: React.FC<{ className?: string; style?: React.CSSProperties }> = ({ className, style }) => (
|
||||
<svg className={className || "platform-tab-icon"} style={style} viewBox="0 0 24 24" fill="currentColor">
|
||||
<path d="M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z" />
|
||||
</svg>
|
||||
);
|
||||
|
||||
const InstagramIcon: React.FC<{ className?: string }> = ({ className }) => (
|
||||
<svg className={className || "platform-tab-icon"} viewBox="0 0 24 24" fill="currentColor">
|
||||
const InstagramIcon: React.FC<{ className?: string; style?: React.CSSProperties }> = ({ className, style }) => (
|
||||
<svg className={className || "platform-tab-icon"} style={style} viewBox="0 0 24 24" fill="currentColor">
|
||||
<path d="M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zM12 0C8.741 0 8.333.014 7.053.072 2.695.272.273 2.69.073 7.052.014 8.333 0 8.741 0 12c0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98C8.333 23.986 8.741 24 12 24c3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98C15.668.014 15.259 0 12 0zm0 5.838a6.162 6.162 0 1 0 0 12.324 6.162 6.162 0 0 0 0-12.324zM12 16a4 4 0 1 1 0-8 4 4 0 0 1 0 8zm6.406-11.845a1.44 1.44 0 1 0 0 2.881 1.44 1.44 0 0 0 0-2.881z" />
|
||||
</svg>
|
||||
);
|
||||
@@ -487,8 +480,9 @@ const DashboardContent: React.FC<DashboardContentProps> = ({ onNavigate }) => {
|
||||
|
||||
const [dashboardData, setDashboardData] = useState<DashboardResponse | null>(null);
|
||||
const [isLoading, setIsLoading] = useState(true);
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
const [error, setError] = useState<DashboardError | null>(null);
|
||||
const [showMockData, setShowMockData] = useState(false);
|
||||
const [retryTrigger, setRetryTrigger] = useState(0);
|
||||
|
||||
// 계정 관련 state
|
||||
const [accounts, setAccounts] = useState<ConnectedAccount[]>([]);
|
||||
@@ -576,25 +570,32 @@ const DashboardContent: React.FC<DashboardContentProps> = ({ onNavigate }) => {
|
||||
|
||||
if (!response.ok) {
|
||||
const errorData = await response.json();
|
||||
|
||||
if (errorData.code === 'YOUTUBE_NOT_CONNECTED') {
|
||||
setError('YouTube 계정을 연동하여 데이터를 확인하세요.');
|
||||
setDashboardData(null);
|
||||
return;
|
||||
}
|
||||
if (errorData.code === 'YOUTUBE_ACCOUNT_SELECTION_REQUIRED') {
|
||||
setDashboardData(null);
|
||||
return;
|
||||
}
|
||||
throw new Error(errorData.detail || `API Error: ${response.status}`);
|
||||
if (errorData.code === 'YOUTUBE_API_FAILED') {
|
||||
setError({ code: 'YOUTUBE_API_FAILED', message: t('dashboard.youtubeApiFailed') });
|
||||
setDashboardData(null);
|
||||
return;
|
||||
}
|
||||
setError({ code: errorData.code || 'API_ERROR', message: errorData.detail || `API Error: ${response.status}`, reconnect_url: errorData.reconnect_url });
|
||||
return;
|
||||
}
|
||||
|
||||
const data: DashboardResponse = await response.json();
|
||||
|
||||
if (data.error) {
|
||||
setError(data.error);
|
||||
setDashboardData(data);
|
||||
return;
|
||||
}
|
||||
|
||||
setDashboardData(data);
|
||||
setError(null);
|
||||
} catch (err) {
|
||||
console.error('Dashboard API Error:', err);
|
||||
setError(err instanceof Error ? err.message : 'Unknown error');
|
||||
setError({ code: 'UNKNOWN', message: err instanceof Error ? err.message : 'Unknown error' });
|
||||
setDashboardData(null);
|
||||
} finally {
|
||||
setIsLoading(false);
|
||||
@@ -602,25 +603,26 @@ const DashboardContent: React.FC<DashboardContentProps> = ({ onNavigate }) => {
|
||||
};
|
||||
|
||||
fetchDashboardData();
|
||||
}, [mode, selectedAccountId, accountsLoaded]);
|
||||
}, [mode, selectedAccountId, accountsLoaded, retryTrigger]);
|
||||
|
||||
if (isLoading) {
|
||||
return (
|
||||
<div className="flex justify-center items-center h-screen">
|
||||
<div className="text-lg">{t('데이터 로딩 중...')}</div>
|
||||
<div className="text-lg">{t('dashboard.dataLoading')}</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
// hasUploads === false: 업로드 영상 없음 → 전체 mock 데이터 표시 + 안내 배너
|
||||
const isEmptyState = dashboardData?.hasUploads === false;
|
||||
|
||||
// 블러 조건: 1)계정 미연결 2)업로드 영상 없음 3)데이터 없음
|
||||
const isBlurred = accounts.length === 0 || isEmptyState || !dashboardData;
|
||||
// hasUploads === false이고 error 없음: 업로드 영상 없음 → 전체 mock 데이터 표시 + 안내 배너
|
||||
const isEmptyState = dashboardData?.hasUploads === false && !dashboardData?.error;
|
||||
|
||||
// showMockData=true면 전체 mock 강제, 아니면 API 우선 / isEmptyState 시 mock 폴백
|
||||
const useReal = !showMockData && !isEmptyState;
|
||||
const contentMetrics = (useReal && dashboardData?.contentMetrics?.length) ? dashboardData.contentMetrics : MOCK_CONTENT_METRICS;
|
||||
const hasRealContentMetrics = useReal && !!dashboardData?.contentMetrics?.slice(0, -1).some((m: ContentMetric) => m.value > 0);
|
||||
const contentMetrics = hasRealContentMetrics ? dashboardData!.contentMetrics : MOCK_CONTENT_METRICS;
|
||||
|
||||
// 블러 조건: 1)계정 미연결 2)업로드 영상 없음 3)데이터 없음 4)에러 있음 5)실제 지표 없음
|
||||
const isBlurred = accounts.length === 0 || isEmptyState || !dashboardData || !!error || !hasRealContentMetrics;
|
||||
const topContent = (useReal && dashboardData?.topContent?.length) ? dashboardData.topContent : MOCK_TOP_CONTENT;
|
||||
const hasRealAgeGroups = useReal && !!dashboardData?.audienceData?.ageGroups?.some(g => g.percentage > 0);
|
||||
const hasRealGender = useReal && ((dashboardData?.audienceData?.gender?.male ?? 0) + (dashboardData?.audienceData?.gender?.female ?? 0)) > 0;
|
||||
@@ -632,15 +634,15 @@ const DashboardContent: React.FC<DashboardContentProps> = ({ onNavigate }) => {
|
||||
const chartData: ChartDataPoint[] = mode === 'month'
|
||||
? ((useReal && dashboardData?.monthlyData?.length)
|
||||
? dashboardData.monthlyData.map((d: MonthlyData) => ({ label: d.month, current: d.thisYear, previous: d.lastYear }))
|
||||
: MOCK_MONTHLY_DATA.map((d: MonthlyData) => ({ label: d.month, current: d.thisYear, previous: d.lastYear })))
|
||||
: MOCK_MONTHLY_DATA.map((d: MonthlyData) => ({ label: t(d.month), current: d.thisYear, previous: d.lastYear })))
|
||||
: ((useReal && dashboardData?.dailyData?.length)
|
||||
? dashboardData.dailyData.map((d: DailyData) => ({ label: d.date, current: d.thisPeriod, previous: d.lastPeriod }))
|
||||
: MOCK_DAILY_DATA.map((d: DailyData) => ({ label: d.date, current: d.thisPeriod, previous: d.lastPeriod })));
|
||||
|
||||
// mode별 차트 레이블
|
||||
const chartCurrentLabel = mode === 'month' ? '올해' : '이번달';
|
||||
const chartPreviousLabel = mode === 'month' ? '작년' : '지난달';
|
||||
const chartSectionTitle = mode === 'month' ? t('dashboard.yearOverYear') : '전월 대비 성장';
|
||||
const chartCurrentLabel = mode === 'month' ? t('dashboard.chartThisYear') : t('dashboard.chartThisMonth');
|
||||
const chartPreviousLabel = mode === 'month' ? t('dashboard.chartLastYear') : t('dashboard.chartLastMonth');
|
||||
const chartSectionTitle = mode === 'month' ? t('dashboard.yearOverYear') : t('dashboard.monthOverMonth');
|
||||
|
||||
const lastUpdated = new Date().toLocaleDateString('ko-KR', {
|
||||
year: 'numeric',
|
||||
@@ -658,8 +660,24 @@ const DashboardContent: React.FC<DashboardContentProps> = ({ onNavigate }) => {
|
||||
<path d="M15 10l4.553-2.069A1 1 0 0121 8.87v6.26a1 1 0 01-1.447.899L15 14M3 8a2 2 0 012-2h10a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2V8z" strokeLinecap="round" strokeLinejoin="round" />
|
||||
</svg>
|
||||
<div>
|
||||
<p style={{ color: '#a6ffea', fontSize: '20px', fontWeight: 600, marginBottom: '2px' }}>아직 업로드된 영상이 없습니다.</p>
|
||||
<p style={{ color: 'rgba(255,255,255,0.5)', fontSize: '16px' }}>ADO2에서 영상을 업로드하면 실제 통계가 표시됩니다.</p>
|
||||
<p style={{ color: '#a6ffea', fontSize: '20px', fontWeight: 600, marginBottom: '2px' }}>{t('dashboard.noUploadsTitle')}</p>
|
||||
<p style={{ color: 'rgba(255,255,255,0.5)', fontSize: '16px' }}>{t('dashboard.noUploadsDesc')}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* 48시간 지연 안내 배너 */}
|
||||
{dashboardData && !isEmptyState && !hasRealContentMetrics && !showMockData && (
|
||||
<div className="mb-4 p-4 border-l-4 rounded" style={{ background: 'rgba(255,210,100,0.06)', borderColor: '#ffd264' }}>
|
||||
<div className="flex items-center gap-3">
|
||||
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="#ffd264" strokeWidth="2" style={{ flexShrink: 0 }}>
|
||||
<circle cx="12" cy="12" r="10" />
|
||||
<path d="M12 6v6l4 2" strokeLinecap="round" strokeLinejoin="round" />
|
||||
</svg>
|
||||
<div>
|
||||
<p style={{ color: '#ffd264', fontSize: '16px', fontWeight: 600, marginBottom: '2px' }}>{t('dashboard.dataDelayTitle')}</p>
|
||||
<p style={{ color: 'rgba(255,255,255,0.5)', fontSize: '14px' }}>{t('dashboard.dataDelayDesc')}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -673,16 +691,30 @@ const DashboardContent: React.FC<DashboardContentProps> = ({ onNavigate }) => {
|
||||
<svg className="w-5 h-5 mr-2 flex-shrink-0" fill="currentColor" viewBox="0 0 20 20">
|
||||
<path fillRule="evenodd" d="M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z" clipRule="evenodd" />
|
||||
</svg>
|
||||
<div>
|
||||
<p className="font-semibold">실제 데이터를 보려면 계정을 연동하세요.</p>
|
||||
</div>
|
||||
<p className="font-semibold">{error.message}</p>
|
||||
</div>
|
||||
{error.includes('YouTube') && (
|
||||
{error.code === 'YOUTUBE_TOKEN_EXPIRED' && (
|
||||
<button
|
||||
onClick={() => onNavigate?.('내 정보')}
|
||||
className="ml-4 px-4 py-2 bg-yellow-600 text-white rounded hover:bg-yellow-700 whitespace-nowrap"
|
||||
>
|
||||
연동하러 가기 →
|
||||
{t('dashboard.reconnectButton')}
|
||||
</button>
|
||||
)}
|
||||
{error.code === 'YOUTUBE_NOT_CONNECTED' && (
|
||||
<button
|
||||
onClick={() => onNavigate?.('내 정보')}
|
||||
className="ml-4 px-4 py-2 bg-yellow-600 text-white rounded hover:bg-yellow-700 whitespace-nowrap"
|
||||
>
|
||||
{t('dashboard.connectButton')}
|
||||
</button>
|
||||
)}
|
||||
{(error.code === 'YOUTUBE_API_FAILED' || error.code === 'DASHBOARD_DATA_ERROR') && (
|
||||
<button
|
||||
onClick={() => { setError(null); setRetryTrigger((n: number) => n + 1); }}
|
||||
className="ml-4 px-4 py-2 bg-yellow-600 text-white rounded hover:bg-yellow-700 whitespace-nowrap"
|
||||
>
|
||||
{t('dashboard.retryButton')}
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
@@ -725,7 +757,7 @@ const DashboardContent: React.FC<DashboardContentProps> = ({ onNavigate }) => {
|
||||
</span>
|
||||
</>
|
||||
) : (
|
||||
<span style={{ flex: 1, color: 'rgba(255,255,255,0.4)' }}>계정을 선택하세요</span>
|
||||
<span style={{ flex: 1, color: 'rgba(255,255,255,0.4)' }}>{t('dashboard.selectAccount')}</span>
|
||||
);
|
||||
})()}
|
||||
<svg width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="rgba(255,255,255,0.5)" strokeWidth="2" style={{ flexShrink: 0, marginLeft: 'auto' }}>
|
||||
@@ -787,20 +819,20 @@ const DashboardContent: React.FC<DashboardContentProps> = ({ onNavigate }) => {
|
||||
<div className="flex items-center justify-between mb-4">
|
||||
<div>
|
||||
<h2 className="dashboard-section-title" style={{ marginBottom: '2px' }}>{t('dashboard.contentPerformance')}</h2>
|
||||
<p style={{ fontSize: '14px', color: 'rgba(255,255,255,0.4)', margin: 0 }}>ADO2에서 업로드한 최근 30개의 영상 통계가 표시됩니다.</p>
|
||||
<p style={{ fontSize: '14px', color: 'rgba(255,255,255,0.4)', margin: 0 }}>{t('dashboard.recentVideosDesc')}</p>
|
||||
</div>
|
||||
<div className="mode-toggle">
|
||||
<button
|
||||
className={`mode-btn ${mode === 'month' ? 'active' : ''}`}
|
||||
onClick={() => setMode('month')}
|
||||
>
|
||||
연간
|
||||
{t('dashboard.modeAnnual')}
|
||||
</button>
|
||||
<button
|
||||
className={`mode-btn ${mode === 'day' ? 'active' : ''}`}
|
||||
onClick={() => setMode('day')}
|
||||
>
|
||||
월간
|
||||
{t('dashboard.modeMonthly')}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -837,6 +869,7 @@ const DashboardContent: React.FC<DashboardContentProps> = ({ onNavigate }) => {
|
||||
currentLabel={chartCurrentLabel}
|
||||
previousLabel={chartPreviousLabel}
|
||||
mode={mode}
|
||||
noDataLabel={t('dashboard.noDataInPeriod')}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -861,7 +894,7 @@ const DashboardContent: React.FC<DashboardContentProps> = ({ onNavigate }) => {
|
||||
<AnimatedSection delay={1000} className="audience-section">
|
||||
<div style={{ marginBottom: '16px' }}>
|
||||
<h2 className="dashboard-section-title" style={{ marginBottom: '2px' }}>{t('dashboard.audienceInsights')}</h2>
|
||||
<p style={{ fontSize: '14px', color: 'rgba(255,255,255,0.4)', margin: 0 }}>선택한 채널의 통계가 표시됩니다.</p>
|
||||
<p style={{ fontSize: '14px', color: 'rgba(255,255,255,0.4)', margin: 0 }}>{t('dashboard.channelStatsDesc')}</p>
|
||||
</div>
|
||||
<div style={{ position: 'relative' }}>
|
||||
<div className="audience-cards" style={!hasRealAudienceData && !showMockData ? { filter: 'blur(4px)', pointerEvents: 'none', userSelect: 'none' } : {}}>
|
||||
@@ -894,7 +927,7 @@ const DashboardContent: React.FC<DashboardContentProps> = ({ onNavigate }) => {
|
||||
padding: '20px 28px',
|
||||
}}>
|
||||
<p style={{ color: 'rgba(255,255,255,0.85)', fontSize: '16px', fontWeight: 500, margin: 0, textAlign: 'center' }}>
|
||||
누적 데이터가 부족하여 실제 시청자 정보가 없습니다.
|
||||
{t('dashboard.noAudienceData')}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -930,7 +963,7 @@ const DashboardContent: React.FC<DashboardContentProps> = ({ onNavigate }) => {
|
||||
: <><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/><circle cx="12" cy="12" r="3"/></>
|
||||
}
|
||||
</svg>
|
||||
{showMockData ? 'Sample 숨기기' : 'Sample 보기'}
|
||||
{showMockData ? t('dashboard.sampleHide') : t('dashboard.sampleShow')}
|
||||
</button>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -15,12 +15,16 @@ import LoadingSection from '../Analysis/LoadingSection';
|
||||
import AnalysisResultSection from '../Analysis/AnalysisResultSection';
|
||||
import { ImageItem, CrawlingResponse, UserMeResponse } from '../../types/api';
|
||||
import { crawlUrl, autocomplete, AutocompleteRequest, getUserMe, clearTokens } from '../../utils/api';
|
||||
import { useTutorial } from '../../components/Tutorial/useTutorial';
|
||||
import { TUTORIAL_KEYS } from '../../components/Tutorial/tutorialSteps';
|
||||
import TutorialOverlay, { TutorialRestartPopup } from '../../components/Tutorial/TutorialOverlay';
|
||||
|
||||
const WIZARD_STEP_KEY = 'castad_wizard_step';
|
||||
const ACTIVE_ITEM_KEY = 'castad_active_item';
|
||||
const SONG_TASK_ID_KEY = 'castad_song_task_id';
|
||||
const IMAGE_TASK_ID_KEY = 'castad_image_task_id';
|
||||
const ANALYSIS_DATA_KEY = 'castad_analysis_data';
|
||||
import { saveSearchHistory } from '../../components/SearchHistory/useSearchHistory';
|
||||
|
||||
// 다른 컴포넌트에서 사용하는 storage key들 (초기화용)
|
||||
const SONG_GENERATION_KEY = 'castad_song_generation';
|
||||
@@ -111,7 +115,9 @@ const GenerationFlow: React.FC<GenerationFlowProps> = ({
|
||||
const [videoGenerationProgress, setVideoGenerationProgress] = useState(0);
|
||||
const [analysisData, setAnalysisData] = useState<CrawlingResponse | null>(parseAnalysisData());
|
||||
const [analysisError, setAnalysisError] = useState<string | null>(null);
|
||||
const [isAnalysisComplete, setIsAnalysisComplete] = useState(false);
|
||||
const [userInfo, setUserInfo] = useState<UserMeResponse | null>(null);
|
||||
const tutorial = useTutorial();
|
||||
|
||||
// 로그인 직후 사용자 정보 조회
|
||||
useEffect(() => {
|
||||
@@ -204,6 +210,7 @@ const GenerationFlow: React.FC<GenerationFlowProps> = ({
|
||||
// 업체명 자동완성으로 분석 시작
|
||||
const handleAutocomplete = async (request: AutocompleteRequest) => {
|
||||
goToWizardStep(-1); // 로딩 상태로
|
||||
setIsAnalysisComplete(false);
|
||||
setAnalysisError(null);
|
||||
|
||||
try {
|
||||
@@ -211,11 +218,11 @@ const GenerationFlow: React.FC<GenerationFlowProps> = ({
|
||||
console.log('[Autocomplete] Response m_id:', data.m_id);
|
||||
|
||||
// 기본값 보장
|
||||
if (data.marketing_analysis) {
|
||||
data.marketing_analysis.tags = data.marketing_analysis.tags || [];
|
||||
data.marketing_analysis.facilities = data.marketing_analysis.facilities || [];
|
||||
data.marketing_analysis.report = data.marketing_analysis.report || '';
|
||||
}
|
||||
// if (data.marketing_analysis) {
|
||||
// data.marketing_analysis.tags = data.marketing_analysis.tags || [];
|
||||
// data.marketing_analysis.facilities = data.marketing_analysis.facilities || [];
|
||||
// data.marketing_analysis.report = data.marketing_analysis.report || '';
|
||||
// }
|
||||
if (data.processed_info) {
|
||||
data.processed_info.customer_name = data.processed_info.customer_name || '알 수 없음';
|
||||
data.processed_info.region = data.processed_info.region || '';
|
||||
@@ -225,7 +232,8 @@ const GenerationFlow: React.FC<GenerationFlowProps> = ({
|
||||
|
||||
setAnalysisData(data);
|
||||
localStorage.setItem(ANALYSIS_DATA_KEY, JSON.stringify(data));
|
||||
goToWizardStep(0); // 브랜드 분석 결과로
|
||||
saveSearchHistory({ type: 'name', value: request.title.replace(/<[^>]*>/g, ''), address: request.address, roadAddress: request.roadAddress });
|
||||
setIsAnalysisComplete(true);
|
||||
} catch (err) {
|
||||
console.error('Autocomplete error:', err);
|
||||
setAnalysisError(err instanceof Error ? err.message : t('app.autocompleteError'));
|
||||
@@ -271,6 +279,7 @@ const GenerationFlow: React.FC<GenerationFlowProps> = ({
|
||||
if (!url.trim()) return;
|
||||
|
||||
goToWizardStep(-1); // 로딩 상태로
|
||||
setIsAnalysisComplete(false);
|
||||
setAnalysisError(null);
|
||||
|
||||
try {
|
||||
@@ -278,11 +287,11 @@ const GenerationFlow: React.FC<GenerationFlowProps> = ({
|
||||
console.log('[Crawl] Response m_id:', data.m_id);
|
||||
|
||||
// 기본값 보장
|
||||
if (data.marketing_analysis) {
|
||||
data.marketing_analysis.tags = data.marketing_analysis.tags || [];
|
||||
data.marketing_analysis.facilities = data.marketing_analysis.facilities || [];
|
||||
data.marketing_analysis.report = data.marketing_analysis.report || '';
|
||||
}
|
||||
// if (data.marketing_analysis) {
|
||||
// data.marketing_analysis.tags = data.marketing_analysis.tags || [];
|
||||
// data.marketing_analysis.facilities = data.marketing_analysis.facilities || [];
|
||||
// data.marketing_analysis.report = data.marketing_analysis.report || '';
|
||||
// }
|
||||
if (data.processed_info) {
|
||||
data.processed_info.customer_name = data.processed_info.customer_name || '알 수 없음';
|
||||
data.processed_info.region = data.processed_info.region || '';
|
||||
@@ -292,7 +301,8 @@ const GenerationFlow: React.FC<GenerationFlowProps> = ({
|
||||
|
||||
setAnalysisData(data);
|
||||
localStorage.setItem(ANALYSIS_DATA_KEY, JSON.stringify(data));
|
||||
goToWizardStep(0); // 브랜드 분석 결과로
|
||||
saveSearchHistory({ type: 'url', value: url });
|
||||
setIsAnalysisComplete(true);
|
||||
} catch (err) {
|
||||
console.error('Crawling failed:', err);
|
||||
const errorMessage = err instanceof Error ? err.message : t('app.analysisError');
|
||||
@@ -316,6 +326,35 @@ const GenerationFlow: React.FC<GenerationFlowProps> = ({
|
||||
localStorage.setItem(ACTIVE_ITEM_KEY, activeItem);
|
||||
}, [activeItem]);
|
||||
|
||||
// wizardStep 변경 시 튜토리얼 트리거 (사이드바 메뉴 화면에서는 제외)
|
||||
const SIDEBAR_ITEMS = ['대시보드', 'ADO2 콘텐츠', '내 정보', '콘텐츠 캘린더'];
|
||||
useEffect(() => {
|
||||
if (tutorial.isActive) tutorial.skipTutorial();
|
||||
if (SIDEBAR_ITEMS.includes(activeItem)) return;
|
||||
const timer = setTimeout(() => {
|
||||
if (wizardStep === 1 && !tutorial.hasSeen(TUTORIAL_KEYS.ASSET)) {
|
||||
tutorial.startTutorial(TUTORIAL_KEYS.ASSET);
|
||||
} else if (wizardStep === 2 && !tutorial.hasSeen(TUTORIAL_KEYS.SOUND)) {
|
||||
tutorial.startTutorial(TUTORIAL_KEYS.SOUND);
|
||||
}
|
||||
}, 600);
|
||||
return () => clearTimeout(timer);
|
||||
}, [wizardStep, activeItem]);
|
||||
|
||||
// activeItem 변경 시 튜토리얼 트리거
|
||||
useEffect(() => {
|
||||
if (tutorial.isActive) tutorial.skipTutorial();
|
||||
if (activeItem === '내 정보' && !tutorial.hasSeen(TUTORIAL_KEYS.MY_INFO)) {
|
||||
tutorial.startTutorial(TUTORIAL_KEYS.MY_INFO);
|
||||
} else if (activeItem === 'ADO2 콘텐츠' && !tutorial.hasSeen(TUTORIAL_KEYS.ADO2_CONTENTS)) {
|
||||
tutorial.startTutorial(TUTORIAL_KEYS.ADO2_CONTENTS);
|
||||
} else if (activeItem === '대시보드' && !tutorial.hasSeen(TUTORIAL_KEYS.DASHBOARD)) {
|
||||
tutorial.startTutorial(TUTORIAL_KEYS.DASHBOARD);
|
||||
} else if (activeItem === '콘텐츠 캘린더' && !tutorial.hasSeen(TUTORIAL_KEYS.CONTENT_CALENDAR)) {
|
||||
tutorial.startTutorial(TUTORIAL_KEYS.CONTENT_CALENDAR);
|
||||
}
|
||||
}, [activeItem]);
|
||||
|
||||
// 네비게이션 핸들러 - "새 프로젝트 만들기" 클릭 시 기존 프로젝트 데이터 초기화
|
||||
const handleNavigate = (item: string) => {
|
||||
if (item === '새 프로젝트 만들기') {
|
||||
@@ -351,7 +390,12 @@ const GenerationFlow: React.FC<GenerationFlowProps> = ({
|
||||
);
|
||||
case -1:
|
||||
// 로딩 단계
|
||||
return <LoadingSection />;
|
||||
return (
|
||||
<LoadingSection
|
||||
isComplete={isAnalysisComplete}
|
||||
onComplete={() => goToWizardStep(0)}
|
||||
/>
|
||||
);
|
||||
case 0:
|
||||
// 브랜드 분석 결과 단계
|
||||
if (!analysisData) {
|
||||
@@ -399,6 +443,13 @@ const GenerationFlow: React.FC<GenerationFlowProps> = ({
|
||||
mId={analysisData?.m_id ?? 0}
|
||||
videoGenerationStatus={videoGenerationStatus}
|
||||
videoGenerationProgress={videoGenerationProgress}
|
||||
onStatusChange={(status: string) => {
|
||||
if (status === 'generating_song' && !tutorial.hasSeen(TUTORIAL_KEYS.SOUND_LYRICS)) {
|
||||
setTimeout(() => tutorial.startTutorial(TUTORIAL_KEYS.SOUND_LYRICS), 400);
|
||||
} else if (status === 'complete' && !tutorial.hasSeen(TUTORIAL_KEYS.SOUND_AUDIO)) {
|
||||
setTimeout(() => tutorial.startTutorial(TUTORIAL_KEYS.SOUND_AUDIO), 400);
|
||||
}
|
||||
}}
|
||||
/>
|
||||
);
|
||||
case 3:
|
||||
@@ -466,6 +517,56 @@ const GenerationFlow: React.FC<GenerationFlowProps> = ({
|
||||
// 스크롤이 필요한 페이지: 대시보드, 비즈니스 설정, 브랜드 분석(0), ADO2 콘텐츠, 내 정보
|
||||
const needsScroll = activeItem === '대시보드' || activeItem === '비즈니스 설정' || activeItem === 'ADO2 콘텐츠' || activeItem === '내 정보' || activeItem === '콘텐츠 캘린더' || isBrandAnalysis;
|
||||
|
||||
// 현재 화면에 맞는 튜토리얼 키 반환 (없으면 null)
|
||||
const getCurrentTutorialKey = (): string | null => {
|
||||
if (activeItem === '내 정보') return TUTORIAL_KEYS.MY_INFO;
|
||||
if (activeItem === 'ADO2 콘텐츠') return TUTORIAL_KEYS.ADO2_CONTENTS;
|
||||
if (activeItem === '대시보드') return TUTORIAL_KEYS.DASHBOARD;
|
||||
if (activeItem === '콘텐츠 캘린더') return TUTORIAL_KEYS.CONTENT_CALENDAR;
|
||||
if (activeItem === '새 프로젝트 만들기') {
|
||||
if (wizardStep === 1) return TUTORIAL_KEYS.ASSET;
|
||||
if (wizardStep === 2) return TUTORIAL_KEYS.SOUND;
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
const tutorialUI = (
|
||||
<>
|
||||
{getCurrentTutorialKey() && (
|
||||
<button
|
||||
className={`tutorial-toggle-fab ${tutorial.isEnabled ? 'active' : ''}`}
|
||||
onClick={() => tutorial.toggleTutorial(getCurrentTutorialKey())}
|
||||
title={tutorial.isEnabled ? t('sidebar.tutorialOff') : t('sidebar.tutorialOn')}
|
||||
>
|
||||
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5">
|
||||
<circle cx="12" cy="12" r="10"/>
|
||||
<path d="M12 8v4l3 3"/>
|
||||
</svg>
|
||||
<span>{t('sidebar.tutorial')}</span>
|
||||
<span className={`tutorial-toggle-badge ${tutorial.isEnabled ? 'on' : 'off'}`}>
|
||||
{tutorial.isEnabled ? 'ON' : 'OFF'}
|
||||
</span>
|
||||
</button>
|
||||
)}
|
||||
{tutorial.isActive && (
|
||||
<TutorialOverlay
|
||||
hints={tutorial.hints}
|
||||
currentIndex={tutorial.currentHintIndex}
|
||||
onNext={tutorial.nextHint}
|
||||
onPrev={tutorial.prevHint}
|
||||
onSkip={tutorial.skipTutorial}
|
||||
groupProgress={tutorial.groupProgress}
|
||||
/>
|
||||
)}
|
||||
{tutorial.isRestartPopupVisible && (
|
||||
<TutorialRestartPopup
|
||||
onConfirm={tutorial.confirmRestart}
|
||||
onCancel={tutorial.cancelRestart}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
|
||||
// 브랜드 분석일 때는 전체 화면 스크롤
|
||||
if (isBrandAnalysis) {
|
||||
return (
|
||||
@@ -476,6 +577,7 @@ const GenerationFlow: React.FC<GenerationFlowProps> = ({
|
||||
<main className="analysis-page-main">
|
||||
{renderContent()}
|
||||
</main>
|
||||
{tutorialUI}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -485,6 +587,7 @@ const GenerationFlow: React.FC<GenerationFlowProps> = ({
|
||||
{showSidebar && (
|
||||
<Sidebar activeItem={activeItem} onNavigate={handleNavigate} onHome={handleHome} userInfo={userInfo} onLogout={handleLogout} />
|
||||
)}
|
||||
{tutorialUI}
|
||||
<div className={`flex-1 relative pl-0 md:pl-0 ${needsScroll ? 'overflow-auto' : 'h-full overflow-hidden'}`}>
|
||||
{renderContent()}
|
||||
</div>
|
||||
|
||||
@@ -16,6 +16,7 @@ interface SoundStudioContentProps {
|
||||
businessInfo?: BusinessInfo;
|
||||
imageTaskId: string | null;
|
||||
mId: number;
|
||||
onStatusChange?: (status: string) => void;
|
||||
videoGenerationStatus?: 'idle' | 'generating' | 'complete' | 'error';
|
||||
videoGenerationProgress?: number;
|
||||
}
|
||||
@@ -39,6 +40,7 @@ const SoundStudioContent: React.FC<SoundStudioContentProps> = ({
|
||||
businessInfo,
|
||||
imageTaskId,
|
||||
mId,
|
||||
onStatusChange,
|
||||
videoGenerationStatus = 'idle',
|
||||
videoGenerationProgress = 0
|
||||
}) => {
|
||||
@@ -58,11 +60,8 @@ const SoundStudioContent: React.FC<SoundStudioContentProps> = ({
|
||||
const [statusMessage, setStatusMessage] = useState('');
|
||||
const [retryCount, setRetryCount] = useState(0);
|
||||
const [songTaskId, setSongTaskId] = useState<string | null>(null);
|
||||
const [isLanguageDropdownOpen, setIsLanguageDropdownOpen] = useState(false);
|
||||
|
||||
const progressBarRef = useRef<HTMLDivElement>(null);
|
||||
const audioRef = useRef<HTMLAudioElement>(null);
|
||||
const languageDropdownRef = useRef<HTMLDivElement>(null);
|
||||
|
||||
// 완료 데이터를 localStorage에 저장
|
||||
const saveSongCompletionData = () => {
|
||||
@@ -76,22 +75,6 @@ const SoundStudioContent: React.FC<SoundStudioContentProps> = ({
|
||||
};
|
||||
|
||||
// Close language dropdown when clicking outside
|
||||
useEffect(() => {
|
||||
const handleClickOutside = (event: MouseEvent) => {
|
||||
if (languageDropdownRef.current && !languageDropdownRef.current.contains(event.target as Node)) {
|
||||
setIsLanguageDropdownOpen(false);
|
||||
}
|
||||
};
|
||||
|
||||
if (isLanguageDropdownOpen) {
|
||||
document.addEventListener('mousedown', handleClickOutside);
|
||||
}
|
||||
|
||||
return () => {
|
||||
document.removeEventListener('mousedown', handleClickOutside);
|
||||
};
|
||||
}, [isLanguageDropdownOpen]);
|
||||
|
||||
// Auto-navigate to next page when video generation is complete
|
||||
useEffect(() => {
|
||||
if (videoGenerationStatus === 'complete' && songTaskId) {
|
||||
@@ -389,7 +372,13 @@ const SoundStudioContent: React.FC<SoundStudioContentProps> = ({
|
||||
|
||||
const isGenerating = status === 'generating_lyric' || status === 'generating_song' || status === 'polling';
|
||||
|
||||
// status 변경 시 부모에 알림
|
||||
useEffect(() => {
|
||||
onStatusChange?.(status);
|
||||
}, [status]);
|
||||
|
||||
return (
|
||||
<>
|
||||
<main className="sound-studio-page">
|
||||
{audioUrl && (
|
||||
<audio ref={audioRef} src={audioUrl} preload="metadata" />
|
||||
@@ -420,14 +409,15 @@ const SoundStudioContent: React.FC<SoundStudioContentProps> = ({
|
||||
<label className="input-label">{t('soundStudio.soundTypeLabel')}</label>
|
||||
<div className="sound-type-grid">
|
||||
{[
|
||||
{ key: '보컬', label: t('soundStudio.soundTypeVocal') },
|
||||
{ key: '배경음악', label: t('soundStudio.soundTypeBGM') },
|
||||
].map(({ key, label }) => (
|
||||
{ key: '보컬', label: t('soundStudio.soundTypeVocal'), disabled: false },
|
||||
{ key: '배경음악', label: t('soundStudio.soundTypeBGM'), disabled: true },
|
||||
].map(({ key, label, disabled }) => (
|
||||
<button
|
||||
key={key}
|
||||
onClick={() => !isGenerating && setSelectedType(key)}
|
||||
disabled={isGenerating}
|
||||
onClick={() => !isGenerating && !disabled && setSelectedType(key)}
|
||||
disabled={isGenerating || disabled}
|
||||
className={`sound-type-btn ${selectedType === key ? 'active' : ''}`}
|
||||
title={disabled ? t('soundStudio.comingSoon', { defaultValue: '이후 오픈 예정입니다' }) : undefined}
|
||||
>
|
||||
{label}
|
||||
</button>
|
||||
@@ -486,39 +476,31 @@ const SoundStudioContent: React.FC<SoundStudioContentProps> = ({
|
||||
{/* Language Selection */}
|
||||
<div className="sound-studio-section">
|
||||
<label className="input-label">{t('soundStudio.languageLabel')}</label>
|
||||
<div className="language-selector-wrapper" ref={languageDropdownRef}>
|
||||
<button
|
||||
onClick={() => setIsLanguageDropdownOpen(!isLanguageDropdownOpen)}
|
||||
disabled={isGenerating}
|
||||
className="language-selector"
|
||||
>
|
||||
<div className="language-display">
|
||||
<span className="language-flag">{LANGUAGE_FLAGS[selectedLang]}</span>
|
||||
<span className="language-name">{selectedLang}</span>
|
||||
</div>
|
||||
<img
|
||||
src="/assets/images/icon-dropdown.svg"
|
||||
alt=""
|
||||
className={`language-dropdown-icon ${isLanguageDropdownOpen ? 'open' : ''}`}
|
||||
/>
|
||||
</button>
|
||||
{isLanguageDropdownOpen && (
|
||||
<div className="language-dropdown-menu">
|
||||
{Object.keys(LANGUAGE_MAP).map((lang) => (
|
||||
<button
|
||||
key={lang}
|
||||
onClick={() => {
|
||||
setSelectedLang(lang);
|
||||
setIsLanguageDropdownOpen(false);
|
||||
}}
|
||||
className={`language-dropdown-item ${selectedLang === lang ? 'active' : ''}`}
|
||||
>
|
||||
<span className="language-flag">{LANGUAGE_FLAGS[lang]}</span>
|
||||
<span className="language-name">{lang}</span>
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
<div className="genre-grid language-grid">
|
||||
<div className="genre-row">
|
||||
{['한국어', 'English', '中文'].map((lang) => (
|
||||
<button
|
||||
key={lang}
|
||||
onClick={() => !isGenerating && setSelectedLang(lang)}
|
||||
disabled={isGenerating}
|
||||
className={`genre-btn ${selectedLang === lang ? 'active' : ''}`}
|
||||
>
|
||||
<span>{LANGUAGE_FLAGS[lang]}</span> {lang}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
<div className="genre-row">
|
||||
{['日本語', 'ไทย', 'Tiếng Việt'].map((lang) => (
|
||||
<button
|
||||
key={lang}
|
||||
onClick={() => !isGenerating && setSelectedLang(lang)}
|
||||
disabled={isGenerating}
|
||||
className={`genre-btn ${selectedLang === lang ? 'active' : ''}`}
|
||||
>
|
||||
<span>{LANGUAGE_FLAGS[lang]}</span> {lang}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -531,6 +513,16 @@ const SoundStudioContent: React.FC<SoundStudioContentProps> = ({
|
||||
</svg>
|
||||
{statusMessage}
|
||||
</div>
|
||||
) : status === 'complete' ? (
|
||||
<>
|
||||
<button
|
||||
onClick={handleRegenerate}
|
||||
className="btn-generate-sound"
|
||||
>
|
||||
{t('soundStudio.regenerateButton')}
|
||||
</button>
|
||||
<p className="regenerate-hint">{t('soundStudio.regenerateHint')}</p>
|
||||
</>
|
||||
) : (
|
||||
<button
|
||||
onClick={handleGenerateMusic}
|
||||
@@ -552,7 +544,7 @@ const SoundStudioContent: React.FC<SoundStudioContentProps> = ({
|
||||
<div className="lyrics-column">
|
||||
<div className="lyrics-header">
|
||||
<h3 className="column-title">{t('soundStudio.lyricsColumn')}</h3>
|
||||
<p className="lyrics-subtitle">{t('soundStudio.lyricsHint')}</p>
|
||||
{/* <p className="lyrics-subtitle">{t('soundStudio.lyricsHint')}</p> */}
|
||||
</div>
|
||||
|
||||
{/* Audio Player */}
|
||||
@@ -595,7 +587,7 @@ const SoundStudioContent: React.FC<SoundStudioContentProps> = ({
|
||||
{lyrics ? (
|
||||
<textarea
|
||||
value={lyrics}
|
||||
onChange={(e) => setLyrics(e.target.value)}
|
||||
readOnly
|
||||
className="lyrics-textarea"
|
||||
placeholder={t('soundStudio.lyricsPlaceholder')}
|
||||
/>
|
||||
@@ -643,6 +635,8 @@ const SoundStudioContent: React.FC<SoundStudioContentProps> = ({
|
||||
</button>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
|
||||
import React, { useState, useRef, useCallback } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { searchAccommodation, AccommodationSearchItem, AutocompleteRequest } from '../../utils/api';
|
||||
import { CrawlingResponse } from '../../types/api';
|
||||
import { useSearchHistory } from '../../components/SearchHistory/useSearchHistory';
|
||||
import SearchHistoryDropdown from '../../components/SearchHistory/SearchHistoryDropdown';
|
||||
|
||||
type SearchType = 'url' | 'name';
|
||||
|
||||
@@ -19,13 +20,30 @@ interface UrlInputContentProps {
|
||||
const UrlInputContent: React.FC<UrlInputContentProps> = ({ onAnalyze, onAutocomplete, onTestData, error }) => {
|
||||
const { t, i18n } = useTranslation();
|
||||
const [inputValue, setInputValue] = useState('');
|
||||
const [searchType, setSearchType] = useState<SearchType>('url');
|
||||
const [searchType, setSearchType] = useState<SearchType>('name');
|
||||
const [isDropdownOpen, setIsDropdownOpen] = useState(false);
|
||||
const [autocompleteResults, setAutocompleteResults] = useState<AccommodationSearchItem[]>([]);
|
||||
const [isAutocompleteLoading, setIsAutocompleteLoading] = useState(false);
|
||||
const [showAutocomplete, setShowAutocomplete] = useState(false);
|
||||
const [selectedItem, setSelectedItem] = useState<AccommodationSearchItem | null>(null);
|
||||
const [isLoadingTest, setIsLoadingTest] = useState(false);
|
||||
const { filteredHistory, showHistory, openHistory, closeHistory, hideOnInput, deleteItem } = useSearchHistory(searchType);
|
||||
|
||||
const handleSelectHistory = (item: { type: 'url' | 'name'; value: string; address?: string; roadAddress?: string }) => {
|
||||
closeHistory();
|
||||
if (item.type === 'url') {
|
||||
setSearchType('url');
|
||||
setInputValue(item.value);
|
||||
} else {
|
||||
setSearchType('name');
|
||||
setInputValue(item.value);
|
||||
setSelectedItem({
|
||||
title: item.value,
|
||||
address: item.address || '',
|
||||
roadAddress: item.roadAddress || '',
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// 테스트 데이터 로드 핸들러
|
||||
const handleTestData = async () => {
|
||||
@@ -53,7 +71,7 @@ const UrlInputContent: React.FC<UrlInputContentProps> = ({ onAnalyze, onAutocomp
|
||||
|
||||
const getPlaceholder = () => {
|
||||
return searchType === 'url'
|
||||
? 'https://www.castad.com'
|
||||
? 'https://naver.me/abcdef'
|
||||
: t('urlInput.placeholderBusinessName');
|
||||
};
|
||||
|
||||
@@ -96,6 +114,11 @@ const UrlInputContent: React.FC<UrlInputContentProps> = ({ onAnalyze, onAutocomp
|
||||
|
||||
// 키보드 네비게이션 핸들러
|
||||
const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {
|
||||
if (e.key === 'Enter') {
|
||||
e.preventDefault();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!showAutocomplete || autocompleteResults.length === 0) return;
|
||||
|
||||
switch (e.key) {
|
||||
@@ -111,12 +134,6 @@ const UrlInputContent: React.FC<UrlInputContentProps> = ({ onAnalyze, onAutocomp
|
||||
prev > 0 ? prev - 1 : autocompleteResults.length - 1
|
||||
);
|
||||
break;
|
||||
case 'Enter':
|
||||
if (highlightedIndex >= 0 && highlightedIndex < autocompleteResults.length) {
|
||||
e.preventDefault();
|
||||
handleSelectAutocomplete(autocompleteResults[highlightedIndex]);
|
||||
}
|
||||
break;
|
||||
case 'Escape':
|
||||
setShowAutocomplete(false);
|
||||
setHighlightedIndex(-1);
|
||||
@@ -138,6 +155,9 @@ const UrlInputContent: React.FC<UrlInputContentProps> = ({ onAnalyze, onAutocomp
|
||||
// 폼 제출 처리
|
||||
const handleSubmit = (e: React.FormEvent) => {
|
||||
e.preventDefault();
|
||||
};
|
||||
|
||||
const handleAnalyzeClick = () => {
|
||||
if (!inputValue.trim()) return;
|
||||
|
||||
if (searchType === 'name' && selectedItem && onAutocomplete) {
|
||||
@@ -221,6 +241,7 @@ const UrlInputContent: React.FC<UrlInputContentProps> = ({ onAnalyze, onAutocomp
|
||||
}
|
||||
|
||||
setInputValue(value);
|
||||
hideOnInput(value);
|
||||
|
||||
// 업체명 검색일 때 자동완성 검색 (디바운스)
|
||||
if (searchType === 'name') {
|
||||
@@ -237,11 +258,22 @@ const UrlInputContent: React.FC<UrlInputContentProps> = ({ onAnalyze, onAutocomp
|
||||
if (searchType === 'name' && autocompleteResults.length > 0) {
|
||||
setShowAutocomplete(true);
|
||||
}
|
||||
openHistory(inputValue);
|
||||
}}
|
||||
onBlur={() => setTimeout(() => closeHistory(), 150)}
|
||||
placeholder={getPlaceholder()}
|
||||
className="url-input-field"
|
||||
/>
|
||||
|
||||
{/* 최근 검색 히스토리 */}
|
||||
{showHistory && !showAutocomplete && (
|
||||
<SearchHistoryDropdown
|
||||
items={filteredHistory}
|
||||
onSelect={handleSelectHistory}
|
||||
onDelete={(e, value) => { e.preventDefault(); e.stopPropagation(); deleteItem(value); }}
|
||||
/>
|
||||
)}
|
||||
|
||||
{/* 자동완성 결과 */}
|
||||
{showAutocomplete && searchType === 'name' && (
|
||||
<div className="url-input-autocomplete-dropdown">
|
||||
@@ -268,21 +300,21 @@ const UrlInputContent: React.FC<UrlInputContentProps> = ({ onAnalyze, onAutocomp
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* 검색 버튼 */}
|
||||
<button type="submit" className="url-input-button">
|
||||
{t('urlInput.searchButton')}
|
||||
</button>
|
||||
|
||||
{/* 안내 텍스트 */}
|
||||
<p className="url-input-guide">
|
||||
{getGuideText()}
|
||||
</p>
|
||||
|
||||
{/* 에러 메시지 */}
|
||||
{error && (
|
||||
<p className="url-input-error">{error}</p>
|
||||
)}
|
||||
</form>
|
||||
|
||||
{/* 안내 텍스트 */}
|
||||
<p className="url-input-guide">
|
||||
{getGuideText()}
|
||||
</p>
|
||||
{/* 검색 버튼 */}
|
||||
<button type="button" onClick={handleAnalyzeClick} className="url-input-button">
|
||||
{t('landing.hero.analyzeButton')}
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
{/* 테스트 버튼 (VITE_IS_TESTPAGE=true일 때만 표시) */}
|
||||
|
||||
@@ -11,9 +11,9 @@ const DisplaySection: React.FC<DisplaySectionProps> = ({ onStartClick }) => {
|
||||
const { t } = useTranslation();
|
||||
// YouTube Shorts 영상 ID들
|
||||
const videos = [
|
||||
{ id: 1, videoId: 'OZJ8X4P82OA' },
|
||||
{ id: 2, videoId: 'hNzMO21O40c' },
|
||||
{ id: 3, videoId: 'dM8_d6Aud68' },
|
||||
{ id: 1, videoId: 'trnN0SQBTiI' },
|
||||
{ id: 2, videoId: '96HO497HsQI' },
|
||||
{ id: 3, videoId: 'XziImxVICIk' },
|
||||
];
|
||||
|
||||
return (
|
||||
|
||||
@@ -3,6 +3,11 @@ import React, { useState, useEffect, useRef, useCallback } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { searchAccommodation, AccommodationSearchItem, AutocompleteRequest } from '../../utils/api';
|
||||
import { CrawlingResponse } from '../../types/api';
|
||||
import { useTutorial } from '../../components/Tutorial/useTutorial';
|
||||
import { TUTORIAL_KEYS } from '../../components/Tutorial/tutorialSteps';
|
||||
import TutorialOverlay from '../../components/Tutorial/TutorialOverlay';
|
||||
import { useSearchHistory } from '../../components/SearchHistory/useSearchHistory';
|
||||
import SearchHistoryDropdown from '../../components/SearchHistory/SearchHistoryDropdown';
|
||||
|
||||
type SearchType = 'url' | 'name';
|
||||
|
||||
@@ -60,7 +65,7 @@ const orbConfigs: OrbConfig[] = [
|
||||
const HeroSection: React.FC<HeroSectionProps> = ({ onAnalyze, onAutocomplete, onTestData, onNext, error: externalError, scrollProgress = 0 }) => {
|
||||
const { t, i18n } = useTranslation();
|
||||
const [inputValue, setInputValue] = useState('');
|
||||
const [searchType, setSearchType] = useState<SearchType>('url');
|
||||
const [searchType, setSearchType] = useState<SearchType>('name');
|
||||
const [isDropdownOpen, setIsDropdownOpen] = useState(false);
|
||||
const [localError, setLocalError] = useState('');
|
||||
const [isLoadingTest, setIsLoadingTest] = useState(false);
|
||||
@@ -81,6 +86,7 @@ const HeroSection: React.FC<HeroSectionProps> = ({ onAnalyze, onAutocomplete, on
|
||||
setIsLoadingTest(false);
|
||||
}
|
||||
};
|
||||
const { filteredHistory, showHistory, openHistory, closeHistory, hideOnInput, deleteItem } = useSearchHistory(searchType);
|
||||
const [isFocused, setIsFocused] = useState(false);
|
||||
const [autocompleteResults, setAutocompleteResults] = useState<AccommodationSearchItem[]>([]);
|
||||
const [isAutocompleteLoading, setIsAutocompleteLoading] = useState(false);
|
||||
@@ -92,6 +98,17 @@ const HeroSection: React.FC<HeroSectionProps> = ({ onAnalyze, onAutocomplete, on
|
||||
const dropdownRef = useRef<HTMLDivElement>(null);
|
||||
const autocompleteRef = useRef<HTMLDivElement>(null);
|
||||
const debounceRef = useRef<NodeJS.Timeout | null>(null);
|
||||
const tutorial = useTutorial();
|
||||
|
||||
// 첫 방문 시 랜딩 튜토리얼 시작
|
||||
useEffect(() => {
|
||||
if (!tutorial.hasSeen(TUTORIAL_KEYS.LANDING)) {
|
||||
const timer = setTimeout(() => {
|
||||
tutorial.startTutorial(TUTORIAL_KEYS.LANDING);
|
||||
}, 800);
|
||||
return () => clearTimeout(timer);
|
||||
}
|
||||
}, []);
|
||||
|
||||
const searchTypeOptions = [
|
||||
{ value: 'url' as SearchType, label: 'URL' },
|
||||
@@ -174,8 +191,8 @@ const HeroSection: React.FC<HeroSectionProps> = ({ onAnalyze, onAutocomplete, on
|
||||
}
|
||||
}
|
||||
|
||||
// 업체명 검색 모드에서 Enter 키 입력 시 기본 동작 방지 (폼 제출 방지)
|
||||
if (e.key === 'Enter' && searchType === 'name') {
|
||||
// Enter 키 입력 시 기본 동작 방지 (폼 제출 방지)
|
||||
if (e.key === 'Enter') {
|
||||
e.preventDefault();
|
||||
}
|
||||
};
|
||||
@@ -260,7 +277,7 @@ const HeroSection: React.FC<HeroSectionProps> = ({ onAnalyze, onAutocomplete, on
|
||||
|
||||
const getPlaceholder = () => {
|
||||
return searchType === 'url'
|
||||
? 'https://www.castad.com'
|
||||
? 'https://naver.me/abcdef'
|
||||
: t('landing.hero.placeholderBusinessName');
|
||||
};
|
||||
|
||||
@@ -387,7 +404,8 @@ const HeroSection: React.FC<HeroSectionProps> = ({ onAnalyze, onAutocomplete, on
|
||||
}
|
||||
|
||||
setInputValue(value);
|
||||
setHighlightedIndex(-1); // 입력 시 하이라이트 초기화
|
||||
setHighlightedIndex(-1);
|
||||
hideOnInput(value);
|
||||
if (localError) setLocalError('');
|
||||
|
||||
// 업체명 검색일 때 자동완성 검색 (디바운스)
|
||||
@@ -415,13 +433,37 @@ const HeroSection: React.FC<HeroSectionProps> = ({ onAnalyze, onAutocomplete, on
|
||||
if (searchType === 'name' && autocompleteResults.length > 0) {
|
||||
setShowAutocomplete(true);
|
||||
}
|
||||
openHistory(inputValue);
|
||||
}}
|
||||
onBlur={() => setIsFocused(false)}
|
||||
onBlur={() => { setIsFocused(false); setTimeout(() => closeHistory(), 150); }}
|
||||
onKeyDown={handleKeyDown}
|
||||
placeholder={getPlaceholder()}
|
||||
className={`hero-input ${inputValue ? 'has-value' : ''}`}
|
||||
/>
|
||||
|
||||
{/* 최근 검색 히스토리 */}
|
||||
{showHistory && !showAutocomplete && (
|
||||
<SearchHistoryDropdown
|
||||
items={filteredHistory}
|
||||
onSelect={(item) => {
|
||||
closeHistory();
|
||||
if (item.type === 'url') {
|
||||
setSearchType('url');
|
||||
setInputValue(item.value);
|
||||
} else {
|
||||
setSearchType('name');
|
||||
setInputValue(item.value);
|
||||
setSelectedItem({ title: item.value, address: item.address || '', roadAddress: item.roadAddress || '' });
|
||||
}
|
||||
}}
|
||||
onDelete={(e, value) => { e.preventDefault(); e.stopPropagation(); deleteItem(value); }}
|
||||
className="hero-autocomplete-dropdown"
|
||||
itemClassName="hero-autocomplete-item"
|
||||
titleClassName="hero-autocomplete-title"
|
||||
addressClassName="hero-autocomplete-address"
|
||||
/>
|
||||
)}
|
||||
|
||||
{/* 자동완성 결과 */}
|
||||
{showAutocomplete && searchType === 'name' && (
|
||||
<div className="hero-autocomplete-dropdown">
|
||||
@@ -502,6 +544,17 @@ const HeroSection: React.FC<HeroSectionProps> = ({ onAnalyze, onAutocomplete, on
|
||||
{isLoadingTest ? t('landing.hero.testDataLoading') : t('landing.hero.testData')}
|
||||
</button>
|
||||
)}
|
||||
|
||||
{tutorial.isActive && (
|
||||
<TutorialOverlay
|
||||
hints={tutorial.hints}
|
||||
currentIndex={tutorial.currentHintIndex}
|
||||
onNext={tutorial.nextHint}
|
||||
onPrev={tutorial.prevHint}
|
||||
onSkip={tutorial.skipTutorial}
|
||||
groupProgress={tutorial.groupProgress}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user