An innovative concept is the solo cookie timer that holds off for one hour before resuming its function upon user interaction.
No luck with Google. https://jsfiddle.net/m6vqyeu8/
Your input or assistance in creating your own version is greatly appreciated.
<!doctype html>
<html>
<head>
<title>cookie timer</title>
<meta charset=utf-8>
</head>
<script>
let initialValue = 0.50000096;
let multiplier = 0.00000001;
// Cookie functions
let getCookie = (c_name) => {
let i, x, y, ARRcookies = document.cookie.split(";");
for (i = 0; i < ARRcookies.length; i++) {
x = ARRcookies[i].substr(0, ARRcookies[i].indexOf("="));
y = ARRcookies[i].substr(ARRcookies[i].indexOf("=") + 1);
x = x.replace(/^\s+|\s+$/g, "");
if (x == c_name) {
return unescape(y);
}
}
}
let setCookie = (c_name, value, exdays) => {
let exdate = new Date();
exdate.setDate(exdate.getDate() + exdays);
let c_value = escape(value) + ((exdays == null) ? "" : "; expires=" + exdate.toUTCString());
document.cookie = c_name + "=" + c_value;
}
// Check last updated time
let lastUpdated = getCookie('lastUpdated') * 1;
if (!lastUpdated) {
lastUpdated = Date.now();
setCookie('lastUpdated', lastUpdated, 9999);
}
// Calculate difference and update cookie
let diff = (Date.now() - lastUpdated) / 1000;
let cu = (diff * multiplier) + initialValue;
// Update display and handle incrementation
let doCu = () => {
document.getElementById('cu').innerHTML = cu.toFixed(8);
cu = cu + multiplier;
}
document.write("<div id='cu' style='text-align: center; font-size: 40pt'></div>\n");
setInterval(doCu, 1000);
doCu();
</script>
<body>
</body>
</html>