Added more loading messages

This commit is contained in:
n1474335 2017-08-03 10:57:54 +00:00
parent c07cc913c8
commit ab1c9e27dc
2 changed files with 12 additions and 7 deletions

View File

@ -48,10 +48,15 @@
"Initialising Skynet...", "Initialising Skynet...",
"[REDACTED]", "[REDACTED]",
"Downloading more RAM...", "Downloading more RAM...",
"Loading more loading messages...",
"Ordering 1s and 0s...", "Ordering 1s and 0s...",
"Navigating neural network...", "Navigating neural network...",
"Importing machine learning..." "Importing machine learning...",
"Issuing Alice and Bob one-time pads...",
"Mining bitcoin cash...",
"Generating key material by trying to escape vim...",
"for i in range(additional): Pylon()",
"(creating unresolved tension...",
"Symlinking emacs and vim to ed...",
]; ];
// Shuffle array using Durstenfeld algorithm // Shuffle array using Durstenfeld algorithm
@ -62,19 +67,19 @@
loadingMsgs[j] = temp; loadingMsgs[j] = temp;
} }
// Show next loading message then move it to the end of the array // Show next loading message and move it to the end of the array
function changeLoadingMsg() { function changeLoadingMsg() {
const msg = loadingMsgs.shift(); const msg = loadingMsgs.shift();
loadingMsgs.push(msg);
try { try {
const el = document.getElementById("preloader-msg"); const el = document.getElementById("preloader-msg");
el.className = "loading"; // Causes CSS transition on first message el.className = "loading"; // Causes CSS transition on first message
el.innerHTML = msg; el.innerHTML = msg;
} catch (err) {} // Ignore errors if DOM not yet ready } catch (err) {} // Ignore errors if DOM not yet ready
loadingMsgs.push(msg);
} }
changeLoadingMsg(); changeLoadingMsg();
window.loadingMsgsInt = setInterval(changeLoadingMsg, (Math.random() * 1000) + 1000); window.loadingMsgsInt = setInterval(changeLoadingMsg, (Math.random() * 2000) + 1500);
</script> </script>
<% if (!htmlWebpackPlugin.options.inline) { %> <% if (!htmlWebpackPlugin.options.inline) { %>
<script type="application/ld+json"> <script type="application/ld+json">

View File

@ -62,8 +62,8 @@
#preloader-msg { #preloader-msg {
display: block; display: block;
position: relative; position: relative;
width: 300px; width: 400px;
left: calc(50% - 150px); left: calc(50% - 200px);
top: calc(50% + 50px); top: calc(50% + 50px);
text-align: center; text-align: center;
margin-top: 50px; margin-top: 50px;