-
Notifications
You must be signed in to change notification settings - Fork 0
/
inputPage.html
181 lines (152 loc) · 6.87 KB
/
inputPage.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.5/css/bulma.min.css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.1/css/all.css"
integrity="sha384-50oBUHEmvpQ+1lW4y57PTFmhCaXp0ML5d60M1M7uH2+nqUivzIebhndOJK28anvf" crossorigin="anonymous" />
<link rel="stylesheet" href="style.css">
<link href="https://fonts.googleapis.com/css?family=Mansalva&display=swap" rel="stylesheet">
<link rel='icon' href='Pizzacon.ico' type='image/x-icon'/>
<title>Eat Our Pizza Pizzeria</title>
</head>
<body>
<!-- Navbar start -->
<nav class="navbar is-danger" role="navigation" aria-label="main navigation">
<div class="navbar-brand">
<p class="navbar-item">
<span class="icon is-medium"><i class="fas fa-pizza-slice" aria-hidden="true"></i></span>
</p>
<a role="button" class="navbar-burger burger" aria-label="menu" aria-expanded="false"
data-target="navbarBasicExample">
<span aria-hidden="true"></span>
<span aria-hidden="true"></span>
<span aria-hidden="true"></span>
</a>
</div>
<div id="navbarBasicExample" class="navbar-menu">
<div class="navbar-start">
<a class="navbar-item" href="./index.html">
Home
</a>
<a class="navbar-item" href="./inputPages.html">
Order Online
</a>
<a class="navbar-item" href="./menuMain.html">
Menu
</a>
<a class="navbar-item" href="./confirmation.html">
Confirmation
</a>
<p class="navbar-item is-size-1 has-text-weight-bold headerText">
Eat Our Pizza Pizzeria
</p>
</div>
</div>
</nav>
<!-- Navbar End -->
<div class="container" style="padding-top: 5px; padding-bottom: 5px;">
<div class="notification is-danger">
<button class="delete"></button>
Email is <strong>NOT</strong> Valid. Please enter another one.
</div>
</div>
<div class="card container">
<div class="card-image">
<figure class="image is-2by1">
<img src="https://i.imgur.com/VUEGlFp.jpg" alt="Placeholder image">
</figure>
</div>
<div class="card-content is-overlay has-text-light">
<span class="is-size2 has-text-weight-bold"></span>
<!-- card body start -->
<br>
<div class="container">
<div class="card">
<div class="columns is-centered">
<div class="column is-three-fifths">
<div class="field">
<label class="label">Full Name</label>
<div class="control">
<input id="name" class="input is-danger" type="text" placeholder="e.g Alex Smith">
</div>
<p id="nameBlank" class="help is-danger">Cannot leave this field blank</p>
</div>
<div class="field">
<label class="label">Email</label>
<div class="control">
<input id="email" class="input is-danger" type="email" placeholder="e.g. [email protected]">
</div>
<p id="emailBlank" class="help is-danger">Cannot leave this field blank</p>
</div>
<div>
<button class="button headerText header has-background-danger is-size-3 pizzaBtn" type="submit" id="validate"><strong>CONTINUE FOR PIZZA OPTIONS </strong><i class="fas fa-arrow-right"></i></button>
</div>
</div>
</div>
</div>
</div>
<br>
<!-- card body end -->
</div>
</div>
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.24.0/moment.min.js"></script>
<script type="text/javascript">
$("#emailBlank").hide();
$("#nameBlank").css('display','none');
$(".notification").css('display','none');
document.addEventListener('DOMContentLoaded', () => {
(document.querySelectorAll('.notification .delete') || []).forEach(($delete) => {
$notification = $delete.parentNode;
$delete.addEventListener('click', () => {
$(".notification").css('display','none');
});
});
});
$("#validate").on("click",function(){
if ($("#email").val() == '') {
$("#emailBlank").show();
}
if ($("#name").val() == '') {
$("#nameBlank").show();
}
let email = $("#email").val();
let name = $("#name").val();
if (email) {
let settings = {
"async": true,
"crossDomain": true,
"url": "https://pozzad-email-validator.p.rapidapi.com/emailvalidator/validateEmail/"+email,
"method": "GET",
"headers": {
"x-rapidapi-host": "pozzad-email-validator.p.rapidapi.com",
"x-rapidapi-key": "6f16f230aemsh31b9ddf6fefd32fp16bb58jsned0ecf0fe85c"
}
}
$.ajax(settings).done(function (response) {
$("#email").val('');
if (response.isValid) {
let order = JSON.parse(localStorage.getItem("order"));
order.name = name;
order.email = email;
localStorage.setItem("order",JSON.stringify(order));
// localStorage.setItem("name",name);
// localStorage.setItem("email",email);
window.location='./menu1.html';
}
else {
$(".notification").show();
$("#emailBlank").hide();
$("#nameBlank").css('display','none');
$("#email").val('');
$("#name").val('');
}
});
}
});
</script>
</body>
</html>