Skip to content

Commit 238bcea

Browse files
MatthewMatthew
authored andcommitted
Audio update and sound on by default
1 parent 0ff9f85 commit 238bcea

23 files changed

+164
-67
lines changed

VirtualCards.html

Lines changed: 121 additions & 45 deletions
Large diffs are not rendered by default.

cards/CaHCrabsAdjustHumidityBlack.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,7 @@ Apple® has announced a new device that promises to revolutionize the way we thi
4646
Audiences at Sundance were traumatized by Lars von Trier's controversial new film, "_."
4747
Bentley's® latest ultra-high-end luxury sedan comes complete with _, _ and _.
4848
Dear Dan Savage, Please help. I am unable to achieve orgasm without _.
49-
"Dear, your father and I found _ and _ in your bedroom.
50-
51-
I'm shocked, and frankly just a little disappointed."
49+
"Dear, your father and I found _ and _ in your bedroom. I'm shocked, and frankly just a little disappointed."
5250
Experts say that without careful management and conservation, _ will disappear within our lifetimes.
5351
From the people who brought you Sharktopus and Sharknado, Syfy's® next horror film combines sharks with _.
5452
Having abandoned his pleas for a return to the gold standard, Ron Paul is now promoting a _-based economy.

index.html

Lines changed: 42 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -93,18 +93,12 @@
9393
.wait-for-game {}
9494
</style>
9595
<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-
10296
<div><!-- class='w3-animate-top'> -->
10397
<div> <!-- class='w3-animate-bottom'> -->
10498
<div class='w3-card-8 card-area card-twisle'>
10599
<header>
106100
<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>
108102
<div class ='w3-center w3-tiny'>
109103
<a href='http://cardsagainsthumanity.com/'>Cards Against Humanity</a>
110104
</div>
@@ -194,13 +188,26 @@ <h4>Welcome <span data-bind='text:player'></span></h4>
194188
</div>
195189
<br/>
196190
</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>
198204
</div>
199205
</div>
200206
</div>
201207

202208
<script>
203209

210+
soundOn = true;
204211
var activity = [ { playerId:'noid', displayName:'You', lastActivity:'', when:'', score:'', renderClass:'' } ];
205212

206213
viewModel = {
@@ -214,12 +221,26 @@ <h4>Welcome <span data-bind='text:player'></span></h4>
214221
isStarted: ko.observable(false)
215222
};
216223

217-
218-
// window level globals
219224
ko.applyBindings(viewModel);
220225
xmlhttp = new XMLHttpRequest();
221226

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+
223244
function cleanUi() {
224245
$('.wait-for-load').hide();
225246
$('.wait-for-game').hide();
@@ -235,6 +256,10 @@ <h4>Welcome <span data-bind='text:player'></span></h4>
235256
var invite = cardApi.getParameterByName('Invite');
236257
viewModel.isInvite( (invite.length > 0) );
237258

259+
$('#soundOn').toggle(soundOn);
260+
$('#soundOff').toggle(!soundOn);
261+
262+
238263
if (playerP.length == 0) $('#pn').focus();
239264
else if (gameP.length == 0) $('#gn').focus();
240265

@@ -245,9 +270,12 @@ <h4>Welcome <span data-bind='text:player'></span></h4>
245270
};
246271

247272
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);
251279
};
252280

253281
function onClickStart(event) {

sounds/alert_asterisk_3.mp3

47.2 KB
Binary file not shown.
27.3 KB
Binary file not shown.

sounds/cartoon003kiss.mp3

-14.7 KB
Binary file not shown.

sounds/cartoon007bell.mp3

-20.5 KB
Binary file not shown.

sounds/cartoon013creak.mp3

-18.8 KB
Binary file not shown.

sounds/comic006laugh.mp3

-26 KB
Binary file not shown.

sounds/http--www.grsites.com-archive-sounds-category-23-offset=48.url

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)