castad front 작업
This commit is contained in:
1 parent
aa39cde4c6
commit
a42562279e
30 files changed
+4332
No files matched your search
Executable
+105
@@ -0,0 +1,105 @@
|
||||
|
||||
import React, { useState } from 'react';
|
||||
|
||||
interface HeroSectionProps {
|
||||
onAnalyze?: (url: string) => void;
|
||||
onNext?: () => void;
|
||||
error?: string | null;
|
||||
}
|
||||
|
||||
const isValidUrl = (string: string): boolean => {
|
||||
try {
|
||||
const url = new URL(string);
|
||||
return url.protocol === 'http:' || url.protocol === 'https:';
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
const HeroSection: React.FC<HeroSectionProps> = ({ onAnalyze, onNext, error: externalError }) => {
|
||||
const [url, setUrl] = useState('');
|
||||
const [localError, setLocalError] = useState('');
|
||||
|
||||
const error = externalError || localError;
|
||||
|
||||
const handleStart = () => {
|
||||
if (!url.trim()) {
|
||||
setLocalError('URL을 입력해주세요.');
|
||||
return;
|
||||
}
|
||||
|
||||
if (!isValidUrl(url.trim())) {
|
||||
setLocalError('올바른 URL 형식이 아닙니다. (예: https://example.com)');
|
||||
return;
|
||||
}
|
||||
|
||||
setLocalError('');
|
||||
if (onAnalyze) {
|
||||
onAnalyze(url);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="w-full h-full flex flex-col items-center justify-center bg-[#121a1d] text-white px-4 relative">
|
||||
<div className="content-safe-area">
|
||||
{/* Title */}
|
||||
<h1 className="font-serif-logo italic text-6xl sm:text-7xl md:text-8xl lg:text-9xl font-bold mb-4 tracking-tight text-center leading-none">
|
||||
CASTAD
|
||||
</h1>
|
||||
|
||||
{/* Subtitle */}
|
||||
<p className="text-sm sm:text-base md:text-xl font-light mb-12 opacity-80 text-center max-w-lg">
|
||||
Marketing Automation for Location Based Business
|
||||
</p>
|
||||
|
||||
{/* Input Form */}
|
||||
<div className="w-full max-w-sm flex flex-col gap-3">
|
||||
<input
|
||||
type="text"
|
||||
value={url}
|
||||
onChange={(e) => {
|
||||
setUrl(e.target.value);
|
||||
if (localError) setLocalError('');
|
||||
}}
|
||||
placeholder="URL 입력"
|
||||
className={`w-full py-3 sm:py-4 px-6 rounded-full bg-white text-gray-800 text-center focus:outline-none placeholder:text-gray-400 font-medium text-sm sm:text-base ${error ? 'ring-2 ring-red-500' : ''}`}
|
||||
/>
|
||||
{error && (
|
||||
<p className="text-red-400 text-xs text-center">{error}</p>
|
||||
)}
|
||||
|
||||
<button
|
||||
onClick={handleStart}
|
||||
className="w-full py-3 sm:py-4 px-6 rounded-full bg-[#a682ff] hover:bg-[#9570f0] transition-all transform active:scale-95 text-white font-bold text-sm sm:text-base shadow-lg shadow-[#a682ff33]"
|
||||
>
|
||||
시작하기
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Footer Indicator - Now a button */}
|
||||
<button
|
||||
onClick={onNext}
|
||||
className="absolute bottom-6 sm:bottom-10 flex flex-col items-center gap-2 opacity-40 hover:opacity-100 transition-opacity cursor-pointer animate-bounce"
|
||||
>
|
||||
<span className="text-[10px] sm:text-xs font-light">더 알아보기</span>
|
||||
<div className="w-8 h-8 sm:w-10 sm:h-10 border border-white rounded-full flex items-center justify-center">
|
||||
<svg
|
||||
width="16"
|
||||
height="16"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
strokeWidth="2"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
>
|
||||
<path d="M7 13l5 5 5-5M7 6l5 5 5-5" />
|
||||
</svg>
|
||||
</div>
|
||||
</button>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default HeroSection;
|
||||
Reference in new issue
Block a user