An open API service indexing awesome lists of open source software.

https://github.com/vokseverk/wakelock-toggle-element

A custom element to render a toggle switch for enabling the screen's wakelock function
https://github.com/vokseverk/wakelock-toggle-element

custom-element wakelock

Last synced: 2 months ago
JSON representation

A custom element to render a toggle switch for enabling the screen's wakelock function

Awesome Lists containing this project

README

        

# <wakelock-toggle> element

This is a [Custom Element][CE] that renders a toggle switch (i.e. a checkbox) for requesting to
keep the device's screen from dimming and going to sleep.

## Usage

Grab the [wakelock-toggle.js][FILE] file and include it in your HTML like this:

```html

```

Then us the HTML element anywhere you want the switch to
render in your webpage, e.g.:

```html

My Pancake Recipe


Settings



...


  1. ...

  2. ...

```

The `label` attribute is optional; the default value is `"Keep the screen on"`.

[CE]: https://developer.mozilla.org/en-US/docs/Web/API/Web_components/Using_custom_elements
[FILE]: src/wakelock-toggle.js