Skip to content

Commit

Permalink
Merge pull request #114 from prgrms-web-devcourse-final-project/Style/#โ€ฆ
Browse files Browse the repository at this point in the history
โ€ฆ111-icon404

Style: ๋””์ž์ธ ์ˆ˜์ • ๋ฐ˜์˜ (์˜จ๋ณด๋”ฉ/404/๋กœ๊ทธ์ธ)
  • Loading branch information
bluedog129 authored Dec 7, 2024
2 parents 19dd92a + 1605e4a commit 3aba5ae
Show file tree
Hide file tree
Showing 13 changed files with 142 additions and 49 deletions.
2 changes: 2 additions & 0 deletions app/(auth)/login/Login.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ export const LogoContainer = styled.div`
flex-direction: column;
justify-content: center;
align-items: center;
/* gap: 20px; // svg ๋„ฃ์„ ๊ฒฝ์šฐ ์ถ”๊ฐ€ํ•˜๊ธฐ */
margin: 40px 0;
`;

export const LoginTitle = styled.div`
Expand Down
9 changes: 5 additions & 4 deletions app/(auth)/login/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ import toast from 'react-hot-toast';
import axiosInstance from '@/lib/axios';
import {
LoginWrapper,
LoginTitle,
ButtonSignupWrapper,
LogoContainer,
} from '@/app/(auth)/login/Login.styles';
import LoginLogo from '@layout/Login/LoginLogo';
import Logo from '@/styles/Icon/Logo.svg';
// import MainLayout from '@/styles/Icon/mainLayout.svg'; // ์šฉ๋Ÿ‰์ด ๋„ˆ๋ฌด ํฌ๋‹ค. . .
import Image from 'next/image';
import Input from '@common/Input/Input';
import AutoLoginCheckbox from '@layout/Login/AutoLogin';
import Button from '@common/Button/Button';
Expand Down Expand Up @@ -123,8 +124,8 @@ const Login = () => {
return (
<LoginWrapper>
<LogoContainer>
<LoginLogo src="" />
<LoginTitle>Where am I?</LoginTitle>
<Image src={Logo} alt="logo" />
{/* <Image src={MainLayout} alt="mainLayout" /> */}
</LogoContainer>
<form onSubmit={handleLogin} autoComplete="off">
<Input
Expand Down
46 changes: 46 additions & 0 deletions app/not-found.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
'use client';

import Image from 'next/image';
import notFound from '@/styles/Icon/404.svg';
import Button from '@/components/Common/Button/Button';
import { useRouter } from 'next/navigation';
import styled from 'styled-components';
import color from '@/styles/color/palette';

const NotFound = () => {
const router = useRouter();

return (
<NotFoundContainer>
<Image src={notFound} alt="404" />
<Text>
์ฐพ์„ ์ˆ˜ ์—†๋Š” ํŽ˜์ด์ง€์ž…๋‹ˆ๋‹ค. <br />
์š”์ฒญํ•˜์‹  ํŽ˜์ด์ง€๊ฐ€ ์‚ฌ๋ผ์กŒ๊ฑฐ๋‚˜, ์ž˜๋ชป๋œ ๊ฒฝ๋กœ๋ฅผ ์ด์šฉํ•˜์…จ์–ด์š”:)
</Text>
<Button label="ํ™ˆ์œผ๋กœ ์ด๋™" onClick={() => router.push('/')} />
</NotFoundContainer>
);
};

export default NotFound;

const NotFoundContainer = styled.div`
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100vh;
padding: 0 20px;
`;

const Text = styled.p`
font-size: 14px;
font-style: normal;
font-weight: 400;
line-height: 150%;
letter-spacing: -0.14px;
margin-bottom: 20px;
text-align: center;
color: ${color.purple[50]};
padding: 24px 0;
`;
6 changes: 4 additions & 2 deletions app/onBoarding.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export const SlideContent = styled.div`

export const ImageWrapper = styled.div<{ $isSecondSlide?: boolean }>`
width: 100%;
padding-top: ${({ $isSecondSlide }) => ($isSecondSlide ? '60px' : '0')};
padding-top: ${({ $isSecondSlide }) => ($isSecondSlide ? '0px' : '0')};
`;

