-
Notifications
You must be signed in to change notification settings - Fork 355
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
483d6ed
commit d683552
Showing
7 changed files
with
179 additions
and
36 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 |
---|---|---|
|
@@ -2,7 +2,6 @@ | |
"printWidth": 140, | ||
"tabWidth": 2, | ||
"useTabs": false, | ||
"semi": false, | ||
"singleQuote": true, | ||
"trailingComma": "all" | ||
} |
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,123 @@ | ||
import React, { PropsWithChildren } from 'react'; | ||
import styled from 'styled-components'; | ||
import NextImage from 'next/image'; | ||
import { media } from 'utils/media'; | ||
import { Container } from './Container'; | ||
|
||
export interface BasicSectionProps { | ||
imageUrl: string; | ||
title: string; | ||
overTitle: string; | ||
reversed?: boolean; | ||
} | ||
|
||
export default function BasicSection({ imageUrl, title, overTitle, reversed, children }: PropsWithChildren<BasicSectionProps>) { | ||
return ( | ||
<BasicSectionWrapper reversed={reversed}> | ||
<ImageContainer> | ||
<NextImage src={imageUrl} layout="fill" objectFit="cover" /> | ||
</ImageContainer> | ||
<ContentContainer> | ||
<OverTitle>{overTitle}</OverTitle> | ||
<Title>{title}</Title> | ||
<Content>{children}</Content> | ||
</ContentContainer> | ||
</BasicSectionWrapper> | ||
); | ||
} | ||
|
||
const Title = styled.h1` | ||
font-size: 5.2rem; | ||
font-weight: bold; | ||
line-height: 1.1; | ||
margin-bottom: 4rem; | ||
letter-spacing: -0.03em; | ||
${media('<=tablet')} { | ||
font-size: 4.6rem; | ||
margin-bottom: 2rem; | ||
} | ||
`; | ||
|
||
// TODO: wet | ||
const OverTitle = styled.div` | ||
&::before { | ||
position: relative; | ||
bottom: -0.1em; | ||
content: ''; | ||
display: inline-block; | ||
width: 0.9em; | ||
height: 0.9em; | ||
background-color: rgb(var(--primary)); | ||
line-height: 0; | ||
margin-right: 1em; | ||
} | ||
font-size: 1.3rem; | ||
letter-spacing: 0.02em; | ||
font-weight: bold; | ||
line-height: 0; | ||
text-transform: uppercase; | ||
margin-bottom: 2rem; | ||
${media('<=desktop')} { | ||
line-height: 1.5; | ||
} | ||
`; | ||
|
||
const Content = styled.div` | ||
font-size: 1.8rem; | ||
opacity: 0.8; | ||
line-height: 1.6; | ||
${media('<=desktop')} { | ||
font-size: 1.5rem; | ||
} | ||
`; | ||
|
||
const ImageContainer = styled.div` | ||
flex: 1; | ||
position: relative; | ||
&:before { | ||
display: block; | ||
content: ''; | ||
width: 100%; | ||
padding-top: calc((9 / 16) * 100%); | ||
} | ||
& > div { | ||
position: absolute; | ||
top: 0; | ||
right: 0; | ||
bottom: 0; | ||
left: 0; | ||
} | ||
${media('<=desktop')} { | ||
width: 100%; | ||
} | ||
`; | ||
|
||
const ContentContainer = styled.div` | ||
flex: 1; | ||
`; | ||
|
||
type Props = Pick<BasicSectionProps, 'reversed'>; | ||
const BasicSectionWrapper = styled(Container)` | ||
display: flex; | ||
align-items: center; | ||
flex-direction: ${(p: Props) => (p.reversed ? 'row-reverse' : 'row')}; | ||
${ImageContainer} { | ||
margin: ${(p: Props) => (p.reversed ? '0 0 0 5rem' : '0 5rem 0 0')}; | ||
} | ||
${media('<=desktop')} { | ||
flex-direction: column; | ||
${ImageContainer} { | ||
margin: 0 0 2.5rem 0; | ||
} | ||
} | ||
`; |
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,19 +1,39 @@ | ||
import styled from 'styled-components' | ||
import BasicSection from 'components/BasicSection'; | ||
import styled from 'styled-components'; | ||
|
||
import Hero from 'views/HomePage/Hero' | ||
import Partners from 'views/HomePage/Partners' | ||
import Hero from 'views/HomePage/Hero'; | ||
import Partners from 'views/HomePage/Partners'; | ||
|
||
export default function Homepage() { | ||
return ( | ||
<HomepageWrapper> | ||
<Hero /> | ||
<Partners /> | ||
<BasicSection imageUrl="/demo-illustration-1.png" title="Lorem ipsum dolor sit amet consectetur." overTitle="sit amet gogo"> | ||
<p> | ||
Lorem ipsum dolor sit amet consectetur adipisicing elit. Quas, quidem error incidunt a doloremque voluptatem porro inventore | ||
voluptate quo deleniti animi laboriosam. Possimus ullam velit rem itaque consectetur, in distinctio? Lorem ipsum, dolor sit amet | ||
consectetur adipisicing elit. Soluta repellendus quia quos obcaecati nihil. Laudantium non accusantium, voluptate eum nesciunt at | ||
suscipit quis est soluta? | ||
</p> | ||
</BasicSection> | ||
<BasicSection imageUrl="/demo-illustration-2.png" title="Lorem ipsum dolor sit." overTitle="gugu gaga" reversed> | ||
<p> | ||
Lorem ipsum dolor sit amet consectetur adipisicing elit. Quas, quidem error incidunt a doloremque voluptatem porro inventore | ||
voluptate quo deleniti animi laboriosam. Possimus ullam velit rem itaque consectetur, in distinctio?{' '} | ||
</p> | ||
<ul> | ||
<li>Professional point 1</li> | ||
<li>Professional remark 2</li> | ||
<li>Professional feature 3</li> | ||
</ul> | ||
</BasicSection> | ||
</HomepageWrapper> | ||
) | ||
); | ||
} | ||
|
||
const HomepageWrapper = styled.div` | ||
& > * { | ||
margin-top: 10rem; | ||
& > *:not(:first-child) { | ||
margin-top: 15rem; | ||
} | ||
` | ||
`; |
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