diff --git a/FencerJudgeFront/src/app/app-routing.module.ts b/FencerJudgeFront/src/app/app-routing.module.ts
index 0440f68..0297262 100644
--- a/FencerJudgeFront/src/app/app-routing.module.ts
+++ b/FencerJudgeFront/src/app/app-routing.module.ts
@@ -1,41 +1,10 @@
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
-import { authGuard } from '@guards/auth.guard';
-
-import { LoginComponent } from './components/essentials/login/login.component';
-import { LogoutComponent } from './components/essentials/logout/logout.component';
-
-import { HomeComponent } from './components/home/home.component';
-
-import { MatchesComponent } from './components/match/matches/matches.component';
-import { MatchesIdComponent } from './components/match/matches-id/matches-id.component';
-import { MatchesAddComponent } from './components/match/matches-add/matches-add.component';
-import { MatchesDelComponent } from './components/match/matches-del/matches-del.component';
-
-const routes: Routes = [
- { path: 'login', component: LoginComponent },
- { path: 'logout', component: LogoutComponent },
-
- { path: '', component: HomeComponent },
- { path: 'home', component: HomeComponent },
-
- { path: 'matches', component: MatchesComponent },
- {
- path: 'matches/add',
- component: MatchesAddComponent,
- canActivate: [authGuard],
- },
- {
- path: 'matches/del/:id',
- component: MatchesDelComponent,
- canActivate: [authGuard],
- },
- { path: 'matches/:id', component: MatchesIdComponent },
-];
+const routes: Routes = [];
@NgModule({
imports: [RouterModule.forRoot(routes)],
- exports: [RouterModule],
+ exports: [RouterModule]
})
-export class AppRoutingModule {}
+export class AppRoutingModule { }
diff --git a/FencerJudgeFront/src/app/app.component.html b/FencerJudgeFront/src/app/app.component.html
index eaf43d3..a37d5f5 100644
--- a/FencerJudgeFront/src/app/app.component.html
+++ b/FencerJudgeFront/src/app/app.component.html
@@ -1,3 +1,5 @@
footer works!
diff --git a/FencerJudgeFront/src/app/components/essentials/header/header.component.css b/FencerJudgeFront/src/app/components/essentials/header/header.component.css index 9df8f3d..e69de29 100644 --- a/FencerJudgeFront/src/app/components/essentials/header/header.component.css +++ b/FencerJudgeFront/src/app/components/essentials/header/header.component.css @@ -1,25 +0,0 @@ -.navbar { - box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1); -} - -.navbar-brand { - font-weight: 700; - font-size: 1.4rem; - display: flex; - align-items: center; -} - -.navbar-brand img { - height: 30px; - margin-right: 0.5rem; -} - -.nav-link { - transition: color 0.3s ease; -} - -.nav-link:hover, -.active-link { - color: #ffcc00 !important; - font-weight: 600; -} diff --git a/FencerJudgeFront/src/app/components/essentials/header/header.component.html b/FencerJudgeFront/src/app/components/essentials/header/header.component.html index c8ae8e8..4f5a95d 100644 --- a/FencerJudgeFront/src/app/components/essentials/header/header.component.html +++ b/FencerJudgeFront/src/app/components/essentials/header/header.component.html @@ -1,52 +1 @@ - - +header works!
diff --git a/FencerJudgeFront/src/app/components/essentials/header/header.component.ts b/FencerJudgeFront/src/app/components/essentials/header/header.component.ts index 6b0a735..ffc3163 100644 --- a/FencerJudgeFront/src/app/components/essentials/header/header.component.ts +++ b/FencerJudgeFront/src/app/components/essentials/header/header.component.ts @@ -1,6 +1,4 @@ import { Component } from '@angular/core'; -import { Router } from '@angular/router'; -import { AuthService } from '@services/auth/auth.service'; @Component({ selector: 'app-header', @@ -8,18 +6,4 @@ import { AuthService } from '@services/auth/auth.service'; templateUrl: './header.component.html', styleUrl: './header.component.css', }) -export class HeaderComponent { - constructor(private router: Router, public authService: AuthService) {} - - isHomeActive(): boolean { - return this.router.url === '/' || this.router.url === '/home'; - } - - isHomeActiveBool(): boolean { - if (this.router.url != '/home') { - return true; - } else { - return false; - } - } -} +export class HeaderComponent {} diff --git a/FencerJudgeFront/src/app/components/essentials/login/login.component.css b/FencerJudgeFront/src/app/components/essentials/login/login.component.css deleted file mode 100644 index a2b0cf2..0000000 --- a/FencerJudgeFront/src/app/components/essentials/login/login.component.css +++ /dev/null @@ -1,147 +0,0 @@ -.login-container { - display: flex; - justify-content: center; - align-items: center; - min-height: 25vh; - padding: 2rem; -} - -.login-card { - background-color: #fff; - border-radius: 12px; - overflow: hidden; - width: 500px; - box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25); - color: #333; -} - -.login-header-img { - position: absolute; - height: inherit; - width: 100%; - background-color: rgba(0, 0, 0, 0.25); - top: 0; - left: 0; -} - -.login-header { - background: url("https://www.lejdd.fr/lmnr/var/jdd/public/media/image/2022/07/19/12/escrime-comment-les-francais-apprivoisent-leurs-armes.jpg?VersionId=Mw31AogdDUwVLuCaVdxMozm9kito7TTP") no-repeat center/cover; - position: relative; - padding: 4rem 1rem; - display: flex; - justify-content: center; - align-items: center; - min-height: 300px; - color: white; -} - -.login-header::before { - content: ""; - position: absolute; - inset: 0; - background: rgba(0, 0, 0, 0.3); - /* voile sombre */ - -webkit-backdrop-filter: blur(2px); - backdrop-filter: blur(2px); - /* effet de flou */ - z-index: 1; - border-radius: 0.5rem; -} - -.login-header h1 { - position: relative; - z-index: 2; - padding: 2rem; -} - -.login-header h2 { - margin-bottom: 0.5rem; -} - -.login-header p { - font-size: 0.85rem; - line-height: 1.4; -} - -.login-form { - padding: 1.5rem; - display: flex; - flex-direction: column; - gap: 1rem; -} - -.input-group { - display: flex; - align-items: center; - border-radius: 20px; - position: relative; - background-color: #235d4f; - padding: 1rem; -} - -.input-group input { - width: 100%; - padding: 1rem; - font-size: 16px; - color: white; - border: none; - border-bottom: 1px solid white; - outline: none; - background: transparent; -} - -.input-group input:focus~label, -.input-group input:valid~label { - top: 0; - left: 0; - color: #235d4f; - font-size: 12px; - padding: .6rem; -} - -.input-group input .form-control:focus { - border-color: transparent !important; -} - -.input-group label { - position: absolute; - top: 22px; - left: 0; - font-size: 16px; - color: white; - pointer-events: none; - transition: 0.5s; - padding: .6rem; -} - -.input-group .icon { - color: white; - margin-right: 0.5rem; -} - -.options { - display: flex; - justify-content: space-between; - font-size: 0.85rem; - color: #555; -} - -.options a { - color: #235d4f; - text-decoration: none; -} - -.login-btn { - background-color: #235d4f; - color: white; - padding: 0.6rem; - border: none; - border-radius: 6px; - font-size: 1rem; - cursor: pointer; - transition: background-color 0.3s; -} - -.login-btn:hover { - background-color: #1b4b3d; -} \ No newline at end of file diff --git a/FencerJudgeFront/src/app/components/essentials/login/login.component.html b/FencerJudgeFront/src/app/components/essentials/login/login.component.html deleted file mode 100644 index 993b80b..0000000 --- a/FencerJudgeFront/src/app/components/essentials/login/login.component.html +++ /dev/null @@ -1,22 +0,0 @@ -logout works!
diff --git a/FencerJudgeFront/src/app/components/essentials/logout/logout.component.spec.ts b/FencerJudgeFront/src/app/components/essentials/logout/logout.component.spec.ts deleted file mode 100644 index 074294b..0000000 --- a/FencerJudgeFront/src/app/components/essentials/logout/logout.component.spec.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { LogoutComponent } from './logout.component'; - -describe('LogoutComponent', () => { - let component: LogoutComponent; - let fixture: ComponentFixture
-
- home works!
diff --git a/FencerJudgeFront/src/app/components/home/home.component.ts b/FencerJudgeFront/src/app/components/home/home.component.ts index c6a3439..906862d 100644 --- a/FencerJudgeFront/src/app/components/home/home.component.ts +++ b/FencerJudgeFront/src/app/components/home/home.component.ts @@ -1,159 +1,11 @@ import { Component } from '@angular/core'; -import { MatchesService } from '@services/matches/matches.service'; -import { Matches, MatchState } from '@interfaces/matches'; - -import { PlayerService } from '@services/player/player.service'; -import { Player } from '@interfaces/player'; - -import { RefereeService } from '@services/referee/referee.service'; -import { Referee, RefereeLevel } from '@interfaces/referee'; - @Component({ selector: 'app-home', standalone: false, templateUrl: './home.component.html', - styleUrl: './home.component.css', + styleUrl: './home.component.css' }) export class HomeComponent { - latestMatch?: Matches; - player1?: Player; - player2?: Player; - referee?: Referee; - MatchState = MatchState; - intervalId?: any; - timeUntilMatch: string | null = null; - constructor( - private matchesService: MatchesService, - private playerService: PlayerService, - private refereeService: RefereeService - ) {} - - ngOnInit(): void { - this.getLatestMatch(); - } - - ngOnDestroy(): void { - if (this.intervalId) { - clearInterval(this.intervalId); - } - } - - private getLatestMatch(): void { - this.matchesService.getMatches().subscribe((matches) => { - if (matches.length > 0) { - this.latestMatch = matches[matches.length - 1]; - console.log( - '[HomeComponent] 🏁 Dernier match ajouté :', - this.latestMatch - ); - - // Récupération des données liées - this.loadRelatedEntities(this.latestMatch); - - if (this.latestMatch.state === MatchState.NOT_STARTED) { - this.updateTimeUntilMatch(); // initial - this.intervalId = setInterval(() => { - this.updateTimeUntilMatch(); - }, 60000); // chaque minute - } - } else { - console.warn('[HomeComponent] Aucun match disponible'); - } - }); - } - - private updateTimeUntilMatch(): void { - if (!this.latestMatch) return; - - const now = new Date(); - const matchDate = new Date(this.latestMatch.date); - const diffMs = matchDate.getTime() - now.getTime(); - - if (diffMs <= 0) { - this.timeUntilMatch = null; - clearInterval(this.intervalId); - return; - } - - const totalMinutes = Math.floor(diffMs / (1000 * 60)); - const days = Math.floor(totalMinutes / (60 * 24)); - const hours = Math.floor((totalMinutes % (60 * 24)) / 60); - const minutes = totalMinutes % 60; - - let result = ''; - if (days > 0) result += `${days}j `; - if (hours > 0 || days > 0) result += `${hours}h `; - result += `${minutes}min`; - - this.timeUntilMatch = result.trim(); - } - - private loadRelatedEntities(match: Matches): void { - this.playerService.getPlayerById(match.player1ID).subscribe((p1) => { - this.player1 = p1!; - }); - - this.playerService.getPlayerById(match.player2ID).subscribe((p2) => { - this.player2 = p2!; - }); - - this.refereeService.getRefereeById(match.refereeID).subscribe((ref) => { - this.referee = ref!; - }); - } - - getMatchStateLabel(state: MatchState): string { - switch (state) { - case MatchState.NOT_STARTED: - return 'À venir'; - case MatchState.ONGOING: - return 'En cours'; - case MatchState.OVER: - return 'Terminé'; - default: - return 'Inconnu'; - } - } - - getMatchStateColor(state: MatchState): string { - switch (state) { - case MatchState.NOT_STARTED: - return 'secondary'; - case MatchState.ONGOING: - return 'warning'; - case MatchState.OVER: - return 'success'; - default: - return 'light'; - } - } - - getTimeUntilMatch(): string | null { - if ( - !this.latestMatch || - this.latestMatch.state !== MatchState.NOT_STARTED - ) { - return null; - } - - const now = new Date(); - const matchDate = new Date(this.latestMatch.date); - const diffMs = matchDate.getTime() - now.getTime(); - - if (diffMs <= 0) return null; - - const totalMinutes = Math.floor(diffMs / (1000 * 60)); - const days = Math.floor(totalMinutes / (60 * 24)); - const hours = Math.floor((totalMinutes % (60 * 24)) / 60); - const minutes = totalMinutes % 60; - - let result = ''; - if (days > 0) result += `${days}j `; - if (hours > 0 || days > 0) result += `${hours}h `; - result += `${minutes}min`; - - return result.trim(); - } } diff --git a/FencerJudgeFront/src/app/components/match/matches-add/matches-add.component.css b/FencerJudgeFront/src/app/components/match/matches-add/matches-add.component.css deleted file mode 100644 index bb537a4..0000000 --- a/FencerJudgeFront/src/app/components/match/matches-add/matches-add.component.css +++ /dev/null @@ -1,18 +0,0 @@ -form fieldset { - background-color: #f8f9fa; /* gris clair */ -} - -form legend { - font-weight: 600; - font-size: 1.1rem; -} - -form label { - font-weight: 500; -} - -form button { - width: 100%; - padding: 0.6rem; - font-size: 1.1rem; -} diff --git a/FencerJudgeFront/src/app/components/match/matches-add/matches-add.component.html b/FencerJudgeFront/src/app/components/match/matches-add/matches-add.component.html deleted file mode 100644 index 130f2cc..0000000 --- a/FencerJudgeFront/src/app/components/match/matches-add/matches-add.component.html +++ /dev/null @@ -1,171 +0,0 @@ -matches-del works!
diff --git a/FencerJudgeFront/src/app/components/match/matches-del/matches-del.component.spec.ts b/FencerJudgeFront/src/app/components/match/matches-del/matches-del.component.spec.ts deleted file mode 100644 index 29459b8..0000000 --- a/FencerJudgeFront/src/app/components/match/matches-del/matches-del.component.spec.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { MatchesDelComponent } from './matches-del.component'; - -describe('MatchesDelComponent', () => { - let component: MatchesDelComponent; - let fixture: ComponentFixture- {{ referee.firstName }} {{ referee.name }} -
-- Niveau : {{ getRefereeLevelLabel(referee.level) }} -
-Arbitre non trouvé.
-Match non trouvé.
-
-
-
-
-
-