This commit is contained in:
David Ralph
2019-11-29 12:12:34 +00:00
parent cde3743ff8
commit 2fa7567cf3
4 changed files with 18 additions and 14 deletions

View File

@@ -14,7 +14,7 @@ export default class Background extends React.Component {
} catch (e) { // ..and if that fails we load one locally
document.getElementById('backgroundCredits').style.display = 'none';
document.getElementById('photographer').innerText = 'Photo from Pexels';
document.getElementById('root').style.backgroundImage = `url(../offline-images/${Math.floor(Math.random() * (20 - 1 + 1)) + 1})`;
document.getElementById('root').style.backgroundImage = `url(../offline-images/${Math.floor(Math.random() * (20 - 1 + 1)) + 1})`; // There are 20 images in the offline-images folder
}
}