From 5da8731017067c94209277402ce681a4a9aff015 Mon Sep 17 00:00:00 2001 From: David Ralph Date: Fri, 29 Nov 2019 13:26:36 +0000 Subject: [PATCH] make it lighter --- README.md | 4 +--- package.json | 27 ++++++++++++--------------- src/App.jsx | 4 ++-- src/components/Background.jsx | 3 +-- src/components/Clock.jsx | 6 +----- src/components/Navbar.jsx | 6 +++--- src/components/Quote.jsx | 3 +-- src/css/index.css | 1 - src/css/index.css.map | 1 - src/scss/modules/_navbar.scss | 8 -------- src/scss/modules/_search.scss | 3 +-- 11 files changed, 22 insertions(+), 44 deletions(-) delete mode 100644 src/css/index.css delete mode 100644 src/css/index.css.map diff --git a/README.md b/README.md index e2411d79..85aa2e45 100644 --- a/README.md +++ b/README.md @@ -109,11 +109,9 @@ Once I find a method to do it automatically, I will update this section accordin ### Maintainers [ohlookitsderpy](https://github.com/ohlookitsderpy) -[TurboMarshmello](https://github.com/TurboMarshmello) +[TurboMarshmello](https://github.com/TurboMarshmello) (name idea, code contributions) ### Other -[TurboMarshmello](https://github.com/TurboMarshmello) - Portions of original code, name idea - [Pexels](https://pexels.com) - Stock photos used for offline mode [Opera Forum](https://forums.opera.com/topic/25046/how-to-disable-completely-the-speed-dial/14) - Portions of code to add Opera support diff --git a/package.json b/package.json index 0a396063..878be99a 100644 --- a/package.json +++ b/package.json @@ -1,29 +1,26 @@ { "name": "mue", - "author": "ohlookitsderpy", + "author": "David \"ohlookitsderpy\" Ralph (https://derpyenterprises.org)", + "maintainers": [ + "David \"ohlookitsderpy\" Ralph (https://derpyenterprises.org)", + "Alex \"TurboMarshmello\" Sparkes (https://github.com/TurboMarshmello)" + ], "description": "Fast, open and free-to-use new tab page for most modern browsers.", "license": "MIT", "version": "2.0.1", "dependencies": { - "@material-ui/core": "^4.6.0", - "@material-ui/icons": "^4.6.0", - "react": "^16.11.0", - "react-dom": "^16.11.0", - "react-scripts": "3.2.0", - "unfetch": "^4.1.0" + "@material-ui/core": "^4.7.0", + "@material-ui/icons": "^4.5.1", + "react": "^16.12.0", + "react-dom": "^16.12.0", + "react-scripts": "3.2.0" }, "devDependencies": { - "eslint": "^6.6.0", - "npm-run-all": "^4.1.5", - "sass": "^1.23.3" + "eslint": "^6.6.0" }, "scripts": { "start": "react-scripts start", - "build": "react-scripts build", - "test": "react-scripts test", - "eject": "react-scripts eject", - "sass": "sass --watch src/scss:src/css --style compressed", - "start-all": "npm-run-all -p start sass" + "build": "react-scripts build" }, "eslintConfig": { "extends": "react-app" diff --git a/src/App.jsx b/src/App.jsx index 824291f3..0177aef6 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -6,8 +6,8 @@ import Greeting from './components/Greeting'; import Quote from './components/Quote'; import Search from './components/Search'; import Credit from './components/Credit'; -import Navbar from './components/Navbar'; -import './css/index.css'; // Import the compiled Sass +//import Navbar from './components/Navbar'; +import './scss/index.scss'; //* App export default class App extends React.Component { diff --git a/src/components/Background.jsx b/src/components/Background.jsx index 69feb15f..4ab1456c 100644 --- a/src/components/Background.jsx +++ b/src/components/Background.jsx @@ -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})`; diff --git a/src/components/Clock.jsx b/src/components/Clock.jsx index d45e49cb..2f88b5eb 100644 --- a/src/components/Clock.jsx +++ b/src/components/Clock.jsx @@ -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

