mirror of
https://github.com/schlagmichdoch/PairDrop.git
synced 2025-04-22 07:46:17 -04:00
Speed up canvas by removing fade-in animation
This commit is contained in:
parent
8a17b82fa4
commit
df778ba42c
6 changed files with 22 additions and 24 deletions
|
@ -303,6 +303,7 @@
|
||||||
</section>
|
</section>
|
||||||
<x-background></x-background>
|
<x-background></x-background>
|
||||||
</x-about>
|
</x-about>
|
||||||
|
<canvas class="circles"></canvas>
|
||||||
<!-- SVG Icon Library -->
|
<!-- SVG Icon Library -->
|
||||||
<svg style="display: none;">
|
<svg style="display: none;">
|
||||||
<symbol id=wifi-tethering viewBox="0 0 24 24">
|
<symbol id=wifi-tethering viewBox="0 0 24 24">
|
||||||
|
|
|
@ -2249,14 +2249,7 @@ window.addEventListener('beforeinstallprompt', e => {
|
||||||
|
|
||||||
// Background Circles
|
// Background Circles
|
||||||
Events.on('load', () => {
|
Events.on('load', () => {
|
||||||
let c = document.createElement('canvas');
|
let c = $$('canvas');
|
||||||
let style = c.style;
|
|
||||||
style.width = '100%';
|
|
||||||
style.position = 'absolute';
|
|
||||||
style.zIndex = -1;
|
|
||||||
style.top = 0;
|
|
||||||
style.left = 0;
|
|
||||||
style.animation = "fade-in 800ms";
|
|
||||||
let cCtx = c.getContext('2d');
|
let cCtx = c.getContext('2d');
|
||||||
let x0, y0, w, h, dw, offset;
|
let x0, y0, w, h, dw, offset;
|
||||||
|
|
||||||
|
@ -2277,11 +2270,7 @@ Events.on('load', () => {
|
||||||
y0 = h - offset;
|
y0 = h - offset;
|
||||||
dw = Math.round(Math.max(w, h, 1000) / 13);
|
dw = Math.round(Math.max(w, h, 1000) / 13);
|
||||||
|
|
||||||
if (document.body.contains(c)) {
|
|
||||||
document.body.removeChild(c);
|
|
||||||
}
|
|
||||||
drawCircles(cCtx, dw);
|
drawCircles(cCtx, dw);
|
||||||
document.body.appendChild(c);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Events.on('bg-resize', _ => init());
|
Events.on('bg-resize', _ => init());
|
||||||
|
@ -2297,6 +2286,7 @@ Events.on('load', () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
function drawCircles(ctx, frame) {
|
function drawCircles(ctx, frame) {
|
||||||
|
ctx.clearRect(0, 0, w, h);
|
||||||
for (let i = 0; i < 13; i++) {
|
for (let i = 0; i < 13; i++) {
|
||||||
drawCircle(ctx, dw * i + frame + 33);
|
drawCircle(ctx, dw * i + frame + 33);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1178,6 +1178,14 @@ button::-moz-focus-inner {
|
||||||
align-self: end;
|
align-self: end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
canvas .circles {
|
||||||
|
width: 100vw;
|
||||||
|
position: absolute;
|
||||||
|
z-index: -10;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* Loading Indicator */
|
/* Loading Indicator */
|
||||||
|
|
||||||
.progress {
|
.progress {
|
||||||
|
|
|
@ -306,6 +306,7 @@
|
||||||
</section>
|
</section>
|
||||||
<x-background></x-background>
|
<x-background></x-background>
|
||||||
</x-about>
|
</x-about>
|
||||||
|
<canvas class="circles"></canvas>
|
||||||
<!-- SVG Icon Library -->
|
<!-- SVG Icon Library -->
|
||||||
<svg style="display: none;">
|
<svg style="display: none;">
|
||||||
<symbol id=wifi-tethering viewBox="0 0 24 24">
|
<symbol id=wifi-tethering viewBox="0 0 24 24">
|
||||||
|
|
|
@ -2250,14 +2250,7 @@ window.addEventListener('beforeinstallprompt', e => {
|
||||||
|
|
||||||
// Background Circles
|
// Background Circles
|
||||||
Events.on('load', () => {
|
Events.on('load', () => {
|
||||||
let c = document.createElement('canvas');
|
let c = $$('canvas');
|
||||||
let style = c.style;
|
|
||||||
style.width = '100%';
|
|
||||||
style.position = 'absolute';
|
|
||||||
style.zIndex = -1;
|
|
||||||
style.top = 0;
|
|
||||||
style.left = 0;
|
|
||||||
style.animation = "fade-in 800ms";
|
|
||||||
let cCtx = c.getContext('2d');
|
let cCtx = c.getContext('2d');
|
||||||
let x0, y0, w, h, dw, offset;
|
let x0, y0, w, h, dw, offset;
|
||||||
|
|
||||||
|
@ -2277,11 +2270,7 @@ Events.on('load', () => {
|
||||||
y0 = h - offset;
|
y0 = h - offset;
|
||||||
dw = Math.round(Math.max(w, h, 1000) / 13);
|
dw = Math.round(Math.max(w, h, 1000) / 13);
|
||||||
|
|
||||||
if (document.body.contains(c)) {
|
|
||||||
document.body.removeChild(c);
|
|
||||||
}
|
|
||||||
drawCircles(cCtx, dw);
|
drawCircles(cCtx, dw);
|
||||||
document.body.appendChild(c);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Events.on('bg-resize', _ => init());
|
Events.on('bg-resize', _ => init());
|
||||||
|
@ -2297,6 +2286,7 @@ Events.on('load', () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
function drawCircles(ctx, frame) {
|
function drawCircles(ctx, frame) {
|
||||||
|
ctx.clearRect(0, 0, w, h);
|
||||||
for (let i = 0; i < 13; i++) {
|
for (let i = 0; i < 13; i++) {
|
||||||
drawCircle(ctx, dw * i + frame + 33);
|
drawCircle(ctx, dw * i + frame + 33);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1204,6 +1204,14 @@ button::-moz-focus-inner {
|
||||||
align-self: end;
|
align-self: end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
canvas .circles {
|
||||||
|
width: 100vw;
|
||||||
|
position: absolute;
|
||||||
|
z-index: -10;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* Loading Indicator */
|
/* Loading Indicator */
|
||||||
|
|
||||||
.progress {
|
.progress {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue