-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
427 additions
and
114 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import styled from "styled-components"; | ||
|
||
export const ButtonListContainer = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
gap: 1.5rem; | ||
padding: 1.5rem; | ||
border: 1px solid #d4d2e3; | ||
border-radius: 24px; | ||
button { | ||
} | ||
button > div { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
} | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import { FaRegBell } from "react-icons/fa"; | ||
import { GoPeople } from "react-icons/go"; | ||
import { IoMapOutline } from "react-icons/io5"; | ||
import { LuCalendarDays } from "react-icons/lu"; | ||
import { PiMicrophoneStage } from "react-icons/pi"; | ||
import { useNavigate } from "react-router-dom"; | ||
|
||
import { Button } from "@/components/forms/Button"; | ||
import { Text } from "@/components/typography/Text"; | ||
|
||
import { ButtonListContainer } from "./ButtonList.styled"; | ||
|
||
export const ButtonList = () => { | ||
const navigate = useNavigate(); | ||
|
||
return ( | ||
<ButtonListContainer> | ||
<Button width="auto" variant="purple" onClick={() => navigate("/booth")}> | ||
<div> | ||
<IoMapOutline size={22} style={{ marginRight: "10px" }} /> | ||
<Text size="m" weight="bold" variant="white"> | ||
부스 별 지도 | ||
</Text> | ||
</div> | ||
</Button> | ||
<Button width="auto" variant="purple" onClick={() => navigate("/guests")}> | ||
<div> | ||
<PiMicrophoneStage size={22} style={{ marginRight: "10px" }} /> | ||
<Text size="m" weight="bold" variant="white"> | ||
Special Guest | ||
</Text> | ||
</div> | ||
</Button> | ||
<Button width="auto" variant="purple" onClick={() => navigate("/timetable")}> | ||
<div> | ||
<LuCalendarDays size={22} style={{ marginRight: "10px" }} /> | ||
<Text size="m" weight="bold" variant="white"> | ||
이벤트 일정 | ||
</Text> | ||
</div> | ||
</Button> | ||
<Button width="auto" variant="purple" onClick={() => navigate("/contributors")}> | ||
<div> | ||
<GoPeople size={22} style={{ marginRight: "10px" }} /> | ||
<Text size="m" weight="bold" variant="white"> | ||
만든이들 | ||
</Text> | ||
</div> | ||
</Button> | ||
<Button width="auto" variant="red" onClick={() => window.open("https://instagram.com/knu_ch", "_blank")}> | ||
<div> | ||
<FaRegBell size={22} style={{ marginRight: "10px" }} /> | ||
<Text size="m" weight="bold" variant="white"> | ||
총학 Hotline | ||
</Text> | ||
</div> | ||
</Button> | ||
</ButtonListContainer> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import styled from "styled-components"; | ||
|
||
export const CountdownContainer = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
font-family: "MesloLGS NF Bold", monospace; | ||
font-size: 2rem; | ||
color: #333; | ||
text-align: center; | ||
padding: 30px 60px; | ||
span { | ||
margin-bottom: 1rem; | ||
} | ||
border: 1px solid #d4d2e3; | ||
border-radius: 24px; | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { Text } from "@/components/typography/Text"; | ||
|
||
import { useCountdown } from "@/hooks/useCountdown"; | ||
|
||
import { CountdownContainer } from "./Countdown.styled"; | ||
|
||
interface ICountdown { | ||
targetDate: Date; | ||
} | ||
|
||
export const Countdown: React.FC<ICountdown> = ({ targetDate }) => { | ||
const displayTime = useCountdown(targetDate); | ||
|
||
const dateOptions: Intl.DateTimeFormatOptions = { | ||
year: "numeric", | ||
month: "2-digit", | ||
day: "2-digit", | ||
}; | ||
const timeOptions: Intl.DateTimeFormatOptions = { | ||
hour: "2-digit", | ||
minute: "2-digit", | ||
|
||
hour12: false, | ||
}; | ||
|
||
return ( | ||
<CountdownContainer> | ||
<Text size="l" weight="bold" variant="darkpurple"> | ||
축제까지 남은 시간 | ||
</Text> | ||
<Text size="xl" weight="bold" variant="lightpurple"> | ||
{displayTime} | ||
</Text> | ||
<Text size="m" weight="normal" variant="darkpurple"> | ||
UTC+9 | {targetDate.toLocaleDateString("ko-KR", dateOptions)}{" "} | ||
{targetDate.toLocaleTimeString("en-US", timeOptions)} | ||
</Text> | ||
</CountdownContainer> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,30 @@ | ||
import styled from "styled-components"; | ||
|
||
export const FooterContainer = styled.footer` | ||
background-color: #b0b0b0; | ||
color: white; | ||
text-align: center; | ||
width: 100%; | ||
padding: 0; | ||
font-size: 0.75rem; | ||
border-radius: 10px 10px 0 0; | ||
padding: 20px 0; | ||
box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1); | ||
bottom: 0; | ||
`; | ||
|
||
export const TopBorder = styled.div` | ||
height: 1px; | ||
background-color: #d0d0d0; | ||
width: 70%; | ||
margin: 0 auto 20px; | ||
`; | ||
|
||
export const Logo = styled.img` | ||
width: 100px; | ||
height: auto; | ||
`; | ||
|
||
export const EventName = styled.h3` | ||
margin: 30px 0; | ||
`; | ||
|
||
export const LegalLinks = styled.div``; | ||
|
||
export const LegalText = styled.p` | ||
margin: 0 0 10px 0; | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { useState, useEffect } from "react"; | ||
|
||
const formatTime = (time: number): string => { | ||
return time < 10 ? `0${time}` : time.toString(); | ||
}; | ||
|
||
const calculateTimeLeft = (targetDate: Date) => { | ||
const difference = +targetDate - +new Date(); | ||
let timeLeft: Record<string, number> = {}; | ||
|
||
if (difference > 0) { | ||
timeLeft = { | ||
days: Math.floor(difference / (1000 * 60 * 60 * 24)), | ||
hours: Math.floor((difference / (1000 * 60 * 60)) % 24), | ||
minutes: Math.floor((difference / 1000 / 60) % 60), | ||
seconds: Math.floor((difference / 1000) % 60), | ||
}; | ||
} | ||
|
||
return timeLeft; | ||
}; | ||
|
||
export const useCountdown = (targetDate: Date) => { | ||
const [timeLeft, setTimeLeft] = useState<Record<string, number>>(calculateTimeLeft(targetDate)); | ||
|
||
useEffect(() => { | ||
const timer = setTimeout(() => { | ||
setTimeLeft(calculateTimeLeft(targetDate)); | ||
}, 1000); | ||
|
||
return () => clearTimeout(timer); | ||
}); | ||
|
||
const formattedTime = `${formatTime(timeLeft.days * 24 + timeLeft.hours)}:${formatTime(timeLeft.minutes)}:${formatTime(timeLeft.seconds)}`; | ||
return formattedTime; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters