mirror of
https://github.com/karpathy/nanochat.git
synced 2026-05-09 17:30:14 +00:00
LandingNav was max-w-3xl which forced "How it works" and "Try samosaChaat" to wrap on two lines. Bumps the pill to 1100px, tightens the link padding, demotes the @ handle to lg+, and adds whitespace-nowrap to every chip so nothing wraps again. Default theme is now dark — the no-flash init script adds .dark unless the user has explicitly stored 'light', and the useTheme hook seeds from the same logic. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
77 lines
2.0 KiB
TypeScript
77 lines
2.0 KiB
TypeScript
import type { Metadata, Viewport } from 'next';
|
|
import { Baloo_2, Great_Vibes, Caveat, Inter, Fraunces } from 'next/font/google';
|
|
import './globals.css';
|
|
|
|
const baloo = Baloo_2({
|
|
subsets: ['latin', 'devanagari'],
|
|
weight: ['400', '600', '700', '800'],
|
|
variable: '--font-baloo',
|
|
display: 'swap',
|
|
});
|
|
|
|
const vibes = Great_Vibes({
|
|
subsets: ['latin'],
|
|
weight: ['400'],
|
|
variable: '--font-vibes',
|
|
display: 'swap',
|
|
});
|
|
|
|
const caveat = Caveat({
|
|
subsets: ['latin'],
|
|
weight: ['400', '600', '700'],
|
|
variable: '--font-caveat',
|
|
display: 'swap',
|
|
});
|
|
|
|
const inter = Inter({
|
|
subsets: ['latin'],
|
|
variable: '--font-inter',
|
|
display: 'swap',
|
|
});
|
|
|
|
const fraunces = Fraunces({
|
|
subsets: ['latin'],
|
|
weight: ['400', '500', '600', '700'],
|
|
variable: '--font-fraunces',
|
|
display: 'swap',
|
|
});
|
|
|
|
export const metadata: Metadata = {
|
|
title: 'समोसाचाट — samosaChaat',
|
|
description:
|
|
'Crafted with care. For India, from India. A warm, desi-flavored chat experience powered by nanochat.',
|
|
icons: { icon: '/logo.svg' },
|
|
};
|
|
|
|
export const viewport: Viewport = {
|
|
themeColor: '#0f0f10',
|
|
width: 'device-width',
|
|
initialScale: 1,
|
|
viewportFit: 'cover',
|
|
};
|
|
|
|
// Set theme class before paint to avoid flash. Default = dark; user can flip via the toggle.
|
|
const themeInitScript = `
|
|
(function(){try{
|
|
var t=localStorage.getItem('theme');
|
|
if(t==='light'){document.documentElement.classList.remove('dark');}
|
|
else{document.documentElement.classList.add('dark');}
|
|
}catch(e){document.documentElement.classList.add('dark');}})();
|
|
`;
|
|
|
|
export default function RootLayout({ children }: { children: React.ReactNode }) {
|
|
return (
|
|
<html
|
|
lang="en"
|
|
className={`${baloo.variable} ${vibes.variable} ${caveat.variable} ${inter.variable} ${fraunces.variable}`}
|
|
>
|
|
<head>
|
|
<script dangerouslySetInnerHTML={{ __html: themeInitScript }} />
|
|
</head>
|
|
<body className="min-h-dvh bg-white text-gray-900 dark:bg-ink dark:text-ink-text">
|
|
{children}
|
|
</body>
|
|
</html>
|
|
);
|
|
}
|