This repository has been archived by the owner on Jan 23, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain1.js
194 lines (133 loc) · 4.57 KB
/
main1.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
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
document.addEventListener("DOMContentLoaded", function() {
const myTimeout = setTimeout(myGreeting, 1000);
function myGreeting() {
document.getElementById("welcome-text").innerHTML = "Welcome"
};
const myTimeout1 = setTimeout(myGreeting1, 2000);
function myGreeting1() {
document.getElementById("welcome-text").innerHTML = "to"
};
const myTimeout2 = setTimeout(myGreeting2, 3000);
function myGreeting2() {
document.getElementById("welcome-text").innerHTML = "Pixel"
};
const myTimeout3 = setTimeout(myGreeting3, 4000);
function myGreeting3() {
document.getElementById("welcome-text").innerHTML = "Quest"
};
const myTimeout4 = setTimeout(myGreeting4, 5000);
function myGreeting4() {
document.getElementById("welcome-text").innerHTML = ""
};
});
const navMenu = document.getElementById('nav__menu'),
navToggle = document.getElementById('nav__toggle'),
navClose = document.getElementById('nav__close')
navToggle.addEventListener('click', () =>{
navMenu.classList.add('show-menu')
})
navClose.addEventListener('click', () =>{
navMenu.classList.remove('show-menu')
})
const search = document.getElementById('search'),
searchBtn = document.getElementById('search-btn'),
searchClose = document.getElementById('search-close')
searchBtn.addEventListener('click', () =>{
search.classList.add('show-search')
})
searchClose.addEventListener('click', () =>{
search.classList.remove('show-search')
})
const login = document.getElementById('login'),
loginBtn = document.getElementById('login-btn'),
loginClose = document.getElementById('login-close')
loginBtn.addEventListener('click', () =>{
login.classList.add('show-login')
})
loginClose.addEventListener('click', () =>{
login.classList.remove('show-login')
})
// document.getElementById('loginform').addEventListener("submit", (event)=>{
// event.preventDefault()
// })
// var swiper = new Swiper(".slide_content", {
// slidesPerView: 1,
// spaceBetween: 30,
// loop: true,
// pagination: {
// el: ".swiper-pagination",
// clickable: true,
// },
// navigation: {
// nextEl: ".swiper-button-next",
// prevEl: ".swiper-button-prev",
// },
// })
// document.getElementById('open_preview').addEventListener('click', function() {
// var container = document.getElementById('1preview');
// container.classList.toggle('preview');
// });
// function openWin() {
// window.open("about NFTs.html");
// }
function fadeOutPage() {
document.body.classList.add('fade-out');
setTimeout(function() {
window.location.href = "about NFTs.html";
}, 600);
}
const contact = document.getElementById('contact'),
contactBtn = document.getElementById('uscontact'),
contactClose = document.getElementById('contact-close')
contactBtn.addEventListener('click', () =>{
contact.classList.add('show-contact')
})
contactClose.addEventListener('click', () =>{
contact.classList.remove('show-contact')
})
const cart = document.getElementById('cart'),
cartBtn = document.getElementById('shopping_cart');
cartClose= document.getElementById('cart_close')
cartBtn.addEventListener('click', () =>{
cart.classList.add('show-cart')
})
cartClose.addEventListener('click', () =>{
cart.classList.remove('show-cart')
})
let slideIndex = 1;
showSlides(slideIndex);
// Next/previous controls
function plusSlides(n) {
showSlides(slideIndex += n);
}
// Thumbnail image controls
function currentSlide(n) {
showSlides(slideIndex = n);
}
function showSlides(n) {
let i;
let slides = document.getElementsByClassName("mySlides");
let dots = document.getElementsByClassName("dot");
if (n > slides.length) {slideIndex = 1}
if (n < 1) {slideIndex = slides.length}
for (i = 0; i < slides.length; i++) {
slides[i].style.display = "none";
}
for (i = 0; i < dots.length; i++) {
dots[i].className = dots[i].className.replace(" active", "");
}
slides[slideIndex-1].style.display = "block";
dots[slideIndex-1].className += " active";
}
function myCustomer() {
let person = prompt("Please enter your name", "Harry Potter");
window.open("customer.html");
}
function changeIconColor(icon) {
var currentColor = icon.style.color;
if (currentColor === "red") {
icon.style.color = "#f1f1f1";
} else {
icon.style.color = "red";
}
}