make it lighter

This commit is contained in:
David Ralph
2019-11-29 13:26:36 +00:00
parent b78f4ccf26
commit 5da8731017
11 changed files with 22 additions and 44 deletions

View File

@@ -1,11 +1,10 @@
//* Imports
import React from 'react';
import Fetch from 'unfetch';
export default class Background extends React.Component {
async setBackground() {
try { // First we try and get an image from the API...
let data = await Fetch('https://api.muetab.xyz/getImage?category=Outdoors');
let data = await fetch('https://api.muetab.xyz/getImage?category=Outdoors');
data = await data.json();
document.getElementById('root').style.backgroundImage = `url(${data.file})`;