<script>
document.addEventListener("DOMContentLoaded", function() {
(function () {
const randomBlocks = document.querySelectorAll(".uc-random-block");
function hideBlocks(){
randomBlocks.forEach(function (el, index) {
el.classList.add('hide-random-block');
});
};
function getRandomInt(max) { return Math.floor(Math.random() * Math.floor(max))};
function showRandomBlock(){
const showBlockNum = getRandomInt(randomBlocks.length);
hideBlocks();
randomBlocks[showBlockNum].classList.remove('hide-random-block');
};
showRandomBlock();
const randomButton = document.querySelectorAll('a[href="#randomblk"]');
randomButton.forEach(function (el, index) {
el.addEventListener('click',function(e) {
e.preventDefault();
showRandomBlock();
});
});
})();
});
</script>
<style>
.hide-random-block {
opacity: 0!important;
min-height: 0!important;
max-height: 0!important;
pointer-events: none!important;
padding-top: 0 !important;
padding-bottom: 0 !important;
overflow: hidden !important;
}
</style>