]> git.sesse.net Git - ultimatescore/commitdiff
Add code for fading out a table.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Fri, 20 Oct 2017 18:28:00 +0000 (20:28 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Fri, 20 Oct 2017 18:28:00 +0000 (20:28 +0200)
carousel.js
score.css

index 42639952243dd138936814744ad25e3d2c5ca5bf..e9c2ed8eec37739b7180708e5b966a8ede653517 100644 (file)
@@ -341,6 +341,7 @@ var display_group = function(response, group_name) {
        carousel.appendChild(footer_tr);
 
        fade_in_rows(carousel);
+       setTimeout(function() { fade_out_rows(carousel); }, 4000);
 
        carousel.style.display = 'table';
 };
@@ -357,6 +358,18 @@ var fade_in_rows = function(table)
        }
 };
 
+var fade_out_rows = function(table)
+{
+       var trs = table.getElementsByTagName("tr");
+       for (var i = 0; i < trs.length; ++i) {
+               if (trs[i].className === "footer") {
+                       trs[i].style = "-webkit-animation: fade-out 1.0s ease; -webkit-animation-delay: " + (0.125 * i) + "s; -webkit-animation-fill-mode: both;";
+               } else {
+                       trs[i].style = "-webkit-animation: fade-out 1.0s ease; -webkit-animation-delay: " + (0.125 * i) + "s; -webkit-animation-fill-mode: both;";
+               }
+       }
+};
+
 // Stream schedule
 var display_stream_schedule = function(response, group_name) {
        var teams = parse_teams_from_spreadsheet(response);
index 14551173b2a4c1d90589eeea51ee6836d6b43ec6..60febc42ce20df8975fb27f2d0e817a229fc9d98 100644 (file)
--- a/score.css
+++ b/score.css
@@ -398,9 +398,17 @@ body {
 }
 @-webkit-keyframes fade-in {
   0% {
-    opacity: 0.0001;
+    opacity: 0;
   }
   100% {
     opacity: 1;
   }
 }
+@-webkit-keyframes fade-out {
+  0% {
+    opacity: 1;
+  }
+  100% {
+    opacity: 0;
+  }
+}