Commit 45e08480 by doszhang

dos

parent 680c2645
...@@ -323,19 +323,19 @@ function countDown(callback) { ...@@ -323,19 +323,19 @@ function countDown(callback) {
let angle = -360; let angle = -360;
let countdown = 3; let countdown = 3;
let timer; let timer;
$('.countdown-num').text(countdown); $('.countdown-num').text(countdown).addClass('animate');
countDownCtx.fillStyle = bgColor; countDownCtx.fillStyle = bgColor;
timer = setInterval(function () { timer = setInterval(function () {
angle = ((angle * 10) + 36) / 10; angle = ((angle * 10) + 36) / 10;
countDownCtx.clearRect(0, 0, countDownCanvas.width, countDownCanvas.height); countDownCtx.clearRect(0, 0, countDownCanvas.width, countDownCanvas.height);
countDownCtx.sector(countDownCanvas.width / 2, countDownCanvas.height / 2, countDownCanvas.width / 2, 0, angle).fill(); countDownCtx.sector(countDownCanvas.width / 2, countDownCanvas.height / 2, countDownCanvas.width / 2, 0, angle).fill();
console.log(angle);
if (angle >= 0) { if (angle >= 0) {
countdown--; countdown--;
if (countdown == 0) { if (countdown == 0) {
clearInterval(timer); clearInterval(timer);
$('.countdown-num').removeClass('animate');
callback(); callback();
} else { } else {
angle = -360; angle = -360;
$('.countdown-num').text(countdown); $('.countdown-num').text(countdown);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment