File tree Expand file tree Collapse file tree 3 files changed +39
-21
lines changed Expand file tree Collapse file tree 3 files changed +39
-21
lines changed Original file line number Diff line number Diff line change @@ -9,9 +9,9 @@ export default async function Home() {
9
9
return (
10
10
< div className = "space-y-6 sm:space-y-8 2xl:space-y-10 h-full rounded-lg p-1 sm:p-7" >
11
11
{ /* 헤더 섹션 */ }
12
- < HeaderSection
13
- title = "Lazydino's DevLog"
14
- description = "내가 한걸 티내기 위해 만든 블로그"
12
+ < HeaderSection
13
+ title = "Lazydino's DevLog"
14
+ description = "내가 한걸 티내기 위해 만든 블로그"
15
15
/>
16
16
17
17
{ /* 포스트 그리드 */ }
@@ -33,4 +33,4 @@ export default async function Home() {
33
33
</ PostGrid >
34
34
</ div >
35
35
) ;
36
- }
36
+ }
Original file line number Diff line number Diff line change 3
3
import { ReactNode } from "react" ;
4
4
import { motion } from "framer-motion" ;
5
5
6
- export function HeaderSection ( { title, description } : { title : string ; description : string } ) {
6
+ export function HeaderSection ( {
7
+ title,
8
+ description,
9
+ } : {
10
+ title : string ;
11
+ description : string ;
12
+ } ) {
7
13
return (
8
- < motion . section
14
+ < motion . section
9
15
className = "space-y-2 sm:space-y-3 md:space-y-4"
10
16
initial = { { opacity : 0 , y : 20 } }
11
17
animate = { { opacity : 1 , y : 0 } }
12
18
transition = { { duration : 0.2 , ease : "easeOut" } }
13
19
>
14
- < motion . h1
20
+ < motion . h1
15
21
className = "text-lg sm:text-xl lg:text-2xl font-bold"
16
22
initial = { { opacity : 0 } }
17
23
animate = { { opacity : 1 } }
18
24
transition = { { delay : 0.1 , duration : 0.2 } }
19
25
>
20
26
{ title }
21
27
</ motion . h1 >
22
- < motion . p
28
+ < motion . p
23
29
className = "text-sm sm:text-base text-muted-foreground"
24
30
initial = { { opacity : 0 } }
25
31
animate = { { opacity : 1 } }
@@ -45,18 +51,24 @@ export function PostGrid({ children }: { children: ReactNode }) {
45
51
) ;
46
52
}
47
53
48
- export function PostItem ( { children, index } : { children : ReactNode ; index : number } ) {
54
+ export function PostItem ( {
55
+ children,
56
+ index,
57
+ } : {
58
+ children : ReactNode ;
59
+ index : number ;
60
+ } ) {
49
61
return (
50
62
< motion . div
51
63
initial = { { opacity : 0 , y : 20 } }
52
64
animate = { { opacity : 1 , y : 0 } }
53
- transition = { {
65
+ transition = { {
54
66
delay : 0.05 * ( index % 3 ) + 0.25 ,
55
67
duration : 0.2 ,
56
- ease : "easeOut"
68
+ ease : "easeOut" ,
57
69
} }
58
70
>
59
71
{ children }
60
72
</ motion . div >
61
73
) ;
62
- }
74
+ }
Original file line number Diff line number Diff line change 1
1
"use client" ;
2
2
3
- import { ReactNode } from "react" ;
3
+ import { ReactNode , useEffect , useState } from "react" ;
4
4
import { motion } from "framer-motion" ;
5
5
import Link from "next/link" ;
6
6
import { ArrowLeft } from "lucide-react" ;
@@ -15,15 +15,21 @@ import { ArrowLeft } from "lucide-react";
15
15
// }
16
16
17
17
export default function PostAnimation ( { children } : { children : ReactNode } ) {
18
+ const [ mounted , setMounted ] = useState ( false ) ;
19
+ useEffect ( ( ) => {
20
+ setMounted ( true ) ;
21
+ } , [ ] ) ;
18
22
return (
19
- < motion . article
20
- className = "rounded-lg p-2 sm:p-7 max-w-3xl mx-auto"
21
- initial = { { opacity : 0 , y : 20 } }
22
- animate = { { opacity : 1 , y : 0 } }
23
- transition = { { duration : 0.2 , ease : "easeOut" } }
24
- >
25
- { children }
26
- </ motion . article >
23
+ mounted && (
24
+ < motion . article
25
+ className = "rounded-lg p-2 sm:p-7 max-w-3xl mx-auto"
26
+ initial = { { opacity : 0 , y : 20 } }
27
+ animate = { { opacity : 1 , y : 0 } }
28
+ transition = { { duration : 0.2 , ease : "easeOut" } }
29
+ >
30
+ { children }
31
+ </ motion . article >
32
+ )
27
33
) ;
28
34
}
29
35
You can’t perform that action at this time.
0 commit comments