Okay, save this html file somewhere onto your computer, and set it as your homepage.
Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Wait!</title>
<link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>
<style>
body {
font-family: 'Open Sans', sans-serif;
padding: 20px;
color: #444;
}
textarea {
width: 50%;
height: 100px;
}
input {
width: 100px;
}
.hide {
opacity: 0;
transition: all 2s;
}
.hide.show {
opacity: 1;
}
.warning {
border: 1px solid rgba(85, 0, 0, 0.5);
background: rgba(85, 0, 0, 0.3);
padding: 20px;
display: inline-block;
border-radius: 5px;
box-shadow: 5px 5px 20px -5px rgba(0, 0, 0, 0.5);
}
</style>
</head>
<body>
<h1 id="title">Wait!</h1>
<p>Off you go in <span id="secs-holder">999</span> seconds...</p>
<div id="warning" class="warning hide">Oh noes! Allow this site to open new windows!</div>
<h3>Settings</h3>
Pages to open (one per line):<br/>
<textarea id="pages"></textarea><br/><br/>
Seconds to wait:<br/>
<input type="number" id="secs"><br/><br/>
<button type="button" id="save" onclick="save()">Save changes</button>
<script>
document.getCookie = function (sName) {
sName = sName.toLowerCase();
var oCrumbles = document.cookie.split(';');
for (var i = 0; i < oCrumbles.length; i++) {
var oPair = oCrumbles[i].split('=');
var sKey = decodeURIComponent(oPair[0].trim().toLowerCase());
var sValue = oPair.length > 1 ? oPair[1] : '';
if (sKey == sName) {
return decodeURIComponent(sValue);
}
}
return '';
};
document.setCookie = function (sName, sValue) {
var oDate = new Date();
oDate.setYear(oDate.getFullYear() + 1);
var sCookie = encodeURIComponent(sName) + '=' + encodeURIComponent(sValue) + ';expires=' + oDate.toGMTString() + ';path=/';
document.cookie = sCookie;
};
var secs = document.getCookie('secs');
var pages = document.getCookie('pages');
if (secs) {
document.getElementById('secs-holder').innerHTML = secs;
document.getElementById('secs').value = secs;
}
if (pages) {
document.getElementById('pages').value = pages;
}
if (secs && pages) {
setTimeout(function () {
hitTicker(secs);
}, 1000);
}
function save() {
document.setCookie('secs', document.getElementById('secs').value);
document.setCookie('pages', document.getElementById('pages').value);
location.reload();
}
function hitTicker(s) {
s--;
document.getElementById('secs-holder').innerHTML = s;
if (!s) {
go();
return;
}
setTimeout(function () {
hitTicker(s);
}, 1000);
}
function go() {
document.getElementById('title').innerHTML = "Go!";
var page_array = pages.split("\n");
var first = page_array.shift();
var good = false;
page_array.forEach(function (p) {
var h = window.open(p, '_blank');
if (h) {
good = true;
}
});
if (good) {
window.location = first;
} else {
document.getElementById('warning').className += ' show';
}
}
</script>
Example here:
http://www.mosttriumphant.co.uk/random/wait.htm
_________________
Grim... wrote:
I wish Craster had left some girls for the rest of us.