mirror of
https://github.com/HendrikRauh/dmx-interface.git
synced 2025-05-19 10:32:56 +00:00
Merge branch 'main' into 51-button-actions
This commit is contained in:
commit
aaae5ac91b
2 changed files with 12 additions and 6 deletions
|
@ -7,11 +7,11 @@
|
|||
<link rel="stylesheet" href="/style.css" />
|
||||
<script type="module" src="/input-visibility.js" defer></script>
|
||||
<script type="module" src="/loading-screen.js" defer></script>
|
||||
<script type="module" src="/range-input.js" defer></script>
|
||||
<script type="module" src="/load-data.js" defer></script>
|
||||
<script type="module" src="/networks.js" defer></script>
|
||||
<script type="module" src="/submit.js" defer></script>
|
||||
<script type="module" src="/reset.js" defer></script>
|
||||
<script type="module" src="/range-input.js" defer></script>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
|
|
|
@ -1,14 +1,20 @@
|
|||
document.querySelector("form").addEventListener("input", (event) => {
|
||||
const form = document.querySelector("form");
|
||||
|
||||
form.addEventListener("input", (event) => {
|
||||
if (event.target.classList.contains("range")) {
|
||||
updateValue(event.target);
|
||||
}
|
||||
});
|
||||
|
||||
form.addEventListener("change", () => {
|
||||
console.log("received change event");
|
||||
document.querySelectorAll("input[type='range']").forEach((input) => {
|
||||
updateValue(input);
|
||||
});
|
||||
});
|
||||
|
||||
function updateValue(slider) {
|
||||
console.log("update slide value");
|
||||
const percentage = Math.round((slider.value / slider.max) * 100);
|
||||
slider.nextElementSibling.innerText = `${percentage}%`;
|
||||
}
|
||||
|
||||
document.querySelectorAll("input[type='range'].range").forEach((element) => {
|
||||
updateValue(element);
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue