index.html 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
  6. <title>Bambuddy</title>
  7. <!-- PWA Meta Tags -->
  8. <meta name="description" content="Monitor and manage your Bambu Lab 3D printers" />
  9. <meta name="theme-color" content="#00ae42" />
  10. <meta name="mobile-web-app-capable" content="yes" />
  11. <meta name="apple-mobile-web-app-capable" content="yes" />
  12. <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
  13. <meta name="apple-mobile-web-app-title" content="Bambuddy" />
  14. <!-- Manifest -->
  15. <link rel="manifest" href="/manifest.json" />
  16. <!-- Favicons -->
  17. <link rel="icon" type="image/png" sizes="32x32" href="/img/favicon-32x32.png" />
  18. <link rel="icon" type="image/png" sizes="16x16" href="/img/favicon-16x16.png" />
  19. <link rel="apple-touch-icon" sizes="180x180" href="/img/apple-touch-icon.png" />
  20. <!-- Splash screens for iOS -->
  21. <link rel="apple-touch-startup-image" href="/img/android-chrome-512x512.png" />
  22. </head>
  23. <body>
  24. <div id="root"></div>
  25. <script type="module" src="/src/main.tsx"></script>
  26. <!-- Service Worker Registration (skip on SpoolBuddy kiosk) -->
  27. <script>
  28. if ('serviceWorker' in navigator) {
  29. if (location.pathname.startsWith('/spoolbuddy')) {
  30. // Kiosk mode — unregister any existing SW to avoid stale cache
  31. navigator.serviceWorker.getRegistrations().then((regs) => {
  32. regs.forEach((r) => r.unregister());
  33. });
  34. } else {
  35. window.addEventListener('load', () => {
  36. navigator.serviceWorker.register('/sw.js')
  37. .then((registration) => {
  38. console.log('SW registered:', registration.scope);
  39. })
  40. .catch((error) => {
  41. console.log('SW registration failed:', error);
  42. });
  43. });
  44. }
  45. }
  46. </script>
  47. </body>
  48. </html>