This repository has been archived by the owner on Jan 4, 2021. It is now read-only.
forked from ftc11260/ftc11260.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
58 lines (52 loc) · 2.53 KB
/
index.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<!DOCTYPE html>
<html>
<head>
<title>Scoring Calculator</title>
<link href='normalize.css' rel='stylesheet'>
<link href='styles.css' rel='stylesheet'>
</head>
<body>
<strong>Score: </strong> <span id='score'>0</span> <button id='update' onclick='calc()'>Update</button> <br>
<strong>Autonomous</strong> <br>
<button onclick='update(-1,"autonShots")'>S-</button>
<span id='autonShots'>0</span>
<button onclick='update(1,"autonShots")'>S+</button> <br>
<button onclick='update(-1,"autonBeacons")'>B-</button>
<span id='autonBeacons'>0</span>
<button onclick='update(1,"autonBeacons")'>B+</button> <br>
<button onclick='update(-1,"park")'>P-</button>
<span id='park'>0</span>
<button onclick='update(1,"park")'>P+</button> <br>
<button onclick='update(-1,"autonCap")'>C-</button>
<span id='autonCap'>0</span>
<button onclick='update(1,"autonCap")'>C+</button> <br>
<strong>Teleop</strong> <br>
<button onclick='update(-1,"teleopShots")'>S-</button>
<span id='teleopShots'>0</span>
<button onclick='update(1,"teleopShots")'>S+</button> <br>
<button onclick='update(-1,"teleopBeacons")'>B-</button>
<span id='teleopBeacons'>0</span>
<button onclick='update(1,"teleopBeacons")'>B+</button> <br>
<button onclick='update(-1,"cap")'>C-</button>
<span id='cap'>0</span>
<button onclick='update(1,"cap")'>C+</button> <br>
<script>
function update(num, target)
{
currentNum = parseInt(document.getElementById(target).innerHTML)
document.getElementById(target).innerHTML = currentNum + num
calc()
}
function calc()
{
let score = parseInt(document.getElementById("autonShots").innerHTML)*15 + parseInt(document.getElementById("autonBeacons").innerHTML)*30 + parseInt(document.getElementById("park").innerHTML)*5 + parseInt(document.getElementById("teleopShots").innerHTML)*5 + parseInt(document.getElementById("teleopBeacons").innerHTML)*10 + parseInt(document.getElementById("autonCap").innerHTML)*5
score += parseInt(document.getElementById("cap").innerHTML)*10
if(parseInt(document.getElementById("cap").innerHTML) == 3)
{
score += 10
}
document.getElementById("score").innerHTML = score
}
</script>
</body>
</html>