aboutsummaryrefslogtreecommitdiff
path: root/public/javascripts/cheat.js
blob: 863e53a6316a2fdfbda7c72fa3a75c69d34ffe72 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
var konamiActivated = false;

new Konami(function () {

    if (konamiActivated) return;
    konamiActivated = true;

    console.log('Cheat console activated. Have fun!');

    // play nice soundtrack
    (new Audio('/assets/medias/sims2-university-theme.ogg')).play();

    // display cheat console
    var form = document.createElement('form');
    form.classList.add('cheat-form');
    form.setAttribute('method', 'post');
    form.setAttribute('action', '/console');

    var field = document.createElement('input');
    field.setAttribute('type', 'text');
    field.setAttribute('name', 'command');
    field.setAttribute('autocomplete', 'off');

    form.appendChild(field);
    document.getElementsByTagName('body')[0].appendChild(form);

    field.focus();

});