From 07deb226b7440d3be95a2dc8dc11cc56c2d976e0 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 17 Feb 2026 20:29:26 +0800 Subject: [PATCH] =?UTF-8?q?fix(video):=20=E4=BF=AE=E6=AD=A3=E9=94=9A?= =?UTF-8?q?=E7=82=B9=E5=BC=B9=E5=B1=82=E5=AE=9A=E4=BD=8D=E5=81=8F=E7=A7=BB?= =?UTF-8?q?=E5=88=B0=E5=8F=B3=E4=B8=8B=E8=A7=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/static/public/css/video.css | 6 ++++++ app/static/public/js/video.js | 6 +++++- app/static/public/pages/video.html | 4 ++-- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/app/static/public/css/video.css b/app/static/public/css/video.css index 1dc1784..b4869d5 100644 --- a/app/static/public/css/video.css +++ b/app/static/public/css/video.css @@ -674,6 +674,12 @@ body { #cacheVideoModal .modal-content { position: fixed; + left: 12px; + top: 12px; + right: auto; + bottom: auto; + margin: 0; + transform: none; width: min(560px, calc(100vw - 24px)); max-height: min(72vh, 560px); border-radius: 12px; diff --git a/app/static/public/js/video.js b/app/static/public/js/video.js index fcbe8c8..ee855a4 100644 --- a/app/static/public/js/video.js +++ b/app/static/public/js/video.js @@ -1100,12 +1100,15 @@ if (!(content instanceof HTMLElement)) return; const anchor = cacheModalAnchorEl instanceof HTMLElement ? cacheModalAnchorEl : null; if (!anchor) return; + content.style.right = 'auto'; + content.style.bottom = 'auto'; + content.style.transform = 'none'; const rect = anchor.getBoundingClientRect(); const margin = 8; const vw = window.innerWidth || document.documentElement.clientWidth || 0; const vh = window.innerHeight || document.documentElement.clientHeight || 0; const width = Math.min(560, Math.max(280, vw - 24)); - let left = rect.left; + let left = rect.left + (rect.width / 2) - (width / 2); if (left + width > vw - 12) { left = vw - 12 - width; } @@ -1125,6 +1128,7 @@ cacheVideoModal.classList.remove('hidden'); cacheVideoModal.classList.add('is-open'); positionCacheVideoModal(); + requestAnimationFrame(() => positionCacheVideoModal()); } function closeCacheVideoModal() { diff --git a/app/static/public/pages/video.html b/app/static/public/pages/video.html index 01ee717..5e62e84 100644 --- a/app/static/public/pages/video.html +++ b/app/static/public/pages/video.html @@ -18,7 +18,7 @@ - + @@ -315,7 +315,7 @@ - +