Adding an Konami Code to your forum(Cool thing >.<)
3 posters
Page 1 of 1
Adding an Konami Code to your forum(Cool thing >.<)
What is the code for an Konami code?
You know, the Up-Up-Down-Down-Left-Right-Left-Right-B-A thing?
(TheFaceBookForum has it >.<)
You know, the Up-Up-Down-Down-Left-Right-Left-Right-B-A thing?
(TheFaceBookForum has it >.<)
Last edited by Santa Sauce on Wed 18 Aug - 15:13; edited 1 time in total
Saxaca- Forumember
- Posts : 539
Reputation : 26
Language : Markup.
Re: Adding an Konami Code to your forum(Cool thing >.<)
ok found a couple of codes for this,
The Code
In case you don't know, the Konami Code is:
Up, Up, Down, Down, Left, Right, Left, Right, B, A, Start
For our purposes, we've replaced Start with Enter.
The JavaScript Code
The code is being hosted over at Google Code where you can download the examples and original source:
http://code.google.com/p/konami-js/
The beauty of hosting it there is you can just copy and paste the examples below. No need to download anything.
Simplest Example
The most basic example takes the user to Google when they enter the code correctly. Just add this in the homepage message
Second Simplest Example
A slightly more complicated examples show how you can redefine konami.code() and have it alert with a pop-up message instead:
Third Simplest Example
Maybe you want some other combination of keys to trigger a special event on your page? No problem. Just redefine the konami.pattern variable to match the sequence of keyCodes you want. This example would match the user hitting up twelve times:
this info is from http://www.snaptortoise.com/konami-js/
The Code
In case you don't know, the Konami Code is:
Up, Up, Down, Down, Left, Right, Left, Right, B, A, Start
For our purposes, we've replaced Start with Enter.
The JavaScript Code
The code is being hosted over at Google Code where you can download the examples and original source:
http://code.google.com/p/konami-js/
The beauty of hosting it there is you can just copy and paste the examples below. No need to download anything.
Simplest Example
The most basic example takes the user to Google when they enter the code correctly. Just add this in the homepage message
- Code:
<script type="text/javascript" src="http://konami-js.googlecode.com/svn/trunk/konami.js"></script>
<script type="text/javascript">
konami = new Konami()
konami.load("http://www.google.com");
</script>
Second Simplest Example
A slightly more complicated examples show how you can redefine konami.code() and have it alert with a pop-up message instead:
- Code:
<script type="text/javascript" src="http://konami-js.googlecode.com/svn/trunk/konami.js"></script>
<script type="text/javascript">
konami = new Konami()
konami.code = function() {
alert("You have entered the KONAMI CODE! You now have 30 lives. Kinda.")
}
konami.load()
</script>
Third Simplest Example
Maybe you want some other combination of keys to trigger a special event on your page? No problem. Just redefine the konami.pattern variable to match the sequence of keyCodes you want. This example would match the user hitting up twelve times:
- Code:
<script type="text/javascript" src="http://konami-js.googlecode.com/svn/trunk/konami.js"></script>
<script type="text/javascript">
konami = new Konami()
konami.pattern = "383838383838383838383838"
konami.code = function() {
alert("You have hit up four times. Why you did this, I don't know.")
}
konami.load()
</script>
this info is from http://www.snaptortoise.com/konami-js/
Re: Adding an Konami Code to your forum(Cool thing >.<)
Ok, but i want this in an HTML page, and to redirect to another HTML page.
But thanks for the explanation, i'll try to modify the codes a little to see what i can do.
But thanks for the explanation, i'll try to modify the codes a little to see what i can do.
Saxaca- Forumember
- Posts : 539
Reputation : 26
Language : Markup.
Re: Adding an Konami Code to your forum(Cool thing >.<)
this code works fine in a html page, use the first code and just change the url in this line
with the url you wanna redirect to.
- Code:
konami.load("http://www.google.com");
with the url you wanna redirect to.
Re: Adding an Konami Code to your forum(Cool thing >.<)
Yes, i've figured that out by now >.< But thanks!
--> Solved!
--> Solved!
Saxaca- Forumember
- Posts : 539
Reputation : 26
Language : Markup.
Re: Adding an Konami Code to your forum(Cool thing >.<)
Since this thread is marked solved, I will lock this thread.
Sanket
Sanket
Sanket- ForumGuru
- Posts : 48766
Reputation : 2830
Language : English
Location : Mumbai
Similar topics
» Konami code
» NOW asking for security code! Mouse Flickers And Does it's Own Thing on Forum
» Adding a second row under forum title & js code
» Adding font to forum, scrip code problem.
» Adding A Thing
» NOW asking for security code! Mouse Flickers And Does it's Own Thing on Forum
» Adding a second row under forum title & js code
» Adding font to forum, scrip code problem.
» Adding A Thing
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum