Ajout Aiguille Horloge

This commit is contained in:
2023-03-08 22:33:23 +01:00
parent 77cf72a752
commit 0c11013694
6 changed files with 97 additions and 6 deletions

View File

@ -161,16 +161,24 @@ export class AppAstrologie extends Application {
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 angle = ((chiffreAstral + heureNaissance) * 30) % 360;
const rotation = `rotate(${angle}deg)`;
this.html.find(`div.astro-roue div.astro-disque img`).css({
const angleAstrologie = ((chiffreAstral + heureNaissance) * 30) % 360;
this.html.find(`div.astro-roue div.astro-disque img`).css(this.cssRotation(angleAstrologie));
const timestamp = game.system.rdd.calendrier.getTimestamp();
const angleHeure = timestamp.pourcentageDuJour * 360
this.html.find(`div.astro-roue div.astro-horloge img`).css(this.cssRotation(angleHeure));
}
cssRotation(angleAstrologie) {
const rotation = `rotate(${angleAstrologie}deg)`;
const cssRotation = {
'transform': rotation,
'-ms-transform': rotation,
'-moz-transform': rotation,
'-webkit-transform': rotation,
'-o-transform': rotation
});
};
return cssRotation;
}
requestJetAstrologie() {
@ -199,6 +207,7 @@ export class AppAstrologie extends Application {
refreshAstrologie() {
this.render(true)
}
async close(options) {
Hooks.off(APP_ASTROLOGIE_REFRESH, this.hookReference);
this.hookReference = undefined