mirror of
https://github.com/ld3z/new-manga.git
synced 2026-11-09 20:23:45 -07:00
better error handling and performance improvements
This commit is contained in:
parent
6ca77cf6af
commit
17ceea25d9
6 changed files with 87 additions and 23 deletions
|
|
@ -75,3 +75,10 @@ export function getRandomBackground(): BackgroundImage {
|
|||
}
|
||||
return backgrounds[Math.floor(Math.random() * backgrounds.length)];
|
||||
}
|
||||
|
||||
export function preloadBackgrounds() {
|
||||
backgrounds.forEach(bg => {
|
||||
const img = new Image();
|
||||
img.src = bg.url;
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue