]> git.wh0rd.org Git - tt-rss.git/commitdiff
piggie-fade
authorAndrew Dolgov <fox@bah.spb.su>
Sat, 25 Feb 2006 12:43:30 +0000 (13:43 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Sat, 25 Feb 2006 12:43:30 +0000 (13:43 +0100)
prefs.js

index 67eb3def06731a000fae261f41f4c0c4fa36fa86..721b70b897e81966fa6295e4b1880512a8e218c1 100644 (file)
--- a/prefs.js
+++ b/prefs.js
@@ -1164,11 +1164,38 @@ function piggie_callback() {
        }
 }
 
+var piggie_opacity = 0;
+
+function piggie2_callback() {
+       var piggie = document.getElementById("piggie");
+       piggie.style.top = 0;
+       piggie.style.opacity = piggie_opacity;
+
+       if (piggie_fwd && piggie_opacity < 1) {
+               setTimeout("piggie2_callback()", 50);
+               piggie_opacity = piggie_opacity + 0.03;
+       } else if (piggie_fwd && piggie_opacity >= 1) {
+               piggie_fwd = false;
+               setTimeout("piggie2_callback()", 50);
+       } else if (!piggie_fwd && piggie_opacity > 0) {
+               setTimeout("piggie2_callback()", 50);
+               piggie_opacity = piggie_opacity - 0.03;
+       } else if (!piggie_fwd && piggie_opacity <= 0) {
+               piggie.style.display = "none";
+               piggie_fwd = true;
+       }
+}
+
 function localPiggieFunction(enable) {
        if (enable) {
                var piggie = document.getElementById("piggie");
                piggie.style.display = "block";
-               piggie_callback();
+
+               if (navigator.userAgent.match("Firefox") && Math.random(1) > 0.5) {     
+                       piggie2_callback();
+               } else {
+                       piggie_callback();
+               }
        }
 }