From e3c9fa2165d2f08bb7518df464488fe0f798f7b4 Mon Sep 17 00:00:00 2001 From: Teriuihi Date: Thu, 3 Apr 2025 21:37:48 +0200 Subject: [PATCH] Refactor homepage and header components. Moved header content logic based on `current_page` input for reusability. Updated styling and layout structure to improve maintainability and accommodate dynamic titles and subtitles. --- frontend/src/app/header/header.component.html | 272 ++++++++++-------- frontend/src/app/header/header.component.scss | 5 + frontend/src/app/header/header.component.ts | 3 + frontend/src/app/home/home.component.html | 14 +- 4 files changed, 157 insertions(+), 137 deletions(-) diff --git a/frontend/src/app/header/header.component.html b/frontend/src/app/header/header.component.html index efe4d86..4a92abb 100644 --- a/frontend/src/app/header/header.component.html +++ b/frontend/src/app/header/header.component.html @@ -1,134 +1,158 @@ - + + + +
+

{{ title }}

+ The Altitude Minecraft Server +

Altitude now on {{ ALTITUDE_VERSION }}!

+
+ + +

Scroll Down

+
+
+ +
+

{{ title }}

+

{{ sub_title }}

+
+
+
diff --git a/frontend/src/app/header/header.component.scss b/frontend/src/app/header/header.component.scss index 3c14197..e653188 100644 --- a/frontend/src/app/header/header.component.scss +++ b/frontend/src/app/header/header.component.scss @@ -417,3 +417,8 @@ input:checked + .slider:before { display: none; } } + +header { + background-size: cover; + background: url("/public/img/backgrounds/120spawn-min.png") no-repeat fixed center 0; +} diff --git a/frontend/src/app/header/header.component.ts b/frontend/src/app/header/header.component.ts index 5265361..c9ec477 100644 --- a/frontend/src/app/header/header.component.ts +++ b/frontend/src/app/header/header.component.ts @@ -1,4 +1,5 @@ import {Component, Input, OnInit} from '@angular/core'; +import {ALTITUDE_VERSION} from '../constant'; @Component({ standalone: false, @@ -8,6 +9,7 @@ import {Component, Input, OnInit} from '@angular/core'; }) export class HeaderComponent implements OnInit { @Input() title: string = ''; + @Input() sub_title: string = ''; @Input() current_page: string = '' public ngOnInit(): void { @@ -35,4 +37,5 @@ export class HeaderComponent implements OnInit { } } + protected readonly ALTITUDE_VERSION = ALTITUDE_VERSION; } diff --git a/frontend/src/app/home/home.component.html b/frontend/src/app/home/home.component.html index 0f9a190..78067f5 100644 --- a/frontend/src/app/home/home.component.html +++ b/frontend/src/app/home/home.component.html @@ -1,17 +1,5 @@ -
- -
-

Altitude Minecraft Server

- The Altitude Minecraft Server -

Altitude now on {{ALTITUDE_VERSION}}!

-
- - -

Scroll Down

-
-
+