Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -443,57 +443,41 @@ def get_pwa_html():
|
|
443 |
<meta charset="UTF-8">
|
444 |
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
445 |
<meta name="apple-mobile-web-app-capable" content="yes">
|
446 |
-
<meta name="apple-mobile-web-app-status-bar-style" content="
|
447 |
<meta name="theme-color" content="#4299e1">
|
448 |
-
<link rel="manifest" href="manifest.json" crossorigin="use-credentials">
|
449 |
-
<link rel="apple-touch-icon" href="icon-192.png">
|
450 |
-
<link rel="apple-touch-startup-image" href="icon-512.png">
|
451 |
|
452 |
-
|
453 |
-
<
|
454 |
-
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
|
455 |
-
|
456 |
-
<!-- iOS 啟動畫面 -->
|
457 |
-
<link rel="apple-touch-startup-image"
|
458 |
-
media="(device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2)"
|
459 |
-
href="icon-512.png">
|
460 |
-
<link rel="apple-touch-startup-image"
|
461 |
-
media="(device-width: 375px) and (device-height: 667px) and (-webkit-device-pixel-ratio: 2)"
|
462 |
-
href="icon-512.png">
|
463 |
|
464 |
<script>
|
465 |
-
|
466 |
-
|
467 |
-
navigator.serviceWorker.register('
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
// Safari 特定處理
|
478 |
-
if (navigator.standalone) {
|
479 |
-
document.documentElement.classList.add('standalone');
|
480 |
-
}
|
481 |
-
});
|
482 |
</script>
|
483 |
|
484 |
<style>
|
485 |
-
|
486 |
-
|
487 |
-
overflow:
|
488 |
position: fixed;
|
489 |
width: 100%;
|
490 |
height: 100%;
|
|
|
491 |
}
|
492 |
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
|
|
497 |
}
|
498 |
</style>
|
499 |
"""
|
|
|
443 |
<meta charset="UTF-8">
|
444 |
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
445 |
<meta name="apple-mobile-web-app-capable" content="yes">
|
446 |
+
<meta name="apple-mobile-web-app-status-bar-style" content="default">
|
447 |
<meta name="theme-color" content="#4299e1">
|
|
|
|
|
|
|
448 |
|
449 |
+
<link rel="manifest" href="./manifest.json">
|
450 |
+
<link rel="apple-touch-icon" href="./icon-192.png">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
451 |
|
452 |
<script>
|
453 |
+
if ('serviceWorker' in navigator) {
|
454 |
+
window.addEventListener('load', function() {
|
455 |
+
navigator.serviceWorker.register('./service-worker.js')
|
456 |
+
.then(function(registration) {
|
457 |
+
console.log('ServiceWorker registration successful');
|
458 |
+
})
|
459 |
+
.catch(function(err) {
|
460 |
+
console.log('ServiceWorker registration failed: ', err);
|
461 |
+
});
|
462 |
+
});
|
463 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
464 |
</script>
|
465 |
|
466 |
<style>
|
467 |
+
body {
|
468 |
+
overscroll-behavior-y: none;
|
469 |
+
-webkit-overflow-scrolling: touch;
|
470 |
position: fixed;
|
471 |
width: 100%;
|
472 |
height: 100%;
|
473 |
+
overflow: auto;
|
474 |
}
|
475 |
|
476 |
+
@media (display-mode: standalone) {
|
477 |
+
body {
|
478 |
+
padding-top: env(safe-area-inset-top);
|
479 |
+
padding-bottom: env(safe-area-inset-bottom);
|
480 |
+
}
|
481 |
}
|
482 |
</style>
|
483 |
"""
|