Skip to content

Commit

Permalink
Update script.js
Browse files Browse the repository at this point in the history
  • Loading branch information
AD9190 authored Aug 26, 2023
1 parent 995f374 commit 4fa586c
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion script.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
let text = document.getElementById("text");
let fg= document.getElementById("fg");
let water = document.getElementById("water");
let sky = document.getElementById("sky");
window.addEventListener('scroll',() =>
{
let value = window.scrollY;


text.style.marginTop= value*2.5+'px';
}
fg.style.top = value*-1.5+'px';
fg.style.left = value*-1.5+'px';
sky.style.left = value*1.5+'px';
water.style.right = value*-1.5+'px';


}
);

0 comments on commit 4fa586c

Please sign in to comment.