Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Corey Sheldon
weather
Commits
11ec6d9c
Commit
11ec6d9c
authored
Jan 25, 2017
by
Zach Knox
Browse files
moved the colors to the css classes
parent
66a6ea80
Changes
2
Show whitespace changes
Inline
Side-by-side
weather/client/main.css
View file @
11ec6d9c
...
...
@@ -55,37 +55,37 @@
}
.degree0.mdl-card
{
background-color
:
#
000000
;
background-color
:
#
6b469c
;
}
.degree10.mdl-card
{
background-color
:
#
222222
;
background-color
:
#
a0c9c1
;
}
.degree20.mdl-card
{
background-color
:
#
444444
;
background-color
:
#
3ec2cf
;
}
.degree30.mdl-card
{
background-color
:
#
666666
;
background-color
:
#
007dc5
;
}
.degree40.mdl-card
{
background-color
:
#
777777
;
background-color
:
#
425195
;
}
.degree50.mdl-card
{
background-color
:
#
888888
;
background-color
:
#
a39382
;
}
.degree60.mdl-card
{
background-color
:
#
999999
;
background-color
:
#
ffcc33
;
}
.degree70.mdl-card
{
background-color
:
#
aaaaaa
;
background-color
:
#
f7941e
;
}
.degree80.mdl-card
{
background-color
:
#
bbbbbb
;
background-color
:
#
f37021
;
}
.degree90.mdl-card
{
background-color
:
#
dddddd
;
background-color
:
#
ac1d37
;
}
.degree100.mdl-card
{
background-color
:
#
ffffff
;
background-color
:
#
a62380
;
}
.mdl-layout__tab-bar-right-button
{
background-color
:
#006633
;
...
...
weather/imports/api/color.js
deleted
100644 → 0
View file @
66a6ea80
//NOTES
//This file's main function will be called for each time of weather, evrey update.
//therefore this file needs to be optimiezed to be as fast as possible
//this is not implemented yet and just a proof of concept to start work
// will be implemented once we get live numbers to frontend
//HOW TO USE:
//Pass colorMain(type,deg);
//type(boolean) = farenheit or celcius
// true = farenheit
// false = celcius
//deg = degrees
//you will have a color in #111111 format returned
//main function
function
colorMain
(
type
,
deg
)
{
if
(
type
=
true
)
{
return
degToColor
(
deg
);
}
else
{
return
degToColor
(
convertToF
(
deg
));
}
}
//deg needs to be farenheit
function
degToColor
(
deg
)
{
switch
(
true
)
{
case
deg
<
10
:
text
=
"
#6b469c
"
;
break
;
case
deg
<
20
:
text
=
"
#a0c9c1
"
;
break
;
case
deg
<
30
:
text
=
"
#3ec2cf
"
;
break
;
case
deg
<
40
:
text
=
"
#007dc5
"
;
break
;
case
deg
<
50
:
text
=
"
#425195
"
;
break
;
case
deg
<
60
:
text
=
"
#a39382
"
;
break
;
case
deg
<
70
:
text
=
"
#ffcc33
"
;
break
;
case
deg
<
80
:
text
=
"
#f7941e
"
;
break
;
case
deg
<
90
:
text
=
"
#f37021
"
;
break
;
case
deg
<
100
:
text
=
"
#ac1d37
"
;
break
;
case
deg
>
100
:
text
=
"
#a62380
"
;
break
;
default
:
text
=
"
#F433FF
"
;
}
return
text
;
}
function
convertToF
(
CDeg
){
//a possible widely used function
Fdeg
=
Cdeg
*
(
9
/
5
)
+
32
;
return
Fdeg
;
}
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