From 56fbc59007fe5064168af33c9770a0d378343b85 Mon Sep 17 00:00:00 2001 From: Danijel Anđelković Date: Sun, 17 Apr 2022 23:20:18 +0200 Subject: Promenio stil home strane. --- .../_elements/reactive-background/reactive-background.component.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'frontend/src/app/_elements/reactive-background') 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))]; -- cgit v1.2.3