Lightweight Javascript manager for customiZable Konami codes : <1 Ko (minified)
<script type="text/javascript" src="https://cdn.rawgit.com/FlorianBezagu/Konamiz/master/konamiz.min.js"></script>
Download konamiz.min.js
<script type="text/javascript" src="konamiz.min.js"></script>
When added to your website, create a new Konamiz
as following :
var k = new Konamiz()
.onStart(function(){
alert('Hello !');
})
.onStop(function(){
alert('Bye !');
});
Now enter the Konami code :
`Up, up, down, down, left, right, left, right, b, a, Enter`
When creating your Konamiz
you can give the constructor an Array with the Konamiz sequence you want such as :
var k = new Konamiz([ 'h', 'e', 'l', 'l', 'o', 'Enter' ])
.onStart(function(){
alert('Hello !');
})
.onStop(function(){
alert('Bye !');
});
Now your Konamiz will be activated when typing
`h, e, l, l, o, Enter`