Permalink
Browse files

Updated README

  • Loading branch information...
1 parent 4613461 commit 34c83096936632c872cd05c9b1a38e5f6c0102e2 @matthewjamesr committed May 20, 2017
Showing with 146 additions and 114 deletions.
  1. +20 −0 README.md
  2. +3 −0 README.md~
  3. +45 −4 css/main.css
  4. +0 −73 css/main.css~
  5. +15 −1 index.html
  6. +4 −0 main.js
  7. +1 −1 package.json
  8. +0 −35 package.json~
  9. +58 −0 settings.html
View
@@ -1,3 +1,23 @@
# Crypti
A small Bitcoin price widget for desktops.
+
+* Keeps you current on Bitcoin to USD conversion
+* Utilized Coinmarketcap.com data
+* Updates every 60 seconds
+
+## Platforms
+
+Currently Supported
+
+* Win32 x64-86
+* Win32 x64
+* Linux
+
+Planned Support
+
+* MacOS
+
+## Compiled Binaries
+
+Compiled binaries are available on the [Latest Release](https://github.com/matthewjamesr/Crypti/releases/latest) page.
View
@@ -0,0 +1,3 @@
+# Crypti
+
+A small Bitcoin price widget for desktops.
View
@@ -4,6 +4,7 @@ html {
margin: 0px;
height: 100%;
color: #FFF;
+ -webkit-app-region: drag;
}
:not(input):not(textarea),
@@ -23,15 +24,16 @@ body {
#info {
position: absolute;
- top: 0px
- left: 0px;
- margin-left: -10px;
+ top: 5px;
+ right: 5px;
+ font-size: 14pt;
+ -webkit-app-region: no-drag;
}
img#btc-icon {
position: absolute;
top: 15px;
- right: 15px;
+ right: 25px;
height: 85px;
width: 85px;
-webkit-app-region: drag;
@@ -72,6 +74,7 @@ p {
position: absolute;
bottom: 15px;
margin: 15px 0px 0px 0px;
+ padding: 0px;
font-size: 16pt;
}
@@ -80,5 +83,43 @@ div#drag-region {
left: 0px;
height: 15px;
width: 100%;
+ z-index: +2;
-webkit-app-region: drag;
}
+
+.modal {
+ display: none; /* Hidden by default */
+ position: fixed; /* Stay in place */
+ z-index: 1; /* Sit on top */
+ left: 0;
+ top: 0;
+ width: 100%; /* Full width */
+ height: 100%; /* Full height */
+ overflow: auto; /* Enable scroll if needed */
+ background-color: rgb(0,0,0); /* Fallback color */
+ background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
+}
+
+/* Modal Content/Box */
+.modal-content {
+ background-color: #fefefe;
+ margin: 15% auto; /* 15% from the top and centered */
+ padding: 20px;
+ border: 1px solid #888;
+ width: 80%; /* Could be more or less, depending on screen size */
+}
+
+/* The Close Button */
+.close {
+ color: #aaa;
+ float: right;
+ font-size: 28px;
+ font-weight: bold;
+}
+
+.close:hover,
+.close:focus {
+ color: black;
+ text-decoration: none;
+ cursor: pointer;
+}
View
@@ -1,73 +0,0 @@
-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;
-}
-
-#info {
- position: absolute;
- top: 0px
- left: 0px;
- margin-left: -10px;
-}
-
-img#btc-icon {
- position: absolute;
- top: 15px;
- right: 15px;
- height: 85px;
- width: 85px;
- -webkit-app-region: drag;
-}
-
-.refresh-control {
- float: left
-}
-
-.refresh-controler, #timer {
- font-size: 10pt;
- margin-left: 10px;
-}
-
-.refresh-bar {
- position: absolute;
- bottom: 0px;
- left: 0px;
- height: 5px;
- width: 100%;
-}
-
-#progress {
- position relative;
- background: #28959b;
- height: 100%;
- width: 0%
-}
-
-h1 {
- position: relative;
- float: left;
- 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;
- left: 0px;
- height: 15px;
- width: 100%;
- -webkit-app-region: drag;
-}
View
@@ -12,15 +12,25 @@
</head>
<body>
<div id="drag-region"></div>
+ <i class="mi mi-info-outline" id="info"></i>
<h1 id="btcPrice">Searching</h1>
<div class="refresh-control">
<span id="timer"></span>
</div>
<img id="btc-icon" src="images/btc-icon.svg" />
- <p>Current Bitcoin Price</p>
+ <p style="float: left;">USD - BTC</p>
<div class="refresh-bar">
<div id="progress"></div>
</div>
+
+ <div id="myModal" class="modal">
+ <!-- Modal content -->
+ <div class="modal-content">
+ <span class="close">&times;</span>
+ <p>Some text in the Modal..</p>
+ </div>
+ </div>
+
</body>
<script>
@@ -49,6 +59,10 @@ <h1 id="btcPrice">Searching</h1>
counter--
progress++
}, 1000);
+
+ document.getElementById("info").addEventListener("click", function (e) {
+ document.getElementById('myModal').style.display = "block";
+ });
</script>
<script
src="https://code.jquery.com/jquery-3.2.1.min.js"
View
@@ -14,6 +14,8 @@ let mainWindow
function createWindow () {
// Create the browser window.
mainWindow = new BrowserWindow({width: 340, height: 115, frame: false})
+
+
// and load the index.html of the app.
mainWindow.loadURL(url.format({
@@ -22,6 +24,8 @@ function createWindow () {
slashes: true
}))
+ //settingsWindow.show();
+
// Open the DevTools.
// mainWindow.webContents.openDevTools()
View
@@ -10,7 +10,7 @@
"cryptocurrency",
"price",
"widget"
- ],git a
+ ],
"author": "Matthew Reichardt",
"license": "MIT",
"devDependencies": {
View
@@ -1,35 +0,0 @@
-{
- "name": "Crypti",
- "version": "1.0.0",
- "description": "A minimal bitcoin price desktop widget",
- "main": "main.js",
- "repository": "https://github.com/electron/electron-quick-start",
- "keywords": [
- "crypti",
- "bitcoin",
- "cryptocurrency",
- "price",
- "widget"
- ],
- "author": "Matthew Reichardt",
- "license": "MIT",
- "devDependencies": {
- "electron": "~1.6.2"
- },
- "dependencies": {
- "material-icons": "^0.1.0",
- "request": "^2.81.0"
- },
- "build": {
- "appId": "com.github.matthewjamesr.crypti",
- "mac": {
- "category": "finance"
- }
- },
- "scripts": {
- "start": "electron .",
- "pack": "build --dir",
- "dist": "build",
- "postinstall": "install-app-deps"
- }
-}
View
@@ -0,0 +1,58 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="UTF-8">
+ <title>Crypti Settings</title>
+ <link rel="stylesheet" href="css/main.css" />
+ <link rel="stylesheet" href="css/animate.css" />
+ <!-- Material icons font hosted by Google -->
+ <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
+ <!-- Material icons CSS toolkit -->
+ <link rel="stylesheet" href="node_modules/material-icons/css/material-icons.min.css">
+ </head>
+ <body>
+ <div id="drag-region"></div>
+ <i class="mi mi-info-outline" id="info"></i>
+ <h1 id="btcPrice">Searching</h1>
+ <div class="refresh-control">
+ <span id="timer"></span>
+ </div>
+ <img id="btc-icon" src="images/btc-icon.svg" />
+ <p style="float: left;">USD - BTC</p>
+ <div class="refresh-bar">
+ <div id="progress"></div>
+ </div>
+ </body>
+
+ <script>
+ // You can also require other files to run in this process
+ require('./renderer.js')
+
+ var currentPrice = document.getElementById('btcPrice');
+ var counter = 60;
+ var progress = 0;
+
+ 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() {
+ //document.getElementById('timer').innerHTML = Math.ceil(counter);
+ document.getElementById('progress').style.width = progress/60*100 + "%";
+ if(counter === 0) {
+ request('https://api.coinmarketcap.com/v1/ticker/bitcoin/', function(error, response, body) {
+ currentPrice.innerHTML = '$' + JSON.parse(body)[0].price_usd;
+
+ });
+ counter = 60;
+ progress = 0;
+ }
+ counter--
+ progress++
+ }, 1000);
+ </script>
+ <script
+ src="https://code.jquery.com/jquery-3.2.1.min.js"
+ integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4="
+ crossorigin="anonymous"></script>
+</html>

0 comments on commit 34c8309

Please sign in to comment.