Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.