-
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 #296 from sharemindteam/feat/edit_background_290
[Feature] 셰어마인드 어플리케이션 배경 이미지 추가
- Loading branch information
Showing
10 changed files
with
214 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
import React from 'react'; | ||
import backgroundImage from 'assets/background/background.png'; | ||
import backgroundLogoImage from 'assets/background/background_logo.png'; | ||
import backgroundTextImage from 'assets/background/background_text.png'; | ||
import backgroundIconsImage from 'assets/background/background_sub_icons.png'; | ||
import backgroundButtonImage from 'assets/background/background_button.png'; | ||
|
||
import styled from 'styled-components'; | ||
import { Green } from 'styles/color'; | ||
import { Flex } from 'components/Common/Flex'; | ||
import { useNavigate } from 'react-router-dom'; | ||
// | ||
// | ||
// | ||
|
||
interface AppLayoutProps { | ||
children: React.ReactNode; | ||
} | ||
|
||
// | ||
// | ||
// | ||
|
||
const BACKGROUND_LEFT_RIGHT_RATIO = 3; | ||
|
||
const GROUND_HEIGHT = '24rem'; | ||
|
||
const LAYOUT_STYLES = { | ||
width: '100vw', | ||
height: '100vh', | ||
display: 'flex', | ||
backgroundImage: `url(${backgroundImage})`, | ||
backgroundSize: 'cover', | ||
backgroundPosition: 'center', | ||
backgroundRepeat: 'no-repeat', | ||
}; | ||
|
||
const LeftSection = styled.div` | ||
position: relative; | ||
flex: ${BACKGROUND_LEFT_RIGHT_RATIO}; | ||
display: flex; | ||
justify-content: center; | ||
`; | ||
|
||
const RightSection = styled.div` | ||
position: relative; | ||
flex: 1; | ||
flex-direction: column; | ||
`; | ||
|
||
const IconWrapper = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: space-between; | ||
max-width: 40rem; | ||
padding: 0; | ||
@media (min-width: 768px) { | ||
padding: 0 2rem; | ||
} | ||
`; | ||
|
||
const ButtonWrapper = styled.div` | ||
max-width: 40rem; | ||
padding: 0; | ||
@media (min-width: 768px) { | ||
padding: 0 2rem; | ||
} | ||
`; | ||
|
||
const StyledImg = styled.img` | ||
max-width: 100%; | ||
height: auto; | ||
`; | ||
|
||
const BottomGreenBox = styled.div` | ||
position: absolute; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
width: 100%; | ||
height: ${GROUND_HEIGHT}; | ||
bottom: 0; | ||
background-color: ${Green}; | ||
`; | ||
|
||
// | ||
// | ||
// | ||
|
||
const AppLayout = ({ children }: AppLayoutProps) => { | ||
const navigate = useNavigate(); | ||
|
||
// | ||
// | ||
// | ||
|
||
return ( | ||
<div style={LAYOUT_STYLES}> | ||
<LeftSection> | ||
<IconWrapper> | ||
<Flex direction="column" gap="1rem" style={{ flex: 1 }}> | ||
<StyledImg src={backgroundTextImage} alt="bg-text" /> | ||
<StyledImg src={backgroundLogoImage} alt="bg-logo" /> | ||
</Flex> | ||
<StyledImg | ||
src={backgroundIconsImage} | ||
alt="bg-icons" | ||
style={{ marginBottom: GROUND_HEIGHT }} | ||
/> | ||
</IconWrapper> | ||
<BottomGreenBox> | ||
<ButtonWrapper> | ||
<StyledImg | ||
src={backgroundButtonImage} | ||
alt="bg-button" | ||
onClick={() => { | ||
navigate('/service'); | ||
}} | ||
/> | ||
</ButtonWrapper> | ||
</BottomGreenBox> | ||
</LeftSection> | ||
<div style={{ flex: 1 }}>{children}</div> | ||
<RightSection> | ||
<BottomGreenBox /> | ||
</RightSection> | ||
</div> | ||
); | ||
}; | ||
|
||
export default AppLayout; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -0,0 +1,71 @@ | ||
import styled, { CSSProperties } from 'styled-components'; | ||
|
||
// | ||
// | ||
// | ||
|
||
interface FlexProps extends FlexBaseProps { | ||
children: React.ReactNode; | ||
className?: string; | ||
style?: CSSProperties; | ||
} | ||
|
||
interface FlexBaseProps { | ||
height?: string; | ||
width?: string; | ||
direction?: 'row' | 'row-reverse' | 'column' | 'column-reverse'; | ||
justify?: | ||
| 'flex-start' | ||
| 'flex-end' | ||
| 'center' | ||
| 'space-between' | ||
| 'space-around' | ||
| 'space-evenly'; | ||
align?: 'stretch' | 'flex-start' | 'flex-end' | 'center' | 'baseline'; | ||
gap?: number | string; | ||
wrap?: 'nowrap' | 'wrap' | 'wrap-reverse'; | ||
} | ||
|
||
// | ||
// | ||
// | ||
|
||
export const Flex = ({ | ||
children, | ||
width = 'auto', | ||
height = 'auto', | ||
direction = 'row', | ||
justify = 'center', | ||
align = 'center', | ||
gap = 0, | ||
wrap = 'nowrap', | ||
className, | ||
style, | ||
}: FlexProps) => { | ||
return ( | ||
<FlexBase | ||
height={height} | ||
direction={direction} | ||
justify={justify} | ||
align={align} | ||
gap={gap} | ||
width={width} | ||
wrap={wrap} | ||
className={className} | ||
style={style} | ||
> | ||
{children} | ||
</FlexBase> | ||
); | ||
}; | ||
|
||
const FlexBase = styled.div<FlexBaseProps>` | ||
display: flex; | ||
height: ${({ height }) => height}; | ||
width: ${({ width }) => width}; | ||
flex-direction: ${({ direction }) => direction}; | ||
justify-content: ${({ justify }) => justify}; | ||
align-items: ${({ align }) => align}; | ||
gap: ${({ gap }) => `${gap}`}; | ||
flex-wrap: ${({ wrap }) => wrap}; | ||
`; |
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