export const TextWrapper = styled.div<{ $isFirstSlide?: boolean }>`
Expand Down Expand Up @@ -100,10 +100,12 @@ export const SlideDescription = styled.p`

export const SlideImage = styled(Image)`
width: 100%;
max-width: 300px;
max-height: 350px;
height: 100%;
min-height: 450px;
object-fit: contain;
margin: 0 auto;
`;

export const ButtonContainer = styled.div`
Expand Down
59 changes: 37 additions & 22 deletions app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
'use client';

import { useState, useRef } from 'react';
import { useRouter } from 'next/navigation';
import Slider from 'react-slick';
import Button from '@/components/Common/Button/Button';
Expand All @@ -16,35 +18,37 @@ import {
} from './onBoarding.styles';
import 'slick-carousel/slick/slick.css';
import 'slick-carousel/slick/slick-theme.css';
import SnowMan1 from '@/styles/Icon/SnowMan1.svg';
import OnBoarding1 from '@/styles/Icon/OnBoarding/OnBoarding1.svg';
import OnBoarding2 from '@/styles/Icon/OnBoarding2.svg';
import OnBoarding3 from '@/styles/Icon/OnBoarding3.svg';
import OnBoarding4 from '@/styles/Icon/OnBoarding4.svg';
import OnBoarding3 from '@/styles/Icon/OnBoarding/OnBoarding3.gif';
import OnBoarding4 from '@/styles/Icon/OnBoarding/OnBoarding4.gif';

const OnBoarding = () => {
const router = useRouter();
const sliderRef = useRef<Slider>(null);
const [currentSlide, setCurrentSlide] = useState(0);

// TODO : ๋งˆ์ง€๋ง‰ ์Šฌ๋ผ์ด๋“œ์—์„œ ์ฒซ๋ฒˆ์งธ ์Šฌ๋ผ์ด๋“œ๋กœ ๋„˜์–ด๊ฐˆ ๋•Œ ๋Š์–ด์ง€๋Š” ์ด์Šˆ (fade ์˜ต์…˜์œผ๋กœ ํ•ด๊ฒฐ!)
const settings = {
dots: true, // ๋„ค๋น„๊ฒŒ์ด์…˜ ๋ฒ„ํŠผ
infinite: true, // ๋ฌดํ•œ ๋ฐ˜๋ณต
speed: 500, // ์Šฌ๋ผ์ด๋“œ ์ด๋™ ์†๋„
slidesToShow: 1, // ํ•œ ๋ฒˆ์— ๋ณด์—ฌ์ค„ ์Šฌ๋ผ์ด๋“œ ๊ฐœ์ˆ˜
slidesToScroll: 1, // ํ•œ ๋ฒˆ์— ์Šคํฌ๋กคํ•  ์Šฌ๋ผ์ด๋“œ ๊ฐœ์ˆ˜
arrows: false, // ์ขŒ์šฐ ๋ฒ„ํŠผ ์ˆจ๊น€
autoplay: true, // ์ž๋™ ์žฌ์ƒ ํ™œ์„ฑํ™”
autoplaySpeed: 3000, // 3์ดˆ๋งˆ๋‹ค ์Šฌ๋ผ์ด๋“œ ๋ณ€๊ฒฝ
pauseOnHover: true, // ๋งˆ์šฐ์Šค ํ˜ธ๋ฒ„์‹œ ์ผ์‹œ์ •์ง€
cssEase: 'linear', // ๋ถ€๋“œ๋Ÿฌ์šด ์ „ํ™˜
dots: true,
infinite: true,
speed: 500,
slidesToShow: 1,
slidesToScroll: 1,
arrows: false,
pauseOnHover: true,
cssEase: 'linear',
fade: true,
beforeChange: (current: number, next: number) => {
setCurrentSlide(next);
},
};

const slides = [
{
title: 'โ€œ์–ด๋ฐ๊ณ ?!โ€',
description: `๊ฐ€์กฑ, ์ปคํ”Œ, ์นœ๊ตฌ๋“ค๊ณผ ํ•จ๊ป˜ ๋ฐฉ๋ฌธํ–ˆ๋˜ ์žฅ์†Œ๋ฅผ
์ƒˆ๋กญ๊ฒŒ ์ถ”์–ตํ•˜๋ฉฐ ์œ„์น˜๋ฅผ ๋งž์ถฐ๋ณด์„ธ์š”!`,
image: SnowMan1,
image: OnBoarding1,
},
{
title: '์žฅ์†Œ ๋“ฑ๋กํ•˜๊ธฐ',
Expand All @@ -71,7 +75,7 @@ const OnBoarding = () => {
<PageWrapper>
<OnBoardingWrapper>
<SlideContainer>
<Slider {...settings}>
<Slider ref={sliderRef} {...settings}>
{slides.map((slide, index) => (
<SlideContent key={index}>
<ImageWrapper $isSecondSlide={index === 1}>
Expand All @@ -89,12 +93,23 @@ const OnBoarding = () => {
</Slider>
</SlideContainer>
<ButtonContainer>
<Button
label="์‹œ์ž‘ํ•˜๊ธฐ"
onClick={() => router.push('/login')}
buttonType="purple"
buttonSize="large"
/>
{currentSlide === slides.length - 1 ? (
<Button
label="์‹œ์ž‘ํ•˜๊ธฐ"
onClick={() => router.push('/login')}
buttonType="purple"
buttonSize="large"
/>
) : (
<Button
label="๋‹ค์Œ์œผ๋กœ"
onClick={() => {
sliderRef.current?.slickNext();
}}
buttonType="purple"
buttonSize="large"
/>
)}
</ButtonContainer>
</OnBoardingWrapper>
</PageWrapper>
Expand Down
42 changes: 21 additions & 21 deletions components/Layout/Game/Character.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,48 +25,48 @@ interface CharacterProps {
}

const positions = [
{ top: '30%', left: '20%' },
{ top: '10%', left: '50%' },
{ top: '30%', left: '80%' },
{ top: '70%', left: '70%' },
{ top: '90%', left: '30%' },
{ top: '60%', left: '10%' },
{ top: '20%', left: '20%' },
{ top: '50%', left: '40%' },
{ top: '80%', left: '30%' },
{ top: '100%', left: '60%' },
];

const Character = ({ users }: CharacterProps) => {
const characters = users.map((user, index) => {
// ํƒ€์›ํ˜• ๋ฐฐ์น˜๋ฅผ ์œ„ํ•œ ๊ณ„์‚ฐ
const angle = (index * 360) / users.length;
const horizontalRadius = 35; // ๊ฐ€๋กœ ๋ฐ˜์ง€๋ฆ„ (๋” ์ž‘๊ฒŒ)
const verticalRadius = 45; // ์„ธ๋กœ ๋ฐ˜์ง€๋ฆ„ (๋” ํฌ๊ฒŒ)

// ํƒ€์›ํ˜• ์ขŒํ‘œ ๊ณ„์‚ฐ
const x = 50 + horizontalRadius * Math.cos((angle * Math.PI) / 180);
const y = 50 + verticalRadius * Math.sin((angle * Math.PI) / 180);

return {
id: user.id,
level: `๋ ˆ๋ฒจ ${index + 1}`,
level: '๋ ˆ๋ฒจ 1',
nickname: user.name,
src: [
Character0,
Character1,
Character2,
Character3,
Character4,
Character5,
Character4,
Character3,
Character2,
Character1,
Character0,
][index],
alt: `${index + 1}๋ฒˆ ๋ˆˆ์‚ฌ๋žŒ`,
isHost: user.isHost,
isReady: user.isReady,
position: { left: `${x}%`, top: `${y}%` },
position: positions[index],
};
});

return (
<CharactersContainer>
{characters.map((char) => (
<CharacterWrapper key={char.id} style={char.position} animation="slide">
<CharacterWrapper
key={char.id}
style={{
...char.position,
width: '350px',
height: '280px',
position: 'absolute',
transform: 'translate(-50%, -50%)',
}}
>
<InfoWrapper>
{char.isHost ? (
<Host>๋ฐฉ์žฅ</Host>
Expand Down
19 changes: 19 additions & 0 deletions styles/Icon/404.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions styles/Icon/Logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions styles/Icon/OnBoarding/OnBoarding1.svg
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 styles/Icon/OnBoarding/OnBoarding3.gif
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 styles/Icon/OnBoarding/OnBoarding4.gif
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 styles/Icon/mainLayout.svg
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 styles/fonts/tway_fly.ttf
Binary file not shown.

0 comments on commit 3aba5ae

Please sign in to comment.