feat: Add analytics
This commit is contained in:
@@ -1,84 +1,84 @@
|
||||
const letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ/.?!@#$%^&*()_+";
|
||||
|
||||
let interval = null;
|
||||
let interval2 = null;
|
||||
let interval3 = null;
|
||||
|
||||
|
||||
// window.onload = (event) => {
|
||||
|
||||
// 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];
|
||||
// }
|
||||
|
||||
// return letters[Math.floor(Math.random() * 41)]
|
||||
// })
|
||||
// .join("");
|
||||
|
||||
// if(iteration >= final.length){
|
||||
// clearInterval(interval);
|
||||
// }
|
||||
|
||||
// iteration += 1 / 3;
|
||||
// }, 30);
|
||||
// };
|
||||
|
||||
document.querySelector(".copyright").onmouseover = event => {
|
||||
let iteration2 = 0;
|
||||
let old2 = "Copyright © Nathan Woodburn 2023";
|
||||
console.log(old2);
|
||||
clearInterval(interval2);
|
||||
|
||||
interval2 = setInterval(() => {
|
||||
event.target.innerText = event.target.innerText
|
||||
.split("")
|
||||
.map((letter, index2) => {
|
||||
if(index2 < iteration2) {
|
||||
return old2[index2];
|
||||
}
|
||||
|
||||
return letters[Math.floor(Math.random() * 41)]
|
||||
})
|
||||
.join("");
|
||||
|
||||
if(iteration2 >= old2.length){
|
||||
clearInterval(interval2);
|
||||
}
|
||||
|
||||
iteration2 += 1/3;
|
||||
}, 10);
|
||||
}
|
||||
// document.querySelector(".hacker3").onmouseover = event => {
|
||||
// let iteration3 = 0;
|
||||
// let old3 = event.target.innerText;
|
||||
// console.log(old3);
|
||||
// clearInterval(interval3);
|
||||
|
||||
// interval3 = setInterval(() => {
|
||||
// event.target.innerText = event.target.innerText
|
||||
// .split("")
|
||||
// .map((letter, index3) => {
|
||||
// if(index3 < iteration3) {
|
||||
// return old3[index3];
|
||||
// }
|
||||
|
||||
// return letters[Math.floor(Math.random() * 41)]
|
||||
// })
|
||||
// .join("");
|
||||
|
||||
// if(iteration3 >= old3.length){
|
||||
// clearInterval(interval3);
|
||||
// }
|
||||
|
||||
// iteration3 += 1 / 3;
|
||||
// }, 10);
|
||||
const letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ/.?!@#$%^&*()_+";
|
||||
|
||||
let interval = null;
|
||||
let interval2 = null;
|
||||
let interval3 = null;
|
||||
|
||||
|
||||
// window.onload = (event) => {
|
||||
|
||||
// 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];
|
||||
// }
|
||||
|
||||
// return letters[Math.floor(Math.random() * 41)]
|
||||
// })
|
||||
// .join("");
|
||||
|
||||
// if(iteration >= final.length){
|
||||
// clearInterval(interval);
|
||||
// }
|
||||
|
||||
// iteration += 1 / 3;
|
||||
// }, 30);
|
||||
// };
|
||||
|
||||
document.querySelector(".copyright").onmouseover = event => {
|
||||
let iteration2 = 0;
|
||||
let old2 = "Copyright © Nathan Woodburn 2023";
|
||||
console.log(old2);
|
||||
clearInterval(interval2);
|
||||
|
||||
interval2 = setInterval(() => {
|
||||
event.target.innerText = event.target.innerText
|
||||
.split("")
|
||||
.map((letter, index2) => {
|
||||
if(index2 < iteration2) {
|
||||
return old2[index2];
|
||||
}
|
||||
|
||||
return letters[Math.floor(Math.random() * 41)]
|
||||
})
|
||||
.join("");
|
||||
|
||||
if(iteration2 >= old2.length){
|
||||
clearInterval(interval2);
|
||||
}
|
||||
|
||||
iteration2 += 1/3;
|
||||
}, 10);
|
||||
}
|
||||
// document.querySelector(".hacker3").onmouseover = event => {
|
||||
// let iteration3 = 0;
|
||||
// let old3 = event.target.innerText;
|
||||
// console.log(old3);
|
||||
// clearInterval(interval3);
|
||||
|
||||
// interval3 = setInterval(() => {
|
||||
// event.target.innerText = event.target.innerText
|
||||
// .split("")
|
||||
// .map((letter, index3) => {
|
||||
// if(index3 < iteration3) {
|
||||
// return old3[index3];
|
||||
// }
|
||||
|
||||
// return letters[Math.floor(Math.random() * 41)]
|
||||
// })
|
||||
// .join("");
|
||||
|
||||
// if(iteration3 >= old3.length){
|
||||
// clearInterval(interval3);
|
||||
// }
|
||||
|
||||
// iteration3 += 1 / 3;
|
||||
// }, 10);
|
||||
// }
|
||||
@@ -1,50 +1,50 @@
|
||||
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
|
||||
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();
|
||||
Reference in New Issue
Block a user