css 정리 .
This commit is contained in:
1 parent
97577b6ba3
commit
ecbd81d091
16 files changed
+3778
-485
No files matched your search
@@ -20,7 +20,6 @@ const AssetManagementContent: React.FC<AssetManagementContentProps> = ({
|
||||
const fileInputRef = useRef<HTMLInputElement>(null);
|
||||
const imageListRef = useRef<HTMLDivElement>(null);
|
||||
|
||||
// 이미지 아이템의 표시용 URL 가져오기
|
||||
const getImageSrc = (item: ImageItem): string => {
|
||||
return item.type === 'url' ? item.url : item.preview;
|
||||
};
|
||||
@@ -37,7 +36,6 @@ const AssetManagementContent: React.FC<AssetManagementContentProps> = ({
|
||||
const atTop = scrollTop <= 0;
|
||||
const atBottom = scrollTop + clientHeight >= scrollHeight - 1;
|
||||
|
||||
// 스크롤 가능한 영역 내에서 스크롤 중이면 이벤트 전파 중지
|
||||
if ((e.deltaY < 0 && !atTop) || (e.deltaY > 0 && !atBottom)) {
|
||||
e.stopPropagation();
|
||||
}
|
||||
@@ -69,38 +67,37 @@ const AssetManagementContent: React.FC<AssetManagementContentProps> = ({
|
||||
const files = e.target.files;
|
||||
if (files && files.length > 0) {
|
||||
onAddImages(Array.from(files));
|
||||
// input 초기화 (같은 파일 다시 선택 가능하도록)
|
||||
e.target.value = '';
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<main className="flex flex-col h-full p-3 sm:p-4 md:p-6 overflow-hidden">
|
||||
<div className="flex justify-start mb-2 sm:mb-3 ml-10 md:ml-0 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">
|
||||
<main className="page-container">
|
||||
{/* Back Button */}
|
||||
<div className="back-button-container">
|
||||
<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:block text-center mb-2 md:mb-4 shrink-0">
|
||||
<h1 className="text-lg md:text-xl lg:text-2xl font-bold mb-0.5 tracking-tight">브랜드 에셋</h1>
|
||||
<p className="text-gray-400 text-[9px] md:text-[10px] lg:text-xs font-light">
|
||||
{/* Header */}
|
||||
<div className="page-header">
|
||||
<h1 className="page-title">브랜드 에셋</h1>
|
||||
<p className="page-subtitle">
|
||||
쉽고 빠르게, 브랜드 소셜 미디어 캠페인을 만드세요.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div className="flex-1 flex flex-col md:flex-row gap-2 sm:gap-3 md:gap-4 max-w-6xl mx-auto w-full min-h-0 overflow-hidden">
|
||||
{/* 선택된 이미지 */}
|
||||
<div className="flex-[2] bg-[#1c2a2e] rounded-xl sm:rounded-2xl md:rounded-3xl p-3 sm:p-4 md:p-5 border border-white/5 shadow-2xl overflow-hidden flex flex-col">
|
||||
<div className="flex justify-between items-center mb-2 sm:mb-3 shrink-0">
|
||||
<h3 className="text-[#a6ffea] text-[9px] sm:text-[10px] md:text-xs font-bold tracking-wide">선택된 이미지</h3>
|
||||
<span className="text-gray-500 text-[8px] sm:text-[9px] md:text-[10px]">{imageList.length}장</span>
|
||||
{/* Main Content */}
|
||||
<div className="main-content">
|
||||
{/* Selected Images Card */}
|
||||
<div className="card card-flex card-flex-2 card-overflow-hidden">
|
||||
<div className="flex-between mb-4 shrink-0">
|
||||
<h3 className="section-title mb-0">선택된 이미지</h3>
|
||||
<span className="text-gray-400 text-sm">{imageList.length}장</span>
|
||||
</div>
|
||||
<div
|
||||
ref={imageListRef}
|
||||
@@ -109,28 +106,21 @@ const AssetManagementContent: React.FC<AssetManagementContentProps> = ({
|
||||
style={{ overscrollBehavior: 'contain' }}
|
||||
>
|
||||
{imageList.length > 0 ? (
|
||||
<div className="grid grid-cols-3 sm:grid-cols-4 gap-1.5 sm:gap-2">
|
||||
<div className="image-grid">
|
||||
{imageList.map((item, i) => (
|
||||
<div
|
||||
key={i}
|
||||
className="aspect-square bg-[#121a1d]/50 rounded-lg border border-white/5 relative overflow-hidden group"
|
||||
>
|
||||
<div key={i} className="image-item">
|
||||
<img
|
||||
src={getImageSrc(item)}
|
||||
alt={`이미지 ${i + 1}`}
|
||||
className="w-full h-full object-cover"
|
||||
/>
|
||||
{/* 업로드된 파일 표시 배지 */}
|
||||
{item.type === 'file' && (
|
||||
<div className="absolute top-1 left-1 px-1 py-0.5 bg-[#a682ff]/80 rounded text-[7px] sm:text-[8px] text-white font-medium">
|
||||
NEW
|
||||
</div>
|
||||
<div className="image-item-badge">NEW</div>
|
||||
)}
|
||||
<button
|
||||
onClick={() => onRemoveImage(i)}
|
||||
className="absolute top-1 right-1 w-4 h-4 sm:w-5 sm:h-5 bg-black/60 hover:bg-red-500/80 rounded flex items-center justify-center text-white/70 hover:text-white transition-colors opacity-0 group-hover:opacity-100"
|
||||
className="image-item-remove"
|
||||
>
|
||||
<svg className="w-2.5 h-2.5 sm:w-3 sm:h-3" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5">
|
||||
<svg className="w-4 h-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5">
|
||||
<line x1="18" y1="6" x2="6" y2="18"/>
|
||||
<line x1="6" y1="6" x2="18" y2="18"/>
|
||||
</svg>
|
||||
@@ -139,33 +129,33 @@ const AssetManagementContent: React.FC<AssetManagementContentProps> = ({
|
||||
))}
|
||||
</div>
|
||||
) : (
|
||||
<div className="flex items-center justify-center text-gray-500 text-[9px] sm:text-[10px] py-6 sm:py-10 h-full">
|
||||
<div className="flex-center text-gray-500 text-base h-full">
|
||||
이미지가 없습니다
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* 이미지 업로드 */}
|
||||
<div className="flex-1 bg-[#1c2a2e] rounded-xl sm:rounded-2xl md:rounded-3xl p-3 sm:p-4 md:p-5 border border-white/5 shadow-2xl flex flex-col min-h-[120px] sm:min-h-[150px]">
|
||||
<h3 className="text-[#a6ffea] text-[9px] sm:text-[10px] md:text-xs font-bold mb-2 sm:mb-3 tracking-wide shrink-0">이미지 업로드</h3>
|
||||
{/* Upload Card */}
|
||||
<div className="card card-flex card-flex-1" style={{ minHeight: '200px' }}>
|
||||
<h3 className="section-title">이미지 업로드</h3>
|
||||
<div
|
||||
onClick={handleFileSelect}
|
||||
onDragOver={handleDragOver}
|
||||
onDrop={handleDrop}
|
||||
className="flex-1 border-2 border-dashed border-gray-700 rounded-xl sm:rounded-2xl flex flex-col items-center justify-center p-3 sm:p-4 text-center group cursor-pointer hover:border-[#a6ffea]/50 transition-colors"
|
||||
className="upload-zone"
|
||||
>
|
||||
<div className="mb-2 text-gray-500 group-hover:text-[#a6ffea]">
|
||||
<svg className="w-6 h-6 sm:w-8 sm:h-8" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5">
|
||||
<div className="upload-zone-icon">
|
||||
<svg className="w-12 h-12" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5">
|
||||
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/>
|
||||
<polyline points="17 8 12 3 7 8"/>
|
||||
<line x1="12" y1="3" x2="12" y2="15"/>
|
||||
</svg>
|
||||
</div>
|
||||
<p className="text-gray-400 text-[8px] sm:text-[9px] md:text-[10px] font-medium leading-relaxed">
|
||||
<p className="upload-zone-title">
|
||||
이미지를 드래그하여<br/>업로드
|
||||
</p>
|
||||
<p className="text-gray-600 text-[7px] sm:text-[8px] mt-1">
|
||||
<p className="upload-zone-subtitle">
|
||||
또는 클릭하여 파일 선택
|
||||
</p>
|
||||
</div>
|
||||
@@ -180,15 +170,12 @@ const AssetManagementContent: React.FC<AssetManagementContentProps> = ({
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="flex justify-center py-2 sm:py-3 md:py-4 shrink-0">
|
||||
{/* Bottom Button */}
|
||||
<div className="bottom-button-container">
|
||||
<button
|
||||
onClick={onNext}
|
||||
disabled={imageList.length === 0}
|
||||
className={`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-2xl text-[9px] sm:text-[10px] md:text-xs tracking-wide ${
|
||||
imageList.length > 0
|
||||
? 'bg-[#a682ff] hover:bg-[#9570f0] text-white shadow-[#a682ff44]'
|
||||
: 'bg-gray-600 text-gray-400 cursor-not-allowed shadow-none'
|
||||
}`}
|
||||
className={`btn-primary ${imageList.length === 0 ? 'disabled' : ''}`}
|
||||
>
|
||||
다음 단계
|
||||
</button>
|
||||
|
||||
Reference in new issue
Block a user