Try Install Learn Blog API Packages GitHub
Pages

Mint Fullscreen

CI

Mint wrapper for the browser Fullscreen API

Example

Example of using the Fullscreen module

component Main {
  fun enter {
    case target {
      Maybe::Just(el) =>
        {
          Fullscreen.enter(el)
          void
        }

      => void
    }
  }

  fun exit {
    Fullscreen.exit()
  }

  fun render {
    <div as target>
      <button onClick={enter}>
        "enter fullscreen"
      </button>

      <button onClick={exit}>
        "exit fullscreen"
      </button>
    </div>
  }
}

Functions

The Fullscreen module

  • enter(el : Dom.Element) - Requests to enter fullscreen mode

  • exit() - Requests to leave fullscreen mode

  • element() : Maybe(Dom.Element) - Returns the active fullscreen element

  • isAvailable() : Bool - Is the Fullscreen API available to use in the browser

  • isActive() : Bool - Is fullscreen mode currently activated on an element