1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2026-06-05 20:15:31 -04:00
Files
jarv.is/app/layout.tsx
T
jake b2416ff0db refactor: overhaul view transitions with granular per-page animation components
- Replace single `<ViewTransition>` wrapper in layout with `FadeTransition` and `DirectionalTransition` components applied per page
- Add `components/page-transition.tsx` with reusable transition wrappers
- Expand view transition CSS with named classes: fade, slide, nav-forward/back, morph, text-morph, scale — all driven by CSS custom property durations
- Use React `<ViewTransition name=... share="text-morph">` for shared note title element between list and detail views
- Wrap comments suspense boundary with enter/exit slide transitions
- Add `persistent-nav` and `persistent-footer` view-transition-name groups to keep chrome static during navigation
- Fix reduced-motion override to target delay and duration instead of `animation: none`
- Add tracking-tight and letter-spacing tweaks to home page typography
2026-04-25 10:50:31 -04:00

78 lines
2.7 KiB
TypeScript

import { JsonLd } from "react-schemaorg";
import type { Person, WebSite } from "schema-dts";
import { Analytics } from "@/app/analytics";
import { Footer } from "@/components/layout/footer";
import { Header } from "@/components/layout/header";
import { Providers } from "@/components/providers";
import { Toaster } from "@/components/ui/sonner";
import authorConfig from "@/lib/config/author";
import siteConfig from "@/lib/config/site";
import { Inter, JetBrainsMono } from "@/lib/fonts";
import "./globals.css";
import { defaultMetadata } from "@/lib/metadata";
import { cn } from "@/lib/utils";
export const metadata = defaultMetadata;
const RootLayout = ({ children }: Readonly<{ children: React.ReactNode }>) => (
<html
lang={process.env.NEXT_PUBLIC_SITE_LOCALE}
className={cn(Inter.variable, JetBrainsMono.variable)}
suppressHydrationWarning
>
<head>
<JsonLd<Person>
item={{
"@context": "https://schema.org",
"@type": "Person",
"@id": `${process.env.NEXT_PUBLIC_BASE_URL}/#person`,
name: authorConfig.name,
url: process.env.NEXT_PUBLIC_BASE_URL!,
image: [`${process.env.NEXT_PUBLIC_BASE_URL}/opengraph-image.jpg`],
sameAs: [
process.env.NEXT_PUBLIC_BASE_URL!,
`https://${authorConfig.social?.mastodon}`,
`https://github.com/${authorConfig.social?.github}`,
`https://bsky.app/profile/${authorConfig.social?.bluesky}`,
`https://twitter.com/${authorConfig.social?.twitter}`,
`https://medium.com/@${authorConfig.social?.medium}`,
`https://www.linkedin.com/in/${authorConfig.social?.linkedin}/`,
`https://www.facebook.com/${authorConfig.social?.facebook}`,
`https://www.instagram.com/${authorConfig.social?.instagram}/`,
],
}}
/>
<JsonLd<WebSite>
item={{
"@context": "https://schema.org",
"@type": "WebSite",
"@id": `${process.env.NEXT_PUBLIC_BASE_URL}/#website`,
name: siteConfig.name,
url: process.env.NEXT_PUBLIC_BASE_URL,
author: authorConfig.name,
description: siteConfig.description,
inLanguage: process.env.NEXT_PUBLIC_SITE_LOCALE,
license: `https://spdx.org/licenses/${siteConfig.license}.html`,
}}
/>
</head>
<body className="bg-background text-foreground font-sans antialiased">
<Providers>
<div className="mx-auto w-full max-w-[720px] px-5">
<Header />
<main className="mt-4 w-full">{children}</main>
<Footer />
</div>
<Toaster position="bottom-center" hotkey={[]} />
</Providers>
<Analytics />
</body>
</html>
);
export default RootLayout;