-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(blog): 블로그 컴포넌트(header) 작업 중 #35
- Loading branch information
Showing
10 changed files
with
332 additions
and
111 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,71 @@ | ||
import { motion } from 'framer-motion' | ||
import styled from 'styled-components' | ||
import styled, { css } from 'styled-components' | ||
import { breakPoint } from '../../styles/theme' | ||
|
||
export const mediaPadding = css` | ||
padding: 16px 32px; | ||
` | ||
|
||
const Styled = { | ||
rootContainer: styled(motion.header)` | ||
position: fixed; | ||
position: sticky; | ||
top: 0; | ||
left: 0; | ||
z-index: 1; | ||
display: flex; | ||
width: 100%; | ||
`, | ||
mainContainer: styled(motion.div)` | ||
wrapContainer: styled(motion.div)` | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
width: 100%; | ||
max-width: 1536px; | ||
padding: 8px 16px; | ||
${mediaPadding} | ||
width: 100%; | ||
max-width: 1280px; | ||
margin-left: auto; | ||
margin-right: auto; | ||
`, | ||
leftContainer: styled(motion.div)` | ||
flexContainer: styled(motion.div)` | ||
display: flex; | ||
align-items: center; | ||
gap: 8px; | ||
`, | ||
image: styled(motion.img)` | ||
border-radius: 50%; | ||
`, | ||
infoContainer: styled(motion.div)` | ||
anchor: styled(motion.a)` | ||
display: flex; | ||
flex-direction: column; | ||
gap: 8px; | ||
align-items: center; | ||
gap: 4px; | ||
color: inherit; | ||
text-decoration: inherit; | ||
`, | ||
icon: styled(motion.img)` | ||
border-radius: 50%; | ||
width: 32px; | ||
height: 32px; | ||
display: block; | ||
@media screen and (max-width: ${breakPoint.md}px) { | ||
display: none; | ||
} | ||
`, | ||
title: styled(motion.h1)` | ||
margin: 0; | ||
margin-top: auto; | ||
margin-bottom: auto; | ||
font-weight: 600; | ||
`, | ||
subtitle: styled(motion.h2)` | ||
margin: 0; | ||
font-weight: 400; | ||
`, | ||
rigthContainer: styled(motion.div)` | ||
display: flex; | ||
menu: styled(motion.div)` | ||
display: none; | ||
@media screen and (max-width: ${breakPoint.md}px) { | ||
display: flex; | ||
} | ||
`, | ||
search: styled(motion.div)``, | ||
} | ||
|
||
export default Styled |
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,65 @@ | ||
import { ComponentMeta, ComponentStory } from '@storybook/react' | ||
|
||
import Hero from './Hero' | ||
|
||
export default { | ||
title: 'Components/Header/Hero', | ||
component: Hero, | ||
} as ComponentMeta<typeof Hero> | ||
|
||
const Template: ComponentStory<typeof Hero> = (args) => <Hero {...args} /> | ||
|
||
export const Default = Template.bind({}) | ||
Default.args = { | ||
title: 'Hello World', | ||
subtitle: 'This is a subtitle', | ||
image: { | ||
src: 'https://images.unsplash.com/photo-1497316730643-415fac54a2af?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=928&q=80', | ||
alt: 'Photo by Michael Henry', | ||
}, | ||
} | ||
|
||
export const Mobile1 = Template.bind({}) | ||
Mobile1.args = { | ||
title: 'Hello World', | ||
subtitle: 'This is a subtitle', | ||
image: { | ||
src: 'https://images.unsplash.com/photo-1497316730643-415fac54a2af?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=928&q=80', | ||
alt: 'Photo by Michael Henry', | ||
}, | ||
} | ||
Mobile1.parameters = { | ||
viewport: { | ||
defaultViewport: 'mobile1', | ||
}, | ||
} | ||
|
||
export const Mobile2 = Template.bind({}) | ||
Mobile2.args = { | ||
title: 'Hello World', | ||
subtitle: 'This is a subtitle', | ||
image: { | ||
src: 'https://images.unsplash.com/photo-1497316730643-415fac54a2af?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=928&q=80', | ||
alt: 'Photo by Michael Henry', | ||
}, | ||
} | ||
Mobile2.parameters = { | ||
viewport: { | ||
defaultViewport: 'mobile2', | ||
}, | ||
} | ||
|
||
export const Tablet = Template.bind({}) | ||
Tablet.args = { | ||
title: 'Hello World', | ||
subtitle: 'This is a subtitle', | ||
image: { | ||
src: 'https://images.unsplash.com/photo-1497316730643-415fac54a2af?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=928&q=80', | ||
alt: 'Photo by Michael Henry', | ||
}, | ||
} | ||
Tablet.parameters = { | ||
viewport: { | ||
defaultViewport: 'tablet', | ||
}, | ||
} |
Oops, something went wrong.