mirror of
https://github.com/Qortal/qortal.git
synced 2025-07-27 04:01:24 +00:00
Added support for dark theme in loading screen.
This commit is contained in:
@@ -128,6 +128,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
<canvas id="c"></canvas>
|
||||
<!-- partial -->
|
||||
<script>
|
||||
var theme = "%%THEME%%";
|
||||
|
||||
var w = c.width = window.innerWidth,
|
||||
h = c.height = window.innerHeight,
|
||||
ctx = c.getContext( '2d' ),
|
||||
@@ -165,7 +167,12 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
|
||||
baseRad = Math.PI * 2 / 6;
|
||||
|
||||
ctx.fillStyle = 'white';
|
||||
if (theme === "dark") {
|
||||
ctx.fillStyle = 'black';
|
||||
}
|
||||
else {
|
||||
ctx.fillStyle = 'white';
|
||||
}
|
||||
ctx.fillRect( 0, 0, w, h );
|
||||
|
||||
function loop() {
|
||||
@@ -176,9 +183,17 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
|
||||
ctx.globalCompositeOperation = 'source-over';
|
||||
ctx.shadowBlur = 0;
|
||||
ctx.fillStyle = 'rgba(230,230,230,alp)'.replace( 'alp', opts.repaintAlpha );
|
||||
ctx.fillRect( 0, 0, w, h );
|
||||
ctx.globalCompositeOperation = 'darker';
|
||||
|
||||
if (theme === "dark") {
|
||||
ctx.fillStyle = 'rgba(0,0,0,alp)'.replace('alp', opts.repaintAlpha);
|
||||
ctx.fillRect( 0, 0, w, h );
|
||||
ctx.globalCompositeOperation = 'lighter';
|
||||
}
|
||||
else {
|
||||
ctx.fillStyle = 'rgba(230,230,230,alp)'.replace('alp', opts.repaintAlpha);
|
||||
ctx.fillRect( 0, 0, w, h );
|
||||
ctx.globalCompositeOperation = 'darker';
|
||||
}
|
||||
|
||||
if( lines.length < opts.count && Math.random() < opts.spawnChance )
|
||||
lines.push( new Line );
|
||||
|
Reference in New Issue
Block a user