{this.state.date} diff --git a/src/components/Navbar.jsx b/src/components/Navbar.jsx index e5eca673..fed3a0ad 100644 --- a/src/components/Navbar.jsx +++ b/src/components/Navbar.jsx @@ -6,14 +6,14 @@ import React from 'react'; export default class Search extends React.Component { render() { return ( -
+
- +
-
+
); } } \ No newline at end of file diff --git a/src/components/Quote.jsx b/src/components/Quote.jsx index 4636c24d..81ded67d 100644 --- a/src/components/Quote.jsx +++ b/src/components/Quote.jsx @@ -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 diff --git a/src/css/index.css b/src/css/index.css deleted file mode 100644 index 4ae8655e..00000000 --- a/src/css/index.css +++ /dev/null @@ -1 +0,0 @@ -.clock{font-size:4em;margin:0;text-shadow:0 0 25px rgba(0,0,0,.3)}.ampm{font-size:.5em}.greeting{margin:0;font-size:1.6em;text-shadow:0 0 25px rgba(0,0,0,.3)}.quote{font-size:.8em;text-shadow:0 0 25px rgba(0,0,0,.3)}@media screen and (min-width: 600px){.quote{margin-left:30%;margin-right:30%}}.quoteauthor{font-size:.9em;letter-spacing:.5px;margin:0;text-shadow:0 0 25px rgba(0,0,0,.3)}i.material-icons,h1.quoteauthor{display:inline}.searchbar{position:absolute;left:20px;top:20px;display:flex;flex-direction:row;display:block;color:#fff;font-family:"Lexend Deca"}.searchbar button{cursor:pointer;outline:none;display:inline}.searchbar button i.material-icons{text-shadow:0 0 25px rgba(0,0,0,.3)}.searchbar input[type=text]{font-size:calc(5px + 1.2vmin);background:none;border:2px solid #fff;padding:10px;color:#fff;position:absolute;box-shadow:0 0 25px rgba(0,0,0,.3);z-index:1}.input.searchtext{border:none}.searchbarform{display:flex;flex-direction:row;box-shadow:0 25px 50px -12px rgba(0,0,0,.25)}#location,#photographer{font-size:calc(10px + 1.2vmin);text-shadow:0 0 25px rgba(0,0,0,.3);text-overflow:ellipsis}#location{margin-bottom:-10px}#photographer{position:absolute;bottom:10px;left:50px;width:1000px}.locationicon{font-size:calc(10px + 1.2vmin);cursor:pointer}.MuiSvgIcon-root{position:absolute;bottom:2px;left:2px;width:100em;height:100em;font-size:2rem;text-shadow:0 2px 25px rgba(0,0,0,.3)}.credits{bottom:2px;left:0px;position:absolute;text-align:left;min-width:50px}.tooltip{position:relative;display:inline-block;border-bottom:1px dotted #000;bottom:15px;left:10px}.tooltip .tooltiptext{visibility:hidden;background-color:#000;color:#fff;text-align:center;border-radius:6px;padding:20px;position:absolute;z-index:1;position:absolute;bottom:40px;left:60px;margin-left:-60px;opacity:0;transition:opacity 1s}.tooltip:hover .tooltiptext{visibility:visible;opacity:1}.navbar1{top:50px;right:0px;position:absolute;text-align:right;min-width:50px}.navbar2{top:50px;right:50px;position:absolute;text-align:right;min-width:50px}.PizzaIcon{margin-right:20px}.pizza{right:2000px}body{background:#2f3640;margin:0;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:"Lexend Deca";overflow:hidden}#center{margin-left:2vw;margin-right:2vw;display:flex;flex-direction:column;justify-content:center;font-size:calc(10px + 2vmin);text-align:center}::placeholder{color:#fff;opacity:1}#root{background-size:cover;background-repeat:no-repeat;background-position:center;background-attachment:fixed;min-height:100vh;display:grid;color:#fff}@font-face{font-family:"Lexend Deca";src:url("/./fonts/LexendDeca-Regular.woff2") format("woff2")}/*# sourceMappingURL=index.css.map */ diff --git a/src/css/index.css.map b/src/css/index.css.map deleted file mode 100644 index 991d56a8..00000000 --- a/src/css/index.css.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sourceRoot":"","sources":["../scss/modules/_clock.scss","../scss/modules/_greeting.scss","../scss/modules/_quote.scss","../scss/modules/_search.scss","../scss/modules/_credit.scss","../scss/modules/_navbar.scss","../scss/modules/_miscellaneous.scss"],"names":[],"mappings":"AAAA,OACE,cACA,SACA,oCAGF,MACE,eCPF,UACI,SACA,gBACA,oCCHJ,OACE,eACA,oCAGF,qCACE,OACE,gBACA,kBAIJ,aACE,eACA,oBACA,SACA,oCAGF,gCAEE,eCrBF,WACI,kBACA,UACA,SACA,aACA,mBACA,cACA,WACA,0BAEA,kBACI,eACA,aAMA,eAJA,mCACI,oCAMR,4BACI,8BACA,gBACA,sBACA,aACA,WACA,kBACA,mCACA,UAIR,kBACI,YAGJ,eACI,aACA,mBACA,6CCxCJ,wBAEE,+BACA,oCACA,uBAGF,UACE,oBAGF,cACE,kBACA,YACA,UACA,aAGF,cACE,+BACA,eAGF,iBACE,kBACA,WACA,SACA,YACA,aACA,eACA,sCAGF,SACE,WACA,SACA,kBACA,gBACA,eAGF,SACE,kBACA,qBACA,8BACA,YACA,UAEA,sBACE,kBACA,sBACA,WACA,kBACA,kBACA,aACA,kBACA,UACA,kBACA,YACA,UACA,kBAEA,UACA,sBAIJ,4BACE,mBACA,UCrEF,SACI,SACA,UACA,kBACA,iBACA,eAGJ,SACI,SACA,WACA,kBACA,iBACA,eAGJ,WACI,kBAGJ,OACI,aCrBJ,KACE,mBACA,SACA,mCACA,kCACA,0BACA,gBAGF,QACE,gBACA,iBACA,aACA,sBACA,uBACA,6BACA,kBAGF,cACE,WACA,UAGF,MACE,sBACA,4BACA,2BACA,4BACA,iBACA,aACA,WAGF,WACE,0BACA","file":"index.css"} \ No newline at end of file diff --git a/src/scss/modules/_navbar.scss b/src/scss/modules/_navbar.scss index e8f1a759..151011da 100644 --- a/src/scss/modules/_navbar.scss +++ b/src/scss/modules/_navbar.scss @@ -14,14 +14,6 @@ min-width: 50px; } -.navbar2 { - top: 50px; - right: 100px; - position: absolute; - text-align: right; - min-width: 50px; -} - .PizzaIcon { margin-right: 20px; } diff --git a/src/scss/modules/_search.scss b/src/scss/modules/_search.scss index ef4d8606..a78735e7 100644 --- a/src/scss/modules/_search.scss +++ b/src/scss/modules/_search.scss @@ -11,12 +11,11 @@ button { cursor: pointer; outline: none; + display: inline; i.material-icons { text-shadow: 0 0 25px rgba(0, 0, 0, 0.3); } - - display: inline; } input[type=text] {