-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpagescript.js
More file actions
65 lines (64 loc) · 1.61 KB
/
pagescript.js
File metadata and controls
65 lines (64 loc) · 1.61 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
61
62
63
64
65
var mode = document.querySelector(".mode")
var body = document.querySelector("body")
var searchbox = document.getElementById("id")
var fixed = document.querySelector(".fixed")
var box_color = document.querySelectorAll(".box_color_align")
var fruit_box = document.querySelector(".fruit_box")
var dark=false
function setMode()
{
if(dark)
{
body.style.backgroundColor = "#F0F2F5"
mode.style.backgroundColor = "#1d2129"
fixed.style.backgroundColor = "#b3b3b3"
box_color.forEach
(
(e)=>{
e.style.backgroundColor="#FFFFFF";
}
)
dark = false
}
else
{
body.style.backgroundColor = "#1d2129"
mode.style.backgroundColor = "#F0F2F5"
fixed.style.backgroundColor = "#ffa600"
box_color.forEach
(
(e)=>{
e.style.backgroundColor="#F0F2F5";
}
)
dark = true
}
}
// function addfruit()
// {
// fruit_box.innerHTML+=
// `<div class="fruit box_color_align">
// <h2 class="fruitname">R | 100</h2>
// <img src="icon.png" class="image">
// <button class="removebag">-</button>
// <button class="addbag">+</button>
// </div>"`
// }
// function display(e)
// {
// if(e.key==="Enter")
// {
// if(searchbox.value.length>0)
// {
// console.log(searchbox.value)
// addfruit()
// }
// }
// else
// {
// console.log(searchbox.value+e.key)
// addfruit()
// }
// }
// searchbox.addEventListener("keypress",display)
mode.addEventListener("click",setMode)