index.html 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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-D7sc-Plx.js"></script>
  23. <link rel="stylesheet" crossorigin href="/assets/index-B4zcncds.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 — nuke SW and all caches, then reload once to get clean state
  32. navigator.serviceWorker.getRegistrations().then((regs) => {
  33. if (regs.length > 0) {
  34. Promise.all([
  35. ...regs.map((r) => r.unregister()),
  36. caches.keys().then((names) => Promise.all(names.map((n) => caches.delete(n)))),
  37. ]).then(() => location.reload());
  38. }
  39. });
  40. } else {
  41. window.addEventListener('load', () => {
  42. navigator.serviceWorker.register('/sw.js')
  43. .then((registration) => {
  44. console.log('SW registered:', registration.scope);
  45. })
  46. .catch((error) => {
  47. console.log('SW registration failed:', error);
  48. });
  49. });
  50. }
  51. }
  52. </script>
  53. </body>
  54. </html>