/// <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()
}