SPB Git

spb/earth-now Public License

earth-now.co — real-time planetary dashboard: live world metrics modeled, not streamed.

TypeScript 93% Shell 2.3% SQL 1.4% JavaScript 1.3% Dockerfile 1.2% CSS 0.8%
2.3 KB · 54 lines tsx
Raw Blame History
1/**2 * earth-now.co3 * Author:  Simon-Pierre Boucher4 * Contact: contact@spboucher.ai5 * File:    apps/web/app/layout.tsx6 * Purpose: Root layout — light-first shell (dark via data-theme toggle, read pre-paint), metadata, footer attribution + methodology link7 */89import type { Metadata } from "next";10import Link from "next/link";11import type { ReactNode } from "react";12import "./globals.css";1314export const metadata: Metadata = {15  title: "earth-now.co — La planète en direct",16  description:17    "La planète en direct / The planet, live — compteurs mondiaux pilotés par des modèles statistiques documentés (sources, incertitude, méthode).",18};1920// Applied before paint so a saved dark preference never flashes light.21// LIGHT is the default — dark only when explicitly chosen.22const THEME_BOOT = `try{if(localStorage.getItem("earth-now.theme")==="dark")document.documentElement.dataset.theme="dark"}catch(e){}`;2324export default function RootLayout({ children }: { children: ReactNode }) {25  // Default lang is "fr"; the client dashboard syncs document.documentElement.lang26  // with the user's locale toggle (persisted in localStorage).27  return (28    <html lang="fr">29      <body className="min-h-screen font-sans">30        <script dangerouslySetInnerHTML={{ __html: THEME_BOOT }} />31        <div className="flex min-h-screen flex-col">32          <main className="flex-1">{children}</main>33          <footer className="border-t border-line px-4 py-6">34            <div className="mx-auto flex max-w-6xl flex-col gap-2 text-xs text-muted sm:flex-row sm:items-center sm:justify-between">35              <p className="max-w-3xl">36                Données : ONU (WPP), NOAA GML, Global Carbon Project, Copernicus/ERA5, FAO,37                Global Forest Watch, Ember/IEA, USGS — chaque compteur est un modèle statistique38                documenté. / Data: every counter is a documented statistical model over real39                observations.40              </p>41              <Link42                href="/methodology"43                className="shrink-0 text-accent underline decoration-accent/40 hover:opacity-80"44              >45                Méthodologie / Methodology46              </Link>47            </div>48          </footer>49        </div>50      </body>51    </html>52  );53}54