@@ -8,38 +8,174 @@ export default function Page(): React.ReactElement {
8
8
( a , b ) => new Date ( b . data . date ) . getTime ( ) - new Date ( a . data . date ) . getTime ( ) ,
9
9
) ;
10
10
11
- const svg = `<svg viewBox='0 0 500 500' xmlns='http://www.w3.org/2000/svg'>
12
- <filter id='noiseFilter'>
13
- <feTurbulence
14
- type='fractalNoise'
15
- baseFrequency='0.65'
16
- numOctaves='3'
17
- stitchTiles='stitch'/>
18
- </filter>
19
-
20
- <rect width='100%' height='100%' filter='url(#noiseFilter)'/>
21
- </svg>` ;
22
-
23
11
return (
24
- < main className = "container max-sm:px-0 md:py-12" >
25
- < div className = "grid grid-cols-1 border md:grid-cols-3 lg:grid-cols-4" >
26
- { posts . map ( ( post ) => (
27
- < Link
28
- key = { post . url }
29
- href = { post . url }
30
- className = "flex flex-col bg-fd-card p-4 transition-colors hover:bg-fd-accent hover:text-fd-accent-foreground"
31
- >
32
- < p className = "font-medium" > { post . data . title } </ p >
33
- < p className = "text-sm text-fd-muted-foreground" >
34
- { post . data . description }
12
+ < main className = "min-h-screen bg-fd-background" >
13
+ { /* Hero Section */ }
14
+ < section className = "w-full py-20 relative overflow-hidden" >
15
+ { /* Background decoration */ }
16
+ < div className = "absolute inset-0 bg-fd-muted opacity-50" />
17
+ < div className = "absolute top-0 left-1/4 w-96 h-96 bg-purple-100 dark:bg-purple-900/20 rounded-full blur-3xl opacity-30" />
18
+ < div className = "absolute bottom-0 right-1/4 w-96 h-96 bg-blue-100 dark:bg-blue-900/20 rounded-full blur-3xl opacity-30" />
19
+
20
+ < div className = "container max-w-6xl mx-auto px-6 relative z-10" >
21
+ < div className = "text-center" >
22
+ < h1 className = "text-5xl md:text-7xl font-extrabold text-fd-foreground mb-6 leading-tight" >
23
+ Blog
24
+ </ h1 >
25
+ < p className = "text-xl md:text-2xl text-fd-muted-foreground max-w-3xl mx-auto leading-relaxed" >
26
+ Insights, tutorials, and updates about Next.js
27
+ internationalization
35
28
</ p >
29
+ </ div >
30
+ </ div >
31
+ </ section >
36
32
37
- < p className = "mt-auto pt-4 text-xs text-fd-muted-foreground" >
38
- { new Date ( post . data . date ?? post . file . name ) . toDateString ( ) }
33
+ { /* Blog Posts Grid */ }
34
+ < section className = "container max-w-6xl mx-auto px-6 py-16" >
35
+ { posts . length === 0 ? (
36
+ < div className = "text-center py-20" >
37
+ < div className = "w-24 h-24 mx-auto mb-6 bg-fd-muted rounded-full flex items-center justify-center" >
38
+ < svg
39
+ className = "w-12 h-12 text-fd-muted-foreground"
40
+ fill = "none"
41
+ stroke = "currentColor"
42
+ viewBox = "0 0 24 24"
43
+ >
44
+ < title > No posts available</ title >
45
+ < path
46
+ strokeLinecap = "round"
47
+ strokeLinejoin = "round"
48
+ strokeWidth = { 2 }
49
+ d = "M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.746 0 3.332.477 4.5 1.253v13C19.832 18.477 18.246 18 16.5 18c-1.746 0-3.332.477-4.5 1.253"
50
+ />
51
+ </ svg >
52
+ </ div >
53
+ < h3 className = "text-2xl font-bold text-fd-foreground mb-2" >
54
+ No posts yet
55
+ </ h3 >
56
+ < p className = "text-fd-muted-foreground" >
57
+ Check back soon for new content!
39
58
</ p >
40
- </ Link >
41
- ) ) }
42
- </ div >
59
+ </ div >
60
+ ) : (
61
+ < div className = "space-y-16" >
62
+ { /* Featured Post */ }
63
+ { posts . length > 0 && (
64
+ < div >
65
+ < div className = "flex items-center gap-3 mb-8" >
66
+ < h2 className = "text-3xl font-bold text-fd-foreground" >
67
+ Latest Post
68
+ </ h2 >
69
+ < span className = "px-3 py-1 bg-fd-accent text-fd-accent-foreground text-sm font-medium rounded-full" >
70
+ Featured
71
+ </ span >
72
+ </ div >
73
+ < Link
74
+ href = { posts [ 0 ] . url }
75
+ className = "group block bg-fd-card border border-fd-border rounded-2xl overflow-hidden shadow-lg hover:shadow-2xl transition-all duration-300 hover:scale-[1.02] relative"
76
+ >
77
+ < div className = "absolute inset-0 bg-purple-50 dark:bg-purple-900/10 opacity-0 group-hover:opacity-100 transition-opacity duration-300" />
78
+ < div className = "relative p-8 md:p-12" >
79
+ < div className = "flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4 mb-6" >
80
+ < time className = "text-fd-muted-foreground" >
81
+ { new Date (
82
+ posts [ 0 ] . data . date ?? posts [ 0 ] . file . name ,
83
+ ) . toLocaleDateString ( 'en-US' , {
84
+ year : 'numeric' ,
85
+ month : 'long' ,
86
+ day : 'numeric' ,
87
+ } ) }
88
+ </ time >
89
+ < div className = "flex items-center text-purple-600 dark:text-purple-400 font-medium group-hover:translate-x-1 transition-transform duration-300" >
90
+ < span className = "mr-2" > Read more</ span >
91
+ < svg
92
+ className = "w-4 h-4"
93
+ fill = "none"
94
+ stroke = "currentColor"
95
+ viewBox = "0 0 24 24"
96
+ >
97
+ < title > Arrow right</ title >
98
+ < path
99
+ strokeLinecap = "round"
100
+ strokeLinejoin = "round"
101
+ strokeWidth = { 2 }
102
+ d = "M9 5l7 7-7 7"
103
+ />
104
+ </ svg >
105
+ </ div >
106
+ </ div >
107
+ < h3 className = "text-3xl md:text-4xl font-bold text-fd-foreground mb-4 group-hover:text-purple-600 dark:group-hover:text-purple-400 transition-colors duration-300" >
108
+ { posts [ 0 ] . data . title }
109
+ </ h3 >
110
+ < p className = "text-lg text-fd-muted-foreground leading-relaxed" >
111
+ { posts [ 0 ] . data . description }
112
+ </ p >
113
+ </ div >
114
+ </ Link >
115
+ </ div >
116
+ ) }
117
+
118
+ { /* Other Posts Grid */ }
119
+ { posts . length > 1 && (
120
+ < div >
121
+ < h2 className = "text-3xl font-bold text-fd-foreground mb-8" >
122
+ All Posts
123
+ </ h2 >
124
+ < div className = "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6" >
125
+ { posts . slice ( 1 ) . map ( ( post ) => (
126
+ < Link
127
+ key = { post . url }
128
+ href = { post . url }
129
+ className = "group block bg-fd-card border border-fd-border rounded-xl overflow-hidden shadow-lg hover:shadow-xl transition-all duration-300 hover:scale-105 relative"
130
+ >
131
+ < div className = "absolute inset-0 bg-purple-50 dark:bg-purple-900/10 opacity-0 group-hover:opacity-100 transition-opacity duration-300" />
132
+ < div className = "relative p-6" >
133
+ < div className = "mb-4" >
134
+ < time className = "text-sm text-fd-muted-foreground" >
135
+ { new Date (
136
+ post . data . date ?? post . file . name ,
137
+ ) . toLocaleDateString ( 'en-US' , {
138
+ year : 'numeric' ,
139
+ month : 'short' ,
140
+ day : 'numeric' ,
141
+ } ) }
142
+ </ time >
143
+ </ div >
144
+
145
+ < h3 className = "text-xl font-bold text-fd-foreground mb-3 line-clamp-2 group-hover:text-purple-600 dark:group-hover:text-purple-400 transition-colors duration-300" >
146
+ { post . data . title }
147
+ </ h3 >
148
+
149
+ < p className = "text-fd-muted-foreground text-sm leading-relaxed mb-4 line-clamp-3" >
150
+ { post . data . description }
151
+ </ p >
152
+
153
+ < div className = "flex items-center text-purple-600 dark:text-purple-400 text-sm font-medium opacity-0 group-hover:opacity-100 transition-all duration-300 transform translate-y-2 group-hover:translate-y-0" >
154
+ < span className = "mr-2" > Read article</ span >
155
+ < svg
156
+ className = "w-4 h-4 transition-transform duration-300 group-hover:translate-x-1"
157
+ fill = "none"
158
+ stroke = "currentColor"
159
+ viewBox = "0 0 24 24"
160
+ >
161
+ < title > Arrow right</ title >
162
+ < path
163
+ strokeLinecap = "round"
164
+ strokeLinejoin = "round"
165
+ strokeWidth = { 2 }
166
+ d = "M9 5l7 7-7 7"
167
+ />
168
+ </ svg >
169
+ </ div >
170
+ </ div >
171
+ </ Link >
172
+ ) ) }
173
+ </ div >
174
+ </ div >
175
+ ) }
176
+ </ div >
177
+ ) }
178
+ </ section >
43
179
</ main >
44
180
) ;
45
181
}
0 commit comments