Log everything
This commit is contained in:
parent
6f2e43b65d
commit
dce2c99a7e
@ -21,8 +21,10 @@
|
|||||||
|
|
||||||
function bgColor() {
|
function bgColor() {
|
||||||
var p = ((window.innerHeight - window.scrollY) / window.innerHeight); //calulate ratio of scroll
|
var p = ((window.innerHeight - window.scrollY) / window.innerHeight); //calulate ratio of scroll
|
||||||
|
console.log(p);
|
||||||
x.innerHTML = " " + String(parseInt(p * 100)); //display it
|
x.innerHTML = " " + String(parseInt(p * 100)); //display it
|
||||||
var rgb = Math.floor(Math.abs(1 - p) * 255); //set the color
|
var rgb = Math.floor(Math.abs(1 - p) * 255); //set the color
|
||||||
|
console.log(rgb);
|
||||||
var colorString = "rgb(" + rgb + "," + rgb + "," + rgb + ")";
|
var colorString = "rgb(" + rgb + "," + rgb + "," + rgb + ")";
|
||||||
document.body.style.backgroundColor = colorString;
|
document.body.style.backgroundColor = colorString;
|
||||||
console.log(colorString);
|
console.log(colorString);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user