Skip to content

Commit

Permalink
Merge pull request #90 from Funssion-SWM/develop
Browse files Browse the repository at this point in the history
랜딩페이지 수정
  • Loading branch information
dongree authored Dec 18, 2023
2 parents 7bceb98 + 7c844e3 commit 0713c99
Show file tree
Hide file tree
Showing 8 changed files with 269 additions and 234 deletions.
6 changes: 6 additions & 0 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"embla-carousel-react": "^8.0.0-rc14",
"eslint": "8.43.0",
"eslint-config-next": "13.4.7",
"gsap": "^3.12.4",
"loadsh": "^0.0.4",
"lodash": "^4.17.21",
"lowlight": "2.4",
Expand Down
66 changes: 63 additions & 3 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
import LandingContainer from '@/components/landing/LandingContainer';
import EventHeader from '@/components/shared/EventHeader';
import { checkUser } from '@/service/auth';
import { ACCESS_TOKEN, MAIN_PATH, REFRESH_TOKEN } from '@/utils/const';
import { cookies } from 'next/headers';
import { redirect } from 'next/navigation';
import LandingMain from '@/components/landing/LandingMain';
import DescriptionBox from '@/components/landing/DescriptionBox';
import LastNaigator from '@/components/landing/LastNaigator';
import Footer from '@/components/shared/Footer';
import autocomplete from '@/assets/autocomplete.gif';
import mypage from '@/assets/mypage.gif';
import editing from '@/assets/edit-memo.gif';
import hire from '@/assets/hire.gif';
import editUnderline from '@/assets/icons/edit_underline.svg';
import speechBubble from '@/assets/icons/speech_bubble.svg';
import infinity from '@/assets/icons/rank/infinity_1.svg';
import wheel from '@/assets/icons/wheel_icon.svg';

export default async function LandingPage() {
const accessToken = cookies().get(ACCESS_TOKEN)?.value;
Expand All @@ -14,5 +24,55 @@ export default async function LandingPage() {

isLogin && redirect(MAIN_PATH);

return <LandingContainer />;
return (
<section>
<LandingMain />
<div className="flex flex-col max-w-screen-xl gap-20 py-20 mx-auto sm:py-60 sm:gap-60">
<DescriptionBox
title1="생성형 AI를 활용한"
title2="텍스트 자동 생성 기능"
description1="++ 명령어를 입력해 텍스트를 자동 생성해보세요!"
description2="글을 다 작성하면 자동생성된 요약과 태그를 제공합니다!"
subImgAlt="speech-bubble"
mainImgAlt="autocomplete"
subImg={speechBubble}
mainImg={autocomplete}
/>
<DescriptionBox
title1="블럭 기반 에디터를 활용한"
title2="간편한 에디팅 기능"
description1="/ 키와 드래그를 이용하여 다양한 편집 기능을 사용해보세요!"
description2="바로 반영되는 마크다운 문법을 사용해보세요!"
subImgAlt="edit-underline"
mainImgAlt="editing"
subImg={editUnderline}
mainImg={editing}
reverse
/>
<DescriptionBox
title1="즐겁고, 꾸준하게"
title2="Post Motivation"
description1="Post History 기능으로 꾸준하게 작성해보세요!"
description2="메모 작성, 답변 채택 등 다양한 활동을 통해 등급을 올려보세요!"
subImgAlt="infinity"
mainImgAlt="mypage"
subImg={infinity}
mainImg={mypage}
/>
<DescriptionBox
title1="신속하고 편리한"
title2="채용 도우미 서비스"
description1="원하는 직무의 개발자를 인포럼에서 찾아보세요!"
description2="키워드에 맞는 질문을 자동 생성해 미니면접을 진행해보세요!"
subImgAlt="wheel"
mainImgAlt="hire"
subImg={wheel}
mainImg={hire}
reverse
/>
</div>
<LastNaigator />
<Footer extraClass="w-full sm:snap-always sm:snap-end bg-white" />
</section>
);
}
80 changes: 80 additions & 0 deletions src/components/landing/DescriptionBox.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
'use client';

import Image, { StaticImageData } from 'next/image';
import { useEffect, useRef } from 'react';
import { gsap } from 'gsap';
import { ScrollTrigger } from 'gsap/ScrollTrigger';
type Props = {
title1: string;
title2: string;
description1: string;
description2: string;
subImg: string | StaticImageData;
mainImg: string | StaticImageData;
subImgAlt: string;
mainImgAlt: string;
reverse?: boolean;
};

gsap.registerPlugin(ScrollTrigger);

export default function DescriptionBox({
title1,
title2,
description1,
description2,
subImg,
mainImg,
subImgAlt,
mainImgAlt,
reverse = false,
}: Props) {
const ref = useRef<null | HTMLDivElement>(null);

useEffect(() => {
if (ref.current) {
const element = ref.current;
gsap.fromTo(
element,
{ opacity: 0, y: 400 },
{
scrollTrigger: {
trigger: element,
start: 'top bottom',
},
y: 0,
opacity: 1,
duration: 1,
}
);
}
}, []);

return (
<div
className={`flex items-center justify-around h-full w-full font-semibold flex-col-reverse gap-8 md:gap-0 ${
reverse ? 'md:flex-row-reverse' : 'md:flex-row'
}`}
ref={ref}
>
<Image
src={mainImg}
alt={mainImgAlt}
className="object-cover rounded-2xl sm:w-[550px] w-[350px] shadow-lg"
/>
<div className="px-4 sm:w-auto">
<Image src={subImg} alt={subImgAlt} className="w-[30px] sm:w-9 mt-5" />
<p className="mb-5 text-2xl font-bold leading-tight sm:text-4xl">
{title1}
<br />
{title2}
</p>
<p className="text-sm font-normal sm:text-xl">
{description1}
<br />
{description2}
</p>
</div>
</div>
);
}
Loading

0 comments on commit 0713c99

Please sign in to comment.