Commit 9c1d1e32 by doszhang

dos

parent 11350c75
...@@ -306,6 +306,7 @@ function changeMainColor(event) { ...@@ -306,6 +306,7 @@ function changeMainColor(event) {
function chooseColorStart(e) { function chooseColorStart(e) {
let touch = e.originalEvent.targetTouches[0]; let touch = e.originalEvent.targetTouches[0];
startX = (touch.pageX - colorbarLeft) / fontSize; startX = (touch.pageX - colorbarLeft) / fontSize;
setBgColor(startX);
} }
function chooseColorMove(e) { function chooseColorMove(e) {
...@@ -316,7 +317,11 @@ function chooseColorMove(e) { ...@@ -316,7 +317,11 @@ function chooseColorMove(e) {
timer = setTimeout(() => { timer = setTimeout(() => {
let touch = e.originalEvent.targetTouches[0]; let touch = e.originalEvent.targetTouches[0];
moveX = (touch.pageX - colorbarLeft) / fontSize; moveX = (touch.pageX - colorbarLeft) / fontSize;
setBgColor(moveX);
}, 5);
}
function setBgColor(moveX) {
if (moveX < 4.2916) { if (moveX < 4.2916) {
moveX = 4.2916; moveX = 4.2916;
} else if (moveX > 26.62) { } else if (moveX > 26.62) {
...@@ -340,7 +345,6 @@ function chooseColorMove(e) { ...@@ -340,7 +345,6 @@ function chooseColorMove(e) {
$('.personal-page').css('background', colorList[mainColor][colorIndex - 1]); $('.personal-page').css('background', colorList[mainColor][colorIndex - 1]);
$('.personal-page .btn-choose-color').css('left', moveX + 'rem'); $('.personal-page .btn-choose-color').css('left', moveX + 'rem');
}, 5);
} }
function initDecorate() { function initDecorate() {
......
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