// biome-ignore lint/correctness/noUnusedImports: Html is the JSX factory (tsconfig jsxFactory: Html.createElement) import { Html } from "@elysiajs/html"; import type { PropsWithChildren } from "@kitajs/html"; import { escapeHTML } from "bun"; import hljs from "highlight.js"; import { config } from "./config"; import { humanFileSize, isValidUTF8, type Theme, themeIcon } from "./shared"; export const filetypes = ["none", "blob"].concat(hljs.listLanguages().sort()); // The auto/light/dark toggle. A plain form so it works without JS (it POSTs to // /theme/cycle, which flips the cookie and redirects back); client-theme.js // upgrades it to switch instantly without a reload. function ThemeToggle(props: { theme: Theme }) { return (
); } function Template(props: PropsWithChildren<{ css: string; theme: Theme }>) { // Server-render the active theme so it's correct before first paint (no flash) // and works with JS off. The dark sakura sheet is gated by `media`: in auto it // follows the OS, otherwise it's forced fully on/off. const darkMedia = props.theme === "auto" ? "(prefers-color-scheme: dark)" : props.theme === "dark" ? "all" : "not all"; return ( <> {""} ⚡ZBin⚡ {/* highlight.js syntax themes, gated like sakura's: light is the base, the dark sheet's `media` follows the active theme. Only the show page renders `.hljs` markup, but loading them sitewide keeps the head (and the client toggle) uniform. */}