Skip to content

Instantly share code, notes, and snippets.

@Ruxton
Created July 26, 2019 06:51
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 Ruxton/75ace990a9d568166926083ccd43e9e3 to your computer and use it in GitHub Desktop.
Save Ruxton/75ace990a9d568166926083ccd43e9e3 to your computer and use it in GitHub Desktop.
(function($) {
return $.fn.konami = function(callback, code) {
if (code == null) {
code = "38,38,40,40,37,39,37,39,66,65";
}
return this.each(function() {
var kkeys;
kkeys = [];
return $(this).bind('keydown', function(e) {
kkeys.push(e.keyCode);
if (kkeys.toString().indexOf(code) >= 0) {
$(this).unbind("keydown");
callback(e);
}
return true;
});
});
};
})(jQuery);
$(document).ready(function() {
var $iframe, $overlay;
$overlay = $('<div id="overlay" style="background-color: #fff; z-index: 10000; display: none; position: absolute; left: 50%; margin-left: -297px; top: 10%"></div>');
$iframe = $('<iframe width="560" height="384" frameborder="0" marginwidth="0" margin="0" height="0" scrolling="no" allowfullscreen></iframe>');
$overlay.append($iframe);
$('body').prepend($overlay);
return $(window).konami(function() {
var src;
src = 'https://archive.org/embed/arcade_pc_grdus';
$iframe.attr('src', src);
return $overlay.show();
});
});
// ---
// generated by coffee-script 1.9.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment