feat: Loksyu & TinJi standalone AppV2 apps with chat buttons and dice automation

- CDELoksyuApp: standalone HandlebarsApplicationMixin(ApplicationV2) app
  - 5-element Wu Xing grid with yin/yang inputs per element
  - Per-element reset buttons + global reset-all
  - Auto-refresh via updateActor hook

- CDETinjiApp: standalone AppV2 for the collective Tin Ji dice pool
  - Large neon counter with +/- buttons and direct input
  - Spend button sends a chat message with remaining count

- singletons.js: shared utilities
  - getSingletonActor: find or auto-create singleton actor
  - updateLoksyuFromRoll: compute lokAspect from Wu Xing cycle, update yin/yang
  - updateTinjiFromRoll: add tinji face count to value

- rolling.js: auto-update both singletons after every dice roll
  (weapon path + main roll path)

- system.js: renderChatLog hook injects Loksyu/TinJi footer buttons
  in the chat sidebar

- loksyu.js / tinji.js: actor sheets redirect to standalone apps
  when opened via the sidebar

- CSS: .cde-loksyu-standalone, .cde-tinji-standalone, .cde-chat-app-buttons,
  .cde-tinji-spend-msg styles added

- i18n: new keys in fr-cde.json and en-cde.json for all new UI strings
  (LoksyuNotFound, TinjiNotFound, Reset, ResetAll, SpendTinji, etc.)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-03-30 09:51:39 +02:00
parent 6fda4b9246
commit 0689fae792
41 changed files with 1558 additions and 13 deletions

View File

