-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
209 lines (178 loc) · 5.75 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
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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
<!DOCTYPE html>
<html>
<head>
<base href="">
<script type="module" src="/src/main.ts"></script>
<style>
body {
font-family: sans-serif;
}
</style>
</head>
<body style="background-color: #00ff00">
<div style="display: flex; justify-content: center; flex-direction: column; row-gap: 25px; margin: 25px;">
<baseball-scoreboard
mode="normal"
awayLogoSrc="https://static.wbsc.org/upload/acfef0c2-5af4-e797-cb4b-550d6173bb34.png"
homeLogoSrc="https://static.hardbulls.com/images/icons/icon-180x180.png"
leagueLogoSrc="https://static.wbsc.org/uploads/federations/8/events/photos/63ac8faa-4b82-1b32-a456-35b1892d8e58.svg"
leagueLogoShadow="#8a8a8a"
hideCounts="false"
hideBases="false"
hideInning="false"
fontName="Courier New"
fontLineHeight="1.10"
bases="false,false,false"
inning="1.5"
homeScore="0"
awayScore="0"
balls="0"
strikes="0"
outs="0"
awayGradient="180,#474747,#334433,30,50"
homeGradient="180,#bb0909,#992222,30,50"
layoutGradient="180,#ebebeb,#e0e0e0,50,50"
backgroundGradient="180,#000000,#484848,0,100"
fontColorDark="#292929"
fontColorLight="#e8e8e8"
awayLogoShadow="#3b3b3b"
homeLogoShadow="#2a2a2a"
activeInningColor="#e00000"
inactiveInningColor="#b3b3b3"
activeOutColor="#e00000"
inactiveOutColor="#b3b3b3"
activeBaseColor="#e5c72b"
inactiveBaseColor="#b3b3b3"
awayName="BH" homeName="HB"
borderColor="#000000"
borderSize="3px">
</baseball-scoreboard>
<baseball-playerboard
fontName="Courier New"
fontLineHeight="1.10"
inning="1.5"
awayGradient="180,#474747,#334433,30,50"
homeGradient="180,#bb0909,#992222,30,50"
layoutGradient="180,#ebebeb,#e0e0e0,50,50"
backgroundGradient="180,#000000,#484848,0,100"
fontColorDark="#292929"
fontColorLight="#e8e8e8"
borderColor="#000000"
borderSize="3px"
hideStats="false"
minNameWidth="10"
>
</baseball-playerboard>
</div>
<div style="display: flex; flex-direction: column; max-width: 400px; row-gap: 4px;">
<div style="display: flex; justify-content: space-between">
<div>Outs</div>
<div>
<input onchange="changeProperty('outs', this.value)" type="number" min="0" max="2" />
</div>
</div>
<div style="display: flex; justify-content: space-between">
<div>Inning</div>
<div>
<input onchange="changeProperty('inning', this.value)" type="number" step="0.5" min="1" max="99.5" />
</div>
</div>
<div style="display: flex; justify-content: space-between">
<div>Home Score</div>
<div>
<input onchange="changeProperty('homeScore', this.value)" type="number" min="0" max="99" />
</div>
</div>
<div style="display: flex; justify-content: space-between">
<div>Away Score</div>
<div>
<input onchange="changeProperty('awayScore', this.value)" type="number" min="0" max="99" />
</div>
</div>
<div style="display: flex; justify-content: space-between">
<div>Balls</div>
<div>
<input onchange="changeProperty('balls', this.value)" type="number" min="0" max="3" />
</div>
</div>
<div style="display: flex; justify-content: space-between">
<div>Strikes</div>
<div>
<input onchange="changeProperty('strikes', this.value)" type="number" min="0" max="2" />
</div>
</div>
<div style="display: flex; justify-content: space-between">
<div>Home Name</div>
<div>
<input onchange="changeProperty('homeName', this.value)" type="text" />
</div>
</div>
<div style="display: flex; justify-content: space-between">
<div>Away Name</div>
<div>
<input onchange="changeProperty('awayName', this.value)" type="text" />
</div>
</div>
<div style="display: flex; justify-content: space-between">
<div>Batter Name</div>
<div>
<input onchange="changeProperty('batterName', this.value)" type="text" />
</div>
</div>
<div style="display: flex; justify-content: space-between">
<div>Pitcher Name</div>
<div>
<input onchange="changeProperty('pitcherName', this.value)" type="text" />
</div>
</div>
<div style="display: flex; justify-content: space-between">
<div>Pitcher ERA</div>
<div>
<input onchange="changeProperty('pitcherEra', this.value)" type="number" step="0.1" />
</div>
</div>
<div style="display: flex; justify-content: space-between">
<div>Batter AVG</div>
<div>
<input onchange="changeProperty('batterAvg', this.value)" type="number" step="0.001" />
</div>
</div>
<div style="display: flex; justify-content: space-between">
<div>Bases</div>
<div>
<input onchange="changeBase(0, this.checked)" type="checkbox" />
<input onchange="changeBase(1, this.checked)" type="checkbox" />
<input onchange="changeBase(2, this.checked)" type="checkbox" />
</div>
</div>
</div>
<script>
const scoreboards = document.querySelectorAll("baseball-scoreboard");
const playerboards = document.querySelectorAll("baseball-playerboard");
function changeProperty(property, value) {
for (const scoreboard of scoreboards) {
scoreboard.setAttribute(property, value);
}
for (const playerboard of playerboards) {
playerboard.setAttribute(property, value);
}
}
function changeBase(base, value) {
for (const scoreboard of scoreboards) {
const bases = scoreboard.getAttribute("bases").split(",").map(v => v === "true");
bases[base] = value;
scoreboard.setAttribute("bases", bases);
}
}
</script>
<footer style="text-align: center">
<p>
<a href="https://github.com/hardbulls/baseball-scoreboard">Hard Bulls Baseball Scoreboard</a> - <a
href="https://www.hardbulls.com">hardbulls.com</a>
</p>
<p>
Copyright © Arjan Frans 2024
</p>
</footer>
</body>
</html>