diff --git a/StockAPI.js b/StockAPI.js index d58252b..0532905 100644 --- a/StockAPI.js +++ b/StockAPI.js @@ -26,12 +26,11 @@ class StockAPI { time_period: 10, }; const qs = queryString.stringify(query); - console.log(qs) try { const res = await fetch(`${this.HOST}/query?${qs}`); const json = await res.json(); const data = json['Technical Analysis: SMA']; - console.log(data) + console.log(`Data for ${symbol} received.`); /* Transform into [{x: ... y: ...}, {}]*/ return data; } catch (e) { diff --git a/main.js b/main.js index e593a79..41e18e8 100644 --- a/main.js +++ b/main.js @@ -84,7 +84,6 @@ const changeRefreshRate = (rate) => { const fetchWithAuth = (url, opts) => { const options = Object.assign({}, opts, { headers: { Authorization: `Token ${RobinHoodAPI._token}` } }); - console.log(options) return fetch(url, options); }; @@ -319,9 +318,10 @@ const createPreferencesWindow = () => { const createStockInfoWindow = async (symbol) => { if (stockInfoWindow !== null) { - stockInfoWindow.show(); - return; + // Don't allow multiple stock info windows + stockInfoWindow.close(); } + stockInfoWindow = new BrowserWindow({ height: 750, width: 1100, diff --git a/package-lock.json b/package-lock.json index ca54276..95fd7f6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -53,6 +53,12 @@ "resolved": "https://registry.npmjs.org/about-window/-/about-window-1.9.1.tgz", "integrity": "sha512-XhmLAGOGDc6DupjgH0nSonfFNrfvaJsaJSECL7Yr4g8fPsdXp0cl6Px8W9fg1ntvV/FG1fINtCUiawIyrGLx9w==" }, + "accessibility-developer-tools": { + "version": "2.12.0", + "resolved": "https://registry.npmjs.org/accessibility-developer-tools/-/accessibility-developer-tools-2.12.0.tgz", + "integrity": "sha1-PaDM6dbsY3OWS4TzXbfPw996tRQ=", + "dev": true + }, "ajv": { "version": "5.5.2", "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", @@ -957,6 +963,17 @@ "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", "dev": true }, + "devtron": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/devtron/-/devtron-1.4.0.tgz", + "integrity": "sha1-tedIvW6Vu+cL/MaKrm/mlhGUQeE=", + "dev": true, + "requires": { + "accessibility-developer-tools": "2.12.0", + "highlight.js": "9.12.0", + "humanize-plus": "1.8.2" + } + }, "dmg-builder": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/dmg-builder/-/dmg-builder-3.1.3.tgz", @@ -2926,6 +2943,12 @@ "sntp": "2.1.0" } }, + "highlight.js": { + "version": "9.12.0", + "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-9.12.0.tgz", + "integrity": "sha1-5tnb5Xy+/mB1HwKvM2GVhwyQwB4=", + "dev": true + }, "hoek": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/hoek/-/hoek-4.2.0.tgz", @@ -2955,6 +2978,12 @@ "sshpk": "1.13.1" } }, + "humanize-plus": { + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/humanize-plus/-/humanize-plus-1.8.2.tgz", + "integrity": "sha1-pls0RZrWNnrbs3B6gqPJ+RYWcDA=", + "dev": true + }, "iconv-lite": { "version": "0.4.19", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz", diff --git a/package.json b/package.json index 3d70ba9..2cc2be2 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ } }, "devDependencies": { + "devtron": "^1.4.0", "electron": "~1.7.8", "electron-builder": "^19.55.2", "electron-debug": "^1.5.0", diff --git a/styles/chart.css b/styles/chart.css index a9fff87..df98aef 100644 --- a/styles/chart.css +++ b/styles/chart.css @@ -1,10 +1,179 @@ +@font-face { + font-family: 'Alte Din'; + src: url('../assets/din1451alt.ttf'); +} + body { - margin: 20px; + font-family: 'Alte Din', sans-serif!important; +} + +.container { display: flex; + justify-content: center; align-items: center; - flex-direction: column; - font-family: 'Alte Din', sans-serif; - letter-spacing: 0.1em; - font-weight: 100; - user-select: none; +} + +canvas { + visibility: hidden; +} + +/*! + * Load Awesome v1.1.0 (http://github.danielcardoso.net/load-awesome/) + * Copyright 2015 Daniel Cardoso <@DanielCardoso> + * Licensed under MIT + */ +.la-line-scale-pulse-out, +.la-line-scale-pulse-out > div { + position: relative; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +.la-line-scale-pulse-out { + display: block; + font-size: 0; + color: #fff; +} +.la-line-scale-pulse-out.la-dark { + color: #333; +} +.la-line-scale-pulse-out > div { + display: inline-block; + float: none; + background-color: currentColor; + border: 0 solid currentColor; +} +.la-line-scale-pulse-out { + width: 40px; + height: 32px; +} +.la-line-scale-pulse-out > div { + width: 4px; + height: 32px; + margin: 2px; + margin-top: 0; + margin-bottom: 0; + border-radius: 0; + -webkit-animation: line-scale-pulse-out .9s infinite cubic-bezier(.85, .25, .37, .85); + -moz-animation: line-scale-pulse-out .9s infinite cubic-bezier(.85, .25, .37, .85); + -o-animation: line-scale-pulse-out .9s infinite cubic-bezier(.85, .25, .37, .85); + animation: line-scale-pulse-out .9s infinite cubic-bezier(.85, .25, .37, .85); +} +.la-line-scale-pulse-out > div:nth-child(3) { + -webkit-animation-delay: -.9s; + -moz-animation-delay: -.9s; + -o-animation-delay: -.9s; + animation-delay: -.9s; +} +.la-line-scale-pulse-out > div:nth-child(2), +.la-line-scale-pulse-out > div:nth-child(4) { + -webkit-animation-delay: -.7s; + -moz-animation-delay: -.7s; + -o-animation-delay: -.7s; + animation-delay: -.7s; +} +.la-line-scale-pulse-out > div:nth-child(1), +.la-line-scale-pulse-out > div:nth-child(5) { + -webkit-animation-delay: -.5s; + -moz-animation-delay: -.5s; + -o-animation-delay: -.5s; + animation-delay: -.5s; +} +.la-line-scale-pulse-out.la-sm { + width: 20px; + height: 16px; +} +.la-line-scale-pulse-out.la-sm > div { + width: 2px; + height: 16px; + margin: 1px; + margin-top: 0; + margin-bottom: 0; +} +.la-line-scale-pulse-out.la-2x { + width: 80px; + height: 64px; +} +.la-line-scale-pulse-out.la-2x > div { + width: 8px; + height: 64px; + margin: 4px; + margin-top: 0; + margin-bottom: 0; +} +.la-line-scale-pulse-out.la-3x { + width: 120px; + height: 96px; +} +.la-line-scale-pulse-out.la-3x > div { + width: 12px; + height: 96px; + margin: 6px; + margin-top: 0; + margin-bottom: 0; +} +/* + * Animation + */ +@-webkit-keyframes line-scale-pulse-out { + 0% { + -webkit-transform: scaley(1); + transform: scaley(1); + } + 50% { + -webkit-transform: scaley(.3); + transform: scaley(.3); + } + 100% { + -webkit-transform: scaley(1); + transform: scaley(1); + } +} +@-moz-keyframes line-scale-pulse-out { + 0% { + -moz-transform: scaley(1); + transform: scaley(1); + } + 50% { + -moz-transform: scaley(.3); + transform: scaley(.3); + } + 100% { + -moz-transform: scaley(1); + transform: scaley(1); + } +} +@-o-keyframes line-scale-pulse-out { + 0% { + -o-transform: scaley(1); + transform: scaley(1); + } + 50% { + -o-transform: scaley(.3); + transform: scaley(.3); + } + 100% { + -o-transform: scaley(1); + transform: scaley(1); + } +} +@keyframes line-scale-pulse-out { + 0% { + -webkit-transform: scaley(1); + -moz-transform: scaley(1); + -o-transform: scaley(1); + transform: scaley(1); + } + 50% { + -webkit-transform: scaley(.3); + -moz-transform: scaley(.3); + -o-transform: scaley(.3); + transform: scaley(.3); + } + 100% { + -webkit-transform: scaley(1); + -moz-transform: scaley(1); + -o-transform: scaley(1); + transform: scaley(1); + } } diff --git a/views/chart.html b/views/chart.html index 9f4d1e7..f7d4a99 100644 --- a/views/chart.html +++ b/views/chart.html @@ -8,21 +8,31 @@
-