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
- Host: GitHub
- URL: https://github.com/vokseverk/wakelock-toggle-element
- Owner: vokseverk
- License: mit
- Created: 2024-05-17T11:38:55.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-05-18T19:53:09.000Z (about 1 year ago)
- Last Synced: 2024-05-19T20:40:23.951Z (about 1 year ago)
- Topics: custom-element, wakelock
- Language: JavaScript
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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
...
- ...
- ...
```
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