Skip to content

Commit

Permalink
feat: remove typo
Browse files Browse the repository at this point in the history
  • Loading branch information
yeonjuan committed Apr 16, 2024
1 parent 6ac2382 commit c04ca32
Show file tree
Hide file tree
Showing 12 changed files with 315 additions and 302 deletions.
9 changes: 9 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,17 @@ module.exports = {
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react-hooks/recommended",
"plugin:tailwindcss/recommended",
],
parser: "@typescript-eslint/parser",
rules: {
"tailwindcss/no-custom-classname": [
"error",
{
whitelist: ["slide-prev", "slide-next"],
},
],
},
},
{
files: ["*.html"],
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@
"dependencies": {
"@tanstack/react-query": "^5.24.8",
"classnames": "^2.5.1",
"clsx": "^2.1.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.22.1",
"swiper": "^11.0.7"
"swiper": "^11.0.7",
"tailwind-merge": "^2.2.2"
},
"devDependencies": {
"@html-eslint/eslint-plugin": "^0.23.1",
Expand All @@ -36,6 +38,7 @@
"eslint": "^8.57.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.5",
"eslint-plugin-tailwindcss": "^3.15.1",
"jest": "^29.7.0",
"postcss": "^8.4.35",
"prettier": "^3.2.5",
Expand Down
Empty file.
21 changes: 21 additions & 0 deletions src/pages/root/sections/start-section.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { Section } from "../ui/common";

export const StartSection = () => {
return (
<Section className="flex flex-col items-center bg-primary-500 md:flex-row md:items-start md:pb-0">
<div className="flex flex-col">
<h1 className="text-center text-white md:text-start">
<span className="md:mb-[12px] md:inline-block">
간편한 링크 아카이빙
</span>
<br />
<span>지금 바로 경험하세요!</span>
</h1>
<button className="rounded-[8px] bg-white px-[18px] py-[12px] text-primary-500 drop-shadow-[0_4px_4px_rgba(0,0,0,0.1)] sm:rounded-[12px] sm:px-5 sm:py-4 md:px-[49px] md:py-[22.5px]">
주섬 시작하기
</button>
</div>
<div className="mt-[20px] h-[300px] w-[163px] rounded-[20px] bg-white sm:w-full sm:max-w-[582px] md:ml-auto md:mr-0 md:mt-0 md:h-[343px] md:rounded-b-none"></div>
</Section>
);
};
126 changes: 126 additions & 0 deletions src/pages/root/sections/usage-section.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
import { Section, SectionRow } from "../ui/common";
import classnames from "classnames";
import { Swiper, SwiperSlide, SwiperClass } from "swiper/react";
import { Navigation } from "swiper/modules";
import ArrowLeftIconImage from "@/assets/images/icon-swiper-arrow-left.svg";
import ArrowRightIconImage from "@/assets/images/icon-swiper-arrow-right.svg";
import "swiper/css";
import { useState } from "react";
import { Breakpoint, useBreakpoint } from "@/shared/hook/useBreakpoint";

const USAGE_ITEMS = [
{
tag: "쉬운 확인",
title: "모바일에서 저장하고\nPC에서 확인하세요",
description:
"어느 기기에서나 편하게 확인해보세요! 스마트폰, 태블릿, PC에서 저장해뒀던 콘텐츠를 다시 열어볼 수 있어요",
},
{
tag: "어디서든 확인",
title: "모바일에서 저장하고\nPC에서 확인하세요",
description:
"어느 기기에서나 편하게 확인해보세요! 스마트폰, 태블릿, PC에서 저장해뒀던 콘텐츠를 다시 열어볼 수 있어요",
},
{
tag: "나만의 폴더",
title: "모바일에서 저장하고\nPC에서 확인하세요",
description:
"어느 기기에서나 편하게 확인해보세요! 스마트폰, 태블릿, PC에서 저장해뒀던 콘텐츠를 다시 열어볼 수 있어요",
},
{
tag: "잊지않게 알림",
title: "모바일에서 저장하고\nPC에서 확인하세요",
description:
"어느 기기에서나 편하게 확인해보세요! 스마트폰, 태블릿, PC에서 저장해뒀던 콘텐츠를 다시 열어볼 수 있어요",
},
{
tag: "태그로 구분",
title: "모바일에서 저장하고\nPC에서 확인하세요",
description:
"어느 기기에서나 편하게 확인해보세요! 스마트폰, 태블릿, PC에서 저장해뒀던 콘텐츠를 다시 열어볼 수 있어요",
},
] as const;

export const UsageSection = () => {
const [swiper, setSwiper] = useState<SwiperClass | null>(null);
const [activeIndex, setActiveIndex] = useState(0);
const breakpoint = useBreakpoint();
return (
<Section className="flex flex-col items-start bg-white">
<SectionRow>
<h1 className="text-start md:text-start">
<span className="text-black md:mb-[12px] md:inline-block">
한눈에 살펴보는
</span>
<br />
<span className="text-primary-500">주섬 사용법</span>
</h1>
<ul>
{USAGE_ITEMS.map((item, index) => {
const active = index === activeIndex;
return (
<li
key={item.tag}
className={classnames(
active
? "bg-primary-500 text-white"
: "bg-gray-200 text-gray-700",
"mb-3 mr-3 inline-block rounded-[50px] px-3 py-2 sm:mb-6 sm:mr-6 sm:px-5 sm:py-3 ",
)}
>
<button onClick={() => swiper?.slideTo(index)}>
{item.tag}
</button>
</li>
);
})}
</ul>
</SectionRow>
<div className="w-full">
<Swiper
modules={[Navigation]}
spaceBetween={0}
allowSlideNext
slidesPerView={
{
[Breakpoint.BASE]: 1.2,
[Breakpoint.SM]: 1.9,
[Breakpoint.MD]: 1,
}[breakpoint]
}
navigation={{
nextEl: ".slide-next",
prevEl: ".slide-prev",
}}
centeredSlides
onSwiper={setSwiper}
onSlideChangeTransitionStart={(swiper) => {
setActiveIndex(swiper.activeIndex);
}}
>
{USAGE_ITEMS.map((item) => {
return (
<SwiperSlide>
<div className="px-[10px] md:m-auto md:flex md:w-[1080px]">
<button className="slide-prev mr-[20px] hidden md:block">
<img src={ArrowLeftIconImage} alt="prev" />
</button>
<div className="m-auto flex w-full flex-col rounded-[24px] bg-gray-200 px-5 pt-6 sm:w-[400px] sm:p-[30px] md:flex md:w-full md:flex-row">
<h3>{item.title}</h3>
<p>{item.description}</p>
<div className="mb-0 mt-auto flex w-full justify-center sm:h-full">
<div className="h-[274px] w-[181px] rounded-t-[20px] bg-white sm:size-full sm:rounded-b-[20px]"></div>
</div>
</div>
<button className="slide-next ml-[20px] hidden md:block">
<img src={ArrowRightIconImage} />
</button>
</div>
</SwiperSlide>
);
})}
</Swiper>
</div>
</Section>
);
};
19 changes: 19 additions & 0 deletions src/pages/root/ui/common.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { PropsWithChildren } from "react";
import { cn } from "@/shared/utils/cn";

export const Section = ({
children,
className,
}: PropsWithChildren & {
className?: string;
}) => {
return (
<section className={cn(`py-[60px] sm:py-[100px] md:py-[80px]`, className)}>
{children}
</section>
);
};

export const SectionRow = ({ children }: PropsWithChildren) => {
return <div className="w-full px-6 sm:px-20">{children}</div>;
};
80 changes: 36 additions & 44 deletions src/pages/root/ui/header.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
import { Logo } from "@/shared/ui/logo";
import cn from "classnames";
import { PropsWithChildren, useEffect } from "react";
import { useEffect } from "react";
import styles from "./header.module.css";
import { useDisclosure } from "@/shared/hook/useDisclosure";
import { NavMenu } from "./nav-menu";
import { createPortal } from "react-dom";
import { Breakpoint, useBreakpoint } from "@/shared/hook/useBreakpoint";

const NAV_ITEMS = [
{
title: "문의하기",
},
{
title: "앱 다운로드",
},
{
title: "주섬 시작하기",
},
];

export const Header = () => {
const { isOpen, toggle, close } = useDisclosure();
const breakpoint = useBreakpoint();
Expand All @@ -22,38 +33,30 @@ export const Header = () => {
}, [breakpoint, close]);

return (
<div>
<header className="flex w-full flex-row items-center px-5 py-2 sm:py-3 fixed bg-white z-10 md:py-5 md:px-20">
<div className="h-[47px]">
<header className="fixed z-10 flex h-[47px] w-full flex-row items-center bg-white px-5 py-2 sm:py-3 md:px-20 md:py-5">
<Logo />
<h1 className="text-[24px] font-['PT_Sans_Caption'] font-bold text-primary-500 ml-[8px] leading-[31px] md:text-[32px]">
Joosum
</h1>
<h1 className="ml-[8px] text-primary-500">Joosum</h1>
<button
className={cn(
`${styles.menu} flex flex-col h-[24px] gap-[3px] w-[24px] mr-0 ml-auto items-center justify-center sm:hidden`,
isOpen && styles.open,
)}
onClick={toggle}
>
<div className="bg-gray-800 w-[18px] h-[2px]" />
<div className="bg-gray-800 w-[18px] h-[2px]" />
<div className="bg-gray-800 w-[18px] h-[2px]" />
<div className="h-[2px] w-[18px] bg-gray-800" />
<div className="h-[2px] w-[18px] bg-gray-800" />
<div className="h-[2px] w-[18px] bg-gray-800" />
</button>
<nav className="ml-auto hidden sm:flex">
<ul className="flex h-full items-center gap-4 text-[18px] md:gap-[30px]">
<li>
<NavLink className="font-normal text-[#5D5C5D]">문의하기</NavLink>
</li>
<li>
<NavLink className="bg-primary-400 font-semibold text-white">
앱 다운로드
</NavLink>
</li>
<li>
<NavLink className="bg-primary-500 font-semibold text-white">
주섬 시작하기
</NavLink>
</li>
<ul className="flex h-full items-center gap-4 md:gap-[30px]">
{NAV_ITEMS.map((item) => {
return (
<li key={item.title}>
<a>{item.title}</a>
</li>
);
})}
</ul>
</nav>
</header>
Expand All @@ -65,29 +68,18 @@ export const Header = () => {
isOpen ? "opacity-100" : "opacity-0",
)}
>
<NavMenu />
<ul className="text-center">
{NAV_ITEMS.map((item) => {
return (
<li key={item.title}>
<a>{item.title}</a>
</li>
);
})}
</ul>
</div>,
document.body,
)}
</div>
);
};

interface NavLinkProps extends PropsWithChildren {
className?: string;
href?: string;
}

const NavLink = ({ className, children, href }: NavLinkProps) => {
return (
<a
className={cn(
"rounded-[8px] p-[12px] leading-[18px] sm:p-2 sm:text-[16px] md:text-[18px] md:p-[12px]",
className,
)}
href={href}
>
{children}
</a>
);
};
15 changes: 0 additions & 15 deletions src/pages/root/ui/nav-menu.tsx

This file was deleted.

Loading

0 comments on commit c04ca32

Please sign in to comment.