ui: 持仓监控卡片与关键位同宽,完善多端与 PWA

改用 split-grid 全宽布局;手机/平板/电脑断点适配;更新 manifest 与 Service Worker 支持安装为 App。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-24 12:50:58 +08:00
parent 67683f5562
commit 3ba3be6035
6 changed files with 104 additions and 35 deletions
+16 -3
View File
@@ -13,6 +13,11 @@
&& !window.MSStream;
}
function isTouchDevice() {
return window.matchMedia('(hover: none) and (pointer: coarse)').matches
|| window.matchMedia('(max-width: 1024px)').matches;
}
function updateThemeColor() {
var meta = document.getElementById('meta-theme-color');
if (!meta) return;
@@ -46,7 +51,10 @@
if (installBtn) {
installBtn.addEventListener('click', function () {
if (!deferredPrompt) return;
if (!deferredPrompt) {
if (isIOS()) showIosHint();
return;
}
deferredPrompt.prompt();
deferredPrompt.userChoice.then(function () {
deferredPrompt = null;
@@ -64,8 +72,13 @@
document.addEventListener('DOMContentLoaded', function () {
updateThemeColor();
showIosHint();
if (!isStandalone() && !deferredPrompt && installBtn) {
installBtn.hidden = true;
if (isStandalone()) {
if (installBtn) installBtn.hidden = true;
if (iosHint) iosHint.classList.remove('show');
return;
}
if (isTouchDevice() && installBtn && deferredPrompt) {
showInstallBtn();
}
});