Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
php
/
chinaamc-2020flag
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
16a6f457
authored
Jan 09, 2020
by
doszhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dos
parent
87773e2d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
0 deletions
+21
-0
Public/static/js/common.js
+21
-0
No files found.
Public/static/js/common.js
View file @
16a6f457
...
...
@@ -172,6 +172,10 @@ let agreeSuggestion = false;
//同意按钮闪烁timer
let
agreeTimer
;
//倒计时canvas
let
countDownCanvas
;
let
countDownCtx
;
//记录初始状态下fontsize
const
fontSize
=
parseFloat
(
$
(
'html'
).
css
(
'fontSize'
));
...
...
@@ -185,6 +189,12 @@ $('input[name=customize-flag]').attr('placeholder', '也能在这里写你的fla
//署名的placeholder
$
(
'input[name=signature]'
).
attr
(
'placeholder'
,
'准备好了,就在此署名吧'
).
attr
(
'id'
,
'signature'
);
//倒计时canvas定义
(
'.countdown-canvas'
).
html
(
'<canvas id="countDownCanvas" width="'
+
254
+
'" height="'
+
251
+
'"></canvas>'
);
let
canvasinfo
=
initCanvas
(
'countDownCanvas'
,
254
,
251
);
countDownCanvas
=
canvasinfo
[
0
];
countDownCtx
=
canvasinfo
[
1
];
//初始化小装饰
initDecorate
();
...
...
@@ -297,6 +307,8 @@ function showCountDownPage() {
my_notify
(
'请填写名字'
);
return
false
;
}
countDownCtx
.
fillStyle
=
bgColor
;
countDownCtx
.
fillRect
(
0
,
0
,
countDownCanvas
.
width
,
countDownCanvas
.
height
);
$
(
'.suggest-page .suggest-wrap'
).
addClass
(
'animate'
);
setTimeout
(
function
()
{
$
(
'.suggest-page'
).
fadeOut
(
300
);
...
...
@@ -614,6 +626,15 @@ function fadeInTextUp(text, fadeTime, divName) {
},
3000
);
}
function
initCanvas
(
id
,
canvasWidth
,
canvasHeight
)
{
canvas
=
$
(
id
)[
0
];
ctx
=
canvas
.
getContext
(
"2d"
);
ctx
.
scale
(
2
,
2
);
canvas
.
width
=
canvasWidth
;
canvas
.
height
=
canvasHeight
;
return
[
canvas
,
ctx
];
}
function
getTranslateDistance
(
cardinal
=
0
)
{
var
wrapInnerTransform
=
$
(
'.wrap-inner'
).
css
(
'transform'
);
var
wrapInnertop
=
parseFloat
(
$
(
'.wrap-inner'
).
css
(
'top'
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment