X-Git-Url: http://git.bytex64.net/?a=blobdiff_plain;ds=sidebyside;f=www%2Fjs%2FBytex64.FX.js;fp=www%2Fjs%2FBytex64.FX.js;h=0000000000000000000000000000000000000000;hb=c8ad4bb20cb1e10d5ac906ce1928357d1e4b3180;hp=4f9902f780085ce99399425ba5e0a64075a6bb50;hpb=6d460ea60252c7bb6b567b06e4428e3e7986885e;p=blerg.git diff --git a/www/js/Bytex64.FX.js b/www/js/Bytex64.FX.js deleted file mode 100644 index 4f9902f..0000000 --- a/www/js/Bytex64.FX.js +++ /dev/null @@ -1,103 +0,0 @@ -if (typeof(Bytex64) == 'undefined') Bytex64 = {}; -Bytex64.FX = {}; -Bytex64.FX.version = 1.0; - -Bytex64.FX.Effect = function(fx, secs) { - this.fx = fx; - this.secs = secs; - - this.run = function() { - Bytex64.FX.run(this.fx, this.secs); - }; -}; - -Bytex64.FX.ParallelEffect = function(fxs, secs) { - this.fx = function(p) { - for (i in fxs) { - fxs[i](p); - } - }; - this.secs = secs; - - this.run = function() { - Bytex64.FX.run(this.fx, this.secs); - }; -}; - -Bytex64.FX.EffectChain = function(chain) { - this.chain = chain; - this.current = 0; - - this.fx_current = function(p) { - this.chain[this.current].fx(p); - }; - - this.run = function() { - _this = this; - - fx = function(p) { - _this.fx_current(p); - if (p == 1.0) - _this.run_next(); - }; - - Bytex64.FX.run(fx, this.chain[this.current].secs); - }; - - this.run_next = function() { - this.current++; - - if (this.current >= this.chain.length) { - this.current = 0; - return; - } - - this.run(); - }; - -}; - -Bytex64.FX.updateInterval = 50; - -Bytex64.FX.run = function(fx, secs) { - secs = secs * 1000; - - var interval; - var start = (new Date()).getTime(); - - fx(0.0); - - interval = setInterval(function() { - var d = (new Date()).getTime() - start; - if (d >= secs) { - clearInterval(interval); - fx(1.0); - } else { - fx(d/secs); - } - }, Bytex64.FX.updateInterval); -} - -Bytex64.FX.create = function(fx, secs) { - return function() { - Bytex64.FX.run(fx, secs); - } -} - -Bytex64.FX.fadeIn = function(elem) { - return function(p) { - if (p == 0.0) - elem.style.display = 'block'; - elem.style.opacity = p; - } -} - -Bytex64.FX.fadeOut = function(elem) { - return function(p) { - elem.style.opacity = 1.0 - p; - if (p == 1.0) - elem.style.display = 'none'; - } -} - -/* vim: set ts=4 sts=4 sw=4 expandtab: */