mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-18 18:11:24 +01:00
feat: assistant - minify js, add option UI
This commit is contained in:
parent
6a0ee5827e
commit
cb34491a17
4 changed files with 31 additions and 41 deletions
13
index.css
13
index.css
|
|
@ -2400,6 +2400,19 @@ svg.button {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#chat-widget-container {
|
||||||
|
animation: fadeIn 1s ease-in;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes fadeIn {
|
||||||
|
from {
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
to {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@media print {
|
@media print {
|
||||||
div,
|
div,
|
||||||
canvas {
|
canvas {
|
||||||
|
|
|
||||||
51
index.html
51
index.html
|
|
@ -1835,6 +1835,16 @@
|
||||||
<td></td>
|
<td></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
<tr data-tip="Toggle Azgaar Assistant (help bubble on the bottom right corner)">
|
||||||
|
<td></td>
|
||||||
|
<td>Azgaar assistant</td>
|
||||||
|
<td>
|
||||||
|
<select id="azgaarAssistant" data-stored="azgaarAssistant">
|
||||||
|
<option value="show" selected>Show</option>
|
||||||
|
<option value="hide">Hide</option>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
<tr data-tip="Select speech synthesis voice to pronounce generated names">
|
<tr data-tip="Select speech synthesis voice to pronounce generated names">
|
||||||
<td></td>
|
<td></td>
|
||||||
<td>Speaker voice</td>
|
<td>Speaker voice</td>
|
||||||
|
|
@ -8097,46 +8107,5 @@
|
||||||
<script defer src="modules/io/load.js?v=1.100.00"></script>
|
<script defer src="modules/io/load.js?v=1.100.00"></script>
|
||||||
<script defer src="modules/io/cloud.js?v=1.99.00"></script>
|
<script defer src="modules/io/cloud.js?v=1.99.00"></script>
|
||||||
<script defer src="modules/io/export.js?v=1.99.14"></script>
|
<script defer src="modules/io/export.js?v=1.99.14"></script>
|
||||||
|
|
||||||
<script defer>
|
|
||||||
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, t, c) {
|
|
||||||
function i(n) {
|
|
||||||
return e._h ? e._h.apply(null, n) : e._q.push(n);
|
|
||||||
}
|
|
||||||
var e = {
|
|
||||||
_q: [],
|
|
||||||
_h: null,
|
|
||||||
_v: "2.0",
|
|
||||||
on: function () {
|
|
||||||
i(["on", c.call(arguments)]);
|
|
||||||
},
|
|
||||||
once: function () {
|
|
||||||
i(["once", c.call(arguments)]);
|
|
||||||
},
|
|
||||||
off: function () {
|
|
||||||
i(["off", c.call(arguments)]);
|
|
||||||
},
|
|
||||||
get: function () {
|
|
||||||
if (!e._h) throw new Error("[OpenWidget] You can't use getters before load.");
|
|
||||||
return i(["get", c.call(arguments)]);
|
|
||||||
},
|
|
||||||
call: function () {
|
|
||||||
i(["call", c.call(arguments)]);
|
|
||||||
},
|
|
||||||
init: function () {
|
|
||||||
var n = t.createElement("script");
|
|
||||||
(n.async = !0),
|
|
||||||
(n.type = "text/javascript"),
|
|
||||||
(n.src = "https://cdn.openwidget.com/openwidget.js"),
|
|
||||||
t.head.appendChild(n);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
!n.__ow.asyncInit && e.init(), (n.OpenWidget = n.OpenWidget || e);
|
|
||||||
})(window, document, [].slice);
|
|
||||||
</script>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
1
libs/openwidget.min.js
vendored
Normal file
1
libs/openwidget.min.js
vendored
Normal file
|
|
@ -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);
|
||||||
7
main.js
7
main.js
|
|
@ -251,6 +251,7 @@ document.addEventListener("DOMContentLoaded", async () => {
|
||||||
}
|
}
|
||||||
restoreDefaultEvents(); // apply default viewbox events
|
restoreDefaultEvents(); // apply default viewbox events
|
||||||
initiateAutosave();
|
initiateAutosave();
|
||||||
|
setTipMessage();
|
||||||
});
|
});
|
||||||
|
|
||||||
function hideLoading() {
|
function hideLoading() {
|
||||||
|
|
@ -316,6 +317,7 @@ async function generateMapOnLoad() {
|
||||||
applyPreset(); // apply saved layers preset
|
applyPreset(); // apply saved layers preset
|
||||||
fitMapToScreen();
|
fitMapToScreen();
|
||||||
focusOn(); // based on searchParams focus on point, cell or burg from MFCG
|
focusOn(); // based on searchParams focus on point, cell or burg from MFCG
|
||||||
|
loadAssistant();
|
||||||
}
|
}
|
||||||
|
|
||||||
// focus on coordinates, cell or burg provided in searchParams
|
// focus on coordinates, cell or burg provided in searchParams
|
||||||
|
|
@ -365,6 +367,11 @@ function focusOn() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function loadAssistant() {
|
||||||
|
const showAssistant = byId("azgaarAssistant").value === "show";
|
||||||
|
if (showAssistant) import("./libs/openwidget.min.js");
|
||||||
|
}
|
||||||
|
|
||||||
// find burg for MFCG and focus on it
|
// find burg for MFCG and focus on it
|
||||||
function findBurgForMFCG(params) {
|
function findBurgForMFCG(params) {
|
||||||
const cells = pack.cells,
|
const cells = pack.cells,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue