修正视图问题

This commit is contained in:
RT15548
2025-12-20 13:37:28 +08:00
committed by GitHub
parent 282b9c183a
commit c37b2bbe4e
3 changed files with 3584 additions and 3582 deletions

View File

@@ -599,6 +599,6 @@ export const buildOverlayHtml = src => `<div id="xiaobaix-story-outline-overlay"
<div class="xb-so-resize-mobile" style="position:absolute!important;right:0!important;bottom:0!important;width:24px!important;height:24px!important;cursor:nwse-resize!important;display:none!important;z-index:10!important;touch-action:none!important;background:linear-gradient(135deg,transparent 50%,rgba(0,0,0,0.2) 50%)!important;border-radius:0 0 12px 0!important;"></div>
</div></div>`;
export const MOBILE_LAYOUT_STYLE = 'position:absolute!important;left:0!important;right:0!important;top:0!important;bottom:auto!important;width:100%!important;height:40vh!important;transform:none!important;z-index:1!important;pointer-events:auto!important;border-radius:0 0 16px 16px!important;box-shadow:0 8px 32px rgba(0,0,0,.4)!important;overflow:hidden!important;display:flex!important;flex-direction:column!important;background:#f4f4f4!important;';
export const MOBILE_LAYOUT_STYLE = 'position:absolute!important;left:0!important;right:0!important;top:0!important;bottom:auto!important;width:100%!important;height:350px!important;transform:none!important;z-index:1!important;pointer-events:auto!important;border-radius:0 0 16px 16px!important;box-shadow:0 8px 32px rgba(0,0,0,.4)!important;overflow:hidden!important;display:flex!important;flex-direction:column!important;background:#f4f4f4!important;';
export const DESKTOP_LAYOUT_STYLE = 'position:absolute!important;left:50%!important;top:50%!important;transform:translate(-50%,-50%)!important;width:600px!important;max-width:90vw!important;height:450px!important;max-height:80vh!important;z-index:1!important;pointer-events:auto!important;border-radius:12px!important;box-shadow:0 8px 32px rgba(0,0,0,.4)!important;overflow:hidden!important;display:flex!important;flex-direction:column!important;background:#f4f4f4!important;';

View File

@@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>剧情地图</title>
<title>小白板</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<style>
*{margin:0;padding:0;box-sizing:border-box}
@@ -62,7 +62,7 @@
.side-menu-panel .btn{font-size:11px;padding:5px 10px}
/* 工具栏 */
.toolbar{height:44px;background:var(--bg2);border-bottom:1px solid var(--bd);padding:0 12px 0 56px}
.toolbar{height:44px;background:var(--bg2);border-bottom:1px solid var(--bd);padding:0 12px 0 56px;position:relative;z-index:200}
.toolbar-t{font-size:14px;font-weight:600;margin-right:auto}
.toolbar-t span{font-weight:400;color:var(--c3);margin-left:8px;font-size:12px}
@@ -227,7 +227,7 @@
.loc-i-info{font-size:11px;opacity:.7;margin-top:2px}
/* 底部弹窗 */
.mob-pop{position:fixed;bottom:0;left:0;right:0;background:var(--bg2);border-top:1px solid var(--bd);border-radius:12px 12px 0 0;box-shadow:0 -2px 16px rgba(0,0,0,.1);z-index:200;display:none;flex-direction:column}
.mob-pop{position:fixed;bottom:0;left:0;right:0;background:var(--bg2);border-top:1px solid var(--bd);border-radius:12px 12px 0 0;box-shadow:0 -2px 16px rgba(0,0,0,.1);z-index:101;display:none;flex-direction:column}
.mob-pop.act{display:flex}
.mob-pop.drag{transition:none!important}
.mob-pop:not(.drag){transition:height .2s ease-out}
@@ -291,7 +291,7 @@
.side-menu{padding:5px 4px}
.nav-i{width:28px;height:28px}
.nav-i i{font-size:11px}
.toolbar{padding:20px}
.toolbar{height:44px;padding:0 12px 0 56px;}
.toolbar-t span{display:none}
.btn{padding:6px 10px;font-size:11px}
.modal-p{max-width:100%;max-height:100%;border-radius:0}
@@ -321,7 +321,7 @@
<!-- 工具栏 -->
<div class="toolbar fc g10 usn">
<div class="toolbar-t">剧情地图<span>Story Outline</span></div>
<div class="toolbar-t">小白板<span>预测试</span></div>
<button class="btn btn-s fc g6" id="btn-deduce"><i class="fa-solid fa-wand-magic-sparkles"></i>生成</button>
<button class="btn btn-s fc g6" id="btn-settings"><i class="fa-solid fa-gear"></i>设置</button>
<button class="btn btn-c fcc" id="btn-close"></button>

