css 정리 .

This commit is contained in:
HyeongBaeYang committed 2025-12-24 13:09:05 +09:00
1 parent 97577b6ba3
commit ecbd81d091
16 files changed
+3778 -485

No files matched your search

+103 -69
View File
@@ -1,5 +1,5 @@
import React from 'react';
import React, { useState } from 'react';
import { CrawlingResponse } from '../../types/api';
interface AnalysisResultSectionProps {
@@ -8,119 +8,153 @@ interface AnalysisResultSectionProps {
data: CrawlingResponse;
}
// 마크다운 report를 섹션별로 파싱
const parseReport = (report: string) => {
const sections: { title: string; content: string }[] = [];
const lines = report.split('\n');
let currentTitle = '';
let currentContent: string[] = [];
lines.forEach((line) => {
if (line.startsWith('## ')) {
if (currentTitle || currentContent.length > 0) {
sections.push({ title: currentTitle, content: currentContent.join('\n').trim() });
}
currentTitle = line.replace('## ', '').trim();
currentContent = [];
} else if (!line.startsWith('# ')) {
currentContent.push(line);
}
});
if (currentTitle || currentContent.length > 0) {
sections.push({ title: currentTitle, content: currentContent.join('\n').trim() });
}
return sections.filter(s => s.title && s.content && !s.title.includes('JSON'));
};
const AnalysisResultSection: React.FC<AnalysisResultSectionProps> = ({ onBack, onGenerate, data }) => {
const { processed_info, marketing_analysis, image_list } = data;
const tags = marketing_analysis.tags || [];
const facilities = marketing_analysis.facilities || [];
const [showFullReport, setShowFullReport] = useState(false);
const reportSections = parseReport(marketing_analysis.report);
return (
<div className="w-full h-[100dvh] text-white flex flex-col p-3 py-2 sm:p-4 sm:py-3 md:p-6 lg:p-8 overflow-hidden bg-[#121a1d]">
{/* 뒤로가기 버튼 */}
<div className="w-full flex justify-start mb-2 sm:mb-3 shrink-0">
<button
onClick={onBack}
className="flex items-center gap-1.5 py-1 px-3 sm:py-1.5 sm:px-4 rounded-full border border-gray-700 hover:bg-gray-800 transition-colors text-[9px] sm:text-[10px] md:text-xs text-gray-300"
>
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
<div className="analysis-container">
{/* Back Button */}
<div className="back-button-container" style={{ marginLeft: 0 }}>
<button onClick={onBack} className="btn-back">
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
<path d="M15 18l-6-6 6-6" />
</svg>
뒤로가기
</button>
</div>
{/* 헤더 - 높이가 작을 때 숨김 */}
<div className="hidden sm:flex flex-col items-center text-center mb-2 md:mb-4 shrink-0">
<div className="text-[#a682ff] mb-1 animate-bounce">
<svg className="w-4 h-4 md:w-5 md:h-5" viewBox="0 0 24 24" fill="currentColor">
{/* Header */}
<div className="analysis-header">
<div className="analysis-icon">
<svg className="w-8 h-8" viewBox="0 0 24 24" fill="currentColor">
<path d="M12 2l2.4 7.2L22 12l-7.6 2.4L12 22l-2.4-7.2L2 12l7.6-2.4z" />
</svg>
</div>
<h1 className="text-lg md:text-xl lg:text-2xl font-bold mb-0.5">브랜드 분석</h1>
<p className="text-gray-400 text-[9px] md:text-[10px] lg:text-xs font-light max-w-lg px-4">
<h1 className="page-title">브랜드 분석</h1>
<p className="page-subtitle">
쉽고 빠르게, 브랜드 소셜 미디어 캠페인을 만드세요.
</p>
</div>
{/* 메인 콘텐츠 그리드 */}
<div className="max-w-6xl mx-auto w-full grid grid-cols-1 md:grid-cols-2 gap-2 sm:gap-3 md:gap-4 flex-1 min-h-0 overflow-hidden">
{/* 브랜드 정체성 */}
<div className="bg-[#1c2a2e] rounded-xl sm:rounded-2xl md:rounded-3xl p-3 sm:p-4 md:p-5 flex flex-col border border-white/5 shadow-xl overflow-hidden">
<span className="text-[#a6ffea] text-[8px] sm:text-[9px] md:text-[10px] font-bold uppercase tracking-wider mb-1.5 sm:mb-2 block shrink-0">브랜드 정체성</span>
<h2 className="text-lg sm:text-xl md:text-2xl lg:text-3xl font-bold mb-0.5 shrink-0">{processed_info.customer_name}</h2>
<p className="text-gray-500 text-[10px] sm:text-xs md:text-sm mb-2 sm:mb-3 shrink-0">{processed_info.region} · {processed_info.detail_region_info}</p>
{/* Main Content Grid */}
<div className="analysis-grid">
{/* Brand Identity */}
<div className="brand-identity-card">
<div className="brand-header">
<span className="section-title mb-0">브랜드 정체성</span>
<span className="text-gray-500 text-sm">AI 마케팅 분석 요약</span>
</div>
{/* 이미지 미리보기 */}
<h2 className="brand-name">{processed_info.customer_name}</h2>
<p className="brand-location">{processed_info.region} · {processed_info.detail_region_info}</p>
{/* Marketing Analysis Summary */}
<div className="flex-1">
<div className="flex-between mb-3">
<button
onClick={() => setShowFullReport(!showFullReport)}
className="report-toggle"
>
{showFullReport ? '간략히 보기' : '자세히 보기'}
</button>
</div>
<div className="report-content custom-scrollbar">
{showFullReport ? (
<div className="space-y-4">
{reportSections.map((section, idx) => (
<div key={idx}>
<h4 className="report-section-title">{section.title}</h4>
<p className="text-gray-300" style={{ lineHeight: 1.625 }}>{section.content}</p>
</div>
))}
</div>
) : (
<p className="text-gray-300">
{reportSections[0]?.content.slice(0, 150)}...
</p>
)}
</div>
</div>
{/* Image Preview */}
{image_list.length > 0 && (
<div className="mt-auto min-h-0 overflow-hidden">
<span className="text-gray-500 text-[8px] sm:text-[9px] md:text-[10px] font-bold uppercase tracking-wider mb-1.5 block shrink-0">수집된 이미지 ({image_list.length}장)</span>
<div className="grid grid-cols-4 gap-1 sm:gap-1.5">
<div className="image-preview-section">
<span className="image-preview-title">수집된 이미지 ({image_list.length}장)</span>
<div className="image-preview-grid">
{image_list.slice(0, 8).map((img, idx) => (
<div key={idx} className="aspect-square rounded sm:rounded-md overflow-hidden bg-[#121a1d]">
<img src={img} alt={`이미지 ${idx + 1}`} className="w-full h-full object-cover" />
<div key={idx} className="image-preview-item">
<img src={img} alt={`이미지 ${idx + 1}`} />
</div>
))}
</div>
{image_list.length > 8 && (
<p className="text-gray-500 text-[9px] sm:text-[10px] mt-1 text-center">+{image_list.length - 8}장 더 있음</p>
<p className="image-preview-more">+{image_list.length - 8}장 더 있음</p>
)}
</div>
)}
</div>
{/* 오른쪽 카드들 */}
<div className="flex flex-col gap-2 sm:gap-3 overflow-hidden">
{/* 시설 정보 */}
<div className="bg-[#1c2a2e] rounded-xl sm:rounded-2xl md:rounded-3xl p-3 sm:p-4 md:p-5 border border-white/5 shadow-xl shrink-0">
<span className="text-[#a682ff] text-[8px] sm:text-[9px] md:text-[10px] font-bold uppercase tracking-wider mb-1.5 sm:mb-2 block">주요 시설</span>
<div className="flex flex-wrap gap-1 sm:gap-1.5">
{facilities.slice(0, 6).map((facility, idx) => (
<span key={idx} className="px-2 sm:px-2.5 py-1 sm:py-1.5 bg-[#121a1d]/40 rounded-full text-[9px] sm:text-[10px] text-gray-400 border border-white/5">
{/* Right Cards */}
<div className="analysis-cards-column">
{/* Main Selling Points (Facilities) */}
<div className="feature-card">
<span className="section-title-purple">주요 셀링 포인트</span>
<div className="tags-wrapper">
{facilities.map((facility, idx) => (
<span key={idx} className="feature-tag">
{facility}
</span>
))}
{facilities.length > 6 && (
<span className="px-2 sm:px-2.5 py-1 sm:py-1.5 bg-[#121a1d]/40 rounded-full text-[9px] sm:text-[10px] text-gray-500 border border-white/5">
+{facilities.length - 6}
</span>
)}
</div>
</div>
{/* 추천 태그 */}
<div className="bg-[#1c2a2e] rounded-xl sm:rounded-2xl md:rounded-3xl p-3 sm:p-4 md:p-5 border border-white/5 shadow-xl shrink-0">
<span className="text-[#a6ffea] text-[8px] sm:text-[9px] md:text-[10px] font-bold uppercase tracking-wider mb-1.5 sm:mb-2 block">추천 마케팅 태그</span>
<div className="flex flex-wrap gap-1 sm:gap-1.5">
{tags.slice(0, 6).map((tag, idx) => (
<span key={idx} className="px-2 sm:px-2.5 py-1 sm:py-1.5 bg-[#121a1d]/40 rounded-full text-[9px] sm:text-[10px] text-[#a6ffea]/80 border border-[#a6ffea]/10">
{/* Recommended Target Keywords (Tags) */}
<div className="feature-card">
<span className="section-title">추천 타겟 키워드</span>
<div className="tags-wrapper">
{tags.map((tag, idx) => (
<span key={idx} className="feature-tag">
{tag}
</span>
))}
{tags.length > 6 && (
<span className="px-2 sm:px-2.5 py-1 sm:py-1.5 bg-[#121a1d]/40 rounded-full text-[9px] sm:text-[10px] text-[#a6ffea]/50 border border-[#a6ffea]/10">
+{tags.length - 6}
</span>
)}
</div>
</div>
{/* 마케팅 분석 요약 */}
<div className="bg-[#1c2a2e] rounded-xl sm:rounded-2xl md:rounded-3xl p-3 sm:p-4 md:p-5 border border-white/5 shadow-xl flex-1 min-h-0 overflow-hidden flex flex-col">
<span className="text-[#a682ff] text-[8px] sm:text-[9px] md:text-[10px] font-bold uppercase tracking-wider mb-1.5 sm:mb-2 block shrink-0">마케팅 분석</span>
<div className="text-gray-400 text-[9px] sm:text-[10px] leading-relaxed overflow-y-auto custom-scrollbar flex-1 min-h-0">
{marketing_analysis.report.split('\n').slice(0, 3).map((line, idx) => (
<p key={idx} className="mb-1 sm:mb-1.5">{line.replace(/^#+\s*/, '')}</p>
))}
</div>
</div>
</div>
</div>
{/* 하단 버튼 */}
<div className="mt-2 sm:mt-3 md:mt-4 flex justify-center shrink-0 py-2 sm:py-3 md:py-4">
<button
onClick={onGenerate}
className="bg-[#a682ff] hover:bg-[#9570f0] text-white font-bold py-2 sm:py-2.5 md:py-3 px-6 sm:px-10 md:px-14 rounded-full transition-all transform active:scale-95 shadow-lg shadow-[#a682ff33] text-[9px] sm:text-[10px] md:text-xs"
>
{/* Bottom Button */}
<div className="analysis-bottom">
<button onClick={onGenerate} className="btn-primary">
콘텐츠 생성
</button>
</div>
+9 -9
View File
@@ -3,19 +3,19 @@ import React from 'react';
const LoadingSection: React.FC = () => {
return (
<div className="w-full h-screen bg-[#121a1d] flex flex-col items-center justify-center text-white px-6">
<div className="relative mb-8">
<div className="loading-container">
<div className="loading-spinner">
{/* Spinning Outer Ring */}
<div className="w-16 h-16 border-4 border-[#a682ff]/20 border-t-[#a682ff] rounded-full animate-spin"></div>
<div className="loading-ring"></div>
{/* Pulsing center icon */}
<div className="absolute inset-0 flex items-center justify-center">
<div className="w-4 h-4 bg-[#a682ff] rounded-full animate-pulse shadow-[0_0_15px_#a682ff]"></div>
<div className="loading-dot">
<div className="loading-dot-inner"></div>
</div>
</div>
<div className="text-center space-y-2">
<h2 className="text-xl sm:text-2xl font-bold tracking-tight">비즈니스 분석 중</h2>
<p className="text-gray-400 text-sm sm:text-base font-light animate-pulse">
<div className="loading-text">
<h2 className="loading-title">비즈니스 분석 중</h2>
<p className="loading-description">
AI가 입력하신 정보를 바탕으로 마케팅 핵심 가치를 추출하고 있습니다...
</p>
</div>