style(navigation): implement new navigation-bar
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { Component, ElementRef, HostListener, ViewChild } from '@angular/core';
|
||||
import { ThemeSwitchService } from '../../service/theme-switch.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-background',
|
||||
@@ -8,6 +9,10 @@ import { Component, ElementRef, HostListener, ViewChild } from '@angular/core';
|
||||
})
|
||||
export class Background {
|
||||
|
||||
constructor(
|
||||
private themeSwitchService: ThemeSwitchService,
|
||||
) {}
|
||||
|
||||
@ViewChild('canvas', { static: true }) canvasRef!: ElementRef<HTMLCanvasElement>;
|
||||
|
||||
// Config
|
||||
@@ -90,7 +95,9 @@ export class Background {
|
||||
// Stern zeichnen mit Scroll-Parallax
|
||||
ctx.beginPath();
|
||||
ctx.arc(star.x, star.y - this.scrollY * this.parallaxFactor, star.radius, 0, Math.PI * 2);
|
||||
ctx.fillStyle = `rgba(255, 215, 0, ${star.alpha})`; // gold
|
||||
ctx.fillStyle = this.themeSwitchService.darkMode()
|
||||
? `rgba(255, 215, 0, ${star.alpha})`
|
||||
: `rgba(184, 134, 11, ${star.alpha})`;
|
||||
ctx.fill();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user