Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
php
/
maf
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
54912ad9
authored
Jan 14, 2020
by
doszhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dos
parent
cb3dad09
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
2 deletions
+16
-2
Public/static/css/index.css
+8
-0
Public/static/js/common.js
+8
-2
No files found.
Public/static/css/index.css
View file @
54912ad9
...
...
@@ -121,4 +121,11 @@ input::-webkit-input-placeholder {
-webkit-transform
:
translate3d
(
-100%
,
0
,
0
);
transform
:
translate3d
(
-100%
,
0
,
0
)
}
}
/* poster-page */
.posterImg
{
z-index
:
1
;
width
:
100%
;
height
:
100%
;
}
\ No newline at end of file
Public/static/js/common.js
View file @
54912ad9
...
...
@@ -77,7 +77,6 @@ let canvasArr = [
[
58
,
240
,
1206
,
1808
,
34
,
30
,
'#ffffff'
],
[
58
,
240
,
1164
,
1740
,
34
,
30
,
'#ffffff'
],
[
58
,
240
,
1164
,
1808
,
34
,
30
,
'#0f5188'
],
// [58, 240, 1164, 1008, 34, 30, '#0f5188'],
[
58
,
240
,
1164
,
1812
,
34
,
30
,
'#0f5188'
],
[
58
,
240
,
1190
,
1812
,
34
,
30
,
'#0f5188'
]
];
...
...
@@ -140,6 +139,7 @@ $(document).ready(function () {
});
function
createPoster
()
{
$
(
'.poster-bg'
).
hide
();
$
(
'.poster-bg-'
+
resultType
).
show
();
$
(
'.poster-canvas-block'
).
css
({
...
...
@@ -159,6 +159,7 @@ function createPoster() {
let
canvasinfo
=
initCanvas
(
'.poster-canvas-block'
,
'posterCanvas'
,
designPxToRealPx
(
canvasArr
[
resultType
-
1
][
2
]),
designPxToRealPx
(
canvasArr
[
resultType
-
1
][
3
]));
posterCanvas
=
canvasinfo
[
0
];
posterCtx
=
canvasinfo
[
1
];
$
(
'.poster-canvas-block'
).
append
(
$
(
'<img class="posterImg" src="" />'
));
$
(
'#posterCanvas'
).
css
({
'width'
:
pxToRem
(
canvasArr
[
resultType
-
1
][
2
])
/
2
+
'rem'
,
'height'
:
pxToRem
(
canvasArr
[
resultType
-
1
][
3
])
/
2
+
'rem'
,
...
...
@@ -174,11 +175,16 @@ function createPoster() {
drawRoundedRect
(
posterCtx
,
designPxToRealPx
(
canvasArr
[
resultType
-
1
][
5
]
-
6
),
designPxToRealPx
(
canvasArr
[
resultType
-
1
][
4
]
-
6
),
designPxToRealPx
(
52
)
*
2
,
designPxToRealPx
(
52
)
*
2
,
designPxToRealPx
(
5
)
*
2
,
true
,
canvasArr
[
resultType
-
1
][
6
]);
drawRoundRectImg
(
posterCtx
,
designPxToRealPx
(
5
)
*
2
,
designPxToRealPx
(
canvasArr
[
resultType
-
1
][
5
]),
designPxToRealPx
(
canvasArr
[
resultType
-
1
][
4
]),
designPxToRealPx
(
46
)
*
2
,
designPxToRealPx
(
46
)
*
2
,
headimg
);
txtDraw
(
posterCtx
,
'@'
+
window
.
nickname
,
designPxToRealPx
(
canvasArr
[
resultType
-
1
][
5
]
+
128
),
designPxToRealPx
(
canvasArr
[
resultType
-
1
][
4
]
+
84
),
designPxToRealPx
(
20
),
'normal'
,
canvasArr
[
resultType
-
1
][
6
])
txtDraw
(
posterCtx
,
'@'
+
window
.
nickname
,
designPxToRealPx
(
canvasArr
[
resultType
-
1
][
5
]
+
128
),
designPxToRealPx
(
canvasArr
[
resultType
-
1
][
4
]
+
84
),
designPxToRealPx
(
20
),
'normal'
,
canvasArr
[
resultType
-
1
][
6
]);
}
}
}
function
getManBase64
()
{
return
myCanvas
.
toDataURL
(
'image/png'
);
}
function
drawRoundedRect
(
ctx
,
x
,
y
,
width
,
height
,
r
,
fill
,
color
)
{
ctx
.
save
();
ctx
.
fillStyle
=
color
;
...
...
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