Skip to content

Instantly share code, notes, and snippets.

@joeymarburger
Created April 27, 2013 13:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joeymarburger/5473059 to your computer and use it in GitHub Desktop.
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.
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