-
Notifications
You must be signed in to change notification settings - Fork 2
[SRLT-142] 랜딩페이지 반응형 수정 #119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The head ref may contain hidden characters: "SRLT-142-\uB79C\uB529\uD398\uC774\uC9C0-\uBC18\uC751\uD615"
Changes from all commits
b9a3024
a6d338f
5aaa7f6
09e853e
3670aac
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,6 @@ | ||
| import { useState, useEffect } from 'react'; | ||
|
|
||
| const calculateTimeLeft = (targetDate: string) => { | ||
| if (typeof window === 'undefined') { | ||
| return { days: 0, hours: 0, minutes: 0, seconds: 0 }; | ||
| } | ||
|
|
||
| const target = new Date(targetDate).getTime(); | ||
| const now = Date.now(); | ||
| const diff = target - now; | ||
|
|
@@ -21,10 +17,14 @@ const calculateTimeLeft = (targetDate: string) => { | |
| return { days: 0, hours: 0, minutes: 0, seconds: 0 }; | ||
| }; | ||
|
|
||
| const initialTimeLeft = { days: 0, hours: 0, minutes: 0, seconds: 0 }; | ||
|
|
||
| export const useCountdown = (targetDate: string) => { | ||
| const [timeLeft, setTimeLeft] = useState(() => calculateTimeLeft(targetDate)); | ||
| const [timeLeft, setTimeLeft] = useState(initialTimeLeft); | ||
| const [mounted, setMounted] = useState(false); | ||
|
Comment on lines
+20
to
+24
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 초기 지금 구현은 SSR/초기 hydration에서 항상 Also applies to: 38-38 🤖 Prompt for AI Agents |
||
|
|
||
| useEffect(() => { | ||
| setMounted(true); | ||
| const updateTimer = () => { | ||
| setTimeLeft(calculateTimeLeft(targetDate)); | ||
| }; | ||
|
|
@@ -35,5 +35,7 @@ export const useCountdown = (targetDate: string) => { | |
| return () => clearInterval(interval); | ||
| }, [targetDate]); | ||
|
|
||
| if (!mounted) return initialTimeLeft; | ||
|
|
||
| return timeLeft; | ||
| }; | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
배경 이미지는 장식용으로 처리해주세요.
이 이미지는 정보 전달 역할이 아니라 시각적 배경이라서, 지금처럼 alt 텍스트를 두면 스크린리더가 불필요한 설명을 읽게 됩니다.
alt=""로 비우고aria-hidden을 주거나 CSS background로 옮기는 편이 접근성에 맞습니다.♿ 제안 수정안
<Image src="/images/bussiness_mobile.png" - alt="사업계획서 배경" + alt="" + aria-hidden="true" fill className="object-cover md:hidden" quality={100} unoptimized priority /> <Image src="/images/bussiness_tablet.png" - alt="사업계획서 배경" + alt="" + aria-hidden="true" fill className="hidden object-cover md:block" quality={100} unoptimized priority />📝 Committable suggestion
🤖 Prompt for AI Agents