Ajout d'une horloge analogique

Amélioration de la fenêtre calendrier:
* plus compacte
* horloge analogique
* normalement compatible pop-out
* minimisable (juste la barre de titre)
This commit is contained in:
2023-03-29 22:53:40 +02:00
parent 23af30a538
commit c1d02d9fda
23 changed files with 429 additions and 539 deletions

View File

@ -1,6 +1,6 @@
import { SYSTEM_RDD } from "../constants.js";
import { Misc } from "../misc.js";
import { RDD_MINUTES_PAR_HEURES, RDD_MINUTES_PAR_JOUR, RdDTimestamp } from "../rdd-timestamp.js";
import { RdDTimestamp } from "../time/rdd-timestamp.js";
export const APP_ASTROLOGIE_REFRESH = `${SYSTEM_RDD}-refresh-astrologie`
@ -22,6 +22,7 @@ export class AppAstrologie extends Application {
title: "Astrologie",
width: 'fit-content',
height: 'fit-content',
classes: ['calendar-astrologie'],
popOut: true,
resizable: false
});
@ -155,30 +156,19 @@ export class AppAstrologie extends Application {
RdDTimestamp.definitions().forEach(dh => {
const ajustement = RdDTimestamp.ajustementAstrologiqueHeure(heureNaissance, chiffreAstral, dh.heure + 1);
const txtAjustement = ajustement == 0 ? '' : Misc.toSignedString(ajustement);
this.html.find(`div.astro-ajustement.heure-${dh.hh}`).text(txtAjustement)
this.html.find(`div.horloge-ajustement.heure-${dh.hh}`).text(txtAjustement)
});
this.html.find(`select[name="signe-astral"]`).val(this.appData.theme.signeAstral.key)
this.html.find(`select[name="signe-naissance"]`).val(this.appData.theme.signeNaissance.key)
const angleAstrologie = ((chiffreAstral + heureNaissance) * 30) % 360 - 45;
this.html.find(`div.astro-roue div.astro-disque img`).css(this.cssRotation(angleAstrologie));
this.html.find(`div.horloge-roue div.disque-astro img`).css(Misc.cssRotation(angleAstrologie));
const timestamp = game.system.rdd.calendrier.getTimestamp();
this.html.find(`div.astro-roue div.astro-horloge-heure img`).css(this.cssRotation(timestamp.angleHeure));
this.html.find(`div.astro-roue div.astro-horloge-minute img`).css(this.cssRotation(timestamp.angleMinute));
}
cssRotation(angleAstrologie) {
const rotation = `rotate(${angleAstrologie}deg)`;
return {
'transform': rotation,
'-ms-transform': rotation,
'-moz-transform': rotation,
'-webkit-transform': rotation,
'-o-transform': rotation
};
this.html.find(`div.horloge-roue div.horloge-aiguille-heure img`).css(Misc.cssRotation(timestamp.angleHeure));
this.html.find(`div.horloge-roue div.horloge-aiguille-minute img`).css(Misc.cssRotation(timestamp.angleMinute));
}
requestJetAstrologie() {