Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
php
/
pingan-marathon
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
ca5a495f
authored
Nov 11, 2019
by
doszhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dos
parent
c8d5311f
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
7 deletions
+20
-7
Public/static/js/common.js
+20
-7
Public/static/js/layout.js
+0
-0
No files found.
Public/static/js/common.js
View file @
ca5a495f
...
@@ -47,10 +47,12 @@ var preloadImageList = [
...
@@ -47,10 +47,12 @@ var preloadImageList = [
var
uploadCanvas
;
var
uploadCanvas
;
var
headimgCanvas
;
var
headimgCanvas
;
var
posterCanvas
;
var
posterCanvas
;
var
textCanvas
;
var
uploadctx
;
var
uploadctx
;
var
headimgctx
;
var
headimgctx
;
var
posterctx
;
var
posterctx
;
var
textctx
;
var
imgInfo
=
{};
var
imgInfo
=
{};
var
nowTemplate
=
1
;
var
nowTemplate
=
1
;
...
@@ -63,7 +65,7 @@ preloadimages(preloadImageList, function () {
...
@@ -63,7 +65,7 @@ preloadimages(preloadImageList, function () {
$
(
'input[name=customize]'
).
attr
(
'placeholder'
,
'输入自定义文字(仅限四个字)'
).
attr
(
'maxlength'
,
'4'
);
$
(
'input[name=customize]'
).
attr
(
'placeholder'
,
'输入自定义文字(仅限四个字)'
).
attr
(
'maxlength'
,
'4'
);
$
(
'.canvas-block'
).
html
(
'<canvas id="uploadCanvas" width="'
+
330
+
'" height="'
+
330
+
'"></canvas>'
);
$
(
'.canvas-block'
).
html
(
'<canvas id="uploadCanvas" width="'
+
330
+
'" height="'
+
330
+
'"></canvas>'
);
$
(
'.headimg-canvas-block'
).
html
(
'<canvas id="headimgCanvas" width="'
+
330
+
'" height="'
+
330
+
'"></canvas><img id="headimg" />'
);
$
(
'.headimg-canvas-block'
).
html
(
'<canvas id="headimgCanvas" width="'
+
330
+
'" height="'
+
330
+
'"></canvas><
canvas id="texthide" width="102" height="94" height=""></canvas><
img id="headimg" />'
);
$
(
'.poster-canvas-block'
).
html
(
'<canvas id="posterCanvas" width="'
+
525
+
'" height="'
+
849
+
'"></canvas><img id="poster" />'
);
$
(
'.poster-canvas-block'
).
html
(
'<canvas id="posterCanvas" width="'
+
525
+
'" height="'
+
849
+
'"></canvas><img id="poster" />'
);
$
(
'.page1'
).
show
();
$
(
'.page1'
).
show
();
...
@@ -272,15 +274,26 @@ function creatPoster() {
...
@@ -272,15 +274,26 @@ function creatPoster() {
frameimg
.
onload
=
function
()
{
frameimg
.
onload
=
function
()
{
posterctx
.
drawImage
(
frameimg
,
51
*
2
,
184
*
2
,
387
*
2
,
387
*
2
);
posterctx
.
drawImage
(
frameimg
,
51
*
2
,
184
*
2
,
387
*
2
,
387
*
2
);
txtDraw
(
posterctx
,
$
(
'[name=customize]'
).
val
(),
50
,
'normal'
,
'#fff'
,
90
,
231
);
//
txtDraw(posterctx, $('[name=customize]').val(), 50, 'normal', '#fff', 90,231);
var
src
=
getManBase64
(
posterCanvas
);
var
canvasinfo
=
initCanvas
(
'#texthide'
,
1050
,
1698
);
$
(
'#poster'
).
attr
(
'src'
,
src
);
textCanvas
=
canvasinfo
[
0
];
textctx
=
canvasinfo
[
1
];
uploadImg
(
'poster'
,
src
);
txtDraw
(
textctx
,
$
(
'[name=customize]'
).
val
(),
50
,
'normal'
,
'#fff'
);
var
textObj
=
new
Image
();
textObj
.
src
=
getManBase64
(
textCanvas
);
$
(
'.upload-page'
).
fadeOut
(
300
);
textObj
.
onload
=
function
()
{
$
(
'.poster-page'
).
fadeIn
(
300
);
posterctx
.
drawImage
(
textObj
,
326
*
2
,
442
*
2
,
387
*
2
,
387
*
2
);
var
src
=
getManBase64
(
posterCanvas
);
$
(
'#poster'
).
attr
(
'src'
,
src
);
uploadImg
(
'poster'
,
src
);
$
(
'.upload-page'
).
fadeOut
(
300
);
$
(
'.poster-page'
).
fadeIn
(
300
);
}
}
}
}
}
}
}
...
...
Public/static/js/layout.js
View file @
ca5a495f
This diff is collapsed.
Click to expand it.
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