22 lines
937 B
HTML
22 lines
937 B
HTML
<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> |