diff --git a/index.css b/index.css index 18f7e16..ce1f1ed 100644 --- a/index.css +++ b/index.css @@ -1,6 +1,7 @@ body { margin: 0; padding: 0; + background-color: rgb(246, 244, 236); } .site { diff --git a/index.js b/index.js index cd28afa..2ec869e 100644 --- a/index.js +++ b/index.js @@ -1,6 +1,7 @@ /** * Created by llan on 2017/1/11. */ +'use strict'; /** * 方块 * @param params @@ -240,14 +241,14 @@ const block = function (params) { * 方块自由下落 * @type {number} */ - const fallDown = setTimeout(function () { + const fallDown = setTimeout(function loop() { let moveDown = canMove(arr).canMoveDown; if (moveDown) { for (let v of activityModels) { v.style.top = `calc(${v.style.top} + ${BLOCK_SIZE}px)`; } curTop++; - setTimeout(arguments.callee, delay / window.__level__); + setTimeout(loop, delay / window.__level__); } else { for (let i = 0; i < activityModels.length; i++) { activityModels[i].className = 'inactiveModel'