cloakfall
    Preparing search index...

    Function installPlayerBar

    • Add the player bar to the page and keep it in step with

      . Returns a function that removes it again.

      On a phone it also opens and closes the drawer the viewer's own board lives in (the CSS in layouts-custom.sass moves the role-own board into it, and dims the page around it): body.own-board-open. It closes on Escape, on a tap outside it, when the game ends, and when the board it shows stops being the viewer's (local multiplayer: every turn, so nobody sees another player's ships by accident). A tap outside only closes it: it never reaches the board underneath, so closing the drawer can't fire a shot.

      Parameters

      • main: HTMLElement

        the game's

        (setup/gameRoot.ts)

      Returns () => void