Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
php
/
citic-fighting
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
f65ec9a5
authored
Jun 27, 2024
by
dosZhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dos
parent
27f139d3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
1 deletions
+17
-1
Public/static/js/common.js
+17
-1
No files found.
Public/static/js/common.js
View file @
f65ec9a5
...
@@ -116,6 +116,8 @@ $(document).ready(function () {
...
@@ -116,6 +116,8 @@ $(document).ready(function () {
$
(
'.username,.company'
).
show
();
$
(
'.username,.company'
).
show
();
var
mc
=
new
Hammer
(
$
(
'.touch'
).
get
(
0
));
var
mc
=
new
Hammer
(
$
(
'.touch'
).
get
(
0
));
bindMc
(
mc
,
uploadCtx
,
uploadCanvas
,
img
,
imgInfo
);
bindMc
(
mc
,
uploadCtx
,
uploadCanvas
,
img
,
imgInfo
);
drawVerticalText
(
uploadCtx
,
username
,
'#595857'
,
32
*
2
,
95
*
2
,
345
*
2
,
true
,
5
*
2
);
drawVerticalText
(
uploadCtx
,
company
,
'#595857'
,
32
*
2
,
95
*
2
,
505
*
2
,
true
,
5
*
2
);
},
imgInfo
);
},
imgInfo
);
return
false
;
return
false
;
});
});
...
@@ -222,7 +224,7 @@ function setShare() {
...
@@ -222,7 +224,7 @@ function setShare() {
}
}
function
initPage
()
{
function
initPage
()
{
//
const displacement = parseFloat(getTranslateDistance());
const
displacement
=
parseFloat
(
getTranslateDistance
());
// const wrapHeight = parseFloat($('.wrap').css('height'));
// const wrapHeight = parseFloat($('.wrap').css('height'));
canvasHeight
=
1238
;
canvasHeight
=
1238
;
// $('.upload-canvas-block,.poster-img,.show-img,.poster-canvas').css('height', wrapHeight + 'px').css('top', displacement < 0 ? -displacement : 0 + 'px');
// $('.upload-canvas-block,.poster-img,.show-img,.poster-canvas').css('height', wrapHeight + 'px').css('top', displacement < 0 ? -displacement : 0 + 'px');
...
@@ -230,6 +232,14 @@ function initPage() {
...
@@ -230,6 +232,14 @@ function initPage() {
// $('.upload-page .logo').css('top', -displacement + 183 + 'px');
// $('.upload-page .logo').css('top', -displacement + 183 + 'px');
// }
// }
if
(
displacement
>
0
)
{
const
scale
=
document
.
documentElement
.
clientHeight
/
$
(
'.page'
).
height
();
$
(
'.wrap-inner'
).
css
({
'transform'
:
'translate(0%,-50%) scale(1,'
+
scale
+
')'
});
}
// if (displacement > 0) {
// if (displacement > 0) {
// const scale = document.documentElement.clientHeight / $('.page').height();
// const scale = document.documentElement.clientHeight / $('.page').height();
// $('.wrap-inner').css({
// $('.wrap-inner').css({
...
@@ -406,6 +416,8 @@ function bindMc(mc, ctx, myCanvas, img, imgInfo) {
...
@@ -406,6 +416,8 @@ function bindMc(mc, ctx, myCanvas, img, imgInfo) {
imgInfo
.
y
+=
movedY
*
2
;
imgInfo
.
y
+=
movedY
*
2
;
drawImage
(
ctx
,
myCanvas
,
img
,
imgInfo
);
drawImage
(
ctx
,
myCanvas
,
img
,
imgInfo
);
drawVerticalText
(
ctx
,
username
,
'#595857'
,
32
*
2
,
95
*
2
,
345
*
2
,
true
,
5
*
2
);
drawVerticalText
(
ctx
,
company
,
'#595857'
,
32
*
2
,
95
*
2
,
505
*
2
,
true
,
5
*
2
);
}
}
});
});
var
oldScale
=
1
;
var
oldScale
=
1
;
...
@@ -421,6 +433,8 @@ function bindMc(mc, ctx, myCanvas, img, imgInfo) {
...
@@ -421,6 +433,8 @@ function bindMc(mc, ctx, myCanvas, img, imgInfo) {
oldScale
=
event
.
scale
;
oldScale
=
event
.
scale
;
imgInfo
.
scale
*=
nowScale
;
imgInfo
.
scale
*=
nowScale
;
drawImage
(
ctx
,
myCanvas
,
img
,
imgInfo
);
drawImage
(
ctx
,
myCanvas
,
img
,
imgInfo
);
drawVerticalText
(
ctx
,
username
,
'#595857'
,
32
*
2
,
95
*
2
,
345
*
2
,
true
,
5
*
2
);
drawVerticalText
(
ctx
,
company
,
'#595857'
,
32
*
2
,
95
*
2
,
505
*
2
,
true
,
5
*
2
);
}
}
});
});
var
oldRotation
=
0
;
var
oldRotation
=
0
;
...
@@ -436,6 +450,8 @@ function bindMc(mc, ctx, myCanvas, img, imgInfo) {
...
@@ -436,6 +450,8 @@ function bindMc(mc, ctx, myCanvas, img, imgInfo) {
oldRotation
=
event
.
rotation
;
oldRotation
=
event
.
rotation
;
imgInfo
.
rotation
+=
nowRotation
;
imgInfo
.
rotation
+=
nowRotation
;
drawImage
(
ctx
,
myCanvas
,
img
,
imgInfo
);
drawImage
(
ctx
,
myCanvas
,
img
,
imgInfo
);
drawVerticalText
(
ctx
,
username
,
'#595857'
,
32
*
2
,
95
*
2
,
345
*
2
,
true
,
5
*
2
);
drawVerticalText
(
ctx
,
company
,
'#595857'
,
32
*
2
,
95
*
2
,
505
*
2
,
true
,
5
*
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