freezmo/app/layout.tsx
Martin Dvorak 52cce42cde Frosted ice glass restyle
Rebuilds the look around the spec: an ice scene, one shared glass
recipe, icy accents and glass on every large surface. Visual only —
layout, behaviour, copy and functionality are untouched.

Background
- .ice-scene: fixed, z-index -1, pointer-events none. Navy base
  (#070b16 to #0c1426) in dark, pale (#f4f9ff to #e6f1fb) in light,
  four drifting glacier blobs (#38bdf8/#60a5fa/#818cf8, 30-60s
  transform-only loops), five glossy ice orbs (40-220px radial
  gradients with a highlight at 30% 25% and a blue shadow) placed so the
  glass blurs them, and an SVG feTurbulence grain at 4-5%.
- prefers-reduced-motion stops the drift; phones get two blobs and two
  orbs fewer.

Glass
- One shared recipe (.glass-panel, .card, .sidebar-surface,
  .study-chrome, .tabbar, .glass, .gate-card): rgba(255,255,255,.06)
  dark / .55 light, blur(24px) saturate(140%) (16px on phones), a bright
  1px rim, an inset top highlight and a blue-tinted outer shadow.
- Nested glass (chips, inputs, secondary buttons) is more opaque and
  never adds a second blur layer. @supports fallback for no
  backdrop-filter. Radii: 24-28px cards/sheets, 14px inputs/buttons,
  pills for chips. Cards hover brighter + cyan rim + 2px lift, 180ms.

Colour and type
- Accent is glacier cyan (#38bdf8) to ice blue (#0ea5e9); progress bars
  and selected states use the gradient; the active sidebar item is a
  frosted highlight with a cyan rim.
- Primary CTA: icy gradient — white to #bfe3ff with ink text in dark,
  deep blue in light (biased so the label sits on the darker half and
  keeps 5.6:1).
- Leftover slate/black greys replaced with navy-tinted frost tokens.
- Headings are semibold with tighter tracking.

Screens
- Dashboard: the sidebar is one tall inset rounded glass panel; deck
  cards are glass.
- Gate: one centred glass card over the scene, orbs visible behind it.
- Sheets/modals: glass over the dimmed, lightly blurred backdrop.
- Study view: question card more opaque (.glass-solid); top bar and
  pager are slim glass pills.

Perf: measured on a phone viewport with 4x CPU throttling. The animated
blobs' filter: blur() was the whole cost (150ms vs 33ms per frame), so
they are soft radial gradients with no filter now; idle 60fps, ~17ms
median while scrolling.

Tests updated for the new tokens: contrast 18/18 AA, deck chrome 15/15,
key gate 49/49, install sheet 64/64, deck fixes 15/15, retry 14/14,
zoom 6/6, final ux 12/12, security 8/8, pwa 16/16.
2026-10-08 10:11:55 +00:00

85 lines
3.3 KiB
TypeScript

import type { Metadata, Viewport } from "next";
import { IceBackdrop } from "@/components/IceBackdrop";
import { InstallSheet } from "@/components/InstallSheet";
import { ServiceWorkerRegistrar } from "@/components/ServiceWorkerRegistrar";
import "./globals.css";
export const metadata: Metadata = {
title: {
default: "Freezmo — turn your notes into a study feed",
template: "%s · Freezmo",
},
description:
"Freezmo turns photos and documents of your notes into a swipeable feed of short interactive study activities, powered by your own Ollama models.",
applicationName: "Freezmo",
manifest: "/manifest.webmanifest",
appleWebApp: {
capable: true,
title: "Freezmo",
statusBarStyle: "default",
},
icons: {
icon: [
// ?v=2 busts browser favicon caches after the icon redesign.
{ url: "/icons/favicon-32.png?v=2", sizes: "32x32", type: "image/png" },
{ url: "/icons/icon-192.png?v=2", sizes: "192x192", type: "image/png" },
{ url: "/icons/icon-512.png?v=2", sizes: "512x512", type: "image/png" },
],
apple: [
{ url: "/icons/apple-touch-icon.png?v=2", sizes: "180x180" },
{ url: "/icons/apple-touch-icon-167.png?v=2", sizes: "167x167" },
{ url: "/icons/apple-touch-icon-152.png?v=2", sizes: "152x152" },
],
},
other: {
// iOS standalone niceties
"apple-mobile-web-app-capable": "yes",
"mobile-web-app-capable": "yes",
"format-detection": "telephone=no",
},
};
export const viewport: Viewport = {
width: "device-width",
initialScale: 1,
// Phones: no pinch/double-tap zoom (the app-like feel). The input font-size
// rule in globals.css is what actually stops iOS Safari's focus auto-zoom,
// which ignores user-scalable=no.
maximumScale: 1,
userScalable: false,
viewportFit: "cover",
themeColor: [
{ media: "(prefers-color-scheme: light)", color: "#f4f7fd" },
{ media: "(prefers-color-scheme: dark)", color: "#0e1424" },
],
};
/** Applies the saved theme before paint to avoid a flash. */
const themeScript = `(function(){try{var s=localStorage.getItem('freezmo.theme');var d=s?s==='dark':window.matchMedia('(prefers-color-scheme: dark)').matches;if(d)document.documentElement.classList.add('dark');}catch(e){}})();`;
/**
* Captures Chrome's `beforeinstallprompt` (it can fire before React hydrates)
* and records an install so the prompt never comes back. Static, no user data.
*/
const installScript = `(function(){try{
window.addEventListener('beforeinstallprompt',function(e){e.preventDefault();window.__freezmoInstallPrompt=e;window.dispatchEvent(new Event('freezmo:installprompt'));});
window.addEventListener('appinstalled',function(){try{localStorage.setItem('freezmo.install.installed','1')}catch(e){}window.dispatchEvent(new Event('freezmo:installed'));});
}catch(e){}})();`;
export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
<html lang="en" suppressHydrationWarning>
<head>
<script dangerouslySetInnerHTML={{ __html: themeScript }} />
<script dangerouslySetInnerHTML={{ __html: installScript }} />
</head>
<body className="min-h-full antialiased">
<IceBackdrop />
{children}
<InstallSheet />
<ServiceWorkerRegistrar />
</body>
</html>
);
}