set butterchurn as the default visualizer
This commit is contained in:
parent
9d81ada6ab
commit
304eb78d7b
5 changed files with 34 additions and 11 deletions
|
|
@ -684,9 +684,9 @@ export const visualizerSettings = {
|
||||||
|
|
||||||
getPreset() {
|
getPreset() {
|
||||||
try {
|
try {
|
||||||
return localStorage.getItem(this.PRESET_KEY) || 'lcd';
|
return localStorage.getItem(this.PRESET_KEY) || 'butterchurn';
|
||||||
} catch {
|
} catch {
|
||||||
return 'lcd';
|
return 'butterchurn';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,21 +20,30 @@ async function loadPresetsModule() {
|
||||||
isLoading = true;
|
isLoading = true;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Dynamic import to code-split butterchurn-presets into separate chunk
|
// Load butterchurn-presets via script tag to avoid ES module issues
|
||||||
const butterchurnPresets = await import('butterchurn-presets');
|
if (!window.butterchurnPresets) {
|
||||||
console.log('[Butterchurn] Presets module loaded, type:', typeof butterchurnPresets);
|
await new Promise((resolve, reject) => {
|
||||||
|
const script = document.createElement('script');
|
||||||
|
script.src = '/lib/butterchurnPresets.min.js';
|
||||||
|
script.onload = resolve;
|
||||||
|
script.onerror = reject;
|
||||||
|
document.head.appendChild(script);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// The module has a static getPresets method
|
const butterchurnPresets = window.butterchurnPresets;
|
||||||
if (typeof butterchurnPresets.default?.getPresets !== 'function') {
|
console.log('[Butterchurn] Presets loaded, type:', typeof butterchurnPresets);
|
||||||
|
|
||||||
|
if (typeof butterchurnPresets?.getPresets !== 'function') {
|
||||||
console.error(
|
console.error(
|
||||||
'[Butterchurn] butterchurnPresets.getPresets is not a function:',
|
'[Butterchurn] butterchurnPresets.getPresets is not a function:',
|
||||||
typeof butterchurnPresets.default?.getPresets
|
typeof butterchurnPresets?.getPresets
|
||||||
);
|
);
|
||||||
isLoading = false;
|
isLoading = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const allPresets = butterchurnPresets.default.getPresets();
|
const allPresets = butterchurnPresets.getPresets();
|
||||||
cachedPresets = allPresets || {};
|
cachedPresets = allPresets || {};
|
||||||
cachedPresetKeys = Object.keys(cachedPresets);
|
cachedPresetKeys = Object.keys(cachedPresets);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -48,11 +48,11 @@
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@neutralinojs/lib": "^6.5.0",
|
"@neutralinojs/lib": "^6.5.0",
|
||||||
"cookie-session": "^2.1.0",
|
|
||||||
"jose": "^6.0.11",
|
|
||||||
"butterchurn": "^2.6.7",
|
"butterchurn": "^2.6.7",
|
||||||
"butterchurn-presets": "^2.4.7",
|
"butterchurn-presets": "^2.4.7",
|
||||||
|
"cookie-session": "^2.1.0",
|
||||||
"dashjs": "^5.1.1",
|
"dashjs": "^5.1.1",
|
||||||
|
"jose": "^6.0.11",
|
||||||
"pocketbase": "^0.26.5"
|
"pocketbase": "^0.26.5"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
1
public/lib/butterchurnPresets.min.js
vendored
Normal file
1
public/lib/butterchurnPresets.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
|
|
@ -8,6 +8,19 @@ export default defineConfig(({ mode }) => {
|
||||||
|
|
||||||
return {
|
return {
|
||||||
base: './',
|
base: './',
|
||||||
|
resolve: {
|
||||||
|
alias: {
|
||||||
|
pocketbase: '/node_modules/pocketbase/dist/pocketbase.es.js',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
optimizeDeps: {
|
||||||
|
exclude: ['pocketbase'],
|
||||||
|
},
|
||||||
|
server: {
|
||||||
|
fs: {
|
||||||
|
allow: ['.', 'node_modules'],
|
||||||
|
},
|
||||||
|
},
|
||||||
build: {
|
build: {
|
||||||
outDir: 'dist',
|
outDir: 'dist',
|
||||||
emptyOutDir: true,
|
emptyOutDir: true,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue