-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
85 lines (66 loc) · 2.04 KB
/
index.js
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
let homeStoreEl = document.getElementById("scoreBgH")
let guestStoreEl = document.getElementById("scoreBgG")
let homeScore = 0
let guestScore = 0
let highlighterWH = document.getElementById("home-el")
let highlighterWG = document.getElementById("guest-el")
function highlightedW(){
if(homeScore > guestScore){
highlighterWH.style.color = "#A5C9CA";
highlighterWH.style.border = "thick dotted #A5C9CA";
highlighterWH.style.marginTop = "30px";
highlighterWG.style.color = "#9AABD8";
highlighterWG.style.border = "none";
highlighterWG.style.marginTop = "40px";
} else if (homeScore < guestScore){
highlighterWG.style.color = "#A5C9CA";
highlighterWG.style.border = "thick dotted #A5C9CA";
highlighterWG.style.marginTop = "30px";
highlighterWH.style.color = "#9AABD8";
highlighterWH.style.border = "none";
highlighterWH.style.marginTop = "40px";
} else {
highlighterWG.style.color = "#9AABD8";
highlighterWG.style.border = "none";
highlighterWG.style.marginTop = "40px";
highlighterWH.style.color = "#9AABD8";
highlighterWH.style.border = "none";
highlighterWH.style.marginTop = "40px";
}
}
function addH1(){
homeScore += 1
homeStoreEl.textContent = homeScore
console.log(homeScore)
highlightedW()
}
function addH2(){
homeScore += 2
homeStoreEl.textContent = homeScore
console.log(homeScore)
highlightedW()
}
function addH3(){
homeScore += 3
homeStoreEl.textContent = homeScore
console.log(guestScore)
highlightedW()
}
function addG1(){
guestScore += 1
guestStoreEl.textContent = guestScore
console.log(guestScore)
highlightedW()
}
function addG2(){
guestScore += 2
guestStoreEl.textContent = guestScore
console.log(guestScore)
highlightedW()
}
function addG3(){
guestScore += 3
guestStoreEl.textContent = guestScore
console.log(guestScore)
highlightedW()
}