# @jswork/fullscreen

> Fullscreen API.

Latest version **1.1.2** (published 2024-08-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install @jswork/fullscreen
pnpm add @jswork/fullscreen
yarn add @jswork/fullscreen
bun add @jswork/fullscreen
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.2 |
| Published | 2024-08-03 |
| First published | 2023-12-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 25.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | afeiship |
| Keywords | api, fullscreen, iife, umd |

## Links

- npm: https://www.npmjs.com/package/@jswork/fullscreen
- npm.io page: https://npm.io/package/@jswork/fullscreen

## Alternatives

- [@mdxeditor/editor](https://npm.io/package/@mdxeditor/editor.md) — 962.4K weekly downloads
- [mmdb-lib](https://npm.io/package/mmdb-lib.md) — 680.9K weekly downloads
- [playcanvas](https://npm.io/package/playcanvas.md) — 36.2K weekly downloads
- [@glw907/cairn-cms](https://npm.io/package/@glw907/cairn-cms.md) — 967 weekly downloads
- [markdown-to-confluence](https://npm.io/package/markdown-to-confluence.md) — 103 weekly downloads

## Recent versions

- 1.1.2 (latest) — 2024-08-03
- 1.1.1 — 2024-01-25
- 1.0.8 — 2023-12-28
- 1.0.7 — 2023-12-28
- 1.0.6 — 2023-12-25
- 1.0.5 — 2023-12-22
- 1.0.4 — 2023-12-22
- 1.0.3 — 2023-12-22
- 1.0.2 — 2023-12-22
- 1.0.1 — 2023-12-21

## 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
<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();
    });
</script>
```

## types
```ts
/// <reference types="@jswork/fullscreen/global.d.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

---
_Source: https://npm.io/package/@jswork/fullscreen · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
