easter egg

From IndieWeb
Jump to: navigation, search


An easter egg is an (often small) undocumented feature, many are small jokes.

Konami Code

Konami Code is a cheat code originating from 80s Konami video games, these days used as reference, or as an actual, functioning Easter egg on websites: up, up, down, down, left, right, left, right, b, a.

This is vanilla JS, no framework is needed.

function kcl(cb) {
  var input = '';
  var key = '38384040373937396665';
  document.addEventListener('keydown', function (e) {
    input += ("" + e.keyCode);
    if (input === key) {
      return cb();
    }
    if (!key.indexOf(input)) return;
    input = ("" + e.keyCode);
  });
}

kcl(function () {
    // do something here
})

IndieWeb Examples

Read any of the below at your own risk. You may want to go hunting yourself!

Martijn van der Ven

Martijn van der Ven has the following easter eggs on his homepage:

Easter egg 1

On any touch enabled devices (or browsers sending touch events for inputs) you can swipe right to trigger an window.alert().

This is active as of 2017-08-20.

Easter egg 2

Forever 18: there is a 9% chance that my age will display as 18 years old, with a non-base-10 modifier on it.

This is active as of 2019-05-05.

Easter egg 3

Entering the Konami Code on the h-card will trigger an window.alert() containing an old-school Geek Code.

This is active as of 2019-10-20.

Peter Molnar

Added an experimental, incredibly ugly, alternative style sheet, which is activated by Konami Code.

fluffy

fluffy's site has quite a few animated error pages, complete with theme songs. Try to generate a 403, 404, or 4xx error yourself. (If you give up, here are spoilers.)

capjamesg

capjamesg's website has a custom Konami code activated using the following sequence:

  • Up
  • Down
  • Up
  • Down
  • Up
  • Down

The Konami code triggers a change in the HTML inside an announcement banner that is used to show featured posts on his blog. The announcement banner appears on all pages.

Visitors can press the escape key to reset the Konami code if they make a mistake when tying it in or if they have already pressed other keys before trying the code.

The code that powers his Konami code is based on the first example:

function konami() {
    var input = "";
    var code = "384038403840";
    document.addEventListener("keydown", function(e) {
        if (e.keyCode.toString() === "27") {
            input = "";
        } else {
            input += e.keyCode.toString();
            if (input === code) {
                const announcement = document.getElementsByClassName("announcement")[0];
                announcement.innerHTML = "<p style='color:white;'><b>You have found the secret.</b></p>"
            }
        }
    })
}

konami();

aaronpk

Aaron Parecki's website has an easter egg if you type the Konami code.

Jan-Lukas Else

Jan-Lukas Else has an easter egg on his sites that gets triggered by the Konami code. If you want to see the page the right way around again, you have to enter the Konami code once more.

Q4.re

Arne Govaerts whoami section changes into '80s chaos when you type the Konami code.

Add yourself

Hit edit on this section if you want to add yourself without spoiling other people’s easter eggs for yourself!

Add a new section above the === Add yourself === line, e.g. === Your Name ===. You can use the following mark-up to hide your easter egg descriptions from viewers:

<raw><details><summary>Easter egg title</summary></raw>

Describe it here.

<raw></details></raw>

See Also