@@ -981,6 +981,346 @@ section.npc .cde-neon-tabs .item.active {
.cde-npc-tracks .cde-track-note input {
width: 100%;
}
.cde-chat-app-buttons {
display: flex;
gap: 6px;
padding: 6px 8px 4px;
border-top: 1px solid #1a2436;
}
.cde-chat-app-buttons .cde-chat-btn {
flex: 1 1 0;
display: flex;
align-items: center;
justify-content: center;
gap: 6px;
padding: 5px 8px;
font-size: 11px;
font-family: "Orbitron", "Averia", sans-serif;
text-transform: uppercase;
letter-spacing: 0.06em;
background: #101622;
border: 1px solid #1a2436;
border-radius: 4px;
color: #7d94b8;
cursor: pointer;
transition: all 0.2s;
}
.cde-chat-app-buttons .cde-chat-btn i {
font-size: 12px;
}
.cde-chat-app-buttons .cde-chat-btn:hover {
background: rgba(74, 158, 255, 0.1);
border-color: #4a9eff;
color: #4a9eff;
box-shadow: 0 0 8px rgba(74, 158, 255, 0.3);
}
.cde-chat-app-buttons .cde-chat-btn--tinji:hover {
background: rgba(255, 61, 90, 0.1);
border-color: #ff3d5a;
color: #ff3d5a;
box-shadow: 0 0 8px rgba(255, 61, 90, 0.3);
}
.cde-loksyu-standalone .cde-loksyu-app-body {
padding: 12px;
}
.cde-loksyu-standalone .cde-loksyu-elements {
display: grid;
grid-template-columns: repeat(5, 1fr);
gap: 8px;
margin-bottom: 12px;
}
.cde-loksyu-standalone .cde-lok-card {
background: rgba(16, 22, 34, 0.8);
border: 1px solid #1a2436;
border-radius: 6px;
padding: 8px 6px;
display: flex;
flex-direction: column;
gap: 6px;
transition: border-color 0.2s;
}
.cde-loksyu-standalone .cde-lok-card--wood:hover {
border-color: #4a9e3f;
}
.cde-loksyu-standalone .cde-lok-card--wood .cde-lok-input:focus {
border-bottom-color: #4a9e3f;
}
.cde-loksyu-standalone .cde-lok-card--fire:hover {
border-color: #ff3d5a;
}
.cde-loksyu-standalone .cde-lok-card--fire .cde-lok-input:focus {
border-bottom-color: #ff3d5a;
}
.cde-loksyu-standalone .cde-lok-card--earth:hover {
border-color: #c88a3a;
}
.cde-loksyu-standalone .cde-lok-card--earth .cde-lok-input:focus {
border-bottom-color: #c88a3a;
}
.cde-loksyu-standalone .cde-lok-card--metal:hover {
border-color: #7d94b8;
}
.cde-loksyu-standalone .cde-lok-card--metal .cde-lok-input:focus {
border-bottom-color: #7d94b8;
}
.cde-loksyu-standalone .cde-lok-card--water:hover {
border-color: #4a9eff;
}
.cde-loksyu-standalone .cde-lok-card--water .cde-lok-input:focus {
border-bottom-color: #4a9eff;
}
.cde-loksyu-standalone .cde-lok-header {
display: flex;
align-items: center;
gap: 6px;
}
.cde-loksyu-standalone .cde-lok-header img.cde-lok-icon {
border-radius: 4px;
flex-shrink: 0;
}
.cde-loksyu-standalone .cde-lok-titles {
flex: 1 1 0;
min-width: 0;
display: flex;
flex-direction: column;
}
.cde-loksyu-standalone .cde-lok-titles .cde-lok-name {
font-size: 10px;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.08em;
color: #e2e8f4;
}
.cde-loksyu-standalone .cde-lok-titles .cde-lok-qual {
font-size: 9px;
color: #7d94b8;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.cde-loksyu-standalone .cde-lok-reset {
color: #7d94b8;
font-size: 11px;
flex-shrink: 0;
cursor: pointer;
}
.cde-loksyu-standalone .cde-lok-reset:hover {
color: #e2e8f4;
}
.cde-loksyu-standalone .cde-lok-values {
display: flex;
flex-direction: column;
gap: 4px;
}
.cde-loksyu-standalone .cde-lok-polarity {
display: flex;
align-items: center;
gap: 4px;
}
.cde-loksyu-standalone .cde-lok-polarity .cde-lok-pol-label {
font-size: 9px;
color: #7d94b8;
width: 30px;
flex-shrink: 0;
}
.cde-loksyu-standalone .cde-lok-polarity--yang .cde-lok-pol-label {
color: #e2e8f4;
}
.cde-loksyu-standalone .cde-lok-input {
flex: 1 1 0;
background: transparent;
border: none;
border-bottom: 1px solid #1a2436;
color: #e2e8f4;
font-size: 13px;
font-weight: 700;
text-align: center;
padding: 2px 0;
transition: border-bottom-color 0.2s;
width: 100%;
}
.cde-loksyu-standalone .cde-lok-input:focus {
outline: none;
}
.cde-loksyu-standalone .cde-lok-input[disabled] {
opacity: 0.5;
cursor: default;
}
.cde-loksyu-standalone .cde-loksyu-visual-row {
text-align: center;
margin: 6px 0;
}
.cde-loksyu-standalone .cde-loksyu-visual-row .cde-lok-visual {
max-width: 100%;
max-height: 80px;
opacity: 0.6;
}
.cde-loksyu-standalone .cde-lok-footer {
display: flex;
justify-content: center;
padding-top: 6px;
border-top: 1px solid #1a2436;
margin-top: 6px;
}
.cde-loksyu-standalone .cde-lok-reset-all {
display: flex;
align-items: center;
gap: 6px;
padding: 5px 14px;
font-size: 11px;
background: rgba(255, 61, 90, 0.12);
border: 1px solid rgba(255, 61, 90, 0.3);
border-radius: 4px;
color: #7d94b8;
cursor: pointer;
transition: all 0.2s;
}
.cde-loksyu-standalone .cde-lok-reset-all:hover {
background: rgba(255, 61, 90, 0.2);
border-color: #ff3d5a;
color: #e2e8f4;
}
.cde-tinji-standalone .cde-tinji-app-body {
padding: 16px 12px;
display: flex;
align-items: center;
gap: 16px;
}
.cde-tinji-standalone .cde-tinji-display {
flex: 1 1 0;
display: flex;
flex-direction: column;
align-items: center;
gap: 8px;
}
.cde-tinji-standalone .cde-tinji-chinese-large {
font-size: 40px;
color: #ff3d5a;
text-shadow: 0 0 20px rgba(255, 61, 90, 0.6);
line-height: 1;
font-family: serif;
}
.cde-tinji-standalone .cde-tinji-label {
font-size: 10px;
font-family: "Orbitron", sans-serif;
text-transform: uppercase;
letter-spacing: 0.12em;
color: #7d94b8;
}
.cde-tinji-standalone .cde-tinji-counter {
display: flex;
align-items: center;
gap: 8px;
margin: 4px 0;
}
.cde-tinji-standalone .cde-tinji-step {
width: 28px;
height: 28px;
background: #101622;
border: 1px solid #1a2436;
border-radius: 50%;
color: #7d94b8;
font-size: 18px;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.2s;
line-height: 1;
padding: 0;
}
.cde-tinji-standalone .cde-tinji-step:hover {
background: rgba(255, 61, 90, 0.15);
border-color: #ff3d5a;
color: #ff3d5a;
}
.cde-tinji-standalone .cde-tinji-direct {
width: 72px;
background: transparent;
border: none;
border-bottom: 2px solid #ff3d5a;
color: #ff3d5a;
font-size: 36px;
font-weight: 700;
text-align: center;
text-shadow: 0 0 12px rgba(255, 61, 90, 0.5);
padding: 0;
}
.cde-tinji-standalone .cde-tinji-direct:focus {
outline: none;
}
.cde-tinji-standalone .cde-tinji-direct[disabled] {
opacity: 0.7;
cursor: default;
}
.cde-tinji-standalone .cde-tinji-hint {
font-size: 10px;
color: #7d94b8;
text-align: center;
}
.cde-tinji-standalone .cde-tinji-actions {
display: flex;
gap: 6px;
margin-top: 6px;
}
.cde-tinji-standalone .cde-tinji-spend-btn,
.cde-tinji-standalone .cde-tinji-reset-btn {
display: flex;
align-items: center;
gap: 5px;
padding: 5px 12px;
font-size: 11px;
border-radius: 4px;
cursor: pointer;
transition: all 0.2s;
}
.cde-tinji-standalone .cde-tinji-spend-btn {
background: rgba(255, 61, 90, 0.15);
border: 1px solid #ff3d5a;
color: #ff3d5a;
}
.cde-tinji-standalone .cde-tinji-spend-btn:hover {
background: rgba(255, 61, 90, 0.3);
}
.cde-tinji-standalone .cde-tinji-spend-btn[disabled] {
opacity: 0.4;
cursor: not-allowed;
pointer-events: none;
}
.cde-tinji-standalone .cde-tinji-reset-btn {
background: #101622;
border: 1px solid #1a2436;
color: #7d94b8;
}
.cde-tinji-standalone .cde-tinji-reset-btn:hover {
border-color: #e2e8f4;
color: #e2e8f4;
}
.cde-tinji-standalone .cde-tinji-visual {
width: 90px;
height: auto;
opacity: 0.6;
flex-shrink: 0;
}
.cde-tinji-spend-msg {
display: flex;
align-items: center;
gap: 6px;
font-size: 12px;
padding: 6px 8px;
background: rgba(255, 61, 90, 0.08);
border-left: 3px solid #ff3d5a;
border-radius: 4px;
color: #e2e8f4;
}
.cde-tinji-spend-msg i {
color: #ff3d5a;
}
.cde-tinji-spend-msg .cde-tinji-remain {
margin-left: auto;
font-size: 10px;
color: #7d94b8;
}
.cde-loksyu-grid {
display: grid;
grid-template-columns: repeat(5, minmax(0, 1fr));

View File

@@ -1032,6 +1032,351 @@ section.npc .cde-neon-tabs .item.active { color: @cde-supernatural; borde
// ============================================================
// Loksyu — 5 elemental cards grid
// ============================================================
// ============================================================
// Chat buttons — Loksyu / TinJi quick-access
// ============================================================
.cde-chat-app-buttons {
display: flex;
gap: 6px;
padding: 6px 8px 4px;
border-top: 1px solid @cde-border;
.cde-chat-btn {
flex: 1 1 0;
display: flex;
align-items: center;
justify-content: center;
gap: 6px;
padding: 5px 8px;
font-size: 11px;
font-family: "Orbitron", "Averia", sans-serif;
text-transform: uppercase;
letter-spacing: 0.06em;
background: @cde-surface;
border: 1px solid @cde-border;
border-radius: 4px;
color: @cde-muted;
cursor: pointer;
transition: all 0.2s;
i { font-size: 12px; }
&:hover {
background: fade(@cde-spell, 10%);
border-color: @cde-spell;
color: @cde-spell;
box-shadow: 0 0 8px fade(@cde-spell, 30%);
}
&--tinji:hover {
background: fade(@cde-kungfu, 10%);
border-color: @cde-kungfu;
color: @cde-kungfu;
box-shadow: 0 0 8px fade(@cde-kungfu, 30%);
}
}
}
// ============================================================
// Loksyu standalone app
// ============================================================
.cde-loksyu-standalone {
.cde-loksyu-app-body {
padding: 12px;
}
.cde-loksyu-elements {
display: grid;
grid-template-columns: repeat(5, 1fr);
gap: 8px;
margin-bottom: 12px;
}
.cde-lok-card {
background: fade(@cde-surface, 80%);
border: 1px solid @cde-border;
border-radius: 6px;
padding: 8px 6px;
display: flex;
flex-direction: column;
gap: 6px;
transition: border-color 0.2s;
&--wood { &:hover { border-color: #4a9e3f; } .cde-lok-input:focus { border-bottom-color: #4a9e3f; } }
&--fire { &:hover { border-color: @cde-kungfu; } .cde-lok-input:focus { border-bottom-color: @cde-kungfu; } }
&--earth { &:hover { border-color: #c88a3a; } .cde-lok-input:focus { border-bottom-color: #c88a3a; } }
&--metal { &:hover { border-color: @cde-muted; } .cde-lok-input:focus { border-bottom-color: @cde-muted; } }
&--water { &:hover { border-color: @cde-spell; } .cde-lok-input:focus { border-bottom-color: @cde-spell; } }
}
.cde-lok-header {
display: flex;
align-items: center;
gap: 6px;
img.cde-lok-icon { border-radius: 4px; flex-shrink: 0; }
}
.cde-lok-titles {
flex: 1 1 0;
min-width: 0;
display: flex;
flex-direction: column;
.cde-lok-name {
font-size: 10px;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.08em;
color: @cde-text;
}
.cde-lok-qual {
font-size: 9px;
color: @cde-muted;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
.cde-lok-reset {
color: @cde-muted;
font-size: 11px;
flex-shrink: 0;
cursor: pointer;
&:hover { color: @cde-text; }
}
.cde-lok-values {
display: flex;
flex-direction: column;
gap: 4px;
}
.cde-lok-polarity {
display: flex;
align-items: center;
gap: 4px;
.cde-lok-pol-label {
font-size: 9px;
color: @cde-muted;
width: 30px;
flex-shrink: 0;
}
&--yang .cde-lok-pol-label { color: @cde-text; }
}
.cde-lok-input {
flex: 1 1 0;
background: transparent;
border: none;
border-bottom: 1px solid @cde-border;
color: @cde-text;
font-size: 13px;
font-weight: 700;
text-align: center;
padding: 2px 0;
transition: border-bottom-color 0.2s;
width: 100%;
&:focus { outline: none; }
&[disabled] { opacity: 0.5; cursor: default; }
}
.cde-loksyu-visual-row {
text-align: center;
margin: 6px 0;
.cde-lok-visual {
max-width: 100%;
max-height: 80px;
opacity: 0.6;
}
}
.cde-lok-footer {
display: flex;
justify-content: center;
padding-top: 6px;
border-top: 1px solid @cde-border;
margin-top: 6px;
}
.cde-lok-reset-all {
display: flex;
align-items: center;
gap: 6px;
padding: 5px 14px;
font-size: 11px;
background: fade(@cde-kungfu, 12%);
border: 1px solid fade(@cde-kungfu, 30%);
border-radius: 4px;
color: @cde-muted;
cursor: pointer;
transition: all 0.2s;
&:hover {
background: fade(@cde-kungfu, 20%);
border-color: @cde-kungfu;
color: @cde-text;
}
}
}
// ============================================================
// TinJi standalone app
// ============================================================
.cde-tinji-standalone {
.cde-tinji-app-body {
padding: 16px 12px;
display: flex;
align-items: center;
gap: 16px;
}
.cde-tinji-display {
flex: 1 1 0;
display: flex;
flex-direction: column;
align-items: center;
gap: 8px;
}
.cde-tinji-chinese-large {
font-size: 40px;
color: @cde-kungfu;
text-shadow: 0 0 20px fade(@cde-kungfu, 60%);
line-height: 1;
font-family: serif;
}
.cde-tinji-label {
font-size: 10px;
font-family: "Orbitron", sans-serif;
text-transform: uppercase;
letter-spacing: 0.12em;
color: @cde-muted;
}
.cde-tinji-counter {
display: flex;
align-items: center;
gap: 8px;
margin: 4px 0;
}
.cde-tinji-step {
width: 28px;
height: 28px;
background: @cde-surface;
border: 1px solid @cde-border;
border-radius: 50%;
color: @cde-muted;
font-size: 18px;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.2s;
line-height: 1;
padding: 0;
&:hover {
background: fade(@cde-kungfu, 15%);
border-color: @cde-kungfu;
color: @cde-kungfu;
}
}
.cde-tinji-direct {
width: 72px;
background: transparent;
border: none;
border-bottom: 2px solid @cde-kungfu;
color: @cde-kungfu;
font-size: 36px;
font-weight: 700;
text-align: center;
text-shadow: 0 0 12px fade(@cde-kungfu, 50%);
padding: 0;
&:focus { outline: none; }
&[disabled] { opacity: 0.7; cursor: default; }
}
.cde-tinji-hint {
font-size: 10px;
color: @cde-muted;
text-align: center;
}
.cde-tinji-actions {
display: flex;
gap: 6px;
margin-top: 6px;
}
.cde-tinji-spend-btn,
.cde-tinji-reset-btn {
display: flex;
align-items: center;
gap: 5px;
padding: 5px 12px;
font-size: 11px;
border-radius: 4px;
cursor: pointer;
transition: all 0.2s;
}
.cde-tinji-spend-btn {
background: fade(@cde-kungfu, 15%);
border: 1px solid @cde-kungfu;
color: @cde-kungfu;
&:hover { background: fade(@cde-kungfu, 30%); }
&[disabled] { opacity: 0.4; cursor: not-allowed; pointer-events: none; }
}
.cde-tinji-reset-btn {
background: @cde-surface;
border: 1px solid @cde-border;
color: @cde-muted;
&:hover { border-color: @cde-text; color: @cde-text; }
}
.cde-tinji-visual {
width: 90px;
height: auto;
opacity: 0.6;
flex-shrink: 0;
}
}
// Chat Tin Ji spend message
.cde-tinji-spend-msg {
display: flex;
align-items: center;
gap: 6px;
font-size: 12px;
padding: 6px 8px;
background: fade(@cde-kungfu, 8%);
border-left: 3px solid @cde-kungfu;
border-radius: 4px;
color: @cde-text;
i { color: @cde-kungfu; }
.cde-tinji-remain {
margin-left: auto;
font-size: 10px;
color: @cde-muted;
}
}
.cde-loksyu-grid {
display: grid;
grid-template-columns: repeat(5, minmax(0, 1fr));