Skip to content

Commit

Permalink
Merge pull request #123 from prgrms-web-devcourse-final-project/feature/
Browse files Browse the repository at this point in the history
#120-onboarding-gif

Feature/#120: ์˜จ๋ณด๋”ฉ ํ™”๋ฉด์— gif ๋ฐฐ์น˜ ๋ฐ ์Šคํƒ€์ผ ์ ์šฉ
  • Loading branch information
bluedog129 authored Dec 9, 2024
2 parents 6bba112 + 577029e commit 4978a34
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 13 deletions.
2 changes: 1 addition & 1 deletion app/(auth)/login/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ const Login = () => {
return (
<LoginWrapper>
<LogoContainer>
<Image src={Logo} alt="logo" />
<Image src={Logo} alt="logo" priority />
{/* <Image src={MainLayout} alt="mainLayout" /> */}
</LogoContainer>
<form onSubmit={handleLogin} autoComplete="off">
Expand Down
14 changes: 12 additions & 2 deletions app/onBoarding.styles.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Image from 'next/image';
import styled from 'styled-components';
import colors from '@/styles/color/palette';
import Image from 'next/image';

export const PageWrapper = styled.div`
width: 100%;
Expand Down Expand Up @@ -98,7 +98,7 @@ export const SlideDescription = styled.p`
white-space: pre-line;
`;

export const SlideImage = styled(Image)`
export const SlideStaticImage = styled(Image)`
width: 100%;
max-width: 300px;
max-height: 350px;
Expand All @@ -108,6 +108,16 @@ export const SlideImage = styled(Image)`
margin: 0 auto;
`;

export const SlideDynamicImage = styled.div`
position: relative;
width: 224px;
height: 448px;
margin: 0 auto;
img {
border-radius: 12.8px;
}
`;

export const ButtonContainer = styled.div`
position: fixed;
display: flex;
Expand Down
28 changes: 21 additions & 7 deletions app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,16 @@ import {
SlideContent,
SlideTitle,
SlideDescription,
SlideImage,
SlideStaticImage,
SlideDynamicImage,
} from './onBoarding.styles';
import 'slick-carousel/slick/slick.css';
import 'slick-carousel/slick/slick-theme.css';
import OnBoarding1 from '@/styles/Icon/OnBoarding/OnBoarding1.svg';
import OnBoarding2 from '@/styles/Icon/OnBoarding2.svg';
import OnBoarding3 from '@/styles/Icon/OnBoarding/OnBoarding3.gif';
import OnBoarding4 from '@/styles/Icon/OnBoarding/OnBoarding4.gif';
import OnBoarding3 from '@/styles/Icon/OnBoarding/OnBoardingPlace.gif';
import OnBoarding4 from '@/styles/Icon/OnBoarding/OnBoardingGame.gif';
import Image from 'next/image';

const OnBoarding = () => {
const router = useRouter();
Expand Down Expand Up @@ -79,10 +81,22 @@ const OnBoarding = () => {
{slides.map((slide, index) => (
<SlideContent key={index}>
<ImageWrapper $isSecondSlide={index === 1}>
<SlideImage
src={slide.image}
alt={`์˜จ๋ณด๋”ฉ ์ด๋ฏธ์ง€ ${index + 1}`}
/>
{index === 0 || index === 1 ? (
<SlideStaticImage
src={slide.image}
alt={`์˜จ๋ณด๋”ฉ ์ด๋ฏธ์ง€ ${index + 1}`}
/>
) : (
<SlideDynamicImage>
<Image
src={slide.image}
alt={`์˜จ๋ณด๋”ฉ ์ด๋ฏธ์ง€ ${index + 1}`}
fill
style={{ objectFit: 'cover' }}
sizes="(max-width:430px) 100vw"
/>
</SlideDynamicImage>
)}
</ImageWrapper>
<TextWrapper $isFirstSlide={index === 0}>
<SlideTitle>{slide.title}</SlideTitle>
Expand Down
3 changes: 0 additions & 3 deletions components/Layout/PlaceRegister/PlaceRegister.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ const PlaceRegister = ({ index, title }: PlaceRegisterProps) => {

return (
<PlaceRegisterWrapper>
{/* <button onClick={() => console.log(placeList)}>
placeList ํ™•์ธ์šฉ ๋ฒ„ํŠผ
</button> */}
<PlaceRegistertext>
<div>{title}</div>
{index !== 0 && (
Expand Down
1 change: 1 addition & 0 deletions hooks/placeRegister/useRegisterFiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ const useRegisterFiles = ({ index }: useUploadFilesProps) => {
const selectedFileList = Array.from(fileList).slice(0, MAX_CONTENT_COUNT);

if (isOverMemory(selectedFileList)) {
toast.error('์—…๋กœ๋“œ ๊ฐ€๋Šฅํ•œ ์šฉ๋Ÿ‰์„ ์ดˆ๊ณผํ–ˆ์–ด์š”');
return;
}

Expand Down
3 changes: 3 additions & 0 deletions hooks/placeRegister/useUploadFiles.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import axiosInstance from '@/lib/axios';
import usePlaceRegisterStore, { Place } from '@/stores/placeRegisterStore';
import useUserStore from '@/stores/useUserStore';
import { useRouter } from 'next/navigation';
import toast from 'react-hot-toast';

const useUploadFiles = () => {
const { placeList, initEntirePlaceList } = usePlaceRegisterStore();
const { nickname } = useUserStore();
const router = useRouter();

const handleUploadFiles = async () => {
// ์žฅ์†Œ ๋“ฑ๋ก ์ง„ํ–‰
Expand All @@ -23,6 +25,7 @@ const useUploadFiles = () => {
});

initEntirePlaceList();
router.push('/home');
} catch (error) {
// ์žฅ์†Œ ๋“ฑ๋ก ์‹คํŒจ
console.error(`์žฅ์†Œ ๋“ฑ๋กํ•˜๊ธฐ์—์„œ ๋ฐœ์ƒํ•œ ์—๋Ÿฌ: ${error}`);
Expand Down
Binary file modified 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/OnBoardingGame.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/OnBoardingPlace.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 4978a34

Please sign in to comment.