-
Notifications
You must be signed in to change notification settings - Fork 0
/
background.js
59 lines (51 loc) · 2.24 KB
/
background.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
48
49
50
51
52
53
54
55
56
57
58
59
// Function to change the background color to a gradient with black at the bottom
function changeBackgroundColor(color) {
document.body.style.background = `linear-gradient(${color}, black)`;
}
// Function to reset the background color to a specific button color and black when mouse leaves
function fadeToColor(color) {
document.body.style.background = `linear-gradient(${color}, black)`;
}
// Add event listeners for each button to handle hover events
document.getElementById("twitch").addEventListener("mouseover", function() {
changeBackgroundColor('#6441a5'); // Twitch purple
});
document.getElementById("twitch").addEventListener("mouseout", function() {
fadeToColor('#6441a5'); // Twitch purple
});
document.getElementById("twitter1").addEventListener("mouseover", function() {
changeBackgroundColor('#1da1f2'); // Twitter blue
});
document.getElementById("twitter1").addEventListener("mouseout", function() {
fadeToColor('#1da1f2'); // Twitter blue
});
document.getElementById("twitter2").addEventListener("mouseover", function() {
changeBackgroundColor('#1da1f2'); // Twitter blue
});
document.getElementById("twitter2").addEventListener("mouseout", function() {
fadeToColor('#1da1f2'); // Twitter blue
});
document.getElementById("youtube").addEventListener("mouseover", function() {
changeBackgroundColor('#ff0000'); // YouTube red
});
document.getElementById("youtube").addEventListener("mouseout", function() {
fadeToColor('#ff0000'); // YouTube red
});
document.getElementById("discord1").addEventListener("mouseover", function() {
changeBackgroundColor('#7289da'); // Discord blue
});
document.getElementById("discord1").addEventListener("mouseout", function() {
fadeToColor('#7289da'); // Discord blue
});
document.getElementById("discord2").addEventListener("mouseover", function() {
changeBackgroundColor('#7289da'); // Discord blue
});
document.getElementById("discord2").addEventListener("mouseout", function() {
fadeToColor('#7289da'); // Discord blue
});
document.getElementById("Github").addEventListener("mouseover", function() {
changeBackgroundColor('#333'); // GitHub black
});
document.getElementById("Github").addEventListener("mouseout", function() {
fadeToColor('#333'); // GitHub black
});