0.0.3 • Published 6 years ago

saidai v0.0.3

Weekly downloads
15
License
-
Repository
github
Last release
6 years ago

saidai

A simple wrapper of Fullscreen API.

Install

This project uses node and npm. Go check them out if you don't have them locally installed.

$ npm install --save saidai

or if you use yarn.

$ yarn add saidai

Then with a module bundler like rollup or webpack, use as you would anything else:

// using ES6 modules
import saidai from 'saidai'

// using CommonJS modules
var saidai = require('saidai')

The UMD build is also available on unpkg:

<script src="//unpkg.com/saidai/dist/saidai.umd.js"></script>

This exposes the saidai() function as a global.


Usage

import saidai from 'saidai';

const fullscreen = saidai()

// check if some element is in Fullscreen mode
saidai.isFullscreen()

// Request to Enter Fullscreen mode
saidai.request()

// Exit Fullscreen mode
saidai.exit()

// Listen to `fullscreenchange` event
fullscreen.on('change', isFull => console.log(`Fullscreen mode: ${isFull ? 'ON' : 'OFF'}`))

Examples & Demos

Real Example on JSFiddle ➡️

API

saidai's API is organized as follows:

saidai(options: Object)

saidai will account for the following properties in options:

  • param ....

isFullscreen()

return if some element in Fullscreen mode

request()

Request to Enter Fullscreen mode

exit()

Exit Fullscreen mode