Present: dark theme settings, a Theme pick, and a content inset

- Event Presentation, dark theme (096): background image and color,
  dim, accent, text color and logo for a dark screen; blank takes the
  light one
- Setup's Theme holds a screen light or dark while it plays (`theme=`)
- Inset top, right, bottom and left (097), percent of the screen, so
  the slides sit inside a frame drawn in the background image; with
  any set the image is stretched to the screen

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Zaldimmar 2026-11-12 04:14:14 -06:00
parent 7e21a0dd40
commit b76f2a5707
8 changed files with 209 additions and 12 deletions

View file

@ -226,6 +226,17 @@ export const events = {
],
blankLabel: "Default: a bar on top, the title line and the timer",
},
...([
["top", "Inset top", "of the screen's height"],
["right", "Inset right", "of the screen's width"],
["bottom", "Inset bottom", "of the screen's height"],
["left", "Inset left", "of the screen's width"],
] as const).map(([side, label, of]) => ({
path: `present_inset_${side}`,
label,
widget: "number",
help: `Room kept clear at this edge, in percent ${of} (0 to 45), eg. to keep the slides inside a frame drawn in the background image. With any inset the image is stretched to the screen, not cropped. Default: 0.`,
})),
{ path: "present_accent", label: "Accent", widget: "color", help: "Default: the event's color" },
{
path: "present_text_color",
@ -244,6 +255,34 @@ export const events = {
},
],
},
{
legend: "Presentation, dark theme",
note: "For a screen in the dark theme (its own setting, or the Theme picked when presenting). Each one left blank uses the one above.",
fields: [
{
path: "present_background_dark",
label: "Background image",
widget: "image",
crop: "free",
resolve: mediaUrl,
full: true,
help: "Default: the background image above",
},
{ path: "present_background_color_dark", label: "Background color", widget: "color", help: "Default: the one above, else the site's dark background" },
{ path: "present_dim_dark", label: "Dim", widget: "number", help: "0 to 90 percent. Default: the one above" },
{ path: "present_accent_dark", label: "Accent", widget: "color", help: "Default: the accent above" },
{ path: "present_text_color_dark", label: "Text color", widget: "color", help: "Default: the one above" },
{
path: "present_logo_dark",
label: "Logo",
widget: "image",
folder: "logos",
resolve: mediaUrl,
full: true,
help: "eg. a light version of the logo. Default: the logo above",
},
],
},
timelineGroup("event"),
timelineDetailGroup("event"),
{ legend: "Publishing", fields: [PUBLISHED_FIELD, LISTED_FIELD] },

15
src/lib/darkTheme.ts Normal file
View file

@ -0,0 +1,15 @@
/* Whether the site is in its dark theme: <html data-theme="dark">,
set before the first paint (index.html) and by ThemeToggle. A
hook, so a page redraws the moment it changes. */
import { useSyncExternalStore } from 'react'
const read = () => document.documentElement.dataset.theme === 'dark'
function subscribe(onChange: () => void) {
const observer = new MutationObserver(onChange)
observer.observe(document.documentElement, { attributes: true, attributeFilter: ['data-theme'] })
return () => observer.disconnect()
}
export const useDarkTheme = (): boolean => useSyncExternalStore(subscribe, read, () => false)

View file

@ -99,6 +99,11 @@ export type EventPresentLook = {
accent: string | null
text_color: string | null
logo: string | null
/** Room clear at each edge (097): percent of the screen's height
* (top, bottom) and width (left, right); null none. */
inset?: { top: number; right: number; bottom: number; left: number } | null
/** In the dark theme (096); a null one takes the above. */
dark?: Partial<Omit<EventPresentLook, 'frame' | 'dark' | 'inset'>>
}
export type MapSection = { name: string; keys: string[] }