Skip to content

Commit

Permalink
Merge pull request #556 from depromeet/feat/apng
Browse files Browse the repository at this point in the history
feat : 성공 apng 및 로띠 적용
  • Loading branch information
wade3420 authored Feb 13, 2024
2 parents f73ef39 + ecac3be commit 9821c0a
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 11 deletions.
Binary file added public/images/bg-gradient.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 public/images/coin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
48 changes: 43 additions & 5 deletions src/app/guest/mission/success/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use client';
import Image from 'next/image';
import { useRouter } from 'next/navigation';
import lottieJson from '@/assets/lotties/lottieExample.json';
import lottieJson from '@/assets/lotties/coin-double.json';
import Button from '@/components/Button/Button';
import { ROUTER } from '@/constants/router';
import { css } from '@styled-system/css';
Expand All @@ -13,14 +14,17 @@ export default function GuestMissionSuccessPage() {
return (
<main className={mainWrapperCss}>
<div className={containerCss}>
<Image className={gradientCss} src="/images/bg-gradient.png" alt="success" fill />
<div className={contentWrapperCss}>
<Lottie className={lottieCss} loop animationData={lottieJson} play />

<div className={lottieWrapperCss}>
<Image className={imageCss} src="/images/coin.png" alt="success" fill />
</div>
<div className={titleWrapperCss}>
<span className={titleCss}>오늘의 미션완료!</span>
<span className={subTitleCss}>{'잘 하셨어요, 오늘도 한 걸음 성장하셨네요 :)'}</span>
</div>
<div className={lottieWrapperCss}>
<Lottie loop animationData={lottieJson} play />
</div>
</div>
<Button type="button" size="large" variant="primary" onClick={onClickConfirmButton}>
<span className={buttonTextCss}>10분만 제대로 즐기기</span>
Expand All @@ -30,6 +34,30 @@ export default function GuestMissionSuccessPage() {
);
}

const gradientCss = css({
height: '100vh',
width: '100%',
maxWidth: 'maxWidth',
position: 'absolute',
top: '0',
objectFit: 'cover',
backgroundPosition: 'center',
left: '0',
});

const lottieCss = css({
position: 'absolute',
top: '0',
left: '0',
width: '100%',
height: '100%',
});

const imageCss = css({
width: '50%',
background: 'transparent',
});

const mainWrapperCss = css({
display: 'flex',
flexDirection: 'column',
Expand All @@ -38,6 +66,7 @@ const mainWrapperCss = css({
});

const containerCss = css({
position: 'relative',
display: 'flex',
flex: 1,
flexDirection: 'column',
Expand Down Expand Up @@ -70,7 +99,16 @@ const subTitleCss = css({
color: 'text.secondary',
});

const lottieWrapperCss = css({});
const lottieWrapperCss = css({
position: 'relative',
minHeight: '260px',
maxWidth: '100vw',
margin: '24px auto 0 auto',
width: '50%',
'& img': {
objectFit: 'contain',
},
});

const buttonTextCss = css({
textStyle: 'subtitle4',
Expand Down
39 changes: 34 additions & 5 deletions src/app/record/success/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
import { useEffect } from 'react';
import Image from 'next/image';
import { useRouter } from 'next/navigation';
// import lottieJson from '@/assets/lotties/lottieExample.json';
import lottieJson from '@/assets/lotties/coin-double.json';
import Button from '@/components/Button/Button';
import { ROUTER } from '@/constants/router';
import { NATIVE_METHODS } from '@/utils/nativeMethod';
import { css } from '@styled-system/css';
// import Lottie from 'react-lottie-player';
import Lottie from 'react-lottie-player';

export default function MissionSuccessPage() {
const router = useRouter();
Expand All @@ -20,11 +20,13 @@ export default function MissionSuccessPage() {

return (
<main className={mainWrapperCss}>
<Image className={gradientCss} src="/images/bg-gradient.png" alt="success" fill />
<div className={containerCss}>
<div className={contentWrapperCss}>
<Lottie className={lottieCss} loop animationData={lottieJson} play />

<div className={lottieWrapperCss}>
<Image src="/assets/mission/10mm-success.svg" alt="success" fill />
{/* <Lottie loop animationData={lottieJson} play /> */}
<Image className={imageCss} src="/images/coin.png" alt="success" fill />
</div>
<div className={titleWrapperCss}>
<span className={titleCss}>오늘의 미션완료!</span>
Expand All @@ -41,11 +43,31 @@ export default function MissionSuccessPage() {
);
}

const lottieCss = css({
position: 'absolute',
top: '0',
left: '0',
width: '100%',
height: '100%',
});

const gradientCss = css({
height: '100vh',
width: '100%',
maxWidth: 'maxWidth',
position: 'absolute',
top: '0',
objectFit: 'cover',
backgroundPosition: 'center',
left: '0',
});

const mainWrapperCss = css({
display: 'flex',
flexDirection: 'column',
backgroundColor: 'bg.surface2',
height: '100vh',
position: 'relative',
});

const buttonWrapperCss = css({
Expand All @@ -66,6 +88,7 @@ const contentWrapperCss = css({
display: 'flex',
flexDirection: 'column',
animation: 'fadeIn 0.3s linear',
position: 'relative',
});

const titleWrapperCss = css({
Expand All @@ -87,11 +110,17 @@ const subTitleCss = css({
color: 'text.secondary',
});

const imageCss = css({
width: '50%',
background: 'transparent',
});

const lottieWrapperCss = css({
position: 'relative',
minHeight: '260px',
maxWidth: '100vw',
width: '100%',
margin: '24px auto 0 auto',
width: '50%',
'& img': {
objectFit: 'contain',
},
Expand Down
1 change: 1 addition & 0 deletions src/assets/lotties/coin-double.json

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion src/assets/lotties/lottieExample.json

This file was deleted.

0 comments on commit 9821c0a

Please sign in to comment.