diff --git a/JS/index.js b/JS/index.js index 38ab17af..ad583431 100644 --- a/JS/index.js +++ b/JS/index.js @@ -40,3 +40,15 @@ async function fetchData() { setTimeout(() => { fetchData(); }, 1000); + + /* time-based greetings*/ + let container = document.querySelector(".container_greeting"); + let timeNow = new Date().getHours(); + let greeting = + timeNow >= 5 && timeNow < 12 + ? "Good Morning" + : timeNow >= 12 && timeNow < 18 + ? "Good Afternoon" + : "Good evening"; + container.innerHTML = `
CodeIN Community is a Community of more than 8,000+ Coding Enthusiasts, where we organize Open Source Programs, Hackathons, and Events on various emerging technologies and domains.