johnandersen777.bsky.social/knotless
git that lives in your Atmosphere account
Forked from chadtmiller.com/knotless
0
0
import { KNOTLESS_NOW } from '$app/env/private';
import { COOKIE, known } from '#lib/zone.svelte.ts';
import { TREE, treeShown } from '#lib/diffs.ts';
import { NIGHT, NIGHT_PALETTE, PALETTE, THEME, paletteOf, themeOf } from '#lib/theme.ts';
/**
* The viewer's zone, as their browser last said, and the server's now: what
* times are put in words by; and whether they last showed or hid a pull's
* file tree; and the theme they chose, if any, with its palette for one of
* their own, and the theme they chose for night, if a pair.
*/
export const load = ({ cookies }) => ({
tz: known(cookies.get(COOKIE)),
now: KNOTLESS_NOW ?? Date.now(),
tree: treeShown(cookies.get(TREE)),
theme: themeOf(cookies.get(THEME)),
palette: paletteOf(cookies.get(PALETTE)),
night: themeOf(cookies.get(NIGHT)),
nightPalette: paletteOf(cookies.get(NIGHT_PALETTE))
});