fix: placement boutons Tarot/Actions/Épreuve dans le chat FVTT v14

- insertion en haut de #chat (avant sidebar-tab-core) au lieu
  d'insérer avant #chat-controls (caché par le scroll en v14)
- remplacement inline styles → classes CSS .hamalron-chat-tools/.hamalron-chat-btn
- CSS externalisé dans chat.less
This commit is contained in:
2026-07-23 22:22:11 +02:00
parent a468a35e4f
commit b35b0809d4
6 changed files with 64 additions and 8 deletions
+25
View File
@@ -3151,6 +3151,31 @@ i.fvtt-hamalron {
text-transform: uppercase;
letter-spacing: 2px;
}
/* Chat sidebar tools (Tarot, Actions, Épreuve) */
.hamalron-chat-tools {
flex: 0 0 auto;
display: flex;
gap: 4px;
padding: 4px 8px;
border-bottom: 1px solid #444;
flex-wrap: wrap;
}
.hamalron-chat-btn {
display: flex;
align-items: center;
gap: 4px;
padding: 3px 8px;
background: #2a2a4a;
color: #e0e0e0;
border: 1px solid #555;
border-radius: 4px;
cursor: pointer;
font-size: 11px;
white-space: nowrap;
}
.hamalron-chat-btn:hover {
background: #3a3a6a;
}
.application.dialog.fvtt-hamalron {
color: var(--color-dark-1);
background-color: var(--color-light-1);
+10 -7
View File
@@ -210,22 +210,19 @@ Hooks.on("getSceneControlButtons", (controls) => {
// Add system buttons to the chat sidebar
function addChatTools() {
const controls = document.querySelector("#chat-controls")
if (!controls || controls.querySelector(".hamalron-chat-tools")) return
const chatEl = document.querySelector("#chat")
if (!chatEl || chatEl.querySelector(".hamalron-chat-tools")) return
const tools = document.createElement("div")
tools.className = "hamalron-chat-tools"
tools.style.cssText = "display:flex;gap:4px;padding:4px 8px;border-bottom:1px solid #444;margin-bottom:2px;flex-wrap:wrap"
const addBtn = (icon, label, title, onClick) => {
const btn = document.createElement("button")
btn.type = "button"
btn.style.cssText = "display:flex;align-items:center;gap:4px;padding:3px 8px;background:#2a2a4a;color:#e0e0e0;border:1px solid #555;border-radius:4px;cursor:pointer;font-size:11px;white-space:nowrap"
btn.className = "hamalron-chat-btn"
btn.innerHTML = `<i class="${icon}"></i> <span>${label}</span>`
btn.title = title
btn.addEventListener("click", onClick)
btn.addEventListener("mouseenter", () => { btn.style.background = "#3a3a6a" })
btn.addEventListener("mouseleave", () => { btn.style.background = "#2a2a4a" })
tools.appendChild(btn)
}
@@ -244,7 +241,13 @@ function addChatTools() {
await HamalronTirageTarot.promptEpreuve(actor)
})
controls.parentNode.insertBefore(tools, controls)
// Insérer en haut de #chat (avant le sidebar-tab-core)
const firstChild = chatEl.firstElementChild
if (firstChild) {
chatEl.insertBefore(tools, firstChild)
} else {
chatEl.appendChild(tools)
}
}
Hooks.on("renderChatLog", () => setTimeout(addChatTools, 0))
+1 -1
View File
@@ -1 +1 @@
MANIFEST-000006
MANIFEST-000011
Binary file not shown.
Binary file not shown.
+28
View File
@@ -959,3 +959,31 @@
letter-spacing: 2px;
}
}
/* Chat sidebar tools (Tarot, Actions, Épreuve) */
.hamalron-chat-tools {
flex: 0 0 auto;
display: flex;
gap: 4px;
padding: 4px 8px;
border-bottom: 1px solid #444;
flex-wrap: wrap;
}
.hamalron-chat-btn {
display: flex;
align-items: center;
gap: 4px;
padding: 3px 8px;
background: #2a2a4a;
color: #e0e0e0;
border: 1px solid #555;
border-radius: 4px;
cursor: pointer;
font-size: 11px;
white-space: nowrap;
&:hover {
background: #3a3a6a;
}
}