mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-19 10:31:24 +01:00
feat: ai widget - improve style
This commit is contained in:
parent
d94defaa18
commit
85a6bc9c66
5 changed files with 24 additions and 7 deletions
16
main.js
16
main.js
|
|
@ -374,8 +374,20 @@ function toggleAssistant() {
|
|||
const showAssistant = byId("azgaarAssistant").value === "show";
|
||||
|
||||
if (showAssistant) {
|
||||
if (isAssistantLoaded) assistantContainer.style.display = "block";
|
||||
else import("./libs/openwidget.min.js").then(() => (isAssistantLoaded = true));
|
||||
if (isAssistantLoaded) {
|
||||
assistantContainer.style.display = "block";
|
||||
} else {
|
||||
import("./libs/openwidget.min.js").then(() => {
|
||||
isAssistantLoaded = true;
|
||||
setTimeout(() => {
|
||||
const bubble = byId("chat-widget-minimized");
|
||||
if (bubble) {
|
||||
bubble.dataset.tip = "Click to open the Assistant";
|
||||
bubble.on("mouseover", showDataTip);
|
||||
}
|
||||
}, 5000);
|
||||
});
|
||||
}
|
||||
} else if (isAssistantLoaded) {
|
||||
assistantContainer.style.display = "none";
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue