diff --git a/desktop/assets/bb-icon.png b/desktop/assets/bb-icon.png
new file mode 100644
index 0000000..1b36d4e
Binary files /dev/null and b/desktop/assets/bb-icon.png differ
diff --git a/desktop/assets/cute-graph-donation.png b/desktop/assets/cute-graph-donation.png
new file mode 100644
index 0000000..8bc9173
Binary files /dev/null and b/desktop/assets/cute-graph-donation.png differ
diff --git a/desktop/assets/cute-graph-green.png b/desktop/assets/cute-graph-green.png
new file mode 100644
index 0000000..95b7c55
Binary files /dev/null and b/desktop/assets/cute-graph-green.png differ
diff --git a/desktop/assets/cute-graph-payout.png b/desktop/assets/cute-graph-payout.png
new file mode 100644
index 0000000..2957464
Binary files /dev/null and b/desktop/assets/cute-graph-payout.png differ
diff --git a/desktop/assets/pages/cute-graph-pink.png b/desktop/assets/cute-graph-pink.png
similarity index 100%
rename from desktop/assets/pages/cute-graph-pink.png
rename to desktop/assets/cute-graph-pink.png
diff --git a/desktop/assets/pages/cute-graph.png b/desktop/assets/cute-graph.png
similarity index 100%
rename from desktop/assets/pages/cute-graph.png
rename to desktop/assets/cute-graph.png
diff --git a/desktop/package-lock.json b/desktop/package-lock.json
index aca20e5..e693b93 100644
--- a/desktop/package-lock.json
+++ b/desktop/package-lock.json
@@ -1,6 +1,6 @@
{
"name": "bailbloc",
- "version": "1.2.0",
+ "version": "1.2.2",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
diff --git a/desktop/stats.css b/desktop/stats.css
index 3b0e0e8..d72929c 100644
--- a/desktop/stats.css
+++ b/desktop/stats.css
@@ -1,3 +1,5 @@
+
+
#individual {
position:absolute;
width:100%;
@@ -88,16 +90,16 @@
.payouticon, .donationicon {
position: absolute;
- width: 18px;
- height: 18px;
- background-image: url(assets/payout.png);
+ width: 14px;
+ height: 14px;
+ background-image: url(assets/cute-graph-payout.png);
background-repeat: no-repeat;
background-size: 100%;
z-index:98;
}
.donationicon {
- background-image: url(assets/donation.png);
+ background-image: url(assets/cute-graph-donation.png);
}
#xaxis-label-friends a img, #label-donations a img {
@@ -111,7 +113,7 @@
}
#xaxis-label-friends, #label-donations {
- right: 94px;
+ left: 550px;
}
#topbox {
@@ -193,4 +195,8 @@
z-index: 99;
color: #fff;
text-shadow: 1px 1px 2px #888888;
+}
+
+#stats-date, #scrub-actual, #scrub-friends, #scrub-line {
+ opacity:0 !important;
}
\ No newline at end of file
diff --git a/desktop/stats.html b/desktop/stats.html
index 3bd1b7f..d3a7a13 100644
--- a/desktop/stats.html
+++ b/desktop/stats.html
@@ -26,23 +26,22 @@
-
-
-
FUNDS RAISED TO DATE
+
+
XMR generated
-
+
CHECK CUT TO BAIL FUND
-
-
if everyone invited 3 friends
-
-
+
+
USD raised
+
-
+
DONATION RECEIVED
@@ -56,11 +55,11 @@
diff --git a/desktop/stats.js b/desktop/stats.js
index 8fbd004..8b7e147 100644
--- a/desktop/stats.js
+++ b/desktop/stats.js
@@ -16,7 +16,7 @@ var yMax = 0.0;
var minExRate = 0.0;
var maxExRate = 500.0;
var minUSD = 0.0;
-var maxUSD = 10000.0;
+var maxUSD = 1000.0;
var myFont;
var fontS = 18.7;
@@ -162,45 +162,77 @@ function draw() {
// NEW------
var y = 0.0;
- // draw XMR graph
- // stroke(255, 0, 0);
- // strokeWeight(8);
- noStroke();
- fill(255, 0, 0);
-
- beginShape();
- vertex(mL, height);
- vertex(gp[0].x, gp[0].y);
-
- for (var i = 1; i < gp.length; i++) {
- vertex(gp[i].x, gp[i].y);
- }
- vertex(mR, height);
- endShape();
+ // // draw XMR graph
+ // // stroke(255, 0, 0);
+ // // strokeWeight(8);
+ // noStroke();
+ // fill(255, 0, 0);
+
+ // beginShape();
+ // vertex(mL, height);
+ // vertex(gp[0].x, gp[0].y);
- // draw exchange rate graph
- stroke(100, 100, 255, 200);
- noFill();
- beginShape();
+ // for (var i = 1; i < gp.length; i++) {
+ // vertex(gp[i].x, gp[i].y);
+ // }
+ // vertex(mR, height);
+ // endShape();
+ // USD as vertical bars
+ strokeWeight(4);
+ stroke(100,255,100);
for (var i = 0; i < gp.length; i++) {
- y = map(gp[i].eRate, minExRate, maxExRate, height, 0);
- vertex(gp[i].x, y);
+ y = map(gp[i].usd, minUSD, maxUSD, height, 0);
+ line(gp[i].x - 1, height, gp[i].x - 1, y);
}
- endShape();
+ // XMR as vertical bars
+ stroke(255,80,80);
+ for (var i = 0; i < gp.length; i++) {
+ line(gp[i].x - 1, height, gp[i].x - 1, gp[i].y);
+ }
+ // turn nearest bar to mouse yellow
+ var nearestBar = int(map(mouseX,0,width,0,gp.length-1));
+ nearestBar = constrain(nearestBar,0,gp.length-1);
+ stroke(255,255,100);
+ // usd
+ y = map(gp[nearestBar].usd, minUSD, maxUSD, height, 0);
+ line(gp[nearestBar].x - 1, height, gp[nearestBar].x - 1, y);
+ // xmr
+ line(gp[nearestBar].x - 1, height, gp[nearestBar].x - 1, gp[nearestBar].y);
+
+ // clean lines between
+ // stroke(255);
+ // strokeWeight(1);
+ // for (var i = 0; i < gp.length; i++) {
+ // line(gp[i].x + 2, height, gp[i].x + 2, 0);
+ // }
- // draw USD graph
- stroke(100, 255, 100, 200);
- noFill();
- beginShape();
+ // // draw exchange rate graph
+ // stroke(100, 100, 255, 200);
+ // noFill();
+ // beginShape();
+
+ // for (var i = 0; i < gp.length; i++) {
+ // y = map(gp[i].eRate, minExRate, maxExRate, height, 0);
+ // vertex(gp[i].x, y);
+ // }
+ // endShape();
+
+
+
+ // // draw USD graph
+ // stroke(100, 255, 100, 200);
+ // noFill();
+ // beginShape();
+
+ // for (var i = 0; i < gp.length; i++) {
+ // y = map(gp[i].usd, minUSD, maxUSD, height, 0);
+ // vertex(gp[i].x, y);
+ // }
+ // endShape();
- for (var i = 0; i < gp.length; i++) {
- y = map(gp[i].usd, minUSD, maxUSD, height, 0);
- vertex(gp[i].x, y);
- }
- endShape();
for (var i = 0; i < gp.length; i++) {
@@ -227,9 +259,9 @@ function mouseMoved() {
mouseReady = true;
}
- // check mouse
- var pointInQuestion = int(map(mouseX, 0, width, 0, numPoints));
- pointInQuestion = constrain(pointInQuestion, 0, numPoints - 1);
+ // check mouse (4 pixel offset helps)
+ var pointInQuestion = int(map(mouseX, 0, width + 4, 0, gp.length));
+ // pointInQuestion = constrain(pointInQuestion, 0, gp.length - 1);
//console.log(pointInQuestion);
@@ -245,6 +277,12 @@ function mouseMoved() {
$("#scrub-actual").offset({ top: y, left: x });
$("#scrub-actual").html(valToPrint);
+ $("#scrub-date").html(gp[pointInQuestion].date);
+ $("#scrub-usd").html(gp[pointInQuestion].usd);
+ $("#scrub-xmr").html(gp[pointInQuestion].xmr.toFixed(1));
+ $("#scrub-exrate").html(gp[pointInQuestion].eRate.toFixed(0));
+
+
y = height - (height - gp[pointInQuestion].y) * friendsMultiplier;
y += $("#defaultCanvas0").offset().top - 18;
y = constrain(y, 150, height);
@@ -304,7 +342,7 @@ function redrawGraph(stats, numWorkers) {
minExRate = maxExRate = stats[0].ticker.price;
minUSD = ((stats[stats.length - 1].stats.amtPaid + stats[stats.length - 1].stats.amtDue) / 1000000000000) * stats[stats.length - 1].ticker.price;
console.log(stats[stats.length - 1].ticker.price);
- maxUSD = (stats[0].stats.amtPaid + stats[0].stats.amtDue) / 1000000000000 * stats[0].ticker.price;
+ // maxUSD = (stats[0].stats.amtPaid + stats[0].stats.amtDue) / 1000000000000 * stats[0].ticker.price;
// add points to array
for (var i = stats.length - 1; i >= 0; i--) {
@@ -315,13 +353,12 @@ function redrawGraph(stats, numWorkers) {
var usd = 0;
var hashrate = stats[i].stats.hash / 1000.0;
var nMiners = stats[i].n_miners;
- var eRate = stats[i].ticker.price;
+ var eRate = parseFloat(stats[i].ticker.price);
if (eRate > maxExRate) maxExRate = eRate;
if (eRate < minExRate) minExRate = eRate;
- if (usd > maxUSD) maxUSD = usd;
- if (usd < minUSD) minUSD = usd;
+
var date = new Date(convertTimestamp(stats[i].timestamp));
var month = date.getMonth();
@@ -348,6 +385,10 @@ function redrawGraph(stats, numWorkers) {
totalUSD = usd; // !
+ // use for min/max graph stuff
+ if (usd > maxUSD) maxUSD = usd;
+ if (usd < minUSD) minUSD = usd;
+
// y = map(usd, yMin, yMax, height, 0);
y = map(xmr, yMin, yMax, height, 0);
@@ -486,8 +527,8 @@ function pullStatsData() {
// get all the bb. server data
$.ajax({
-
- url: "https://bb.darkinquiry.com/?step=65&n=120",
+ // was step=65, n=120
+ url: "https://bb.darkinquiry.com/?step=130&n=80",
type: 'get',
cache: false,
success: function(stats) {