Created
April 27, 2013 13:08
-
-
Save joeymarburger/5473059 to your computer and use it in GitHub Desktop.
Tardis pulsing effect with audio used with reveal.js for a BarCamp presentation.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tardis = function() | |
{ | |
// Download wav file here: https://dl.dropboxusercontent.com/u/9440990/tardis.wav | |
var tardis = new Audio("tardis.wav"); | |
tardis.play(); | |
setTimeout(function() { | |
$("img#tardisimg").animate({ | |
opacity: 0.4 | |
}, 1000, "linear", function() { | |
$("img#tardisimg").animate({ | |
opacity: 0.2 | |
}, 1000, "linear", function() { | |
$("img#tardisimg").animate({ | |
opacity: 0.6 | |
}, 1000, "linear", function() { | |
$("img#tardisimg").animate({ | |
opacity: 0.4 | |
}, 750, "linear", function() { | |
$("img#tardisimg").animate({ | |
opacity: 0.8 | |
}, 750, "linear", function() { | |
$("img#tardisimg").animate({ | |
opacity: 0.6 | |
}, 750, "linear", function() { | |
tardis.volume = 0.75; | |
$("img#tardisimg").animate({ | |
opacity: 0.8 | |
}, 500, "linear", function() { | |
tardis.volume = 0.6; | |
$("img#tardisimg").animate({ | |
opacity: 1.0 | |
}, 1500, "linear", function() { | |
// All done Tardising! | |
tardis.volume = 0.4; | |
setTimeout(function() { | |
tardis.volume = 0.2; | |
setTimeout(function() { | |
tardis.volume = 0.1; | |
tardis.pause(); // Stop sound | |
}, 500); | |
}, 1000); | |
}); | |
}); | |
}); | |
}); | |
}); | |
}); | |
}); | |
}); | |
}, 1000); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment