aboutsummaryrefslogtreecommitdiff
path: root/frontend/src/app/_elements
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/src/app/_elements')
-rw-r--r--frontend/src/app/_elements/reactive-background/reactive-background.component.ts6
1 files changed, 4 insertions, 2 deletions
diff --git a/frontend/src/app/_elements/reactive-background/reactive-background.component.ts b/frontend/src/app/_elements/reactive-background/reactive-background.component.ts
index 9d7f5522..73cdb326 100644
--- a/frontend/src/app/_elements/reactive-background/reactive-background.component.ts
+++ b/frontend/src/app/_elements/reactive-background/reactive-background.component.ts
@@ -22,6 +22,8 @@ export class ReactiveBackgroundComponent implements AfterViewInit {
@Input() pointColor: string = '#ffffff';
@Input() cursorLineColor: string = '#ff0000';
+ private fleeSpeed = 0.005;
+
private points: Point[] = [];
private width = 200;
@@ -160,8 +162,8 @@ export class ReactiveBackgroundComponent implements AfterViewInit {
const distToCursor = this.distance(p.x, p.y, mx, my);
if (distToCursor < this.cursorDistance) {
- p.x -= ((mx - p.x) / distToCursor) / 500;
- p.y -= ((my - p.y) / distToCursor) / 500;
+ p.x -= ((mx - p.x) / distToCursor) * this.fleeSpeed;
+ p.y -= ((my - p.y) / distToCursor) * this.fleeSpeed;
const grd = this.ctx.createLinearGradient(p.x * this.width, p.y * this.height, mx * this.width, my * this.height);
const alpha = HEX[Math.round(p.size / this.maxSize * (HEX.length - 1))];