View File

@@ -1,6 +1,6 @@
/**
* ============================================================================
* Story Outline 模块 - 剧情地图系统
* Story Outline 模块 - 小白板
* ============================================================================
* 功能生成和管理RPG式剧情世界提供地图导航、NPC管理、短信系统、世界推演
*
@@ -393,7 +393,7 @@ function formatOutlinePrompt() {
if (!store?.outlineData) return "";
const { outlineData: d, dataChecked: c, playerLocation } = store, stage = store.stage ?? 0;
let text = "## Story Outline (剧情地图数据)\n\n", has = false;
let text = "## Story Outline (剧情数据)\n\n", has = false;
// 世界真相
if (c?.meta && d.meta?.truth) {
@@ -1088,7 +1088,7 @@ function createOverlay() {
setupDrag(overlay.querySelector(".xb-so-resize-mobile"), {
shouldHandle: () => isMobile(),
onStart(e) { setPtr('none'); return { sy: e.clientY, sh: wrap.offsetHeight }; },
onMove(e, s) { wrap.style.height = Math.max(200, Math.min(window.innerHeight * 0.9, s.sh + e.clientY - s.sy)) + 'px'; },
onMove(e, s) { wrap.style.height = Math.max(44, Math.min(window.innerHeight * 0.9, s.sh + e.clientY - s.sy)) + 'px'; },
onEnd: () => setPtr('')
});
@@ -1098,14 +1098,16 @@ function createOverlay() {
function updateLayout() {
const wrap = document.querySelector(".xb-so-frame-wrap"); if (!wrap) return;
const drag = document.querySelector(".xb-so-drag-handle"), resize = document.querySelector(".xb-so-resize-handle"), mobile = document.querySelector(".xb-so-resize-mobile");
if (isMobile()) { if (drag) drag.style.display = 'none'; if (resize) resize.style.display = 'none'; if (mobile) mobile.style.display = 'flex'; wrap.style.cssText = MOBILE_LAYOUT_STYLE; }
if (isMobile()) { if (drag) drag.style.display = 'none'; if (resize) resize.style.display = 'none'; if (mobile) mobile.style.display = 'flex'; wrap.style.cssText = MOBILE_LAYOUT_STYLE; const fixedHeight = window.innerHeight * 0.4; wrap.style.height = Math.max(44, fixedHeight) + 'px'; wrap.style.top = '0px'; }
else { if (drag) drag.style.display = 'block'; if (resize) resize.style.display = 'block'; if (mobile) mobile.style.display = 'none'; wrap.style.cssText = DESKTOP_LAYOUT_STYLE; }
}
function showOverlay() { if (!overlayCreated) createOverlay(); frameReady = false; const f = document.getElementById("xiaobaix-story-outline-iframe"); if (f) f.src = IFRAME_PATH; updateLayout(); $("#xiaobaix-story-outline-overlay").show(); }
function hideOverlay() { $("#xiaobaix-story-outline-overlay").hide(); }
$(window).on('resize', () => { if ($("#xiaobaix-story-outline-overlay").is(':visible')) updateLayout(); });
let lastIsMobile = isMobile();
window.addEventListener('resize', () => { const nowIsMobile = isMobile(); if (nowIsMobile !== lastIsMobile) { lastIsMobile = nowIsMobile; updateLayout(); } });
// ==================== 11. 事件与初始化 ====================
@@ -1117,7 +1119,7 @@ function addBtnToMsg(mesId) {
if (!msg || msg.querySelector('.xiaobaix-story-outline-btn')) return;
const btn = document.createElement('div');
btn.className = 'mes_btn xiaobaix-story-outline-btn';
btn.title = '剧情地图';
btn.title = '小白板';
btn.dataset.mesid = mesId;
btn.innerHTML = '<i class="fa-regular fa-map"></i>';
btn.addEventListener('click', e => { e.preventDefault(); e.stopPropagation(); if (!getSettings().storyOutline?.enabled) return; currentMesId = Number(mesId); showOverlay(); loadAndSend(); });