-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #240 from Team-TIFY/dev
[Deploy]: 카카오 로그인 에러 수정
- Loading branch information
Showing
14 changed files
with
192 additions
and
64 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,30 +1,119 @@ | ||
import { | ||
DailyQuestionCategory, | ||
DailyQuestionCategoryType, | ||
} from '@utils/apis/weekly/questionType' | ||
import styled from '@emotion/styled' | ||
import { useRecoilState } from 'recoil' | ||
import { dateState } from '@libs/store/date' | ||
import { DailyQuestionCategoryType } from '@utils/apis/weekly/questionType' | ||
|
||
const QuestionImg = ({ | ||
className, | ||
category, | ||
isToggled = true, | ||
}: { | ||
category: DailyQuestionCategoryType | ||
className: string | ||
isToggled?: boolean | ||
category?: DailyQuestionCategoryType | ||
}) => { | ||
const [date, setDate] = useRecoilState(dateState) | ||
|
||
const images = [ | ||
'/images/questionBox/mon.png', | ||
'/images/questionBox/tue.png', | ||
'/images/questionBox/wed.png', | ||
'/images/questionBox/thur.png', | ||
'/images/questionBox/fri.png', | ||
'/images/questionBox/sat.png', | ||
'/images/questionBox/sun.png', | ||
] | ||
|
||
const getTransform = (index: number) => { | ||
const diff = index - date.selectedDate | ||
const translateX = diff * 97 // 가로 이동 거리 | ||
const translateY = diff * (diff > 0 ? -68 : 68) // 세로 이동 거리 | ||
console.log(translateX) | ||
return `translate(${translateX}px, ${translateY}px)` | ||
} | ||
|
||
return ( | ||
<ImgContainer isToggled={isToggled}> | ||
<img src={DailyQuestionCategory[category]} /> | ||
<div className="image-slider"> | ||
{images.map((image, index) => ( | ||
<img | ||
alt="ImgBox" | ||
key={index} | ||
className={`image-box ${ | ||
index === date.selectedDate | ||
? 'todayImg' | ||
: index === date.selectedDate - 1 | ||
? 'prevImg' | ||
: index === date.selectedDate + 1 | ||
? 'nextImg' | ||
: index === date.selectedDate + 2 | ||
? 'nextReadyImg' | ||
: index === date.selectedDate - 2 | ||
? 'prevReadyImg' | ||
: 'hidden' | ||
}`} | ||
src={image} | ||
style={{ | ||
transform: getTransform(index), | ||
transition: | ||
'transform 0.5s ease-in-out, opacity 0.5s ease-in-out', | ||
opacity: | ||
Math.abs(index - date.selectedDate) === 1 | ||
? 0.05 | ||
: Math.abs(index - date.selectedDate) === 0 | ||
? 1 | ||
: 0.05, | ||
}} | ||
/> | ||
))} | ||
</div> | ||
</ImgContainer> | ||
) | ||
} | ||
export default QuestionImg | ||
|
||
const ImgContainer = styled.div<{ isToggled: boolean }>` | ||
display: ${({ isToggled }) => (isToggled ? 'flex' : 'none')}; | ||
display: flex; | ||
flex-shrink: 0; | ||
justify-content: center; | ||
width: 100%; | ||
height: 242px; | ||
height: 230px; | ||
.image-slider { | ||
position: relative; | ||
display: flex; | ||
justify-content: center; | ||
width: 100%; | ||
height: 100%; | ||
} | ||
img { | ||
height: 100%; | ||
position: absolute; | ||
} | ||
.todayImg { | ||
top: 40%; | ||
} | ||
.hidden { | ||
display: none; | ||
} | ||
.prevImg { | ||
top: 40%; | ||
left: 15%; | ||
opacity: 5%; | ||
} | ||
.nextImg { | ||
top: 40%; | ||
right: 15%; | ||
opacity: 5%; | ||
} | ||
.prevReadyImg { | ||
left: -10%; | ||
opacity: 0; | ||
} | ||
.nextReadyImg { | ||
right: -10%; | ||
opacity: 0; | ||
} | ||
cursor: pointer; | ||
` |
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
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 |
---|---|---|
@@ -1,3 +1,16 @@ | ||
import { TodayKeyType } from '@models/components/atoms/DayWeek' | ||
|
||
export const todayList: TodayKeyType[] = [0, 1, 2, 3, 4, 5, 6] | ||
|
||
type WeeklyBoxType = { [key in TodayKeyType]: string } | ||
|
||
export const weeklyList: WeeklyBoxType = { | ||
'-1': '', | ||
0: '/images/questionBox/mon.png', | ||
1: '/images/questionBox/tue.png', | ||
2: '/images/questionBox/wed.png', | ||
3: '/images/questionBox/thur.png', | ||
4: '/images/questionBox/fri.png', | ||
5: '/images/questionBox/sat.png', | ||
6: '/images/questionBox/sun.png', | ||
} |
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
Oops, something went wrong.