diff --git a/index.css b/index.css
index 49ecd8f0..b36a0716 100644
--- a/index.css
+++ b/index.css
@@ -2388,6 +2388,21 @@ svg.button {
}
}
+#chat-widget-minimized {
+ animation: fadeIn 1s ease-in;
+ transform: scale(0.65);
+ opacity: var(--bg-opacity);
+}
+
+@keyframes fadeIn {
+ from {
+ opacity: 0;
+ }
+ to {
+ opacity: var(--bg-opacity);
+ }
+}
+
@media print {
div,
canvas {
diff --git a/index.html b/index.html
index 3c4d525b..e3154e9e 100644
--- a/index.html
+++ b/index.html
@@ -138,7 +138,7 @@
}
-
+
@@ -1827,6 +1827,16 @@
|
+
+ |
+ Azgaar assistant |
+
+ |
+
+
|
Speaker voice |
@@ -8062,10 +8072,9 @@
-
-
-
-
+
+
+
diff --git a/libs/openwidget.min.js b/libs/openwidget.min.js
new file mode 100644
index 00000000..89583d8f
--- /dev/null
+++ b/libs/openwidget.min.js
@@ -0,0 +1 @@
+window.__ow=window.__ow||{},window.__ow.organizationId="7bb02e70-bcef-4861-a4e6-d259b0d10e24",window.__ow.integration_name="manual_settings",window.__ow.product_name="openwidget",function(n,e,t){function o(n){return c._h?c._h.apply(null,n):c._q.push(n)}var c={_q:[],_h:null,_v:"2.0",on:function(){o(["on",t.call(arguments)])},once:function(){o(["once",t.call(arguments)])},off:function(){o(["off",t.call(arguments)])},get:function(){if(!c._h)throw Error("[OpenWidget] You can't use getters before load.");return o(["get",t.call(arguments)])},call:function(){o(["call",t.call(arguments)])},init:function(){var n=e.createElement("script");n.async=!0,n.type="text/javascript",n.src="https://cdn.openwidget.com/openwidget.js",e.head.appendChild(n)}};n.__ow.asyncInit||c.init(),n.OpenWidget=n.OpenWidget||c}(window,document,[].slice);
\ No newline at end of file
diff --git a/main.js b/main.js
index ca6f1ca1..eeff1f71 100644
--- a/main.js
+++ b/main.js
@@ -317,7 +317,8 @@ async function generateMapOnLoad() {
applyLayersPreset(); // apply saved layers preset and reder layers
drawLayers();
fitMapToScreen();
- focusOn(); // focus on point, cell or burg from MFCG based on url searchParams
+ focusOn(); // based on searchParams focus on point, cell or burg from MFCG
+ toggleAssistant();
}
// focus on coordinates, cell or burg provided in searchParams
@@ -367,6 +368,31 @@ function focusOn() {
}
}
+let isAssistantLoaded = false;
+function toggleAssistant() {
+ const assistantContainer = byId("chat-widget-container");
+ const showAssistant = byId("azgaarAssistant").value === "show";
+
+ if (showAssistant) {
+ 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";
+ }
+}
+
// find burg for MFCG and focus on it
function findBurgForMFCG(params) {
const cells = pack.cells,
diff --git a/modules/ui/options.js b/modules/ui/options.js
index a6640aed..1ac4c8ad 100644
--- a/modules/ui/options.js
+++ b/modules/ui/options.js
@@ -148,6 +148,7 @@ optionsContent.addEventListener("change", event => {
else if (id === "yearInput") changeYear();
else if (id === "eraInput") changeEra();
else if (id === "stateLabelsModeInput") options.stateLabelsMode = value;
+ else if (id === "azgaarAssistant") toggleAssistant();
});
optionsContent.addEventListener("click", event => {
@@ -446,6 +447,7 @@ function changeDialogsTheme(themeColor, transparency) {
};
const theme = [
+ {name: "--bg-opacity", value: alpha},
{name: "--bg-main", h, s, l, alpha},
{name: "--bg-lighter", h, s, l: l + 0.02, alpha},
{name: "--bg-light", h, s: s - 0.02, l: l + 0.06, alpha},
@@ -458,8 +460,9 @@ function changeDialogsTheme(themeColor, transparency) {
];
const sx = document.documentElement.style;
- theme.forEach(({name, h, s, l, alpha}) => {
- sx.setProperty(name, getRGBA(h, s, l, alpha));
+ theme.forEach(({name, value, h, s, l, alpha}) => {
+ if (value !== undefined) sx.setProperty(name, value);
+ else sx.setProperty(name, getRGBA(h, s, l, alpha));
});
}
diff --git a/versioning.js b/versioning.js
index bf3deac2..afa76381 100644
--- a/versioning.js
+++ b/versioning.js
@@ -12,7 +12,7 @@
*
* Example: 1.102.2 -> Major version 1, Minor version 102, Patch version 2
*/
-const VERSION = "1.104.15";
+const VERSION = "1.105.0";
if (parseMapVersion(VERSION) !== VERSION) alert("versioning.js: Invalid format or parsing function");
{
@@ -36,6 +36,7 @@ if (parseMapVersion(VERSION) !== VERSION) alert("versioning.js: Invalid format o
Latest changes:
+ - Azgaar Bot to answer questions and provide help
- Labels: ability to set letter spacing
- Zones update
- Notes Editor: on-demand AI text generation