-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feature] - 플로팅 버튼에 여행 계획 작성 추가 (#368)
* refactor(FloatingButton): 여행 계획 작성 추가 및 UI 수정 * refactor(FloatingButton): 작성 페이지 반대로 가게끔 되어있는 것 수정 * refactor(zIndex): 수정 * refactor(FloatingButton): subButtonContainer gap 및 padding 수정
- Loading branch information
Showing
3 changed files
with
82 additions
and
17 deletions.
There are no files selected for viewing
54 changes: 47 additions & 7 deletions
54
frontend/src/components/common/FloatingButton/FloatingButton.styled.ts
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,20 +1,60 @@ | ||
import { css } from "@emotion/react"; | ||
import styled from "@emotion/styled"; | ||
|
||
import theme from "@styles/theme"; | ||
import { PRIMITIVE_COLORS } from "@styles/tokens"; | ||
|
||
export const registerButtonStyle = css` | ||
export const FloatingButtonContainer = styled.div` | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
flex-direction: column; | ||
align-items: flex-end; | ||
position: fixed; | ||
right: max(2rem, calc(50% - 48rem / 2 + 2rem)); | ||
right: max(0vw + 2rem, calc(50vw - 22rem)); | ||
bottom: 2rem; | ||
z-index: ${theme.zIndex.floatingButton}; | ||
z-index: ${({ theme }) => theme.zIndex.floatingButton}; | ||
gap: ${({ theme }) => theme.spacing.s}; | ||
`; | ||
|
||
export const SubButtonContainer = styled.div<{ $isOpen: boolean }>` | ||
display: flex; | ||
flex-direction: column; | ||
align-items: flex-start; | ||
width: 15rem; | ||
padding: ${({ theme }) => theme.spacing.l} ${({ theme }) => theme.spacing.m}; | ||
border-radius: ${({ theme }) => theme.spacing.s}; | ||
background-color: ${PRIMITIVE_COLORS.gray[700]}; | ||
gap: ${({ theme }) => theme.spacing.l}; | ||
transition: all 0.3s ease-out; | ||
${({ $isOpen }) => css` | ||
opacity: ${$isOpen ? 1 : 0}; | ||
transform: translateY(${$isOpen ? 0 : 2}rem); | ||
pointer-events: ${$isOpen ? "auto" : "none"}; | ||
`} | ||
`; | ||
|
||
export const MainButtonWrapper = styled.div<{ $isOpen: boolean }>` | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
width: 6rem; | ||
height: 6rem; | ||
border-radius: 50%; | ||
box-shadow: 0 2px 4px rgb(0 0 0 / 20%); | ||
background-color: ${theme.colors.primary}; | ||
background-color: ${({ $isOpen, theme }) => | ||
$isOpen ? PRIMITIVE_COLORS.gray[700] : theme.colors.primary}; | ||
transition: transform 0.3s ease-out; | ||
transform: ${({ $isOpen }) => ($isOpen ? "rotate(45deg)" : "rotate(0)")}; | ||
cursor: pointer; | ||
`; | ||
|
||
export const subButtonTextStyle = css` | ||
color: ${PRIMITIVE_COLORS.white}; | ||
`; |
39 changes: 32 additions & 7 deletions
39
frontend/src/components/common/FloatingButton/FloatingButton.tsx
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