Merge pull request 'feat: adjust landing page styles' (!290) from restyle-landing-page into main
Some checks failed
Build docs / build-docs (push) Failing after 16s
Release / Release (push) Successful in 1m18s
Release / Build Backend Image (push) Successful in 31s
Release / Build Frontend Image (push) Successful in 35s

Reviewed-on: #290
Reviewed-by: Jan K9f <jan@kjan.email>
This commit is contained in:
Phan Huy Tran 2025-06-04 12:41:31 +00:00
commit a296ae147b
No known key found for this signature in database
GPG key ID: 944223E4D46B7412
4 changed files with 96 additions and 72 deletions

View file

@ -21,13 +21,7 @@
(click)="showRegisterForm()" (click)="showRegisterForm()"
class="w-full sm:w-auto button-primary px-6 sm:px-8 py-3 shadow-lg" class="w-full sm:w-auto button-primary px-6 sm:px-8 py-3 shadow-lg"
> >
Konto erstellen Jetzt registrieren
</button>
<button
(click)="showLoginForm()"
class="w-full sm:w-auto bg-slate-700 text-white hover:bg-slate-600 px-6 sm:px-8 py-3 shadow-lg rounded"
>
Anmelden
</button> </button>
} }
</div> </div>
@ -46,33 +40,63 @@
<div class="game-card-content"> <div class="game-card-content">
<h3 class="game-heading-sm">Slots</h3> <h3 class="game-heading-sm">Slots</h3>
<p class="game-text">Klassische Spielautomaten</p> <p class="game-text">Klassische Spielautomaten</p>
@if (isLoggedIn()) {
<a <a
routerLink="game/slots" routerLink="game/slots"
class="button-primary w-full py-2 inline-block text-center" class="button-primary w-full py-2 inline-block text-center"
>Jetzt Spielen</a
> >
Jetzt Spielen
</a>
} @else {
<button
(click)="showLoginForm()"
class="button-primary w-full py-2 inline-block text-center"
>
Jetzt Spielen
</button>
}
</div> </div>
</div> </div>
<div class="hidden lg:block card"> <div class="hidden lg:block card">
<div class="game-card-content"> <div class="game-card-content">
<h3 class="game-heading-sm">Blackjack</h3> <h3 class="game-heading-sm">Blackjack</h3>
<p class="game-text">Klassisches Kartenspiel</p> <p class="game-text">Klassisches Kartenspiel</p>
@if (isLoggedIn()) {
<a <a
routerLink="game/blackjack" routerLink="game/blackjack"
class="button-primary w-full py-2 inline-block text-center" class="button-primary w-full py-2 inline-block text-center"
>Jetzt Spielen</a
> >
Jetzt Spielen
</a>
} @else {
<button
(click)="showLoginForm()"
class="button-primary w-full py-2 inline-block text-center"
>
Jetzt Spielen
</button>
}
</div> </div>
</div> </div>
<div class="hidden lg:block card"> <div class="hidden lg:block card">
<div class="game-card-content"> <div class="game-card-content">
<h3 class="game-heading-sm">Coinflip</h3> <h3 class="game-heading-sm">Coinflip</h3>
<p class="game-text">Münzwurf</p> <p class="game-text">Münzwurf</p>
@if (isLoggedIn()) {
<a <a
routerLink="game/blackjack" routerLink="game/coinflip"
class="button-primary w-full py-2 inline-block text-center" class="button-primary w-full py-2 inline-block text-center"
>Jetzt Spielen</a
> >
Jetzt Spielen
</a>
} @else {
<button
(click)="showLoginForm()"
class="button-primary w-full py-2 inline-block text-center"
>
Jetzt Spielen
</button>
}
</div> </div>
</div> </div>
</div> </div>
@ -82,22 +106,42 @@
<div class="game-card-content"> <div class="game-card-content">
<h3 class="game-heading-sm">Dice</h3> <h3 class="game-heading-sm">Dice</h3>
<p class="game-text">Würfelspiel</p> <p class="game-text">Würfelspiel</p>
@if (isLoggedIn()) {
<a <a
routerLink="/game/dice" routerLink="game/dice"
class="button-primary w-full py-2 inline-block text-center" class="button-primary w-full py-2 inline-block text-center"
>Jetzt Spielen</a
> >
Jetzt Spielen
</a>
} @else {
<button
(click)="showLoginForm()"
class="button-primary w-full py-2 inline-block text-center"
>
Jetzt Spielen
</button>
}
</div> </div>
</div> </div>
<div class="hidden lg:block card"> <div class="hidden lg:block card">
<div class="game-card-content"> <div class="game-card-content">
<h3 class="game-heading-sm">Lootboxen</h3> <h3 class="game-heading-sm">Lootboxen</h3>
<p class="game-text">Überraschungskisten</p> <p class="game-text">Überraschungskisten</p>
@if (isLoggedIn()) {
<a <a
routerLink="game/lootboxes" routerLink="game/lootboxes"
class="button-primary w-full py-2 inline-block text-center" class="button-primary w-full py-2 inline-block text-center"
>Jetzt Spielen</a
> >
Jetzt Spielen
</a>
} @else {
<button
(click)="showLoginForm()"
class="button-primary w-full py-2 inline-block text-center"
>
Jetzt Spielen
</button>
}
</div> </div>
</div> </div>
</div> </div>

