forked from KwickerHub/WebCraftifyAI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhelp.html
301 lines (253 loc) · 8.88 KB
/
help.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
<!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>Help Page</title>
<link rel="stylesheet" type="text/css" href="../assets/css/help.css">
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.0/css/all.min.css"
integrity="sha512-xh6O/CkQoPOWDdYTDqeRdPCVd1SpvCA9XXcUnZS2FmJNp1coAFzvtCN9BmamE+4aHK8yyUHUSCcJHgXloTyT2A=="
crossorigin="anonymous"
referrerpolicy="no-referrer"
/>
<link rel="stylesheet" href="faq-accordion.css" />
</head>
<body>
<div class="jumbotron jumbotron-fluid">
<div class="container">
<h1 class="display-4">HELP PAGE</h1>
<p class="lead">Frequently Asked Questions</p>
</div>
</div>
<div class="faq-container">
<div class="faq">
<div class="question-container">
<h2>Q. What is KwickerHub?</h2>
<div class="toggle-btn">
<p>+</p>
</div>
</div>
<div class="answer">
<p>A. KwickerHub is a platform where you cancreate UI templates easily.</p>
</div>
</div>
<div class="faq">
<div class="question-container">
<h2>Q. Is it free?</h2>
<div class="toggle-btn">
<p>+</p>
</div>
</div>
<div class="answer">
<p>A.Yes. It is free.</p>
</div>
</div>
<div class="faq">
<div class="question-container">
<h2>Q. Is it useful for any type of UI/UX?</h2>
<div class="toggle-btn">
<p>+</p>
</div>
</div>
<div class="answer">
<p>A. Yes.</p>
</div>
</div>
<div class="faq">
<div class="question-container">
<h2>Q. How to use KwickerHub?</h2>
<div class="toggle-btn">
<p>+</p>
</div>
</div>
<div class="answer">
<p>A. Follow the steps to use KwickerHub efficiently : </p>
</div>
</div>
<div class="faq">
<div class="question-container">
<h2>Q. How can I add tags?</h2>
<div class="toggle-btn">
<p>+</p>
</div>
</div>
<div class="answer">
<p>A. Follow the steps to add tags :</p>
</div>
</div>
</div>
</body>
</html>
<script>
const questionContainers = document.querySelectorAll('.question-container');
const answers = document.querySelectorAll('.answer');
let activeAnswer = answers[0];
// Adds the visible class to the first answer and rotate class to the first toggle button
questionContainers[0].querySelector('.toggle-btn p').classList.add('rotate');
activeAnswer.classList.add('visible');
questionContainers.forEach((container, index) => {
container.addEventListener('click', () => {
const answer = answers[index];
const toggleBtn = container.querySelector('.toggle-btn p');
if (activeAnswer !== null && activeAnswer !== answer) {
const activeToggleBtn = activeAnswer.previousElementSibling.querySelector('.toggle-btn p');
activeToggleBtn.classList.remove('rotate');
activeAnswer.classList.remove('visible');
}
toggleBtn.classList.toggle('rotate');
if (answer.classList.contains('visible')) {
answer.classList.remove('visible');
activeAnswer = null;
} else {
answers.forEach(a => {
a.classList.remove('visible');
});
answer.classList.add('visible');
activeAnswer = answer;
}
});
});
</script>
<section class="content">
<h3 class="content__heading">Ask a question</h1>
<form class="content__form contact-form">
<div class="testing">
<p>Does this do anything?</p>
</div>
<div class="contact-form__input-group">
<label class="contact-form__label" for="name">Name*</label>
<input class="contact-form__input contact-form__input--text" id="name" name="name" type="text"/>
</div>
<div class="contact-form__input-group">
<label class="contact-form__label" for="email">Email Address*</label>
<input class="contact-form__input contact-form__input--email" id="email" name="email" type="email"/>
</div>
<div class="contact-form__input-group">
<label class="contact-form__label" for="message">Enter a question</label>
<textarea class="contact-form__input contact-form__input--textarea" id="message" name="message" rows="6" cols="65"></textarea>
</div>
<input name="authentication" type="hidden" value="Token 1b3a9374-1a8e-434e-90ab-21aa7b9b80e7"/>
<div>
<input name:"query" type="hidden" id="demo" value="query:{}"/>
</div>
<button class="contact-form__button" type="submit">Submit</button>
</form>
</section>
<!-- <div class="results">
<h2 class="results__heading">Form Data</h2>
<pre class="results__display-wrapper"><code class="results__display"></code></pre>
</div> -->
<script>
const isValidElement = element => {
return element.name && element.value;
};
const getSelectValues = options =>
[].reduce.call(
options,
(values, option) => {
return option.selected ? values.concat(option.value) : values;
},
[]
);
*/
const formToJSON_deconstructed = elements => {
// This is the function that is called on each element of the array.
const reducerFunction = (data, element) => {
// Add the current field to the object.
data[element.name] = element.value;
// For the demo only: show each step in the reducer’s progress.
console.log(JSON.stringify(data));
return data;
};
// This is used as the initial value of `data` in `reducerFunction()`.
const reducerInitialValue = {};
// To help visualize what happens, log the inital value, which we know is `{}`.
console.log("Initial `data` value:", JSON.stringify(reducerInitialValue));
// Now we reduce by `call`-ing `Array.prototype.reduce()` on `elements`.
const formData = [].reduce.call(
elements,
reducerFunction,
reducerInitialValue
);
// The result is then returned for use elsewhere.
return formData;
};
/**
* Retrieves input data from a form and returns it as a JSON object.
* @param {HTMLFormControlsCollection} elements the form elements
* @return {Object} form data as an object literal
*/
const formToJSON = elements =>
[].reduce.call(
elements,
(data, element) => {
// Make sure the element has the required properties and should be added.
if (isValidElement(element) && isValidValue(element)) {
/*
* Some fields allow for more than one value, so we need to check if this
* is one of those fields and, if so, store the values as an array.
*/
if (isCheckbox(element)) {
data[element.name] = (data[element.name] || []).concat(element.value);
} else if (isMultiSelect(element)) {
data[element.name] = getSelectValues(element);
} else {
data[element.name] = element.value;
}
}
return data;
},
{}
);
/**
* A handler function to prevent default submission and run our custom script.
* @param {Event} event the submit event triggered by the user
* @return {void}
*/
const handleFormSubmit = event => {
// Stop the form from submitting since we’re handling that with AJAX.
event.preventDefault();
// Call our function to get the form data.
const data = formToJSON(form.elements);
// Demo only: print the form data onscreen as a formatted JSON object.
const dataContainer = document.getElementsByClassName("results__display")[0];
// Use `JSON.stringify()` to make the output valid, human-readable JSON.
dataContainer.textContent = JSON.stringify(data, null, " ");
// ...this is where we’d actually do something with the form data...
};
/*
* This is where things actually get started. We find the form element using
* its class name, then attach the `handleFormSubmit()` function to the
* `submit` event.
*/
var form = document.getElementsByClassName("contact-form")[0];
if (form){
form.addEventListener("submit", handleFormSubmit, false);
}
/* adding more background info to grab from user */
function myFunction() {
var z = document.getElementById("query").value;
var x = navigator.userAgent;
var y = Intl.DateTimeFormat().resolvedOptions().timeZone;
var obj = {"browser_timezone" : String(y),"user_agent" : String(x),"query": String(z)};
var myJSON = JSON.stringify(obj);
document.getElementById("demo").innerHTML = myJSON;
}
if(window.attachEvent) {
window.attachEvent('onload', myFunction);
} else {
if(window.onload) {
var curronload = window.onload;
var newonload = function(evt) {
curronload(evt);
myFunction(evt);
};
window.onload = newonload;
} else {
window.onload = myFunction;
}
}
</script>