64 lines
2.4 KiB
TypeScript
64 lines
2.4 KiB
TypeScript
import { iconUrl } from "@/lib/icon-version";
|
|
import type { Metadata, Viewport } from "next";
|
|
import localFont from "next/font/local";
|
|
import { NextIntlClientProvider } from "next-intl";
|
|
import { getLocale, getTranslations } from "next-intl/server";
|
|
import "./globals.css";
|
|
import { STARTUP_SIZES } from "@/lib/startup-sizes";
|
|
|
|
// Eine Schrift für alles (Kai, 7.11.2026, E-0014): Poppins — Logo, Überschriften,
|
|
// Text —, dazu Caveat nur für Maikes Unterschrift „by Maike“. Beide SIL Open Font
|
|
// License (app/fonts/Poppins-OFL.txt, Caveat-OFL.txt), lokal, nie vom CDN.
|
|
const sans = localFont({
|
|
src: [
|
|
{ path: "./fonts/poppins-latin-400-normal.woff2", weight: "400" },
|
|
{ path: "./fonts/poppins-latin-500-normal.woff2", weight: "500" },
|
|
{ path: "./fonts/poppins-latin-600-normal.woff2", weight: "600" },
|
|
{ path: "./fonts/poppins-latin-700-normal.woff2", weight: "700" },
|
|
],
|
|
variable: "--font-poppins",
|
|
display: "swap",
|
|
});
|
|
const hand = localFont({ src: "./fonts/caveat-latin-400-normal.woff2", weight: "400", variable: "--font-caveat", display: "swap" });
|
|
|
|
export async function generateMetadata(): Promise<Metadata> {
|
|
const t = await getTranslations("app");
|
|
return {
|
|
title: t("name"),
|
|
description: t("tagline"),
|
|
applicationName: t("name"),
|
|
appleWebApp: {
|
|
capable: true,
|
|
title: t("name"),
|
|
statusBarStyle: "default",
|
|
// Startbild mit Maike, solange die Web-App lädt (app/startbild, 26.11.35).
|
|
startupImage: STARTUP_SIZES.map(([w, h, cw, ch, dpr]) => ({
|
|
url: `/startbild/${w}x${h}`,
|
|
media: `(device-width: ${cw}px) and (device-height: ${ch}px) and (-webkit-device-pixel-ratio: ${dpr}) and (orientation: portrait)`,
|
|
})),
|
|
},
|
|
icons: { icon: iconUrl("/icon.svg"), apple: iconUrl("/apple-touch-icon.png") },
|
|
};
|
|
}
|
|
|
|
export const viewport: Viewport = {
|
|
width: "device-width",
|
|
initialScale: 1,
|
|
viewportFit: "cover",
|
|
themeColor: [
|
|
{ media: "(prefers-color-scheme: light)", color: "#fdfcfe" },
|
|
{ media: "(prefers-color-scheme: dark)", color: "#1c1823" },
|
|
],
|
|
};
|
|
|
|
export default async function RootLayout({ children }: { children: React.ReactNode }) {
|
|
const locale = await getLocale();
|
|
return (
|
|
<html lang={locale} className={`${sans.variable} ${hand.variable}`}>
|
|
<body className="min-h-dvh antialiased">
|
|
<NextIntlClientProvider>{children}</NextIntlClientProvider>
|
|
</body>
|
|
</html>
|
|
);
|
|
}
|