Déplacement de la notif dans les panel

This commit is contained in:
JonathanMM 2023-05-17 23:20:58 +02:00
parent e4a6439acb
commit 51e43bf38c
3 changed files with 11 additions and 4 deletions

View file

@ -147,7 +147,7 @@ h1 {
#panel-area {
display: none;
font-size: 24px;
font-size: 20px;
}
#input-area {
@ -274,6 +274,10 @@ h1 {
min-height: 50px;
}
#panel-fenetre-notification-area {
position: absolute;
}
#notification-label,
#panel-fenetre-notification-label {
font-size: 22px;

View file

@ -123,10 +123,10 @@ export default class FinDePartiePanel {
})
)
.then(() => {
NotificationMessage.ajouterNotificationPanel("Résumé copié dans le presse-papier.");
NotificationMessage.ajouterNotificationPanel("Résumé copié dans le presse-papier.", resumeBouton);
})
.catch((raison) => {
NotificationMessage.ajouterNotificationPanel("Votre navigateur n'est pas compatible.");
NotificationMessage.ajouterNotificationPanel("Votre navigateur n'est pas compatible.", resumeBouton);
});
});
}

View file

@ -9,8 +9,11 @@ export default class NotificationMessage {
this.ajouterNotificationDiv(this._notificationArea, this._notificationLabel, message);
}
public static ajouterNotificationPanel(message: string): void {
public static ajouterNotificationPanel(message: string, origine: HTMLElement): void {
this.ajouterNotificationDiv(this._notificationPanelArea, this._notificationPanelLabel, message);
const { top: topParent, left: leftParent } = origine.getBoundingClientRect();
this._notificationPanelArea.style.top = `${topParent + 30}px`;
this._notificationPanelArea.style.left = `${leftParent - this._notificationPanelArea.getBoundingClientRect().width / 2}px`;
}
private static ajouterNotificationDiv(divArea: HTMLElement, divLabel: HTMLElement, message: string): void {