Repository navigation
Expand file tree
/
Copy pathhome.js
More file actions
119 lines (115 loc) · 3.87 KB
/
Copy pathhome.js
File metadata and controls
119 lines (115 loc) · 3.87 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
// Triggrer kelas aktif navbar
const navbarList = document.querySelector('.list');
// saat di click
document.querySelector('#hamburger').onclick = (e) => {
navbarList.classList.toggle('active');
e.preventDefault();
};
// Triggrer kelas aktif search box
const searchForm = document.querySelector('.search-form');
const searchBox = document.querySelector('#search-box');
// saat di click
document.querySelector('#search-button').onclick = (e) => {
searchForm.classList.toggle('nyala');
searchBox.focus();
e.preventDefault();
};
// Triggrer kelas aktif shopping cart
const ShoppingCart = document.querySelector('.shopping-cart');
// saat di click
document.querySelector('#cart-button').onclick = (e) => {
ShoppingCart.classList.toggle('on');
e.preventDefault();
};
//modal box
const itemModal = document.querySelector('#item-modal');
const itemModal2 = document.querySelector('#item-modal2');
const itemModal3 = document.querySelector('#item-modal3');
const itemModal4 = document.querySelector('#item-modal4');
const itemModal5 = document.querySelector('#item-modal5');
const itemModal6 = document.querySelector('#item-modal6');
const itemModal7 = document.querySelector('#item-modal7');
const itemModal8 = document.querySelector('#item-modal8');
const itemModal9 = document.querySelector('#item-modal9');
const itemButton = document.querySelector('.item-detail-button');
const itemButton2 = document.querySelector('.item-detail-button2');
const itemButton3 = document.querySelector('.item-detail-button3');
const itemButton4 = document.querySelector('.item-detail-button4');
const itemButton5 = document.querySelector('.item-detail-button5');
const itemButton6 = document.querySelector('.item-detail-button6');
const itemButton7 = document.querySelector('.item-detail-button7');
const itemButton8 = document.querySelector('.item-detail-button8');
const itemButton9 = document.querySelector('.item-detail-button9');
itemButton.onclick = (e) => {
itemModal.style.display = 'flex';
e.preventDefault();
};
itemButton2.onclick = (e) => {
itemModal2.style.display = 'flex';
e.preventDefault();
};
itemButton3.onclick = (e) => {
itemModal3.style.display = 'flex';
e.preventDefault();
};
itemButton4.onclick = (e) => {
itemModal4.style.display = 'flex';
e.preventDefault();
};
itemButton5.onclick = (e) => {
itemModal5.style.display = 'flex';
e.preventDefault();
};
itemButton6.onclick = (e) => {
itemModal6.style.display = 'flex';
e.preventDefault();
};
itemButton7.onclick = (e) => {
itemModal7.style.display = 'flex';
e.preventDefault();
};
itemButton8.onclick = (e) => {
itemModal8.style.display = 'flex';
e.preventDefault();
};
itemButton9.onclick = (e) => {
itemModal9.style.display = 'flex';
e.preventDefault();
};
//close modal box
document.querySelector('.modal .close-icon').onclick = (e) => {
itemModal.style.display = 'none';
e.preventDefault();
};
document.querySelector('#item-modal2 .close-icon').onclick = (e) => {
itemModal2.style.display = 'none';
e.preventDefault();
};
document.querySelector('#item-modal3 .close-icon').onclick = (e) => {
itemModal3.style.display = 'none';
e.preventDefault();
};
document.querySelector('#item-modal4 .close-icon').onclick = (e) => {
itemModal4.style.display = 'none';
e.preventDefault();
};
document.querySelector('#item-modal5 .close-icon').onclick = (e) => {
itemModal5.style.display = 'none';
e.preventDefault();
};
document.querySelector('#item-modal6 .close-icon').onclick = (e) => {
itemModal6.style.display = 'none';
e.preventDefault();
};
document.querySelector('#item-modal7 .close-icon').onclick = (e) => {
itemModal7.style.display = 'none';
e.preventDefault();
};
document.querySelector('#item-modal8 .close-icon').onclick = (e) => {
itemModal8.style.display = 'none';
e.preventDefault();
};
document.querySelector('#item-modal9 .close-icon').onclick = (e) => {
itemModal9.style.display = 'none';
e.preventDefault();
};