From 99e91909dc297fb434774a9523c305eda03bf28b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yusuf=20=C4=B0pek?= Date: Mon, 25 Jan 2021 15:28:11 +0300 Subject: [PATCH] Updates --- asset-manifest.json | 12 ++++++------ index.html | 2 +- ...in.a9e04c65.chunk.css => main.55bf0c2f.chunk.css} | 4 ++-- ...c65.chunk.css.map => main.55bf0c2f.chunk.css.map} | 2 +- static/js/main.52e24b25.chunk.js | 2 ++ static/js/main.52e24b25.chunk.js.map | 1 + static/js/main.5bb52aac.chunk.js | 2 -- static/js/main.5bb52aac.chunk.js.map | 1 - 8 files changed, 13 insertions(+), 13 deletions(-) rename static/css/{main.a9e04c65.chunk.css => main.55bf0c2f.chunk.css} (85%) rename static/css/{main.a9e04c65.chunk.css.map => main.55bf0c2f.chunk.css.map} (87%) create mode 100644 static/js/main.52e24b25.chunk.js create mode 100644 static/js/main.52e24b25.chunk.js.map delete mode 100644 static/js/main.5bb52aac.chunk.js delete mode 100644 static/js/main.5bb52aac.chunk.js.map diff --git a/asset-manifest.json b/asset-manifest.json index d844205..aff436d 100644 --- a/asset-manifest.json +++ b/asset-manifest.json @@ -1,8 +1,8 @@ { "files": { - "main.css": "/quote-machine/static/css/main.a9e04c65.chunk.css", - "main.js": "/quote-machine/static/js/main.5bb52aac.chunk.js", - "main.js.map": "/quote-machine/static/js/main.5bb52aac.chunk.js.map", + "main.css": "/quote-machine/static/css/main.55bf0c2f.chunk.css", + "main.js": "/quote-machine/static/js/main.52e24b25.chunk.js", + "main.js.map": "/quote-machine/static/js/main.52e24b25.chunk.js.map", "runtime-main.js": "/quote-machine/static/js/runtime-main.d0d4c421.js", "runtime-main.js.map": "/quote-machine/static/js/runtime-main.d0d4c421.js.map", "static/css/2.150d169a.chunk.css": "/quote-machine/static/css/2.150d169a.chunk.css", @@ -12,14 +12,14 @@ "static/js/3.5113abf0.chunk.js.map": "/quote-machine/static/js/3.5113abf0.chunk.js.map", "index.html": "/quote-machine/index.html", "static/css/2.150d169a.chunk.css.map": "/quote-machine/static/css/2.150d169a.chunk.css.map", - "static/css/main.a9e04c65.chunk.css.map": "/quote-machine/static/css/main.a9e04c65.chunk.css.map", + "static/css/main.55bf0c2f.chunk.css.map": "/quote-machine/static/css/main.55bf0c2f.chunk.css.map", "static/js/2.cc152759.chunk.js.LICENSE.txt": "/quote-machine/static/js/2.cc152759.chunk.js.LICENSE.txt" }, "entrypoints": [ "static/js/runtime-main.d0d4c421.js", "static/css/2.150d169a.chunk.css", "static/js/2.cc152759.chunk.js", - "static/css/main.a9e04c65.chunk.css", - "static/js/main.5bb52aac.chunk.js" + "static/css/main.55bf0c2f.chunk.css", + "static/js/main.52e24b25.chunk.js" ] } \ No newline at end of file diff --git a/index.html b/index.html index df79905..1669531 100644 --- a/index.html +++ b/index.html @@ -1 +1 @@ -Quote Machine
\ No newline at end of file +Quote Machine
\ No newline at end of file diff --git a/static/css/main.a9e04c65.chunk.css b/static/css/main.55bf0c2f.chunk.css similarity index 85% rename from static/css/main.a9e04c65.chunk.css rename to static/css/main.55bf0c2f.chunk.css index f944c0a..4246e82 100644 --- a/static/css/main.a9e04c65.chunk.css +++ b/static/css/main.55bf0c2f.chunk.css @@ -1,2 +1,2 @@ -body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Oxygen","Ubuntu","Cantarell","Fira Sans","Droid Sans","Helvetica Neue",sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}code{font-family:source-code-pro,Menlo,Monaco,Consolas,"Courier New",monospace}.wrapper{display:flex;justify-content:center;align-content:center;height:950px}.wrapper #quote-box{display:flexbox;align-self:center;color:#fff;width:800px;height:400px;border:1px solid grey;border-radius:5px;padding:10px}.wrapper .writing{padding-top:130px;height:150px;text-align:center}.wrapper #new-quote,.wrapper #tweet{margin-top:100px;float:right}.wrapper #tweet{margin-right:15px}.wrapper a:active,.wrapper a:link,.wrapper a:visited{color:#fff} -/*# sourceMappingURL=main.a9e04c65.chunk.css.map */ \ No newline at end of file +body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Oxygen","Ubuntu","Cantarell","Fira Sans","Droid Sans","Helvetica Neue",sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}code{font-family:source-code-pro,Menlo,Monaco,Consolas,"Courier New",monospace}.wrapper{display:flex;justify-content:center;align-content:center;height:954px}.wrapper #quote-box{display:flexbox;align-self:center;color:#fff;width:800px;height:400px;border:1px solid grey;border-radius:5px;padding:10px}.wrapper .writing{padding-top:130px;height:150px;text-align:center}.wrapper #new-quote,.wrapper #tweet{margin-top:100px;float:right}.wrapper #tweet{margin-right:15px}.wrapper a:active,.wrapper a:link,.wrapper a:visited{color:#fff} +/*# sourceMappingURL=main.55bf0c2f.chunk.css.map */ \ No newline at end of file diff --git a/static/css/main.a9e04c65.chunk.css.map b/static/css/main.55bf0c2f.chunk.css.map similarity index 87% rename from static/css/main.a9e04c65.chunk.css.map rename to static/css/main.55bf0c2f.chunk.css.map index 7ebbcaa..e8a9c36 100644 --- a/static/css/main.a9e04c65.chunk.css.map +++ b/static/css/main.55bf0c2f.chunk.css.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://src/index.css","webpack://src/components/quote-box/quote-box-styles.scss"],"names":[],"mappings":"AAAA,KACE,QAAS,CACT,mJAEY,CACZ,kCAAmC,CACnC,iCACF,CAEA,KACE,yEAEF,CCZA,SACE,YAAA,CACA,sBAAA,CACA,oBAAA,CACA,YAAA,CAEA,oBACE,eAAA,CACA,iBAAA,CACA,UAAA,CACA,WAAA,CACA,YAAA,CACA,qBAAA,CACA,iBAAA,CACA,YAAA,CAGF,kBACE,iBAAA,CACA,YAAA,CACA,iBAAA,CAQF,oCAJE,gBAAA,CACA,WAMA,CAHF,gBAGE,iBAAA,CASF,qDACE,UAAA","file":"main.a9e04c65.chunk.css","sourcesContent":["body {\n margin: 0;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',\n 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',\n sans-serif;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\ncode {\n font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',\n monospace;\n}\n",".wrapper {\n display: flex;\n justify-content: center;\n align-content: center;\n height: 950px;\n\n #quote-box {\n display: flexbox;\n align-self: center;\n color: white;\n width: 800px;\n height: 400px;\n border: 1px solid grey;\n border-radius: 5px;\n padding: 10px;\n }\n\n .writing {\n padding-top: 130px;\n height: 150px;\n text-align: center;\n }\n\n #new-quote {\n margin-top: 100px;\n float: right;\n }\n\n #tweet {\n float: right;\n margin-top: 100px;\n margin-right: 15px;\n }\n\n a:link {\n color: white;\n }\n a:visited {\n color: white;\n } /* visited link */\n a:active {\n color: white;\n }\n}\n"]} \ No newline at end of file +{"version":3,"sources":["webpack://src/index.css","webpack://src/components/quote-box/quote-box-styles.scss"],"names":[],"mappings":"AAAA,KACE,QAAS,CACT,mJAEY,CACZ,kCAAmC,CACnC,iCACF,CAEA,KACE,yEAEF,CCZA,SACE,YAAA,CACA,sBAAA,CACA,oBAAA,CACA,YAAA,CAEA,oBACE,eAAA,CACA,iBAAA,CACA,UAAA,CACA,WAAA,CACA,YAAA,CACA,qBAAA,CACA,iBAAA,CACA,YAAA,CAGF,kBACE,iBAAA,CACA,YAAA,CACA,iBAAA,CAQF,oCAJE,gBAAA,CACA,WAMA,CAHF,gBAGE,iBAAA,CASF,qDACE,UAAA","file":"main.55bf0c2f.chunk.css","sourcesContent":["body {\n margin: 0;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',\n 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',\n sans-serif;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\ncode {\n font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',\n monospace;\n}\n",".wrapper {\n display: flex;\n justify-content: center;\n align-content: center;\n height: 954px;\n\n #quote-box {\n display: flexbox;\n align-self: center;\n color: white;\n width: 800px;\n height: 400px;\n border: 1px solid grey;\n border-radius: 5px;\n padding: 10px;\n }\n\n .writing {\n padding-top: 130px;\n height: 150px;\n text-align: center;\n }\n\n #new-quote {\n margin-top: 100px;\n float: right;\n }\n\n #tweet {\n float: right;\n margin-top: 100px;\n margin-right: 15px;\n }\n\n a:link {\n color: white;\n }\n a:visited {\n color: white;\n } /* visited link */\n a:active {\n color: white;\n }\n}\n"]} \ No newline at end of file diff --git a/static/js/main.52e24b25.chunk.js b/static/js/main.52e24b25.chunk.js new file mode 100644 index 0000000..4675ba2 --- /dev/null +++ b/static/js/main.52e24b25.chunk.js @@ -0,0 +1,2 @@ +(this["webpackJsonpquote-machine"]=this["webpackJsonpquote-machine"]||[]).push([[0],{17:function(t,e,n){},18:function(t,e,n){},21:function(t,e,n){},22:function(t,e,n){"use strict";n.r(e);var a=n(1),r=n(0),s=n.n(r),c=n(9),i=n.n(c),o=(n(17),n(2)),u=n(3),h=n(5),d=n(4),l=(n(18),n(7)),f=n.n(l),b=n(10),j=n(11),p=(n(20),function(t){return Object(a.jsx)(j.a,{variant:t.variant,href:t.href,target:t.target,onClick:t.click,children:t.text})}),x=(n(21),function(t){Object(h.a)(n,t);var e=Object(d.a)(n);function n(t){var a;return Object(o.a)(this,n),(a=e.call(this,t)).random=function(){return Math.floor(1600*Math.random())},a.random2=function(){return Math.floor(4*Math.random())},a.handleChange=function(){var t=a.random();a.setState({displayQuote:a.state.quotes[t].text,displayAuthor:a.state.quotes[t].author}),a.props.handler(a.state.backGroundApp[a.random2()])},a.state={quotes:null,displayQuote:null,displayAuthor:null,color:["#264653","#2a9d8f","#e76f51","#e63946","#bc6c25"],backGroundApp:["#ffadad","#ffd6a5","#caffbf","#9bf6ff","#a0c4ff","#ffc6ff"]},a}return Object(u.a)(n,[{key:"componentDidMount",value:function(){var t=Object(b.a)(f.a.mark((function t(){var e,n,a;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,fetch("https://type.fit/api/quotes");case 2:return e=t.sent,t.next=5,e.json();case 5:n=t.sent,this.setState({quotes:n}),a=this.random(),this.setState({displayQuote:this.state.quotes[a].text,displayAuthor:this.state.quotes[a].author});case 9:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}()},{key:"render",value:function(){return this.state.quotes?Object(a.jsx)("div",{className:"wrapper",children:Object(a.jsxs)("div",{id:"quote-box",style:{transition:"background-color 0.3s ease",backgroundColor:this.state.color[this.random2()]},children:[Object(a.jsxs)("div",{className:"writing",children:[Object(a.jsx)("h3",{id:"text",children:this.state.displayQuote}),Object(a.jsx)("p",{id:"author",children:this.state.displayAuthor})]}),Object(a.jsx)("div",{id:"new-quote",children:Object(a.jsx)(p,{click:this.handleChange,text:"New Quote",variant:"success"})}),Object(a.jsx)("div",{id:"tweet",children:Object(a.jsx)(p,{href:"https://twitter.com/intent/tweet?text=".concat(this.state.displayQuote," \n \n ").concat(this.state.displayAuthor),target:"_blank",text:Object(a.jsx)("a",{id:"tweet-quote",target:"_blank",rel:"noreferrer",href:"https://twitter.com/intent/tweet?text=".concat(this.state.displayQuote," \n \n ").concat(this.state.displayAuthor),children:"Tweet"}),variant:"primary"})})]})}):Object(a.jsx)("div",{children:Object(a.jsx)("h1",{style:{textAlign:"center"},children:"Loading..."})})}}]),n}(s.a.Component)),O=function(t){Object(h.a)(n,t);var e=Object(d.a)(n);function n(){var t;return Object(o.a)(this,n),(t=e.call(this)).bgChange=function(e){t.setState({backG:e})},t.state={backG:"#2a9d8f"},t}return Object(u.a)(n,[{key:"render",value:function(){return Object(a.jsx)("div",{className:"App",style:{transition:"background-color 0.3s ease",backgroundColor:this.state.backG},children:Object(a.jsx)(x,{id:"quote",handler:this.bgChange})})}}]),n}(r.Component),v=function(t){t&&t instanceof Function&&n.e(3).then(n.bind(null,23)).then((function(e){var n=e.getCLS,a=e.getFID,r=e.getFCP,s=e.getLCP,c=e.getTTFB;n(t),a(t),r(t),s(t),c(t)}))};i.a.render(Object(a.jsx)(s.a.StrictMode,{children:Object(a.jsx)(O,{})}),document.getElementById("root")),v()}},[[22,1,2]]]); +//# sourceMappingURL=main.52e24b25.chunk.js.map \ No newline at end of file diff --git a/static/js/main.52e24b25.chunk.js.map b/static/js/main.52e24b25.chunk.js.map new file mode 100644 index 0000000..cffc270 --- /dev/null +++ b/static/js/main.52e24b25.chunk.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["components/button/button.jsx","components/quote-box/quote-box.jsx","App.js","reportWebVitals.js","index.js"],"names":["QuoteButton","props","Button","variant","href","target","onClick","click","text","QuoteBox","random","Math","floor","random2","handleChange","randomNum","setState","displayQuote","state","quotes","displayAuthor","author","handler","backGroundApp","color","fetch","response","json","this","className","id","style","transition","backgroundColor","rel","textAlign","React","Component","App","bgChange","e","backG","reportWebVitals","onPerfEntry","Function","then","getCLS","getFID","getFCP","getLCP","getTTFB","ReactDOM","render","StrictMode","document","getElementById"],"mappings":"kTAGaA,G,MAAc,SAACC,GAC1B,OACE,cAACC,EAAA,EAAD,CACEC,QAASF,EAAME,QACfC,KAAMH,EAAMG,KACZC,OAAQJ,EAAMI,OACdC,QAASL,EAAMM,MAJjB,SAMGN,EAAMO,SCsGEC,G,wDA5Gb,WAAYR,GAAQ,IAAD,8BACjB,cAAMA,IAoBRS,OAAS,WACP,OAAOC,KAAKC,MAAsB,KAAhBD,KAAKD,WAtBN,EA0BnBG,QAAU,WACR,OAAOF,KAAKC,MAAsB,EAAhBD,KAAKD,WA3BN,EA2CnBI,aAAe,WACb,IAAMC,EAAY,EAAKL,SACvB,EAAKM,SAAS,CACZC,aAAc,EAAKC,MAAMC,OAAOJ,GAAWP,KAC3CY,cAAe,EAAKF,MAAMC,OAAOJ,GAAWM,SAE9C,EAAKpB,MAAMqB,QAAQ,EAAKJ,MAAMK,cAAc,EAAKV,aA/CjD,EAAKK,MAAQ,CACXC,OAAQ,KACRF,aAAc,KACdG,cAAe,KAEfI,MAAO,CAAC,UAAW,UAAW,UAAW,UAAW,WAEpDD,cAAe,CACb,UACA,UACA,UACA,UACA,UACA,YAfa,E,oMAgCME,MAAM,+B,cAAvBC,E,gBACaA,EAASC,O,OAAtBA,E,OACNC,KAAKZ,SAAS,CAAEG,OAAQQ,IAClBZ,EAAYa,KAAKlB,SACvBkB,KAAKZ,SAAS,CACZC,aAAcW,KAAKV,MAAMC,OAAOJ,GAAWP,KAC3CY,cAAeQ,KAAKV,MAAMC,OAAOJ,GAAWM,S,qIAe9C,OAAKO,KAAKV,MAAMC,OASd,qBAAKU,UAAU,UAAf,SACE,sBACEC,GAAG,YACHC,MAAO,CACLC,WAAY,6BACZC,gBAAiBL,KAAKV,MAAMM,MAAMI,KAAKf,YAJ3C,UAOE,sBAAKgB,UAAU,UAAf,UACE,oBAAIC,GAAG,OAAP,SAAeF,KAAKV,MAAMD,eAC1B,mBAAGa,GAAG,SAAN,SAAgBF,KAAKV,MAAME,mBAE7B,qBAAKU,GAAG,YAAR,SACE,cAAC,EAAD,CACEvB,MAAOqB,KAAKd,aACZN,KAAK,YACLL,QAAQ,cAGZ,qBAAK2B,GAAG,QAAR,SACE,cAAC,EAAD,CACE1B,KAAI,gDAA2CwB,KAAKV,MAAMD,aAAtD,4CAEFW,KAAKV,MAAME,eACbf,OAAO,SACPG,KACE,mBACEsB,GAAG,cACHzB,OAAO,SACP6B,IAAI,aACJ9B,KAAI,gDAA2CwB,KAAKV,MAAMD,aAAtD,4CAENW,KAAKV,MAAME,eANX,mBAWFjB,QAAQ,mBA5Cd,8BACE,oBAAI4B,MAAO,CAAEI,UAAW,UAAxB,8B,GAzDaC,IAAMC,YC8BdC,E,kDA7Bb,aAAe,IAAD,8BACZ,gBAOFC,SAAW,SAACC,GACV,EAAKxB,SAAS,CACZyB,MAAOD,KART,EAAKtB,MAAQ,CACXuB,MAAO,WAHG,E,qDAeZ,OACE,qBACEZ,UAAU,MACVE,MAAO,CACLC,WAAY,6BACZC,gBAAiBL,KAAKV,MAAMuB,OAJhC,SAOE,cAAC,EAAD,CAAUX,GAAG,QAAQR,QAASM,KAAKW,iB,GAxBzBF,aCQHK,EAZS,SAAAC,GAClBA,GAAeA,aAAuBC,UACxC,6BAAqBC,MAAK,YAAkD,IAA/CC,EAA8C,EAA9CA,OAAQC,EAAsC,EAAtCA,OAAQC,EAA8B,EAA9BA,OAAQC,EAAsB,EAAtBA,OAAQC,EAAc,EAAdA,QAC3DJ,EAAOH,GACPI,EAAOJ,GACPK,EAAOL,GACPM,EAAON,GACPO,EAAQP,OCDdQ,IAASC,OACP,cAAC,IAAMC,WAAP,UACE,cAAC,EAAD,MAEFC,SAASC,eAAe,SAM1Bb,M","file":"static/js/main.52e24b25.chunk.js","sourcesContent":["import Button from \"react-bootstrap/Button\";\nimport \"bootstrap/dist/css/bootstrap.min.css\";\n\nexport const QuoteButton = (props) => {\n return (\n \n {props.text}\n \n );\n};\n","import React from \"react\";\nimport { QuoteButton } from \"../button/button\";\nimport \"./quote-box-styles.scss\";\n\nclass QuoteBox extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n quotes: null,\n displayQuote: null,\n displayAuthor: null,\n // color for the box\n color: [\"#264653\", \"#2a9d8f\", \"#e76f51\", \"#e63946\", \"#bc6c25\"],\n // color for the app.js body\n backGroundApp: [\n \"#ffadad\",\n \"#ffd6a5\",\n \"#caffbf\",\n \"#9bf6ff\",\n \"#a0c4ff\",\n \"#ffc6ff\",\n ],\n };\n }\n\n // creating random number for quote api\n random = () => {\n return Math.floor(Math.random() * 1600);\n };\n\n // creating random number for background\n random2 = () => {\n return Math.floor(Math.random() * 4);\n };\n\n // fetching the quotes and assigning it to displayquote/author states\n async componentDidMount() {\n const response = await fetch(\"https://type.fit/api/quotes\");\n const json = await response.json();\n this.setState({ quotes: json });\n const randomNum = this.random();\n this.setState({\n displayQuote: this.state.quotes[randomNum].text,\n displayAuthor: this.state.quotes[randomNum].author,\n });\n }\n\n //changing the quotes and author also sending a bg to app.js\n handleChange = () => {\n const randomNum = this.random();\n this.setState({\n displayQuote: this.state.quotes[randomNum].text,\n displayAuthor: this.state.quotes[randomNum].author,\n });\n this.props.handler(this.state.backGroundApp[this.random2()]);\n };\n\n render() {\n if (!this.state.quotes) {\n return (\n
\n

