mirror of
https://github.com/seigler/dash-visualizer
synced 2025-07-27 01:36:10 +00:00
parent
a924f77e5e
commit
4ff09d7844
2 changed files with 31 additions and 24 deletions
53
bundle.js
53
bundle.js
|
@ -19028,29 +19028,38 @@ function () {
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
// to prevent 404 when WS is ahead of regular API
|
// to prevent 404 when WS is ahead of regular API
|
||||||
fetch('https://insight.dash.org/insight-api/block/' + data).then(function (resp) {
|
fetch('https://insight.dash.org/insight-api/block/' + data).then(function (resp) {
|
||||||
return resp.json();
|
if (resp.ok) {
|
||||||
|
return resp.json();
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}).then(function (data) {
|
}).then(function (data) {
|
||||||
var leftovers = [];
|
if (data) {
|
||||||
|
for (var i in data.tx) {
|
||||||
|
var txid = data.tx[i];
|
||||||
|
var paint = document.getElementById(txid);
|
||||||
|
|
||||||
for (var i in data.tx) {
|
if (paint) {
|
||||||
var txid = data.tx[i];
|
completedBlock.insertBefore(paint, completedBlock.firstChild);
|
||||||
var paint = document.getElementById(txid);
|
}
|
||||||
|
|
||||||
if (paint) {
|
|
||||||
completedBlock.insertBefore(paint, completedBlock.firstChild);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Array.from(_this2.hero.children).forEach(function (item) {
|
||||||
|
var age = 1 * item.style.getPropertyValue('--age'); // 1 * null = 0
|
||||||
|
|
||||||
|
if (age > 10) {
|
||||||
|
item.remove();
|
||||||
|
} else {
|
||||||
|
item.classList.add('stale');
|
||||||
|
item.style.setProperty('--age', age + 1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
Array.from(_this2.hero.children).forEach(function (item) {
|
||||||
|
return completedBlock.appendChild(item);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
Array.from(_this2.hero.children).forEach(function (item) {
|
|
||||||
var age = 1 * item.style.getPropertyValue('--age'); // 1 * null = 0
|
|
||||||
|
|
||||||
if (age > 10) {
|
|
||||||
item.remove();
|
|
||||||
} else {
|
|
||||||
item.classList.add('stale');
|
|
||||||
item.style.setProperty('--age', age + 1);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
completedBlock.appendChild(blockLink);
|
completedBlock.appendChild(blockLink);
|
||||||
|
|
||||||
_this2.blockList.insertBefore(completedBlock, _this2.blockList.firstChild);
|
_this2.blockList.insertBefore(completedBlock, _this2.blockList.firstChild);
|
||||||
|
@ -19069,19 +19078,17 @@ function () {
|
||||||
var addToMempool = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
var addToMempool = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
||||||
return function (data) {
|
return function (data) {
|
||||||
var isMixing = App.isPrivateSend(data.vout);
|
var isMixing = App.isPrivateSend(data.vout);
|
||||||
var isInstant = data.txlock || data.vin && data.vin.length <= 4;
|
var isComplex = data.vin && data.vin.length > 1;
|
||||||
var isSimple = data.txlock || data.vin && data.vin.length <= 1;
|
|
||||||
var tx = {
|
var tx = {
|
||||||
id: data.txid,
|
id: data.txid,
|
||||||
mixing: isMixing,
|
mixing: isMixing,
|
||||||
instant: isInstant,
|
complex: isComplex,
|
||||||
simple: isSimple,
|
|
||||||
value: data.valueOut,
|
value: data.valueOut,
|
||||||
x: parseInt(data.txid.slice(0, 4), 16) / 65536,
|
x: parseInt(data.txid.slice(0, 4), 16) / 65536,
|
||||||
y: parseInt(data.txid.slice(4, 8), 16) / 65536,
|
y: parseInt(data.txid.slice(4, 8), 16) / 65536,
|
||||||
rotation: parseInt(data.txid.slice(16, 17), 16) / 16,
|
rotation: parseInt(data.txid.slice(16, 17), 16) / 16,
|
||||||
paintIndex: parseInt(data.txid.slice(17, 21), 16) / 65536,
|
paintIndex: parseInt(data.txid.slice(17, 21), 16) / 65536,
|
||||||
color: isMixing ? _constants.COLORS.black : !isSimple ? _constants.COLORS.white : 'var(--color-' + Math.floor(parseInt(data.txid.slice(21, 23), 16) / 256 * _this3.blockColors.length) + ')'
|
color: isMixing ? _constants.COLORS.black : isComplex ? _constants.COLORS.white : 'var(--color-' + Math.floor(parseInt(data.txid.slice(21, 23), 16) / 256 * _this3.blockColors.length) + ')'
|
||||||
};
|
};
|
||||||
var paint = document.createElement('div');
|
var paint = document.createElement('div');
|
||||||
paint.id = tx.id;
|
paint.id = tx.id;
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue