Skip to content

Commit

Permalink
Merge pull request #41 from Redot-Engine/chore/404-page-improvements
Browse files Browse the repository at this point in the history
Enhance NotFound Page Layout
  • Loading branch information
charlottewiltshire0 authored Jan 10, 2025
2 parents b60caf7 + 53ca2d5 commit cb826a4
Show file tree
Hide file tree
Showing 34 changed files with 650 additions and 119 deletions.
111 changes: 86 additions & 25 deletions app/not-found.tsx
Original file line number Diff line number Diff line change
@@ -1,42 +1,103 @@
"use client";

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";
import {
IconArrowLeft,
IconBook,
IconCube,
IconMessages,
IconPointFilled,
} from "@tabler/icons-react";
import { Separator } from "@/components/ui/separator";
import React from "react";
import { links } from "@/constants/links";
import { useRouter } from "next/navigation";
import { SectionLink } from "@/components/SectionLink";

export const runtime = "edge";

export default function NotFound() {
const router = useRouter();
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 className="relative dark:bg-black">
<div className="absolute inset-0 z-0 flex h-[25rem] items-center justify-center bg-white bg-grid-black/[0.1] dark:bg-black dark:bg-grid-white/[0.1]">
{/* Radial gradient for the container to give a faded look */}
<div className="pointer-events-none absolute inset-0 flex items-center justify-center bg-white [mask-image:radial-gradient(ellipse_at_center,transparent_20%,black)] dark:bg-black"></div>
</div>
<section className="relative z-10">
<Header />
<div className="px-5 py-24">
<div className="flex flex-col items-center justify-center gap-16">
<div className="mx-auto flex max-w-[768px] flex-col text-center">
<div className="space-y-12">
<div className="space-y-6">
<div className="flex flex-col items-center gap-4">
<div className="flex h-8 w-fit items-center gap-2 rounded-md border border-input bg-background px-2 text-sm font-medium">
<IconPointFilled className="h-4 w-4 text-rose-600" />
{t("code")}
</div>
<h2 className="text-4xl font-bold tracking-tighter text-zinc-900 dark:text-white md:text-6xl">
{t("title")}
</h2>
</div>
<p className="text-lg text-zinc-500 dark:text-zinc-400 md:text-xl">
{t("description")}
</p>
</div>

<div className="flex flex-col justify-center gap-3 md:flex-row">
<Button
size="lg"
variant="outline"
onClick={() => router.back()}
asChild
>
<Link href="/">
<IconArrowLeft />
{t("goBack")}
</Link>
</Button>
<Button size="lg" asChild>
<Link href="/">{t("goHome")}</Link>
</Button>
</div>
</div>
</div>
<div className="mx-auto flex max-w-[560px] flex-col gap-5 sm:w-[560px]">
<Separator />
<SectionLink
icon={<IconCube className="h-6 w-6" />}
href={links.documentation}
title={t("documentation.title")}
description={t("documentation.description")}
/>

<Separator />
<SectionLink
icon={<IconBook className="h-6 w-6" />}
href="/blog"
title={t("ourBlog.title")}
description={t("ourBlog.description")}
/>

<Separator />
<SectionLink
icon={<IconMessages className="h-6 w-6" />}
href="/contact"
title={t("contactUs.title")}
description={t("contactUs.description")}
/>
</div>
<Button asChild>
<Link href="/">{t("goBack")}</Link>
</Button>
</div>
</div>
</div>
<Footer />
</section>
<Footer />
</section>
</div>
);
}
36 changes: 36 additions & 0 deletions components/SectionLink.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import { IconArrowRight } from "@tabler/icons-react";
import Link from "next/link";
import React from "react";

interface SectionLinkProps {
readonly href: string;
readonly icon: React.ReactNode;
readonly title: string;
readonly description: string;
}

