81 lines
3.1 KiB
TypeScript
81 lines
3.1 KiB
TypeScript
import type { Metadata, Viewport } from "next";
|
|
import { Figtree, Inter, JetBrains_Mono } from "next/font/google";
|
|
import "./globals.css";
|
|
|
|
import { ThemeProvider } from "@/components/theme/theme-provider";
|
|
import { TooltipProvider } from "@/components/ui/tooltip";
|
|
import { Toaster } from "@/components/ui/sonner";
|
|
import { RegisterServiceWorker } from "@/components/pwa/register-sw";
|
|
|
|
/** UI type: Inter -- a neutral, highly legible humanist sans that reads
|
|
* cleanly at small sizes (to-do lists, tables, nav). */
|
|
const inter = Inter({
|
|
variable: "--font-sans",
|
|
subsets: ["latin"],
|
|
});
|
|
|
|
/** Display type: Figtree -- a slightly friendlier, rounder geometric sans
|
|
* for headings and wordmarks. Same family, one step of personality. */
|
|
const figtree = Figtree({
|
|
variable: "--font-heading",
|
|
subsets: ["latin"],
|
|
});
|
|
|
|
/** Code: JetBrains Mono, used for the markdown editor's monospace bits. */
|
|
const jetbrainsMono = JetBrains_Mono({
|
|
variable: "--font-mono",
|
|
subsets: ["latin"],
|
|
});
|
|
|
|
export const metadata: Metadata = {
|
|
title: "Organize",
|
|
description: "An extended to-do list and notes organizer.",
|
|
manifest: "/manifest.webmanifest",
|
|
icons: {
|
|
icon: [{ url: "/icons/icon-192.png", sizes: "192x192", type: "image/png" }],
|
|
apple: [{ url: "/icons/apple-touch-icon.png", sizes: "180x180", type: "image/png" }],
|
|
},
|
|
appleWebApp: {
|
|
capable: true,
|
|
statusBarStyle: "default",
|
|
title: "Organize",
|
|
},
|
|
};
|
|
|
|
export const viewport: Viewport = {
|
|
themeColor: [
|
|
{ media: "(prefers-color-scheme: light)", color: "#fafafa" },
|
|
{ media: "(prefers-color-scheme: dark)", color: "#22252b" },
|
|
],
|
|
};
|
|
|
|
export default function RootLayout({ children }: LayoutProps<"/">) {
|
|
return (
|
|
<html
|
|
lang="en"
|
|
className={`${inter.variable} ${figtree.variable} ${jetbrainsMono.variable} h-full antialiased`}
|
|
suppressHydrationWarning
|
|
>
|
|
<body className="min-h-full flex flex-col">
|
|
{/* Four looks: Default (calm light), Sunset (warm light), Dark, Ocean
|
|
(deep blue-green) -- complete token sets in app/globals.css.
|
|
"system" resolves to Default/Dark by OS preference.
|
|
No-FOUC theme restore: runs before first paint, applies the
|
|
stored preference to <html> (class + color-scheme). */}
|
|
<script
|
|
dangerouslySetInnerHTML={{
|
|
__html: `!(function(){try{var r=document.documentElement,c=['theme-default','theme-sunset','dark','ocean','light'];for(var i=0;i<c.length;i++){r.classList.remove(c[i]);}var v=null;try{v=localStorage.getItem('theme');}catch(e){}var m={default:'theme-default',sunset:'theme-sunset',dark:'dark',ocean:'ocean'};if(v==='system'||!v){v=window.matchMedia&&window.matchMedia('(prefers-color-scheme: dark)').matches?'dark':'default';}if(m[v]){r.classList.add(m[v]);r.style.colorScheme=(v==='dark'||v==='ocean')?'dark':'light';}}catch(e){}})();`,
|
|
}}
|
|
/>
|
|
<ThemeProvider defaultTheme="system">
|
|
<TooltipProvider delay={200}>
|
|
{children}
|
|
<Toaster />
|
|
<RegisterServiceWorker />
|
|
</TooltipProvider>
|
|
</ThemeProvider>
|
|
</body>
|
|
</html>
|
|
);
|
|
}
|