Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feat/#13] 홈 화면 UI 제작 #14

Merged
merged 8 commits into from
Feb 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@
"group": "type",
"position": "before"
},
{
"pattern": "@/pages/**/*",
"group": "type",
"position": "before"
},
{
"pattern": "@/styles/**/*",
"group": "type",
Expand Down
95 changes: 95 additions & 0 deletions .pnp.cjs

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

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"@tanstack/react-query": "^5.64.2",
"classnames": "^2.5.1",
"react": "^18.3.1",
"react-dom": "^18.3.1"
"react-dom": "^18.3.1",
"react-router-dom": "^7.1.3"
},
"devDependencies": {
"@commitlint/cli": "^19.6.1",
Expand Down
24 changes: 0 additions & 24 deletions src/App.module.scss

This file was deleted.

32 changes: 4 additions & 28 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,34 +1,10 @@
import styles from "./App.module.scss";

import Button from "@/components/ui/Button/Button";
import IconButton from "@/components/ui/IconButton/IconButton";
import Text from "@/components/ui/Text/Text";
import { Outlet } from "react-router-dom";

const App = () => {
return (
<div className={styles.Test}>
<Button variant="primary" text="정보가 맞아요" />
<Button variant="secondary" text="정보가 맞아요" />
<Button variant="tertiary" text="다시 스캔하기" />
<div className={styles.Test2}>
<IconButton text="갤러리" iconName="gallery" />
<IconButton text="카메라" iconName="camera" />
</div>
<div className={styles.Test3}>
<IconButton size="sm" text="복사하기" iconName="paste" />
</div>
<div className={styles.Test3}>
<Text align="center" color="gradient" size="lg" weight="bold">
영수증으로
</Text>
<Text align="center" color="gradient" size="lg" weight="bold">
AI 음식 리뷰 남겨요
</Text>
<Text color="primary" weight="medium">
손쉬운 음식 리뷰 작성
</Text>
</div>
</div>
<main>
<Outlet />
</main>
);
};

Expand Down
Binary file added src/assets/img/img-graphic-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/assets/svg/img-graphic-main.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
58 changes: 58 additions & 0 deletions src/components/Home/Home.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
.Home {
padding-left: 1.25rem;
padding-right: 1.25rem;
padding-bottom: 2.5rem;
height: calc(100vh - 2.75rem);
overflow: hidden;
position: relative;
display: flex;
flex-direction: column;
justify-content: space-between;
background: var(--color-bg-gradient);

&::before {
content: "";
background: url("/src/assets/svg/img-graphic-main.svg") center no-repeat;
background-size: 100% 16.375rem;
filter: blur(4.625rem);
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 0;
}

.HomeTitle {
padding-top: 5rem;
padding-bottom: 1.25rem;

display: flex;
flex-direction: column;
gap: 0.625rem;
z-index: 1;

& > h1 {
white-space: pre-line;
}
}

.HomeImage {
display: flex;
justify-content: center;
align-items: center;
z-index: 1;

& > img {
width: 16.25rem;
height: 16.25rem;
}
}

.HomeBottom {
display: flex;
align-items: center;
gap: 0.875rem;
z-index: 1;
}
}
27 changes: 27 additions & 0 deletions src/components/Home/Home.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import styles from "@/components/Home/Home.module.scss";
import IconButton from "@/components/ui/IconButton/IconButton";
import Text from "@/components/ui/Text/Text";

const Home = () => {
return (
<div className={styles.Home}>
<div className={styles.HomeTitle}>
<Text size="xl" color="gradient" weight="bold" align="center" as="h1">
{`영수증으로\nAI 음식 리뷰 남겨요`}
</Text>
<Text color="secondary" weight="medium" align="center">
손쉬운 음식 리뷰 작성
</Text>
</div>
<div className={styles.HomeImage}>
<img src="/src/assets/img/img-graphic-logo.png" alt="mainLogo" />
</div>
<div className={styles.HomeBottom}>
<IconButton text="갤러리" iconName="gallery" />
<IconButton text="카메라" iconName="camera" />
</div>
</div>
);
};

export default Home;
5 changes: 5 additions & 0 deletions src/components/common/Navbar.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.Navbar {
width: 100%;
height: 2.75rem;
background-color: red;
}
7 changes: 7 additions & 0 deletions src/components/common/Navbar.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import styles from "@/components/common/Navbar.module.scss";

const Navbar = () => {
return <div className={styles.Navbar}>Navbar</div>;
};

export default Navbar;
8 changes: 4 additions & 4 deletions src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import { StrictMode } from "react";
import { createRoot } from "react-dom/client";
import ReactDom from "react-dom/client";

import { ReactQueryDevtools } from "@tanstack/react-query-devtools";

import App from "@/App";
import AppRouter from "@/router/AppRouter";

import ReactQueryClientProvider from "@/components/provider/ReactQueryClientProvider";

import "@/styles/reset.scss";
import "@/styles/global.scss";

createRoot(document.getElementById("root")!).render(
ReactDom.createRoot(document.getElementById("root")!).render(
<StrictMode>
<ReactQueryClientProvider>
<App />
<AppRouter />
<ReactQueryDevtools initialIsOpen={false} />
</ReactQueryClientProvider>
</StrictMode>,
Expand Down
13 changes: 13 additions & 0 deletions src/pages/HomePage.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import Navbar from "@/components/common/Navbar";
import Home from "@/components/Home/Home";

const HomePage = () => {
return (
<>
<Navbar />
<Home />
</>
);
};

export default HomePage;
24 changes: 24 additions & 0 deletions src/router/AppRouter.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { RouterProvider, createBrowserRouter } from "react-router-dom";

import App from "@/App";

import HomePage from "@/pages/HomePage";

const AppRouter = () => {
const router = createBrowserRouter([
{
path: "/",
element: <App />,
children: [
{
path: "",
element: <HomePage />,
},
],
},
]);

return <RouterProvider router={router} />;
};

export default AppRouter;
Loading