Spaces:
Running
Running
| <html lang="zh-CN"> | |
| <head> | |
| <meta charset="utf-8" /> | |
| <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" /> | |
| <meta name="theme-color" content="#2563eb" /> | |
| <meta name="apple-mobile-web-app-capable" content="yes"> | |
| <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"> | |
| <title>智慧校园管理系统</title> | |
| <script> | |
| // Global PWA Event Capture | |
| // This runs before React, ensuring we don't miss the event. | |
| window.deferredPrompt = null; | |
| window.addEventListener('beforeinstallprompt', (e) => { | |
| // Prevent the mini-infobar from appearing on mobile | |
| e.preventDefault(); | |
| // Stash the event so it can be triggered later. | |
| window.deferredPrompt = e; | |
| console.log('✨ PWA Install Prompt captured globally'); | |
| }); | |
| </script> | |
| <style> | |
| /* Critical CSS for immediate loading state */ | |
| body { margin: 0; background-color: #f9fafb; font-family: sans-serif; } | |
| #root-loader { | |
| position: fixed; top: 0; left: 0; width: 100%; height: 100%; | |
| display: flex; flex-direction: column; align-items: center; justify-content: center; | |
| z-index: 9999; background: #fff; transition: opacity 0.5s; | |
| } | |
| .spinner { | |
| width: 40px; height: 40px; border: 4px solid #e5e7eb; | |
| border-top: 4px solid #3b82f6; border-radius: 50%; | |
| animation: spin 1s linear infinite; | |
| } | |
| @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } | |
| .loading-text { margin-top: 15px; color: #6b7280; font-size: 14px; font-weight: 500; } | |
| </style> | |
| <script type="importmap"> | |
| { | |
| "imports": { | |
| "react": "https://aistudiocdn.com/react@^19.2.0", | |
| "react-dom/": "https://aistudiocdn.com/react-dom@^19.2.0/", | |
| "react/": "https://aistudiocdn.com/react@^19.2.0/", | |
| "lucide-react": "https://aistudiocdn.com/lucide-react@^0.555.0", | |
| "recharts": "https://aistudiocdn.com/recharts@^3.5.1", | |
| "vite": "https://aistudiocdn.com/vite@^7.2.6", | |
| "@vitejs/plugin-react": "https://aistudiocdn.com/@vitejs/plugin-react@^5.1.1", | |
| "react-dom": "https://aistudiocdn.com/react-dom@^19.2.0", | |
| "xlsx": "https://aistudiocdn.com/xlsx@^0.18.5", | |
| "@google/genai": "https://esm.sh/@google/genai@^1.33.0", | |
| "react-markdown": "https://esm.sh/react-markdown@^10.1.0", | |
| "remark-gfm": "https://esm.sh/remark-gfm@^4.0.1", | |
| "vite-plugin-pwa": "https://esm.sh/vite-plugin-pwa@^1.2.0", | |
| "mammoth": "https://esm.sh/mammoth@1.6.0", | |
| "pdfjs-dist": "https://esm.sh/pdfjs-dist@3.11.174", | |
| "docx": "https://esm.sh/docx@8.5.0" | |
| } | |
| } | |
| </script> | |
| </head> | |
| <body> | |
| <div id="root"> | |
| <!-- Immediate Loading UI (Disappears when React mounts) --> | |
| <div id="root-loader"> | |
| <div class="spinner"></div> | |
| <div class="loading-text">系统启动中...</div> | |
| </div> | |
| </div> | |
| <script type="module" src="/index.tsx"></script> | |
| </body> | |
| </html> |