@open-slot-ui/pixi 0.7.1 → 0.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +527 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +41 -1
- package/dist/index.d.ts +41 -1
- package/dist/index.js +527 -12
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -3985,9 +3985,294 @@ var PanelBodyView = class extends ControlView {
|
|
|
3985
3985
|
super.dispose();
|
|
3986
3986
|
}
|
|
3987
3987
|
};
|
|
3988
|
+
var esc = (s) => s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
3989
|
+
var rich = (s) => esc(s).replace(/\*\*(.+?)\*\*/g, "<b>$1</b>");
|
|
3990
|
+
function renderBlocks(blocks, tr) {
|
|
3991
|
+
const out = [];
|
|
3992
|
+
for (const b of blocks) {
|
|
3993
|
+
switch (b.kind) {
|
|
3994
|
+
case "text":
|
|
3995
|
+
out.push(`<p>${rich(tr(b.text))}</p>`);
|
|
3996
|
+
break;
|
|
3997
|
+
case "heading":
|
|
3998
|
+
out.push(`<div class="ohm-sec"><span>${esc(tr(b.text))}</span></div>`);
|
|
3999
|
+
break;
|
|
4000
|
+
case "subheading":
|
|
4001
|
+
out.push(`<h4 class="ohm-subh">${esc(tr(b.text))}</h4>`);
|
|
4002
|
+
break;
|
|
4003
|
+
case "legal":
|
|
4004
|
+
out.push(`<p class="ohm-legal">${rich(tr(b.text))}</p>`);
|
|
4005
|
+
break;
|
|
4006
|
+
case "divider":
|
|
4007
|
+
out.push('<hr class="ohm-hr">');
|
|
4008
|
+
break;
|
|
4009
|
+
case "image":
|
|
4010
|
+
out.push(`<img class="ohm-feature" alt="${esc(tr(b.alt ?? ""))}" src="${b.src}" loading="lazy">`);
|
|
4011
|
+
break;
|
|
4012
|
+
case "media": {
|
|
4013
|
+
const img = `<img alt="${esc(tr(b.alt ?? ""))}" src="${b.src}" loading="lazy">`;
|
|
4014
|
+
const body = `<div class="ohm-media-body">${b.title ? `<h4>${esc(tr(b.title))}</h4>` : ""}<p>${rich(tr(b.text))}</p></div>`;
|
|
4015
|
+
out.push(`<div class="ohm-media ohm-media--${b.side ?? "left"}">${img}${body}</div>`);
|
|
4016
|
+
break;
|
|
4017
|
+
}
|
|
4018
|
+
case "cards": {
|
|
4019
|
+
const cards = b.items.map((it) => `<div class="ohm-fcard">${it.icon ? `<img src="${it.icon}" alt="" loading="lazy">` : ""}<h5>${esc(tr(it.title))}</h5>${it.text ? `<p>${rich(tr(it.text))}</p>` : ""}</div>`).join("");
|
|
4020
|
+
out.push(`<div class="ohm-cards">${cards}</div>`);
|
|
4021
|
+
break;
|
|
4022
|
+
}
|
|
4023
|
+
case "paytable":
|
|
4024
|
+
out.push(`<div class="ohm-grid">${renderPaytable(b.rows, tr)}</div>`);
|
|
4025
|
+
break;
|
|
4026
|
+
case "table": {
|
|
4027
|
+
const head = b.columns?.length ? `<thead><tr>${b.columns.map((c) => `<th>${esc(tr(c))}</th>`).join("")}</tr></thead>` : "";
|
|
4028
|
+
const body = b.rows.map((r) => `<tr>${r.map((c) => `<td>${esc(tr(c))}</td>`).join("")}</tr>`).join("");
|
|
4029
|
+
out.push(`<table class="ohm-table">${head}<tbody>${body}</tbody></table>`);
|
|
4030
|
+
break;
|
|
4031
|
+
}
|
|
4032
|
+
case "stat-grid": {
|
|
4033
|
+
const rows = b.items.map((it) => `<div><dt>${esc(tr(it.label))}</dt><dd>${esc(tr(it.value))}</dd></div>`).join("");
|
|
4034
|
+
out.push(`<dl class="ohm-stats">${rows}</dl>`);
|
|
4035
|
+
break;
|
|
4036
|
+
}
|
|
4037
|
+
case "steps": {
|
|
4038
|
+
const items = b.items.map((s) => `<li>${rich(tr(s))}</li>`).join("");
|
|
4039
|
+
out.push(b.ordered ? `<ol class="ohm-steps">${items}</ol>` : `<ul class="ohm-steps">${items}</ul>`);
|
|
4040
|
+
break;
|
|
4041
|
+
}
|
|
4042
|
+
case "callout":
|
|
4043
|
+
out.push(`<div class="ohm-callout ohm-callout--${b.tone ?? "info"}">${b.title ? `<b>${esc(tr(b.title))}</b>` : ""}<p>${rich(tr(b.text))}</p></div>`);
|
|
4044
|
+
break;
|
|
4045
|
+
case "group":
|
|
4046
|
+
out.push(`<div class="ohm-group">${b.title ? `<h4 class="ohm-subh">${esc(tr(b.title))}</h4>` : ""}${renderBlocks(b.children, tr)}</div>`);
|
|
4047
|
+
break;
|
|
4048
|
+
}
|
|
4049
|
+
}
|
|
4050
|
+
return out.join("\n");
|
|
4051
|
+
}
|
|
4052
|
+
function renderPaytable(rows, tr) {
|
|
4053
|
+
return rows.map((r) => {
|
|
4054
|
+
const icon = r.icon ? `<img class="ohm-symimg" src="${r.icon}" alt="" loading="lazy">` : `<span class="ohm-emoji">${esc(tr(r.symbol ?? ""))}</span>`;
|
|
4055
|
+
const lines = r.payouts.split("\n").map((line) => {
|
|
4056
|
+
const i = line.indexOf(":");
|
|
4057
|
+
return i >= 0 ? `<div><b>${esc(line.slice(0, i))}</b><span>${esc(line.slice(i + 1))}</span></div>` : `<div><span>${esc(line)}</span></div>`;
|
|
4058
|
+
}).join("");
|
|
4059
|
+
return `<div class="ohm-sym">${icon}<div class="ohm-pay">${lines}</div></div>`;
|
|
4060
|
+
}).join("");
|
|
4061
|
+
}
|
|
4062
|
+
function renderSettingBlock(b, tr) {
|
|
4063
|
+
const hint = "hint" in b && b.hint ? `<div class="ohm-hint">${esc(tr(b.hint))}</div>` : "";
|
|
4064
|
+
const label = "label" in b && b.label ? esc(tr(b.label)) : "";
|
|
4065
|
+
switch (b.kind) {
|
|
4066
|
+
case "toggle":
|
|
4067
|
+
return `<div class="ohm-setting"><label class="ohm-row ohm-check"><span>${label}</span><span class="ohm-ctl"><input data-set="${b.id}" type="checkbox"${b.on ? " checked" : ""}></span></label>${hint}</div>`;
|
|
4068
|
+
case "slider":
|
|
4069
|
+
return `<div class="ohm-setting"><label class="ohm-row"><span>${label}</span><input data-set="${b.id}" type="range" min="0" max="1" step="0.01" value="${b.initial ?? 1}"></label>${hint}</div>`;
|
|
4070
|
+
case "select": {
|
|
4071
|
+
const opts = b.options.map((o, i) => `<option value="${esc(o.value)}"${i === (b.index ?? 0) ? " selected" : ""}>${esc(tr(o.label))}</option>`).join("");
|
|
4072
|
+
return `<div class="ohm-setting"><label class="ohm-row"><span>${label}</span><select data-set="${b.id}">${opts}</select></label>${hint}</div>`;
|
|
4073
|
+
}
|
|
4074
|
+
default:
|
|
4075
|
+
return "";
|
|
4076
|
+
}
|
|
4077
|
+
}
|
|
4078
|
+
function mountInfoMenu(app, ui) {
|
|
4079
|
+
const menu = ui.spec?.menu ?? {};
|
|
4080
|
+
const tr = (k) => ui.t(k);
|
|
4081
|
+
const disposers = [];
|
|
4082
|
+
const host2 = document.createElement("div");
|
|
4083
|
+
host2.className = "ohm-root";
|
|
4084
|
+
const vars = {
|
|
4085
|
+
"--accent": "#d99000",
|
|
4086
|
+
"--accent-text": "#1a1200",
|
|
4087
|
+
"--surface": "#ffffff",
|
|
4088
|
+
"--surface-alt": "#eef1f6",
|
|
4089
|
+
"--text": "#181b20",
|
|
4090
|
+
"--text-dim": "#5b6472",
|
|
4091
|
+
"--card-radius": "8px",
|
|
4092
|
+
"--font": ui.theme.type.family
|
|
4093
|
+
};
|
|
4094
|
+
for (const [k, v] of Object.entries(vars)) host2.style.setProperty(k, v);
|
|
4095
|
+
const locales = ui.spec?.locale ? Array.from(/* @__PURE__ */ new Set([ui.spec.locale.locale, ...Object.keys(ui.spec.locale.messages)])) : [];
|
|
4096
|
+
const langRow = locales.length > 1 ? `<div class="ohm-setting"><label class="ohm-row"><span>${tr("Language")}</span><select id="ohm-lang">${locales.map((c) => `<option value="${c}"${c === ui.locale.get() ? " selected" : ""}>${esc(core.LOCALE_LABELS[c] ?? c)}</option>`).join("")}</select></label></div>` : "";
|
|
4097
|
+
const turbo = ui.turbo;
|
|
4098
|
+
const cap = (m) => m.charAt(0).toUpperCase() + m.slice(1);
|
|
4099
|
+
const turboCtl = turbo.modeCount <= 2 ? `<span class="ohm-ctl"><input id="ohm-turbo" type="checkbox"></span>` : `<span class="ohm-ctl"><div class="ohm-segmented" id="ohm-turbo-seg">${turbo.modes.map((m, i) => `<button class="ohm-seg" data-i="${i}">${esc(tr(cap(m)))}</button>`).join("")}</div></span>`;
|
|
4100
|
+
const customSettings = (menu.settings ?? []).map((b) => renderSettingBlock(b, tr)).join("");
|
|
4101
|
+
const soundMode = menu.sound ?? "sliders";
|
|
4102
|
+
const volRow = (id, label, hint, val) => `<div class="ohm-setting"><label class="ohm-row"><span>${esc(tr(label))}</span><input class="ohm-slider" data-vol="${id}" type="range" min="0" max="1" step="0.01" value="${val}"></label><div class="ohm-hint">${esc(tr(hint))}</div></div>`;
|
|
4103
|
+
const soundSliders = soundMode === "master" ? volRow("master", "Volume", "Adjust the overall game volume.", ui.sfxSlider.value.get()) : soundMode === "sliders" ? volRow("music", "Music", "Adjust the background music volume.", ui.musicSlider.value.get()) + volRow("sfx", "Effects", "Adjust the sound-effects volume.", ui.sfxSlider.value.get()) : "";
|
|
4104
|
+
const paytableHtml = menu.paytable ? renderBlocks(menu.paytable, tr) : "";
|
|
4105
|
+
const rulesHtml = menu.rules ? renderBlocks(menu.rules, tr) : "";
|
|
4106
|
+
const banner = menu.banner ? `<img class="ohm-logo" alt="" src="${menu.banner.src}"${menu.banner.width ? ` width="${menu.banner.width}"` : ""}${menu.banner.height ? ` height="${menu.banner.height}"` : ""}>` : ui.gameInfo.name ? `<h1 class="ohm-logo-text">${esc(ui.gameInfo.name)}</h1>` : "";
|
|
4107
|
+
host2.innerHTML = `
|
|
4108
|
+
<div class="ohm-backdrop" data-close></div>
|
|
4109
|
+
<button class="ohm-x" data-close aria-label="Close">\u2715</button>
|
|
4110
|
+
<div class="ohm-card" role="dialog" aria-modal="true">
|
|
4111
|
+
<div class="ohm-body">
|
|
4112
|
+
${banner}
|
|
4113
|
+
<div class="ohm-sec"><span>${tr("Settings")}</span></div>
|
|
4114
|
+
<div class="ohm-setting"><label class="ohm-row ohm-check"><span>${tr("Sound")}</span><span class="ohm-ctl"><input id="ohm-sound" type="checkbox" checked></span></label><div class="ohm-hint">${tr("Turn all game sound and music on or off.")}</div></div>
|
|
4115
|
+
${soundSliders}
|
|
4116
|
+
${langRow}
|
|
4117
|
+
<div class="ohm-setting"><div class="ohm-row ohm-check"><span>${tr("Quick spin")}</span>${turboCtl}</div><div class="ohm-hint">${tr("Speed up rounds by shortening the animation. The result is identical.")}</div></div>
|
|
4118
|
+
${customSettings}
|
|
4119
|
+
${paytableHtml ? `<div class="ohm-sec"><span>${tr("Paytable")}</span></div>${paytableHtml}` : ""}
|
|
4120
|
+
${rulesHtml ? `<div class="ohm-sec"><span>${tr("Rules")}</span></div><div class="ohm-rules" id="ohm-rules">${rulesHtml}</div>` : ""}
|
|
4121
|
+
</div>
|
|
4122
|
+
</div>`;
|
|
4123
|
+
const style = document.createElement("style");
|
|
4124
|
+
style.textContent = OHM_CSS;
|
|
4125
|
+
host2.appendChild(style);
|
|
4126
|
+
document.body.appendChild(host2);
|
|
4127
|
+
const $ = (sel) => host2.querySelector(sel);
|
|
4128
|
+
const sound = $("#ohm-sound");
|
|
4129
|
+
if (sound) {
|
|
4130
|
+
sound.checked = !ui.muted.get();
|
|
4131
|
+
sound.addEventListener("change", () => ui.setMuted(!sound.checked));
|
|
4132
|
+
disposers.push(ui.muted.subscribe((m) => {
|
|
4133
|
+
sound.checked = !m;
|
|
4134
|
+
}));
|
|
4135
|
+
}
|
|
4136
|
+
host2.querySelectorAll("[data-vol]").forEach((el) => {
|
|
4137
|
+
const which = el.dataset.vol;
|
|
4138
|
+
el.addEventListener("input", () => {
|
|
4139
|
+
const v = Number(el.value);
|
|
4140
|
+
if (which === "music") ui.musicSlider.setNormalized(v);
|
|
4141
|
+
else if (which === "sfx") ui.sfxSlider.setNormalized(v);
|
|
4142
|
+
else {
|
|
4143
|
+
ui.musicSlider.setNormalized(v);
|
|
4144
|
+
ui.sfxSlider.setNormalized(v);
|
|
4145
|
+
}
|
|
4146
|
+
});
|
|
4147
|
+
const src = which === "music" ? ui.musicSlider : ui.sfxSlider;
|
|
4148
|
+
disposers.push(src.value.subscribe((v) => {
|
|
4149
|
+
el.value = String(v);
|
|
4150
|
+
}));
|
|
4151
|
+
});
|
|
4152
|
+
const lang = $("#ohm-lang");
|
|
4153
|
+
if (lang) lang.addEventListener("change", () => ui.setLocale(lang.value));
|
|
4154
|
+
if (turbo.modeCount <= 2) {
|
|
4155
|
+
const tg = $("#ohm-turbo");
|
|
4156
|
+
if (tg) {
|
|
4157
|
+
tg.checked = turbo.isOn;
|
|
4158
|
+
tg.addEventListener("change", () => turbo.set(tg.checked));
|
|
4159
|
+
disposers.push(turbo.index.subscribe(() => {
|
|
4160
|
+
tg.checked = turbo.isOn;
|
|
4161
|
+
}));
|
|
4162
|
+
}
|
|
4163
|
+
} else {
|
|
4164
|
+
const segs = Array.from(host2.querySelectorAll(".ohm-seg"));
|
|
4165
|
+
segs.forEach((b) => b.addEventListener("click", () => turbo.setIndex(Number(b.dataset.i))));
|
|
4166
|
+
const sync = () => segs.forEach((b, i) => b.classList.toggle("active", i === turbo.index.get()));
|
|
4167
|
+
disposers.push(turbo.index.subscribe(sync));
|
|
4168
|
+
sync();
|
|
4169
|
+
}
|
|
4170
|
+
host2.querySelectorAll("[data-set]").forEach((el) => {
|
|
4171
|
+
const id = el.dataset.set;
|
|
4172
|
+
if (el instanceof HTMLInputElement && el.type === "checkbox") el.addEventListener("change", () => ui.bus.emit("toggled", { id, on: el.checked }));
|
|
4173
|
+
else if (el instanceof HTMLInputElement && el.type === "range") el.addEventListener("input", () => ui.bus.emit("valueChanged", { id, value: Number(el.value) }));
|
|
4174
|
+
else if (el instanceof HTMLSelectElement) el.addEventListener("change", () => ui.bus.emit("optionSelected", { id, value: el.value, index: el.selectedIndex }));
|
|
4175
|
+
});
|
|
4176
|
+
host2.querySelectorAll("[data-close]").forEach((b) => b.addEventListener("click", () => ui.settingsPanel.closePanel()));
|
|
4177
|
+
disposers.push(
|
|
4178
|
+
ui.locale.subscribe(() => {
|
|
4179
|
+
const body = host2.querySelector(".ohm-body");
|
|
4180
|
+
if (body) {
|
|
4181
|
+
const rulesEl = host2.querySelector("#ohm-rules");
|
|
4182
|
+
if (rulesEl && menu.rules) rulesEl.innerHTML = renderBlocks(menu.rules, tr);
|
|
4183
|
+
if (lang) lang.value = ui.locale.get();
|
|
4184
|
+
}
|
|
4185
|
+
})
|
|
4186
|
+
);
|
|
4187
|
+
disposers.push(ui.settingsPanel.state.subscribe(() => host2.classList.toggle("open", ui.settingsPanel.isOpen)));
|
|
4188
|
+
return () => {
|
|
4189
|
+
for (const d of disposers.splice(0)) d();
|
|
4190
|
+
host2.remove();
|
|
4191
|
+
};
|
|
4192
|
+
}
|
|
4193
|
+
var OHM_CSS = `
|
|
4194
|
+
.ohm-root { position: fixed; inset: 0; z-index: 10000; display: grid; place-items: center; font-family: var(--font); opacity: 0; pointer-events: none; transition: opacity .18s ease; }
|
|
4195
|
+
.ohm-root.open { opacity: 1; pointer-events: auto; }
|
|
4196
|
+
.ohm-backdrop { position: absolute; inset: 0; background: rgba(8,6,4,0); backdrop-filter: blur(0px) saturate(1); -webkit-backdrop-filter: blur(0px) saturate(1); transition: background .4s ease, backdrop-filter .4s ease, -webkit-backdrop-filter .4s ease; }
|
|
4197
|
+
.ohm-root.open .ohm-backdrop { background: rgba(8,6,4,.34); backdrop-filter: blur(6px) saturate(1.1); -webkit-backdrop-filter: blur(6px) saturate(1.1); }
|
|
4198
|
+
.ohm-card { position: relative; width: min(92%, 1100px); max-height: 86vh; display: flex; flex-direction: column; background: var(--surface); color: var(--text); border: 1.5px solid #000; border-radius: var(--card-radius); box-shadow: 0 30px 80px rgba(0,0,0,.5); overflow: hidden; transform: translateY(8px) scale(.99); transition: transform .18s ease; }
|
|
4199
|
+
.ohm-root.open .ohm-card { transform: none; }
|
|
4200
|
+
.ohm-x { position: absolute; top: 18px; right: 22px; width: 46px; height: 46px; border-radius: 999px; border: 0; background: rgba(18,14,10,.82); color: #fff; font-size: 18px; cursor: pointer; display: grid; place-items: center; box-shadow: 0 6px 18px rgba(0,0,0,.45); z-index: 2; transition: transform .12s, background .12s; }
|
|
4201
|
+
.ohm-x:hover { transform: scale(1.08); background: rgba(18,14,10,.95); }
|
|
4202
|
+
.ohm-body { padding: 24px 26px 26px; overflow-y: scroll; }
|
|
4203
|
+
.ohm-body::-webkit-scrollbar { width: 18px; }
|
|
4204
|
+
.ohm-body::-webkit-scrollbar-track { background: transparent; margin: 12px 0; }
|
|
4205
|
+
.ohm-body::-webkit-scrollbar-thumb { background-color: #111; border: 6px solid transparent; background-clip: padding-box; border-radius: 999px; min-height: 44px; }
|
|
4206
|
+
.ohm-body::-webkit-scrollbar-thumb:hover { background-color: #000; }
|
|
4207
|
+
.ohm-logo { display: block; margin: 6px auto 18px; max-width: 64%; height: auto; }
|
|
4208
|
+
.ohm-logo-text { margin: 6px 0 18px; text-align: center; font-size: 30px; font-weight: 900; letter-spacing: 1px; color: var(--text); }
|
|
4209
|
+
.ohm-sec { display: flex; align-items: center; gap: 14px; margin: 26px 0 14px; color: var(--text); font-weight: 800; letter-spacing: 1px; }
|
|
4210
|
+
.ohm-sec::before, .ohm-sec::after { content: ""; flex: 1; height: 2px; background: color-mix(in srgb, var(--text) 80%, transparent); border-radius: 2px; }
|
|
4211
|
+
.ohm-root *, .ohm-root *::before, .ohm-root *::after { box-sizing: border-box; }
|
|
4212
|
+
.ohm-row { display: flex; align-items: center; gap: 16px; margin: 14px 0; font-weight: 700; }
|
|
4213
|
+
.ohm-setting { margin: 14px 0; }
|
|
4214
|
+
.ohm-setting .ohm-row { margin: 0; }
|
|
4215
|
+
.ohm-hint { margin: 3px 0 0; font-size: 12.5px; font-weight: 500; color: var(--text-dim); }
|
|
4216
|
+
.ohm-row > span:first-child { flex: none; min-width: 110px; }
|
|
4217
|
+
.ohm-row input[type=range] { flex: 1; min-width: 0; max-width: min(440px, 60dvw); accent-color: var(--accent); height: 6px; }
|
|
4218
|
+
.ohm-row select { flex: 1; min-width: 0; max-width: min(440px, 60dvw); padding: 11px 14px; border-radius: 4px; border: 2px solid var(--accent); background: var(--surface-alt); color: var(--text); font-weight: 700; font-size: 15px; cursor: pointer; }
|
|
4219
|
+
.ohm-row select option { background: var(--surface); color: var(--text); font-weight: 600; }
|
|
4220
|
+
.ohm-row select option:checked { background: var(--accent); color: var(--accent-text); }
|
|
4221
|
+
.ohm-ctl { flex: 1; min-width: 0; max-width: min(440px, 60dvw); display: flex; align-items: center; justify-content: flex-end; }
|
|
4222
|
+
.ohm-check input[type=checkbox] { appearance: none; -webkit-appearance: none; width: 50px; height: 28px; border-radius: 999px; background: color-mix(in srgb, var(--text-dim) 38%, transparent); position: relative; cursor: pointer; transition: background .15s; flex: none; }
|
|
4223
|
+
.ohm-check input[type=checkbox]:checked { background: var(--accent); }
|
|
4224
|
+
.ohm-check input[type=checkbox]::before { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 999px; background: #fff; transition: left .15s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
|
|
4225
|
+
.ohm-check input[type=checkbox]:checked::before { left: 25px; }
|
|
4226
|
+
.ohm-segmented { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface-alt); border-radius: 999px; border: 1px solid color-mix(in srgb, var(--text-dim) 30%, transparent); }
|
|
4227
|
+
.ohm-seg { border: 0; background: transparent; color: var(--text-dim); font-weight: 700; font-size: 14px; padding: 8px 18px; border-radius: 999px; cursor: pointer; transition: background .12s, color .12s; }
|
|
4228
|
+
.ohm-seg.active { background: var(--accent); color: var(--accent-text); }
|
|
4229
|
+
.ohm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
|
|
4230
|
+
.ohm-sym { display: flex; align-items: center; gap: 16px; padding: 6px 4px; }
|
|
4231
|
+
.ohm-emoji { font-size: 48px; line-height: 1; filter: drop-shadow(0 2px 4px rgba(0,0,0,.3)); }
|
|
4232
|
+
.ohm-symimg { width: 56px; height: 56px; object-fit: contain; flex: none; }
|
|
4233
|
+
.ohm-pay { font-size: 13px; line-height: 1.6; }
|
|
4234
|
+
.ohm-pay div { display: flex; gap: 6px; }
|
|
4235
|
+
.ohm-pay b { min-width: 42px; }
|
|
4236
|
+
.ohm-pay span { color: var(--accent); font-weight: 700; }
|
|
4237
|
+
.ohm-body p { color: var(--text-dim); line-height: 1.6; }
|
|
4238
|
+
.ohm-body p b { color: var(--text); }
|
|
4239
|
+
.ohm-feature { display: block; width: 100%; height: auto; margin: 10px 0; }
|
|
4240
|
+
.ohm-stats { margin: 12px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; }
|
|
4241
|
+
.ohm-stats > div { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid color-mix(in srgb, var(--text-dim) 20%, transparent); }
|
|
4242
|
+
.ohm-stats dt { color: var(--text-dim); margin: 0; } .ohm-stats dd { margin: 0; font-weight: 700; }
|
|
4243
|
+
.ohm-callout { margin: 16px 0 4px; padding: 14px 16px; border-radius: 12px; border-left: 4px solid var(--accent); background: color-mix(in srgb, var(--accent) 9%, transparent); }
|
|
4244
|
+
.ohm-callout b { color: var(--accent); } .ohm-callout p { margin: 4px 0 0; color: var(--text); }
|
|
4245
|
+
.ohm-callout--warning { border-left-color: #e0a106; background: color-mix(in srgb, #e0a106 10%, transparent); }
|
|
4246
|
+
.ohm-callout--warning b { color: #b07d09; }
|
|
4247
|
+
.ohm-subh { margin: 22px 0 8px; font-size: 15px; font-weight: 800; letter-spacing: .5px; color: var(--text); }
|
|
4248
|
+
.ohm-legal { font-size: 12px; line-height: 1.6; color: var(--text-dim); opacity: .85; }
|
|
4249
|
+
.ohm-hr { border: 0; border-top: 1px solid color-mix(in srgb, var(--text-dim) 30%, transparent); margin: 18px 0; }
|
|
4250
|
+
.ohm-media { display: flex; align-items: center; gap: 18px; margin: 14px 0; }
|
|
4251
|
+
.ohm-media--right { flex-direction: row-reverse; }
|
|
4252
|
+
.ohm-media > img { width: 40%; max-width: 320px; height: auto; flex: none; }
|
|
4253
|
+
.ohm-media-body { flex: 1; }
|
|
4254
|
+
.ohm-media-body h4 { margin: 0 0 6px; font-size: 16px; color: var(--text); }
|
|
4255
|
+
.ohm-media-body p { margin: 0; }
|
|
4256
|
+
.ohm-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 12px 0; }
|
|
4257
|
+
.ohm-fcard { padding: 8px 6px; text-align: center; }
|
|
4258
|
+
.ohm-fcard img { display: block; width: 48px; height: 48px; margin: 0 auto 8px; }
|
|
4259
|
+
.ohm-fcard h5 { margin: 0 0 4px; font-size: 14px; color: var(--text); }
|
|
4260
|
+
.ohm-fcard p { margin: 0; font-size: 12px; line-height: 1.5; }
|
|
4261
|
+
.ohm-table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 14px; }
|
|
4262
|
+
.ohm-table th { text-align: left; padding: 8px 10px; font-weight: 800; color: var(--text); border-bottom: 2px solid color-mix(in srgb, var(--text-dim) 35%, transparent); }
|
|
4263
|
+
.ohm-table td { padding: 8px 10px; border-bottom: 1px solid color-mix(in srgb, var(--text-dim) 18%, transparent); }
|
|
4264
|
+
.ohm-table td:first-child { color: var(--text); font-weight: 700; }
|
|
4265
|
+
.ohm-table td:not(:first-child) { color: var(--accent); font-weight: 700; }
|
|
4266
|
+
.ohm-steps { margin: 12px 0; padding-left: 22px; color: var(--text-dim); line-height: 1.7; }
|
|
4267
|
+
.ohm-steps li { margin: 5px 0; }
|
|
4268
|
+
.ohm-steps b { color: var(--text); }
|
|
4269
|
+
.ohm-group { margin: 8px 0; }
|
|
4270
|
+
`;
|
|
4271
|
+
|
|
4272
|
+
// src/mountHud.ts
|
|
3988
4273
|
function showReplayModal(ui, info, buttonKey, onSelect) {
|
|
3989
4274
|
const cur = info.currency ?? ui.balance.currency.get();
|
|
3990
|
-
const
|
|
4275
|
+
const money2 = (n) => core.formatAmount(n, cur);
|
|
3991
4276
|
ui.showNotice(
|
|
3992
4277
|
[
|
|
3993
4278
|
{ kind: "heading", id: "openui-replay-h", text: "openui.replay.title" },
|
|
@@ -3995,10 +4280,10 @@ function showReplayModal(ui, info, buttonKey, onSelect) {
|
|
|
3995
4280
|
kind: "stat-grid",
|
|
3996
4281
|
id: "openui-replay-g",
|
|
3997
4282
|
items: [
|
|
3998
|
-
{ label: "openui.replay.baseBet", value:
|
|
4283
|
+
{ label: "openui.replay.baseBet", value: money2(info.baseBet) },
|
|
3999
4284
|
{ label: "openui.replay.costMultiplier", value: `${info.costMultiplier}\xD7` },
|
|
4000
4285
|
{ label: "openui.replay.payoutMultiplier", value: `${info.payoutMultiplier}\xD7` },
|
|
4001
|
-
{ label: "openui.replay.amount", value:
|
|
4286
|
+
{ label: "openui.replay.amount", value: money2(info.amount) }
|
|
4002
4287
|
]
|
|
4003
4288
|
}
|
|
4004
4289
|
],
|
|
@@ -4010,15 +4295,17 @@ function showReplayModal(ui, info, buttonKey, onSelect) {
|
|
|
4010
4295
|
);
|
|
4011
4296
|
}
|
|
4012
4297
|
function mountHud(app, spec = {}, opts = {}) {
|
|
4013
|
-
const { hooks, ...pixiOpts } = opts;
|
|
4298
|
+
const { hooks, infoMenu, ...pixiOpts } = opts;
|
|
4014
4299
|
const ui = core.createUI(spec, hooks);
|
|
4300
|
+
const useInfoMenu = infoMenu !== false && pixiOpts.menu !== false;
|
|
4015
4301
|
const locales = spec.locale ? Array.from(/* @__PURE__ */ new Set([spec.locale.locale, ...Object.keys(spec.locale.messages)])) : [];
|
|
4016
|
-
const menu = pixiOpts.menu === false ? false : core.composeMenu(spec.menu, { locales, localeSelectId: spec.localeSelectId, rulesFallback: spec.rules });
|
|
4302
|
+
const menu = pixiOpts.menu === false || useInfoMenu ? false : core.composeMenu(spec.menu, { locales, localeSelectId: spec.localeSelectId, rulesFallback: spec.rules });
|
|
4017
4303
|
if (menu && spec.game && (spec.game.name || spec.game.version)) {
|
|
4018
4304
|
menu.push({ kind: "legal", id: "openui-game-info", text: [spec.game.name, spec.game.version ? `v${spec.game.version}` : ""].filter(Boolean).join(" \xB7 ") });
|
|
4019
4305
|
}
|
|
4020
4306
|
const pixi = new OpenUIPixi(ui, { ...pixiOpts, menu });
|
|
4021
4307
|
pixi.mount(app);
|
|
4308
|
+
const disposeInfoMenu = useInfoMenu ? mountInfoMenu(app, ui) : void 0;
|
|
4022
4309
|
const extra = [];
|
|
4023
4310
|
if (spec.panels?.length) {
|
|
4024
4311
|
for (const ps of spec.panels) {
|
|
@@ -4039,6 +4326,7 @@ function mountHud(app, spec = {}, opts = {}) {
|
|
|
4039
4326
|
});
|
|
4040
4327
|
const teardown = () => {
|
|
4041
4328
|
offRelayout();
|
|
4329
|
+
disposeInfoMenu?.();
|
|
4042
4330
|
for (const v of extra) v.dispose();
|
|
4043
4331
|
extra.length = 0;
|
|
4044
4332
|
pixi.unmount();
|
|
@@ -4123,10 +4411,237 @@ function mountHud(app, spec = {}, opts = {}) {
|
|
|
4123
4411
|
dispose: teardown
|
|
4124
4412
|
};
|
|
4125
4413
|
}
|
|
4414
|
+
function money(amount, cur) {
|
|
4415
|
+
return core.formatAmount(amount, cur);
|
|
4416
|
+
}
|
|
4417
|
+
var esc2 = (s) => s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
4418
|
+
function mountBuyFeatureModal(_app, hud, features, opts = {}) {
|
|
4419
|
+
const ui = hud.ui;
|
|
4420
|
+
const tr = (k) => ui.t(k);
|
|
4421
|
+
const list = features.slice(0, 4);
|
|
4422
|
+
const boosts = /* @__PURE__ */ new Set();
|
|
4423
|
+
const activation = opts.activation ?? "multi";
|
|
4424
|
+
const blocksBuy = opts.activationBlocksBuy ?? false;
|
|
4425
|
+
const disposers = [];
|
|
4426
|
+
const host2 = document.createElement("div");
|
|
4427
|
+
host2.className = "bfm-root";
|
|
4428
|
+
const vars = {
|
|
4429
|
+
"--accent": "#d99000",
|
|
4430
|
+
"--accent-text": "#1a1200",
|
|
4431
|
+
"--surface": "#ffffff",
|
|
4432
|
+
"--surface-alt": "#eef1f6",
|
|
4433
|
+
"--text": "#181b20",
|
|
4434
|
+
"--text-dim": "#5b6472",
|
|
4435
|
+
"--font": ui.theme.type.family
|
|
4436
|
+
};
|
|
4437
|
+
for (const [k, v] of Object.entries(vars)) host2.style.setProperty(k, v);
|
|
4438
|
+
host2.innerHTML = `
|
|
4439
|
+
<div class="bfm-backdrop" data-close></div>
|
|
4440
|
+
<button class="bfm-x" data-close aria-label="Close">\u2715</button>
|
|
4441
|
+
<div class="bfm-panel" role="dialog" aria-modal="true">
|
|
4442
|
+
<div class="bfm-fit" id="bfm-fit">
|
|
4443
|
+
<h2 class="bfm-title" data-t="Buy Feature">${esc2(tr("Buy Feature"))}</h2>
|
|
4444
|
+
<div class="bfm-bet">
|
|
4445
|
+
<button class="bfm-step" id="bfm-minus" aria-label="Decrease">\u2212</button>
|
|
4446
|
+
<div class="bfm-betbox"><span class="bfm-betlabel" data-t="Bet">${esc2(tr("Bet"))}</span><b id="bfm-betval">\u2014</b></div>
|
|
4447
|
+
<button class="bfm-step" id="bfm-plus" aria-label="Increase">+</button>
|
|
4448
|
+
</div>
|
|
4449
|
+
<div class="bfm-cards" id="bfm-cards"></div>
|
|
4450
|
+
</div>
|
|
4451
|
+
</div>
|
|
4452
|
+
<div class="bfm-confirm" id="bfm-confirm">
|
|
4453
|
+
<div class="bfm-confirm-card">
|
|
4454
|
+
<p class="bfm-confirm-msg" id="bfm-confirm-msg"></p>
|
|
4455
|
+
<div class="bfm-confirm-row">
|
|
4456
|
+
<button class="bfm-confirm-btn bfm-confirm-no" id="bfm-confirm-no" data-t="openui.cancel">${esc2(tr("openui.cancel"))}</button>
|
|
4457
|
+
<button class="bfm-confirm-btn bfm-confirm-yes" id="bfm-confirm-yes" data-t="openui.confirm">${esc2(tr("openui.confirm"))}</button>
|
|
4458
|
+
</div>
|
|
4459
|
+
</div>
|
|
4460
|
+
</div>`;
|
|
4461
|
+
const style = document.createElement("style");
|
|
4462
|
+
style.textContent = BFM_CSS;
|
|
4463
|
+
host2.appendChild(style);
|
|
4464
|
+
document.body.appendChild(host2);
|
|
4465
|
+
const $ = (sel) => host2.querySelector(sel);
|
|
4466
|
+
const panel = $(".bfm-panel");
|
|
4467
|
+
const fitEl = $("#bfm-fit");
|
|
4468
|
+
const cardsEl = $("#bfm-cards");
|
|
4469
|
+
const betValEl = $("#bfm-betval");
|
|
4470
|
+
const confirmEl = $("#bfm-confirm");
|
|
4471
|
+
const confirmMsg = $("#bfm-confirm-msg");
|
|
4472
|
+
const confirmYes = $("#bfm-confirm-yes");
|
|
4473
|
+
const confirmNo = $("#bfm-confirm-no");
|
|
4474
|
+
let pendingConfirm = null;
|
|
4475
|
+
const hideConfirm = () => {
|
|
4476
|
+
confirmEl.classList.remove("show");
|
|
4477
|
+
pendingConfirm = null;
|
|
4478
|
+
};
|
|
4479
|
+
confirmNo.addEventListener("click", hideConfirm);
|
|
4480
|
+
confirmYes.addEventListener("click", () => {
|
|
4481
|
+
const fn = pendingConfirm;
|
|
4482
|
+
hideConfirm();
|
|
4483
|
+
fn?.();
|
|
4484
|
+
});
|
|
4485
|
+
const askConfirm = (totalCost, name, price, onYes) => {
|
|
4486
|
+
if (!hud.shouldConfirmBuy(totalCost)) {
|
|
4487
|
+
onYes();
|
|
4488
|
+
return;
|
|
4489
|
+
}
|
|
4490
|
+
confirmMsg.textContent = ui.t("openui.buyFeature.confirm", { name: ui.t(name), price });
|
|
4491
|
+
pendingConfirm = onYes;
|
|
4492
|
+
confirmEl.classList.add("show");
|
|
4493
|
+
};
|
|
4494
|
+
const layout = () => {
|
|
4495
|
+
const vw = window.innerWidth;
|
|
4496
|
+
const vh = window.innerHeight;
|
|
4497
|
+
const cols = vh <= 540 || vw >= 900 ? Math.min(4, list.length) : Math.min(2, list.length);
|
|
4498
|
+
cardsEl.style.gridTemplateColumns = `repeat(${cols}, 1fr)`;
|
|
4499
|
+
const fitW = Math.min(vw * 0.96, cols >= 4 ? 1180 : cols === 1 ? 380 : 760);
|
|
4500
|
+
fitEl.style.width = `${fitW}px`;
|
|
4501
|
+
fitEl.style.transform = "none";
|
|
4502
|
+
const natH = fitEl.offsetHeight;
|
|
4503
|
+
const s = Math.min(1, vh * 0.95 / natH);
|
|
4504
|
+
fitEl.style.transform = `translateX(-50%) scale(${s})`;
|
|
4505
|
+
panel.style.width = `${Math.ceil(fitW * s)}px`;
|
|
4506
|
+
panel.style.height = `${Math.ceil(natH * s)}px`;
|
|
4507
|
+
};
|
|
4508
|
+
const renderCards = () => {
|
|
4509
|
+
const bet = opts.getBet ? opts.getBet() : ui.bet.get();
|
|
4510
|
+
const cur = ui.bet.currency.get();
|
|
4511
|
+
cardsEl.innerHTML = list.map((f) => {
|
|
4512
|
+
const active = boosts.has(f.id);
|
|
4513
|
+
const buyBlocked = f.variant === "buy" && blocksBuy && boosts.size > 0;
|
|
4514
|
+
const price = f.variant === "buy" ? money(f.cost * bet, cur) : `+${money(f.cost * bet, cur)}`;
|
|
4515
|
+
const label = f.variant === "buy" ? tr("Buy") : active ? tr("Activated") : tr("Activate");
|
|
4516
|
+
const cls = `bfm-action bfm-action--${f.variant}${active ? " is-active" : ""}${buyBlocked ? " is-blocked" : ""}`;
|
|
4517
|
+
const img = f.image ? ` style="background-image:url('${f.image}')"` : "";
|
|
4518
|
+
return `
|
|
4519
|
+
<div class="bfm-cell">
|
|
4520
|
+
<div class="bfm-card">
|
|
4521
|
+
<div class="bfm-cardimg"${img}></div>
|
|
4522
|
+
<div class="bfm-strip"></div>
|
|
4523
|
+
<div class="bfm-cardbody">
|
|
4524
|
+
<span class="bfm-name">${esc2(tr(f.name))}</span>
|
|
4525
|
+
<b class="bfm-price">${esc2(price)}</b>
|
|
4526
|
+
</div>
|
|
4527
|
+
</div>
|
|
4528
|
+
<button class="${cls}" data-id="${f.id}" data-variant="${f.variant}"${buyBlocked ? " disabled" : ""}>${esc2(label)}</button>
|
|
4529
|
+
</div>`;
|
|
4530
|
+
}).join("");
|
|
4531
|
+
betValEl.textContent = money(bet, cur);
|
|
4532
|
+
cardsEl.querySelectorAll(".bfm-action").forEach((b) => {
|
|
4533
|
+
b.addEventListener("click", () => onAction(b.dataset.id, b.dataset.variant));
|
|
4534
|
+
});
|
|
4535
|
+
layout();
|
|
4536
|
+
};
|
|
4537
|
+
const onAction = (id, variant) => {
|
|
4538
|
+
const f = list.find((x) => x.id === id);
|
|
4539
|
+
const bet = opts.getBet ? opts.getBet() : ui.bet.get();
|
|
4540
|
+
const cur = ui.bet.currency.get();
|
|
4541
|
+
if (variant === "boost") {
|
|
4542
|
+
const wasActive = boosts.has(id);
|
|
4543
|
+
const commit = () => {
|
|
4544
|
+
if (activation === "single") boosts.clear();
|
|
4545
|
+
if (wasActive) boosts.delete(id);
|
|
4546
|
+
else boosts.add(id);
|
|
4547
|
+
ui.bus.emit("cardActivated", { id });
|
|
4548
|
+
renderCards();
|
|
4549
|
+
opts.onActivate?.([...boosts], id, boosts.has(id));
|
|
4550
|
+
};
|
|
4551
|
+
if (wasActive) {
|
|
4552
|
+
commit();
|
|
4553
|
+
return;
|
|
4554
|
+
}
|
|
4555
|
+
const total = 1 + (f?.cost ?? 0);
|
|
4556
|
+
askConfirm(total, f?.name ?? id, money(total * bet, cur), commit);
|
|
4557
|
+
} else {
|
|
4558
|
+
if (blocksBuy && boosts.size > 0) return;
|
|
4559
|
+
const cost = (f?.cost ?? 0) * bet;
|
|
4560
|
+
askConfirm(f?.cost ?? 0, f?.name ?? id, money(cost, cur), () => {
|
|
4561
|
+
ui.bus.emit("cardActivated", { id });
|
|
4562
|
+
close();
|
|
4563
|
+
opts.onBuy?.(id, cost);
|
|
4564
|
+
});
|
|
4565
|
+
}
|
|
4566
|
+
};
|
|
4567
|
+
$("#bfm-minus").addEventListener("click", () => ui.betStepper.dec());
|
|
4568
|
+
$("#bfm-plus").addEventListener("click", () => ui.betStepper.inc());
|
|
4569
|
+
disposers.push(ui.bet.value.subscribe(() => renderCards()));
|
|
4570
|
+
const open = () => {
|
|
4571
|
+
renderCards();
|
|
4572
|
+
host2.classList.add("open");
|
|
4573
|
+
};
|
|
4574
|
+
const close = () => host2.classList.remove("open");
|
|
4575
|
+
host2.querySelectorAll("[data-close]").forEach((b) => b.addEventListener("click", close));
|
|
4576
|
+
disposers.push(ui.on("buttonActivated", ({ id }) => {
|
|
4577
|
+
if (id === "bonus") open();
|
|
4578
|
+
}));
|
|
4579
|
+
const onResize = () => {
|
|
4580
|
+
if (host2.classList.contains("open")) layout();
|
|
4581
|
+
};
|
|
4582
|
+
window.addEventListener("resize", onResize);
|
|
4583
|
+
disposers.push(
|
|
4584
|
+
ui.locale.subscribe(() => {
|
|
4585
|
+
host2.querySelectorAll("[data-t]").forEach((n) => n.textContent = tr(n.dataset.t));
|
|
4586
|
+
renderCards();
|
|
4587
|
+
})
|
|
4588
|
+
);
|
|
4589
|
+
renderCards();
|
|
4590
|
+
return () => {
|
|
4591
|
+
window.removeEventListener("resize", onResize);
|
|
4592
|
+
for (const d of disposers.splice(0)) d();
|
|
4593
|
+
host2.remove();
|
|
4594
|
+
};
|
|
4595
|
+
}
|
|
4596
|
+
var BFM_CSS = `
|
|
4597
|
+
.bfm-root { position: fixed; inset: 0; z-index: 11000; display: grid; place-items: center; font-family: var(--font); opacity: 0; pointer-events: none; transition: opacity .18s ease; }
|
|
4598
|
+
.bfm-root.open { opacity: 1; pointer-events: auto; }
|
|
4599
|
+
.bfm-backdrop { position: absolute; inset: 0; background: rgba(8,6,4,0); backdrop-filter: blur(0px) saturate(1); -webkit-backdrop-filter: blur(0px) saturate(1); transition: background .4s ease, backdrop-filter .4s ease, -webkit-backdrop-filter .4s ease; }
|
|
4600
|
+
.bfm-root.open .bfm-backdrop { background: rgba(8,6,4,.5); backdrop-filter: blur(10px) saturate(1.1); -webkit-backdrop-filter: blur(10px) saturate(1.1); }
|
|
4601
|
+
.bfm-x { position: absolute; top: 18px; right: 22px; width: 46px; height: 46px; border-radius: 999px; border: 0; background: rgba(18,14,10,.82); color: #fff; font-size: 18px; cursor: pointer; display: grid; place-items: center; box-shadow: 0 6px 18px rgba(0,0,0,.45); z-index: 2; transition: transform .12s, background .12s; }
|
|
4602
|
+
.bfm-x:hover { transform: scale(1.08); background: rgba(18,14,10,.95); }
|
|
4603
|
+
.bfm-root *, .bfm-root *::before, .bfm-root *::after { box-sizing: border-box; }
|
|
4604
|
+
.bfm-panel { position: relative; transform: translateY(8px) scale(.985); transition: transform .18s ease; }
|
|
4605
|
+
.bfm-root.open .bfm-panel { transform: none; }
|
|
4606
|
+
.bfm-fit { position: absolute; top: 0; left: 50%; transform: translateX(-50%); transform-origin: top center; }
|
|
4607
|
+
.bfm-title { margin: 0 0 14px; text-align: center; color: #fff; font-size: 30px; font-weight: 800; letter-spacing: 1px; text-shadow: 0 2px 12px rgba(0,0,0,.6); }
|
|
4608
|
+
.bfm-bet { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 0 0 24px; }
|
|
4609
|
+
.bfm-betbox { min-width: 200px; padding: 10px 22px; border-radius: 12px; background: var(--surface); border: 3px solid #000; display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
|
|
4610
|
+
.bfm-betlabel { font-size: 12px; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; }
|
|
4611
|
+
.bfm-betbox b { font-size: 24px; color: var(--text); }
|
|
4612
|
+
.bfm-step { flex: none; width: 54px; height: 54px; border-radius: 999px; border: 3px solid #000; background: var(--surface); color: var(--text); font-size: 28px; font-weight: 800; cursor: pointer; display: grid; place-items: center; line-height: 1; transition: transform .1s, background .12s; box-shadow: 0 4px 12px rgba(0,0,0,.3); }
|
|
4613
|
+
.bfm-step:hover { background: var(--surface-alt); }
|
|
4614
|
+
.bfm-step:active { transform: scale(.92); }
|
|
4615
|
+
.bfm-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; align-items: start; }
|
|
4616
|
+
.bfm-cell { display: flex; flex-direction: column; min-width: 0; }
|
|
4617
|
+
.bfm-card { background: var(--surface); border: 4px solid #000; border-radius: 14px; overflow: hidden; box-shadow: 0 14px 34px rgba(0,0,0,.45); }
|
|
4618
|
+
.bfm-cardimg { width: 100%; aspect-ratio: 16 / 10; background-size: cover; background-position: center; background-color: var(--surface-alt); background-image: linear-gradient(135deg, #e7ebf2, #cfd6e2); }
|
|
4619
|
+
.bfm-strip { height: 8px; background: linear-gradient(90deg, #f0a500, #ffd166, #f0a500); }
|
|
4620
|
+
.bfm-cardbody { padding: 12px 14px 16px; text-align: center; }
|
|
4621
|
+
.bfm-name { display: block; font-size: 15px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
4622
|
+
.bfm-price { display: block; margin-top: 2px; font-size: 22px; font-weight: 800; color: var(--text); }
|
|
4623
|
+
.bfm-action { display: block; width: 100%; margin-top: 12px; padding: 14px 10px; border-radius: 12px; border: 4px solid #000; background: var(--surface); color: var(--text); font-size: 15px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; cursor: pointer; transition: transform .1s, background .12s, color .12s; box-shadow: 0 5px 14px rgba(0,0,0,.35); white-space: nowrap; }
|
|
4624
|
+
.bfm-action:hover { background: var(--surface-alt); }
|
|
4625
|
+
.bfm-action:active { transform: scale(.96); }
|
|
4626
|
+
.bfm-action.is-active { background: var(--accent); color: var(--accent-text); border-color: #000; }
|
|
4627
|
+
.bfm-action.is-blocked, .bfm-action:disabled { opacity: .38; cursor: not-allowed; box-shadow: none; }
|
|
4628
|
+
.bfm-action.is-blocked:hover, .bfm-action:disabled:hover { background: var(--surface); }
|
|
4629
|
+
.bfm-confirm { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; opacity: 0; pointer-events: none; transition: opacity .16s ease; }
|
|
4630
|
+
.bfm-confirm.show { opacity: 1; pointer-events: auto; }
|
|
4631
|
+
.bfm-confirm::before { content: ""; position: absolute; inset: 0; background: rgba(8,6,4,.6); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
|
|
4632
|
+
.bfm-confirm-card { position: relative; width: min(90%, 420px); background: var(--surface); color: var(--text); border: 3px solid #000; border-radius: 14px; padding: 26px 24px 22px; box-shadow: 0 24px 60px rgba(0,0,0,.55); text-align: center; }
|
|
4633
|
+
.bfm-confirm-msg { margin: 0 0 22px; font-size: 19px; font-weight: 700; line-height: 1.4; color: var(--text); }
|
|
4634
|
+
.bfm-confirm-row { display: flex; gap: 14px; }
|
|
4635
|
+
.bfm-confirm-btn { flex: 1; padding: 14px 10px; border-radius: 12px; border: 3px solid #000; font-size: 15px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; cursor: pointer; transition: transform .1s, background .12s; }
|
|
4636
|
+
.bfm-confirm-btn:active { transform: scale(.96); }
|
|
4637
|
+
.bfm-confirm-no { background: var(--surface); color: var(--text); }
|
|
4638
|
+
.bfm-confirm-no:hover { background: var(--surface-alt); }
|
|
4639
|
+
.bfm-confirm-yes { background: var(--accent); color: var(--accent-text); }
|
|
4640
|
+
`;
|
|
4126
4641
|
|
|
4127
4642
|
// src/bootError.ts
|
|
4128
4643
|
var host = null;
|
|
4129
|
-
var
|
|
4644
|
+
var esc3 = (s) => s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
4130
4645
|
function showBootError(opts = {}) {
|
|
4131
4646
|
const title = opts.title ?? "Connection lost";
|
|
4132
4647
|
const message = opts.message ?? "The game could not reach the game server. Please reload to reconnect and continue.";
|
|
@@ -4140,10 +4655,10 @@ function showBootError(opts = {}) {
|
|
|
4140
4655
|
<div class="openui-be-icon" aria-hidden="true">
|
|
4141
4656
|
<svg viewBox="0 0 48 48" width="48" height="48"><path d="M24 4 3 42h42L24 4Z" fill="none" stroke="#ffc935" stroke-width="3" stroke-linejoin="round"/><rect x="22" y="18" width="4" height="12" rx="2" fill="#ffc935"/><circle cx="24" cy="35" r="2.4" fill="#ffc935"/></svg>
|
|
4142
4657
|
</div>
|
|
4143
|
-
<h1 class="openui-be-title">${
|
|
4144
|
-
<p class="openui-be-msg">${
|
|
4145
|
-
${opts.detail ? `<p class="openui-be-detail">${
|
|
4146
|
-
${showReload ? `<button class="openui-be-reload" type="button">${
|
|
4658
|
+
<h1 class="openui-be-title">${esc3(title)}</h1>
|
|
4659
|
+
<p class="openui-be-msg">${esc3(message)}</p>
|
|
4660
|
+
${opts.detail ? `<p class="openui-be-detail">${esc3(opts.detail)}</p>` : ""}
|
|
4661
|
+
${showReload ? `<button class="openui-be-reload" type="button">${esc3(opts.reloadLabel ?? "Reload")}</button>` : ""}
|
|
4147
4662
|
</div>
|
|
4148
4663
|
<style>
|
|
4149
4664
|
.openui-boot-error { position: fixed; inset: 0; z-index: 2147483000; display: grid; place-items: center;
|
|
@@ -4223,7 +4738,9 @@ exports.defaultSpinSkin = defaultSpinSkin;
|
|
|
4223
4738
|
exports.drawSpin = drawSpin;
|
|
4224
4739
|
exports.hideBootError = hideBootError;
|
|
4225
4740
|
exports.isDesktop = isDesktop;
|
|
4741
|
+
exports.mountBuyFeatureModal = mountBuyFeatureModal;
|
|
4226
4742
|
exports.mountHud = mountHud;
|
|
4743
|
+
exports.mountInfoMenu = mountInfoMenu;
|
|
4227
4744
|
exports.showBootError = showBootError;
|
|
4228
4745
|
exports.svgSpinSkin = svgSpinSkin;
|
|
4229
4746
|
//# sourceMappingURL=index.cjs.map
|