This commit is contained in:
2021-11-11 13:12:17 +01:00
parent 62f3ac48bb
commit d5108d0408
2 changed files with 31 additions and 60 deletions
+10 -38
View File
@@ -37,31 +37,18 @@
});
$(window).scroll(function() {
if (isInViewport(document.querySelector('footer')))
{
//blockchainExplorer.addBottomBlock();
console.log("Scroll to footer detected !");
}
var element = document.getElementById('blockchain');
var offset = element.getBoundingClientRect().top - element.offsetParent.getBoundingClientRect().top;
const top = window.pageYOffset + window.innerHeight - offset;
if ((window.innerHeight + window.scrollY) >= document.body.offsetHeight) {
// blockchainExplorer.addBottomBlock();
console.log("Scroll to footer detected !");
}
$(".slideanim").each(function(){
var pos = $(this).offset().top;
var winTop = $(window).scrollTop();
if (pos < winTop + 600) {
blockchainExplorer.addBottomBlock();
$(this).addClass("slide");
}
});
if (top === element.scrollHeight) {
console.log("bottom");
blockchainExplorer.addBottomBlock();
}
});
blockchainExplorer.init(0);
showInfos();
//toggleInfos();
});
var isInViewport = function (elem) {
@@ -76,13 +63,7 @@
function showInfos()
{
var flag = 2*parseInt($('#mode_selector').val());
$('#blockchain').html('');
if ($('#mode_checkbox').is(":checked")) flag += 1;
blockchainExplorer.init(flag);
blockchainExplorer.init(parseInt($('#mode_selector').val()));
}
function toggleInfos()
@@ -122,7 +103,7 @@
<div class="col-sm-12 text-right">
<br><small>An image for each block of the BTC Blockchain</small>
<br><a href="nft.php">Click here to buy a block as an NFT</a>
<br><select id="mode_selector" onchange="showInfos(this)">
<br><select id="mode_selector" onchange="showInfos()">
<option value=0>Full Blockchain Explorer</option>
<option value=1>My special Blocks list</option>
</select>
@@ -134,14 +115,5 @@
<div id="blockchain" style="position:absolute;top:210px;width:100%"></div>
<div>
Click to see more blocks
</div>
<footer class="container-fluid bg-grey text-center slideanim">
<a href="#myPage" title="To Top">
<span class="glyphicon glyphicon-chevron-up"></span>
</a>
</footer>
</body>
</html>