Skip to content
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

feat: select 페이지 생성 #11

Merged
merged 29 commits into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
bf9cf39
temp
Aug 28, 2024
b999514
Merge branch 'develop' into feat/select
Aug 28, 2024
50da91b
temp
Aug 28, 2024
49e0643
feat: Refectoring style
Aug 28, 2024
c604561
chore: style 재구성
FriOct Aug 28, 2024
cd34f0d
chore: Layout height를 100vh로 변경
FriOct Aug 28, 2024
cb6df9d
chore: Type지정
FriOct Aug 28, 2024
c3e3c4e
chore: type 지정
FriOct Aug 28, 2024
531dad3
chore: type지정 및 주석처리
FriOct Aug 28, 2024
afdfe26
chore: 주석 처리
FriOct Aug 28, 2024
2dc7ce5
chore: react-spring/web 패키지 삭제
FriOct Aug 28, 2024
c809916
chore: 이상한 사진 주소 수정
FriOct Aug 28, 2024
dffdd2a
style: 스타일 조정
FriOct Aug 28, 2024
3883349
Merge branch 'develop' into feat/select
toothlessdev Aug 29, 2024
7c73976
chore: slectpage mark1
FriOct Aug 29, 2024
53b39a1
style: 선택 버튼에 맞는 스타일 추가 border 따로 구분
FriOct Aug 29, 2024
7511960
feat: SelectPage mark2
FriOct Aug 29, 2024
006691a
chore: 초기 버튼 gap 수정
FriOct Aug 29, 2024
2535d8d
chore: 각 분야별 질문 Tree 생성
FriOct Aug 30, 2024
2ae6282
chore: 선택지 위치 조정
FriOct Aug 30, 2024
353cc70
Merge branch 'develop' into feat/select
toothlessdev Sep 4, 2024
030ae78
feat: selectpage에 라우팅 추가
FriOct Sep 5, 2024
dbaa068
feat: results 데이터 추가 및 tree수정
FriOct Sep 5, 2024
724eafc
chore: route수정
FriOct Sep 5, 2024
dd0e773
feat: 분야 선택 switch문 추가
FriOct Sep 5, 2024
df98a03
feat: Button클릭시 색상전환 애니메이션 추가
FriOct Sep 5, 2024
842d0c6
chore: Button의 style은 inline방식이 아닌 variant방식으로 수정
FriOct Sep 6, 2024
b461e5c
Merge branch 'develop' into feat/select
FriOct Sep 6, 2024
3d2ab5a
chore: useNavigate 중복 imoprt 해결
FriOct Sep 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 34 additions & 43 deletions src/pages/SelectPage.style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,53 +9,44 @@ export const SelectPageContainer = styled.div`
align-items: center;
overflow: hidden;
height: 100%;
`;

.optionWrapper {
height: 100%;
display: flex;
justify-content: center;
align-items: center;
}

.optionLeft,
.optionRight {
display: flex;

justify-content: center;
align-items: center;
width: 100%;
height: 100%;
padding: 10px 20px;
overflow: hidden; /* 내용이 넘치면 숨김 */
white-space: nowrap; /* 텍스트를 한 줄로 유지 */
text-overflow: clip; /* 텍스트가 넘치면 그냥 잘라냄 */
}

.optionLeft {
background-color: #d9d9d9;
color: #000;
border-radius: 0 15px 15px 0;
}

.optionRight {
background-color: #37cdcd;
color: #fff;
border-radius: 15px 0 0 15px;
}
.container {
}
export const OptionLeft = styled(motion.div)`
display: flex;
justify-content: center;
align-items: center;
width: 100%;
height: 100%;
padding: 10px 20px;
overflow: hidden; /* 내용이 넘치면 숨김 */
white-space: nowrap; /* 텍스트를 한 줄로 유지 */
text-overflow: clip; /* 텍스트가 넘치면 그냥 잘라냄 */
background-color: #d9d9d9;
color: #000;
border-radius: 0 15px 15px 0;
`;

.item {
}
.box {
width: 200px;
height: 200px;
background: var(--accent);
background-color: #000;
}
export const OptionRight = styled(motion.div)`
display: flex;
justify-content: center;
align-items: center;
width: 100%;
height: 100%;
padding: 10px 20px;
overflow: hidden; /* 내용이 넘치면 숨김 */
white-space: nowrap; /* 텍스트를 한 줄로 유지 */
text-overflow: clip; /* 텍스트가 넘치면 그냥 잘라냄 */
background-color: #37cdcd;
FriOct marked this conversation as resolved.
Show resolved Hide resolved
color: #fff;
border-radius: 15px 0 0 15px;
`;

export const OptionContainer = styled.div``;
export const OptionWrapper = styled.div`
height: 100%;
display: flex;
justify-content: center;
align-items: center;
`;

export const Item = styled(motion.div)`
position: relative;
Expand Down
31 changes: 15 additions & 16 deletions src/pages/SelectPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ import {
CardContainer,
ItemWrapper,
Item,
OptionWrapper,
OptionLeft,
OptionRight,
} from "./SelectPage.style";
import ProgressBar from "@ramonak/react-progress-bar";

Expand Down Expand Up @@ -92,13 +95,9 @@ export default function SelectPage() {
)}
</CardWrapper>

<div
className="optionContainer"
style={{ flexDirection: animateRightToLeft ? "row-reverse" : "row" }}
>
<div className="optionWrapper" style={{ display: animateRightToLeft ? "none" : "flex" }}>
<motion.div
className="optionLeft"
<div style={{ flexDirection: animateRightToLeft ? "row-reverse" : "row" }}>
<OptionWrapper style={{ display: animateRightToLeft ? "none" : "flex" }}>
<OptionLeft
initial={{ width: "auto" }}
animate={animateLeftToRight ? { width: "100vw" } : { width: "auto" }}
transition={{
Expand All @@ -109,13 +108,13 @@ export default function SelectPage() {
onAnimationComplete={animateLeftToRight ? handleAnimationComplete : undefined}
>
<Text size="xs">{questions[currentQuestionIndex].option[0]}</Text>
</motion.div>
<img src={leftArrow} className="leftArrow" />
</div>
<div className="optionWrapper" style={{ display: animateLeftToRight ? "none" : "flex" }}>
<img src={rightArrow} className="rightArrow" />
<motion.div
className="optionRight"
</OptionLeft>

<img src={leftArrow} />
</OptionWrapper>
<OptionWrapper style={{ display: animateLeftToRight ? "none" : "flex" }}>
<img src={rightArrow} />
<OptionRight
initial={{ width: "auto" }}
animate={animateRightToLeft ? { width: "100vw" } : { width: "auto" }}
transition={{
Expand All @@ -126,8 +125,8 @@ export default function SelectPage() {
onAnimationComplete={animateRightToLeft ? handleAnimationComplete : undefined}
>
<Text size="xs">{questions[currentQuestionIndex].option[1]}</Text>
</motion.div>
</div>
</OptionRight>
</OptionWrapper>
</div>
</SelectPageContainer>
</SelectPageWrapper>
Expand Down