Skip to content

Commit

Permalink
[FE] 로그인 페이지 구현 (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
PracticeKJY authored Oct 25, 2024
2 parents 237d212 + 04c5ace commit 2d9ab90
Show file tree
Hide file tree
Showing 19 changed files with 288 additions and 145 deletions.
7 changes: 7 additions & 0 deletions app/frontend/src/app/(chat)/chat/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export default function page() {
return (
<>
<div>채팅페이지</div>
</>
);
}
7 changes: 7 additions & 0 deletions app/frontend/src/app/(chat)/room/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export default function page() {
return (
<>
<div>room 페이지</div>
</>
);
}
Binary file removed app/frontend/src/app/favicon.ico
Binary file not shown.
Binary file removed app/frontend/src/app/fonts/GeistMonoVF.woff
Binary file not shown.
Binary file removed app/frontend/src/app/fonts/GeistVF.woff
Binary file not shown.
27 changes: 0 additions & 27 deletions app/frontend/src/app/globals.css

This file was deleted.

33 changes: 10 additions & 23 deletions app/frontend/src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,34 +1,21 @@
import type { Metadata } from "next";
import localFont from "next/font/local";
import "./globals.css";
import "@/styles/index.css";

const geistSans = localFont({
src: "./fonts/GeistVF.woff",
variable: "--font-geist-sans",
weight: "100 900",
});
const geistMono = localFont({
src: "./fonts/GeistMonoVF.woff",
variable: "--font-geist-mono",
weight: "100 900",
});

export const metadata: Metadata = {
title: "Create Next App",
description: "Generated by create next app",
export const metadata = {
title: "Next.js",
description: "Generated by Next.js",
};

// 375*812 (ios) 크기.

export default function RootLayout({
children,
}: Readonly<{
}: {
children: React.ReactNode;
}>) {
}) {
return (
<html lang="en">
<body
className={`${geistSans.variable} ${geistMono.variable} antialiased`}
>
{children}
<body>
<div className="container">{children}</div>
</body>
</html>
);
Expand Down
116 changes: 21 additions & 95 deletions app/frontend/src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,101 +1,27 @@
import Image from "next/image";
"use client";

import LoginModal from "@/components/auth/LoginModal";
import { useState } from "react";

export default function Home() {
return (
<div className="grid grid-rows-[20px_1fr_20px] items-center justify-items-center min-h-screen p-8 pb-20 gap-16 sm:p-20 font-[family-name:var(--font-geist-sans)]">
<main className="flex flex-col gap-8 row-start-2 items-center sm:items-start">
<Image
className="dark:invert"
src="https://nextjs.org/icons/next.svg"
alt="Next.js logo"
width={180}
height={38}
priority
/>
<ol className="list-inside list-decimal text-sm text-center sm:text-left font-[family-name:var(--font-geist-mono)]">
<li className="mb-2">
Get started by editing{" "}
<code className="bg-black/[.05] dark:bg-white/[.06] px-1 py-0.5 rounded font-semibold">
src/app/page.tsx
</code>
.
</li>
<li>Save and see your changes instantly.</li>
</ol>
// 로그인 모달 제어 state
const [isLoginModalOpen, setIsLoginModalOpen] = useState(false);

<div className="flex gap-4 items-center flex-col sm:flex-row">
<a
className="rounded-full border border-solid border-transparent transition-colors flex items-center justify-center bg-foreground text-background gap-2 hover:bg-[#383838] dark:hover:bg-[#ccc] text-sm sm:text-base h-10 sm:h-12 px-4 sm:px-5"
href="https://vercel.com/new?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
>
<Image
className="dark:invert"
src="https://nextjs.org/icons/vercel.svg"
alt="Vercel logomark"
width={20}
height={20}
/>
Deploy now
</a>
<a
className="rounded-full border border-solid border-black/[.08] dark:border-white/[.145] transition-colors flex items-center justify-center hover:bg-[#f2f2f2] dark:hover:bg-[#1a1a1a] hover:border-transparent text-sm sm:text-base h-10 sm:h-12 px-4 sm:px-5 sm:min-w-44"
href="https://nextjs.org/docs?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
>
Read our docs
</a>
</div>
</main>
<footer className="row-start-3 flex gap-6 flex-wrap items-center justify-center">
<a
className="flex items-center gap-2 hover:underline hover:underline-offset-4"
href="https://nextjs.org/learn?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
>
<Image
aria-hidden
src="https://nextjs.org/icons/file.svg"
alt="File icon"
width={16}
height={16}
/>
Learn
</a>
<a
className="flex items-center gap-2 hover:underline hover:underline-offset-4"
href="https://vercel.com/templates?framework=next.js&utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
>
<Image
aria-hidden
src="https://nextjs.org/icons/window.svg"
alt="Window icon"
width={16}
height={16}
/>
Examples
</a>
<a
className="flex items-center gap-2 hover:underline hover:underline-offset-4"
href="https://nextjs.org?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
return (
<>
<div className="flex flex-col items-center">
<h1>너나들이 메인 화면입니다.</h1>
<button
className="btn text-[20px] h-[55px] mt-[24px] bg-[#f7d943] rounded-[8px] px-4"
onClick={() => setIsLoginModalOpen(true)}
>
<Image
aria-hidden
src="https://nextjs.org/icons/globe.svg"
alt="Globe icon"
width={16}
height={16}
/>
Go to nextjs.org →
</a>
</footer>
</div>
로그인 테스트하기
</button>
<LoginModal
isOpen={isLoginModalOpen}
onClick={() => setIsLoginModalOpen(false)}
/>
</div>
</>
);
}
Binary file added app/frontend/src/assets/images/close_btn.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/frontend/src/assets/images/google_login.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/frontend/src/assets/images/kakao_login.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/frontend/src/assets/images/naver_login.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
95 changes: 95 additions & 0 deletions app/frontend/src/components/auth/LoginModal.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
"use client";

import { useState } from "react";
import Image from "next/image";
import closeBtn from "@/assets/images/close_btn.png";
import googleLoginBtn from "@/assets/images/google_login.png";
import kakaoLoginBtn from "@/assets/images/kakao_login.png";
import naverLoginBtn from "@/assets/images/naver_login.png";

type LoginModalPropsType = {
isOpen: boolean;
onClick: () => void;
};

export default function LoginModal({ isOpen, onClick }: LoginModalPropsType) {
const [isCloseAnimating, setIsCloseAnimating] = useState(false);

// 닫기버튼 클릭 이벤트 핸들러
const onClickCloseHandler = () => {
// 닫기 애니메이션 시작
setIsCloseAnimating(true);
setTimeout(() => {
// 3초 뒤, 모달창 상태 false
onClick();
// 3초 뒤, 애니메이션 false
setIsCloseAnimating(false);
}, 300);
};

return (
<>
{isOpen && (
<div className="fixed inset-0 flex items-center justify-center z-50">
<div className="w-full h-full bg-black bg-opacity-60 flex items-center justify-center">
<div
className={`w-[375px] h-[376px] fixed bottom-0 bg-white rounded-t-[20px] p-[30px] transition-transform duration-300 ease-in-out ${
isCloseAnimating ? "animate-slide-bottom" : "animate-slide-top"
}`}
style={{
animation: isCloseAnimating
? "slide-bottom 0.3s forwards"
: "slide-top 0.3s forwards",
}}
>
<div className="flex justify-end" onClick={onClickCloseHandler}>
<Image src={closeBtn} alt="close-button" width={20} />
</div>
<div className="flex flex-col justify-center items-center mt-[24px]">
<p className="text-[20px] font-medium">3초만에 로그인하고</p>
<p className="text-[20px] font-medium">
너나들이를 이용해보세요!
</p>
<button className="btn relative flex w-full items-center justify-center h-[55px] mt-[24px] bg-[#F5F5F5] rounded-[8px] px-4">
<span className="absolute left-4">
<Image
className="mr-3"
src={googleLoginBtn}
alt="google-login"
width={38}
height={38}
/>
</span>
<span className="text-[16px] font-medium">구글 로그인</span>
</button>
<p className="pt-[24px] pb-[16px] text-[#808080] text-[14px] cursor-pointer">
다른 방법으로 로그인 하기
</p>
<div className="flex w-[130px] justify-between">
<button className="hover:bg-gray-200 rounded-[50%]">
<Image
src={kakaoLoginBtn}
alt="kakao-button"
width={50}
height={50}
className="btn"
/>
</button>
<button className="hover:bg-gray-200 rounded-[50%]">
<Image
src={naverLoginBtn}
alt="naver-button"
width={50}
height={50}
className="btn"
/>
</button>
</div>
</div>
</div>
</div>
</div>
)}
</>
);
}
7 changes: 7 additions & 0 deletions app/frontend/src/components/layout/NavMenu.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export default function NavMenu() {
return (
<>
<div>NavMenu 컴포넌트</div>
</>
);
}
79 changes: 79 additions & 0 deletions app/frontend/src/styles/animation.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
/* animista 사이트 애니메이션 코드 활용 - 높이만 세부적으로 조정함 */
/* 참고: http://animista.net */

/* 바텀시트 올라오는 애니메이션 */
@-webkit-keyframes slide-top {
0% {
-webkit-transform: translateY(60px);
transform: translateY(60px);
}
100% {
-webkit-transform: translateY(0px);
transform: translateY(0px);
}
}
@keyframes slide-top {
0% {
-webkit-transform: translateY(60px);
transform: translateY(60px);
}
100% {
-webkit-transform: translateY(0px);
transform: translateY(0px);
}
}

/* 바텀시트 내려가는 애니메이션 */
@-webkit-keyframes slide-bottom {
0% {
-webkit-transform: translateY(0px);
transform: translateY(0px);
}
20% {
-webkit-transform: translateY(30px);
transform: translateY(30px);
}
40% {
-webkit-transform: translateY(60px);
transform: translateY(60px);
}
60% {
-webkit-transform: translateY(100px);
transform: translateY(100px);
}
80% {
-webkit-transform: translateY(250px);
transform: translateY(250px);
}
100% {
-webkit-transform: translateY(400px);
transform: translateY(400px);
}
}

@keyframes slide-bottom {
0% {
-webkit-transform: translateY(0px);
transform: translateY(0px);
}
20% {
-webkit-transform: translateY(30px);
transform: translateY(30px);
}
40% {
-webkit-transform: translateY(60px);
transform: translateY(60px);
}
60% {
-webkit-transform: translateY(100px);
transform: translateY(100px);
}
80% {
-webkit-transform: translateY(250px);
transform: translateY(250px);
}
100% {
-webkit-transform: translateY(400px);
transform: translateY(400px);
}
}
Loading

0 comments on commit 2d9ab90

Please sign in to comment.