export const SectionLink = ({
href,
icon,
title,
description,
}: Readonly<SectionLinkProps>) => (
<Link href={href}>
<div className="group flex w-full flex-row items-center justify-between gap-5">
<div className="flex flex-col gap-5 md:flex-row">
<div>
<div className="border-zinc-250 flex h-12 w-12 items-center justify-center rounded-lg border">
{icon}
</div>
</div>
<div className="flex w-full flex-col gap-2">
<h3 className="text-xl font-medium text-zinc-900 dark:text-white">
{title}
</h3>
<p className="text-zinc-500 dark:text-zinc-400">{description}</p>
</div>
</div>
<IconArrowRight className="text-zinc-400 transition-all duration-300 group-hover:text-zinc-900" />
</div>
</Link>
);
2 changes: 1 addition & 1 deletion components/ui/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const buttonVariants = cva(
size: {
default: "h-10 px-4 py-2",
sm: "h-9 rounded-md px-3",
lg: "h-11 rounded-md px-8",
lg: "h-12 rounded-md px-8",
icon: "h-10 w-10",
},
},
Expand Down
20 changes: 17 additions & 3 deletions locales/bg/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,23 @@
}
},
"notFound": {
"title": "Упс! Страницата не е намерена",
"description": "Изглежда сте навлезли в непознато място... ние също не знаем къде отиде тази страница!",
"goBack": "Върнете се назад"
"code": "404 грешка",
"title": "Не можем да намерим тази страница",
"description": "Страницата, която търсите, е недостъпна или е преместена.",
"goBack": "Върнете се обратно",
"goHome": "Отидете на началната страница",
"documentation": {
"title": "Документация",
"description": "Запознайте се, за да научите всичко за нашия двигател."
},
"ourBlog": {
"title": "Нашият блог",
"description": "Прочетете последните публикации в нашия блог."
},
"contactUs": {
"title": "Свържете се с нас",
"description": "Свържете се с нас за запитвания или поддръжка."
}
},
"downloadHero": {
"downloadForOS": "Изтеглете Redot за {platform}",
Expand Down
20 changes: 17 additions & 3 deletions locales/cs/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,23 @@
}
},
"notFound": {
"title": "Oops! Stránka nenalezena",
"description": "Vypadá to, že jste se dostali do neznámé oblasti... ani my nevíme, kam tato stránka zmizela!",
"goBack": "Zpět"
"code": "Chyba 404",
"title": "Tuto stránku nemůžeme najít",
"description": "Stránka, kterou hledáte, je buď nedostupná, nebo byla přesunuta.",
"goBack": "Zpět",
"goHome": "Domů",
"documentation": {
"title": "Dokumentace",
"description": "Ponořte se a naučte se vše o našem enginu."
},
"ourBlog": {
"title": "Náš blog",
"description": "Přečtěte si nejnovější příspěvky na našem blogu."
},
"contactUs": {
"title": "Kontaktujte nás",
"description": "Kontaktujte nás pro dotazy nebo podporu."
}
},
"downloadHero": {
"downloadForOS": "Stáhnout Redot pro {platform}",
Expand Down
20 changes: 17 additions & 3 deletions locales/da/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,23 @@
}
},
"notFound": {
"title": "Ups! Siden blev ikke fundet",
"description": "Det ser ud til, at du har været på en ukendt sti... vi er ikke sikre på, hvor denne side er hen!",
"goBack": "Gå tilbage"
"code": "404-fejl",
"title": "Vi kan ikke finde denne side",
"description": "Siden, du leder efter, er enten utilgængelig eller blevet flyttet.",
"goBack": "Gå tilbage",
"goHome": "Gå til forsiden",
"documentation": {
"title": "Dokumentation",
"description": "Dyk ned og lær alt om vores motor."
},
"ourBlog": {
"title": "Vores blog",
"description": "Læs de nyeste indlæg på vores blog."
},
"contactUs": {
"title": "Kontakt os",
"description": "Kom i kontakt for forespørgsler eller support."
}
},
"downloadHero": {
"downloadForOS": "Download redot til {platform}",
Expand Down
20 changes: 17 additions & 3 deletions locales/de/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,23 @@
}
},
"notFound": {
"title": "Ups! Seite nicht gefunden",
"description": "Sieht so aus, als ob du ins Unbekannte vorgedrungen bist... Wir wissen auch nicht, wo diese Seite geblieben ist!",
"goBack": "Zurück"
"code": "404 Fehler",
"title": "Wir können diese Seite nicht finden",
"description": "Die Seite, die Sie suchen, ist entweder nicht verfügbar oder wurde verschoben.",
"goBack": "Zurück",
"goHome": "Zur Startseite",
"documentation": {
"title": "Dokumentation",
"description": "Tauchen Sie ein, um alles über unsere Engine zu erfahren."
},
"ourBlog": {
"title": "Unser Blog",
"description": "Lesen Sie die neuesten Beiträge in unserem Blog."
},
"contactUs": {
"title": "Kontaktieren Sie uns",
"description": "Kontaktieren Sie uns für Anfragen oder Support."
}
},
"downloadHero": {
"downloadForOS": "Redot für {platform} herunterladen",
Expand Down
20 changes: 17 additions & 3 deletions locales/el/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,23 @@
}
},
"notFound": {
"title": "Ουπς! Η Σελίδα Δεν Βρέθηκε",
"description": "Φαίνεται ότι εξερευνήσατε το άγνωστο... δεν είμαστε σίγουροι που πήγε αυτή η σελίδα!",
"goBack": "Επιστροφή"
"code": "Σφάλμα 404",
"title": "Δεν μπορούμε να βρούμε αυτήν την σελίδα",
"description": "Η σελίδα που ψάχνετε είτε είναι μη διαθέσιμη είτε έχει μετακινηθεί.",
"goBack": "Πίσω",
"goHome": "Αρχική",
"documentation": {
"title": "Τεκμηρίωση",
"description": "Βυθιστείτε και μάθετε τα πάντα για την μηχανή μας."
},
"ourBlog": {
"title": "Το ιστολόγιό μας",
"description": "Διαβάστε τις τελευταίες αναρτήσεις στο ιστολόγιό μας."
},
"contactUs": {
"title": "Επικοινωνήστε μαζί μας",
"description": "Επικοινωνήστε μαζί μας για ερωτήσεις ή υποστήριξη."
}
},
"downloadHero": {
"downloadForOS": "Λήψη Redot για {platform}",
Expand Down
20 changes: 17 additions & 3 deletions locales/en-GB/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,23 @@
}
},
"notFound": {
"title": "Oops! Page Not Found",
"description": "Looks like you’ve ventured into the unknown... we’re not sure where this page went either!",
"goBack": "Go Back"
"code": "404 error",
"title": "We can't find this page",
"description": "The page you're looking for is either unavailable or has been relocated.",
"goBack": "Go back",
"goHome": "Go home",
"documentation": {
"title": "Documentation",
"description": "Dive in to learn all about our engine."
},
"ourBlog": {
"title": "Our blog",
"description": "Read the latest posts on our blog."
},
"contactUs": {
"title": "Contact Us",
"description": "Get in touch for inquiries or support."
}
},
"downloadHero": {
"downloadForOS": "Download Redot for {platform}",
Expand Down
20 changes: 17 additions & 3 deletions locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,23 @@
}
},
"notFound": {
"title": "Oops! Page Not Found",
"description": "Looks like you’ve ventured into the unknown... we’re not sure where this page went either!",
"goBack": "Go Back"
"code": "404 error",
"title": "We can't find this page",
"description": "The page you're looking for is either unavailable or has been relocated.",
"goBack": "Go back",
"goHome": "Go home",
"documentation": {
"title": "Documentation",
"description": "Dive in to learn all about our engine."
},
"ourBlog": {
"title": "Our blog",
"description": "Read the latest posts on our blog."
},
"contactUs": {
"title": "Contact Us",
"description": "Get in touch for inquiries or support."
}
},
"downloadHero": {
"downloadForOS": "Download redot for {platform}",
Expand Down
20 changes: 17 additions & 3 deletions locales/es-LA/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,23 @@
}
},
"notFound": {
"title": "¡Vaya! Página no encontrada",
"description": "Parece que has ido a lo desconocido... ¡nosotros tampoco sabemos a dónde fue esta página!",
"goBack": "Volver"
"code": "Error 404",
"title": "No podemos encontrar esta página",
"description": "La página que buscas está fuera de servicio o ha sido trasladada.",
"goBack": "Volver atrás",
"goHome": "Ir a inicio",
"documentation": {
"title": "Documentación",
"description": "Sumérgete y aprende todo sobre nuestro motor."
},
"ourBlog": {
"title": "Nuestro blog",
"description": "Lee las últimas publicaciones en nuestro blog."
},
"contactUs": {
"title": "Contáctanos",
"description": "Ponte en contacto para consultas o soporte."
}
},
"downloadHero": {
"downloadForOS": "Descargar Redot para {platform}",
Expand Down
Loading

0 comments on commit cb826a4

Please sign in to comment.