-
Notifications
You must be signed in to change notification settings - Fork 0
/
colourgradientv2.js
46 lines (39 loc) · 1.05 KB
/
colourgradientv2.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
var ids = ["one", "two", "three", "four", "five", "six", "seven", "eight"];
var whichID = ["false", "false", "false", "false", "false", "false", "false", "false"];
var choice = [8];
function makeGradient() {
document.getElementById('bigbox').style.background = `linear-gradient(to right, ${retrieveColour(colourOne)}, ${retrieveColour(colourTwo)})`;
}
function retrieveColour(colour) {
return document.defaultView.getComputedStyle(document.getElementById(colour)).getPropertyValue("background-color");
}
function doReset() {
for (var i = 0; i < choice.length; i++){
choice[i] = null;
}
document.getElementById('bigbox').style.background='white'
}
function setOne() {
choice[0] == 1;
}
function setTwo() {
choice[0] == 2;
}
function setThree() {
choice[0] == 3;
}
function setFour() {
choice[0] == 4;
}
function setFive() {
choice[0] == 5;
}
function setSix() {
choice[0] == 6;
}
function setSeven() {
choice[0] == 7;
}
function setEight() {
choice[0] == 8;
}