Skip to content

Commit

Permalink
FEAT :: 첫 화면 완성(반응형 x)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsm8109jsm committed Mar 26, 2023
1 parent 5913a5e commit 856b82f
Show file tree
Hide file tree
Showing 17 changed files with 233 additions and 7 deletions.
13 changes: 13 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"presets": ["next/babel"],
"plugins": [
[
"styled-components",
{
"ssr": true,
"displayName": true,
"preprocess": true
}
]
]
}
29 changes: 29 additions & 0 deletions components/Landing/LandingContents/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import RecipeButton from "@/components/etc/Button/RecipeButton";
import React from "react";
import * as S from "./style";

function LandingContents() {
return (
<>
<S.LandingContents>
<S.MainWrapper>
<S.Title>Recipe GPT</S.Title>
<div>
<S.Description>가지고 있는 재료로</S.Description>
<S.Description>요리할 수 있는 레시피를</S.Description>
<S.Description>확인해보세요!</S.Description>
</div>
<RecipeButton>레시피 확인하기</RecipeButton>
</S.MainWrapper>
<S.Fryfan
src="./images/frypan.svg"
alt="프라이팬 사진"
width={650}
height={650}
/>
</S.LandingContents>
</>
);
}

export default LandingContents;
43 changes: 43 additions & 0 deletions components/Landing/LandingContents/style.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import Image from "next/image";
import styled from "styled-components";

export const LandingContents = styled.div`
backdrop-filter: blur(20px);
position: absolute;
left: 50%;
width: calc(100% - 300px);
top: 100px;
transform: translateX(-50%);
background: rgba(255, 255, 255, 0.2);
border-radius: 50px 50px 0px 0px;
padding: 9.5rem 6.5rem;
`;

export const MainWrapper = styled.div`
display: inline-flex;
flex-direction: column;
align-items: flex-start;
gap: 4rem;
`;

export const Title = styled.h1`
font-size: 4.5rem;
font-weight: bold;
color: white;
margin: 0;
letter-spacing: -0.9px;
`;

export const Description = styled.h3`
margin: 0;
letter-spacing: -0.9px;
font-weight: bold;
color: white;
font-size: 4rem;
`

export const Fryfan = styled(Image)`
position: absolute;
top: 0;
right: -10rem;
`;
19 changes: 19 additions & 0 deletions components/Landing/LandingMain/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import Image from "next/image";
import React from "react";
import * as S from "./style";

function LandingMain() {
return (
<>
<S.MainBackground>
<S.MainBackgroundImage
alt="메인 화면 디자인 사진"
src="./images/MainBackground.svg"
fill
/>
</S.MainBackground>
</>
);
}

export default LandingMain;
20 changes: 20 additions & 0 deletions components/Landing/LandingMain/style.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import styled from "styled-components";
import Image from "next/image";

export const MainBackground = styled.div`
width: 100%;
position: relative;
`;

export const MainBackgroundImage = styled(Image)`
height: auto !important;
position: relative !important;
filter: blur(10px);
`;

export const BackgroundBlur = styled.div`
width: 100%;
height: 100px;
position: absolute;
top: 0;
`;
16 changes: 16 additions & 0 deletions components/Landing/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import React from "react";
import LandingContents from "./LandingContents";
import LandingMain from "./LandingMain";

function Landing() {
return (
<>
<LandingMain />
<LandingMain />
<LandingMain />
<LandingContents />
</>
);
}

export default Landing;
14 changes: 14 additions & 0 deletions components/etc/Button/RecipeButton/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import React from "react";
import * as S from "./style";
import { HiChevronRight } from "react-icons/hi";

function RecipeButton({ children }: { children: string }) {
return (
<S.RecipeButton>
{children}
<HiChevronRight size={40}/>
</S.RecipeButton>
);
}

export default RecipeButton;
14 changes: 14 additions & 0 deletions components/etc/Button/RecipeButton/style.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import styled from "styled-components";

export const RecipeButton = styled.button`
background-color: #1c1b17;
padding: 1.5rem 1.5rem 1.5rem 2.5rem;
color: white;
display: inline-flex;
font-size: 2rem;
border-radius: 30px 30px 0 30px;
border: none;
justify-content: space-between;
align-items: center;
width: 23rem;
`;
9 changes: 6 additions & 3 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
}
reactStrictMode: false,
compiler: {
styledComponents: true,
},
};

module.exports = nextConfig
module.exports = nextConfig;
10 changes: 10 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@
"@types/react": "18.0.29",
"@types/react-dom": "18.0.11",
"@types/styled-components": "^5.1.26",
"babel-plugin-styled-components": "^2.0.7",
"eslint": "8.36.0",
"eslint-config-next": "13.2.4",
"next": "13.2.4",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-icons": "^4.8.0",
"styled-components": "^5.3.9",
"styled-normalize": "^8.0.7",
"typescript": "5.0.2"
Expand Down
10 changes: 9 additions & 1 deletion pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
import type { AppProps } from "next/app";
import { ThemeProvider } from "styled-components";
import { theme } from "@/styles/theme";
import GlobalStyle from "@/styles/globals";

export default function App({ Component, pageProps }: AppProps) {
return <Component {...pageProps} />;
return (
<ThemeProvider theme={theme}>
<Component {...pageProps} />
<GlobalStyle />
</ThemeProvider>
);
}
2 changes: 1 addition & 1 deletion pages/_document.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Html, Head, Main, NextScript } from 'next/document'

export default function Document() {
return (
<Html lang="en">
<Html lang="ko">
<Head />
<body>
<Main />
Expand Down
12 changes: 11 additions & 1 deletion pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
import Landing from "@/components/Landing";
import Head from "next/head";

export default function Home() {
return <></>;
return (
<>
<Head>
<title>Recipe GPT</title>
</Head>
<Landing />
</>
);
}
File renamed without changes
10 changes: 10 additions & 0 deletions public/images/frypan.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 16 additions & 1 deletion styles/globals.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,22 @@ const GlobalStyle = createGlobalStyle`
* {
box-sizing: border-box;
font-family: 'NanumSquare', sans-serif;
font-family: 'Pretendard-Regular';
}
@font-face {
font-family: 'Pretendard-Regular';
src: url('https://cdn.jsdelivr.net/gh/Project-Noonnu/[email protected]/Pretendard-Regular.woff') format('woff');
font-weight: 400;
font-style: normal;
}
html{
font-size: 14px;
}
body{
margin: 0;
}
button{
Expand Down

0 comments on commit 856b82f

Please sign in to comment.