Loading...

\n
\n );\n }\n\n return (\n
\n \n
\n

{this.state.displayQuote}

\n

{this.state.displayAuthor}

\n
\n
\n \n
\n
\n \n Tweet\n \n }\n variant=\"primary\"\n />\n
\n
\n \n );\n }\n}\n\nexport default QuoteBox;\n","import { Component } from \"react\";\nimport \"./App.css\";\nimport QuoteBox from \"./components/quote-box/quote-box\";\n\nclass App extends Component {\n constructor() {\n super();\n this.state = {\n backG: \"#2a9d8f\",\n };\n }\n\n // getting the background from quote-box\n bgChange = (e) => {\n this.setState({\n backG: e,\n });\n };\n\n render() {\n return (\n \n \n \n );\n }\n}\n\nexport default App;\n","const reportWebVitals = onPerfEntry => {\n if (onPerfEntry && onPerfEntry instanceof Function) {\n import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {\n getCLS(onPerfEntry);\n getFID(onPerfEntry);\n getFCP(onPerfEntry);\n getLCP(onPerfEntry);\n getTTFB(onPerfEntry);\n });\n }\n};\n\nexport default reportWebVitals;\n","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport './index.css';\nimport App from './App';\nimport reportWebVitals from './reportWebVitals';\n\nReactDOM.render(\n \n \n ,\n document.getElementById('root')\n);\n\n// If you want to start measuring performance in your app, pass a function\n// to log results (for example: reportWebVitals(console.log))\n// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals\nreportWebVitals();\n"],"sourceRoot":""} \ No newline at end of file diff --git a/static/js/main.5bb52aac.chunk.js b/static/js/main.5bb52aac.chunk.js deleted file mode 100644 index a55ffda..0000000 --- a/static/js/main.5bb52aac.chunk.js +++ /dev/null @@ -1,2 +0,0 @@ -(this["webpackJsonpquote-machine"]=this["webpackJsonpquote-machine"]||[]).push([[0],{17:function(t,e,n){},18:function(t,e,n){},21:function(t,e,n){},22:function(t,e,n){"use strict";n.r(e);var a=n(1),r=n(0),s=n.n(r),c=n(9),i=n.n(c),o=(n(17),n(2)),u=n(3),h=n(5),d=n(4),l=(n(18),n(7)),f=n.n(l),b=n(10),j=n(11),p=(n(20),function(t){return Object(a.jsx)(j.a,{variant:t.variant,target:t.target,onClick:t.click,children:t.text})}),x=(n(21),function(t){Object(h.a)(n,t);var e=Object(d.a)(n);function n(t){var a;return Object(o.a)(this,n),(a=e.call(this,t)).random=function(){return Math.floor(1600*Math.random())},a.random2=function(){return Math.floor(4*Math.random())},a.handleChange=function(){var t=a.random();a.setState({displayQuote:a.state.quotes[t].text,displayAuthor:a.state.quotes[t].author}),a.props.handler(a.state.backGroundApp[a.random2()])},a.state={quotes:null,displayQuote:null,displayAuthor:null,color:["#264653","#2a9d8f","#e76f51","#e63946","#bc6c25"],backGroundApp:["#ffadad","#ffd6a5","#caffbf","#9bf6ff","#a0c4ff","#ffc6ff"]},a}return Object(u.a)(n,[{key:"componentDidMount",value:function(){var t=Object(b.a)(f.a.mark((function t(){var e,n,a;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,fetch("https://type.fit/api/quotes");case 2:return e=t.sent,t.next=5,e.json();case 5:n=t.sent,this.setState({quotes:n}),a=this.random(),this.setState({displayQuote:this.state.quotes[a].text,displayAuthor:this.state.quotes[a].author});case 9:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}()},{key:"render",value:function(){return this.state.quotes?Object(a.jsx)("div",{className:"wrapper",children:Object(a.jsxs)("div",{id:"quote-box",style:{transition:"background-color 0.3s ease",backgroundColor:this.state.color[this.random2()]},children:[Object(a.jsxs)("div",{className:"writing",children:[Object(a.jsx)("h3",{id:"text",children:this.state.displayQuote}),Object(a.jsx)("p",{id:"author",children:this.state.displayAuthor})]}),Object(a.jsx)("div",{id:"new-quote",children:Object(a.jsx)(p,{click:this.handleChange,text:"New Quote",variant:"success"})}),Object(a.jsx)("div",{id:"tweet",children:Object(a.jsx)(p,{href:"https://twitter.com/intent/tweet?text=".concat(this.state.displayQuote," \n \n ").concat(this.state.displayAuthor),text:Object(a.jsx)("a",{id:"tweet-quote",target:"_blank",rel:"noreferrer",href:"https://twitter.com/intent/tweet?text=".concat(this.state.displayQuote," \n \n ").concat(this.state.displayAuthor),children:"Tweet"}),variant:"primary"})})]})}):Object(a.jsx)("div",{children:Object(a.jsx)("h1",{style:{textAlign:"center"},children:"Loading..."})})}}]),n}(s.a.Component)),O=function(t){Object(h.a)(n,t);var e=Object(d.a)(n);function n(){var t;return Object(o.a)(this,n),(t=e.call(this)).bgChange=function(e){t.setState({backG:e})},t.state={backG:"#2a9d8f"},t}return Object(u.a)(n,[{key:"render",value:function(){return Object(a.jsx)("div",{className:"App",style:{transition:"background-color 0.3s ease",backgroundColor:this.state.backG},children:Object(a.jsx)(x,{id:"quote",handler:this.bgChange})})}}]),n}(r.Component),v=function(t){t&&t instanceof Function&&n.e(3).then(n.bind(null,23)).then((function(e){var n=e.getCLS,a=e.getFID,r=e.getFCP,s=e.getLCP,c=e.getTTFB;n(t),a(t),r(t),s(t),c(t)}))};i.a.render(Object(a.jsx)(s.a.StrictMode,{children:Object(a.jsx)(O,{})}),document.getElementById("root")),v()}},[[22,1,2]]]); -//# sourceMappingURL=main.5bb52aac.chunk.js.map \ No newline at end of file diff --git a/static/js/main.5bb52aac.chunk.js.map b/static/js/main.5bb52aac.chunk.js.map deleted file mode 100644 index b2911a3..0000000 --- a/static/js/main.5bb52aac.chunk.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["components/button/button.jsx","components/quote-box/quote-box.jsx","App.js","reportWebVitals.js","index.js"],"names":["QuoteButton","props","Button","variant","target","onClick","click","text","QuoteBox","random","Math","floor","random2","handleChange","randomNum","setState","displayQuote","state","quotes","displayAuthor","author","handler","backGroundApp","color","fetch","response","json","this","className","id","style","transition","backgroundColor","href","rel","textAlign","React","Component","App","bgChange","e","backG","reportWebVitals","onPerfEntry","Function","then","getCLS","getFID","getFCP","getLCP","getTTFB","ReactDOM","render","StrictMode","document","getElementById"],"mappings":"kTAGaA,G,MAAc,SAACC,GAC1B,OACE,cAACC,EAAA,EAAD,CAAQC,QAASF,EAAME,QAASC,OAAQH,EAAMG,OAAQC,QAASJ,EAAMK,MAArE,SACGL,EAAMM,SC0GEC,G,wDA3Gb,WAAYP,GAAQ,IAAD,8BACjB,cAAMA,IAoBRQ,OAAS,WACP,OAAOC,KAAKC,MAAsB,KAAhBD,KAAKD,WAtBN,EA0BnBG,QAAU,WACR,OAAOF,KAAKC,MAAsB,EAAhBD,KAAKD,WA3BN,EA2CnBI,aAAe,WACb,IAAMC,EAAY,EAAKL,SACvB,EAAKM,SAAS,CACZC,aAAc,EAAKC,MAAMC,OAAOJ,GAAWP,KAC3CY,cAAe,EAAKF,MAAMC,OAAOJ,GAAWM,SAE9C,EAAKnB,MAAMoB,QAAQ,EAAKJ,MAAMK,cAAc,EAAKV,aA/CjD,EAAKK,MAAQ,CACXC,OAAQ,KACRF,aAAc,KACdG,cAAe,KAEfI,MAAO,CAAC,UAAW,UAAW,UAAW,UAAW,WAEpDD,cAAe,CACb,UACA,UACA,UACA,UACA,UACA,YAfa,E,oMAgCME,MAAM,+B,cAAvBC,E,gBACaA,EAASC,O,OAAtBA,E,OACNC,KAAKZ,SAAS,CAAEG,OAAQQ,IAClBZ,EAAYa,KAAKlB,SACvBkB,KAAKZ,SAAS,CACZC,aAAcW,KAAKV,MAAMC,OAAOJ,GAAWP,KAC3CY,cAAeQ,KAAKV,MAAMC,OAAOJ,GAAWM,S,qIAe9C,OAAKO,KAAKV,MAAMC,OASd,qBAAKU,UAAU,UAAf,SACE,sBACEC,GAAG,YACHC,MAAO,CACLC,WAAY,6BACZC,gBAAiBL,KAAKV,MAAMM,MAAMI,KAAKf,YAJ3C,UAOE,sBAAKgB,UAAU,UAAf,UACE,oBAAIC,GAAG,OAAP,SAAeF,KAAKV,MAAMD,eAC1B,mBAAGa,GAAG,SAAN,SAAgBF,KAAKV,MAAME,mBAE7B,qBAAKU,GAAG,YAAR,SACE,cAAC,EAAD,CACEvB,MAAOqB,KAAKd,aACZN,KAAK,YACLJ,QAAQ,cAGZ,qBAAK0B,GAAG,QAAR,SACE,cAAC,EAAD,CACEI,KAAI,gDAA2CN,KAAKV,MAAMD,aAAtD,4CAEFW,KAAKV,MAAME,eACbZ,KACE,mBACEsB,GAAG,cACHzB,OAAO,SACP8B,IAAI,aACJD,KAAI,gDAA2CN,KAAKV,MAAMD,aAAtD,4CAENW,KAAKV,MAAME,eANX,mBAWFhB,QAAQ,mBA3Cd,8BACE,oBAAI2B,MAAO,CAAEK,UAAW,UAAxB,8B,GAzDaC,IAAMC,YC8BdC,E,kDA7Bb,aAAe,IAAD,8BACZ,gBAOFC,SAAW,SAACC,GACV,EAAKzB,SAAS,CACZ0B,MAAOD,KART,EAAKvB,MAAQ,CACXwB,MAAO,WAHG,E,qDAeZ,OACE,qBACEb,UAAU,MACVE,MAAO,CACLC,WAAY,6BACZC,gBAAiBL,KAAKV,MAAMwB,OAJhC,SAOE,cAAC,EAAD,CAAUZ,GAAG,QAAQR,QAASM,KAAKY,iB,GAxBzBF,aCQHK,EAZS,SAAAC,GAClBA,GAAeA,aAAuBC,UACxC,6BAAqBC,MAAK,YAAkD,IAA/CC,EAA8C,EAA9CA,OAAQC,EAAsC,EAAtCA,OAAQC,EAA8B,EAA9BA,OAAQC,EAAsB,EAAtBA,OAAQC,EAAc,EAAdA,QAC3DJ,EAAOH,GACPI,EAAOJ,GACPK,EAAOL,GACPM,EAAON,GACPO,EAAQP,OCDdQ,IAASC,OACP,cAAC,IAAMC,WAAP,UACE,cAAC,EAAD,MAEFC,SAASC,eAAe,SAM1Bb,M","file":"static/js/main.5bb52aac.chunk.js","sourcesContent":["import Button from \"react-bootstrap/Button\";\nimport \"bootstrap/dist/css/bootstrap.min.css\";\n\nexport const QuoteButton = (props) => {\n return (\n \n );\n};\n","import React from \"react\";\nimport { QuoteButton } from \"../button/button\";\nimport \"./quote-box-styles.scss\";\n\nclass QuoteBox extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n quotes: null,\n displayQuote: null,\n displayAuthor: null,\n // color for the box\n color: [\"#264653\", \"#2a9d8f\", \"#e76f51\", \"#e63946\", \"#bc6c25\"],\n // color for the app.js body\n backGroundApp: [\n \"#ffadad\",\n \"#ffd6a5\",\n \"#caffbf\",\n \"#9bf6ff\",\n \"#a0c4ff\",\n \"#ffc6ff\",\n ],\n };\n }\n\n // creating random number for quote api\n random = () => {\n return Math.floor(Math.random() * 1600);\n };\n\n // creating random number for background\n random2 = () => {\n return Math.floor(Math.random() * 4);\n };\n\n // fetching the quotes and assigning it to displayquote/author states\n async componentDidMount() {\n const response = await fetch(\"https://type.fit/api/quotes\");\n const json = await response.json();\n this.setState({ quotes: json });\n const randomNum = this.random();\n this.setState({\n displayQuote: this.state.quotes[randomNum].text,\n displayAuthor: this.state.quotes[randomNum].author,\n });\n }\n\n //changing the quotes and author also sending a bg to app.js\n handleChange = () => {\n const randomNum = this.random();\n this.setState({\n displayQuote: this.state.quotes[randomNum].text,\n displayAuthor: this.state.quotes[randomNum].author,\n });\n this.props.handler(this.state.backGroundApp[this.random2()]);\n };\n\n render() {\n if (!this.state.quotes) {\n return (\n
\n

Loading...

\n
\n );\n }\n\n return (\n
\n \n
\n

{this.state.displayQuote}

\n

{this.state.displayAuthor}

\n
\n
\n \n
\n
\n \n Tweet\n \n }\n variant=\"primary\"\n />\n
\n
\n \n );\n }\n}\n\nexport default QuoteBox;\n","import { Component } from \"react\";\nimport \"./App.css\";\nimport QuoteBox from \"./components/quote-box/quote-box\";\n\nclass App extends Component {\n constructor() {\n super();\n this.state = {\n backG: \"#2a9d8f\",\n };\n }\n\n // getting the background from quote-box\n bgChange = (e) => {\n this.setState({\n backG: e,\n });\n };\n\n render() {\n return (\n \n \n \n );\n }\n}\n\nexport default App;\n","const reportWebVitals = onPerfEntry => {\n if (onPerfEntry && onPerfEntry instanceof Function) {\n import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {\n getCLS(onPerfEntry);\n getFID(onPerfEntry);\n getFCP(onPerfEntry);\n getLCP(onPerfEntry);\n getTTFB(onPerfEntry);\n });\n }\n};\n\nexport default reportWebVitals;\n","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport './index.css';\nimport App from './App';\nimport reportWebVitals from './reportWebVitals';\n\nReactDOM.render(\n \n \n ,\n document.getElementById('root')\n);\n\n// If you want to start measuring performance in your app, pass a function\n// to log results (for example: reportWebVitals(console.log))\n// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals\nreportWebVitals();\n"],"sourceRoot":""} \ No newline at end of file