-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from Redot-Engine/feature/landing-page
Implement Localization and Internationalization Features
- Loading branch information
Showing
51 changed files
with
3,970 additions
and
308 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,4 +14,3 @@ junit.xml | |
docs | ||
public | ||
bun.lockb | ||
locales |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
"use server"; | ||
|
||
import { cookies } from "next/headers"; | ||
|
||
export async function setLanguage(value: string) { | ||
const cookieStore = await cookies(); | ||
cookieStore.set("locale", value); | ||
} | ||
|
||
export async function getLanguage() { | ||
const cookieStore = await cookies(); | ||
return cookieStore.get("locale")?.value || "en"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { useTranslations } from "next-intl"; | ||
import { Button } from "@/components/ui/button"; | ||
import Link from "next/link"; | ||
import { Header } from "@/components/header"; | ||
import { Footer } from "@/components/footer"; | ||
import Image from "next/image"; | ||
|
||
export const runtime = "edge"; | ||
|
||
export default function NotFound() { | ||
const t = useTranslations("notFound"); | ||
|
||
return ( | ||
<section className="flex min-h-screen flex-col"> | ||
<Header /> | ||
<div className="flex-grow overflow-x-clip bg-gradient-to-b from-[#ffffff] to-[#FFD2D2] py-32"> | ||
<div className="mx-auto max-w-[540px]"> | ||
<div className="flex flex-col items-center justify-center gap-4"> | ||
<Image | ||
src="https://image.redotengine.org/redotchan.png" | ||
alt="Redotchan" | ||
width={160} | ||
height={160} | ||
/> | ||
<div className="flex flex-col"> | ||
<h2 className="mt-5 text-center text-4xl font-bold tracking-tighter md:text-[54px] md:leading-[60px]"> | ||
{t("title")} | ||
</h2> | ||
<p className="mt-5 text-center text-xl tracking-tighter text-black/60 md:text-[22px] md:leading-[30px]"> | ||
{t("description")} | ||
</p> | ||
</div> | ||
<Button asChild> | ||
<Link href="/">{t("goBack")}</Link> | ||
</Button> | ||
</div> | ||
</div> | ||
</div> | ||
<Footer /> | ||
</section> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import { useTranslations } from "next-intl"; | ||
import { motion } from "motion/react"; | ||
import { useInView } from "react-intersection-observer"; | ||
|
||
interface HeaderSelectionProps { | ||
section: string; | ||
} | ||
|
||
export default function HeaderSection({ section }: HeaderSelectionProps) { | ||
const { ref, inView } = useInView({ | ||
threshold: 0.1, | ||
triggerOnce: true, | ||
}); | ||
|
||
const t = useTranslations(section); | ||
|
||
return ( | ||
<> | ||
<div className="mx-auto max-w-[540px]" ref={ref}> | ||
<div className="flex justify-center"> | ||
<motion.div | ||
initial={{ opacity: 0, y: 20 }} | ||
animate={inView ? { opacity: 1, y: 0 } : {}} | ||
transition={{ duration: 0.5, delay: 0.2 }} | ||
className="flex h-9 items-center rounded-md border border-input bg-background px-3 text-center text-sm font-medium hover:bg-accent" | ||
> | ||
{t("badge")} | ||
</motion.div> | ||
</div> | ||
|
||
<motion.h2 | ||
initial={{ opacity: 0, y: 20 }} | ||
animate={inView ? { opacity: 1, y: 0 } : {}} | ||
transition={{ duration: 0.5, delay: 0.4 }} | ||
className="mt-5 text-center text-4xl font-bold tracking-tighter md:text-[54px] md:leading-[60px]" | ||
dangerouslySetInnerHTML={{ __html: t("title") }} | ||
/> | ||
|
||
<motion.p | ||
initial={{ opacity: 0, y: 20 }} | ||
animate={inView ? { opacity: 1, y: 0 } : {}} | ||
transition={{ duration: 0.5, delay: 0.6 }} | ||
className="mt-5 text-center text-xl tracking-tighter text-black/60 md:text-[22px] md:leading-[30px]" | ||
> | ||
{t("description")} | ||
</motion.p> | ||
</div> | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.