93
93
.wait-for-game {}
94
94
</ style >
95
95
< div id ='wrapper ' class ='w3-animate-opacity '>
96
- < a href ="SomeSound.wav "> Here's My Sound</ a >
97
-
98
- < audio id ='sndWhistle ' preload >
99
- < source src ='sounds/misc031whistle.mp3 ' type ='audio/mpeg '>
100
- </ audio >
101
-
102
96
< div > <!-- class='w3-animate-top'> -->
103
97
< div > <!-- class='w3-animate-bottom'> -->
104
98
< div class ='w3-card-8 card-area card-twisle '>
105
99
< header >
106
100
< h1 class ='w3-center '> Virtual Cards Against Cards</ h1 >
107
- < h6 class ='w3-center '> Virtual Cards Against Humanity 0.6 < span > A < audio id =' sndLaugh ' controls > < source src =' sounds/comic006laugh.mp3 ' type =' audio/mpeg ' > </ audio > </ span > </ h6 >
101
+ < h6 class ='w3-center '> Virtual Cards Against Humanity 0.7 </ h6 >
108
102
< div class ='w3-center w3-tiny '>
109
103
< a href ='http://cardsagainsthumanity.com/ '> Cards Against Humanity</ a >
110
104
</ div >
@@ -194,13 +188,26 @@ <h4>Welcome <span data-bind='text:player'></span></h4>
194
188
</ div >
195
189
< br />
196
190
</ div >
197
- </ div >
191
+ </ div >
192
+ </ div >
193
+ < div class ='w3-row w3-center '>
194
+ < p >
195
+ < b > < span id ='txtPlayerName '> douchebag</ span > </ b > , < i > < span id ='txtGameName '> </ span > </ i > (< span id ='txtRoundNumber ' class ='w3-tiny '> </ span > )
196
+ </ p >
197
+ < p >
198
+ < button id ='btnSound ' class ='w3-center w3-btn w3-padding-tiny w3-margin-tiny w3-medium w3-white ' onclick ='onSound(event) '> < span id ='soundOff ' class ='fa fa-toggle-off '> < span class ='w3-large fa fa-volume-off '> </ span > </ span > < span id ='soundOn ' class ='fa fa-toggle-on '> < span class ='w3-large fa fa-volume-up '> </ span > </ span > </ button >
199
+ < a class ='w3-tiny ' href ='http://www.freesfx.co.uk '> http://www.freesfx.co.uk</ a >
200
+ </ p >
201
+ < audio id ='sndWhistle ' preload volume ='0.4 ' controls >
202
+ < source src ='sounds/multimedia_rollover_019.mp3 ' type ='audio/mpeg '>
203
+ </ audio >
198
204
</ div >
199
205
</ div >
200
206
</ div >
201
207
202
208
< script >
203
209
210
+ soundOn = true ;
204
211
var activity = [ { playerId :'noid' , displayName :'You' , lastActivity :'' , when :'' , score :'' , renderClass :'' } ] ;
205
212
206
213
viewModel = {
@@ -214,12 +221,26 @@ <h4>Welcome <span data-bind='text:player'></span></h4>
214
221
isStarted : ko . observable ( false )
215
222
} ;
216
223
217
-
218
- // window level globals
219
224
ko . applyBindings ( viewModel ) ;
220
225
xmlhttp = new XMLHttpRequest ( ) ;
221
226
222
-
227
+ function toggleControls ( videoId ) {
228
+ var video = document . getElementById ( videoId ) ;
229
+ if ( video . hasAttribute ( "controls" ) ) {
230
+ video . removeAttribute ( "controls" )
231
+ } else {
232
+ video . setAttribute ( "controls" , "controls" )
233
+ }
234
+ }
235
+
236
+ function onSound ( event ) {
237
+ soundOn = ! soundOn ;
238
+ $ ( '#soundOn' ) . toggle ( soundOn ) ;
239
+ $ ( '#soundOff' ) . toggle ( ! soundOn ) ;
240
+
241
+ toggleControls ( 'sndWhistle' ) ;
242
+ }
243
+
223
244
function cleanUi ( ) {
224
245
$ ( '.wait-for-load' ) . hide ( ) ;
225
246
$ ( '.wait-for-game' ) . hide ( ) ;
@@ -235,6 +256,10 @@ <h4>Welcome <span data-bind='text:player'></span></h4>
235
256
var invite = cardApi . getParameterByName ( 'Invite' ) ;
236
257
viewModel . isInvite ( ( invite . length > 0 ) ) ;
237
258
259
+ $ ( '#soundOn' ) . toggle ( soundOn ) ;
260
+ $ ( '#soundOff' ) . toggle ( ! soundOn ) ;
261
+
262
+
238
263
if ( playerP . length == 0 ) $ ( '#pn' ) . focus ( ) ;
239
264
else if ( gameP . length == 0 ) $ ( '#gn' ) . focus ( ) ;
240
265
@@ -245,9 +270,12 @@ <h4>Welcome <span data-bind='text:player'></span></h4>
245
270
} ;
246
271
247
272
function playRound ( ) {
248
- $ ( "#sndWhistle" ) . trigger ( 'play' ) ;
249
- var playRoundLocation = cardApi . getRoot ( window . document . URL ) + '/PlayRoundUi?Game=' + encodeURIComponent ( viewModel . game ( ) ) + '&Player=' + encodeURIComponent ( viewModel . player ( ) ) ;
250
- window . document . location = playRoundLocation ;
273
+ if ( soundOn ) $ ( "#sndWhistle" ) . trigger ( 'play' ) ;
274
+
275
+ setTimeout ( function ( ) {
276
+ var playRoundLocation = cardApi . getRoot ( window . document . URL ) + '/PlayRoundUi?Game=' + encodeURIComponent ( viewModel . game ( ) ) + '&Player=' + encodeURIComponent ( viewModel . player ( ) ) ;
277
+ window . document . location = playRoundLocation ;
278
+ } , 1000 ) ;
251
279
} ;
252
280
253
281
function onClickStart ( event ) {
0 commit comments