-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path3 PLAYER.html
More file actions
188 lines (149 loc) · 5.92 KB
/
3 PLAYER.html
File metadata and controls
188 lines (149 loc) · 5.92 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
<!DOCTYPE html>
<html>
<head>
<title>3 PLAYER</title>
<meta charset="windows-1252">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<script>
window.onbeforeunload = function() {
return "Data will be lost if you leave the page, are you sure?";
};
function calc()
{
var n1 = new Float32Array(4);
var n2 = new Float32Array(4);
var str = document.getElementById('n1').value;
var res = str.split("-");
n1[1] =parseFloat(res[0]);
n2[1] =parseFloat(res[1]);
str = document.getElementById('n2').value;
res = str.split("-");
n1[2] =parseFloat(res[0]);
n2[2] =parseFloat(res[1]);
str = document.getElementById('n3').value;
res = str.split("-");
n1[3] =parseFloat(res[0]);
n2[3] =parseFloat(res[1]);
var l=n1[1]+n1[2]+n1[3];
var s=n2[1]+n2[2]+n2[3];
var rates = document.getElementsByName("blankRadio");
var rate;
for(var i = 0; i < rates.length; i++)
{
if(rates[i].checked){
rate = rates[i].value;
}
}
var win=parseFloat(rate);
var score = new Float32Array(4);
for(var i=1;i<4;++i)
{
if(i===win)
{
document.getElementById("s"+i).innerHTML=parseFloat(document.getElementById("s"+i).innerHTML)+3*n2[i]-s+l;
score[i]=3*n2[i]-s+l;
}
else
{
document.getElementById("s"+i).innerHTML=parseFloat(document.getElementById("s"+i).innerHTML)+3*n2[i]-s-n1[i];
score[i]=3*n2[i]-s-n1[i];
}
}
for(var i=1;i<4;++i)
{
document.getElementById("col"+i).innerHTML+="</br>"+score[i];
}
for(var i=1;i<4;++i)
{
if(document.getElementById("pp"+i).value)
document.getElementById("p"+i).innerHTML=document.getElementById("pp"+i).value+":";
else
document.getElementById("p"+i).innerHTML="Player"+i+":";
}
document.getElementById('n1').value='';
document.getElementById('n2').value='';
document.getElementById('n3').value='';
}
</script>
<style>
input
{
text-align: center;
}
.but{
text-align:center;
}
body
{
color:rgb(255, 251, 4);
font-weight:bold;
margin-left:4%;
margin-right:4%;
margin-top:12.5%;
background-image:url('background.jpg');
background-color: black;
background-size: 100% ;
background-position: center center;
}
#demo
{
color:White;
font-weight:bold;
font-size: 1.25em;
-webkit-text-stroke-width: 0.5px;
-webkit-text-stroke-color: red;
}
.column {
float: left;
width: 33%;
text-align: center;
color:whitesmoke;
font-weight:bold;
}
#col1,#col2,#col3,#col4
{
color:whitesmoke;
-webkit-text-stroke-width: 0.5px;
-webkit-text-stroke-color: blue;
}
</style>
</head>
<body>
<div class="form-check">
<input class="form-check-input position-static" type="radio" name="blankRadio" id="blankRadio1" value="1" aria-label="...">
<label id="p1" >Player 1:</label>
<label for="s1" id="s1">0</label>
<input type="tel" id="n1" placeholder="Point-Maal" onfocus="this.value=''" /><br/><br/>
</div>
<div class="form-check">
<input class="form-check-input position-static" type="radio" name="blankRadio" id="blankRadio1" value="2" aria-label="...">
<label id="p2">Player 2:</label>
<label for="s2" id="s2">0</label>
<input type="tel" id="n2" placeholder="Point-Maal" /><br/><br/>
</div>
<div class="form-check">
<input class="form-check-input position-static" type="radio" name="blankRadio" id="blankRadio1" value="3" aria-label="...">
<label id="p3">Player 3:</label>
<label for="s3" id="s3">0</label>
<input type="tel" id="n3"placeholder="Point-Maal" /><br/><br/>
</div>
<div class="but">
<button onclick="calc()" class="btn btn-primary"> Submit</button>
</div>
</br>
<div class="column" >
<input type="text" placeholder="Player1" size="11" id="pp1"/>
<p id="col1">Player1</p>
</div>
<div class="column" >
<input type="text" placeholder="Player2" size="11" id="pp2"/>
<p id="col2"> Player2 </p>
</div>
<div class="column" >
<input type="text" placeholder="Player3" size="11" id="pp3"/>
<p id="col3"> Player3 </p>
</div>
<p id="demo">Made by:Varun Sahu <br/> Email:varunsahu29.vs@gmail.com</p>
</body>
</html>