feat: add about page, global stats counter, and blitz screen updates

- Create about page with game modes, technologies, and paliers
- Add stats API endpoint for global game counter
- Update home screen with emoji-based tier system (🌱-🚀)
- Rewrite BlitzScreen to match new puzzle-based win/lose phases
- Add simple-icons package for tech stack icons
- Update metadata with wikirush.xyz domain
- Fix em dashes to hyphens throughout codebase
- Update footer with privacy and about links
This commit is contained in:
jessy-david-dev
2026-04-10 22:26:24 +02:00
parent dc12abf796
commit 47b8de0b67
17 changed files with 487 additions and 2989 deletions
+3 -3
View File
@@ -16,7 +16,7 @@ async function getOrCreatePuzzle() {
return prisma.dailyPuzzle.create({ data: { date, startArticle: start, targetArticle: target } });
}
// GET retourne le puzzle du jour + si l'utilisateur a déjà joué
// GET - retourne le puzzle du jour + si l'utilisateur a déjà joué
export async function GET() {
const session = await auth();
const puzzle = await getOrCreatePuzzle();
@@ -35,7 +35,7 @@ export async function GET() {
});
}
// POST soumettre un résultat
// POST - soumettre un résultat
export async function POST(req: Request) {
const session = await auth();
if (!session?.user?.id) return NextResponse.json({ error: "Non connecté" }, { status: 401 });
@@ -50,7 +50,7 @@ export async function POST(req: Request) {
return NextResponse.json({ error: "Puzzle invalide" }, { status: 400 });
}
// Upsert on n'enregistre qu'une fois
// Upsert - on n'enregistre qu'une fois
const result = await prisma.dailyResult.upsert({
where: { puzzleId_userId: { puzzleId, userId: session.user.id } },
create: { puzzleId, userId: session.user.id, path: JSON.stringify(path), clicks, timeSeconds, won },
+2 -2
View File
@@ -2,7 +2,7 @@ import { NextRequest, NextResponse } from "next/server";
import { auth } from "../../../auth";
import { prisma } from "../../../lib/prisma";
// POST /api/games sauvegarder une partie
// POST /api/games - sauvegarder une partie
export async function POST(req: NextRequest) {
const session = await auth();
if (!session?.user?.id) {
@@ -36,7 +36,7 @@ export async function POST(req: NextRequest) {
return NextResponse.json({ id: game.id });
}
// GET /api/games historique de l'utilisateur connecté
// GET /api/games - historique de l'utilisateur connecté
export async function GET() {
const session = await auth();
if (!session?.user?.id) {
+17
View File
@@ -0,0 +1,17 @@
import { NextResponse } from "next/server";
import { prisma } from "../../../lib/prisma";
export const revalidate = 60; // revalide toutes les 60s
export async function GET() {
const todayStart = new Date();
todayStart.setHours(0, 0, 0, 0);
const todayCount = await prisma.game.count({
where: { playedAt: { gte: todayStart } },
});
const totalCount = await prisma.game.count();
return NextResponse.json({ today: todayCount, total: totalCount });
}