feat: calendrier impérial et conversions calendaires

- calendrier impérial : fenêtre compacte (260px), affichage date
- commande /cal, auto-ouverture paramétrable dans les settings
- socket calendarSync : mise à jour temps réel pour les joueurs
- config MJ : année, jour (label live), heure:minute, planète
- boutons +1 jour et +1 heure (report 24h→jour, 365→1)
- conversions : Solomani, Vilani, Zhodani (Olympiade), Aslan, K'Kree, Hiver
- formules wiki.travellerrpg.com/Date_Conversion, section repliable
- fix: renderChatInput /cal trop large → exact match
- fix: fenêtre refermable (onClose nullifie la référence)
- fix: socket joueur lit data direct au lieu de readCalendar()
This commit is contained in:
2026-07-23 23:28:49 +02:00
parent 5a4d4c45dc
commit 00bcc775fe
9 changed files with 723 additions and 2 deletions
+190
View File
@@ -1162,3 +1162,193 @@ a.mgt2-world-link:hover {
color: #555;
margin-top: 4px;
}
/* === Calendrier Impérial =================================================== */
.mgt2-calendar .window-header {
background: linear-gradient(180deg, rgba(44, 44, 62, 0.96) 0%, rgba(30, 30, 43, 0.96) 100%);
border-bottom: 1px solid #c9a227;
}
.mgt2-calendar .window-title {
color: #d9b24c;
text-shadow: none;
}
.mgt2-calendar .window-content {
padding: 4px 8px;
background: #1a1a2e;
overflow: hidden;
}
.mgt2-cal-window {
display: flex;
align-items: center;
justify-content: space-between;
gap: 8px;
min-height: 28px;
}
.mgt2-cal-display {
flex: 1;
}
.mgt2-cal-date {
color: #d8c79a;
font-size: 0.95em;
font-family: 'Roboto', sans-serif;
white-space: nowrap;
}
.mgt2-cal-config-btn {
flex: 0 0 auto;
width: 22px;
height: 22px;
padding: 0;
border: none;
background: transparent;
color: #8a7a5a;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
font-size: 0.85em;
border-radius: 3px;
transition: color 0.15s, background 0.15s;
}
.mgt2-cal-config-btn:hover {
color: #d9b24c;
background: rgba(201, 162, 39, 0.15);
}
/* Config dialog */
.mgt2-cal-config {
display: flex;
flex-direction: column;
gap: 8px;
padding: 8px;
background: #1a1a2e;
color: #d8c79a;
}
.mgt2-cal-config-row {
display: flex;
align-items: center;
gap: 8px;
}
.mgt2-cal-config-row label {
flex: 0 0 80px;
font-size: 0.85em;
color: #b8a87a;
}
.mgt2-cal-config-row input[type="number"],
.mgt2-cal-config-row input[type="text"] {
flex: 1;
padding: 3px 6px;
border: 1px solid #3a3a4e;
border-radius: 3px;
background: #252540;
color: #d8c79a;
font-size: 0.85em;
}
.mgt2-cal-config-row input:focus {
outline: none;
border-color: #c9a227;
}
.mgt2-cal-day-group {
flex: 1;
display: flex;
align-items: center;
gap: 6px;
}
.mgt2-cal-day-group input {
flex: 0 0 60px;
}
.mgt2-cal-day-label {
font-size: 0.85em;
color: #d9b24c;
white-space: nowrap;
}
.mgt2-cal-config-actions {
display: flex;
gap: 6px;
justify-content: flex-end;
margin-top: 4px;
}
.mgt2-cal-btn {
padding: 4px 10px;
border: 1px solid #3a3a4e;
border-radius: 3px;
background: #252540;
color: #d8c79a;
font-size: 0.82em;
cursor: pointer;
transition: background 0.15s, border-color 0.15s;
}
.mgt2-cal-btn:hover {
background: #303050;
border-color: #c9a227;
}
.mgt2-cal-btn-primary {
background: linear-gradient(180deg, #c9a227 0%, #a8881e 100%);
color: #1a1a2e;
border-color: #c9a227;
font-weight: 600;
}
.mgt2-cal-btn-primary:hover {
background: linear-gradient(180deg, #d9b24c 0%, #c9a227 100%);
}
.mgt2-cal-conversions {
margin-top: 8px;
border: 1px solid #3a3a4e;
border-radius: 3px;
background: #1e1e32;
}
.mgt2-cal-conversions summary {
padding: 4px 8px;
color: #b8a87a;
font-size: 0.82em;
cursor: pointer;
user-select: none;
}
.mgt2-cal-conversions summary:hover {
color: #d9b24c;
}
.mgt2-cal-conv-note {
font-size: 0.85em;
color: #6a6a7e;
font-style: italic;
}
.mgt2-cal-conv-row {
display: flex;
justify-content: space-between;
padding: 2px 8px;
font-size: 0.82em;
color: #d8c79a;
}
.mgt2-cal-conv-row:nth-child(even) {
background: rgba(255,255,255,0.03);
}
.mgt2-cal-conv-label {
color: #8a7a5a;
}