How to use the screenfull.default.onchange function in screenfull

To help you get started, we’ve selected a few screenfull examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github marp-team / marp-cli / src / templates / bespoke / osc.ts View on Github external
oscElements(
        'prev',
        prev => (prev.disabled = index === 0 && fragmentIndex === 0)
      )

      oscElements(
        'next',
        next =>
          (next.disabled =
            index === deck.slides.length - 1 &&
            fragmentIndex === fragments.length - 1)
      )
    })

    if (screenfull.isEnabled) {
      screenfull.onchange(() =>
        oscElements('fullscreen', fs =>
          fs.classList.toggle(
            'exit',
            screenfull.isEnabled && screenfull.isFullscreen
          )
        )
      )
    }
  }
}