Ajout Aiguille Horloge
This commit is contained in:
parent
77cf72a752
commit
0c11013694
@ -49,6 +49,7 @@ export class RdDCalendrier extends Application {
|
|||||||
if (setting.key == SYSTEM_RDD + '.' + WORLD_TIMESTAMP_SETTING) {
|
if (setting.key == SYSTEM_RDD + '.' + WORLD_TIMESTAMP_SETTING) {
|
||||||
this.timestamp = RdDTimestamp.getWorldTime();
|
this.timestamp = RdDTimestamp.getWorldTime();
|
||||||
this.updateDisplay();
|
this.updateDisplay();
|
||||||
|
Hooks.callAll(APP_ASTROLOGIE_REFRESH);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -286,6 +287,7 @@ export class RdDCalendrier extends Application {
|
|||||||
this.positionnerHeure(Number(calendarSet.value));
|
this.positionnerHeure(Number(calendarSet.value));
|
||||||
}
|
}
|
||||||
this.updateDisplay();
|
this.updateDisplay();
|
||||||
|
Hooks.callAll(APP_ASTROLOGIE_REFRESH);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
|
@ -252,6 +252,7 @@ export class RdDTimestamp {
|
|||||||
get heure() { return Math.floor(this.indexMinute / RDD_MINUTES_PAR_HEURES) }
|
get heure() { return Math.floor(this.indexMinute / RDD_MINUTES_PAR_HEURES) }
|
||||||
get minute() { return this.indexMinute % RDD_MINUTES_PAR_HEURES }
|
get minute() { return this.indexMinute % RDD_MINUTES_PAR_HEURES }
|
||||||
get round() { return ROUNDS_PAR_MINUTE * (this.indexMinute - Math.floor(this.indexMinute)) }
|
get round() { return ROUNDS_PAR_MINUTE * (this.indexMinute - Math.floor(this.indexMinute)) }
|
||||||
|
get pourcentageDuJour() { return this.indexMinute / RDD_MINUTES_PAR_JOUR }
|
||||||
|
|
||||||
formatDate() {
|
formatDate() {
|
||||||
const jour = this.jour + 1;
|
const jour = this.jour + 1;
|
||||||
|
@ -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-astral"]`).val(this.appData.theme.signeAstral.key)
|
||||||
this.html.find(`select[name="signe-naissance"]`).val(this.appData.theme.signeNaissance.key)
|
this.html.find(`select[name="signe-naissance"]`).val(this.appData.theme.signeNaissance.key)
|
||||||
|
|
||||||
const angle = ((chiffreAstral + heureNaissance) * 30) % 360;
|
const angleAstrologie = ((chiffreAstral + heureNaissance) * 30) % 360;
|
||||||
const rotation = `rotate(${angle}deg)`;
|
this.html.find(`div.astro-roue div.astro-disque img`).css(this.cssRotation(angleAstrologie));
|
||||||
this.html.find(`div.astro-roue div.astro-disque img`).css({
|
|
||||||
|
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,
|
'transform': rotation,
|
||||||
'-ms-transform': rotation,
|
'-ms-transform': rotation,
|
||||||
'-moz-transform': rotation,
|
'-moz-transform': rotation,
|
||||||
'-webkit-transform': rotation,
|
'-webkit-transform': rotation,
|
||||||
'-o-transform': rotation
|
'-o-transform': rotation
|
||||||
});
|
};
|
||||||
|
return cssRotation;
|
||||||
}
|
}
|
||||||
|
|
||||||
requestJetAstrologie() {
|
requestJetAstrologie() {
|
||||||
@ -199,6 +207,7 @@ export class AppAstrologie extends Application {
|
|||||||
refreshAstrologie() {
|
refreshAstrologie() {
|
||||||
this.render(true)
|
this.render(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
async close(options) {
|
async close(options) {
|
||||||
Hooks.off(APP_ASTROLOGIE_REFRESH, this.hookReference);
|
Hooks.off(APP_ASTROLOGIE_REFRESH, this.hookReference);
|
||||||
this.hookReference = undefined
|
this.hookReference = undefined
|
||||||
|
68
styles/img/ui/rdd-aiguille-horloge.svg
Normal file
68
styles/img/ui/rdd-aiguille-horloge.svg
Normal file
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 13 KiB |
@ -907,7 +907,15 @@ div.astro-roue div.astro-disque {
|
|||||||
width: calc(100% - 5rem);
|
width: calc(100% - 5rem);
|
||||||
height: calc(100% - 5rem);
|
height: calc(100% - 5rem);
|
||||||
}
|
}
|
||||||
div.astro-roue div.astro-disque img { border: none; }
|
div.astro-roue div.astro-horloge {
|
||||||
|
position: absolute;
|
||||||
|
border: none;
|
||||||
|
top: calc(50% - 3.5rem);
|
||||||
|
left: calc(50% - 3.5rem);
|
||||||
|
width: calc(100% - 6rem);
|
||||||
|
height: calc(100% - 6rem);
|
||||||
|
}
|
||||||
|
div.astro-roue div:is(.astro-disque,.astro-horloge) img { border: none; }
|
||||||
div.astro-roue div.astro-heure img.astro-heure-img {
|
div.astro-roue div.astro-heure img.astro-heure-img {
|
||||||
width: 2rem;
|
width: 2rem;
|
||||||
height: 2rem;
|
height: 2rem;
|
||||||
|
@ -28,5 +28,8 @@
|
|||||||
<div class="astro-heure heure-{{heure.hh}}"><img class="astro-heure-img" src="{{heure.webp}}" title="{{heure.label}}"></div>
|
<div class="astro-heure heure-{{heure.hh}}"><img class="astro-heure-img" src="{{heure.webp}}" title="{{heure.label}}"></div>
|
||||||
<div class="astro-ajustement ajustement-{{heure.hh}}"></div>
|
<div class="astro-ajustement ajustement-{{heure.hh}}"></div>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
|
<div class="astro-horloge">
|
||||||
|
<img src="systems/foundryvtt-reve-de-dragon/styles/img/ui/rdd-aiguille-horloge.svg" alt="">
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
Loading…
Reference in New Issue
Block a user