mirror of
https://github.com/Shu-Ying/noname-shuying.git
synced 2026-11-24 22:16:30 +08:00
fixed # 新增缩放倍率适配
This commit is contained in:
@@ -328,7 +328,7 @@ export function openCardLibrary(run, options = {}) {
|
||||
// Prevent the map's Escape/Tab handler from acting behind this modal.
|
||||
dialog.addEventListener("keydown", event => event.stopPropagation());
|
||||
render();
|
||||
document.body.appendChild(dialog);
|
||||
document.documentElement.appendChild(dialog);
|
||||
try { dialog.showModal(); } catch (error) { close(); throw error; }
|
||||
fitCards();
|
||||
if (typeof ResizeObserver !== "undefined") {
|
||||
|
||||
@@ -29,21 +29,22 @@ export const playDialogue = (lines, options = {}) => new Promise(resolve => {
|
||||
|
||||
const overlay = ui.create.div(".mengsan-dialogue-overlay-shuying", ui.window);
|
||||
const stage = ui.create.div(".mengsan-dialogue-stage-shuying", overlay);
|
||||
ui.create.div(".mengsan-dialogue-chapter-shuying", options.title || "剧情", stage);
|
||||
const textBox = ui.create.div(".mengsan-dialogue-box-shuying", stage);
|
||||
ui.create.div(".mengsan-dialogue-chapter-shuying", options.title || "剧情", overlay);
|
||||
const content = ui.create.div(".mengsan-dialogue-content-shuying", stage);
|
||||
const choices = ui.create.div(".mengsan-dialogue-choices-shuying", content);
|
||||
const textBox = ui.create.div(".mengsan-dialogue-box-shuying", content);
|
||||
const portraitFrame = ui.create.div(
|
||||
".mengsan-dialogue-portrait-frame-shuying", textBox);
|
||||
const speaker = ui.create.div(".mengsan-dialogue-speaker-shuying", textBox);
|
||||
const text = ui.create.div(".mengsan-dialogue-text-shuying", textBox);
|
||||
const progress = ui.create.div(".mengsan-dialogue-progress-shuying", textBox);
|
||||
const indicator = ui.create.div(".mengsan-dialogue-indicator-shuying", "◆", textBox);
|
||||
const choices = ui.create.div(".mengsan-dialogue-choices-shuying", stage);
|
||||
const skipButton = document.createElement("button");
|
||||
skipButton.type = "button";
|
||||
skipButton.className = "mengsan-dialogue-skip-shuying";
|
||||
skipButton.textContent = "跳过对话";
|
||||
skipButton.setAttribute("aria-label", "跳过对话,未选择的发言使用默认选项");
|
||||
stage.appendChild(skipButton);
|
||||
overlay.appendChild(skipButton);
|
||||
|
||||
let lineIndex = -1;
|
||||
let timer = null;
|
||||
@@ -189,5 +190,5 @@ export const playDialogue = (lines, options = {}) => new Promise(resolve => {
|
||||
const help = ui.create.div(".mengsan-dialogue-help-shuying", stage);
|
||||
help.textContent = "点击补全文字 · 再次点击继续 · Enter / 空格";
|
||||
showNextLine();
|
||||
textBox.focus();
|
||||
if (!awaitingChoice || typing) textBox.focus({ preventScroll: true });
|
||||
});
|
||||
|
||||
@@ -12,7 +12,7 @@ export const chooseFlow = (title, render, { back } = {}) => new Promise(resolve
|
||||
if (overlay.dataset.resolved) return;
|
||||
overlay.dataset.resolved = "true";
|
||||
overlay.remove();
|
||||
if (previousFocus?.isConnected) previousFocus.focus();
|
||||
if (previousFocus?.isConnected) previousFocus.focus({ preventScroll: true });
|
||||
resolve(id);
|
||||
};
|
||||
const initialFocus = render(overlay, finish);
|
||||
@@ -26,7 +26,7 @@ export const chooseFlow = (title, render, { back } = {}) => new Promise(resolve
|
||||
if (event.shiftKey && document.activeElement === first) { event.preventDefault(); last.focus(); }
|
||||
else if (!event.shiftKey && document.activeElement === last) { event.preventDefault(); first.focus(); }
|
||||
});
|
||||
initialFocus?.focus();
|
||||
initialFocus?.focus({ preventScroll: true });
|
||||
});
|
||||
|
||||
export const chooseButtons = (title, choices, description = "", options = {}) => chooseFlow(title, (overlay, finish) => {
|
||||
|
||||
@@ -181,7 +181,7 @@ export function mountGMManager(session, owner, piles, battle, resources, game) {
|
||||
const created = dialog;
|
||||
dialog.addEventListener("close", () => { if (dialog === created) close(); });
|
||||
dialog.addEventListener("keydown", event => event.stopPropagation());
|
||||
document.body.appendChild(dialog);
|
||||
document.documentElement.appendChild(dialog);
|
||||
try { dialog.showModal(); } catch (error) { close(); throw error; }
|
||||
render();
|
||||
dialog.querySelector(".ms-deck-header button").focus();
|
||||
|
||||
+10
-14
@@ -89,24 +89,20 @@ export function createHandInput(player, session, adapter, fan, env, refresh, log
|
||||
aim = document.createElementNS(svg, "svg");
|
||||
aim.classList.add("mengsan-hand-aim-shuying");
|
||||
aim.setAttribute("aria-hidden", "true");
|
||||
aim.setAttribute("preserveAspectRatio", "none");
|
||||
aim.appendChild(document.createElementNS(svg, "line"));
|
||||
document.documentElement.appendChild(aim);
|
||||
}
|
||||
// 牌面和触点在同一个视口坐标系,统一换算到绘制层的局部坐标。
|
||||
const matrix = aim.getScreenCTM();
|
||||
const determinant = matrix && matrix.a * matrix.d - matrix.b * matrix.c;
|
||||
if (!determinant || !Number.isFinite(determinant)) { removeAim(); return; }
|
||||
const inverse = matrix.inverse();
|
||||
const viewportPoint = aim.createSVGPoint();
|
||||
viewportPoint.x = x; viewportPoint.y = y;
|
||||
const from = viewportPoint.matrixTransform(inverse);
|
||||
viewportPoint.x = point.x; viewportPoint.y = point.y;
|
||||
const to = viewportPoint.matrixTransform(inverse);
|
||||
// Use the painted overlay bounds so card, touch and line share viewport CSS pixels.
|
||||
const overlay = aim.getBoundingClientRect();
|
||||
if (!(overlay.width > 0 && overlay.height > 0)) { removeAim(); return; }
|
||||
const viewBox = `0 0 ${overlay.width} ${overlay.height}`;
|
||||
if (aim.getAttribute("viewBox") !== viewBox) aim.setAttribute("viewBox", viewBox);
|
||||
const line = aim.firstElementChild;
|
||||
line.setAttribute("x1", from.x);
|
||||
line.setAttribute("y1", from.y);
|
||||
line.setAttribute("x2", to.x);
|
||||
line.setAttribute("y2", to.y);
|
||||
line.setAttribute("x1", x - overlay.left);
|
||||
line.setAttribute("y1", y - overlay.top);
|
||||
line.setAttribute("x2", point.x - overlay.left);
|
||||
line.setAttribute("y2", point.y - overlay.top);
|
||||
}
|
||||
function clearSelection(state) {
|
||||
if (!live(state) || !state.selected) return;
|
||||
|
||||
+37
-10
@@ -108,7 +108,7 @@ export function mountBattleHUD(player, battle, env) {
|
||||
const openDetails = (target, id = null) => {
|
||||
if (disposed || frozen || !battle.session.active) return;
|
||||
closeDialog(); previousFocus = document.activeElement;
|
||||
dialog = create('dialog', 'mengsan-hud-dialog-shuying mengsan-deck-dialog-shuying mengsan-relic-dialog-shuying', document.body);
|
||||
dialog = create('dialog', 'mengsan-hud-dialog-shuying mengsan-deck-dialog-shuying mengsan-relic-dialog-shuying', document.documentElement);
|
||||
const current = dialog;
|
||||
const header = create('header', 'ms-deck-header', dialog);
|
||||
create('h2', '', header, `${nameOf(target)} · 当前状态`);
|
||||
@@ -247,8 +247,13 @@ export function mountBattleHUD(player, battle, env) {
|
||||
for (const mark of hiddenMarks) if (!wanted.has(mark)) { mark.classList.remove('mengsan-hud-represented-mark-shuying'); hiddenMarks.delete(mark); }
|
||||
for (const mark of wanted) if (!mark.classList.contains('mengsan-hud-represented-mark-shuying')) { mark.classList.add('mengsan-hud-represented-mark-shuying'); hiddenMarks.add(mark); }
|
||||
}
|
||||
let layout = null;
|
||||
let layout = null, handGeometry;
|
||||
const hudHeightFor = () => layout === 'short' ? 188 : layout === 'narrow' ? 288 : 274;
|
||||
function invalidateHandBounds() {
|
||||
// Decade uses this cache to place the origin of committed card effects.
|
||||
const bounds = window.decadeUI?.boundsCaches?.hand;
|
||||
if (bounds) bounds.updated = false;
|
||||
}
|
||||
const oldLayout = arena.getAttribute('data-mengsan-hud-layout');
|
||||
restores.push(() => {
|
||||
if (arena.getAttribute('data-mengsan-hud-layout') !== layout) return;
|
||||
@@ -272,20 +277,41 @@ export function mountBattleHUD(player, battle, env) {
|
||||
const hudHeight = hudHeightFor();
|
||||
style(arena, '--mengsan-hud-height', `${hudHeight}px`);
|
||||
const large = width >= 1000;
|
||||
style(arena, '--mengsan-hud-left', short ? '216px' : narrow ? '116px' : large ? '352px' : '292px');
|
||||
style(arena, '--mengsan-hud-right', short ? '132px' : narrow ? '116px' : '184px');
|
||||
const left = short ? 216 : narrow ? 116 : large ? 352 : 292;
|
||||
const right = short ? 132 : narrow ? 116 : 184;
|
||||
style(arena, '--mengsan-hud-left', `${left}px`);
|
||||
style(arena, '--mengsan-hud-right', `${right}px`);
|
||||
// Nova sets important geometry on #me and #handcards1. The HUD owns these positions for this battle.
|
||||
const handInset = Math.min(Math.max(left,right),Math.max(0,(width-114)/2));
|
||||
for (const [key,value] of Object.entries({left:`${handInset}px`,right:`${handInset}px`,
|
||||
width:'auto',bottom:short?'64px':'68px'})) style(handRoot,key,value);
|
||||
const firstHand = ui.handcards1Container;
|
||||
if (firstHand && handRoot.contains(firstHand)) {
|
||||
style(firstHand,'left','0px');
|
||||
style(firstHand,'width','100%');
|
||||
}
|
||||
const geometry = [handRoot.offsetLeft, handRoot.offsetTop, handRoot.offsetWidth, handRoot.offsetHeight].join(',');
|
||||
if (geometry !== handGeometry) {
|
||||
handGeometry = geometry;
|
||||
invalidateHandBounds();
|
||||
}
|
||||
style(arena, '--mengsan-profile-info-left', short ? '108px' : narrow ? '22px' : large ? '200px' : '160px');
|
||||
style(arena, '--mengsan-profile-width', short ? '172px' : narrow ? '76px' : large ? '200px' : '130px');
|
||||
skinActor(player);
|
||||
// Inline important dimensions also beat skins with #arena > .player !important rules.
|
||||
const selfLeft = short ? 24 : narrow ? 22 : 40;
|
||||
const selfWidth = short || narrow ? 76 : large ? 144 : 104;
|
||||
const selfBottom = narrow ? 180 : 24;
|
||||
const selfHeight = short || narrow ? 104 : large ? 196 : 148;
|
||||
const infoTop = narrow ? hudHeight - selfBottom + 16 : hudHeight - selfBottom - selfHeight + (short ? 0 : 20);
|
||||
style(arena, '--mengsan-profile-info-top', `${infoTop}px`);
|
||||
for (const [key, value] of Object.entries({left: short ? '24px' : narrow ? '22px' : '40px', right:'auto', top:'auto',
|
||||
bottom:`${selfBottom}px`, width:short ? '76px' : narrow ? '76px' : large ? '144px' : '104px',
|
||||
for (const [key, value] of Object.entries({left:`${selfLeft}px`, right:'auto', top:'auto',
|
||||
bottom:`${selfBottom}px`, width:`${selfWidth}px`,
|
||||
height:`${selfHeight}px`, transform:'none'})) style(player, key, value);
|
||||
style(arena, '--mengsan-side-dock-bottom', `${selfBottom + selfHeight + 12}px`);
|
||||
const statusBottom = selfBottom + selfHeight + 12;
|
||||
const statusBesidePortrait = height - statusBottom < 36;
|
||||
style(arena, '--mengsan-status-left', `${statusBesidePortrait ? selfLeft + selfWidth + 8 : selfLeft}px`);
|
||||
style(arena, '--mengsan-side-dock-bottom', `${statusBesidePortrait ? 8 : statusBottom}px`);
|
||||
style(arena, '--mengsan-relic-dock-bottom', `${selfBottom + selfHeight + (narrow ? -4 : 12)}px`);
|
||||
style(arena, '--mengsan-skill-ceiling', `${Math.min(hudHeight - 36, selfBottom + selfHeight)}px`);
|
||||
style(arena, '--mengsan-status-height', short ? '52px' : narrow ? '84px' : '160px');
|
||||
@@ -339,8 +365,8 @@ export function mountBattleHUD(player, battle, env) {
|
||||
const hudHeight = hudHeightFor();
|
||||
const rail = layout === 'wide' ? 142 : layout === 'short' ? 112 : 96;
|
||||
const actionBottom = layout === 'narrow' ? hudHeight - 48 : hudHeight + 8;
|
||||
const compactActions = response || arena.clientWidth < 1000;
|
||||
for (const [key,value] of Object.entries({position:'absolute',left:compactActions?'16px':'var(--mengsan-hud-left)',right:compactActions?'16px':'var(--mengsan-hud-right)',top:'auto',bottom:`${actionBottom}px`,width:'auto','max-height':'none',transform:'none'})) style(ui.control,key,value);
|
||||
const actionInset = response || arena.clientWidth < 1000 ? '16px' : 'max(var(--mengsan-hud-left),var(--mengsan-hud-right))';
|
||||
for (const [key,value] of Object.entries({position:'absolute',left:actionInset,right:actionInset,top:'auto',bottom:`${actionBottom}px`,width:'auto','max-height':'none',transform:'none'})) style(ui.control,key,value);
|
||||
for (const group of ui.control.children) if (group.classList.contains('control')) {
|
||||
if (external.includes(group)) {
|
||||
ownClass(group,'mengsan-hud-native-skills-shuying');
|
||||
@@ -362,7 +388,7 @@ export function mountBattleHUD(player, battle, env) {
|
||||
const host=node.offsetParent||arena,a=arena.getBoundingClientRect(),h=host.getBoundingClientRect();
|
||||
const scale=h.width/host.offsetWidth||1,zoom=a.width/arena.clientWidth||1;
|
||||
const responseConfirm = response && node === ui.confirm;
|
||||
const center=responseConfirm ? arena.clientWidth/2 : (parseFloat(arena.style.getPropertyValue('--mengsan-hud-left'))+arena.clientWidth-parseFloat(arena.style.getPropertyValue('--mengsan-hud-right')))/2;
|
||||
const center=arena.clientWidth/2;
|
||||
const side=responseConfirm ? 0 : node===ui.confirm?-1:1;
|
||||
for(const [key,value] of Object.entries({position:'absolute',left:`${(a.left+center*zoom-h.left)/scale+side*80}px`,right:'auto',top:'auto',bottom:`${(h.bottom-a.bottom+actionBottom*zoom)/scale}px`,width:`${Math.min(rail,140)}px`,transform:'translateX(-50%)'}))style(node,key,value);
|
||||
}
|
||||
@@ -420,6 +446,7 @@ export function mountBattleHUD(player, battle, env) {
|
||||
for (const mark of hiddenMarks) mark.classList.remove('mengsan-hud-represented-mark-shuying'); hiddenMarks.clear();
|
||||
for (const restore of restores.reverse()) restore();
|
||||
releaseNodes();
|
||||
invalidateHandBounds();
|
||||
root.remove(); link.remove();
|
||||
}
|
||||
ownClass(document.body, 'mengsan-hud-active-shuying'); ownClass(arena, 'mengsan-hud-arena-shuying');
|
||||
|
||||
@@ -82,9 +82,9 @@ export function createOverlayLayout(arena, hand, ui, player) {
|
||||
.filter(button => !button.closest('.mengsan-hud-external-control-shuying,.removing,.closing'))
|
||||
.map(button => button.getBoundingClientRect()).filter(box => box.height && box.width);
|
||||
}
|
||||
function positionResponseActions(handTop, center, gap, used) {
|
||||
function alignActions(handTop, center, gap, used, response) {
|
||||
const controls = [ui.control];
|
||||
if (ui.confirm?.isConnected && !ui.control.contains(ui.confirm)) controls.push(ui.confirm);
|
||||
if (response && ui.confirm?.isConnected && !ui.control.contains(ui.confirm)) controls.push(ui.confirm);
|
||||
let top = Infinity;
|
||||
for (const node of controls) {
|
||||
const isRoot = node === ui.control;
|
||||
@@ -102,7 +102,7 @@ export function createOverlayLayout(arena, hand, ui, player) {
|
||||
const right = Math.max(...centered.map(box => box.right));
|
||||
const scale = hostScale(node), previous = currentShift(node,scale);
|
||||
const bottom = Math.max(...buttons.map(box => box.bottom)) - previous.y;
|
||||
const offset = handTop - gap - bottom;
|
||||
const offset = response ? handTop - gap - bottom : 0;
|
||||
shift(node,center - (left + right)/2 + previous.x,offset,scale,used);
|
||||
top = Math.min(top, ...buttons.map(box => box.top - previous.y + offset));
|
||||
}
|
||||
@@ -140,16 +140,16 @@ export function createOverlayLayout(arena, hand, ui, player) {
|
||||
const handCards=[...hand.querySelectorAll('.handcards>.card')].map(node=>node.getBoundingClientRect()).filter(box=>box.height&&box.width);
|
||||
const handTop=Math.min(handBox.top,...handCards.map(box=>box.top));
|
||||
const gap=Math.max(4,(arena.clientHeight<=500?6:8)*zoom);
|
||||
const responseTop=response ? positionResponseActions(handCards.length ? Math.min(...handCards.map(box=>box.top)) : handTop,(a.left+a.right)/2,gap,used) : Infinity;
|
||||
const actionTop=alignActions(handCards.length ? Math.min(...handCards.map(box=>box.top)) : handTop,(a.left+a.right)/2,gap,used,response);
|
||||
const controlTop=ui.control.getBoundingClientRect().top;
|
||||
let promptBottom=Math.min(controlTop-10*zoom,a.bottom-(footerHeight+54)*zoom);
|
||||
if(Number.isFinite(responseTop))promptBottom=responseTop-gap;
|
||||
if(response && Number.isFinite(actionTop))promptBottom=actionTop-gap;
|
||||
let promptTop=Infinity;
|
||||
for(const node of prompts) {
|
||||
if(node.hidden || !node.getClientRects().length)continue;
|
||||
mark(node,'mengsan-hud-prompt-shuying');used.add(node);
|
||||
const promptX=response?a.left+16*zoom:x;
|
||||
const promptWidth=response?arena.clientWidth-32:width;
|
||||
const promptX=a.left+(arena.clientWidth-promptWidth)*zoom/2;
|
||||
position(node,promptX,0,promptWidth,arena.clientHeight<=500?34:64);
|
||||
const height=node.getBoundingClientRect().height;
|
||||
position(node,promptX,Math.max(a.top+(response?8:50)*zoom,promptBottom-height),promptWidth,arena.clientHeight<=500?34:64);
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
.mengsan-hud-health-track-shuying { width:100%;height:4px;margin:0 0 2px;background:#ffffff1a;border-radius:4px;overflow:hidden; }
|
||||
.mengsan-hud-health-track-shuying>span { height:100%;background:#9bb78d; }
|
||||
.mengsan-hud-energy-shuying { color:#eacb87;font-size:16px;font-variant-numeric:tabular-nums;white-space:nowrap; }
|
||||
.mengsan-hud-center-shuying { left:40px;right:auto;top:auto;bottom:var(--mengsan-side-dock-bottom);width:var(--mengsan-profile-width);height:var(--mengsan-status-height); }
|
||||
.mengsan-hud-center-shuying { left:var(--mengsan-status-left);right:auto;top:auto;bottom:var(--mengsan-side-dock-bottom);width:var(--mengsan-profile-width);height:var(--mengsan-status-height); }
|
||||
.mengsan-hud-shuying .mengsan-hud-statuses-shuying { display:grid;grid-template-columns:repeat(auto-fill,32px);grid-auto-rows:32px;align-content:end;gap:6px;overflow:hidden;white-space:nowrap;height:100%; }
|
||||
.mengsan-hud-shuying .mengsan-hud-status-shuying { display:flex;align-items:center;justify-content:center;width:32px;height:32px;min-width:0;min-height:32px;padding:2px;background:transparent;border-radius:6px;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;touch-action:pan-y; }
|
||||
.mengsan-hud-status-shuying img { width:26px;height:26px;object-fit:contain;pointer-events:none; }
|
||||
@@ -29,7 +29,7 @@
|
||||
Keep them above the portrait (25) and below action controls (30).
|
||||
Inline elevations used by awakening animations still take precedence. */
|
||||
body.mengsan-hud-active-shuying>#decadeUI-canvas { z-index:28; }
|
||||
.mengsan-hud-hand-shuying { position:absolute!important;left:var(--mengsan-hud-left)!important;right:var(--mengsan-hud-right)!important;bottom:68px!important;top:auto!important;width:calc(100% - var(--mengsan-hud-left) - var(--mengsan-hud-right))!important;height:calc(var(--mengsan-hud-height,274px) - 126px)!important;z-index:24!important;background:none!important;border:0!important;transform:none!important;pointer-events:none; }
|
||||
.mengsan-hud-hand-shuying { position:absolute!important;top:auto!important;height:calc(var(--mengsan-hud-height,274px) - 126px)!important;z-index:24!important;background:none!important;border:0!important;transform:none!important;pointer-events:none; }
|
||||
.mengsan-hud-hand-shuying .handcards>.card { pointer-events:auto; }
|
||||
.mengsan-hud-mebg-shuying,.mengsan-hud-hand-shuying>.fakeme.avatar { display:none!important; }
|
||||
/* These explicit references cover Decade's nested camp-wrap and hp-wrap as well. */
|
||||
@@ -75,12 +75,10 @@ body.mengsan-hud-active-shuying .mengsan-hud-potion-action-shuying { display:non
|
||||
[data-mengsan-hud-layout="short"] .mengsan-hud-hp-shuying,[data-mengsan-hud-layout="short"] .mengsan-hud-block-shuying { font-size:11px; }
|
||||
[data-mengsan-hud-layout="short"] .mengsan-hud-name-shuying { font-size:15px; }
|
||||
[data-mengsan-hud-layout="short"] .mengsan-hud-energy-shuying { font-size:14px; }
|
||||
[data-mengsan-hud-layout="short"] .mengsan-hud-hand-shuying { bottom:64px!important;height:calc(var(--mengsan-hud-height) - 122px)!important; }
|
||||
[data-mengsan-hud-layout="short"] .mengsan-hud-center-shuying { top:auto;left:24px; }
|
||||
[data-mengsan-hud-layout="short"] .mengsan-hud-hand-shuying { height:calc(var(--mengsan-hud-height) - 122px)!important; }
|
||||
[data-mengsan-hud-layout="short"] .mengsan-hud-shuying .mengsan-hud-status-shuying { min-height:26px;padding:2px 4px; }
|
||||
[data-mengsan-hud-layout="short"] .mengsan-hud-status-shuying img { width:18px;height:18px; }
|
||||
[data-mengsan-hud-layout="narrow"] .mengsan-hud-shuying .mengsan-hud-info-shuying { left:22px;width:76px;font-size:12px;gap:5px; }
|
||||
[data-mengsan-hud-layout="narrow"] .mengsan-hud-hand-shuying { bottom:68px!important; }
|
||||
[data-mengsan-hud-layout="narrow"] .mengsan-hud-name-shuying { font-size:16px; }
|
||||
[data-mengsan-hud-layout="narrow"] .mengsan-hud-status-shuying span { display:none; }
|
||||
#arena.mengsan-hud-arena-shuying>.mengsan-hud-notification-shuying { width:148px!important;max-width:148px!important;min-height:30px;height:30px!important;transition:none!important;font:600 16px/30px "Microsoft YaHei",sans-serif!important;white-space:nowrap; }
|
||||
@@ -119,7 +117,6 @@ body.mengsan-hud-active-shuying #arena .mengsan-hud-equips-shuying::-webkit-scro
|
||||
[data-mengsan-hud-layout="narrow"] .mengsan-hand-relics-shuying { right:16px!important;width:96px!important;max-width:96px!important;max-height:36px;flex-wrap:nowrap;justify-content:flex-start;overflow-x:auto;overflow-y:hidden;touch-action:pan-x; }
|
||||
body.mengsan-hud-active-shuying #arena>.mengsan-hud-controls-shuying>.mengsan-hud-native-skills-shuying { flex-direction:column!important;flex-wrap:nowrap!important;align-items:stretch!important;max-width:none!important;overflow:auto!important; }
|
||||
body.mengsan-hud-active-shuying #arena .mengsan-hud-native-skills-shuying>div { width:100%!important;min-width:0!important;box-sizing:border-box!important;padding:8px 10px!important;min-height:40px!important;font:14px/20px "Microsoft YaHei",sans-serif!important;white-space:normal!important; }
|
||||
[data-mengsan-hud-layout="narrow"] .mengsan-hud-center-shuying { left:22px; }
|
||||
[data-mengsan-hud-layout="short"] .mengsan-hud-shuying .mengsan-hud-statuses-shuying { height:100%; }
|
||||
.mengsan-hud-prompt-shuying { box-sizing:border-box!important;height:auto!important;min-height:0!important;overflow:auto!important;padding:2px 6px!important;background:none!important;border:0!important;box-shadow:none!important;text-align:center!important;z-index:32!important;color:#f6edcb!important;text-shadow:0 1px 3px #000,0 0 6px #000!important; }
|
||||
body.mengsan-hud-active-shuying .mengsan-hud-card-intro-shuying { box-sizing:border-box!important;z-index:90!important;height:auto!important;min-height:0!important;overflow:auto!important;border-radius:14px!important;background:#202020f5!important;box-shadow:0 8px 24px #0007!important;color:#f4f4f4!important;transition:none!important; }
|
||||
|
||||
@@ -415,7 +415,8 @@ export const showMap = (run, { saveRun } = {}) => new Promise(resolve => {
|
||||
suppressClick = true;
|
||||
if (!viewport.hasPointerCapture(event.pointerId)) viewport.setPointerCapture(event.pointerId);
|
||||
viewport.classList.add("dragging");
|
||||
viewport.scrollTop = drag.top - distance;
|
||||
const scale = viewport.getBoundingClientRect().height / viewport.offsetHeight || 1;
|
||||
viewport.scrollTop = drag.top - distance / scale;
|
||||
event.preventDefault();
|
||||
});
|
||||
const endDrag = event => {
|
||||
|
||||
@@ -145,7 +145,7 @@ export const askMenu = (title, description, choices) => new Promise(resolve => {
|
||||
dialog.appendChild(button);
|
||||
}
|
||||
dialog.addEventListener("cancel", event => { event.preventDefault(); finish(null); });
|
||||
document.body.appendChild(dialog);
|
||||
document.documentElement.appendChild(dialog);
|
||||
dialog.showModal();
|
||||
dialog.querySelector("button")?.focus();
|
||||
});
|
||||
|
||||
@@ -83,7 +83,7 @@ export function mountRelics(session, run, battleRelics, { stripRoot = ui.me } =
|
||||
});
|
||||
dialog.addEventListener("keydown", event => event.stopPropagation());
|
||||
refresh();
|
||||
document.body.appendChild(dialog);
|
||||
document.documentElement.appendChild(dialog);
|
||||
try { dialog.showModal(); dismiss.focus(); }
|
||||
catch (error) { close(); throw error; }
|
||||
};
|
||||
|
||||
+75
-25
@@ -303,9 +303,26 @@
|
||||
|
||||
.mengsan-dialogue-stage-shuying {
|
||||
position: absolute !important;
|
||||
inset: 0 !important;
|
||||
inset: 68px 0 max(8px, env(safe-area-inset-bottom)) !important;
|
||||
width: 100% !important;
|
||||
height: 100% !important;
|
||||
height: auto !important;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding: 16px 0 6px;
|
||||
overflow: auto;
|
||||
touch-action: pan-y;
|
||||
}
|
||||
|
||||
.mengsan-dialogue-content-shuying {
|
||||
position: relative !important;
|
||||
display: flex;
|
||||
flex: none;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 28px;
|
||||
margin-top: auto;
|
||||
width: min(1120px, 92%);
|
||||
}
|
||||
|
||||
.mengsan-dialogue-chapter-shuying {
|
||||
@@ -388,13 +405,9 @@
|
||||
}
|
||||
|
||||
.mengsan-dialogue-box-shuying {
|
||||
position: absolute !important;
|
||||
left: 50% !important;
|
||||
right: auto !important;
|
||||
bottom: clamp(18px, 4vh, 42px) !important;
|
||||
top: auto !important;
|
||||
transform: translateX(-50%) !important;
|
||||
width: min(1120px, 92vw) !important;
|
||||
position: relative !important;
|
||||
inset: auto !important;
|
||||
width: 100% !important;
|
||||
height: auto !important;
|
||||
min-height: clamp(120px, 20vh, 180px);
|
||||
padding: clamp(32px, 5vh, 46px) clamp(24px, 4vw, 52px) 28px;
|
||||
@@ -496,9 +509,8 @@
|
||||
height: 146px !important;
|
||||
padding: 4px;
|
||||
}
|
||||
.mengsan-dialogue-content-shuying { width: 96%; }
|
||||
.mengsan-dialogue-box-shuying {
|
||||
bottom: 8px !important;
|
||||
width: 96vw !important;
|
||||
min-height: 126px;
|
||||
padding: 30px 18px 24px;
|
||||
}
|
||||
@@ -548,6 +560,7 @@
|
||||
|
||||
.mengsan-map-panel-shuying {
|
||||
padding: 0 !important;
|
||||
container-type: size;
|
||||
background:
|
||||
linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px),
|
||||
linear-gradient(rgba(255,255,255,.012) 1px, transparent 1px);
|
||||
@@ -783,7 +796,7 @@
|
||||
position: relative !important;
|
||||
z-index: 1;
|
||||
display: block !important;
|
||||
width: min(420px, calc(100vw - 32px));
|
||||
width: min(420px, calc(100% - 32px));
|
||||
height: 100% !important;
|
||||
padding: 0 !important;
|
||||
border: 0;
|
||||
@@ -920,7 +933,7 @@
|
||||
.mengsan-ink-legend-shuying { display: none; }
|
||||
.mengsan-map-shuying .mengsan-node-shuying { width: 52px; height: 52px; padding: 9px; }
|
||||
.mengsan-map-menu-layer-shuying { align-items: flex-end; }
|
||||
.mengsan-map-menu-sheet-shuying { width: 100%; height: min(82dvh, 680px) !important; border-right: 0; border-top: 1px solid rgba(210,175,101,.34); border-radius: 16px 16px 0 0; animation-name: mengsan-menu-enter-mobile-shuying; }
|
||||
.mengsan-map-menu-sheet-shuying { width: 100%; height: min(82%, 680px) !important; border-right: 0; border-top: 1px solid rgba(210,175,101,.34); border-radius: 16px 16px 0 0; animation-name: mengsan-menu-enter-mobile-shuying; }
|
||||
@keyframes mengsan-menu-enter-mobile-shuying { from { opacity: 0; transform: translateY(24px); } }
|
||||
.mengsan-map-menu-title-shuying { font-size: 24px; }
|
||||
.mengsan-map-menu-header-shuying { inset: 14px 14px auto 14px !important; }
|
||||
@@ -929,6 +942,35 @@
|
||||
.mengsan-map-menu-action-shuying { min-height: 64px; }
|
||||
}
|
||||
|
||||
@container (max-height: 325px) {
|
||||
.mengsan-map-menu-sheet-shuying { overflow-y: auto; overscroll-behavior-y: contain; }
|
||||
.mengsan-map-menu-header-shuying,
|
||||
.mengsan-map-menu-content-shuying,
|
||||
.mengsan-map-menu-footer-shuying {
|
||||
position: relative !important;
|
||||
inset: auto !important;
|
||||
width: auto !important;
|
||||
margin: 0 14px;
|
||||
}
|
||||
.mengsan-map-menu-header-shuying { height: auto !important; min-height: 54px; padding: 4px; }
|
||||
.mengsan-map-menu-content-shuying { overflow: visible; padding-top: 8px; }
|
||||
.mengsan-map-menu-footer-shuying { height: auto !important; padding: 8px 4px; }
|
||||
}
|
||||
@container (max-height: 190px) {
|
||||
.mengsan-map-header-shuying { grid-template-columns: auto minmax(0, 1fr); min-height: 0; gap: 4px 8px; padding: 4px 8px; }
|
||||
.mengsan-map-menu-trigger-shuying { width: 34px; min-width: 34px; min-height: 34px; }
|
||||
.mengsan-map-title-group-shuying > .mengsan-title-shuying { font-size: 16px; }
|
||||
.mengsan-map-header-shuying > .mengsan-map-status-shuying {
|
||||
grid-column: 1 / -1; justify-self: stretch; justify-content: flex-start;
|
||||
min-width: 0; flex-wrap: nowrap; gap: 4px; overflow-x: auto;
|
||||
}
|
||||
.mengsan-map-stat-shuying { flex: 0 0 auto; min-width: 38px; min-height: 24px; padding: 1px 4px; }
|
||||
.mengsan-map-status-shuying .mengsan-potion-slots { flex: none; flex-wrap: nowrap; }
|
||||
.mengsan-map-status-shuying .mengsan-potion-slot { width: 26px; height: 26px; }
|
||||
.mengsan-map-status-shuying .mengsan-potion-import { flex: none; white-space: nowrap; }
|
||||
.mengsan-map-viewport-shuying { padding-block: 0; }
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.mengsan-map-menu-sheet-shuying { animation: none !important; }
|
||||
.mengsan-map-menu-trigger-shuying,
|
||||
@@ -954,6 +996,11 @@
|
||||
.mengsan-flow-overlay-shuying {
|
||||
background: radial-gradient(ellipse at 18% 20%, #53635766, transparent 55%), linear-gradient(120deg, #172724f5, #101b1df5);
|
||||
padding: 80px 24px 28px;
|
||||
overflow: clip;
|
||||
}
|
||||
.mengsan-flow-overlay-shuying > .mengsan-panel-shuying {
|
||||
min-height: 0;
|
||||
overscroll-behavior: contain;
|
||||
}
|
||||
.mengsan-flow-panel-shuying {
|
||||
width: min(680px, 100%) !important;
|
||||
@@ -1156,30 +1203,35 @@ button.mengsan-card-choice-skip-shuying:hover { color: #fff1d5; border-color: #d
|
||||
.mengsan-menu-dialog-shuying p { margin: 0 0 24px; color: var(--flow-muted); }
|
||||
.mengsan-menu-dialog-shuying button { display: block; width: 100%; min-height: 48px; margin-top: 12px; border: 1px solid #c4a56888; border-radius: 3px; padding: 10px; font: inherit; color: var(--flow-paper); background: #ffffff08; cursor: pointer; }
|
||||
.mengsan-menu-dialog-shuying button.danger { background: var(--flow-danger); border-color: #d89586; }
|
||||
.mengsan-dialogue-overlay-shuying { background: radial-gradient(ellipse at 35% 25%, #62736544, transparent 60%), linear-gradient(120deg, #172724ee, #101b1dee); }
|
||||
.mengsan-dialogue-chapter-shuying { top: 26px !important; left: 24px !important; max-width: calc(100% - 160px); color: var(--flow-muted); }
|
||||
.mengsan-dialogue-overlay-shuying { container-type: size; background: radial-gradient(ellipse at 35% 25%, #62736544, transparent 60%), linear-gradient(120deg, #172724ee, #101b1dee); }
|
||||
.mengsan-dialogue-chapter-shuying { top: 26px !important; left: 50% !important; right: auto !important; transform: translateX(-50%); max-width: 30%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--flow-muted); }
|
||||
.mengsan-dialogue-box-shuying { border-radius: 4px; border-color: var(--flow-gold); background: #172724f5; padding-bottom: 34px; }
|
||||
.mengsan-dialogue-speaker-shuying { border-radius: 2px; color: #172724; background: #efe5cf; font-family: "KaiTi", "SimSun", serif; }
|
||||
.mengsan-dialogue-text-shuying { color: var(--flow-paper); font-size: clamp(17px, 2vw, 22px); line-height: 1.85; max-height: 30vh; overflow: auto; }
|
||||
.mengsan-dialogue-help-shuying { position: absolute !important; bottom: 8px; left: 16px; right: 16px; text-align: center; font-size: 12px; color: var(--flow-muted); pointer-events: none; }
|
||||
.mengsan-dialogue-choices-shuying { position: absolute !important; left: 50%; bottom: clamp(210px, 32vh, 290px); transform: translateX(-50%); width: min(580px, 88vw); display: grid; gap: 10px; z-index: 5; }
|
||||
.mengsan-dialogue-help-shuying { position: relative !important; flex: none; margin: 8px 16px 0; text-align: center; font-size: 12px; color: var(--flow-muted); pointer-events: none; }
|
||||
.mengsan-dialogue-choices-shuying { position: relative !important; width: min(580px, 100%); display: grid; gap: 10px; z-index: 5; }
|
||||
.mengsan-dialogue-choices-shuying:empty { display: none; }
|
||||
.mengsan-dialogue-skip-shuying { position: absolute !important; top: max(18px, env(safe-area-inset-top)); left: max(18px, env(safe-area-inset-left)); z-index: 6; padding: 8px 14px; border: 1px solid var(--flow-gold); border-radius: 4px; color: var(--flow-paper); background: #172724e8; font: inherit; cursor: pointer; }
|
||||
.mengsan-dialogue-skip-shuying:hover, .mengsan-dialogue-skip-shuying:focus-visible { background: #304540; outline: 2px solid var(--flow-gold); outline-offset: 2px; }
|
||||
.mengsan-dialogue-choice-shuying { padding: 12px 18px; border: 1px solid var(--flow-gold); border-radius: 4px; color: var(--flow-paper); background: #172724f5; text-align: left; font: inherit; cursor: pointer; }
|
||||
.mengsan-dialogue-choice-shuying:hover, .mengsan-dialogue-choice-shuying:focus-visible { background: #304540; outline: 2px solid var(--flow-gold); outline-offset: 2px; }
|
||||
@container (max-height: 280px) {
|
||||
.mengsan-dialogue-stage-shuying { padding-top: 4px; }
|
||||
.mengsan-dialogue-choices-shuying { gap: 6px; }
|
||||
.mengsan-dialogue-choice-shuying { min-height: 36px; padding: 6px 14px; }
|
||||
}
|
||||
@media (max-width: 600px) {
|
||||
.mengsan-dialogue-chapter-shuying { display: block !important; font-size: 14px; }
|
||||
.mengsan-flow-overlay-shuying { padding: 78px 12px 16px; }
|
||||
.mengsan-flow-panel-shuying { padding: 24px 18px; }
|
||||
.mengsan-flow-panel-shuying > .mengsan-title-shuying { font-size: 30px; }
|
||||
.mengsan-flow-panel-shuying .mengsan-choice-shuying { padding: 14px; }
|
||||
.mengsan-dialogue-box-shuying { bottom: 36px !important; }
|
||||
}
|
||||
@media (max-height: 500px) {
|
||||
.mengsan-flow-overlay-shuying { padding-top: 70px; padding-bottom: 12px; }
|
||||
.mengsan-flow-panel-shuying { padding: 18px 24px; }
|
||||
.mengsan-flow-panel-shuying > .mengsan-description-shuying { margin-bottom: 16px; }
|
||||
.mengsan-dialogue-box-shuying { bottom: 28px !important; min-height: 100px; max-height: 50vh; padding: 24px 20px 20px; }
|
||||
.mengsan-dialogue-box-shuying { min-height: 100px; padding: 24px 20px 20px; }
|
||||
.mengsan-dialogue-text-shuying { max-height: 24vh; }
|
||||
.mengsan-dialogue-portrait-frame-shuying {
|
||||
height: 110px !important;
|
||||
@@ -1267,7 +1319,8 @@ dialog.mengsan-deck-dialog-shuying::backdrop { background: #080706b8; }
|
||||
|
||||
/* Battle-only control; removed with its owning session. */
|
||||
.mengsan-battle-piles-button-shuying {
|
||||
position: fixed !important; right: max(14px, env(safe-area-inset-right)); top: 110px;
|
||||
--mengsan-battle-side-top: clamp(4px, calc(100% - 100px), 110px);
|
||||
position: fixed !important; right: max(14px, env(safe-area-inset-right)); top: var(--mengsan-battle-side-top);
|
||||
z-index: 35; min-width: 64px; min-height: 44px; padding: 8px 14px;
|
||||
border: 1px solid #dcb578; border-radius: 8px; background: #30251eee;
|
||||
color: #f4e7cc; font: 16px/1.4 "Microsoft YaHei", sans-serif;
|
||||
@@ -1282,7 +1335,7 @@ dialog.mengsan-deck-dialog-shuying::backdrop { background: #080706b8; }
|
||||
.mengsan-gm-dialog-shuying .ms-gm-editor { overflow: auto; flex: 1; min-height: 0; border-top: 1px solid #96754e; padding: 12px 4px; }
|
||||
.mengsan-gm-dialog-shuying .ms-gm-affixes { display: grid; grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); gap: 10px; margin-top: 12px; }
|
||||
.mengsan-gm-dialog-shuying .ms-gm-affixes button:disabled { opacity: .55; cursor: not-allowed; }
|
||||
@media (max-height: 500px) { .mengsan-battle-piles-button-shuying { top: 70px; right: max(8px, env(safe-area-inset-right)); } }
|
||||
@media (max-height: 500px) { .mengsan-battle-piles-button-shuying { --mengsan-battle-side-top: clamp(4px, calc(100% - 100px), 70px); right: max(8px, env(safe-area-inset-right)); } }
|
||||
|
||||
/* Only session-created Mengsan players; retain internal identity and seat order. */
|
||||
.player.mengsan-hide-identity-shuying > .identity {
|
||||
@@ -1408,7 +1461,7 @@ body.mengsan-battle-ui-shuying #arena[data-number="3"] > .player:is([data-positi
|
||||
height: 22px;
|
||||
object-fit: contain;
|
||||
}
|
||||
.mengsan-battle-relics-button-shuying { top: 162px; }
|
||||
.mengsan-battle-relics-button-shuying { top: calc(var(--mengsan-battle-side-top) + 52px); }
|
||||
.mengsan-hand-relics-shuying {
|
||||
position: absolute !important;
|
||||
left: 0;
|
||||
@@ -1503,9 +1556,6 @@ body.mengsan-battle-ui-shuying #arena[data-number="3"] > .player:is([data-positi
|
||||
.mengsan-map-inventory-row-shuying > .mengsan-relic-icon-shuying { width: 40px; height: 40px; }
|
||||
.mengsan-relic-choice-tile-shuying .mengsan-card-choice-art-shuying img { padding: 14px; box-sizing: border-box; background: transparent; }
|
||||
.mengsan-relic-choice-tile-shuying .mengsan-card-choice-art-shuying:has(img) .mengsan-card-choice-glyph-shuying { display: none; }
|
||||
@media (max-height: 500px) {
|
||||
.mengsan-battle-relics-button-shuying { top: 122px; }
|
||||
}
|
||||
.mengsan-bonds-shuying {
|
||||
position: relative !important;
|
||||
flex-shrink: 0;
|
||||
|
||||
Reference in New Issue
Block a user