-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDalis.html
More file actions
78 lines (67 loc) · 1.8 KB
/
Dalis.html
File metadata and controls
78 lines (67 loc) · 1.8 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<html>
<head>
<script>
function skaic() {
var a = parseInt(document.getElementById("1").value);
var b = parseInt(document.getElementById("2").value);
var c = a + b;
if(!document.getElementById("ch").checked) {
a=Math.round((a/c)*100);
b=Math.round((b/c)*100);
c=a+b;
}
document.getElementById("vienas").style.height = a + "px";
document.getElementById("vienas").style.lineHeight = a + "px";
document.getElementById("vienas").style.fontSize = a + "px";
document.getElementById("du").style.height = b + "px";
document.getElementById("du").style.lineHeight = b + "px";
document.getElementById("du").style.fontSize = b + "px";
document.getElementById("visas").style.height = c + "px";
document.getElementById("vienas").innerHTML=""+a;
document.getElementById("du").innerHTML=""+b;
if(document.getElementById("ch").checked) document.getElementById("bendras").innerHTML="Viso: "+c+"<br /> ω<sub>1</sub> = " +Math.round((a/c)*10000)/100+"%"+"<br /> ω<sub>2</sub> = " +Math.round((b/c)*10000)/100+"%";
else document.getElementById("bendras").innerHTML="Viso: "+c;
}
</script>
<style>
#visas{
height:100px;
width:60%;
font-size:300%;
}
#vienas{
background:#80ff00 ;
height:100px;
text-align: center;
vertical-align: middle;
line-height: 90px;
}
#du {
background:#0080ff;
height:100px;
text-align: center;
vertical-align: middle;
line-height: 90px;
}
input{
width:60%;
}
#bendras {
position:fixed;
top:0px;
left:60%;
font-size:30px;
}
</style>
</head>
<body>
<input id="ch" type="checkbox"></input>
<input oninput="skaic()" id="1" type="range" value="50" max="200"></input>
<input oninput="skaic()" id="2" type="range" value="50" max="200"></input>
<div id="visas">
<div id="vienas" ></div>
<div id="du" ></div>
<div id="bendras" ></div>
</div>
</body>
</html>