diff options
author | pacien | 2018-07-19 21:48:13 +0200 |
---|---|---|
committer | pacien | 2018-07-19 21:54:21 +0200 |
commit | f169ac0401e896f5865111b139298a9abfa31a3a (patch) | |
tree | da2c2bcae4c7771582d9602d78d13530471f1740 /pointless | |
parent | 5b4f6d7a26f55407bd4d12b1641ff1484b65df1c (diff) | |
download | beamer-viewer-f169ac0401e896f5865111b139298a9abfa31a3a.tar.gz |
Mitigate flashing screen with fading
Diffstat (limited to 'pointless')
-rw-r--r-- | pointless/viewer/screen.js | 11 | ||||
-rw-r--r-- | pointless/viewer/viewer.css | 4 |
2 files changed, 14 insertions, 1 deletions
diff --git a/pointless/viewer/screen.js b/pointless/viewer/screen.js index 28f4f55..42ea781 100644 --- a/pointless/viewer/screen.js +++ b/pointless/viewer/screen.js | |||
@@ -29,7 +29,7 @@ class Screen { | |||
29 | this.timer.start(); | 29 | this.timer.start(); |
30 | 30 | ||
31 | this.page = page; | 31 | this.page = page; |
32 | this._refreshPage(); | 32 | this._changePage(); |
33 | this.pageTurnCount++; | 33 | this.pageTurnCount++; |
34 | } | 34 | } |
35 | 35 | ||
@@ -69,6 +69,15 @@ class Screen { | |||
69 | }); | 69 | }); |
70 | } | 70 | } |
71 | 71 | ||
72 | _changePage() { | ||
73 | this.canvas.style.opacity = 0; | ||
74 | var self = this; | ||
75 | setTimeout(function() { | ||
76 | self._refreshPage(); | ||
77 | self.canvas.style.opacity = 1; | ||
78 | }, 300); | ||
79 | } | ||
80 | |||
72 | _refreshPage() { | 81 | _refreshPage() { |
73 | if (this.page == null) return; | 82 | if (this.page == null) return; |
74 | var viewport = this.page.getViewport(1); | 83 | var viewport = this.page.getViewport(1); |
diff --git a/pointless/viewer/viewer.css b/pointless/viewer/viewer.css index d5b766b..8ec608f 100644 --- a/pointless/viewer/viewer.css +++ b/pointless/viewer/viewer.css | |||
@@ -91,3 +91,7 @@ header span { | |||
91 | .notification:empty { | 91 | .notification:empty { |
92 | display: none; | 92 | display: none; |
93 | } | 93 | } |
94 | |||
95 | #screen { | ||
96 | transition: opacity 300ms; | ||
97 | } | ||