feat: restyle navbar
Some checks failed
CI / Get Changed Files (pull_request) Successful in 17s
Label PRs based on size / Check PR size (pull_request) Successful in 17s
Pull Request Labeler / labeler (pull_request_target) Successful in 11s
CI / eslint (pull_request) Failing after 40s
CI / Backend Tests (pull_request) Has been skipped
CI / Checkstyle Main (pull_request) Has been skipped
CI / oxlint (pull_request) Failing after 30s
Claude PR Review / claude-code (pull_request) Successful in 1m18s
CI / Docker backend validation (pull_request) Has been skipped
CI / prettier (pull_request) Failing after 42s
CI / Docker frontend validation (pull_request) Successful in 1m13s
CI / test-build (pull_request) Successful in 1m30s
Some checks failed
CI / Get Changed Files (pull_request) Successful in 17s
Label PRs based on size / Check PR size (pull_request) Successful in 17s
Pull Request Labeler / labeler (pull_request_target) Successful in 11s
CI / eslint (pull_request) Failing after 40s
CI / Backend Tests (pull_request) Has been skipped
CI / Checkstyle Main (pull_request) Has been skipped
CI / oxlint (pull_request) Failing after 30s
Claude PR Review / claude-code (pull_request) Successful in 1m18s
CI / Docker backend validation (pull_request) Has been skipped
CI / prettier (pull_request) Failing after 42s
CI / Docker frontend validation (pull_request) Successful in 1m13s
CI / test-build (pull_request) Successful in 1m30s
This commit is contained in:
parent
ed099e0431
commit
ccfc74891c
3 changed files with 169 additions and 67 deletions
|
@ -1,34 +1,21 @@
|
||||||
import { ChangeDetectionStrategy, Component, inject, OnInit } from '@angular/core';
|
import {ChangeDetectionStrategy, Component, OnInit} from '@angular/core';
|
||||||
import { AsyncPipe, CurrencyPipe, DatePipe, NgFor } from '@angular/common';
|
import {NgFor} from '@angular/common';
|
||||||
import { DepositComponent } from '../deposit/deposit.component';
|
import {ActivatedRoute, Router} from '@angular/router';
|
||||||
import { ActivatedRoute, Router } from '@angular/router';
|
import {Game} from 'app/model/Game';
|
||||||
import { ConfirmationComponent } from '@shared/components/confirmation/confirmation.component';
|
|
||||||
import { Game } from 'app/model/Game';
|
|
||||||
import { Observable } from 'rxjs';
|
|
||||||
import { TransactionService } from '@service/transaction.service';
|
|
||||||
import format from 'ajv/dist/vocabularies/format';
|
import format from 'ajv/dist/vocabularies/format';
|
||||||
import { TransactionHistoryComponent } from '../transaction-history/transaction-history.component';
|
|
||||||
import { TransactionData } from '../../model/TransactionData';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-homepage',
|
selector: 'app-homepage',
|
||||||
standalone: true,
|
standalone: true,
|
||||||
imports: [
|
imports: [
|
||||||
CurrencyPipe,
|
|
||||||
NgFor,
|
NgFor,
|
||||||
DepositComponent,
|
|
||||||
ConfirmationComponent,
|
|
||||||
AsyncPipe,
|
|
||||||
DatePipe,
|
|
||||||
TransactionHistoryComponent,
|
|
||||||
],
|
],
|
||||||
templateUrl: './home.component.html',
|
templateUrl: './home.component.html',
|
||||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||||
})
|
})
|
||||||
export default class HomeComponent implements OnInit {
|
export default class HomeComponent implements OnInit {
|
||||||
isDepositModalOpen = false;
|
|
||||||
isDepositSuccessful = false;
|
isDepositSuccessful = false;
|
||||||
isTransactionModalOpen = false;
|
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
public route: ActivatedRoute,
|
public route: ActivatedRoute,
|
||||||
|
@ -78,35 +65,10 @@ export default class HomeComponent implements OnInit {
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
allGames: Game[] = [...this.featuredGames];
|
|
||||||
|
|
||||||
recentTransactionData: Observable<TransactionData> =
|
|
||||||
inject(TransactionService).getUsersTransactions(5);
|
|
||||||
|
|
||||||
openDepositModal() {
|
|
||||||
this.isDepositModalOpen = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
closeDepositModal() {
|
|
||||||
this.isDepositModalOpen = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
openDepositConfirmationModal() {
|
openDepositConfirmationModal() {
|
||||||
this.isDepositSuccessful = true;
|
this.isDepositSuccessful = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
openTransactionModal() {
|
|
||||||
this.isTransactionModalOpen = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
closeDepositConfirmationModal() {
|
|
||||||
this.isDepositSuccessful = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
closeTransactionModal() {
|
|
||||||
this.isTransactionModalOpen = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
navigateToGame(route: string) {
|
navigateToGame(route: string) {
|
||||||
this.router.navigate([route]);
|
this.router.navigate([route]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,40 +1,106 @@
|
||||||
<nav class="bg-deep-blue border-b border-deep-blue-contrast">
|
<nav class="bg-deep-blue-light border-b border-emerald-500/30 shadow-lg">
|
||||||
<div class="max-w-full mx-auto px-4">
|
<div class="max-w-full mx-auto px-6">
|
||||||
<div class="flex justify-between items-center h-14">
|
<div class="flex justify-between items-center h-16">
|
||||||
|
<!-- Logo and Brand -->
|
||||||
<div class="flex items-center space-x-6">
|
<div class="flex items-center space-x-6">
|
||||||
<a routerLink="/" class="nav-brand">
|
<a routerLink="/" class="flex items-center space-x-3 group">
|
||||||
<span>Trustworthy Casino</span>
|
<div class="flex flex-col">
|
||||||
|
<span class="text-xl font-bold text-white">
|
||||||
|
Trustworthy Casino
|
||||||
|
</span>
|
||||||
|
<span class="text-xs text-emerald-400 font-medium">Premium Gaming</span>
|
||||||
|
</div>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
|
<!-- Navigation Links -->
|
||||||
<div class="hidden md:flex items-center space-x-1">
|
<div class="hidden md:flex items-center space-x-1">
|
||||||
<a routerLink="/home" class="nav-link">Spiele</a>
|
<a 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">
|
||||||
|
<svg class="w-4 h-4 mr-2" fill="currentColor" viewBox="0 0 24 24">
|
||||||
|
<path d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"/>
|
||||||
|
</svg>
|
||||||
|
Spiele
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="hidden md:flex items-center space-x-4">
|
<!-- User Actions -->
|
||||||
|
<div class="hidden md:flex items-center space-x-2">
|
||||||
@if (!isLoggedIn()) {
|
@if (!isLoggedIn()) {
|
||||||
<button (click)="showLogin.emit()" class="button-primary px-4 py-1.5">Anmelden</button>
|
<button
|
||||||
|
(click)="showLogin.emit()"
|
||||||
|
class="flex items-center px-4 py-2 text-white font-medium border border-emerald-500 rounded-lg hover:bg-emerald-500/10 transition-colors duration-200"
|
||||||
|
>
|
||||||
|
<svg class="w-4 h-4 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 16l-4-4m0 0l4-4m-4 4h14m-5 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h7a3 3 0 013 3v1"/>
|
||||||
|
</svg>
|
||||||
|
Anmelden
|
||||||
|
</button>
|
||||||
<button
|
<button
|
||||||
(click)="showRegister.emit()"
|
(click)="showRegister.emit()"
|
||||||
class="bg-emerald-700 text-white hover:bg-emerald-600 px-4 py-1.5 rounded"
|
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">
|
||||||
|
<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
|
Registrieren
|
||||||
</button>
|
</button>
|
||||||
}
|
}
|
||||||
|
|
||||||
@if (isLoggedIn()) {
|
@if (isLoggedIn()) {
|
||||||
<div
|
<!-- Balance Display -->
|
||||||
class="text-white font-bold bg-deep-blue-contrast rounded-full px-4 py-2 text-sm hover:bg-deep-blue-contrast/80 hover:cursor-pointer hover:scale-105 transition-all active:scale-95 select-none duration-300"
|
<div class="flex items-center px-4 py-2 bg-slate-700 border border-emerald-500/30 rounded-lg font-medium">
|
||||||
routerLink="/home"
|
<span class="text-emerald-400 text-sm mr-2">Guthaben:</span>
|
||||||
>
|
<span [class]="balance() < 0 ? 'text-red-400 font-bold' : 'text-white font-bold'" class="text-sm">
|
||||||
<span [class]="balance() < 0 ? 'text-accent-red' : ''">
|
|
||||||
<app-animated-number [value]="balance()" [duration]="0.5"></app-animated-number>
|
<app-animated-number [value]="balance()" [duration]="0.5"></app-animated-number>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<button (click)="logout()" class="button-primary px-4 py-1.5">Abmelden</button>
|
|
||||||
|
<!-- Action Buttons -->
|
||||||
|
<button
|
||||||
|
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"
|
||||||
|
(click)="openDepositModal()"
|
||||||
|
>
|
||||||
|
<svg class="w-4 h-4 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6v6m0 0v6m0-6h6m-6 0H6"/>
|
||||||
|
</svg>
|
||||||
|
Einzahlen
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<app-deposit
|
||||||
|
[isOpen]="isDepositModalOpen"
|
||||||
|
(closeModalEmitter)="closeDepositModal()"
|
||||||
|
></app-deposit>
|
||||||
|
|
||||||
|
<button
|
||||||
|
class="flex items-center px-4 py-2 bg-slate-700 text-white font-medium rounded-lg hover:bg-slate-600 border border-slate-600 transition-colors duration-200"
|
||||||
|
(click)="openTransactionModal()"
|
||||||
|
>
|
||||||
|
Transaktionen
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<app-transaction-history
|
||||||
|
[isOpen]="isTransactionModalOpen"
|
||||||
|
(closeEventEmitter)="closeTransactionModal()"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<button
|
||||||
|
(click)="logout()"
|
||||||
|
class="flex items-center px-4 py-2 text-red-400 font-medium border border-red-500/50 rounded-lg hover:bg-red-500/10 transition-colors duration-200"
|
||||||
|
>
|
||||||
|
<svg class="w-4 h-4 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1"/>
|
||||||
|
</svg>
|
||||||
|
Abmelden
|
||||||
|
</button>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- Mobile Menu Button -->
|
||||||
<div class="md:hidden">
|
<div class="md:hidden">
|
||||||
<button (click)="toggleMenu()" class="nav-toggle">
|
<button
|
||||||
|
(click)="toggleMenu()"
|
||||||
|
class="p-2 text-white hover:text-emerald-400 rounded-lg transition-colors duration-200"
|
||||||
|
>
|
||||||
<svg
|
<svg
|
||||||
class="h-6 w-6"
|
class="h-6 w-6"
|
||||||
[class.hidden]="isMenuOpen"
|
[class.hidden]="isMenuOpen"
|
||||||
|
@ -67,26 +133,78 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- Mobile Menu -->
|
||||||
<div [class]="isMenuOpen ? 'block' : 'hidden'" class="md:hidden">
|
<div [class]="isMenuOpen ? 'block' : 'hidden'" class="md:hidden">
|
||||||
<div class="nav-mobile-menu">
|
<div class="px-2 pt-2 pb-4 space-y-3 bg-slate-700 rounded-lg mt-2">
|
||||||
<a routerLink="/games" class="nav-mobile-link">Spiele</a>
|
<a
|
||||||
<div class="pt-2 space-y-2">
|
routerLink="/home"
|
||||||
|
class="flex items-center px-4 py-3 text-white/90 hover:text-white hover:bg-white/10 rounded-lg transition-colors duration-200"
|
||||||
|
>
|
||||||
|
<svg class="w-4 h-4 mr-2" fill="currentColor" viewBox="0 0 24 24">
|
||||||
|
<path d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"/>
|
||||||
|
</svg>
|
||||||
|
Spiele
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<div class="border-t border-slate-600 pt-3 space-y-3">
|
||||||
@if (!isLoggedIn()) {
|
@if (!isLoggedIn()) {
|
||||||
<button
|
<button
|
||||||
(click)="showLogin.emit()"
|
(click)="showLogin.emit()"
|
||||||
class="button-primary w-full py-1.5 block text-center"
|
class="w-full flex items-center justify-center px-4 py-3 text-white font-medium border border-emerald-500 rounded-lg hover:bg-emerald-500/10 transition-colors duration-200"
|
||||||
>
|
>
|
||||||
|
<svg class="w-4 h-4 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 16l-4-4m0 0l4-4m-4 4h14m-5 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h7a3 3 0 013 3v1"/>
|
||||||
|
</svg>
|
||||||
Anmelden
|
Anmelden
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
(click)="showRegister.emit()"
|
(click)="showRegister.emit()"
|
||||||
class="bg-emerald-700 text-white hover:bg-emerald-600 w-full py-1.5 rounded block text-center"
|
class="w-full flex items-center justify-center px-4 py-3 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">
|
||||||
|
<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
|
Registrieren
|
||||||
</button>
|
</button>
|
||||||
}
|
}
|
||||||
@if (isLoggedIn()) {
|
@if (isLoggedIn()) {
|
||||||
<button (click)="logout()" class="button-primary w-full py-1.5">Abmelden</button>
|
<!-- Mobile Balance Display -->
|
||||||
|
<div class="flex items-center justify-center px-4 py-3 bg-slate-700 border border-emerald-500/30 rounded-lg">
|
||||||
|
<span class="text-emerald-400 text-sm font-medium mr-2">Guthaben:</span>
|
||||||
|
<span [class]="balance() < 0 ? 'text-red-400 font-bold' : 'text-white font-bold'" class="text-sm">
|
||||||
|
<app-animated-number [value]="balance()" [duration]="0.5"></app-animated-number> €
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<button
|
||||||
|
(click)="openDepositModal()"
|
||||||
|
class="w-full flex items-center justify-center px-4 py-3 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">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6v6m0 0v6m0-6h6m-6 0H6"/>
|
||||||
|
</svg>
|
||||||
|
Einzahlen
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<button
|
||||||
|
(click)="openTransactionModal()"
|
||||||
|
class="w-full flex items-center justify-center px-4 py-3 bg-slate-700 text-white font-medium rounded-lg hover:bg-slate-600 border border-slate-600 transition-colors duration-200"
|
||||||
|
>
|
||||||
|
<svg class="w-4 h-4 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5H7a2 2 0 00-2 2v10a2 2 0 002 2h8a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"/>
|
||||||
|
</svg>
|
||||||
|
Transaktionen
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<button
|
||||||
|
(click)="logout()"
|
||||||
|
class="w-full flex items-center justify-center px-4 py-3 text-red-400 font-medium border border-red-500/50 rounded-lg hover:bg-red-500/10 transition-colors duration-200"
|
||||||
|
>
|
||||||
|
<svg class="w-4 h-4 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1"/>
|
||||||
|
</svg>
|
||||||
|
Abmelden
|
||||||
|
</button>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -10,18 +10,24 @@ import {
|
||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
import { RouterModule } from '@angular/router';
|
import { RouterModule } from '@angular/router';
|
||||||
import { AuthService } from '@service/auth.service';
|
import { AuthService } from '@service/auth.service';
|
||||||
import { Subscription } from 'rxjs';
|
import {Observable, Subscription} from 'rxjs';
|
||||||
import { AnimatedNumberComponent } from '@blackjack/components/animated-number/animated-number.component';
|
import { AnimatedNumberComponent } from '@blackjack/components/animated-number/animated-number.component';
|
||||||
|
import {DepositComponent} from "../../../feature/deposit/deposit.component";
|
||||||
|
import {TransactionHistoryComponent} from "../../../feature/transaction-history/transaction-history.component";
|
||||||
|
import {TransactionData} from "../../../model/TransactionData";
|
||||||
|
import {TransactionService} from "@service/transaction.service";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-navbar',
|
selector: 'app-navbar',
|
||||||
templateUrl: './navbar.component.html',
|
templateUrl: './navbar.component.html',
|
||||||
standalone: true,
|
standalone: true,
|
||||||
imports: [RouterModule, AnimatedNumberComponent],
|
imports: [RouterModule, AnimatedNumberComponent, DepositComponent, TransactionHistoryComponent],
|
||||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||||
})
|
})
|
||||||
export class NavbarComponent implements OnInit, OnDestroy {
|
export class NavbarComponent implements OnInit, OnDestroy {
|
||||||
isMenuOpen = false;
|
isMenuOpen = false;
|
||||||
|
isDepositModalOpen = false;
|
||||||
|
isTransactionModalOpen = false;
|
||||||
private authService: AuthService = inject(AuthService);
|
private authService: AuthService = inject(AuthService);
|
||||||
isLoggedIn = signal(this.authService.isLoggedIn());
|
isLoggedIn = signal(this.authService.isLoggedIn());
|
||||||
|
|
||||||
|
@ -51,4 +57,20 @@ export class NavbarComponent implements OnInit, OnDestroy {
|
||||||
toggleMenu() {
|
toggleMenu() {
|
||||||
this.isMenuOpen = !this.isMenuOpen;
|
this.isMenuOpen = !this.isMenuOpen;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
openDepositModal() {
|
||||||
|
this.isDepositModalOpen = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
closeDepositModal() {
|
||||||
|
this.isDepositModalOpen = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
openTransactionModal() {
|
||||||
|
this.isTransactionModalOpen = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
closeTransactionModal() {
|
||||||
|
this.isTransactionModalOpen = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue