mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-25 08:33:53 +08:00
15 lines
557 B
JavaScript
15 lines
557 B
JavaScript
// 背景图加载检测
|
|
const backgroundContainer = document.getElementById('backgroundContainer');
|
|
// 提取背景图片URL
|
|
let bgImageUrl = window.getComputedStyle(backgroundContainer).backgroundImage;
|
|
const urlMatch = bgImageUrl.match(/url\(["']?(.*?)["']?\)/);
|
|
bgImageUrl = urlMatch[1];
|
|
const bgImage = new Image();
|
|
bgImage.src = bgImageUrl;
|
|
// 加载完成后显示模型加载
|
|
bgImage.onload = function () {
|
|
const modelLoading = document.getElementById('modelLoading');
|
|
if (modelLoading) {
|
|
modelLoading.style.display = 'flex';
|
|
}
|
|
} |