Permalink
Browse files

First commit

  • Loading branch information...
1 parent dea0121 commit 1cbc1e71d31962c7d0ad29161dca42c8dda0ae42 @matthewjamesr committed May 20, 2017
Showing with 1,866 additions and 16 deletions.
  1. +1,579 −0 css/animate.css
  2. +41 −0 css/main.css
  3. +7 −0 css/main.css~
  4. +98 −0 images/btc-icon.svg
  5. +24 −6 index.html
  6. +19 −0 index.html~
  7. +1 −1 main.js
  8. +60 −0 main.js~
  9. +12 −9 package.json
  10. +25 −0 package.json~
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -0,0 +1,41 @@
+html {
+ background: linear-gradient(045deg, #0fb8ad 0%, #1fc8db 51%, #2cb5e8 75%);
+ padding: 0px;
+ margin: 0px;
+ height: 100%;
+ color: #FFF;
+}
+
+body {
+ margin: 10px 15px 15px 15px;
+}
+
+img#btc-icon {
+ position: absolute;
+ top: 15px;
+ right: 15px;
+ height: 85px;
+ width: 85px;
+ -webkit-app-region: drag;
+}
+
+h1 {
+ font-size: 32pt;
+ margin: 0px 0px 0px 0px;
+}
+
+p {
+ position: absolute;
+ bottom: 15px;
+ margin: 15px 0px 0px 0px;
+ font-size: 16pt;
+}
+
+div#drag-region {
+ position: absolute;
+ top: 0px;
+ left: 0px;
+ height: 15px;
+ width: 100%;
+ -webkit-app-region: drag;
+}
View
@@ -0,0 +1,7 @@
+div#drag-region {
+ position: absolute;
+ top: 0px;
+ left: 0px;
+ height: 15px;
+ width: 100%;
+}
View
@@ -0,0 +1,98 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ version="1.1"
+ width="512px"
+ height="512px"
+ viewBox="0 0 1 1"
+ preserveAspectRatio="xMidYMid"
+ id="svg2"
+ inkscape:version="0.91 r13725"
+ sodipodi:docname="bitcoinLogo_withShadow.svg">
+ <metadata
+ id="metadata22">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1017"
+ id="namedview20"
+ showgrid="false"
+ inkscape:zoom="2.6074563"
+ inkscape:cx="141.9319"
+ inkscape:cy="461.86715"
+ inkscape:window-x="-8"
+ inkscape:window-y="-8"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="svg2" />
+ <!-- Android launcher icons: viewBox="-0.045 -0.045 1.09 1.09" -->
+ <defs
+ id="defs4">
+ <filter
+ id="drop-shadow">
+ <feGaussianBlur
+ in="SourceAlpha"
+ result="blur-out"
+ stdDeviation="1"
+ id="feGaussianBlur7" />
+ <feBlend
+ in="SourceGraphic"
+ in2="blur-out"
+ mode="normal"
+ id="feBlend9" />
+ </filter>
+ <linearGradient
+ id="coin-gradient"
+ x1="-6.3992519"
+ y1="-6.4002874"
+ x2="-6.3992519"
+ y2="70.396015"
+ gradientTransform="scale(0.99994169,1.0000583)"
+ gradientUnits="userSpaceOnUse">
+ <stop
+ offset="0%"
+ style="stop-color:#f9aa4b"
+ id="stop12" />
+ <stop
+ offset="100%"
+ style="stop-color:#f7931a"
+ id="stop14" />
+ </linearGradient>
+ </defs>
+ <g
+ transform="matrix(0.01436343,0,0,0.01452646,0.04036642,0.0351531)"
+ id="g16">
+ <path
+ id="coin"
+ d="M 63.0359,39.741 C 58.7619,56.884 41.3989,67.317 24.2539,63.042 7.1159,58.768 -3.3171,41.404 0.9589,24.262 5.2309,7.117 22.5939,-3.317 39.7339,0.957 c 17.144,4.274 27.576,21.64 23.302,38.784 z"
+ style="fill:url(#coin-gradient);filter:url(#drop-shadow)"
+ inkscape:connector-curvature="0" />
+ <path
+ id="symbol"
+ d="m 46.1009,27.441 c 0.637,-4.258 -2.605,-6.547 -7.038,-8.074 l 1.438,-5.768 -3.511,-0.875 -1.4,5.616 c -0.923,-0.23 -1.871,-0.447 -2.813,-0.662 l 1.41,-5.653 -3.509,-0.875 -1.439,5.766 c -0.764,-0.174 -1.514,-0.346 -2.242,-0.527 l 0.004,-0.018 -4.842,-1.209 -0.934,3.75 c 0,0 2.605,0.597 2.55,0.634 1.422,0.355 1.679,1.296 1.636,2.042 -3.94,15.801 0,0 -3.94,15.801 -0.174,0.432 -0.615,1.08 -1.609,0.834 0.035,0.051 -2.552,-0.637 -2.552,-0.637 l -1.743,4.019 4.569,1.139 c 0.85,0.213 1.683,0.436 2.503,0.646 l -1.453,5.834 3.507,0.875 1.439,-5.772 c 0.958,0.26 1.888,0.5 2.798,0.726 l -1.434,5.745 3.511,0.875 1.453,-5.823 c 5.987,1.133 10.489,0.676 12.384,-4.739 1.527,-4.36 -0.076,-6.875 -3.226,-8.515 2.294,-0.529 4.022,-2.038 4.483,-5.155 z m -8.022,11.249 c -1.085,4.36 -8.426,2.003 -10.806,1.412 l 1.928,-7.729 c 2.38,0.594 10.012,1.77 8.878,6.317 z m 1.086,-11.312 c -0.99,3.966 -7.1,1.951 -9.082,1.457 l 1.748,-7.01 c 1.982,0.494 8.365,1.416 7.334,5.553 z"
+ style="fill:#ffffff;filter:url(#drop-shadow)"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="ccccccccccccccccccccccccccccccccccccccc" />
+ </g>
+</svg>
View
@@ -2,18 +2,36 @@
<html>
<head>
<meta charset="UTF-8">
- <title>Hello World!</title>
+ <title>Crypti</title>
+ <link rel="stylesheet" href="css/main.css" />
+ <link rel="stylesheet" href="css/animate.css" />
</head>
<body>
- <h1>Hello World!</h1>
- <!-- All of the Node.js APIs are available in this renderer process. -->
- We are using Node.js <script>document.write(process.versions.node)</script>,
- Chromium <script>document.write(process.versions.chrome)</script>,
- and Electron <script>document.write(process.versions.electron)</script>.
+ <div id="drag-region"></div>
+ <h1 id="btcPrice">Searching....</h1>
+ <img id="btc-icon" src="images/btc-icon.svg" />
+ <p>Current Bitcoin Price</p>
</body>
<script>
// You can also require other files to run in this process
require('./renderer.js')
+
+ var currentPrice = document.getElementById('btcPrice');
+
+ var request = require('request');
+ request('https://api.coinmarketcap.com/v1/ticker/bitcoin/', function(error, response, body) {
+ currentPrice.innerHTML = '$' + JSON.parse(body)[0].price_usd;
+ });
+ var requestLoop = setInterval(function() {
+ request('https://api.coinmarketcap.com/v1/ticker/bitcoin/', function(error, response, body) {
+ currentPrice.innerHTML = '$' + JSON.parse(body)[0].price_usd;
+
+ });
+ }, 30000);
</script>
+ <script
+ src="https://code.jquery.com/jquery-3.2.1.min.js"
+ integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4="
+ crossorigin="anonymous"></script>
</html>
View
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="UTF-8">
+ <title>Hello World!</title>
+ </head>
+ <body>
+ <h1>Hello World!</h1>
+ <!-- All of the Node.js APIs are available in this renderer process. -->
+ We are using Node.js <script>document.write(process.versions.node)</script>,
+ Chromium <script>document.write(process.versions.chrome)</script>,
+ and Electron <script>document.write(process.versions.electron)</script>.
+ </body>
+
+ <script>
+ // You can also require other files to run in this process
+ require('./renderer.js')
+ </script>
+</html>
View
@@ -13,7 +13,7 @@ let mainWindow
function createWindow () {
// Create the browser window.
- mainWindow = new BrowserWindow({width: 800, height: 600})
+ mainWindow = new BrowserWindow({width: 340, height: 115, frame: false})
// and load the index.html of the app.
mainWindow.loadURL(url.format({
View
@@ -0,0 +1,60 @@
+const electron = require('electron')
+// Module to control application life.
+const app = electron.app
+// Module to create native browser window.
+const BrowserWindow = electron.BrowserWindow
+
+const path = require('path')
+const url = require('url')
+
+// Keep a global reference of the window object, if you don't, the window will
+// be closed automatically when the JavaScript object is garbage collected.
+let mainWindow
+
+function createWindow () {
+ // Create the browser window.
+ mainWindow = new BrowserWindow({width: 800, height: 600})
+
+ // and load the index.html of the app.
+ mainWindow.loadURL(url.format({
+ pathname: path.join(__dirname, 'index.html'),
+ protocol: 'file:',
+ slashes: true
+ }))
+
+ // Open the DevTools.
+ // mainWindow.webContents.openDevTools()
+
+ // Emitted when the window is closed.
+ mainWindow.on('closed', function () {
+ // Dereference the window object, usually you would store windows
+ // in an array if your app supports multi windows, this is the time
+ // when you should delete the corresponding element.
+ mainWindow = null
+ })
+}
+
+// This method will be called when Electron has finished
+// initialization and is ready to create browser windows.
+// Some APIs can only be used after this event occurs.
+app.on('ready', createWindow)
+
+// Quit when all windows are closed.
+app.on('window-all-closed', function () {
+ // On OS X it is common for applications and their menu bar
+ // to stay active until the user quits explicitly with Cmd + Q
+ if (process.platform !== 'darwin') {
+ app.quit()
+ }
+})
+
+app.on('activate', function () {
+ // On OS X it's common to re-create a window in the app when the
+ // dock icon is clicked and there are no other windows open.
+ if (mainWindow === null) {
+ createWindow()
+ }
+})
+
+// In this file you can include the rest of your app's specific main process
+// code. You can also put them in separate files and require them here.
View
@@ -1,22 +1,25 @@
{
- "name": "electron-quick-start",
+ "name": "Crypti",
"version": "1.0.0",
- "description": "A minimal Electron application",
+ "description": "A minimal bitcoin price desktop widget",
"main": "main.js",
"scripts": {
"start": "electron ."
},
"repository": "https://github.com/electron/electron-quick-start",
"keywords": [
- "Electron",
- "quick",
- "start",
- "tutorial",
- "demo"
+ "crypti",
+ "bitcoin",
+ "cryptocurrency",
+ "price",
+ "widget"
],
- "author": "GitHub",
- "license": "CC0-1.0",
+ "author": "Matthew Reichardt",
+ "license": "MIT",
"devDependencies": {
"electron": "~1.6.2"
+ },
+ "dependencies": {
+ "request": "^2.81.0"
}
}
View
@@ -0,0 +1,25 @@
+{
+ "name": "electron-quick-start",
+ "version": "1.0.0",
+ "description": "A minimal Electron application",
+ "main": "main.js",
+ "scripts": {
+ "start": "electron ."
+ },
+ "repository": "https://github.com/electron/electron-quick-start",
+ "keywords": [
+ "Electron",
+ "quick",
+ "start",
+ "tutorial",
+ "demo"
+ ],
+ "author": "GitHub",
+ "license": "CC0-1.0",
+ "devDependencies": {
+ "electron": "~1.6.2"
+ },
+ "dependencies": {
+ "request": "^2.81.0"
+ }
+}

0 comments on commit 1cbc1e7

Please sign in to comment.