Remote-Brightness-PWA/index.html

22 lines
937 B
HTML
Raw Normal View History

2022-12-27 15:39:07 +00:00
<head>
<body>
<form action="/button_pressed" method="get">
<label for="brightness">Brightness:</label>
<input type="range" id="brightness" name="brightness" min="0" max="100" onmouseup="updateBrightness(this.value)" ontouchend="updateBrightness(this.value)">
<output id="brightness-value"></output>
</form>
<script>
function updateBrightness(value) {
document.querySelector('#brightness-value').innerHTML = value;
window.location.href = '/button_pressed?' + value;
}
function submitForm(event) {
// Prevent the default form submission behavior
event.preventDefault();
// Submit the form manually
document.querySelector('form').submit();
}
</script>
</body>
</head>