-
Notifications
You must be signed in to change notification settings - Fork 7
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
[SP2] 프로젝트 탭 캐러셀 블러 스타일 수정 #266
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,50 @@ | ||
import styled from '@emotion/styled'; | ||
import { colors } from '@sopt-makers/colors'; | ||
import { css } from '@emotion/react'; | ||
import arrowLeft from '@src/assets/icons/arrow_left_28x28.svg'; | ||
import arrowRight from '@src/assets/icons/arrow_right_28x28.svg'; | ||
import { HideScrollbar } from '@src/lib/styles/scrollbar'; | ||
import { CarouselArrowType } from '@src/lib/types/universal'; | ||
|
||
const Wrapper = styled(HideScrollbar)` | ||
const Wrapper = styled(HideScrollbar)<{ isSliding: boolean; lastIndex: boolean }>` | ||
width: 100%; | ||
position: relative; | ||
|
||
::before, | ||
::after { | ||
content: ''; | ||
position: absolute; | ||
top: 0; | ||
z-index: 5; | ||
|
||
width: 70px; | ||
height: 164px; | ||
} | ||
|
||
::before { | ||
left: 0; | ||
background: linear-gradient(270deg, transparent 0%, ${colors.gray950} 100%); | ||
|
||
opacity: ${({ isSliding }) => (isSliding ? '1' : '0')}; | ||
transition: opacity 0.3s ease-out; | ||
} | ||
|
||
::after { | ||
right: -1px; | ||
background: linear-gradient(270deg, ${colors.gray950} 0%, transparent 100%); | ||
|
||
opacity: 0; | ||
${({ isSliding }) => | ||
isSliding && | ||
css` | ||
opacity: 1; | ||
transition: opacity 0.3s ease-out; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. transition 속성은 조건문을 걸지 않아도 괜찮지 않나요 ..? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 화면 사이즈가 변동 되었을 때는 transition이 없었으면 해서 슬라이드 넘길 때만 적용했습니다! |
||
`}; | ||
|
||
@media (max-width: 1279px) { | ||
opacity: ${({ lastIndex }) => (lastIndex ? 0 : 1)}; | ||
} | ||
} | ||
`; | ||
|
||
const Arrow = styled.div<{ type: CarouselArrowType }>` | ||
|
@@ -40,12 +77,14 @@ const CarouselWrapper = styled.div<{ | |
translateX: number; | ||
itemWidth: number; | ||
itemCount: number; | ||
gapWidth: number; | ||
}>` | ||
width: ${({ itemWidth, itemCount }) => itemWidth * itemCount}px; | ||
display: grid; | ||
grid-template-columns: ${({ itemWidth, itemCount }) => `repeat(${itemCount}, ${itemWidth}px)`}; | ||
transition: transform 0.5s ease-in-out; | ||
transform: ${({ translateX }) => `translateX(${translateX}px)`}; | ||
gap: ${({ gapWidth }) => `${gapWidth}px`}; | ||
`; | ||
|
||
const CarouselViewport = styled.div` | ||
|
@@ -58,12 +97,7 @@ const Blur = styled.div` | |
height: 100%; | ||
width: calc(50vw - 50%); | ||
top: 0; | ||
background: linear-gradient( | ||
to right, | ||
transparent 10px, | ||
${colors.background} 50px, | ||
${colors.background} | ||
); | ||
background: ${colors.background}; | ||
`; | ||
|
||
const LeftBlur = styled(Blur)` | ||
|
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right
를 -1px
로 준 이유는0
으로 주면 크롬 개발자 도구 반응형으로 봤을 때 끝 부분까지 덮이지 않는 것처럼 보이기 때문입니다.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
오호... 왜 안덮히는 걸까요...? 신기하네요..!