Skip to content

Instantly share code, notes, and snippets.

@michaelcurry
Last active December 28, 2015 22:59
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 michaelcurry/7576007 to your computer and use it in GitHub Desktop.
Save michaelcurry/7576007 to your computer and use it in GitHub Desktop.
Include to mirror a web page. jQuery not required. Happy trolling.
/*!
* Mirror Attack JS
* Twitter: @KernelCurry
* http://www.kernelcurry.com
* @link https://gist.github.com/michaelcurry/7576007
*
* Include to mirror a web page. jQuery not required. Happy trolling.
*
*/
window.onload=function(){
cssify('body','-webkit-transform: rotateY(180deg);');
cssify('body','-moz-transform: rotateY(180deg);');
cssify('body','-o-transform: rotateY(180deg);');
cssify('body','transform: rotateY(180deg);');
cssify('body','ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";');
cssify('body','filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2);');
function cssify ( selector, styles )
{
try {
style = document.getElementById('myCustomStyleID');
temp = style.innerHTML;
style.innerHTML = temp + selector + "{ " + styles + "}\n";
}
catch (err)
{
style = document.createElement("style");
style.id = 'myCustomStyleID'
style.setAttribute('type', 'text/css');
style.innerHTML = selector + "{ " + styles + " }\n";
document.head.insertBefore(style,document.head.childNodes[0]);
}
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment