-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathmain.js
More file actions
60 lines (53 loc) · 1.23 KB
/
main.js
File metadata and controls
60 lines (53 loc) · 1.23 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
let h, s, l;
const helloInDifLanguage = [
"Ahlan",
"Zdrasti",
"Hey",
"Salut",
"Hallo",
"Salam!",
"Ciao",
"Oi",
"Hei",
"Selam",
"Helo",
"Yasou",
];
let sayHello;
let helloStyle = document.querySelector("#hello-container");
function getRandomHello() {
sayHello = helloInDifLanguage[Math.floor(Math.random() * 12)];
}
function displayHello() {
getRandomHello();
helloStyle.innerHTML = sayHello;
helloStyle.style.color = `hsl(${h + 180}, ${s}%, ${l}%)`;
}
function randomHSLValues() {
h = Math.floor(Math.random() * 360);
s = Math.floor(Math.random() * 21 + 80);
l = Math.floor(Math.random() * 11 + 55);
}
function executeHello() {
setTimeout(function () {
changeColor();
displayHello();
console.log(sayHello);
executeHello();
}, 3000);
}
executeHello();
let selectBody = document.querySelector("body");
function changeColor() {
randomHSLValues();
helloStyle.style.background = `hsl(${h}, ${s}%, ${l}%)`;
helloStyle.style.borderColor = `hsl(${h}, ${s-10}%, ${l-20}%)`;
}
function handleClick() {
console.log('first button was clicked 🚀')
}
var btn = document.querySelector('first-btn')
// btn.addEventListener('click', handleClick)
function conflictsAreUgly() {
console.log('🙏')
}