Showing
1 changed file
with
34 additions
and
4 deletions
| ... | @@ -2,33 +2,60 @@ import React, { useState, useEffect } from "react"; | ... | @@ -2,33 +2,60 @@ import React, { useState, useEffect } from "react"; |
| 2 | import Card from "../components/card/Card"; | 2 | import Card from "../components/card/Card"; |
| 3 | import {useDispatch} from 'react-redux'; | 3 | import {useDispatch} from 'react-redux'; |
| 4 | import {getResultThunk} from "../store/action/result"; | 4 | import {getResultThunk} from "../store/action/result"; |
| 5 | -import ProgressBar from "../components/progressbar/ProgressBar"; | ||
| 6 | import "antd/dist/antd.css"; | 5 | import "antd/dist/antd.css"; |
| 6 | +import mainPattern from "../assets/mainPattern.jpeg"; | ||
| 7 | 7 | ||
| 8 | import styled, { css } from "styled-components"; | 8 | import styled, { css } from "styled-components"; |
| 9 | 9 | ||
| 10 | const SurveyContainer = styled.div` | 10 | const SurveyContainer = styled.div` |
| 11 | display: flex; | 11 | display: flex; |
| 12 | justify-content: center; | 12 | justify-content: center; |
| 13 | + background-image: url(${mainPattern}); | ||
| 13 | `; | 14 | `; |
| 14 | 15 | ||
| 15 | const Container = styled.div` | 16 | const Container = styled.div` |
| 16 | - border: solid 1px red; | 17 | + /* border: solid 1px red; */ |
| 17 | width: 500px; | 18 | width: 500px; |
| 18 | height: 100vh; | 19 | height: 100vh; |
| 19 | overflow: hidden; | 20 | overflow: hidden; |
| 21 | + display: flex; | ||
| 22 | + flex-direction: column; | ||
| 23 | + align-items: center; | ||
| 24 | +`; | ||
| 25 | + | ||
| 26 | +const ProgressBar = styled.div` | ||
| 27 | + display: flex; | ||
| 28 | + align-items: center; | ||
| 29 | + width: 300px; | ||
| 30 | + padding: 0.25rem; | ||
| 31 | + margin-top: 14rem; | ||
| 32 | + background-color: #747b4b; | ||
| 33 | + border-radius: 1rem; | ||
| 34 | + position: relative; | ||
| 35 | +`; | ||
| 36 | + | ||
| 37 | +// 적당한 icon 찾으면 바꿀 것임 | ||
| 38 | +const ProgressIcon = styled.div` | ||
| 39 | + position: absolute; | ||
| 40 | + width: 25px; | ||
| 41 | + height: 25px; | ||
| 42 | + border-radius: 50%; | ||
| 43 | + background-color: #3c441d; | ||
| 44 | + ${(props)=> css` | ||
| 45 | + transform: translateX(${30 * props.curIdx}px); | ||
| 46 | + transition: 0.5s; | ||
| 47 | + `} | ||
| 20 | `; | 48 | `; |
| 21 | 49 | ||
| 22 | const SliderCotainer = styled.div` | 50 | const SliderCotainer = styled.div` |
| 23 | width: 100%; | 51 | width: 100%; |
| 24 | display: flex; | 52 | display: flex; |
| 25 | align-items: center; | 53 | align-items: center; |
| 26 | - /* margin: 0 auto; */ | ||
| 27 | ${(props) => css` | 54 | ${(props) => css` |
| 28 | transform: translateX(${-500 * props.curIdx}px); | 55 | transform: translateX(${-500 * props.curIdx}px); |
| 29 | transition: 0.5s; | 56 | transition: 0.5s; |
| 30 | `} | 57 | `} |
| 31 | - margin-top: 20rem; | 58 | + margin-top: 6rem; |
| 32 | `; | 59 | `; |
| 33 | 60 | ||
| 34 | function SurveyPage({ history, question }) { | 61 | function SurveyPage({ history, question }) { |
| ... | @@ -47,6 +74,9 @@ function SurveyPage({ history, question }) { | ... | @@ -47,6 +74,9 @@ function SurveyPage({ history, question }) { |
| 47 | <SurveyContainer> | 74 | <SurveyContainer> |
| 48 | <Container> | 75 | <Container> |
| 49 | {/* 상태바 넣기 */} | 76 | {/* 상태바 넣기 */} |
| 77 | + <ProgressBar> | ||
| 78 | + <ProgressIcon curIdx={curIdx}/> | ||
| 79 | + </ProgressBar> | ||
| 50 | <SliderCotainer curIdx={curIdx}> | 80 | <SliderCotainer curIdx={curIdx}> |
| 51 | {/* 얘가 슬라이더 컨테이너 */} | 81 | {/* 얘가 슬라이더 컨테이너 */} |
| 52 | {question.map((question) => ( | 82 | {question.map((question) => ( | ... | ... |
-
Please register or login to post a comment