mirror of
https://github.com/seigler/dash-visualizer
synced 2025-07-27 09:46:09 +00:00
publish: Remove monotone color scheme, add console messages
generated from commit 96a5f901b5
This commit is contained in:
parent
91088966fe
commit
4330aefa33
2 changed files with 10 additions and 4 deletions
12
bundle.js
12
bundle.js
|
@ -18857,10 +18857,15 @@ var App = {
|
||||||
case 0:
|
case 0:
|
||||||
generateColors = function _ref(blockHash) {
|
generateColors = function _ref(blockHash) {
|
||||||
// https://github.com/c0bra/color-scheme-js
|
// https://github.com/c0bra/color-scheme-js
|
||||||
var schemeTypes = ['mono', 'contrast', 'triade', 'tetrade', 'analogic'];
|
var schemeTypes = ['contrast', 'triade', 'triade', 'tetrade', 'tetrade', 'analogic', 'analogic', 'analogic', 'analogic'];
|
||||||
|
var hue = Math.floor(parseInt(prevBlockHash.slice(-3), 16) / 4096 * 360);
|
||||||
|
var schemeFraction = parseInt(prevBlockHash.slice(-5, -3), 16) / 256;
|
||||||
|
var scheme = schemeTypes[Math.floor(schemeFraction * schemeTypes.length)];
|
||||||
var blockColorScheme = new _colorScheme["default"]();
|
var blockColorScheme = new _colorScheme["default"]();
|
||||||
blockColorScheme.from_hue(Math.floor(parseInt(prevBlockHash.slice(-3), 16) / 4096 * 360)).scheme(schemeTypes[Math.floor(parseInt(prevBlockHash.slice(-5, -3), 16) / 256 * schemeTypes.length)]);
|
blockColorScheme.from_hue(hue).scheme(scheme).add_complement(true);
|
||||||
return blockColorScheme.colors();
|
var colors = blockColorScheme.colors();
|
||||||
|
console.log('New color scheme: ' + scheme + ' based on %chue ' + hue, 'background-color:hsl(' + hue + ',100%,50%)');
|
||||||
|
return colors;
|
||||||
};
|
};
|
||||||
|
|
||||||
socket = _socket["default"].connect("https://insight.dash.org:443/");
|
socket = _socket["default"].connect("https://insight.dash.org:443/");
|
||||||
|
@ -18935,6 +18940,7 @@ var App = {
|
||||||
paintIndex: parseInt(data.txid.slice(17, 21), 16) / 65536,
|
paintIndex: parseInt(data.txid.slice(17, 21), 16) / 65536,
|
||||||
color: isPrivateSend ? COLORS["private"] : data.txlock ? COLORS.instant : blockColors[Math.floor(parseInt(data.txid.slice(21, 23), 16) / 256 * blockColors.length)]
|
color: isPrivateSend ? COLORS["private"] : data.txlock ? COLORS.instant : blockColors[Math.floor(parseInt(data.txid.slice(21, 23), 16) / 256 * blockColors.length)]
|
||||||
};
|
};
|
||||||
|
console.log('tx: ' + tx.value + (tx["private"] ? ' private' : '') + (tx.instant ? ' instant' : ''));
|
||||||
var paint = document.createElement('div');
|
var paint = document.createElement('div');
|
||||||
paint.classList.add('paint');
|
paint.classList.add('paint');
|
||||||
paint.style.maskImage = 'url(assets/paint/' + (tx.value > 10 ? PAINT.big[Math.floor(tx.paintIndex * 12)] : PAINT.small[Math.floor(tx.paintIndex * 11)]) + ')';
|
paint.style.maskImage = 'url(assets/paint/' + (tx.value > 10 ? PAINT.big[Math.floor(tx.paintIndex * 12)] : PAINT.small[Math.floor(tx.paintIndex * 11)]) + ')';
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue