33 lines
858 B
JavaScript
33 lines
858 B
JavaScript
const Knmc = function(w) {
|
|
this.window = w;
|
|
}
|
|
|
|
Knmc.prototype.init = function() {
|
|
var chars = '';
|
|
var seq = '38384040373937396665';
|
|
var body = this.window.document.querySelector('body');
|
|
|
|
body.addEventListener('keyup', function(e) {
|
|
chars += e.keyCode.toString();
|
|
|
|
if (chars.indexOf(seq) !== -1) {
|
|
chars = '';
|
|
var url = '/bundles/deblanblog/skin2018/frontoffice/img/mario.gif';
|
|
var image = new Image();
|
|
image.classList.add('fixed');
|
|
image.style.position = 'fixed';
|
|
image.style.bottom = '-11px';
|
|
image.style.left = '-256px';
|
|
|
|
image.onload = function() {
|
|
image.classList.add('knmc');
|
|
body.appendChild(image);
|
|
}
|
|
|
|
image.src = url;
|
|
}
|
|
});
|
|
}
|
|
|
|
module.exports = Knmc
|