|
1 | | -<!DOCTYPE html> |
| 1 | +<!doctype html> |
2 | 2 | <html lang="en"> |
| 3 | + <head> |
| 4 | + <meta charset="UTF-8" /> |
| 5 | + <meta name="viewport" content="width=device-width, initial-scale=1" /> |
| 6 | + <!-- Fallback Metadata --> |
| 7 | + <meta |
| 8 | + name="description" |
| 9 | + content="A modern music player interface with playlists, song management, and an amazing visualizer." |
| 10 | + /> |
| 11 | + <meta |
| 12 | + property="og:image" |
| 13 | + content="https://nellowtcs.me/assets/icon-1024.png" |
| 14 | + /> |
| 15 | + <meta |
| 16 | + property="og:description" |
| 17 | + content="A modern music player interface with playlists, song management, and an amazing visualizer." |
| 18 | + /> |
| 19 | + <meta property="og:title" content="HTMLPlayer (beta)" /> |
3 | 20 |
|
4 | | -<head> |
5 | | - <meta charset="UTF-8" /> |
6 | | - <meta name="viewport" content="width=device-width, initial-scale=1" /> |
7 | | - <!-- Fallback Metadata --> |
8 | | - <meta name="description" |
9 | | - content="A modern music player interface with playlists, song management, and an amazing visualizer." /> |
10 | | - <meta property="og:image" content="https://nellowtcs.me/assets/icon-1024.png" /> |
11 | | - <meta property="og:description" |
12 | | - content="A modern music player interface with playlists, song management, and an amazing visualizer." /> |
13 | | - <meta property="og:title" content="HTMLPlayer (beta)" /> |
| 21 | + <script> |
| 22 | + (function () { |
| 23 | + // Vite will replace these exact strings during build |
| 24 | + const isSingleFile = __IS_SINGLE_FILE__; |
| 25 | + const iconData = __INLINED_ICON__; |
14 | 26 |
|
15 | | - <script> |
16 | | - (function () { |
17 | | - // Vite will replace these exact strings during build |
18 | | - const isSingleFile = __IS_SINGLE_FILE__; |
19 | | - const iconData = __INLINED_ICON__; |
| 27 | + if (isSingleFile && iconData) { |
| 28 | + const link = |
| 29 | + document.querySelector("link[rel*='icon']") || |
| 30 | + document.createElement("link"); |
| 31 | + link.type = "image/png"; |
| 32 | + link.rel = "icon"; |
| 33 | + link.href = iconData; |
| 34 | + document.head.appendChild(link); |
20 | 35 |
|
21 | | - if (isSingleFile && iconData) { |
22 | | - const link = document.querySelector("link[rel*='icon']") || document.createElement('link'); |
23 | | - link.type = 'image/png'; |
24 | | - link.rel = 'icon'; |
25 | | - link.href = iconData; |
26 | | - document.head.appendChild(link); |
27 | | - |
28 | | - const ogImage = document.querySelector('meta[property="og:image"]') || document.createElement('meta'); |
29 | | - ogImage.setAttribute('property', 'og:image'); |
30 | | - ogImage.content = iconData; |
31 | | - document.head.appendChild(ogImage); |
32 | | - } |
33 | | - })(); |
34 | | - </script> |
| 36 | + const ogImage = |
| 37 | + document.querySelector('meta[property="og:image"]') || |
| 38 | + document.createElement("meta"); |
| 39 | + ogImage.setAttribute("property", "og:image"); |
| 40 | + ogImage.content = iconData; |
| 41 | + document.head.appendChild(ogImage); |
| 42 | + } |
| 43 | + })(); |
| 44 | + </script> |
35 | 45 |
|
36 | | - <link href="./src/global.css" rel="stylesheet" /> |
37 | | - <!-- Default theme loaded first for instant styling and first load --> |
38 | | - <link href="./src/themes/Themes/Blue/Blue.theme.css" rel="stylesheet" id="theme-link" /> |
| 46 | + <link href="./src/global.css" rel="stylesheet" /> |
| 47 | + <!-- Default theme loaded first for instant styling and first load --> |
| 48 | + <link |
| 49 | + href="./src/themes/Themes/Blue/Blue.theme.css" |
| 50 | + rel="stylesheet" |
| 51 | + id="theme-link" |
| 52 | + /> |
39 | 53 |
|
40 | | - <!-- Load user's saved theme and dark mode preference ASAP --> |
41 | | - <script> |
42 | | - (function () { |
43 | | - // Apply dark mode immediately if needed (before theme switching) |
44 | | - const savedMode = localStorage.getItem('themeMode') || 'auto'; |
45 | | - if (savedMode === 'dark') { |
46 | | - document.documentElement.classList.add('dark'); |
47 | | - } else if (savedMode === 'auto') { |
48 | | - // Check system preference |
49 | | - if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) { |
50 | | - document.documentElement.classList.add('dark'); |
| 54 | + <!-- Load user's saved theme and dark mode preference ASAP --> |
| 55 | + <script> |
| 56 | + (function () { |
| 57 | + // Apply dark mode immediately if needed (before theme switching) |
| 58 | + const savedMode = localStorage.getItem("themeMode") || "auto"; |
| 59 | + if (savedMode === "dark") { |
| 60 | + document.documentElement.classList.add("dark"); |
| 61 | + } else if (savedMode === "auto") { |
| 62 | + // Check system preference |
| 63 | + if ( |
| 64 | + window.matchMedia && |
| 65 | + window.matchMedia("(prefers-color-scheme: dark)").matches |
| 66 | + ) { |
| 67 | + document.documentElement.classList.add("dark"); |
| 68 | + } |
51 | 69 | } |
52 | | - } |
53 | | - })(); |
54 | | - </script> |
55 | | - |
56 | | - <title>HTMLPlayer</title> |
57 | | -</head> |
58 | | -<body> |
59 | | - <!-- Loading screen shown before React loads --> |
60 | | - <div id="loading-screen" class="loadingScreen"> |
61 | | - <div class="loadingContent"> |
62 | | - <div class="loadingSpinner"></div> |
63 | | - <h1 class="loadingTitle">HTMLPlayer</h1> |
64 | | - <p class="loadingText" id="loading-text">Loading the loading message...</p> |
| 70 | + })(); |
| 71 | + </script> |
65 | 72 |
|
| 73 | + <title>HTMLPlayer</title> |
| 74 | + </head> |
| 75 | + <body> |
| 76 | + <!-- Loading screen shown before React loads --> |
| 77 | + <div id="loading-screen" class="loadingScreen"> |
| 78 | + <div class="loadingContent"> |
| 79 | + <div class="loadingSpinner"></div> |
| 80 | + <h1 class="loadingTitle">HTMLPlayer</h1> |
| 81 | + <p class="loadingText" id="loading-text"> |
| 82 | + Loading the loading message... |
| 83 | + </p> |
| 84 | + </div> |
66 | 85 | </div> |
67 | | - </div> |
68 | 86 |
|
69 | | - <div id="root"></div> |
| 87 | + <div id="root"></div> |
70 | 88 |
|
71 | | - <!-- Load fun loading messages --> |
72 | | - <script> |
73 | | - (function () { |
74 | | - const userLang = (navigator.language || 'en').substring(0, 2); |
75 | | - const lang = (userLang === 'fr') ? 'fr' : 'en'; |
76 | | - const loadingText = document.getElementById('loading-text'); |
77 | | - |
78 | | - const updateText = (messages) => { |
79 | | - if (loadingText && messages) { |
80 | | - const randomMessage = messages[Math.floor(Math.random() * messages.length)]; |
81 | | - loadingText.textContent = randomMessage; |
82 | | - } |
83 | | - }; |
| 89 | + <!-- Load fun loading messages --> |
| 90 | + <script> |
| 91 | + (function () { |
| 92 | + const userLang = (navigator.language || "en").substring(0, 2); |
| 93 | + const lang = userLang === "fr" ? "fr" : "en"; |
| 94 | + const loadingText = document.getElementById("loading-text"); |
84 | 95 |
|
85 | | - // Statically replaced by the custom plugin |
86 | | - const inlined = __INLINED_MESSAGES__; |
| 96 | + const updateText = (messages) => { |
| 97 | + if (loadingText && messages) { |
| 98 | + const randomMessage = |
| 99 | + messages[Math.floor(Math.random() * messages.length)]; |
| 100 | + loadingText.textContent = randomMessage; |
| 101 | + } |
| 102 | + }; |
87 | 103 |
|
88 | | - if (inlined) { |
89 | | - updateText(inlined[lang] || inlined.en); |
90 | | - } else { |
91 | | - fetch(`./locales/${lang}/loading-messages-${lang}.json`) |
92 | | - .then(res => res.json()) |
93 | | - .then(updateText) |
94 | | - .catch(() => console.warn('Loading messages failed.')); |
95 | | - } |
96 | | - })(); |
97 | | - </script> |
| 104 | + // Statically replaced by the custom plugin |
| 105 | + const inlined = __INLINED_MESSAGES__; |
| 106 | + })(); |
| 107 | + </script> |
98 | 108 |
|
99 | | - <script type="module" src="./src/pages/main.tsx"></script> |
100 | | -</body> |
| 109 | + <script type="module" src="./src/pages/main.tsx"></script> |
| 110 | + </body> |
101 | 111 | </html> |
0 commit comments