diff options
author | Chris Xiong <chirs241097@gmail.com> | 2020-08-04 19:03:55 +0800 |
---|---|---|
committer | Chris Xiong <chirs241097@gmail.com> | 2020-08-04 19:03:55 +0800 |
commit | 6a765f3e8509fb62c9c6d381b57b5964b461f4b8 (patch) | |
tree | 04a0647bbd4d2c29bfc1d9c97628fb6e6c16d6aa /libs/music/player.d | |
parent | 24f3ab15a9c0b3a95d63390561d9e8efea05fc06 (diff) | |
download | web-6a765f3e8509fb62c9c6d381b57b5964b461f4b8.tar.xz |
Show some love to our photophobic users.
(Always use dark theme if the user indicates their preference.)
Blog posts will be updated later.
Diffstat (limited to 'libs/music/player.d')
-rw-r--r-- | libs/music/player.d/main_static.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libs/music/player.d/main_static.js b/libs/music/player.d/main_static.js index fe30cca..51f7243 100644 --- a/libs/music/player.d/main_static.js +++ b/libs/music/player.d/main_static.js @@ -547,7 +547,7 @@ NSVisualization={ NSAudio.anlznode.getByteTimeDomainData(timedomv); cctx.lineWidth=window.devicePixelRatio; cctx.strokeStyle='#000'; - if(athm)cctx.strokeStyle='#FFF'; + if(isDarkTheme)cctx.strokeStyle='#FFF'; cctx.beginPath(); for(let i=0,x=0;i<this.nbins;++i) { @@ -572,7 +572,7 @@ NSVisualization={ cctx.clearRect(this.spectgrmp/this.spectgrmw*canvas.width,0,canvas.width/this.spectgrmw,canvas.height); for(let i=0;i<this.nbins;++i) { - let color=(athm?'rgba(255,255,255,':'rgba(0,0,0,')+freqdomv[i]/256.+')'; + let color=(isDarkTheme?'rgba(255,255,255,':'rgba(0,0,0,')+freqdomv[i]/256.+')'; cctx.fillStyle=color; cctx.fillRect(this.spectgrmp/this.spectgrmw*canvas.width,(this.nbins-i)/this.nbins*canvas.height,canvas.width/this.spectgrmw,canvas.height/this.nbins); } @@ -693,6 +693,7 @@ NSInk={ function init() { if(!window.devicePixelRatio)window.devicePixelRatio=1; + loadTheme(); NSUI.setup_ui(); NSUI.load_playlists() .then(()=>{ |