Commit b65ab595 by doszhang

dos

parent b2a279fe
...@@ -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, 254, true);
countDownCanvas = canvasinfo[0]; countDownCanvas = canvasinfo[0];
countDownCtx = canvasinfo[1]; countDownCtx = canvasinfo[1];
...@@ -308,8 +308,8 @@ function showCountDownPage() { ...@@ -308,8 +308,8 @@ function showCountDownPage() {
return false; return false;
} }
$('.countdown-page').css('background', bgColor); $('.countdown-page').css('background', bgColor);
countDownCtx.fillStyle = bgColor;
countDownCtx.fillRect(0, 0, countDownCanvas.width, countDownCanvas.height); countDownCtx();
$('.countdown-page').show(); $('.countdown-page').show();
$('.suggest-page .suggest-wrap').addClass('animate'); $('.suggest-page .suggest-wrap').addClass('animate');
setTimeout(function () { setTimeout(function () {
...@@ -317,6 +317,16 @@ function showCountDownPage() { ...@@ -317,6 +317,16 @@ function showCountDownPage() {
}, 500); }, 500);
} }
function countDownCtx() {
let angle = 360;
let Timer;
countDownCtx.fillStyle = '#000';
setInterval(function () {
angle += 3.6;
countDownCtx.sector(countDownCanvas.width / 4, countDownCanvas.height / 4, countDownCanvas.width / 4, angle);
}, 10);
}
function agreeSuggest() { function agreeSuggest() {
$('.suggest-page .agree').hide(); $('.suggest-page .agree').hide();
$('.suggest-page .agree-active').show(); $('.suggest-page .agree-active').show();
...@@ -643,6 +653,16 @@ function initCanvas(target, id, canvasWidth, canvasHeight, useRem = false) { ...@@ -643,6 +653,16 @@ function initCanvas(target, id, canvasWidth, canvasHeight, useRem = false) {
return [canvas, ctx]; return [canvas, ctx];
} }
CanvasRenderingContext2D.prototype.sector = function (x, y, r, angle1, angle2) {
this.save();
this.beginPath();
this.moveTo(x, y);
this.arc(x, y, r, angle1 * Math.PI / 180, angle2 * Math.PI / 180, false);
this.closePath();
this.restore();
return this;
}
function getTranslateDistance(cardinal = 0) { function getTranslateDistance(cardinal = 0) {
var wrapInnerTransform = $('.wrap-inner').css('transform'); var wrapInnerTransform = $('.wrap-inner').css('transform');
var wrapInnertop = parseFloat($('.wrap-inner').css('top')); var wrapInnertop = parseFloat($('.wrap-inner').css('top'));
......
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