From 7de09570c0d7907424c30f492207e80ff69e4061 Mon Sep 17 00:00:00 2001 From: polwex Date: Thu, 29 May 2025 15:54:51 +0700 Subject: very pretty --- src/pages/index.tsx | 258 ++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 199 insertions(+), 59 deletions(-) (limited to 'src/pages/index.tsx') diff --git a/src/pages/index.tsx b/src/pages/index.tsx index 48fa46e..7b66f5d 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -1,92 +1,232 @@ import { Link } from "waku"; +import { getContextData } from "waku/middleware/context"; +import { ArrowRightIcon, BookOpenIcon, BrainIcon, LanguagesIcon, GraduationCapIcon } from "lucide-react"; import { Progress } from "@/components/ui/progress"; -import { getContextData } from "waku/middleware/context"; +import { Button } from "@/components/ui/button"; +import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "@/components/ui/card"; +import Navbar from "@/components/Navbar"; type LanguageChoice = "th" | "en" | "zh" | "ja" | "es" | "fr"; -type LangMeta = { flag: string; name: string }; +type LangMeta = { flag: string; name: string; level?: string; progress?: number; totalCards?: number; dueCards?: number }; + const langs: Record = { - th: { flag: "🇹🇭", name: "Thai" }, - en: { flag: "🇬🇧", name: "English" }, - zh: { flag: "🇨🇳", name: "Chinese" }, - ja: { flag: "🇯🇵", name: "Japanese" }, - es: { flag: "🇪🇸", name: "Spanish" }, - fr: { flag: "🇫🇷", name: "French" }, + th: { flag: "🇹🇭", name: "Thai", level: "Beginner", progress: 32, totalCards: 245, dueCards: 12 }, + en: { flag: "🇬🇧", name: "English", level: "Advanced", progress: 87, totalCards: 542, dueCards: 5 }, + zh: { flag: "🇨🇳", name: "Chinese", level: "Intermediate", progress: 59, totalCards: 378, dueCards: 8 }, + ja: { flag: "🇯🇵", name: "Japanese", level: "Beginner", progress: 23, totalCards: 198, dueCards: 15 }, + es: { flag: "🇪🇸", name: "Spanish", level: "Not Started", progress: 0, totalCards: 312, dueCards: 0 }, + fr: { flag: "🇫🇷", name: "French", level: "Not Started", progress: 0, totalCards: 289, dueCards: 0 }, }; export default async function HomePage() { - const { user } = getContextData(); + const { user } = getContextData() as any; + + // Get due cards count for the progress badge + const totalDueCards = Object.values(langs) + .reduce((sum, lang) => sum + (lang.dueCards || 0), 0); return (
-
+ + + {/* Hero section */} +
-
-
-

Prosody

+
+
+

+ Master Languages with Sorlang +

+

+ Boost your language learning with our scientifically proven spaced repetition system. Track progress, analyze text, and learn efficiently. +

+
+ + + + + + +
+
+
+
+
+
+ 🇹🇭 +
+
+ 🇨🇳 +
+
+ 🇯🇵 +
+
+ 🇬🇧 +
+
+
+ SRS +
+
+ Spaced Repetition System +
+
+
+
- - {/* Desktop Navigation */} -
- - {/* Mobile Navigation */} -
-
-

Your Languages

- - - - +
+ + {/* Feature highlights */} +
+
+
+

Learning Features

+

+ Tools designed to accelerate your language learning journey +

+
+ +
+ + +
+ +
+ Spaced Repetition + + Optimized review schedule based on your performance + +
+ +

+ Our SRS algorithm determines the optimal time for you to review each card, helping you memorize efficiently. +

+
+
+ + + +
+ +
+ Text Analysis + + Break down complex text into manageable pieces + +
+ +

+ Parse any text to analyze grammar, vocabulary, and patterns to enhance your understanding. +

+
+
+ + + +
+ +
+ Progress Tracking + + Monitor your learning journey with detailed statistics + +
+ +

+ Track your progress across different languages, see your mastery level, and identify areas for improvement. +

+
+
+
+
+
+ + {/* Languages section */} +
+
+
+

Your Languages

+ {totalDueCards > 0 && ( +
+ {totalDueCards} cards due for review +
+ )} +
+ +
+ {Object.entries(langs).map(([langCode, langData]) => ( + + ))} +
+ +
+ + + +
+
); } -const getData = async () => { - const data = { - title: "Waku", - headline: "Waku", - body: "Hello world!", - }; - - return data; -}; - export const getConfig = async () => { return { render: "dynamic", } as const; }; -async function LanguageItem({ lang }: { lang: LanguageChoice }) { +function LanguageItem({ lang, langData }: { lang: LanguageChoice, langData: LangMeta }) { return ( -
-
-
-
{langs[lang].flag}
-
{langs[lang].name}
+ + +
+
+
{langData.flag}
+
+ {langData.name} + {langData.level} +
+
+ {langData.dueCards > 0 && ( +
+ {langData.dueCards} due +
+ )}
- -
-
+ + +
+ +
+ {langData.progress}% complete + {langData.totalCards} cards +
+
+
+ + + + ); } -- cgit v1.2.3