2021-06-11 16:39:48 +00:00
|
|
|
// NOTE(matt): To use, source this file inside the element you wish to be obscured while processing occurs.
|
|
|
|
// After processing is complete, call FlipClear()
|
|
|
|
|
|
|
|
var ThisScriptElement = document.currentScript;
|
|
|
|
var NodeToHide = ThisScriptElement.parentNode;
|
|
|
|
|
2021-06-11 15:38:38 +00:00
|
|
|
var CineraClearElement = document.createElement("DIV");
|
|
|
|
CineraClearElement.style.position = "fixed";
|
|
|
|
CineraClearElement.style.height = "100%";
|
|
|
|
CineraClearElement.style.width = "100%";
|
|
|
|
CineraClearElement.style.zIndex = 64;
|
2021-06-11 16:39:48 +00:00
|
|
|
|
|
|
|
var CineraPlacedClear = NodeToHide.appendChild(CineraClearElement);
|
|
|
|
var Colour = getBackgroundColourRGB(CineraPlacedClear);
|
|
|
|
CineraPlacedClear.style.background = "rgb(" + Colour.R + ", " + Colour.G + ", " + Colour.B + ")"
|
2021-06-11 15:38:38 +00:00
|
|
|
document.body.style.overflowY = "hidden";
|
|
|
|
|
|
|
|
function
|
2021-06-11 16:39:48 +00:00
|
|
|
FlipClear(BodyOverflowY)
|
2021-06-11 15:38:38 +00:00
|
|
|
{
|
2021-06-11 16:39:48 +00:00
|
|
|
document.body.style.overflowY = BodyOverflowY ? BodyOverflowY : null;
|
|
|
|
CineraPlacedClear.parentNode.removeChild(CineraPlacedClear);
|
2021-06-11 15:38:38 +00:00
|
|
|
}
|