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
6b510bbb
authored
Jan 09, 2020
by
doszhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dos
parent
ee0a5c2e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
Public/static/js/common.js
+9
-3
No files found.
Public/static/js/common.js
View file @
6b510bbb
...
...
@@ -190,8 +190,8 @@ $('input[name=customize-flag]').attr('placeholder', '也能在这里写你的fla
$
(
'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
);
let
canvasinfo
=
initCanvas
(
'
.countdown-canvas'
,
'#countDownCanvas'
,
254
,
251
,
true
);
countDownCanvas
=
canvasinfo
[
0
];
countDownCtx
=
canvasinfo
[
1
];
...
...
@@ -342,6 +342,7 @@ function showSuggestPage() {
$
(
'.personal-page .btn-tab-decorate'
).
click
();
return
false
;
}
$
(
'.flag-page'
).
hide
();
$
(
'.suggest-page'
).
css
(
'background'
,
bgColor
);
$
(
'.personal-page .personal-wrap'
).
addClass
(
'animate'
);
$
(
'.suggest-page'
).
show
();
...
...
@@ -627,7 +628,12 @@ function fadeInTextUp(text, fadeTime, divName) {
},
3000
);
}
function
initCanvas
(
id
,
canvasWidth
,
canvasHeight
)
{
function
initCanvas
(
target
,
id
,
canvasWidth
,
canvasHeight
,
useRem
=
false
)
{
if
(
useRem
)
{
canvasWidth
=
(
canvasWidth
/
20
)
*
fontSize
;
canvasHeight
=
(
canvasHeight
/
20
)
*
fontSize
;
}
$
(
target
).
html
(
'<canvas id="'
+
id
+
'" width="'
+
canvasWidth
+
'" height="'
+
canvasHeight
+
'"></canvas>'
);
canvas
=
$
(
id
)[
0
];
ctx
=
canvas
.
getContext
(
"2d"
);
ctx
.
scale
(
2
,
2
);
...
...
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