Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/afeiship/fullscreen
Fullscreen API.
https://github.com/afeiship/fullscreen
api fullscreen iife umd
Last synced: 8 days ago
JSON representation
Fullscreen API.
- Host: GitHub
- URL: https://github.com/afeiship/fullscreen
- Owner: afeiship
- License: mit
- Created: 2019-09-22T11:28:15.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2024-01-25T12:33:01.000Z (11 months ago)
- Last Synced: 2024-04-25T14:42:50.114Z (8 months ago)
- Topics: api, fullscreen, iife, umd
- Language: TypeScript
- Homepage: https://afeiship.github.io/fullscreen
- Size: 31.3 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# fullscreen
> Fullscreen API.[![version][version-image]][version-url]
[![license][license-image]][license-url]
[![size][size-image]][size-url]
[![download][download-image]][download-url]## installation
```shell
npm install @jswork/fullscreen
```## usage
```js
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
```html
Request Fullscreen
Exit Fullscreenconst el1 = document.getElementById('p1');
const el2 = document.getElementById('p2');
el1.addEventListener('click', () => {
fullscreen.request();
});el2.addEventListener('click', () => {
fullscreen.exit();
});```
## types
```ts
///
```## license
Code released under [the MIT license](https://github.com/afeiship/fullscreen/blob/master/LICENSE.txt).[version-image]: https://img.shields.io/npm/v/@jswork/fullscreen
[version-url]: https://npmjs.org/package/@jswork/fullscreen[license-image]: https://img.shields.io/npm/l/@jswork/fullscreen
[license-url]: https://github.com/afeiship/fullscreen/blob/master/LICENSE.txt[size-image]: https://img.shields.io/bundlephobia/minzip/@jswork/fullscreen
[size-url]: https://github.com/afeiship/fullscreen/blob/master/dist/index.min.js[download-image]: https://img.shields.io/npm/dm/@jswork/fullscreen
[download-url]: https://www.npmjs.com/package/@jswork/fullscreen