-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpage.html
34 lines (34 loc) · 1.43 KB
/
webpage.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<!DOCTYPE html><html><head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
html,body {height:100%;margin:0;background-color:#f9f9f9;}
.box {display:flex;flex-flow:column;padding:10pt;margin:10pt;}
.sec {display:flex;width:100%;font-family:Arial, Helvetica, sans-serif;font-size:30pt;padding:7pt;align-items:center;gap:7pt;color:#444;}
.ttl {display:flex;width:32pt;height:32pt;font-size:12pt;border:2px solid #444;border-radius:7px;justify-content:center;align-items:center;box-shadow: 2px 2px 2px 2px #eed;}
.slider {width:100%;background:#ddd;accent-color:#888;}
</style>
<script>
</script>
</head>
<body>
<div class="box">
<div class="sec">
<div class="ttl">PWM</div><span id="valuePwm">127</span>
</div>
<input type="range" min="0" max="8192" value="4096" class="slider" id="sliderPwm">
<div class="sec">
<div class="ttl">V</div><span id="valueV">0.00</span> V
</div>
<div class="sec">
<div class="ttl">A</div><span id="valueA">0.00</span> A
</div>
</div>
<script>
const slider = document.getElementById("sliderPwm");
const output = document.getElementById("valuePwm");
slider.addEventListener("input", function() {
output.textContent = Math.floor(this.value/32);
});
</script>
</body></html>