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})`;

View File

@@ -15,7 +15,7 @@ export default class Clock extends React.Component {
let h = t.getHours(); // Get hours
// const s = today.getSeconds();
if (h > 12) h = h - 12; // Forgot what this does, might remove later if it doesn't do anything
if (h > 12) h = h - 12; // 12 hour support
this.setState({
date: `${('0' + h).slice(-2)}:${('0' + t.getMinutes()).slice(-2)}`, ampm: h >= 12 ? 'AM' : 'PM'
@@ -28,10 +28,6 @@ export default class Clock extends React.Component {
this.startTime();
}
componentWillUnmount() { // Do we need this?
clearTimeout(this.timeout);
}
render() {
return <h1 className='clock'>
{this.state.date}

View File

@@ -6,14 +6,14 @@ import React from 'react';
export default class Search extends React.Component {
render() {
return (
<div className="navbar-container">
<div className='navbar-container'>
<div className='navbar1'>
<RefreshIcon className='locationicon' />
<RefreshIcon className='locationicon'/>
</div>
<div className='navbar2'>
<LocalPizzaIcon className='pizzaicon'/>
</div>
</div>
</div>
);
}
}

View File

@@ -1,6 +1,5 @@
//* Imports
import React from 'react';
import Fetch from 'unfetch';
import quotes from '../quotes.json';
export default class Quote extends React.Component {
@@ -14,7 +13,7 @@ export default class Quote extends React.Component {
async getQuote() {
try { // First we try and get a quote from the API...
let data = await Fetch('https://api.muetab.xyz/getQuote');
let data = await fetch('https://api.muetab.xyz/getQuote');
data = await data.json();
this.setState({ quote: data.quote, author: data.author });
} catch (e) { // ..and if that fails we load one locally