Commit 02ed5ae4 by doszhang

dos

parent b0e9e5e1
......@@ -450,24 +450,24 @@ function showCountDownPage() {
}
function countDown(callback) {
let angle = 360;
let angle = -360;
let countdown = 3;
let timer;
countDownCtx.fillStyle = '#000';
countDownCtx.fillStyle = bgColor;
timer = setInterval(function () {
$('.countdown-num').text(countdown).addClass('animate');
angle = ((angle * 10) - 36) / 10;
countDownCtx.clearRect(0, 0, countDownCanvas.width, countDownCanvas.height);
angle = ((angle * 10) + 36) / 10;
countDownCtx.sector(countDownCanvas.width / 2, countDownCanvas.height / 2, countDownCanvas.width / 2, 0, angle).fill();
if (angle <= 0) {
if (angle >= 0) {
countdown--;
if (countdown == 0) {
clearInterval(timer);
callback();
} else {
angle = 360;
countDownCtx.clearRect(0, 0, countDownCanvas.width, countDownCanvas.height);
angle = -360;
$('.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