nose-pluto/bin/mode.ts
2025-10-07 18:34:41 -07:00

19 lines
546 B
TypeScript

/// <reference lib="dom" />
// Swap UI between cinema mode (fix 16:9) and 100% height.
import { content } from "@/js/dom"
import { focusInput } from "@/js/focus"
import { resize } from "@/js/resize"
import { send } from "@/js/websocket"
export default function (mode?: string) {
if (!mode) {
mode = document.body.dataset.mode === "tall" ? "cinema" : "tall"
send({ type: "session:update", data: { "ui:mode": mode } })
}
content.style.display = ""
document.body.dataset.mode = mode
resize()
focusInput()
}