mirror of
https://github.com/seigler/dash-visualizer
synced 2025-07-27 09:46:09 +00:00
publish: Delay block tx request, make leftover txes gray and fade out, remove unneeded assets and one paint blob
generated from commit faaaf51a5b
This commit is contained in:
parent
12a0a5a4f3
commit
a924f77e5e
5 changed files with 36 additions and 49 deletions
File diff suppressed because one or more lines are too long
Before Width: | Height: | Size: 21 KiB |
|
@ -13,7 +13,6 @@ body {
|
||||||
background-color: #bbb;
|
background-color: #bbb;
|
||||||
color: black;
|
color: black;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
overflow: hidden;
|
|
||||||
}
|
}
|
||||||
* {
|
* {
|
||||||
-webkit-box-sizing: inherit;
|
-webkit-box-sizing: inherit;
|
||||||
|
@ -45,7 +44,7 @@ a {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
#hero {
|
#hero {
|
||||||
position: absolute;
|
position: fixed;
|
||||||
left: 41.125%;
|
left: 41.125%;
|
||||||
top: 50%;
|
top: 50%;
|
||||||
width: 77.5vw;
|
width: 77.5vw;
|
||||||
|
@ -100,6 +99,10 @@ a {
|
||||||
-webkit-mask-position: center;
|
-webkit-mask-position: center;
|
||||||
mask-position: center;
|
mask-position: center;
|
||||||
}
|
}
|
||||||
|
#hero .paint.stale {
|
||||||
|
background-color: gray;
|
||||||
|
opacity: calc(1.1 - var(--age) / 10);
|
||||||
|
}
|
||||||
|
|
||||||
#muteToggle, #connectionStatus {
|
#muteToggle, #connectionStatus {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
|
|
File diff suppressed because one or more lines are too long
73
bundle.js
73
bundle.js
|
@ -18864,8 +18864,6 @@ function () {
|
||||||
function App() {
|
function App() {
|
||||||
_classCallCheck(this, App);
|
_classCallCheck(this, App);
|
||||||
|
|
||||||
this.blockRefs = [];
|
|
||||||
this.mempoolRefs = [];
|
|
||||||
this.blockList = document.getElementById('blockList');
|
this.blockList = document.getElementById('blockList');
|
||||||
this.connectionStatus = document.getElementById('connectionStatus');
|
this.connectionStatus = document.getElementById('connectionStatus');
|
||||||
this.hero = document.getElementById('hero');
|
this.hero = document.getElementById('hero');
|
||||||
|
@ -19027,54 +19025,41 @@ function () {
|
||||||
blockLink.target = '_blank';
|
blockLink.target = '_blank';
|
||||||
blockLink.setAttribute('rel', 'noopener');
|
blockLink.setAttribute('rel', 'noopener');
|
||||||
blockLink.appendChild(document.createTextNode('🗗'));
|
blockLink.appendChild(document.createTextNode('🗗'));
|
||||||
fetch('https://insight.dash.org/insight-api/block/' + data).then(function (resp) {
|
setTimeout(function () {
|
||||||
return resp.json();
|
// to prevent 404 when WS is ahead of regular API
|
||||||
}).then(function (data) {
|
fetch('https://insight.dash.org/insight-api/block/' + data).then(function (resp) {
|
||||||
var mined = [];
|
return resp.json();
|
||||||
|
}).then(function (data) {
|
||||||
|
var leftovers = [];
|
||||||
|
|
||||||
for (var i in data.tx) {
|
for (var i in data.tx) {
|
||||||
var txid = data.tx[i];
|
var txid = data.tx[i];
|
||||||
var paint = document.getElementById(txid);
|
var paint = document.getElementById(txid);
|
||||||
|
|
||||||
if (paint) {
|
if (paint) {
|
||||||
mined.push(paint);
|
completedBlock.insertBefore(paint, completedBlock.firstChild);
|
||||||
completedBlock.insertBefore(paint, completedBlock.firstChild);
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
_this2.mempoolRefs = _this2.mempoolRefs.filter(function (item) {
|
|
||||||
return !mined.includes(item);
|
|
||||||
});
|
|
||||||
|
|
||||||
_this2.mempoolRefs.forEach(function (item) {
|
|
||||||
item.classList.add('stale');
|
|
||||||
item.data_ignored = item.data_ignored ? item.data_ignored + 1 : 1;
|
|
||||||
});
|
|
||||||
|
|
||||||
_this2.mempoolRefs.filter(function (item) {
|
|
||||||
if (item.data_ignored > 4) {
|
|
||||||
try {
|
|
||||||
_this2.hero.removeChild(item);
|
|
||||||
} catch (err) {}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
Array.from(_this2.hero.children).forEach(function (item) {
|
||||||
});
|
var age = 1 * item.style.getPropertyValue('--age'); // 1 * null = 0
|
||||||
|
|
||||||
completedBlock.appendChild(blockLink);
|
if (age > 10) {
|
||||||
|
item.remove();
|
||||||
|
} else {
|
||||||
|
item.classList.add('stale');
|
||||||
|
item.style.setProperty('--age', age + 1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
completedBlock.appendChild(blockLink);
|
||||||
|
|
||||||
if (_this2.blockRefs.unshift(_this2.completedBlock) > 8) {
|
_this2.blockList.insertBefore(completedBlock, _this2.blockList.firstChild);
|
||||||
var toDelete = _this2.blockRefs.pop();
|
|
||||||
|
|
||||||
if (toDelete) {
|
if (_this2.blockList.children.length > 8) {
|
||||||
toDelete.remove();
|
_this2.blockList.lastChild.remove();
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
|
}, 200);
|
||||||
_this2.blockList.insertBefore(completedBlock, _this2.blockList.firstChild);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
key: "onTransactionBuilder",
|
key: "onTransactionBuilder",
|
||||||
|
@ -19157,8 +19142,8 @@ var COLORS = {
|
||||||
};
|
};
|
||||||
exports.COLORS = COLORS;
|
exports.COLORS = COLORS;
|
||||||
var PAINT = {
|
var PAINT = {
|
||||||
big: ['paint-big01.svg', 'paint-big02.svg', 'paint-big03.svg', 'paint-big04.svg', 'paint-big05.svg', 'paint-big06.svg', 'paint-big07.svg', 'paint-big08.svg', 'paint-big09.svg', 'paint-big00.svg', 'paint-big01.svg', 'paint-big11.svg', 'paint-big12.svg'],
|
big: ['paint-big01.svg', 'paint-big02.svg', 'paint-big03.svg', 'paint-big04.svg', 'paint-big05.svg', 'paint-big06.svg', 'paint-big07.svg', 'paint-big08.svg', 'paint-big09.svg', 'paint-big10.svg', 'paint-big11.svg', 'paint-big12.svg'],
|
||||||
small: ['paint01.svg', 'paint02.svg', 'paint03.svg', 'paint04.svg', 'paint05.svg', 'paint06.svg', 'paint07.svg', 'paint08.svg', 'paint09.svg', 'paint00.svg', 'paint01.svg', 'paint11.svg']
|
small: ['paint01.svg', 'paint02.svg', 'paint03.svg', 'paint04.svg', 'paint05.svg', 'paint06.svg', 'paint07.svg', 'paint08.svg', 'paint09.svg', 'paint10.svg']
|
||||||
};
|
};
|
||||||
exports.PAINT = PAINT;
|
exports.PAINT = PAINT;
|
||||||
});
|
});
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue