main: Added status checks on websites
All checks were successful
Build Docker / CheckFiles (push) Successful in 10s
Build Docker / Build Docker (push) Successful in 22s

This commit is contained in:
2023-07-28 14:17:53 +10:00
parent e8ad23bed0
commit be65929ca3
21 changed files with 9127 additions and 30 deletions

View File

@@ -5,32 +5,32 @@ let interval2 = null;
let interval3 = null;
window.onload = (event) => {
// window.onload = (event) => {
target = document.querySelector(".nathanwoodburn");
let iteration = 0;
let final = "NATHAN.WOODBURN/";
clearInterval(interval);
// target = document.querySelector(".nathanwoodburn");
// let iteration = 0;
// let final = "NATHAN.WOODBURN/";
// clearInterval(interval);
interval = setInterval(() => {
target.innerText = target.innerText
.split("")
.map((letter, index) => {
if(index < iteration) {
return final[index];
}
// interval = setInterval(() => {
// target.innerText = target.innerText
// .split("")
// .map((letter, index) => {
// if(index < iteration) {
// return final[index];
// }
return letters[Math.floor(Math.random() * 41)]
})
.join("");
// return letters[Math.floor(Math.random() * 41)]
// })
// .join("");
if(iteration >= final.length){
clearInterval(interval);
}
// if(iteration >= final.length){
// clearInterval(interval);
// }
iteration += 1 / 3;
}, 30);
};
// iteration += 1 / 3;
// }, 30);
// };
document.querySelector(".copyright").onmouseover = event => {
let iteration2 = 0;

51
assets/js/status.js Normal file
View File

@@ -0,0 +1,51 @@
function checkStatus(url, callback) {
fetch(url, {
method: 'GET',
mode: 'no-cors'
}).then(function(response) {
callback('up');
}
).catch(function(error) {
callback('down');
}
);
}
// Check every 5 seconds
setInterval(function() {
checkStatuses();
}, 5000);
function checkStatuses(){
checkStatus('https://nathan.woodburn.au', function(updateStatus) {
if (updateStatus == 'up') document.getElementById('nathan-woodburn-au').style.color = '#00ff00';
else document.getElementById('nathan-woodburn-au').style.color = '#ff0000';
});
checkStatus('https://nathan3dprinting.au', function(updateStatus) {
if (updateStatus == 'up') document.getElementById('nathan3dprinting-au').style.color = '#00ff00';
else document.getElementById('nathan3dprinting-au').style.color = '#ff0000';
});
checkStatus('https://podcast.woodburn.au', function(updateStatus) {
if (updateStatus == 'up') document.getElementById('podcast-woodburn-au').style.color = '#00ff00';
else document.getElementById('podcast-woodburn-au').style.color = '#ff0000';
});
checkStatus('https://uptime.woodburn.au', function(updateStatus) {
if (updateStatus == 'up') document.getElementById('uptime-woodburn-au').style.color = '#00ff00';
else document.getElementById('uptime-woodburn-au').style.color = '#ff0000';
});
checkStatus('https://reg.woodburn.au', function(updateStatus) {
if (updateStatus == 'up') document.getElementById('reg-woodburn-au').style.color = '#00ff00';
else document.getElementById('reg-woodburn-au').style.color = '#ff0000';
});
checkStatus('https://hnscall', function(updateStatus) {
if (updateStatus == 'up') document.getElementById('hnscall').style.color = '#00ff00';
else document.getElementById('hnscall').style.color = '#ff0000';
});
checkStatus('https://hnshosting', function(updateStatus) {
if (updateStatus == 'up') document.getElementById('hnshosting').style.color = '#00ff00';
else document.getElementById('hnshosting').style.color = '#ff0000';
});
}
// Check on load
checkStatuses();