Skip to content

Commit 6f5dbbc

Browse files
committed
Something extremely funny
1 parent 876e939 commit 6f5dbbc

11 files changed

Lines changed: 246 additions & 132 deletions

File tree

.github/workflows/single_file.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Create single file build
2+
3+
on:
4+
push:
5+
branches: ["*"]
6+
workflow_dispatch:
7+
8+
concurrency:
9+
group: "pages"
10+
cancel-in-progress: false
11+
12+
jobs:
13+
deploy:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
19+
- name: Use Node.js
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: "22" # Using latest Node 22 for 2026 compatibility
23+
24+
- name: Install dependencies
25+
working-directory: Build
26+
run: npm i
27+
28+
- name: Build
29+
working-directory: Build
30+
run: npm run build:single
31+
32+
- name: Rename for distribution
33+
working-directory: Build/dist
34+
run: mv index.html HTMLPlayer-v2.html
35+
36+
- name: Upload Build Artifact
37+
uses: actions/upload-artifact@v4
38+
with:
39+
name: HTMLPlayer-Standalone
40+
path: Build/dist/HTMLPlayer-v2.html
41+
if-no-files-found: error

BUGS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Bugs
22

3+
- [ ] Add tour to inline
4+
35
- [ ] Either comment out or implement missing features:
46
- [ ] Compact mode
57
- [ ] Show Lyrics

Build/index.html

Lines changed: 50 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,45 @@
11
<!DOCTYPE html>
22
<html lang="en">
3+
34
<head>
45
<meta charset="UTF-8" />
56
<meta name="viewport" content="width=device-width, initial-scale=1" />
67
<!-- Fallback Metadata -->
7-
<meta name="description" content="A modern music player interface with playlists, song management, and an amazing visualizer." />
8+
<meta name="description"
9+
content="A modern music player interface with playlists, song management, and an amazing visualizer." />
810
<meta property="og:image" content="https://nellowtcs.me/assets/icon-1024.png" />
9-
<meta property="og:description" content="A modern music player interface with playlists, song management, and an amazing visualizer." />
11+
<meta property="og:description"
12+
content="A modern music player interface with playlists, song management, and an amazing visualizer." />
1013
<meta property="og:title" content="HTMLPlayer (beta)" />
1114

15+
<script>
16+
(function () {
17+
// Vite will replace these exact strings during build
18+
const isSingleFile = __IS_SINGLE_FILE__;
19+
const iconData = __INLINED_ICON__;
20+
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>
35+
1236
<link href="./src/global.css" rel="stylesheet" />
1337
<!-- Default theme loaded first for instant styling and first load -->
1438
<link href="./src/themes/Themes/Blue/Blue.theme.css" rel="stylesheet" id="theme-link" />
15-
39+
1640
<!-- Load user's saved theme and dark mode preference ASAP -->
1741
<script>
18-
(function() {
42+
(function () {
1943
// Apply dark mode immediately if needed (before theme switching)
2044
const savedMode = localStorage.getItem('themeMode') || 'auto';
2145
if (savedMode === 'dark') {
@@ -28,7 +52,7 @@
2852
}
2953
})();
3054
</script>
31-
55+
3256
<title>HTMLPlayer</title>
3357
</head>
3458
<body>
@@ -46,30 +70,29 @@ <h1 class="loadingTitle">HTMLPlayer</h1>
4670

4771
<!-- Load fun loading messages -->
4872
<script>
49-
(function() {
50-
// Detect user's language (first two letters)
73+
(function () {
5174
const userLang = (navigator.language || 'en').substring(0, 2);
52-
53-
// Map supported languages
54-
const supportedLangs = { 'en': 'en', 'fr': 'fr' };
55-
const lang = supportedLangs[userLang] || 'en';
56-
57-
// Load the appropriate language file
58-
fetch(`./locales/${lang}/loading-messages-${lang}.json`)
59-
.then(response => response.json())
60-
.then(messages => {
61-
// Pick a random message
75+
const lang = (userLang === 'fr') ? 'fr' : 'en';
76+
const loadingText = document.getElementById('loading-text');
77+
78+
const updateText = (messages) => {
79+
if (loadingText && messages) {
6280
const randomMessage = messages[Math.floor(Math.random() * messages.length)];
63-
// Update the loading text
64-
const loadingText = document.getElementById('loading-text');
65-
if (loadingText) {
66-
loadingText.textContent = randomMessage;
67-
}
68-
})
69-
.catch(() => {
70-
// Fallback to English if loading fails
71-
console.warn('Failed to load loading messages, using fallback');
72-
});
81+
loadingText.textContent = randomMessage;
82+
}
83+
};
84+
85+
// Statically replaced by the custom plugin
86+
const inlined = __INLINED_MESSAGES__;
87+
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+
}
7396
})();
7497
</script>
7598

0 commit comments

Comments
 (0)