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
a67a470a
authored
Jan 08, 2020
by
doszhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dos
parent
f499d7e4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
68 additions
and
10 deletions
+68
-10
Public/static/js/common.js
+68
-10
No files found.
Public/static/js/common.js
View file @
a67a470a
...
@@ -87,6 +87,7 @@ let first = true;
...
@@ -87,6 +87,7 @@ let first = true;
let
startX
;
let
startX
;
let
timer
;
let
timer
;
let
mainColor
=
'red'
;
let
mainColor
=
'red'
;
let
colorIndex
=
4
;
let
colorList
=
{
let
colorList
=
{
'red'
:
[
'red'
:
[
'#854337'
,
'#854337'
,
...
@@ -95,6 +96,46 @@ let colorList = {
...
@@ -95,6 +96,46 @@ let colorList = {
'#e5382a'
,
'#e5382a'
,
'#fa675c'
,
'#fa675c'
,
'#ffbaaf'
'#ffbaaf'
],
'yellow'
:
[
'#cf9b0d'
,
'#e4a701'
,
'#ffc411'
,
'#f8d35c'
,
'#fae28e'
,
'#f4d895'
],
'lightgreen'
:
[
'#6a7c42'
,
'#86995c'
,
'#9fcd63'
,
'#b5d986'
,
'#92be71'
,
'#bacaa8'
],
'darkgreen'
:
[
'#3d6743'
,
'#368a41'
,
'#4eac5b'
,
'#6cba77'
,
'#8ecc97'
,
'#a6c6ab'
],
'blue'
:
[
'#295a9c'
,
'#458baa'
,
'#2fa7de'
,
'#6fb0da'
,
'#88b7db'
,
'#b1dce3'
],
'purple'
:
[
'#543c64'
,
'#6d3f82'
,
'#986cb2'
,
'#856cb9'
,
'#9c87c6'
,
'#b3a5ce'
]
]
}
}
const
fontSize
=
parseFloat
(
$
(
'html'
).
css
(
'fontSize'
));
const
fontSize
=
parseFloat
(
$
(
'html'
).
css
(
'fontSize'
));
...
@@ -137,11 +178,28 @@ $(document).ready(function () {
...
@@ -137,11 +178,28 @@ $(document).ready(function () {
$
(
'.personal-page .btn-yellow'
).
on
(
'click'
,
{
$
(
'.personal-page .btn-yellow'
).
on
(
'click'
,
{
color
:
'yellow'
color
:
'yellow'
},
changeMainColor
);
},
changeMainColor
);
//青绿
$
(
'.personal-page .btn-lightgreen'
).
on
(
'click'
,
{
color
:
'lightgreen'
},
changeMainColor
);
//深绿
$
(
'.personal-page .btn-drakgreen'
).
on
(
'click'
,
{
color
:
'drakgreen'
},
changeMainColor
);
//蓝色
$
(
'.personal-page .btn-blue'
).
on
(
'click'
,
{
color
:
'blue'
},
changeMainColor
);
//紫色
$
(
'.personal-page .btn-purple'
).
on
(
'click'
,
{
color
:
'purple'
},
changeMainColor
);
});
});
function
changeMainColor
(
event
)
{
function
changeMainColor
(
event
)
{
console
.
log
(
event
.
data
.
color
);
mainColor
=
event
.
data
.
color
;
$
(
'.personal-page'
).
css
(
'background'
,
colorList
[
mainColor
][
colorIndex
-
1
]);
$
(
'.personal-page .colorbar'
).
css
(
'background'
,
'url(../image2/colorbar-'
+
mainColor
+
'.png) left top no-repeat'
);
}
}
function
chooseColorStart
(
e
)
{
function
chooseColorStart
(
e
)
{
...
@@ -167,22 +225,22 @@ function chooseColorMove(e) {
...
@@ -167,22 +225,22 @@ function chooseColorMove(e) {
}
else
if
(
left
>
26.62
)
{
}
else
if
(
left
>
26.62
)
{
left
=
26.62
;
left
=
26.62
;
}
}
let
index
=
4
;
if
(
left
<
6.59
)
{
if
(
left
<
6.59
)
{
i
ndex
=
1
;
colorI
ndex
=
1
;
}
else
if
(
left
>
6.59
&&
left
<
11
)
{
}
else
if
(
left
>
6.59
&&
left
<
11
)
{
i
ndex
=
2
;
colorI
ndex
=
2
;
}
else
if
(
left
>
11
&&
left
<
15.46
)
{
}
else
if
(
left
>
11
&&
left
<
15.46
)
{
i
ndex
=
3
;
colorI
ndex
=
3
;
}
else
if
(
left
>
15.46
&&
left
<
19.91
)
{
}
else
if
(
left
>
15.46
&&
left
<
19.91
)
{
i
ndex
=
4
;
colorI
ndex
=
4
;
}
else
if
(
left
>
19.91
&&
left
<
24.38
)
{
}
else
if
(
left
>
19.91
&&
left
<
24.38
)
{
i
ndex
=
5
;
colorI
ndex
=
5
;
}
else
if
(
left
>
24.38
)
{
}
else
if
(
left
>
24.38
)
{
i
ndex
=
6
;
colorI
ndex
=
6
;
}
}
$
(
'.personal-page'
).
css
(
'background'
,
colorList
[
mainColor
][
i
ndex
-
1
]);
$
(
'.personal-page'
).
css
(
'background'
,
colorList
[
mainColor
][
colorI
ndex
-
1
]);
$
(
'.personal-page .btn-choose-color'
).
css
(
'left'
,
left
+
'rem'
);
$
(
'.personal-page .btn-choose-color'
).
css
(
'left'
,
left
+
'rem'
);
startX
=
moveX
;
startX
=
moveX
;
...
...
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