-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmainscript.js
47 lines (38 loc) · 1.15 KB
/
mainscript.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
47
"use strict";
const body = document.body;
let lion = document.getElementById("lion");
let snake = document.getElementById("snake");
let raven = document.getElementById("raven");
let title1 = document.getElementById("title1");
let title2 = document.getElementById("title2");
let title3 = document.getElementById("title3");
function returnBg() {
body.style.background = "#06181f";
}
lion.addEventListener('mousemove', () => {
body.style.background = "red";
title1.style.visibility = "visible";
title1.style.color = "yellow";
})
lion.addEventListener('mouseout', () => {
title1.style.visibility = "hidden";
returnBg();
})
snake.addEventListener('mousemove', () => {
body.style.background = "green";
title2.style.visibility = "visible";
title2.style.color = "white";
})
snake.addEventListener('mouseout', () => {
returnBg();
title2.style.visibility = "hidden";
})
raven.addEventListener("mousemove", () => {
body.style.background = "blue";
title3.style.visibility = "visible";
title3.style.color = "white";
})
raven.addEventListener('mouseout', () => {
returnBg();
title3.style.visibility = "hidden";
})