https://github.com/fireyy/saidai
A simple wrapper of Fullscreen API.
https://github.com/fireyy/saidai
Last synced: 7 months ago
JSON representation
A simple wrapper of Fullscreen API.
- Host: GitHub
- URL: https://github.com/fireyy/saidai
- Owner: fireyy
- Created: 2017-12-11T08:30:33.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-12-12T02:26:08.000Z (over 8 years ago)
- Last Synced: 2025-10-24T10:39:02.973Z (9 months ago)
- Language: JavaScript
- Size: 31.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# saidai
> A simple wrapper of Fullscreen API.
## Install
This project uses [node](http://nodejs.org) and [npm](https://npmjs.com). Go check them out if you don't have them locally installed.
```sh
$ npm install --save saidai
```
or if you use [yarn](https://yarnpkg.com).
```sh
$ yarn add saidai
```
Then with a module bundler like [rollup](http://rollupjs.org/) or [webpack](https://webpack.js.org/), use as you would anything else:
```javascript
// using ES6 modules
import saidai from 'saidai'
// using CommonJS modules
var saidai = require('saidai')
```
The [UMD](https://github.com/umdjs/umd) build is also available on [unpkg](https://unpkg.com):
```html
```
This exposes the `saidai()` function as a global.
* * *
## Usage
```js
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**](https://jsfiddle.net/fireyy/x1fkk0hb/) ➡️
## 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