Commit f65ec9a5 by dosZhang

dos

parent 27f139d3
...@@ -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);
} }
}); });
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment