I'm working on a small project where if the user enters the Konami code on a site, a filter is applied to every element (for now, will be better in the final version). Right now I have:
<script type="text/javascript">
var success = function() {
var css = 'div { -webkit-filter: blur(10px); }',
head = document.getElementsByTagName('head')[0],
style = document.createElement('style');
style.type = 'text/css';
if (style.styleSheet){
style.styleSheet.cssText = css;
} else {
style.appendChild(document.createTextNode(css));
}
}
var konami = new Konami(success);
</script>
and I'm using http://snaptortoise.com/konami-js/ which has successfully run when used with a redirect instead of a function (documentation says I can create a new Konami with the method shown above, or with a url string to be used as a redirect).
I've gotten javascript alert messages to show, but cannot implement this filter. What did I do wrong?