mirror of
https://github.com/mue/mue.git
synced 2026-07-22 16:27:32 +02:00
make it lighter
This commit is contained in:
@@ -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})`;
|
||||
|
||||
@@ -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}
|
||||
|
||||
@@ -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>
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user