-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
26 lines (20 loc) · 813 Bytes
/
main.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
/* ------------------------------------------ */
/* ------------------------------------------ */
/* ------------------------------------------ */
window.onscroll = function () {
myFunction();
};
function myFunction() {
var winScroll = document.body.scrollTop || document.documentElement.scrollTop;
var height =
document.documentElement.scrollHeight -
document.documentElement.clientHeight;
var scrolled = (winScroll / height) * 100;
document.getElementById("myBar").style.width = scrolled + "%";
}
/* ------------------------------------------ */
/* ------------------------------------------ */
/* ------------------------------------------ */
var actualYear = new Date().getFullYear();
var actualYearSpan = document.querySelector(".actual-year");
actualYearSpan.innerText = actualYear;