1.1.1 • Published 4 months ago

@jswork/fullscreen v1.1.1

Weekly downloads
-
License
MIT
Repository
-
Last release
4 months ago

fullscreen

Fullscreen API.

version license size download

installation

npm install @jswork/fullscreen

usage

import fullscreen from '@jswork/fullscreen';

// enter fullscreen
fullscreen.request()

// exit fullscreen
fullscreen.exit()

// toggle fullscreen
fullscreen.toggle()

// register event
const res = fullscreen.on((e)=>console.log(e));

// unregister event
res.destroy();

// detect fullscreen status
fullscreen.isFullscreen

in html

<button id="p1">Request Fullscreen</button>
<button id="p2">Exit Fullscreen</button>
<script>
    const el1 = document.getElementById('p1');
    const el2 = document.getElementById('p2');
    el1.addEventListener('click', () => {
      fullscreen.request();
    });
el2.addEventListener('click', () => {
  fullscreen.exit();
});

types

/// <reference types="@jswork/fullscreen/global.d.ts" />

license

Code released under the MIT license.

1.1.1

4 months ago

1.0.8

5 months ago

1.0.7

5 months ago

1.0.6

5 months ago

1.0.2

5 months ago

1.0.5

5 months ago

1.0.4

5 months ago

1.0.3

5 months ago

1.0.1

5 months ago