forked from NageshMandal/STARBUCKS_Landing_Page
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
40 lines (34 loc) · 1.09 KB
/
script.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
const headerBtn = document.querySelectorAll(".header-btn");
const activeColor = document.querySelector(".active-color");
function imgSlider(anything) {
document.querySelector(".starbucks").src = anything;
}
function changeCircleColor(color) {
const circle = document.querySelector(".circle");
circle.style.background = color;
}
function textColor(color) {
const circle = document.querySelector("span");
circle.style.color = color;
}
function buttonColor(color) {
const circle = document.querySelector(".textbox a");
circle.style.background = color;
}
function listColor(color) {
const circle = document.querySelector("header ul li a:hover");
header.style.background = color;
}
//! CHANGE BUTOTN COLOR WHEN THEME IS CHANGED
let currentColor;
headerBtn.forEach(function (e) {
e.addEventListener("mouseover", function () {
currentColor = activeColor.style.background;
e.style.background = `${currentColor}`;
});
});
headerBtn.forEach(function (e) {
e.addEventListener("mouseout", function () {
e.style.background = "transparent";
});
});