-
Notifications
You must be signed in to change notification settings - Fork 1
/
script.js
23 lines (18 loc) · 837 Bytes
/
script.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
function randomDirection()
{
let colorDirection = ["to right","to left bottom","to left top","to bottom","to top","to right bottom","to right top","to left"];
return colorDirection[Math.floor(Math.random() * colorDirection.length)];;
}
function change(){
let fcolor = document.getElementById('fcolor').value;
let scolor = document.getElementById('scolor').value;
console.log(fcolor);
console.log(scolor);
colorDirection = ["to right","to left bottom","to left top","to bottom","to top","to right bottom","to right top","to left"];
randomGen = colorDirection[Math.floor(Math.random() * colorDirection.length)];
let bid = document.getElementById('bid');
bid.style.background = 'linear-gradient('+randomDirection()+','+fcolor+','+scolor+')';
}
window.onload = function(){
change();
}