From 245c9acf7ad6d98374ec75b6c102f320f6478e69 Mon Sep 17 00:00:00 2001 From: BENOIT Vincent Date: Thu, 10 Oct 2024 17:43:59 +0200 Subject: [PATCH] correction bug sur timeline --- src/app/app.module.ts | 7 +- .../football-field.component.css | 15 +- .../football-field.component.html | 21 +-- .../football-field.component.ts | 142 ++++++++++++------ 4 files changed, 124 insertions(+), 61 deletions(-) diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 3d42796..247cb1f 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -1,9 +1,10 @@ import { NgModule } from '@angular/core'; +import { FormsModule } from '@angular/forms'; import { FootballFieldComponent } from './football-field/football-field.component'; @NgModule({ - declarations: [ - FootballFieldComponent - ], + imports: [ + FormsModule + ] }) export class AppModule {} diff --git a/src/app/football-field/football-field.component.css b/src/app/football-field/football-field.component.css index addf118..1eabb83 100644 --- a/src/app/football-field/football-field.component.css +++ b/src/app/football-field/football-field.component.css @@ -76,17 +76,24 @@ canvas { .timeline { position: relative; width: 100%; - height: 20px; + height: 25px; background-color: #f0f0f0; border: 1px solid #ccc; display: flex; - align-items: center; + align-items: right; +} + +.timeline-name { + width: 10%; + display: flex; + align-items: left; + margin-right: 10px; } .timeline-block { position: absolute; - height: 15px; - background-color: blue; + height: 25px; + background-color: hsla(240, 100%, 50%, 0.308); border: 1px solid black; cursor: move; } diff --git a/src/app/football-field/football-field.component.html b/src/app/football-field/football-field.component.html index 8fb3cf3..8e3e5da 100644 --- a/src/app/football-field/football-field.component.html +++ b/src/app/football-field/football-field.component.html @@ -64,32 +64,33 @@
- {{ player.id }} -
+ Joueur {{ player.id }} +
+ [style.left]="calculateLeftPosition(step)" + [style.width]="calculateBlockWidth(step)" + (mousedown)="onTimelineBlockMouseDown($event, player, i)">
-
+

Timeline du joueur sélectionné

  • - Étape {{ i + 1 }} : Départ ({{ step.startX }}, {{ step.startY }}), Arrivée ({{ step.endX }}, {{ step.endY }}), Durée : {{ step.duration }} + Étape {{ i + 1 }} : Départ ({{ step.startX }}, {{ step.startY }}), Arrivée ({{ step.endX }}, {{ step.endY }}), Durée : ({{ step.startTime }}, {{ step.endTime }}: {{ step.duration }})
-

Debug Info: {{ debugInfo }}

+

Debug Info

+

{{ debugInfo }}