style: format HTML for consistency and readability

This commit is contained in:
Jan-Marlon Leibl 2025-05-14 12:01:06 +02:00
commit b51305ca64
Signed by: jleibl
GPG key ID: 300B2F906DC6F1D5
6 changed files with 53 additions and 44 deletions

View file

@ -1,40 +1,27 @@
<div class="min-h-screen flex flex-col"> <div class="min-h-screen flex flex-col">
<main class="flex-grow"> <main class="flex-grow">
<app-navbar <app-navbar (showLogin)="showLoginForm()" (showRegister)="showRegisterForm()"></app-navbar>
(showLogin)="showLoginForm()"
(showRegister)="showRegisterForm()"
></app-navbar>
<router-outlet></router-outlet> <router-outlet></router-outlet>
</main> </main>
<app-footer></app-footer> <app-footer></app-footer>
<!-- Auth Forms Overlay --> <!-- Auth Forms Overlay -->
@if (showLogin() || showRegister()) { @if (showLogin() || showRegister()) {
<div <div
class="fixed inset-0 bg-black/50 z-40" class="fixed inset-0 bg-black/50 z-40"
(click)="hideAuthForms()" (click)="hideAuthForms()"
(keydown.enter)="hideAuthForms()" (keydown.enter)="hideAuthForms()"
tabindex="0" tabindex="0"
role="dialog" role="dialog"
aria-modal="true" aria-modal="true"
></div> ></div>
<div <div class="fixed inset-0 flex items-center justify-center z-50 p-4" role="presentation">
class="fixed inset-0 flex items-center justify-center z-50 p-4" <div class="relative" role="dialog" aria-modal="true">
role="presentation"
>
<div
class="relative"
role="dialog"
aria-modal="true"
>
@if (showLogin()) { @if (showLogin()) {
<app-login <app-login (switchForm)="showRegisterForm()" (closeDialog)="hideAuthForms()"></app-login>
(switchForm)="showRegisterForm()"
(closeDialog)="hideAuthForms()"
></app-login>
} }
@if (showRegister()) { @if (showRegister()) {
<app-register <app-register
(switchForm)="showLoginForm()" (switchForm)="showLoginForm()"
(closeDialog)="hideAuthForms()" (closeDialog)="hideAuthForms()"
></app-register> ></app-register>

View file

@ -1,13 +1,24 @@
<div class="min-h-screen bg-deep-blue flex items-center justify-center"> <div class="min-h-screen bg-deep-blue flex items-center justify-center">
<div class="modal-card max-w-md w-full bg-deep-blue rounded-lg shadow-xl p-6 relative"> <div class="modal-card max-w-md w-full bg-deep-blue rounded-lg shadow-xl p-6 relative">
<!-- Close Button --> <!-- Close Button -->
<button <button
(click)="closeDialog.emit()" (click)="closeDialog.emit()"
class="absolute top-4 right-4 text-text-secondary hover:text-white transition-colors" class="absolute top-4 right-4 text-text-secondary hover:text-white transition-colors"
aria-label="Dialog schließen" aria-label="Dialog schließen"
> >
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor"> <svg
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" /> xmlns="http://www.w3.org/2000/svg"
class="h-6 w-6"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M6 18L18 6M6 6l12 12"
/>
</svg> </svg>
</button> </button>

View file

@ -1,13 +1,24 @@
<div class="min-h-screen bg-deep-blue flex items-center justify-center"> <div class="min-h-screen bg-deep-blue flex items-center justify-center">
<div class="modal-card max-w-md w-full bg-deep-blue rounded-lg shadow-xl p-6 relative"> <div class="modal-card max-w-md w-full bg-deep-blue rounded-lg shadow-xl p-6 relative">
<!-- Close Button --> <!-- Close Button -->
<button <button
(click)="closeDialog.emit()" (click)="closeDialog.emit()"
class="absolute top-4 right-4 text-text-secondary hover:text-white transition-colors" class="absolute top-4 right-4 text-text-secondary hover:text-white transition-colors"
aria-label="Dialog schließen" aria-label="Dialog schließen"
> >
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor"> <svg
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" /> xmlns="http://www.w3.org/2000/svg"
class="h-6 w-6"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M6 18L18 6M6 6l12 12"
/>
</svg> </svg>
</button> </button>

View file

@ -184,31 +184,21 @@
<!-- Auth Forms Overlay --> <!-- Auth Forms Overlay -->
@if (showLogin() || showRegister()) { @if (showLogin() || showRegister()) {
<div <div
class="fixed inset-0 bg-black/50 z-40" class="fixed inset-0 bg-black/50 z-40"
(click)="hideAuthForms()" (click)="hideAuthForms()"
(keydown.enter)="hideAuthForms()" (keydown.enter)="hideAuthForms()"
tabindex="0" tabindex="0"
role="dialog" role="dialog"
aria-modal="true" aria-modal="true"
></div> ></div>
<div <div class="fixed inset-0 flex items-center justify-center z-50 p-4" role="presentation">
class="fixed inset-0 flex items-center justify-center z-50 p-4" <div class="relative" role="dialog" aria-modal="true">
role="presentation"
>
<div
class="relative"
role="dialog"
aria-modal="true"
>
@if (showLogin()) { @if (showLogin()) {
<app-login <app-login (switchForm)="showRegisterForm()" (closeDialog)="hideAuthForms()"></app-login>
(switchForm)="showRegisterForm()"
(closeDialog)="hideAuthForms()"
></app-login>
} }
@if (showRegister()) { @if (showRegister()) {
<app-register <app-register
(switchForm)="showLoginForm()" (switchForm)="showLoginForm()"
(closeDialog)="hideAuthForms()" (closeDialog)="hideAuthForms()"
></app-register> ></app-register>

View file

@ -1,4 +1,11 @@
import { ChangeDetectionStrategy, Component, inject, OnDestroy, OnInit, signal } from '@angular/core'; import {
ChangeDetectionStrategy,
Component,
inject,
OnDestroy,
OnInit,
signal,
} from '@angular/core';
import { NgFor } from '@angular/common'; import { NgFor } from '@angular/common';
import { RouterLink } from '@angular/router'; import { RouterLink } from '@angular/router';
import { AuthService } from '@service/auth.service'; import { AuthService } from '@service/auth.service';

View file

@ -72,7 +72,10 @@
<a routerLink="/games" class="nav-mobile-link">Spiele</a> <a routerLink="/games" class="nav-mobile-link">Spiele</a>
<div class="pt-2 space-y-2"> <div class="pt-2 space-y-2">
@if (!isLoggedIn()) { @if (!isLoggedIn()) {
<button (click)="showLogin.emit()" class="button-primary w-full py-1.5 block text-center"> <button
(click)="showLogin.emit()"
class="button-primary w-full py-1.5 block text-center"
>
Anmelden Anmelden
</button> </button>
<button <button