Created
February 29, 2024 20:01
-
-
Save linuxd3v/eef863b26c53c2906587b202dcc53d2b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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