Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -441,41 +441,31 @@ def show_details_html(choice, previous_output, initial_state):
|
|
441 |
def main():
|
442 |
with gr.Blocks(css=get_css_styles()) as iface:
|
443 |
|
|
|
444 |
gr.HTML("""
|
445 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
446 |
<meta name="apple-mobile-web-app-capable" content="yes">
|
447 |
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
448 |
-
<
|
449 |
-
<link rel="
|
450 |
-
|
451 |
-
|
452 |
-
gr.HTML("""
|
453 |
<script>
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
} catch(e) {
|
468 |
-
console.error('Service Worker 註冊時發生錯誤:', e.message);
|
469 |
-
}
|
470 |
-
} else {
|
471 |
-
console.log('此瀏覽器不支援 Service Worker');
|
472 |
-
}
|
473 |
-
});
|
474 |
</script>
|
475 |
-
|
476 |
-
|
477 |
-
# Header HTML
|
478 |
-
gr.HTML("""
|
479 |
<header style='text-align: center; padding: 20px; margin-bottom: 20px;'>
|
480 |
<h1 style='font-size: 2.5em; margin-bottom: 10px; color: #2D3748;'>
|
481 |
🐾 PawMatch AI
|
|
|
441 |
def main():
|
442 |
with gr.Blocks(css=get_css_styles()) as iface:
|
443 |
|
444 |
+
# Header HTML
|
445 |
gr.HTML("""
|
446 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
447 |
<meta name="apple-mobile-web-app-capable" content="yes">
|
448 |
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
449 |
+
<meta name="apple-mobile-web-app-title" content="PawMatch AI">
|
450 |
+
<link rel="manifest" href="https://dawnc-pawmatchai.hf.space/manifest.json">
|
451 |
+
<link rel="apple-touch-icon" href="https://dawnc-pawmatchai.hf.space/assets/icon-192.png">
|
452 |
+
|
|
|
453 |
<script>
|
454 |
+
window.addEventListener('load', async () => {{
|
455 |
+
try {{
|
456 |
+
if ('serviceWorker' in navigator) {{
|
457 |
+
const registration = await navigator.serviceWorker.register(
|
458 |
+
'https://dawnc-pawmatchai.hf.space/service-worker.js',
|
459 |
+
{{ scope: '/' }}
|
460 |
+
);
|
461 |
+
console.log('Service Worker 註冊成功', registration);
|
462 |
+
}}
|
463 |
+
}} catch (error) {{
|
464 |
+
console.error('Service Worker 註冊失敗:', error);
|
465 |
+
}}
|
466 |
+
}});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
467 |
</script>
|
468 |
+
|
|
|
|
|
|
|
469 |
<header style='text-align: center; padding: 20px; margin-bottom: 20px;'>
|
470 |
<h1 style='font-size: 2.5em; margin-bottom: 10px; color: #2D3748;'>
|
471 |
🐾 PawMatch AI
|