View file

@ -23,15 +23,14 @@ import RecoverPasswordComponent from '../auth/recover-password/recover-password.
}) })
export class LandingComponent implements OnInit, OnDestroy { export class LandingComponent implements OnInit, OnDestroy {
currentSlide = 0; currentSlide = 0;
private autoplayInterval: ReturnType<typeof setInterval> | undefined;
authService: AuthService = inject(AuthService); authService: AuthService = inject(AuthService);
route: ActivatedRoute = inject(ActivatedRoute); route: ActivatedRoute = inject(ActivatedRoute);
showLogin = signal(false); showLogin = signal(false);
showRegister = signal(false); showRegister = signal(false);
showRecoverPassword = signal(false); showRecoverPassword = signal(false);
isLoggedIn = signal(this.authService.isLoggedIn());
ngOnInit() { ngOnInit() {
this.startAutoplay();
document.body.style.overflow = 'auto'; document.body.style.overflow = 'auto';
if (this.route.snapshot.queryParamMap.get('login') === 'true') { if (this.route.snapshot.queryParamMap.get('login') === 'true') {
this.showLoginForm(); this.showLoginForm();
@ -39,7 +38,6 @@ export class LandingComponent implements OnInit, OnDestroy {
} }
ngOnDestroy() { ngOnDestroy() {
this.stopAutoplay();
document.body.style.overflow = 'auto'; document.body.style.overflow = 'auto';
} }
@ -73,33 +71,13 @@ export class LandingComponent implements OnInit, OnDestroy {
prevSlide() { prevSlide() {
this.currentSlide = this.currentSlide === 0 ? 1 : 0; this.currentSlide = this.currentSlide === 0 ? 1 : 0;
this.resetAutoplay();
} }
nextSlide() { nextSlide() {
this.currentSlide = this.currentSlide === 1 ? 0 : 1; this.currentSlide = this.currentSlide === 1 ? 0 : 1;
this.resetAutoplay();
} }
goToSlide(index: number) { goToSlide(index: number) {
this.currentSlide = index; 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();
} }
} }

View file

@ -10,6 +10,7 @@
</a> </a>
<div class="hidden md:flex items-center space-x-1"> <div class="hidden md:flex items-center space-x-1">
@if (isLoggedIn()) {
<a <a
routerLink="/home" routerLink="/home"
class="flex items-center px-4 py-2 text-white/90 hover:text-white font-medium rounded-lg hover:bg-white/10 transition-colors duration-200" class="flex items-center px-4 py-2 text-white/90 hover:text-white font-medium rounded-lg hover:bg-white/10 transition-colors duration-200"
@ -17,6 +18,15 @@
<img class="mr-2 w-4 h-4" src="assets/games.svg" alt="gamess" /> <img class="mr-2 w-4 h-4" src="assets/games.svg" alt="gamess" />
Spiele Spiele
</a> </a>
} @else {
<button
(click)="showLogin.emit()"
class="flex items-center px-4 py-2 text-white/90 hover:text-white font-medium rounded-lg hover:bg-white/10 transition-colors duration-200"
>
<img class="mr-2 w-4 h-4" src="assets/games.svg" alt="gamess" />
Spiele
</button>
}
</div> </div>
</div> </div>
@ -40,15 +50,7 @@
(click)="showRegister.emit()" (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" 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"
> >
<svg class="w-4 h-4 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24"> Jetzt registrieren
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M18 9v3m0 0v3m0-3h3m-3 0h-3m-2-5a4 4 0 11-8 0 4 4 0 018 0zM3 20a6 6 0 0112 0v1H3v-1z"
/>
</svg>
Registrieren
</button> </button>
} }

View file

@ -52,7 +52,7 @@ a {
} }
.slider-grid { .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 { .welcome-bonus {