-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontact.html
317 lines (267 loc) · 10.7 KB
/
contact.html
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
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>EXAM API</title>
<link rel="stylesheet" href="/css/all.min.css">
<link rel="stylesheet" href="/css/bootstrap.min.css">
<link rel="stylesheet" href="/css/style.css ">
<link rel="stylesheet" href="/css/responsive.css">
<link href="https://unpkg.com/aos@2.3.1/dist/aos.css" rel="stylesheet">
</head>
<body>
<aside class="aside-nav">
<div>
<div class="asideNav-inner">
<ul class="navList flex-column-center">
<li class="nav-item" id=""><a href="search.html" movieCategory="popular" class="navLink">Search</a></li>
<li class="nav-item" id="categories"><a href="categories.html" movieCategory="top_rated" class="navLink">Categories</a></li>
<li class="nav-item"><a href="area.html" movieCategory="trending" class="navLink">Area</a></li>
<li class="nav-item"><a href="ingredients.html" movieCategory="upcoming" class="navLink">Ingredients</a></li>
<li class="nav-item"><a href="contact.html" class="navLink">Contact US</a></li>
</ul>
<div class="bottom-div text-white">
<i class="fa-brands fa-facebook"></i>
<i class="fa-brands fa-twitter"></i>
<i class="fas fa-globe"></i>
<p class="text-white mt-3">Copyright © 2019 All Rights Reserved.
</p>
</div>
</div>
</div>
<div class="asideNav-outer">
<div class="logo">
<img src="/img/logo.png" alt=""class="w-75 ps-2">
</div>
<div class="open-btn">
<i class="fa fa-align-justify text-black fs-3"></i>
</div>
<div class="icons text-black ">
<div class="strip-lang">
<span>
<i class="fas fa-globe "></i>
</span>
</div>
<div class="strip-share">
<span>
<i class="fas fa-share-alt"></i>
</span>
</div>
</div>
</div>
</div>
</aside>
<main>
<div class="container py-3 g-1 main-container">
<div class="contact"></div>
<div id="row"></div>
</div>
</main>
<script src="/js/jquery-3.6.1.min.js"></script>
<script src="/js/bootstrap.bundle.min.js"></script>
<script>
$("html, body").animate({
scrollTop: 0
}, 200)
row.innerHTML = `
<section id="contact" class="container myM w-75 mx-auto mt-5 ">
<div class="p-2">
<h2 class="text-light mb-5">ContacUs...</h2>
<div class="row">
<div class="col-md-6">
<div class="form-group mb-4">
<input class="form-control text-light bg-transparent border-0 border-bottom shadow " onkeyup="validation()" id="name"
placeholder="Enter Your Name">
<div class="alert mt-1 alert-danger d-none" id="namealert" role="alert">
Special Characters and Numbers not allowed
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group mb-4">
<input onkeyup="validation()" class="form-control text-light bg-transparent border-0 border-bottom" id="email" placeholder="Enter Email">
<div class="alert mt-1 alert-danger d-none" id="emailalert" role="alert">
Enter valid email. *Ex: xxx@yyy.zzz
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group mb-4">
<input onkeyup="validation()" class="form-control text-light bg-transparent border-0 border-bottom" id="phone" placeholder="Enter phone">
<div class="alert mt-1 alert-danger d-none" id="phonealert" role="alert">
Enter valid Phone Number
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group mb-4">
<input onkeyup="validation()" class="form-control text-light bg-transparent border-0 border-bottom" id="age" placeholder="Enter Age">
<div class="alert mt-1 alert-danger d-none" id="agealert" role="alert">
Enter valid Age
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group mb-4">
<input onkeyup="validation()" class="form-control text-light bg-transparent border-0 border-bottom" type="password" id="password"
placeholder="Enter Password">
<div class="alert mt-1 alert-danger d-none" id="passwordalert" role="alert">
Enter valid password *Minimum eight characters, at least one letter and one number:*
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group mb-4">
<input onkeyup="validation()" class="form-control text-light bg-transparent border-0 border-bottom" type="password" id="rePassword"
placeholder="Enter RePassword">
<div class="alert mt-1 alert-danger d-none" id="repasswordalert" role="alert">
Enter valid Repassword
</div>
</div>
</div>
</div>
<button type="submit" id="submitBtn" class="btn btn-success w-100">Submit</button>
</div>
</section>`
userName = document.getElementById("name"),
userEmail = document.getElementById("email"),
userPhone = document.getElementById("phone"),
userAge = document.getElementById("age"),
userPassword = document.getElementById("password"),
userRePassword = document.getElementById("rePassword"),
userNameAlert = document.getElementById("namealert"),
userEmailAlert = document.getElementById("emailalert"),
userPhoneAlert = document.getElementById("phonealert"),
userAgeAlert = document.getElementById("agealert"),
userpasswordAlert = document.getElementById("passwordalert"),
userRepasswordAlert = document.getElementById("repasswordalert");
userName.addEventListener("focus", () => {
nameToached = true
})
userEmail.addEventListener("focus", () => {
emailToached = true
})
userPhone.addEventListener("focus", () => {
phoneToached = true
})
userAge.addEventListener("focus", () => {
ageToached = true
})
userPassword.addEventListener("focus", () => {
passwordToached = true
})
userRePassword.addEventListener("focus", () => {
repasswordToached = true
})
$(document).scroll((e) => {
if ($(document).scrollTop()) {
$(".mmm").css("backgroundColor", "#0D0D0D")
}
})
let nameToached = false,
emailToached = false,
phoneToached = false,
ageToached = false,
passwordToached = false,
repasswordToached = false;
function validation() {
if (nameToached) {
if (userNameValid()) {
userName.classList.remove("is-invalid")
userName.classList.add("is-valid")
userNameAlert.classList.replace("d-block", "d-none")
userNameAlert.classList.replace("d-block", "d-none")
} else {
userName.classList.replace("is-valid", "is-invalid")
userNameAlert.classList.replace("d-none", "d-block")
}
}
if (emailToached) {
if (userEmailValid()) {
userEmail.classList.remove("is-invalid")
userEmail.classList.add("is-valid")
userEmailAlert.classList.replace("d-block", "d-none")
userEmailAlert.classList.replace("d-block", "d-none")
} else {
userEmail.classList.replace("is-valid", "is-invalid")
userEmailAlert.classList.replace("d-none", "d-block")
}
}
if (phoneToached) {
if (userPhoneValid()) {
userPhone.classList.remove("is-invalid")
userPhone.classList.add("is-valid")
userPhoneAlert.classList.replace("d-block", "d-none")
userPhoneAlert.classList.replace("d-block", "d-none")
} else {
userPhone.classList.replace("is-valid", "is-invalid")
userPhoneAlert.classList.replace("d-none", "d-block")
}
}
if (ageToached) {
if (userAgeValid()) {
userAge.classList.remove("is-invalid")
userAge.classList.add("is-valid")
userAgeAlert.classList.replace("d-block", "d-none")
userAgeAlert.classList.replace("d-block", "d-none")
} else {
userAge.classList.replace("is-valid", "is-invalid")
userAgeAlert.classList.replace("d-none", "d-block")
}
}
if (passwordToached) {
if (userPasswordValid()) {
userPassword.classList.remove("is-invalid")
userPassword.classList.add("is-valid")
userpasswordAlert.classList.replace("d-block", "d-none")
userpasswordAlert.classList.replace("d-block", "d-none")
} else {
userPassword.classList.replace("is-valid", "is-invalid")
userpasswordAlert.classList.replace("d-none", "d-block")
}
}
if (repasswordToached) {
if (userRePasswordValid()) {
userRePassword.classList.remove("is-invalid")
userRePassword.classList.add("is-valid")
userRepasswordAlert.classList.replace("d-block", "d-none")
userRepasswordAlert.classList.replace("d-block", "d-none")
} else {
userRePassword.classList.replace("is-valid", "is-invalid")
userRepasswordAlert.classList.replace("d-none", "d-block")
}
}
if(userNameValid() && userEmailValid() && userPhoneValid() && userAgeValid() && userPasswordValid() && userRePasswordValid()){
document.getElementById("submitBtn").removeAttribute("disabled")
}else{
document.getElementById("submitBtn").setAttribute("disabled","true")
}
}
function userNameValid() {
return /^[a-zA-Z ]+$/.test(userName.value)
}
function userEmailValid() {
return /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(userEmail.value)
}
function userPhoneValid() {
return /^[\+]?[(]?[0-9]{3}[)]?[-\s\.]?[0-9]{3}[-\s\.]?[0-9]{4,6}$/.test(userPhone.value)
}
function userAgeValid() {
return /^[1-9][0-9]?$|^100$/.test(userAge.value)
}
function userPasswordValid() {
return /^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d]{8,}$/.test(userPassword.value)
}
function userRePasswordValid() {
return userPassword.value == userRePassword.value
}
</script>
<script>
AOS.init();
</script>
<script src="/js/main.js"></script>
<script src="https://unpkg.com/aos@2.3.1/dist/aos.js"></script>
</body>
</html>