Add Time & Date

This commit is contained in:
Sam 2022-08-25 12:28:12 +03:00 committed by GitHub
parent 47b884f8ef
commit 3826f09376
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,4 +1,4 @@
// Time
// Countdown
const body = document.body;
const endTime = new Date('9 13 2022 23:59:59');
@ -22,11 +22,14 @@ function updateCountdown() {
secondsEl.innerHTML = seconds < 10 ? '0'+seconds : seconds;
}
// Data
const time = new Date();
document.getElementById("date").innerHTML = time;
// scroll To Top
// Time & Date
setInterval(function(){
document.getElementById('date').innerHTML = Date();
},1000);
// scroll To Top
let scrollTop = document.querySelector('.scrollTop');
window.onscroll = function (){
@ -37,4 +40,4 @@ scrollTop.onclick = function(){
top: 0,
behavior:'smooth'
});
};
};