Skip to content

Commit 753aab2

Browse files
committed
style: mbti-test intro 페이지 ui 개선
1 parent a05f8c0 commit 753aab2

File tree

3 files changed

+47
-24
lines changed

3 files changed

+47
-24
lines changed

src/components/header/SubHeader.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,13 @@ const SubHeader = ({
5656
src="/public/icon/arrow_left.svg"
5757
alt="Go To Back"
5858
className="absolute left-[18.77px] cursor-pointer"
59-
width={9.87}
59+
width={9}
6060
height={16}
6161
onClick={handleGoBack}
6262
/>
6363
)}
6464

65-
<h1 className="absolute left-1/2 -translate-x-1/2 transform text-[18px] font-bold text-gray-900">
65+
<h1 className="absolute left-1/2 -translate-x-1/2 transform font-bold text-gray-900">
6666
{title}
6767
</h1>
6868

src/index.css

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,27 @@ body {
3131
main {
3232
@media screen and (min-width: 360px) {
3333
width: 360px;
34-
3534
}
3635
@media screen and (min-width: 375px) {
3736
width: 375px;
38-
3937
}
4038
@media screen and (min-width: 500px) {
4139
width: 500px;
4240
}
4341
}
4442

43+
header {
44+
@media screen and (min-width: 360px) {
45+
font-size: 16px;
46+
}
47+
@media screen and (min-width: 375px) {
48+
font-size: 18px;
49+
}
50+
@media screen and (min-width: 500px) {
51+
font-size: 18px;
52+
}
53+
}
54+
4555
input:focus {
4656
outline: none;
4757
}
@@ -55,7 +65,6 @@ button:hover {
5565
}
5666

5767
@keyframes pulse-custom {
58-
5968
0%,
6069
100% {
6170
transform: scale(1);
@@ -87,4 +96,4 @@ button:hover {
8796
* {
8897
@apply transition-transform duration-200 ease-in-out;
8998
}
90-
}
99+
}

src/pages/MbtiTestIntro.tsx

Lines changed: 32 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
import { ChangeEvent, FormEvent, useState } from "react";
22
import { useNavigate } from "react-router-dom";
33
import Header from "@/components/header/Header";
4+
import useLayoutSize from "@/hooks/useLayoutSize";
45
const MbtiTestIntro = () => {
56
const [name, setName] = useState("");
67
const navigate = useNavigate();
7-
8-
const handleChange = (e:ChangeEvent<HTMLInputElement>) => {
8+
const viewport = useLayoutSize();
9+
const bannerSize =
10+
viewport === "sm" ? "360" : viewport === "md" ? "375" : "500";
11+
const handleChange = (e: ChangeEvent<HTMLInputElement>) => {
912
setName(e.target.value);
10-
}
13+
};
1114

1215
const handleSubmit = (e: FormEvent<HTMLFormElement>) => {
1316
e.preventDefault();
@@ -21,37 +24,48 @@ const MbtiTestIntro = () => {
2124

2225
localStorage.setItem("mbti-test-name", name);
2326
navigate("/mbti-test-progress");
24-
}
27+
};
2528

2629
return (
27-
<main className="sm:h-[812px] h-[1080px] flex flex-col">
28-
<Header title="상대방 MBTI 유추 테스트"/>
29-
<div className="relative flex-1 flex flex-col items-center w-full h-[756px]">
30-
<img src="/image/mbti-test/500px/intro_500.png" alt="intro image" className="inset-0 w-full h-full"/>
31-
<span className="absolute top-[38px] font-medium text-lg">그 사람의 mbti는 뭘까?</span>
32-
<h2 className="absolute top-[74px] font-extrabold text-[32px] text-center">
30+
<main className="flex h-[1080px] flex-col sm:h-[812px]">
31+
<Header title="상대방 MBTI 유추 테스트" />
32+
<div className="relative flex h-[756px] w-full flex-1 flex-col items-center">
33+
<img
34+
src={`/image/mbti-test/${bannerSize}px/intro_${bannerSize}.png`}
35+
alt="intro image"
36+
className="inset-0 h-full w-full"
37+
/>
38+
<span className="absolute top-[38px] text-lg font-medium">
39+
그 사람의 mbti는 뭘까?
40+
</span>
41+
<h2 className="absolute top-[74px] text-center text-[32px] leading-10 font-extrabold">
3342
<span className="text-[#2714FF]">상대방</span> MBTI
3443
<br />
3544
유추 테스트
3645
</h2>
37-
<form className="absolute top-[472px] flex flex-col items-center" onSubmit={handleSubmit}>
38-
<label htmlFor="name" className="font-medium text-lg ">MBTI를 알고 싶은 상대의 이름</label>
46+
<form
47+
className="absolute top-[472px] flex flex-col items-center"
48+
onSubmit={handleSubmit}
49+
>
50+
<label htmlFor="name" className="text-lg font-medium ">
51+
MBTI를 알고 싶은 상대의 이름
52+
</label>
3953
<input
4054
type="text"
4155
id="name"
4256
onChange={handleChange}
43-
className="bg-white border-gray-50 w-full rounded-lg mt-[30px] h-[68px] text-center"
57+
className="mt-[30px] h-[68px] w-full rounded-lg border-gray-50 bg-white text-center"
4458
/>
4559
<button
4660
type="submit"
47-
className="bg-primary-normal hover:opacity-80 mt-[60px] rounded-lg w-[320px] lg:w-[460px] h-[60px] font-bold text-white"
61+
className="mt-[60px] h-[60px] w-[320px] rounded-lg bg-primary-normal font-bold text-white hover:opacity-80 lg:w-[460px]"
4862
>
4963
시작하기
5064
</button>
51-
</form>
65+
</form>
5266
</div>
5367
</main>
54-
)
55-
}
68+
);
69+
};
5670

57-
export default MbtiTestIntro;
71+
export default MbtiTestIntro;

0 commit comments

Comments
 (0)