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
159a7dc6
authored
Nov 10, 2019
by
doszhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dos
parent
6e69cee0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
1 deletions
+38
-1
Public/static/css/index.css
+6
-1
Public/static/js/common.js
+32
-0
No files found.
Public/static/css/index.css
View file @
159a7dc6
...
@@ -48,7 +48,12 @@ input::-webkit-input-placeholder {
...
@@ -48,7 +48,12 @@ input::-webkit-input-placeholder {
height
:
327px
;
height
:
327px
;
}
}
#headimg
{
#posterCanvas
{
width
:
525px
;
height
:
849px
;
}
#headimg
,
#poster
{
width
:
100%
;
width
:
100%
;
height
:
100%
;
height
:
100%
;
position
:
absolute
;
position
:
absolute
;
...
...
Public/static/js/common.js
View file @
159a7dc6
...
@@ -46,8 +46,12 @@ var preloadImageList = [
...
@@ -46,8 +46,12 @@ var preloadImageList = [
var
uploadCanvas
;
var
uploadCanvas
;
var
headimgCanvas
;
var
headimgCanvas
;
var
posterCanvas
;
var
uploadctx
;
var
uploadctx
;
var
headimgctx
;
var
headimgctx
;
var
posterctx
;
var
imgInfo
=
{};
var
imgInfo
=
{};
var
nowTemplate
=
1
;
var
nowTemplate
=
1
;
...
@@ -60,6 +64,7 @@ preloadimages(preloadImageList, function () {
...
@@ -60,6 +64,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><img id="headimg" />'
);
$
(
'.poster-canvas-block'
).
html
(
'<canvas id="posterCanvas" width="'
+
525
+
'" height="'
+
849
+
'"></canvas><img id="poster" />'
);
$
(
'.page1'
).
show
();
$
(
'.page1'
).
show
();
...
@@ -81,6 +86,7 @@ $(document).ready(function () {
...
@@ -81,6 +86,7 @@ $(document).ready(function () {
$
(
'.headimg-page .btn-back'
).
on
(
'click'
,
backToUpload
);
$
(
'.headimg-page .btn-back'
).
on
(
'click'
,
backToUpload
);
$
(
'.btn-toposter'
).
on
(
'click'
,
creatPoster
);
$
(
'[name=btn-tocreate]'
).
change
(
function
()
{
$
(
'[name=btn-tocreate]'
).
change
(
function
()
{
var
canvasinfo
=
initCanvas
(
'#uploadCanvas'
,
660
,
660
);
var
canvasinfo
=
initCanvas
(
'#uploadCanvas'
,
660
,
660
);
...
@@ -188,6 +194,32 @@ $(document).ready(function () {
...
@@ -188,6 +194,32 @@ $(document).ready(function () {
});
});
});
});
function
creatPoster
()
{
var
posterObj
=
new
Image
();
posterObj
.
src
=
'/Public/static/image2/poster.png'
;
posterObj
.
onload
=
function
()
{
posterctx
.
drawImage
(
posterObj
,
0
,
0
,
posterCanvas
.
width
,
posterCanvas
.
height
);
var
headimgObj
=
new
Image
();
headimgObj
.
src
=
getManBase64
(
uploadCanvas
);
var
canvasinfo
=
initCanvas
(
'#posterCanvas'
,
1050
,
1698
);
posterCanvas
=
canvasinfo
[
0
];
posterctx
=
canvasinfo
[
1
];
headimgObj
.
onload
=
function
()
{
headimgctx
.
drawImage
(
headimgObj
,
51
,
184
,
387
,
387
);
$
(
'#poster'
).
attr
(
'src'
,
getManBase64
(
posterCanvas
));
$
(
'.upload-page'
).
fadeOut
(
300
);
$
(
'.poster-page'
).
fadeIn
(
300
);
}
}
}
function
backToUpload
()
{
function
backToUpload
()
{
$
(
'.headimg-page'
).
fadeOut
(
300
);
$
(
'.headimg-page'
).
fadeOut
(
300
);
$
(
'.upload-page'
).
delay
(
200
).
fadeIn
(
300
);
$
(
'.upload-page'
).
delay
(
200
).
fadeIn
(
300
);
...
...
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