|
@@ -1,9 +1,11 @@
|
|
|
import styled from '@emotion/styled'
|
|
|
|
|
|
-import { Searchbar, Icon } from '@/shared/components'
|
|
|
+import { Icon, Searchbar } from '@/shared/components'
|
|
|
import { colors, sizes } from '@/shared/theme'
|
|
|
import { ReactComponent as UnstyledLogo } from '@/assets/logo.svg'
|
|
|
|
|
|
+const BREAKPOINT = '600px'
|
|
|
+
|
|
|
type NavbarStyleProps = {
|
|
|
hasFocus: boolean
|
|
|
}
|
|
@@ -16,18 +18,28 @@ export const Logo = styled(UnstyledLogo)`
|
|
|
export const NavigationContainer = styled.div`
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
+ margin-right: ${sizes.b3}px;
|
|
|
+
|
|
|
> * + * {
|
|
|
- margin-left: ${sizes.b6}px;
|
|
|
+ margin-left: ${sizes.b3}px;
|
|
|
+ @media screen and (min-width: ${BREAKPOINT}) {
|
|
|
+ margin-left: ${sizes.b6}px;
|
|
|
+ }
|
|
|
}
|
|
|
`
|
|
|
|
|
|
export const StyledSearchbar = styled(Searchbar)`
|
|
|
- transition: width 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
|
|
|
- will-change: width;
|
|
|
+ transition: max-width 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
|
|
|
+ will-change: max-width;
|
|
|
`
|
|
|
export const SearchbarContainer = styled.div`
|
|
|
display: flex;
|
|
|
justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+
|
|
|
+ justify-self: center;
|
|
|
+ width: 100%;
|
|
|
+ max-width: 1156px;
|
|
|
`
|
|
|
export const StyledIcon = styled(Icon)`
|
|
|
color: ${colors.gray[300]};
|
|
@@ -39,14 +51,20 @@ export const StyledIcon = styled(Icon)`
|
|
|
|
|
|
export const Header = styled.header<NavbarStyleProps>`
|
|
|
display: grid;
|
|
|
- grid-template-columns: 1fr 3fr 1fr;
|
|
|
width: 100%;
|
|
|
- padding: ${(props) => (props.hasFocus ? `${sizes.b2}px` : `${sizes.b3}px ${sizes.b8}px`)};
|
|
|
+
|
|
|
+ grid-template-columns: ${({ hasFocus }) => (hasFocus ? '1fr' : '1fr 2fr')};
|
|
|
+ padding: ${(props) => (props.hasFocus ? `${sizes.b2}px` : `${sizes.b2}px ${sizes.b4}px`)};
|
|
|
+ @media screen and (min-width: ${BREAKPOINT}) {
|
|
|
+ grid-template-columns: ${({ hasFocus }) => (hasFocus ? '1fr' : '1fr 2fr 1fr')};
|
|
|
+ padding: ${(props) => (props.hasFocus ? `${sizes.b2}px` : `${sizes.b3}px ${sizes.b8}px`)};
|
|
|
+ }
|
|
|
border-bottom: 1px solid ${colors.gray[800]};
|
|
|
background-color: ${(props) => (props.hasFocus ? colors.gray[900] : colors.black)};
|
|
|
transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
|
|
|
|
|
|
${StyledSearchbar} {
|
|
|
- width: ${(props) => (props.hasFocus ? '1156px' : '385px')};
|
|
|
+ width: 100%;
|
|
|
+ max-width: ${(props) => (props.hasFocus ? '100%' : '385px')};
|
|
|
}
|
|
|
`
|