mirror of
https://github.com/Patiun/com.gregkilmer.www.git
synced 2026-11-08 04:08:24 +00:00
Add light mode that follows the device setting
Dark stays the default. A device set to light gets the picks from the light motif board: the Dawn chart sky (dawn wash over faint star chart lines, atlas marks in the hero), deep gold line seals, Midnight, violet and gold dust, the deep gold to teal filament and the morning sky placeholder. Large standalone seals (404, Inquiries, Inquiry sent, the blog's lead) are gold foil in both modes. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012aSbo2D1qP8cMFQCykf7kx
This commit is contained in:
@@ -46,6 +46,27 @@ export type SealName = keyof typeof seals;
|
||||
|
||||
export { filamentBanner };
|
||||
|
||||
// Light mode and foil versions, written by scripts/light-motifs.mjs.
|
||||
const byFile = (m: Record<string, string>) => Object.fromEntries(Object.entries(m).map(([p, u]) => [p.slice(p.lastIndexOf("/") + 1), u]));
|
||||
const darkFiles = byFile(import.meta.glob<string>("../assets/motifs/*.svg", { query: "?url", import: "default", eager: true }));
|
||||
const lightFiles = byFile(import.meta.glob<string>("../assets/motifs/light/*.svg", { query: "?url", import: "default", eager: true }));
|
||||
const foilFiles = byFile(import.meta.glob<string>("../assets/motifs/foil/*.svg", { query: "?url", import: "default", eager: true }));
|
||||
const foilLightFiles = byFile(import.meta.glob<string>("../assets/motifs/foil-light/*.svg", { query: "?url", import: "default", eager: true }));
|
||||
const fileOf = Object.fromEntries(Object.entries(darkFiles).map(([f, u]) => [u, f]));
|
||||
|
||||
/**
|
||||
* A motif's image for each mode. Foil is only for a seal standing alone at
|
||||
* 120px or more and half opacity or more; smaller or fainter seals stay flat.
|
||||
*/
|
||||
export function motifSources(url: string, { foil = false } = {}): { dark: string; light: string } {
|
||||
const f = fileOf[url];
|
||||
if (!f) return { dark: url, light: url };
|
||||
return {
|
||||
dark: (foil && foilFiles[f]) || url,
|
||||
light: (foil && foilLightFiles[f]) || lightFiles[f] || url,
|
||||
};
|
||||
}
|
||||
|
||||
/** Each page family's edge seal. A craft page uses its own craft seal. */
|
||||
export const pageSeals = {
|
||||
landing: "transmutation-star-paths",
|
||||
|
||||
Reference in New Issue
Block a user