-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
211 lines (166 loc) · 6.5 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
210
211
<!DOCTYPE html>
<html>
<head>
<link rel="manifest" href="baseballwa.manifest?v=1655868662">
<link rel="shortcut icon" href = "favicon.ico">
<link rel="apple-touch-icon" href="icons/icon32.png">
<link rel="apple-touch-icon" href="icons/icon64.png">
<link rel="apple-touch-icon" href="icons/icon128.png">
<link rel="apple-touch-icon" href="icons/icon256.png">
<link rel="apple-touch-icon" href="icons/icon512.png">
<meta name="viewport" content="width=device-width, user-scalable=no">
<meta name="mobile-web-app-capable" content="no" >
<title>RoboCoach Batting Order</title>
<style>
body{margin-bottom:4em;font-family:"Trebuchet MS", Helvetica, sans-serif;font-size:11pt;}
#controls{padding:5px;}
.hide{display:none;}
.block{border:solid 1px #ccc;padding:5px;}
.block li:hover{background-color:yellow;cursor:pointer;}
button{font-size:.9em;}
.curBatter{background:yellow;}
.nextBatter{background:rgb(175, 229, 247);}
li{font-size:1em;}
.fw{width:100%;}
.fr{float:right;}
.fl{float:left;}
h1,h2,h3,ul,ol {margin:.25em;}
</style>
</head>
<body style="background:#ccc;">
<script id="selectButtons" type="dot-template">
<div>
<button onclick="get('{{=it.sex}}s').value='';">Clear {{=it.sex}}s</button>
{{~it.people:p:i}}<button onclick="addToList('{{=it.sex}}','{{=p}}');">{{=p}}</button>{{~}}
</div>
</script>
<script id="teamTmpl" type="dot-template">
<p>click a player to se them as next-up</p>
<div class=block>
<h3>{{=it.name}} Dudes</h3>
<ol id="dudesList" onclick="setCurDude(idx(this,event.target));">
{{~it.dudes:dude:i}}
<li class="curBatter">{{=dude.name}}</li>
{{~}}
</ol>
</div>
<div class=block>
<h3>{{=it.name}} Gals</h3>
<ol id="galsList" onclick="setCurGal(idx(this,event.target));">
{{~it.gals:gal:i}}
<li class="nextBatter">{{=gal.name}}</li>
{{~}}
</ol>
</div>
</script>
<script id="battingTmpl2" type="dot-template">
<div class=block>
<h3>At Bat: {{=it.up}}</h3>
<h2>On Deck: {{=it.onDeck}}</h2>
<h2>In Hole: {{=it.inHole}}</h2>
</div>
</script>
<script id="playersTmpl" type="dot-template">
<div class="block" style="max-width:500px;">
<h1>Players <button onclick="toggle('importTeam');" class="fr" style="font-size:12pt;">Import</button></h1>
<div id="importTeam" class="hide">
<textarea id="importTeamData"></textarea>
<button onclick="importTeamData();">Do Import</button>
</div>
<input type="text" value="" id="newPlayer" /><button onclick="addPlayer(get('newPlayer').value);get('newPlayer').value='';html('playersEdit',playerListTmpl(players));">Add</button>
<br>
{{~it.sort():p:i}}
<div>{{!p}}
<button class="fr" onclick="removePlayer('{{!p}}');html('playersEdit',playerListTmpl(players));">Delete</button></div>
{{?music[p]}}
{{=linkSongTmplFn({availableSongs:availableSongs,playerName:p,curSong:music[p]})}}
{{??}}
Choose Song;
{{=linkSongTmplFn({availableSongs:availableSongs,playerName:p,curSong:music[p]})}}
{{?}}
<hr>
{{~}}
</div>
</script>
<script id="linkSongTmpl" type="dot-template">
<select onchange="setPlayerSong('{{=it.playerName}}',this.value);">
<option></option>
{{~it.availableSongs.sort():s:i}}
<option {{?s===it.curSong}}SELECTED{{?}} value="{{!s}}">{{=s.replace(/%20/g," ")}}</option>
{{~}}
</select>
startsAt:<input type="text" value="{{=musicStartsAt[it.playerName]||0}}" oninput="updatePlayer('musicStartsAt','{{!it.playerName||""}}',this.value);"/>,
WaitForAnnouncer:<input type="checkbox" onclick="updatePlayer('delaySong','{{!it.playerName}}',this.checked===true);" {{?delaySong[it.playerName]}}CHECKED{{?}}>
</script>
<!-- DREAMINFG OF AN UPDATE!!! dsssssssssssssssssssssssssssss -->
<button id="showSetup" class="" onclick="show('teamSetup');hide('showSetup');">Show Setup?</button>
<div id="teamSetup" class="hide">
<h3>Setup</h3>
<button onclick="hide('teamSetup');show('showSetup');">Hide Setup</button>
<button id="playerConfigBtn" onclick="html('playersEdit',playerListTmpl(players));toggle('playersEdit');">Config Players</button>
<button id="exportConfigBtn" onclick="exportConfig();">Export Setup</button>
<div id="playersEdit" class="hide"></div>
<fieldset><div id="dude"></div><label-for="dudes">Dudes (csv NO SPACES between players):</label><input class="fw" type="text" id="dudes" value=""></input>
<div id="gal"></div>
<label-for="gals">Gals (csv):</label><input class="fw" type="text" id="gals" value=""></input>
<fieldset>
<button onclick="saveTeam();loadTeam();">Update Order</button></fieldset>
</div>
<hr>
<div id="main"></div>
<div id="voices" class=""></div>
<button id="voiceInit" onclick="show('mainControls');initVoices();hide('voiceInit');show('voices');">start voices</button>
<br>
<div id="mainControls" class="hide">
<div id="audio"></div>
<button onclick="nextBatter();" class="hiLiteBtn" style="font-size:1.1em;" >next</button>
<!-- button onclick="curSong.fadeOut(0,1000);">fadeOut</button><br -->
<button onclick="curSong.pause();" class="hiLiteBtn">pause</button>
<button onclick="curSong.play();">resume</button>
<button onclick="curSong.pause();curSong.currentTime = (musicStartsAt[Team.dudes[di].name]||0); curSong.play();">restart song</button>
<br><br>
<button onclick="voiceSay('nice play');">nice play</button>
<button onclick="voiceSay('good eye!');">good eye</button>
<br>
<input id="saymsg" type="text" placeholder="something to say"></input><button onclick="voiceSay(get('saymsg').value);")>Say it</button>
<div id="controls" >
<button onclick="playWATC();">we are the champions</button><br>
<h2>Now Playing:<span id="nowPlaying"></span></h2></div>
</div>
<div id="curBattingTrack">ugh</div>
<script>
function l(key, item) {
if (item != undefined) {
localStorage.setItem(key + teamName, item);
} else {
return localStorage.getItem(key + teamName);
}
}
function jsonStore(key, item) {
if (item != undefined) {
localStorage.setItem(key + teamName, JSON.stringify(item));
} else {
var result=localStorage.getItem(key + teamName);
if (result){
return JSON.parse(result);
}
}
}
</script>
<script type="text/javascript" src="doT.js"></script>
<script type="text/javascript" src="baseball.js?v=1655868662"></script>
<script>
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('service-worker-generated.js').then(function(registration) {
console.log('Service worker registration succeeded:','vstamp-1655868662',registration.scope, registration);
}).catch( function(error) {
console.log('Service worker registration failed:', error);
});
} else {
console.log('Service workers are not supported.');
}
console.log("hmmm");
loadTeam(teamName);
</script>
</body>
</html>