index.html 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. <script type="module" crossorigin src="/assets/index-aq4iRnuK.js"></script>
  23. <link rel="stylesheet" crossorigin href="/assets/index-Dzv7xI7m.css">
  24. </head>
  25. <body>
  26. <div id="root"></div>
  27. <!-- Service Worker Registration (skip on SpoolBuddy kiosk) -->
  28. <script>
  29. if ('serviceWorker' in navigator) {
  30. if (location.pathname.startsWith('/spoolbuddy')) {
  31. // Kiosk mode — unregister any existing SW to avoid stale cache
  32. navigator.serviceWorker.getRegistrations().then((regs) => {
  33. regs.forEach((r) => r.unregister());
  34. });
  35. } else {
  36. window.addEventListener('load', () => {
  37. navigator.serviceWorker.register('/sw.js')
  38. .then((registration) => {
  39. console.log('SW registered:', registration.scope);
  40. })
  41. .catch((error) => {
  42. console.log('SW registration failed:', error);
  43. });
  44. });
  45. }
  46. }
  47. </script>
  48. </body>
  49. </html>