Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
php
/
chinaamc-2020flag
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
9c1d1e32
authored
Jan 08, 2020
by
doszhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dos
parent
11350c75
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
21 deletions
+25
-21
Public/static/js/common.js
+25
-21
No files found.
Public/static/js/common.js
View file @
9c1d1e32
...
...
@@ -306,6 +306,7 @@ function changeMainColor(event) {
function
chooseColorStart
(
e
)
{
let
touch
=
e
.
originalEvent
.
targetTouches
[
0
];
startX
=
(
touch
.
pageX
-
colorbarLeft
)
/
fontSize
;
setBgColor
(
startX
);
}
function
chooseColorMove
(
e
)
{
...
...
@@ -316,31 +317,34 @@ function chooseColorMove(e) {
timer
=
setTimeout
(()
=>
{
let
touch
=
e
.
originalEvent
.
targetTouches
[
0
];
moveX
=
(
touch
.
pageX
-
colorbarLeft
)
/
fontSize
;
setBgColor
(
moveX
);
},
5
);
}
if
(
moveX
<
4.2916
)
{
moveX
=
4.2916
;
}
else
if
(
moveX
>
26.62
)
{
moveX
=
26.62
;
}
function
setBgColor
(
moveX
)
{
if
(
moveX
<
4.2916
)
{
moveX
=
4.2916
;
}
else
if
(
moveX
>
26.62
)
{
moveX
=
26.62
;
}
if
(
moveX
<
6.59
)
{
colorIndex
=
1
;
}
else
if
(
moveX
>
6.59
&&
moveX
<
11
)
{
colorIndex
=
2
;
}
else
if
(
moveX
>
11
&&
moveX
<
15.46
)
{
colorIndex
=
3
;
}
else
if
(
moveX
>
15.46
&&
moveX
<
19.91
)
{
colorIndex
=
4
;
}
else
if
(
moveX
>
19.91
&&
moveX
<
24.38
)
{
colorIndex
=
5
;
}
else
if
(
moveX
>
24.38
)
{
colorIndex
=
6
;
}
if
(
moveX
<
6.59
)
{
colorIndex
=
1
;
}
else
if
(
moveX
>
6.59
&&
moveX
<
11
)
{
colorIndex
=
2
;
}
else
if
(
moveX
>
11
&&
moveX
<
15.46
)
{
colorIndex
=
3
;
}
else
if
(
moveX
>
15.46
&&
moveX
<
19.91
)
{
colorIndex
=
4
;
}
else
if
(
moveX
>
19.91
&&
moveX
<
24.38
)
{
colorIndex
=
5
;
}
else
if
(
moveX
>
24.38
)
{
colorIndex
=
6
;
}
$
(
'.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'
);
},
5
);
$
(
'.personal-page .btn-choose-color'
).
css
(
'left'
,
moveX
+
'rem'
);
}
function
initDecorate
()
{
...
...
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