Adjust overlay_gradient to accept numeric transparency values.

Replaced the boolean `overlay_gradient` property with a numeric input to allow for more granular control over the overlay transparency. Updated both the map component and the header logic to handle this change dynamically.
This commit is contained in:
Teriuihi 2025-04-05 23:01:27 +02:00
parent a2f1a079cf
commit 18cc111b26
2 changed files with 3 additions and 3 deletions

View File

@ -10,7 +10,7 @@ export class HeaderComponent {
@Input() current_page: string = '';
@Input() background_image: string = '';
@Input() height: string = '';
@Input() overlay_gradient: boolean = false;
@Input() overlay_gradient: number = 0;
public active: string = '';
@ -26,7 +26,7 @@ export class HeaderComponent {
public getBackgroundImage() {
if (this.overlay_gradient) {
return `linear-gradient(rgba(0, 0, 0, 0.65), rgba(0, 0, 0, 0.65)), url(${this.background_image})`;
return `linear-gradient(rgba(0, 0, 0, ${this.overlay_gradient}), rgba(0, 0, 0, ${this.overlay_gradient})), url(${this.background_image})`;
} else {
return `url(${this.background_image})`;
}

View File

@ -1,7 +1,7 @@
<ng-container>
<app-header [current_page]="'map'"
[background_image]="'public/img/backgrounds/map.jpg'"
[overlay_gradient]="true">
[overlay_gradient]=0.65>
<div class="title" header-content>
<h1>Dynamic Server Maps</h1>
<h2>Which server would you like to see?</h2>