diff --git a/frontend/src/app/feature/landing/landing.component.html b/frontend/src/app/feature/landing/landing.component.html index 2f38d9f..a7cb79e 100644 --- a/frontend/src/app/feature/landing/landing.component.html +++ b/frontend/src/app/feature/landing/landing.component.html @@ -21,13 +21,7 @@ (click)="showRegisterForm()" class="w-full sm:w-auto button-primary px-6 sm:px-8 py-3 shadow-lg" > - Konto erstellen - - } @@ -46,33 +40,63 @@

Slots

Klassische Spielautomaten

- Jetzt Spielen + @if (isLoggedIn()) { + + Jetzt Spielen + + } @else { + + }
@@ -82,22 +106,42 @@

Dice

Würfelspiel

- Jetzt Spielen + @if (isLoggedIn()) { + + Jetzt Spielen + + } @else { + + }
diff --git a/frontend/src/app/feature/landing/landing.component.ts b/frontend/src/app/feature/landing/landing.component.ts index d354fa4..93b9e84 100644 --- a/frontend/src/app/feature/landing/landing.component.ts +++ b/frontend/src/app/feature/landing/landing.component.ts @@ -23,15 +23,14 @@ import RecoverPasswordComponent from '../auth/recover-password/recover-password. }) export class LandingComponent implements OnInit, OnDestroy { currentSlide = 0; - private autoplayInterval: ReturnType | undefined; authService: AuthService = inject(AuthService); route: ActivatedRoute = inject(ActivatedRoute); showLogin = signal(false); showRegister = signal(false); showRecoverPassword = signal(false); + isLoggedIn = signal(this.authService.isLoggedIn()); ngOnInit() { - this.startAutoplay(); document.body.style.overflow = 'auto'; if (this.route.snapshot.queryParamMap.get('login') === 'true') { this.showLoginForm(); @@ -39,7 +38,6 @@ export class LandingComponent implements OnInit, OnDestroy { } ngOnDestroy() { - this.stopAutoplay(); document.body.style.overflow = 'auto'; } @@ -73,33 +71,13 @@ export class LandingComponent implements OnInit, OnDestroy { prevSlide() { this.currentSlide = this.currentSlide === 0 ? 1 : 0; - this.resetAutoplay(); } nextSlide() { this.currentSlide = this.currentSlide === 1 ? 0 : 1; - this.resetAutoplay(); } goToSlide(index: number) { this.currentSlide = index; - this.resetAutoplay(); - } - - private startAutoplay() { - this.autoplayInterval = setInterval(() => { - this.nextSlide(); - }, 5000); - } - - private stopAutoplay() { - if (this.autoplayInterval) { - clearInterval(this.autoplayInterval); - } - } - - private resetAutoplay() { - this.stopAutoplay(); - this.startAutoplay(); } } diff --git a/frontend/src/app/shared/components/navbar/navbar.component.html b/frontend/src/app/shared/components/navbar/navbar.component.html index e780e0f..608f3de 100644 --- a/frontend/src/app/shared/components/navbar/navbar.component.html +++ b/frontend/src/app/shared/components/navbar/navbar.component.html @@ -10,13 +10,23 @@ @@ -40,15 +50,7 @@ (click)="showRegister.emit()" class="flex items-center px-4 py-2 bg-emerald-600 text-white font-medium rounded-lg hover:bg-emerald-500 transition-colors duration-200" > - - - - Registrieren + Jetzt registrieren } diff --git a/frontend/src/styles.css b/frontend/src/styles.css index 43d7156..99d43ee 100644 --- a/frontend/src/styles.css +++ b/frontend/src/styles.css @@ -52,7 +52,7 @@ a { } .slider-grid { - @apply min-w-full grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4; + @apply min-w-full grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4; } .welcome-bonus {