-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpage.tsx
More file actions
284 lines (270 loc) · 11.4 KB
/
page.tsx
File metadata and controls
284 lines (270 loc) · 11.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
"use client";
import React, { createContext, useContext, useEffect } from "react";
import { motion } from "framer-motion";
import Link from "next/link";
import { Button } from "@/components/ui/button";
import { Badge } from "@/components/ui/badge";
import { Compass3D } from "@/components/compass-3d";
import { ProjectCard } from "@/components/project-card";
import {
Star,
Github,
Code,
Users,
Award,
TrendingUp,
Heart,
} from "lucide-react";
import { useQuery } from "@tanstack/react-query";
import { Project } from "@/types/project";
export default function Home() {
// Fetch featured projects from database API
const basePath = process.env.NEXT_PUBLIC_BASE_PATH || "";
const { data: allProjects = [], isLoading, error } = useQuery({
queryKey: ["projects"],
queryFn: async (): Promise<Project[]> => {
const response = await fetch(`${basePath}/api/projects`);
if (!response.ok) {
// Fallback to JSON file if API fails
const fallbackResponse = await fetch(`${basePath}/data/projects.json`);
if (!fallbackResponse.ok) throw new Error("Failed to fetch projects");
return fallbackResponse.json();
}
return response.json();
},
});
// Filter featured projects
const featuredProjects = allProjects.filter((project) => project.featured);
const stats = [
{ value: "50k+", label: "Active Developers", icon: Users },
{ value: "25+", label: "Open Source Tools", icon: Code },
{ value: "100k+", label: "GitHub Stars", icon: Star },
{ value: "95%", label: "Developer Satisfaction", icon: Award },
];
return (
<div className="min-h-screen">
{/* Hero Section */}
<section className="relative bg-gradient-to-br from-slate-blue via-gray-800 to-navy-900 text-white overflow-hidden">
<div className="absolute inset-0 bg-black bg-opacity-20"></div>
<div className="relative max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-24 lg:py-32">
<div className="grid lg:grid-cols-2 gap-12 items-center">
<motion.div
className="space-y-8"
initial={{ opacity: 0, y: 30 }}
animate={{ opacity: 1, y: 0 }}
transition={{ duration: 0.8 }}
>
<div className="space-y-4">
<Badge className="bg-blue-accent/20 text-blue-accent border-blue-accent/30 px-4 py-2">
<Star className="w-4 h-4 mr-2" />
Open Source Excellence
</Badge>
<h1 className="text-4xl sm:text-5xl lg:text-6xl font-bold leading-tight">
Navigate Your{" "}
<span className="text-transparent bg-clip-text bg-gradient-to-r from-blue-accent to-professional-blue">
Development Journey
</span>
</h1>
<p className="text-xl text-gray-300 leading-relaxed max-w-2xl">
Professional open-source organization building innovative free
& premium software tools for developers and students
worldwide.
</p>
</div>
<div className="flex flex-col sm:flex-row gap-4">
<Link href="/projects">
<Button
size="lg"
className="bg-blue-accent hover:bg-blue-600 text-white px-8 py-4 text-lg font-semibold"
>
Browse Projects
</Button>
</Link>
<Link href="/mission">
<Button
size="lg"
variant="outline"
className="border-2 border-white text-white hover:bg-white hover:text-gray-900 px-8 py-4 text-lg font-semibold"
>
Get Started
</Button>
</Link>
</div>
<div className="flex items-center space-x-8 text-sm text-gray-300">
<div className="flex items-center space-x-2">
<Github className="w-5 h-5 text-blue-accent" />
<span>Open Source</span>
</div>
<div className="flex items-center space-x-2">
<Star className="w-5 h-5 text-blue-accent" />
<span>Free & Premium</span>
</div>
<div className="flex items-center space-x-2">
<Code className="w-5 h-5 text-blue-accent" />
<span>Developer Tools</span>
</div>
</div>
</motion.div>
{/* 3D Compass Visualization */}
<motion.div
className="flex justify-center lg:justify-end"
initial={{ opacity: 0, scale: 0.8 }}
animate={{ opacity: 1, scale: 1 }}
transition={{ duration: 1, delay: 0.3 }}
>
<Compass3D />
</motion.div>
</div>
</div>
</section>
{/* Featured Tools Section */}
<section className="py-20 bg-white dark:bg-gray-800">
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<motion.div
className="text-center mb-16"
initial={{ opacity: 0, y: 20 }}
whileInView={{ opacity: 1, y: 0 }}
viewport={{ once: true }}
>
<h2 className="text-3xl lg:text-4xl font-bold text-gray-900 dark:text-white mb-4">
Featured Developer Tools
</h2>
<p className="text-xl text-gray-600 dark:text-gray-300 max-w-3xl mx-auto">
Discover our most popular free and premium tools designed to
accelerate your development workflow
</p>
</motion.div>
<div className="grid md:grid-cols-2 lg:grid-cols-3 gap-8 mb-12">
{featuredProjects.length > 0 ? (
featuredProjects.map((project, index) => (
<motion.div
key={project.id}
initial={{ opacity: 0, y: 30 }}
whileInView={{ opacity: 1, y: 0 }}
viewport={{ once: true }}
transition={{ delay: index * 0.1 }}
>
<ProjectCard project={project} />
</motion.div>
))
) : allProjects.length === 0 ? (
// Loading state
<div className="col-span-full text-center py-12">
<div className="inline-block animate-spin rounded-full h-8 w-8 border-b-2 border-blue-accent mb-4"></div>
<h3 className="text-xl font-semibold text-gray-600 dark:text-gray-400 mb-2">
Loading Featured Projects...
</h3>
<p className="text-gray-500 dark:text-gray-500">
Discovering our best developer tools for you.
</p>
</div>
) : (
// No featured projects but projects exist
<div className="col-span-full text-center py-12">
<Code className="w-16 h-16 text-gray-400 dark:text-gray-600 mx-auto mb-4" />
<h3 className="text-xl font-semibold text-gray-600 dark:text-gray-400 mb-2">
No Featured Projects Yet
</h3>
<p className="text-gray-500 dark:text-gray-500 mb-4">
We have great tools available, but none are currently
featured.
</p>
<Link href="/projects">
<Button className="bg-blue-accent hover:bg-blue-600 text-white">
View All Projects
</Button>
</Link>
</div>
)}
</div>
<motion.div
className="text-center"
initial={{ opacity: 0 }}
whileInView={{ opacity: 1 }}
viewport={{ once: true }}
>
<Link href="/projects">
<Button
size="lg"
className="bg-gray-900 dark:bg-white text-white dark:text-gray-900 hover:bg-gray-800 dark:hover:bg-gray-100"
>
View All Projects
</Button>
</Link>
</motion.div>
</div>
</section>
{/* Community & Stats Section */}
{/* <section className="py-20 bg-gray-50 dark:bg-gray-900">
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div className="grid lg:grid-cols-2 gap-16 items-center">
<motion.div
className="space-y-8"
initial={{ opacity: 0, x: -30 }}
whileInView={{ opacity: 1, x: 0 }}
viewport={{ once: true }}
>
<div className="space-y-4">
<h2 className="text-3xl lg:text-4xl font-bold text-gray-900 dark:text-white">
Join Our Growing Community
</h2>
<p className="text-xl text-gray-600 dark:text-gray-300 leading-relaxed">
Connect with thousands of developers worldwide who trust
CodeCompass for their development needs. From students to
enterprise teams, our tools scale with your ambitions.
</p>
</div>
<div className="grid grid-cols-2 gap-8">
{stats.map(({ value, label, icon: Icon }, index) => (
<motion.div
key={label}
className="text-center lg:text-left"
initial={{ opacity: 0, y: 20 }}
whileInView={{ opacity: 1, y: 0 }}
viewport={{ once: true }}
transition={{ delay: index * 0.1 }}
>
<div className="flex items-center justify-center lg:justify-start mb-2">
<Icon className="w-6 h-6 text-blue-accent mr-2" />
<div className="text-3xl lg:text-4xl font-bold text-blue-accent">
{value}
</div>
</div>
<div className="text-gray-600 dark:text-gray-300">
{label}
</div>
</motion.div>
))}
</div>
<div className="flex flex-col sm:flex-row gap-4">
<Button className="bg-blue-accent hover:bg-blue-600 text-white">
<Users className="w-4 h-4 mr-2" />
Join Community
</Button>
<Button
variant="outline"
className="border-gray-300 dark:border-gray-600"
>
Documentation
</Button>
</div>
</motion.div>
<motion.div
className="relative"
initial={{ opacity: 0, x: 30 }}
whileInView={{ opacity: 1, x: 0 }}
viewport={{ once: true }}
>
<img
src="https://images.unsplash.com/photo-1498050108023-c5249f4df085?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=800&h=600"
alt="Modern developer workspace with multiple monitors"
className="rounded-2xl shadow-2xl w-full h-auto"
/>
<div className="absolute inset-0 bg-gradient-to-t from-blue-accent/20 to-transparent rounded-2xl"></div>
</motion.div>
</div>
</div>
</section> */}
</div>
);
}