summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--index.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/index.php b/index.php
index 5d5188a..e1e3621 100644
--- a/index.php
+++ b/index.php
@@ -53,6 +53,8 @@
</div>
<script>
+ var lastClick = 0;
+ var bpm = [];
var dances = <?php readfile("dances.json"); ?>;
function median(values){
if ( values.length === 0 ) {
@@ -81,8 +83,6 @@
document.getElementById("showBpm").innerHTML = Math.round(median(bpm.slice()));
}
window.addEventListener("load",function() {
- var lastClick = 0;
- var bpm = [];
document.getElementById("countBpm").addEventListener("click", function(e){
var d = new Date();
var t = d.getTime();
@@ -96,7 +96,7 @@
} else {
var _bpm = 60 / seconds
bpm.push( _bpm );
- if ( bpm.length > 10 ) {
+ if ( bpm.length > 15 ) {
// keep only last 10 clicks
bpm.shift();
}