Skip to content
Snippets Groups Projects
Commit 3ba9bcff authored by Taddeüs Kroes's avatar Taddeüs Kroes
Browse files

Add first alpha placeholder interface

parent 90a98df2
No related branches found
No related tags found
No related merge requests found
......@@ -4,6 +4,7 @@ import os
import atexit
import time
import grequests
import json
from argparse import ArgumentParser
from Queue import PriorityQueue
......@@ -115,6 +116,6 @@ if __name__ == '__main__':
last = float(last)
with open(root + '/' + exid, 'w') as f:
print >>f, last, currency
json.dump({'last': last, 'currency': currency}, f)
except KeyboardInterrupt:
pass
www/dashboard.png

430 KiB

<!doctype html>
<html>
<head>
<style>
body {
background-color: #52617d;
}
img, div {
position: absolute;
}
.spaceship {
left: 50%;
top: 50%;
margin-left: -150px;
margin-top: -50px;
}
.moon {
right: 50px;
top: 50px;
}
.dashboard {
right: 0;
bottom: 0;
}
.price, .cap {
font: normal 14px courier new;
right: 15px;
bottom: 127px;
width: 109px;
height: 20px;
}
.cap {
bottom: 50px;
}
</style>
</head>
<body>
<img class="moon" src="moooon.png" width="300"></div>
<img class="dashboard" src="dashboard.png "width="500"></div>
<img class="spaceship" src="spaiceship.png" width="250"></div>
<div id="price" class="price"></div>
<div id="cap" class="cap"></div>
<script src="poll.js"></script>
</body>
</html>
www/moooon.png

125 KiB

/dev/shm/tothemoon
\ No newline at end of file
var poll_interval = 2000;
var price = document.getElementById('price');
var cap = document.getElementById('cap');
function poll(url, cb) {
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function() {
if (xhr.readyState == 4 && xhr.status == 200)
cb(JSON.parse(xhr.responseText));
};
xhr.open('GET', url, true);
xhr.send();
}
function poll_btce() {
poll('poll/btce', function(d) {
price.innerHTML = '$' + d.last.toFixed(2);
});
}
setInterval(poll_btce, poll_interval);
poll('poll/coinmarketcap', function(d) {
cap.innerHTML = '$' + d.last.toFixed(0);
});
poll_btce();
www/spaiceship.png

443 KiB

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment