diff --git a/my-app/components/button/button-type.js b/my-app/components/button/button-type.js new file mode 100644 index 00000000..1ee54688 --- /dev/null +++ b/my-app/components/button/button-type.js @@ -0,0 +1,7 @@ +const BUTTON_TYPE = Object.freeze({ + add: "add", + edit: "edit", + delete: "delete", +}); + +export { BUTTON_TYPE }; diff --git a/my-app/components/button/button.jsx b/my-app/components/button/button.jsx new file mode 100644 index 00000000..83236c94 --- /dev/null +++ b/my-app/components/button/button.jsx @@ -0,0 +1,27 @@ +import { BUTTON_TYPE } from "./button-type"; +import styles from "./button.module.css"; + +const className = { + [BUTTON_TYPE.add]: `${styles.button} ${styles.add}`, + [BUTTON_TYPE.edit]: `${styles.button} ${styles.edit}`, + [BUTTON_TYPE.delete]: `${styles.button} ${styles.delete}`, +}; + +const leadingIcon = { + [BUTTON_TYPE.add]: "/icons/ic-plus.svg", + [BUTTON_TYPE.edit]: "/icons/ic-check.svg", + [BUTTON_TYPE.delete]: "/icons/ic-xmark-white.svg", +}; + +function Button({ children, type = BUTTON_TYPE.add, ...props }) { + return ( + + ); +} + +export default Button; diff --git a/my-app/components/button/button.module.css b/my-app/components/button/button.module.css new file mode 100644 index 00000000..df652dcb --- /dev/null +++ b/my-app/components/button/button.module.css @@ -0,0 +1,42 @@ +.button { + color: var(--color-state-900); + background-color: var(--color-state-200); + padding: 18px 40px; + border: 2px solid var(--color-state-900); + border-radius: 24px; + box-shadow: 4px 4px 0px var(--color-state-900); + font-size: 16px; + font-weight: 700; + line-height: 100%; + cursor: pointer; + display: flex; + align-items: center; + gap: 4px; + white-space: nowrap; +} +.button .trailingIcon { + width: 16px; + height: 16px; +} +.button .trailingIcon img { + width: 100%; + height: 100%; +} + +.button.add:active { + color: white; + background-color: var(--color-violet-600); +} +.button.add:active img { + filter: invert(100%) sepia(14%) saturate(1801%) hue-rotate(190deg) + brightness(116%) contrast(101%); +} + +.button.edit:active { + background-color: var(--color-lime-300); +} + +.button.delete { + color: white; + background-color: var(--color-rose-500); +} diff --git a/my-app/components/color/color.js b/my-app/components/color/color.js new file mode 100644 index 00000000..b198fb49 --- /dev/null +++ b/my-app/components/color/color.js @@ -0,0 +1,30 @@ +function colorVariable(name, shade) { + return `var(--color-${name}-${Math.max(100, Math.min(900, shade))})`; +} + +const Colors = { + state: { + 100: colorVariable("state", 100), + 200: colorVariable("state", 200), + 300: colorVariable("state", 300), + 400: colorVariable("state", 400), + 500: colorVariable("state", 500), + 800: colorVariable("state", 800), + 900: colorVariable("state", 900), + }, + violet: { + 100: colorVariable("violet", 100), + 600: colorVariable("violet", 600), + }, + rose: { + 500: colorVariable("rose", 500), + }, + lime: { + 300: colorVariable("lime", 300), + }, + amber: { + 800: colorVariable("amber", 800), + }, +}; + +export default Colors; diff --git a/my-app/components/input/search-input.jsx b/my-app/components/input/search-input.jsx new file mode 100644 index 00000000..4c51fffd --- /dev/null +++ b/my-app/components/input/search-input.jsx @@ -0,0 +1,11 @@ +import styles from "./search-input.module.css"; + +function SearchInput({ ...props }) { + return ( +
+ +
+ ); +} + +export default SearchInput; diff --git a/my-app/components/input/search-input.module.css b/my-app/components/input/search-input.module.css new file mode 100644 index 00000000..61d3ba10 --- /dev/null +++ b/my-app/components/input/search-input.module.css @@ -0,0 +1,24 @@ +.searchInput { + width: 100%; + background-color: var(--color-state-100); + padding: 16px 24px; + border: 2px solid var(--color-state-900); + border-radius: 24px; + box-shadow: 4px 4px 0px var(--color-state-900); +} +.searchInput input { + background: none; + border: none; + outline: none; + width: 100%; + font-size: 16px; + font-weight: 400; + line-height: 100%; + color: var(--color-state-900); +} +.searchInput input::placeholder { + font-size: 16px; + font-weight: 400; + line-height: 100%; + color: var(--color-state-500); +} diff --git a/my-app/components/nav-bar/global-nav-bar.jsx b/my-app/components/nav-bar/global-nav-bar.jsx new file mode 100644 index 00000000..bc5bdae0 --- /dev/null +++ b/my-app/components/nav-bar/global-nav-bar.jsx @@ -0,0 +1,22 @@ +import Link from "next/link"; +import styles from "./global-nav-bar.module.css"; + +function GlobalNavBar() { + return ( + + ); +} + +export default GlobalNavBar; diff --git a/my-app/components/nav-bar/global-nav-bar.module.css b/my-app/components/nav-bar/global-nav-bar.module.css new file mode 100644 index 00000000..d4dd5264 --- /dev/null +++ b/my-app/components/nav-bar/global-nav-bar.module.css @@ -0,0 +1,31 @@ +.globalNavBar { + height: 60px; + background-color: white; + padding: 0 200px; + border-bottom: 1px solid var(--color-state-200); +} + +.globalNavBar .content { + max-width: 1200px; + height: 100%; + margin: 0 auto; + display: flex; + align-items: center; +} + +@media (max-width: 1199px) { + .globalNavBar { + padding: 0 24px; + } + + .globalNavBar .content { + max-width: none; + margin: 0; + } +} + +@media (max-width: 743px) { + .globalNavBar { + padding: 0 16px; + } +} diff --git a/my-app/components/portal/portal.jsx b/my-app/components/portal/portal.jsx new file mode 100644 index 00000000..c80ef1ab --- /dev/null +++ b/my-app/components/portal/portal.jsx @@ -0,0 +1,15 @@ +import { useEffect, useState } from "react"; +import { createPortal } from "react-dom"; + +function Portal({ children }) { + const [container, setContainer] = useState(null); + + useEffect(() => { + // setContainer(document.getElementById("portal")); + setContainer(document.body); + }, []); + + return container && createPortal(children, container); +} + +export default Portal; diff --git a/my-app/components/todo/todo-label.jsx b/my-app/components/todo/todo-label.jsx new file mode 100644 index 00000000..137f8091 --- /dev/null +++ b/my-app/components/todo/todo-label.jsx @@ -0,0 +1,12 @@ +import styles from "./todo-label.module.css"; + +function TodoLabel({ done }) { + let className = styles.todoLabel; + if (done) { + className += ` ${styles.done}`; + } + + return {done ? "DONE" : "TO DO"}; +} + +export default TodoLabel; diff --git a/my-app/components/todo/todo-label.module.css b/my-app/components/todo/todo-label.module.css new file mode 100644 index 00000000..ca617b9a --- /dev/null +++ b/my-app/components/todo/todo-label.module.css @@ -0,0 +1,15 @@ +.todoLabel { + background-color: var(--color-lime-300); + color: var(--color-green-700); + font-family: "HsSantoki20"; + font-size: 18px; + font-weight: 400; + line-height: 100%; + padding: 6px 27px; + border-radius: 24px; +} + +.todoLabel.done { + background-color: var(--color-green-700); + color: var(--color-amber-300); +} diff --git a/my-app/components/todo/todo-list.jsx b/my-app/components/todo/todo-list.jsx new file mode 100644 index 00000000..79b6968d --- /dev/null +++ b/my-app/components/todo/todo-list.jsx @@ -0,0 +1,38 @@ +import TodoLabel from "./todo-label"; +import styles from "./todo-list.module.css"; + +function EmptyMessage({ children }) { + const chunks = children.split("\n"); + let messageChunks = []; + for (const chunk of chunks) { + messageChunks.push({chunk}); + messageChunks.push(
); + } + messageChunks.pop(); + return

{messageChunks}

; +} + +function TodoList({ done = false, children }) { + const emptyMessage = done + ? "아직 다 한 일이 없어요.\n해야 할 일을 체크해보세요!" + : "할 일이 없어요.\nTODO를 새롭게 추가해주세요!"; + + return ( +
+ + {children.length > 0 ? ( +
{children}
+ ) : ( +
+ empty + {emptyMessage} +
+ )} +
+ ); +} + +export default TodoList; diff --git a/my-app/components/todo/todo-list.module.css b/my-app/components/todo/todo-list.module.css new file mode 100644 index 00000000..4eb1e906 --- /dev/null +++ b/my-app/components/todo/todo-list.module.css @@ -0,0 +1,32 @@ +.todoList { + width: 100%; + display: flex; + flex-direction: column; + align-items: flex-start; + gap: 16px; +} + +.todoListContent { + width: 100%; + display: flex; + flex-direction: column; + gap: 16px; +} + +.todoListEmptyContainer { + width: 100%; + display: flex; + flex-direction: column; + align-items: center; +} +.todoListEmptyContainer img { + aspect-ratio: 1 / 1; +} +.todoListEmptyContainer p { + margin: 0; + font-size: 16px; + font-weight: 700; + line-height: 100%; + color: var(--color-state-400); + text-align: center; +} diff --git a/my-app/components/todo/todo.jsx b/my-app/components/todo/todo.jsx new file mode 100644 index 00000000..b0409c63 --- /dev/null +++ b/my-app/components/todo/todo.jsx @@ -0,0 +1,23 @@ +import styles from "./todo.module.css"; + +function Todo({ children, checked = false, ...props }) { + let className = styles.todo; + if (checked) { + className += ` ${styles.checked}`; + } + + const checkImage = checked + ? "/images/checkbox-checked.svg" + : "/images/checkbox.svg"; + + return ( +
+
+ check +
+

{children}

+
+ ); +} + +export default Todo; diff --git a/my-app/components/todo/todo.module.css b/my-app/components/todo/todo.module.css new file mode 100644 index 00000000..c0b5dd49 --- /dev/null +++ b/my-app/components/todo/todo.module.css @@ -0,0 +1,33 @@ +.todo { + background-color: white; + border: 2px solid var(--color-state-900); + border-radius: 27px; + font-size: 16px; + font-weight: 400; + line-height: 100%; + color: var(--color-state-800); + display: flex; + align-items: center; + gap: 16px; + height: 50px; + padding: 9px 12px; + cursor: pointer; +} +.todo.checked { + background-color: var(--color-violet-100); + text-decoration: line-through; +} + +.todo .checkImage { + width: 32px; + height: 32px; +} + +.todo .checkImage img { + width: 100%; + height: 100%; +} + +.todo .title { + flex-grow: 1; +} diff --git a/my-app/hooks/use-async-call.js b/my-app/hooks/use-async-call.js new file mode 100644 index 00000000..2253ba92 --- /dev/null +++ b/my-app/hooks/use-async-call.js @@ -0,0 +1,17 @@ +const { useState } = require("react"); + +export function useAsyncCall() { + const [isLoading, setLoading] = useState(false); + + const execute = async (callback) => { + setLoading(true); + try { + const result = await callback(); + return result; + } finally { + setLoading(false); + } + }; + + return [isLoading, execute]; +} diff --git a/my-app/libs/apis/client.js b/my-app/libs/apis/client.js new file mode 100644 index 00000000..8dbe0121 --- /dev/null +++ b/my-app/libs/apis/client.js @@ -0,0 +1,47 @@ +class Client { + constructor(baseUrl = process.env.NEXT_PUBLIC_BASE_URL) { + this.baseUrl = baseUrl; + } + + createFetchInput(endpoint) { + return `${this.baseUrl}/${endpoint.replace()}`; + } + + async get(endpoint) { + const response = await fetch(this.createFetchInput(endpoint)); + if (!response.ok) { + throw new Error(`Error fetching ${endpoint}: ${response.statusText}`); + } + return response.json(); + } + + async post(endpoint, data) { + const response = await fetch(this.createFetchInput(endpoint), { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify(data), + }); + if (!response.ok) { + throw new Error(`Error posting ${endpoint}: ${response.statusText}`); + } + return response.json(); + } + + async patch(endpoint, data) { + const response = await fetch(this.createFetchInput(endpoint), { + method: "PATCH", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify(data), + }); + if (!response.ok) { + throw new Error(`Error patching ${endpoint}: ${response.statusText}`); + } + return response.json(); + } +} + +export default Client; diff --git a/my-app/libs/apis/todo.js b/my-app/libs/apis/todo.js new file mode 100644 index 00000000..a7182597 --- /dev/null +++ b/my-app/libs/apis/todo.js @@ -0,0 +1,33 @@ +import Client from "./client"; + +export async function getTodos() { + try { + const client = new Client(); + const items = await client.get("items"); + return items; + } catch (error) { + return []; + } +} + +export async function addTodo(name) { + try { + const client = new Client(); + const newItem = await client.post(`items`, { name }); + return newItem; + } catch (error) { + return null; + } +} + +export async function toggleTodo(todo) { + try { + const client = new Client(); + const updatedItem = await client.patch(`items/${todo.id}`, { + isCompleted: !todo.isCompleted, + }); + return updatedItem; + } catch (error) { + return null; + } +} diff --git a/my-app/pages/_document.js b/my-app/pages/_document.js index b2fff8b4..e1696de9 100644 --- a/my-app/pages/_document.js +++ b/my-app/pages/_document.js @@ -1,9 +1,21 @@ -import { Html, Head, Main, NextScript } from "next/document"; +import { Head, Html, Main, NextScript } from "next/document"; export default function Document() { return ( - - + + + Do It + + + +
diff --git a/my-app/pages/index.js b/my-app/pages/index.js index d3f2c809..b2ae02c6 100644 --- a/my-app/pages/index.js +++ b/my-app/pages/index.js @@ -1,117 +1,103 @@ -import Head from "next/head"; -import Image from "next/image"; -import { Geist, Geist_Mono } from "next/font/google"; -import styles from "@/styles/Home.module.css"; +import Button from "@/components/button/button"; +import { BUTTON_TYPE } from "@/components/button/button-type"; +import SearchInput from "@/components/input/search-input"; +import GlobalNavBar from "@/components/nav-bar/global-nav-bar"; +import Portal from "@/components/portal/portal"; +import Todo from "@/components/todo/todo"; +import TodoList from "@/components/todo/todo-list"; +import { useAsyncCall } from "@/hooks/use-async-call"; +import { addTodo, getTodos, toggleTodo } from "@/libs/apis/todo"; +import styles from "@/styles/home.module.css"; +import { useMemo, useState } from "react"; -const geistSans = Geist({ - variable: "--font-geist-sans", - subsets: ["latin"], -}); +export async function getServerSideProps() { + const todos = await getTodos(); + return { props: { todos } }; +} + +export default function Home({ todos: initialTodos }) { + const [inputValue, setInputValue] = useState(""); + const [todos, setTodos] = useState(initialTodos ?? []); + const [isLoading, execute] = useAsyncCall(); + + const canAdd = useMemo(() => inputValue.trim().length > 0, [inputValue]); + + const inProgressTodos = todos + .filter((todo) => !todo.isCompleted) + .sort((a, b) => a.id - b.id); + const doneTodos = todos + .filter((todo) => todo.isCompleted) + .sort((a, b) => a.id - b.id); + + const handleInputChange = (event) => { + setInputValue(event.target.value); + }; + + const handleAddClick = async (event) => { + event.preventDefault(); + execute(async () => { + const newTodo = await addTodo(inputValue); + setTodos((prev) => [...prev, newTodo]); + setInputValue(""); + }); + }; -const geistMono = Geist_Mono({ - variable: "--font-geist-mono", - subsets: ["latin"], -}); + const handleToDoClick = async (todo) => { + execute(async () => { + const updatedTodo = await toggleTodo(todo); + setTodos((prevTodos) => { + const index = prevTodos.findIndex( + (prevTodo) => prevTodo.id === todo.id + ); + let newTodos = [...prevTodos]; + newTodos[index] = updatedTodo; + return newTodos; + }); + }); + }; -export default function Home() { return ( <> - - Create Next App - - - - -
-
- Next.js logo -
    -
  1. - Get started by editing pages/index.js. -
  2. -
  3. Save and see your changes instantly.
  4. -
- -
- - Vercel logomark - Deploy now - - +
+
+
+ + +
+
+ + {inProgressTodos.map((todo) => ( + handleToDoClick(todo)}> + {todo.name} + + ))} + + + {doneTodos.map((todo) => ( + handleToDoClick(todo)} + > + {todo.name} + + ))} +
-
- -
+
+
+ {isLoading &&
}
); } diff --git a/my-app/public/favicon.ico b/my-app/public/favicon.ico deleted file mode 100644 index 718d6fea..00000000 Binary files a/my-app/public/favicon.ico and /dev/null differ diff --git a/my-app/public/file.svg b/my-app/public/file.svg deleted file mode 100644 index 004145cd..00000000 --- a/my-app/public/file.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/my-app/public/globe.svg b/my-app/public/globe.svg deleted file mode 100644 index 567f17b0..00000000 --- a/my-app/public/globe.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/my-app/public/icons/ic-check.svg b/my-app/public/icons/ic-check.svg new file mode 100644 index 00000000..c1f426d3 --- /dev/null +++ b/my-app/public/icons/ic-check.svg @@ -0,0 +1,3 @@ + + + diff --git a/my-app/public/icons/ic-plus-white.svg b/my-app/public/icons/ic-plus-white.svg new file mode 100644 index 00000000..2ec289e9 --- /dev/null +++ b/my-app/public/icons/ic-plus-white.svg @@ -0,0 +1,4 @@ + + + + diff --git a/my-app/public/icons/ic-plus.svg b/my-app/public/icons/ic-plus.svg new file mode 100644 index 00000000..935663bd --- /dev/null +++ b/my-app/public/icons/ic-plus.svg @@ -0,0 +1,4 @@ + + + + diff --git a/my-app/public/icons/ic-xmark-white.svg b/my-app/public/icons/ic-xmark-white.svg new file mode 100644 index 00000000..c054bbcb --- /dev/null +++ b/my-app/public/icons/ic-xmark-white.svg @@ -0,0 +1,4 @@ + + + + diff --git a/my-app/public/images/checkbox-checked.svg b/my-app/public/images/checkbox-checked.svg new file mode 100644 index 00000000..62bc5549 --- /dev/null +++ b/my-app/public/images/checkbox-checked.svg @@ -0,0 +1,4 @@ + + + + diff --git a/my-app/public/images/checkbox.svg b/my-app/public/images/checkbox.svg new file mode 100644 index 00000000..0e06cb40 --- /dev/null +++ b/my-app/public/images/checkbox.svg @@ -0,0 +1,3 @@ + + + diff --git a/my-app/public/images/done-list-empty.svg b/my-app/public/images/done-list-empty.svg new file mode 100644 index 00000000..9e7b5c61 --- /dev/null +++ b/my-app/public/images/done-list-empty.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/my-app/public/images/logo-large.svg b/my-app/public/images/logo-large.svg new file mode 100644 index 00000000..79e3a93a --- /dev/null +++ b/my-app/public/images/logo-large.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/my-app/public/images/logo-small.svg b/my-app/public/images/logo-small.svg new file mode 100644 index 00000000..4fb80423 --- /dev/null +++ b/my-app/public/images/logo-small.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/my-app/public/images/todo-list-empty.svg b/my-app/public/images/todo-list-empty.svg new file mode 100644 index 00000000..c30e0514 --- /dev/null +++ b/my-app/public/images/todo-list-empty.svg @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/my-app/public/next.svg b/my-app/public/next.svg deleted file mode 100644 index 5174b28c..00000000 --- a/my-app/public/next.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/my-app/public/vercel.svg b/my-app/public/vercel.svg deleted file mode 100644 index 77053960..00000000 --- a/my-app/public/vercel.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/my-app/public/window.svg b/my-app/public/window.svg deleted file mode 100644 index b2b2a44f..00000000 --- a/my-app/public/window.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/my-app/styles/Home.module.css b/my-app/styles/Home.module.css deleted file mode 100644 index a11c8f31..00000000 --- a/my-app/styles/Home.module.css +++ /dev/null @@ -1,168 +0,0 @@ -.page { - --gray-rgb: 0, 0, 0; - --gray-alpha-200: rgba(var(--gray-rgb), 0.08); - --gray-alpha-100: rgba(var(--gray-rgb), 0.05); - - --button-primary-hover: #383838; - --button-secondary-hover: #f2f2f2; - - display: grid; - grid-template-rows: 20px 1fr 20px; - align-items: center; - justify-items: center; - min-height: 100svh; - padding: 80px; - gap: 64px; - font-family: var(--font-geist-sans); -} - -@media (prefers-color-scheme: dark) { - .page { - --gray-rgb: 255, 255, 255; - --gray-alpha-200: rgba(var(--gray-rgb), 0.145); - --gray-alpha-100: rgba(var(--gray-rgb), 0.06); - - --button-primary-hover: #ccc; - --button-secondary-hover: #1a1a1a; - } -} - -.main { - display: flex; - flex-direction: column; - gap: 32px; - grid-row-start: 2; -} - -.main ol { - font-family: var(--font-geist-mono); - padding-left: 0; - margin: 0; - font-size: 14px; - line-height: 24px; - letter-spacing: -0.01em; - list-style-position: inside; -} - -.main li:not(:last-of-type) { - margin-bottom: 8px; -} - -.main code { - font-family: inherit; - background: var(--gray-alpha-100); - padding: 2px 4px; - border-radius: 4px; - font-weight: 600; -} - -.ctas { - display: flex; - gap: 16px; -} - -.ctas a { - appearance: none; - border-radius: 128px; - height: 48px; - padding: 0 20px; - border: none; - border: 1px solid transparent; - transition: - background 0.2s, - color 0.2s, - border-color 0.2s; - cursor: pointer; - display: flex; - align-items: center; - justify-content: center; - font-size: 16px; - line-height: 20px; - font-weight: 500; -} - -a.primary { - background: var(--foreground); - color: var(--background); - gap: 8px; -} - -a.secondary { - border-color: var(--gray-alpha-200); - min-width: 158px; -} - -.footer { - grid-row-start: 3; - display: flex; - gap: 24px; -} - -.footer a { - display: flex; - align-items: center; - gap: 8px; -} - -.footer img { - flex-shrink: 0; -} - -/* Enable hover only on non-touch devices */ -@media (hover: hover) and (pointer: fine) { - a.primary:hover { - background: var(--button-primary-hover); - border-color: transparent; - } - - a.secondary:hover { - background: var(--button-secondary-hover); - border-color: transparent; - } - - .footer a:hover { - text-decoration: underline; - text-underline-offset: 4px; - } -} - -@media (max-width: 600px) { - .page { - padding: 32px; - padding-bottom: 80px; - } - - .main { - align-items: center; - } - - .main ol { - text-align: center; - } - - .ctas { - flex-direction: column; - } - - .ctas a { - font-size: 14px; - height: 40px; - padding: 0 16px; - } - - a.secondary { - min-width: auto; - } - - .footer { - flex-wrap: wrap; - align-items: center; - justify-content: center; - } -} - -@media (prefers-color-scheme: dark) { - .logo { - filter: invert(); - } -} diff --git a/my-app/styles/globals.css b/my-app/styles/globals.css index e3734be1..5e1ffe40 100644 --- a/my-app/styles/globals.css +++ b/my-app/styles/globals.css @@ -1,42 +1,34 @@ :root { - --background: #ffffff; - --foreground: #171717; + --color-state-100: #f1f5f9; + --color-state-200: #e2e8f0; + --color-state-300: #cbd5e1; + --color-state-400: #94a3b8; + --color-state-500: #64748b; + --color-state-800: #1e293b; + --color-state-900: #0f172a; + --color-violet-100: #ede9fe; + --color-violet-600: #7c3aed; + --color-rose-500: #f43f5e; + --color-lime-300: #bef264; + --color-amber-300: #fcd34d; + --color-amber-800: #92400e; + --color-green-700: #15803d; } -@media (prefers-color-scheme: dark) { - :root { - --background: #0a0a0a; - --foreground: #ededed; - } -} - -html, -body { - max-width: 100vw; - overflow-x: hidden; -} - -body { - color: var(--foreground); - background: var(--background); - font-family: Arial, Helvetica, sans-serif; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; +@font-face { + font-family: "HsSantoki20"; + src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/2405@1.0/HSSanTokki20-Regular.woff2") + format("woff2"); + font-weight: normal; + font-display: swap; } * { box-sizing: border-box; - padding: 0; - margin: 0; -} - -a { - color: inherit; - text-decoration: none; } -@media (prefers-color-scheme: dark) { - html { - color-scheme: dark; - } +body { + font-family: NanumSquare, system-ui, -apple-system, BlinkMacSystemFont, + "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", + sans-serif; } diff --git a/my-app/styles/home.module.css b/my-app/styles/home.module.css new file mode 100644 index 00000000..6a2f899c --- /dev/null +++ b/my-app/styles/home.module.css @@ -0,0 +1,46 @@ +.main { + padding: 0 200px; +} + +.content { + width: 100%; + max-width: 1200px; + margin: 0 auto; + padding-top: 24px; +} + +.searchForm { + display: flex; + align-items: center; + gap: 16px; +} + +.todoListContainer { + margin-top: 40px; + display: flex; + gap: 24px; +} + +.loading { + position: fixed; + inset: 0; + background-color: rgba(0, 0, 0, 0.2); + z-index: 1000; +} + +@media (max-width: 1199px) { + .main { + padding: 0 24px; + } + + .content { + max-width: none; + margin: 0; + } +} + +@media (max-width: 743px) { + .main { + padding: 0 16px; + } +}