Browse Source

Fix video flashing when quitting out of loading screen

Thomas Dy 4 years ago
parent
commit
aacfb090fc
2 changed files with 7 additions and 1 deletions
  1. 4 0
      dist/style.css
  2. 3 1
      src/background.ts

+ 4 - 0
dist/style.css

@@ -36,6 +36,10 @@
 #background div.show {
   opacity: 1;
 }
+
+#background div.instant {
+  transition: none;
+}
 /* }}} */
 
 /* progress bar {{{ */

+ 3 - 1
src/background.ts

@@ -10,7 +10,7 @@ namespace background {
       this.element = element;
       this.last = null;
       this.video = document.createElement('div');
-      this.video.classList.add('show');
+      this.video.classList.add('instant');
       this.element.appendChild(this.video);
       this.next = document.createElement('div');
       this.element.appendChild(this.next);
@@ -24,6 +24,7 @@ namespace background {
     }
 
     showVideo() {
+      this.video.classList.add('show');
       this.last?.classList.remove('show');
     }
 
@@ -31,6 +32,7 @@ namespace background {
       if (this.last != null) {
         this.last.classList.add('show');
         this.last.addEventListener('transitionend', () => {
+          this.video.classList.remove('show');
           this.video.innerHTML = '';
         });
       }