-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhelp.html
More file actions
181 lines (176 loc) Β· 8.5 KB
/
help.html
File metadata and controls
181 lines (176 loc) Β· 8.5 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
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>
<head>
<title>Mask Monitor</title>
<link rel="icon" href="images/icon2.png">
<!-- External Styles -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css" integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous">
<link rel="stylesheet" type="text/css" href="./semantic/dist/semantic.min.css">
<script src="https://www.google.com/recaptcha/api.js" async defer></script>
<link rel="stylesheet" href='styles/styles.css'>
<!-- External Scripts -->
<script type="text/javascript">
window.$ = window.jQuery = require('jquery'); //Require jquery
require('bootstrap'); //Require bootstrap
require('./render.js'); //Require render.js
require('fomantic-ui'); //Require Semantic
let emailjs = require('emailjs-com'); //Require email
function remClasses(element) {
element.removeClass("success error")
}
function submitForm() {
let error = false;
//Reset classes
remClasses($("#firstName").parent());
remClasses($("#lastName").parent());
remClasses($("#email").parent());
remClasses($("#issue").parent());
remClasses($("#checkbox").parent().parent());
remClasses($(".ui.massive.inverted.form"));
//Get first name
let firstName = $("#firstName").val();
if (!firstName) {
$("#firstName").parent().addClass("error");
error = true;
}
else {
$("#firstName").parent().addClass("success");
}
//Get last name
let lastName = $("#lastName").val();
if (!lastName) {
$("#lastName").parent().addClass("error");
error = true;
}
else {
$("#lastName").parent().addClass("success");
}
//Get email
let email = $("#email").val();
if (!email) {
$("#email").parent().addClass("error");
error = true;
}
else {
$("#email").parent().addClass("success");
}
//Issue
let issue = $("#issue").val();
if (!issue) {
$("#issue").parent().addClass("error");
error = true;
}
else {
$("#issue").parent().addClass("success");
}
//Check if checkbox is pressed
let checkbox = $("#checkbox").prop('checked');
if (!checkbox) {
$("#checkbox").parent().parent().addClass("error");
error = true;
}
else {
$("#checkbox").parent().parent().addClass("success");
}
//Change state of the entire form
if (error) {
$(".ui.massive.inverted.form").addClass("error");
return;
}
//On Success
let serviceID = "gmail";
let templateID = "template_jvivnk6N";
let templateParams = {
name: `${lastName}, ${firstName}`,
email: email,
issue: issue
};
let userID = "user_RxPbA4vA3eWHcISNVo1db";
emailjs.send(serviceID, templateID, templateParams, userID)
.then(function(response){
$(".ui.massive.inverted.form").addClass("success");
})
.catch(function(err) {
//alert("Something went wrong...");
})
}
$(document).ready(function(){
$(".ui.submit.button").click(submitForm);
});
</script>
</head>
<body id="body">
<!-------------------Title Bar ----------------->
<span id="titleBar" style="width: 100%; display: inline-block;"><p style="float:left; color:white; z-index: 1; position: absolute; margin:4px; margin-left: 10px; color:#8E9297;" >πππ¨π ππ€π£ππ©π€π§β’</p></span>
<!-------------------NAV BAR-------------------->
<nav class="navbar navbar-expand-lg navbar-dark" style="background-color: #36393F; border-bottom-style: solid; border-color: #2B2D32;" id="navigationBar">
<!--Brand name + logo -->
<a class="navbar-brand" href="#">
<img src="images/icon2.png" width="50" height="50" class="d-inline-block align-center" alt="" loading="lazy">
Mask Monitor
</a>
<!-- Expand Link Button -->
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNavAltMarkup" aria-controls="navbarNavAltMarkup" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<!-- Links -->
<div class="collapse navbar-collapse" id="navbarNavAltMarkup">
<div class="navbar-nav">
<a class="nav-item nav-link" href="index.html">Monitoring</span></a>
<a class="nav-item nav-link" href="reports.html">Logs and Reports</a>
<a class="nav-item nav-link active" href="help.html">Help</a>
</div>
</div>
</nav>
<!------------------- CONTENTS -------------------->
<div id="mainBody" style="text-align: center">
<div id="formContainer">
<div id="formContainerInner">
<div class="ui massive inverted form" style="display: inline-block;width: 50%;" >
<!--First and Last Name-->
<div class="two fields">
<div class="field">
<label>First Name</label>
<input id="firstName" placeholder="First Name" type="text">
</div>
<div class="field">
<label>Last Name</label>
<input id="lastName" placeholder="Last Name" type="text">
</div>
</div>
<!--Email Field -->
<div class="field">
<label>E-mail</label>
<input id="email" type="text" placeholder="joe@schmoe.com">
</div>
<!--Issue-->
<div class="field">
<label>What seems to be the issue?</label>
<textarea id="issue" rows="4"></textarea>
</div>
<!--Conditions-->
<div class="field">
<div class="ui checkbox">
<input id="checkbox" type="checkbox" tabindex="0">
<label>I agree to the Terms and Conditions</label>
</div>
</div>
<!--Success Message-->
<div class="ui success message">
<div class="header">Form Completed</div>
<p>You have submitted a support token. Our team will get to you as soon as possible!</p>
</div>
<!--Error Message -->
<div class="ui error message">
<div class="header">Action Forbidden</div>
<p>Please enter all necessay information.</p>
</div>
<!--Submit Token-->
<div class="ui submit button">Submit Support Ticket</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>