Spiel Informationen
diff --git a/frontend/src/app/feature/landing/landing.component.html b/frontend/src/app/feature/landing/landing.component.html
index aa411fd..9a6203d 100644
--- a/frontend/src/app/feature/landing/landing.component.html
+++ b/frontend/src/app/feature/landing/landing.component.html
@@ -1,4 +1,4 @@
-
+
@@ -120,8 +120,8 @@
xmlns="http://www.w3.org/2000/svg"
class="h-6 w-6"
fill="none"
- viewBox="0 0 24 24"
stroke="currentColor"
+ viewBox="0 0 24 24"
>
+
+ @if (showLogin() || showRegister()) {
+
+
+
+ @if (showLogin()) {
+
+ }
+ @if (showRegister()) {
+
+ }
+
+
+ }
diff --git a/frontend/src/app/feature/landing/landing.component.ts b/frontend/src/app/feature/landing/landing.component.ts
index 9e66baf..d4d6078 100644
--- a/frontend/src/app/feature/landing/landing.component.ts
+++ b/frontend/src/app/feature/landing/landing.component.ts
@@ -1,12 +1,21 @@
-import { ChangeDetectionStrategy, Component, inject, OnDestroy, OnInit } from '@angular/core';
+import {
+ ChangeDetectionStrategy,
+ Component,
+ inject,
+ OnDestroy,
+ OnInit,
+ signal,
+} from '@angular/core';
import { NgFor } from '@angular/common';
import { RouterLink } from '@angular/router';
import { AuthService } from '@service/auth.service';
+import { LoginComponent } from '../auth/login/login.component';
+import { RegisterComponent } from '../auth/register/register.component';
@Component({
selector: 'app-landing-page',
standalone: true,
- imports: [NgFor, RouterLink],
+ imports: [NgFor, RouterLink, LoginComponent, RegisterComponent],
templateUrl: './landing.component.html',
changeDetection: ChangeDetectionStrategy.OnPush,
})
@@ -14,13 +23,35 @@ export class LandingComponent implements OnInit, OnDestroy {
currentSlide = 0;
private autoplayInterval: ReturnType
| undefined;
authService: AuthService = inject(AuthService);
+ showLogin = signal(false);
+ showRegister = signal(false);
ngOnInit() {
this.startAutoplay();
+ document.body.style.overflow = 'auto';
}
ngOnDestroy() {
this.stopAutoplay();
+ document.body.style.overflow = 'auto';
+ }
+
+ showLoginForm() {
+ this.showLogin.set(true);
+ this.showRegister.set(false);
+ document.body.style.overflow = 'hidden';
+ }
+
+ showRegisterForm() {
+ this.showRegister.set(true);
+ this.showLogin.set(false);
+ document.body.style.overflow = 'hidden';
+ }
+
+ hideAuthForms() {
+ this.showLogin.set(false);
+ this.showRegister.set(false);
+ document.body.style.overflow = 'auto';
}
prevSlide() {
diff --git a/frontend/src/app/shared/components/navbar/navbar.component.html b/frontend/src/app/shared/components/navbar/navbar.component.html
index 749437f..7e010fa 100644
--- a/frontend/src/app/shared/components/navbar/navbar.component.html
+++ b/frontend/src/app/shared/components/navbar/navbar.component.html
@@ -12,12 +12,13 @@
@if (!isLoggedIn()) {
-
Anmelden
-
Anmelden
+
+ Registrieren
+
}
@if (isLoggedIn()) {
Spiele
@if (!isLoggedIn()) {
-
Anmelden
-
+
+ Registrieren
+
}
@if (isLoggedIn()) {
diff --git a/frontend/src/app/shared/components/navbar/navbar.component.ts b/frontend/src/app/shared/components/navbar/navbar.component.ts
index 8f646f5..7b8bb63 100644
--- a/frontend/src/app/shared/components/navbar/navbar.component.ts
+++ b/frontend/src/app/shared/components/navbar/navbar.component.ts
@@ -1,9 +1,11 @@
import {
ChangeDetectionStrategy,
Component,
+ EventEmitter,
inject,
OnDestroy,
OnInit,
+ Output,
signal,
} from '@angular/core';
import { RouterModule } from '@angular/router';
@@ -26,6 +28,9 @@ export class NavbarComponent implements OnInit, OnDestroy {
private authSubscription!: Subscription;
public balance = signal(0);
+ @Output() showLogin = new EventEmitter
();
+ @Output() showRegister = new EventEmitter();
+
ngOnInit() {
this.authSubscription = this.authService.userSubject.subscribe({
next: (user) => {