mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-11-28 04:59:52 +01:00
Merge 154 upstream commits with the 12-commit westernization stack, preserving upstream features (theme refactor, knowledge base, device calling, web search) while keeping downstream provider policy, English defaults, and westernized surfaces.
27 lines
851 B
JavaScript
27 lines
851 B
JavaScript
// Background image load check.
|
|
(function() {
|
|
const backgroundContainer = document.getElementById('backgroundContainer');
|
|
|
|
// Extract the background image URL.
|
|
let bgImageUrl = window.getComputedStyle(backgroundContainer).backgroundImage;
|
|
const urlMatch = bgImageUrl && bgImageUrl.match(/url\(["']?(.*?)["']?\)/);
|
|
|
|
if (!urlMatch || !urlMatch[1]) {
|
|
console.warn('Could not extract a valid background image URL.');
|
|
return;
|
|
}
|
|
|
|
bgImageUrl = urlMatch[1];
|
|
|
|
const bgImage = new Image();
|
|
bgImage.onerror = function() {
|
|
console.error('Failed to load the background image:', bgImageUrl);
|
|
};
|
|
|
|
// Show the model loading indicator once the background is ready.
|
|
bgImage.onload = function() {
|
|
modelLoading.style.display = 'flex';
|
|
};
|
|
|
|
bgImage.src = bgImageUrl;
|
|
})();
|