-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
46 lines (39 loc) · 1.53 KB
/
index.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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Greeter
function called() {
var time = new Date()
let timestamp = time.getHours()
var greet_user;
if (timestamp >= 0 && timestamp < 12){
greet_user = "Good Morning🤩";
}
else if (timestamp >=12 && timestamp < 16){
greet_user = "Good AfterNoon🥰";
}
else if (timestamp >=16 && timestamp < 19){
greet_user = "Good Evening😎";
}
else if (timestamp <24){
greet_user = "Good Night😴";
}
document.getElementById("greetings").innerText = "Hello, "+greet_user
}
// text color changer
function changColor(){
let list = ["red", "green", "yellow", "purple", "skyblue", "pink"]
let m = Math.random() * 5
console.log(parseInt(m))
document.getElementById("greetings").style.color = list[parseInt(m)]
document.getElementById("table").style.borderColor = list[parseInt(m)]
document.getElementById("greetme").style.color = list[parseInt(m)]
document.getElementById("changColor").style.color = list[parseInt(m)]
document.getElementById("changbackColor").style.color = list[parseInt(m)]
document.getElementById("about").style.color = list[parseInt(m)]
}
// background Color changer
function changBackgroundColor(){
let list = ["red", "green", "yellow", "purple", "skyblue", "pink"]
let m = Math.random() * 5
console.log(parseInt(m))
// document.getElementById("bck").style.backgroundColor = list[parseInt(m)]
document.getElementById("bck").style.background = background(linear-gradient("-45deg, #ee9952, #e74c7e, #29a6d5, #66d5ab"))
}