MCPcopy Create free account
hub / github.com/MemeTray/MemeTray / initRandomBackground

Function initRandomBackground

tools/common/fileUploadHelpers.js:188–205  ·  view source on GitHub ↗
(selector = '.desktop')

Source from the content-addressed store, hash-verified

186 * @deprecated Use initRandomBackground from backgroundConfig.js instead
187 */
188export function initRandomBackground(selector = '.desktop') {
189 // Retained for backwards compatibility; prefer importing from backgroundConfig.js
190 import('./backgroundConfig.js').then(({ initRandomBackground: init }) => {
191 init(selector);
192 }).catch(() => {
193 // Fallback: inline implementation if the module import fails
194 try {
195 const desktop = document.querySelector(selector);
196 if (!desktop) return;
197 const apiPool = [
198 'https://t.alcy.cc/ycy', 'https://t.alcy.cc/moez', 'https://t.alcy.cc/ysz',
199 'https://t.alcy.cc/pc', 'https://t.alcy.cc/moe', 'https://t.alcy.cc/fj',
200 'https://t.alcy.cc/bd', 'https://t.alcy.cc/ys', 'https://t.alcy.cc/lai'
201 ];
202 desktop.style.backgroundImage = `url("${apiPool[Math.floor(Math.random() * apiPool.length)]}")`;
203 } catch (_) {}
204 });
205}
206
207/**
208 * Format a file size value

Callers

nothing calls this directly

Calls 1

initFunction · 0.50

Tested by

no test coverage detected