Skip to content

Commit

Permalink
Preloads images. Added compatibility list.
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxLaumeister committed Mar 28, 2013
1 parent 0974f39 commit d605f74
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
4 changes: 2 additions & 2 deletions engine.css
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ a {
color: white;
bottom: 0;
left: 0;
margin: 1em;
margin: 2em;
width: 22em;
}

Expand Down Expand Up @@ -72,7 +72,7 @@ a {
position: fixed;
bottom: 0;
right: 0;
margin: 1em;
margin: 2em;
width: 50px;
height: 46px;
background-image: url('images/sound.png');
Expand Down
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
<p>
Realtime Bitcoin transaction and trade visualizer. <a href="">More Info</a>
</p>
<p>Works with Chrome, Firefox 19+, and Safari 6+.</p>
<p>
Donations get highlighted: <span style="color: yellow;">14zoTKB29NdsJRvk4qP3vB9mQZ3dcV3eWk</span>
</p>
Expand Down
7 changes: 6 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ var globalMute = false;

var instanceId = 0;
var pageDivId = "pageDiv";
var TICK_SPEED = 50;

var updateTargets = new Array();

Expand All @@ -18,6 +19,10 @@ $(document).ready(function() {
$("#clickSuppress").click(function () {
$("#noInternetExplorer").slideUp(300);
});

// Preload images
(new Image()).src = "images/block.png";
(new Image()).src = "images/bubble.png";

// Create a bubble spawner for testing
var debugSpawner = function() {
Expand Down Expand Up @@ -62,7 +67,7 @@ var globalUpdate = function() {
for (var i = 0; i < updateTargets.length; i++) {
updateTargets[i].update();
}
setTimeout(globalUpdate, 40);
setTimeout(globalUpdate, TICK_SPEED);
}

window.onbeforeunload = function(e) {
Expand Down
2 changes: 1 addition & 1 deletion transaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function Transaction(bitcoins, currency, currencyName, highlight) {
// Sound
var maxBitcoins = 1000;
var minVolume = 0.3;
var maxVolume = 0.6;
var maxVolume = 0.5;
var volume = bitcoins / (maxBitcoins / (maxVolume - minVolume)) + minVolume;
Sound.playRandomAtVolume(volume * 100);
}
Expand Down

0 comments on commit d605f74

Please sign in to comment.