diff --git a/lib/common/static/instance_theme.css b/lib/common/static/instance_theme.css index b9af670..2f1bd6a 100644 --- a/lib/common/static/instance_theme.css +++ b/lib/common/static/instance_theme.css @@ -2372,9 +2372,40 @@ html[data-theme="light"] .settings-export-link { .options-chain-toolbar .btn-secondary.active, .opt-uly-btn.active, .opt-type-btn.active { - border-color: #4a7cff; + border-color: #5b8cff; + color: #cfe0ff; + background: rgba(74, 124, 255, 0.28); + box-shadow: inset 0 0 0 1px rgba(120, 160, 255, 0.45); +} +.opt-pick-btn.active { + border-color: #5b8cff; + color: #fff; + background: rgba(74, 124, 255, 0.45); + box-shadow: inset 0 0 0 1px rgba(140, 175, 255, 0.6); +} +.opt-strike-row.opt-row-selected td { + background: rgba(74, 124, 255, 0.1); +} +.opt-strike-row.opt-row-selected td:first-child { + box-shadow: inset 3px 0 0 #5b8cff; +} +.opt-order-inline-row td { + padding: 14px 16px !important; + background: rgba(74, 124, 255, 0.07); + border-top: 1px solid rgba(74, 124, 255, 0.25); + border-bottom: 1px solid rgba(74, 124, 255, 0.25); +} +.opt-order-panel-inner { + border-radius: 8px; +} +.opt-order-panel-inner .opt-order-title { + margin: 0 0 10px; + font-size: 1rem; color: #9ec0ff; } +.opt-order-panel-host { + display: none; +} .options-order-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); diff --git a/lib/common/static/options_panel.js b/lib/common/static/options_panel.js index 31d76ee..0b04a1b 100644 --- a/lib/common/static/options_panel.js +++ b/lib/common/static/options_panel.js @@ -22,11 +22,63 @@ return r.json(); } - function scrollToOrderPanel() { - const panel = document.getElementById("opt-order-panel"); - if (panel && panel.style.display !== "none") { - panel.scrollIntoView({ behavior: "smooth", block: "nearest" }); + function orderPanel() { + return document.getElementById("opt-order-panel"); + } + + function orderPanelHost() { + return document.getElementById("opt-order-panel-host"); + } + + function parkOrderPanel() { + const panel = orderPanel(); + const host = orderPanelHost(); + const inline = document.querySelector(".opt-order-inline-row"); + if (inline) inline.remove(); + if (panel && host && panel.parentElement !== host) { + host.appendChild(panel); + host.hidden = true; } + if (panel) panel.style.display = "none"; + document.querySelectorAll(".opt-strike-row").forEach(function (r) { + r.classList.remove("opt-row-selected"); + }); + document.querySelectorAll(".opt-pick-btn").forEach(function (b) { + b.classList.remove("active"); + b.disabled = false; + if (b.dataset.origText) b.textContent = b.dataset.origText; + }); + } + + function placeOrderPanelAfter(instId) { + const panel = orderPanel(); + if (!panel || !instId) return; + const row = document.querySelector('#opt-strike-tbody tr.opt-strike-row[data-inst="' + CSS.escape(instId) + '"]'); + if (!row) return; + + document.querySelectorAll(".opt-strike-row").forEach(function (r) { + r.classList.toggle("opt-row-selected", r === row); + }); + document.querySelectorAll(".opt-pick-btn").forEach(function (b) { + const on = b.getAttribute("data-inst") === instId; + b.classList.toggle("active", on); + if (!b.dataset.origText) b.dataset.origText = b.textContent; + if (on) b.textContent = "已选"; + }); + + const oldInline = document.querySelector(".opt-order-inline-row"); + if (oldInline) oldInline.remove(); + + const tr = document.createElement("tr"); + tr.className = "opt-order-inline-row"; + const td = document.createElement("td"); + td.colSpan = 6; + td.appendChild(panel); + tr.appendChild(td); + row.after(tr); + panel.style.display = ""; + orderPanelHost().hidden = true; + tr.scrollIntoView({ behavior: "smooth", block: "nearest" }); } function currentSizeMode() { @@ -107,9 +159,12 @@ function renderStrikes() { const tbody = document.getElementById("opt-strike-tbody"); const expMs = document.getElementById("opt-exp-select").value; + const prevSelected = state.selectedInst; + parkOrderPanel(); tbody.innerHTML = ""; if (!expMs || !state.chain) { tbody.innerHTML = '