Skip to content

Commit b8a973f

Browse files
Fix background animation size on 4k screens and decrease base opacity
1 parent 8354926 commit b8a973f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

public/scripts/ui-main.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -346,10 +346,10 @@ class BackgroundCanvas {
346346
initAnimation() {
347347
this.baseColorNormal = '168 168 168';
348348
this.baseColorShareMode = '168 168 255';
349-
this.baseOpacityNormal = 0.4;
349+
this.baseOpacityNormal = 0.3;
350350
this.baseOpacityShareMode = 0.8;
351351
this.speed = 0.5;
352-
this.fps = 40;
352+
this.fps = 60;
353353

354354
// if browser supports OffscreenCanvas
355355
// -> put canvas drawing into serviceworker to unblock main thread
@@ -427,7 +427,7 @@ class BackgroundCanvas {
427427
c.height = h;
428428
x0 = w / 2;
429429
y0 = h - offset;
430-
dw = Math.round(Math.min(Math.max(w, h), 800) / 10);
430+
dw = Math.round(Math.min(Math.max(0.6 * w, h)) / 10);
431431

432432
drawFrame(currentFrame);
433433
}

public/scripts/worker/canvas-worker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ function initCanvas(footerOffsetHeight, clientWidth, clientHeight) {
6262
c.height = h;
6363
x0 = w / 2;
6464
y0 = h - offset;
65-
dw = Math.round(Math.min(Math.max(w, h), 800) / 10);
65+
dw = Math.round(Math.min(Math.max(0.6 * w, h)) / 10);
6666

6767
drawFrame(currentFrame);
6868
}

0 commit comments

Comments
 (0)