Skip to content

Instantly share code, notes, and snippets.

@linuxd3v
Created February 29, 2024 20:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save linuxd3v/eef863b26c53c2906587b202dcc53d2b to your computer and use it in GitHub Desktop.
Save linuxd3v/eef863b26c53c2906587b202dcc53d2b to your computer and use it in GitHub Desktop.
<script>
;(function(win, doc, style, timeout) {
var STYLE_ID = 'at-body-style';
function getParent() {
return doc.getElementsByTagName('head')[0];
}
function addStyle(parent, id, def) {
if (!parent) {
return;
}
var style = doc.createElement('style');
style.id = id;
style.innerHTML = def;
parent.appendChild(style);
}
function removeStyle(parent, id) {
if (!parent) {
return;
}
var style = doc.getElementById(id);
if (!style) {
return;
}
parent.removeChild(style);
}
addStyle(getParent(), STYLE_ID, style);
setTimeout(function() {
removeStyle(getParent(), STYLE_ID);
}, timeout);
}(window, document, "body {opacity: 0 !important}", 3000));
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment