index.html 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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, viewport-fit=cover" />
  6. <meta name="description" content="Control your kinetic sand table" />
  7. <!-- PWA Meta Tags -->
  8. <meta name="theme-color" content="#0a0a0a" />
  9. <meta name="apple-mobile-web-app-capable" content="yes" />
  10. <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
  11. <meta name="apple-mobile-web-app-title" content="Dune Weaver" />
  12. <meta name="mobile-web-app-capable" content="yes" />
  13. <!-- Favicons - will be updated dynamically if custom logo exists -->
  14. <link rel="icon" type="image/x-icon" href="/static/favicon.ico" id="favicon-ico" />
  15. <link rel="icon" type="image/png" sizes="128x128" href="/static/favicon-128x128.png" id="favicon-128" />
  16. <link rel="icon" type="image/png" sizes="96x96" href="/static/favicon-96x96.png" id="favicon-96" />
  17. <link rel="icon" type="image/png" sizes="32x32" href="/static/favicon-32x32.png" id="favicon-32" />
  18. <link rel="icon" type="image/png" sizes="16x16" href="/static/favicon-16x16.png" id="favicon-16" />
  19. <link rel="apple-touch-icon" sizes="180x180" href="/static/apple-touch-icon.png" id="apple-touch-icon" />
  20. <link rel="manifest" href="/api/manifest.webmanifest" id="manifest" />
  21. <title>Dune Weaver</title>
  22. <!-- Check for custom favicon -->
  23. <script>
  24. // Get base URL for active table (supports multi-table connections)
  25. (function() {
  26. var baseUrl = '';
  27. try {
  28. var stored = localStorage.getItem('duneweaver_tables');
  29. var activeId = localStorage.getItem('duneweaver_active_table');
  30. if (stored && activeId) {
  31. var data = JSON.parse(stored);
  32. var active = (data.tables || []).find(function(t) { return t.id === activeId; });
  33. if (active && !active.isCurrent && active.url && active.url !== window.location.origin) {
  34. baseUrl = active.url.replace(/\/$/, '');
  35. }
  36. }
  37. } catch (e) {}
  38. fetch(baseUrl + '/api/settings')
  39. .then(function(r) { return r.json(); })
  40. .then(function(settings) {
  41. if (settings.app && settings.app.custom_logo) {
  42. // Use generated icons with proper padding (not the raw uploaded logo)
  43. document.getElementById('favicon-ico').href = baseUrl + '/static/custom/favicon.ico';
  44. document.getElementById('apple-touch-icon').href = baseUrl + '/static/custom/apple-touch-icon.png';
  45. }
  46. if (settings.app && settings.app.name) {
  47. document.title = settings.app.name;
  48. // Also update PWA title
  49. var appTitleMeta = document.querySelector('meta[name="apple-mobile-web-app-title"]');
  50. if (appTitleMeta) appTitleMeta.content = settings.app.name;
  51. }
  52. })
  53. .catch(function() {});
  54. })();
  55. </script>
  56. </head>
  57. <body>
  58. <div id="root"></div>
  59. <script type="module" src="/src/main.tsx"></script>
  60. </body>
  61. </html>