Commit b2a279fe by doszhang

dos

parent 6b510bbb
...@@ -191,7 +191,7 @@ $('input[name=signature]').attr('placeholder', '准备好了,就在此署名 ...@@ -191,7 +191,7 @@ $('input[name=signature]').attr('placeholder', '准备好了,就在此署名
//倒计时canvas定义 //倒计时canvas定义
let canvasinfo = initCanvas('.countdown-canvas', '#countDownCanvas', 254, 251, true); let canvasinfo = initCanvas('.countdown-canvas', 'countDownCanvas', 254, 251, true);
countDownCanvas = canvasinfo[0]; countDownCanvas = canvasinfo[0];
countDownCtx = canvasinfo[1]; countDownCtx = canvasinfo[1];
...@@ -307,6 +307,7 @@ function showCountDownPage() { ...@@ -307,6 +307,7 @@ function showCountDownPage() {
my_notify('请填写名字'); my_notify('请填写名字');
return false; return false;
} }
$('.countdown-page').css('background', bgColor);
countDownCtx.fillStyle = bgColor; countDownCtx.fillStyle = bgColor;
countDownCtx.fillRect(0, 0, countDownCanvas.width, countDownCanvas.height); countDownCtx.fillRect(0, 0, countDownCanvas.width, countDownCanvas.height);
$('.countdown-page').show(); $('.countdown-page').show();
...@@ -634,7 +635,7 @@ function initCanvas(target, id, canvasWidth, canvasHeight, useRem = false) { ...@@ -634,7 +635,7 @@ function initCanvas(target, id, canvasWidth, canvasHeight, useRem = false) {
canvasHeight = (canvasHeight / 20) * fontSize; canvasHeight = (canvasHeight / 20) * fontSize;
} }
$(target).html('<canvas id="' + id + '" width="' + canvasWidth + '" height="' + canvasHeight + '"></canvas>'); $(target).html('<canvas id="' + id + '" width="' + canvasWidth + '" height="' + canvasHeight + '"></canvas>');
canvas = $(id)[0]; canvas = $('#' + id)[0];
ctx = canvas.getContext("2d"); ctx = canvas.getContext("2d");
ctx.scale(2, 2); ctx.scale(2, 2);
canvas.width = canvasWidth; canvas.width = canvasWidth;
......
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