mirror of
https://github.com/gchq/CyberChef
synced 2024-11-16 01:17:57 +00:00
Merge branch 'feature-loading-messages'
This commit is contained in:
commit
a6317212d9
3 changed files with 46 additions and 1 deletions
|
@ -70,6 +70,9 @@ App.prototype.loaded = function() {
|
|||
document.getElementById("loader-wrapper").remove();
|
||||
document.body.classList.remove("loaded");
|
||||
}, 1000);
|
||||
|
||||
// Clear the loading message interval
|
||||
clearInterval(window.loadingMsgInt);
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -34,12 +34,37 @@
|
|||
<script type="application/javascript">
|
||||
// Load theme before the preloader is shown
|
||||
document.querySelector(":root").className = JSON.parse(localStorage.getItem("options")).theme;
|
||||
|
||||
// Cycle loading messages
|
||||
const loadingMsgs = [
|
||||
"Proving P = NP...",
|
||||
"Computing 6 x 9...",
|
||||
"Mining bitcoin...",
|
||||
"Dividing by 0...",
|
||||
"Initialising Skynet...",
|
||||
"[REDACTED]",
|
||||
"Downloading more RAM...",
|
||||
"Loading more loading messages...",
|
||||
"Ordering 1s and 0s...",
|
||||
"Navigating neural network...",
|
||||
"Importing machine learning..."
|
||||
];
|
||||
function changeLoadingMsg() {
|
||||
try {
|
||||
const el = document.getElementById("preloader-msg");
|
||||
el.className = "loading"; // Causes CSS transition on first message
|
||||
el.innerHTML = loadingMsgs[Math.floor(Math.random()*loadingMsgs.length)];
|
||||
} catch (err) {}
|
||||
}
|
||||
changeLoadingMsg();
|
||||
window.loadingMsgsInt = setInterval(changeLoadingMsg, (Math.random()*500) + 500);
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- Preloader overlay -->
|
||||
<div id="loader-wrapper">
|
||||
<div id="preloader"></div>
|
||||
<div id="preloader-msg"></div>
|
||||
</div>
|
||||
<!-- End preloader overlay -->
|
||||
<span id="edit-favourites" class="btn btn-default btn-sm"><img aria-hidden="true" src="<%- require('../static/images/favourite-16x16.png') %>" alt="Star Icon"/> Edit</span>
|
||||
|
|
|
@ -55,9 +55,26 @@
|
|||
animation: spin 1.5s linear infinite;
|
||||
}
|
||||
|
||||
#preloader-msg {
|
||||
display: block;
|
||||
position: relative;
|
||||
width: 300px;
|
||||
left: calc(50% - 150px);
|
||||
top: calc(50% + 50px);
|
||||
text-align: center;
|
||||
margin-top: 50px;
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
#preloader-msg.loading {
|
||||
opacity: 1;
|
||||
transition: all 0.1s ease-in;
|
||||
}
|
||||
|
||||
|
||||
/* Loaded */
|
||||
.loaded #preloader {
|
||||
.loaded #preloader,
|
||||
.loaded #preloader-msg {
|
||||
opacity: 0;
|
||||
transition: all 0.3s ease-out;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue