coin-clicks
Advanced tools
Comparing version 0.0.3 to 1.0.0
import $ from 'jquery'; | ||
export function initialize(/* container, application */) { | ||
$(window).on('click', addCoin); | ||
const stack = [38, 38, 40, 40, 37, 39, 37, 39, 66, 65]; | ||
let currentStack = stack.slice(); | ||
$(window).on('keyup.coin-clicks', event => { | ||
const keyCode = currentStack.shift(); | ||
if (event.keyCode === keyCode) { | ||
if (currentStack.length === 0) { | ||
$(window).on('click.coin-clicks', addCoin); | ||
$(window).off('keyup.coin-clicks'); | ||
} | ||
} else { | ||
currentStack = stack.slice(); | ||
} | ||
}); | ||
} | ||
@@ -11,3 +27,11 @@ | ||
let coinCount = 0; | ||
function addCoin(event) { | ||
coinCount++; | ||
if (coinCount >= 10) { | ||
$(window).off('click.coin-clicks'); | ||
initialize(); | ||
coinCount = 0; | ||
} | ||
const $img = $('<img>') | ||
@@ -14,0 +38,0 @@ .attr('src', '/coin-clicks/img/coin.gif') |
{ | ||
"name": "coin-clicks", | ||
"version": "0.0.3", | ||
"version": "1.0.0", | ||
"description": "The default blueprint for ember-cli addons.", | ||
@@ -5,0 +5,0 @@ "directories": { |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
31146
90
1