-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
483 lines (453 loc) · 26.2 KB
/
index.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
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
<!doctype html>
<html lang="en">
<head>
<title>Starshop</title>
<!-- Required meta tags -->
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<!-- bootstrap -->
<link rel="stylesheet" href="css/bootstrap-dark.css">
<link href="css/custom.css" rel="stylesheet">
<!-- icons -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.min.css">
<link rel="icon" href="assets/icons/stars.png">
<!-- handlebars -->
<script src="js/handlebars.min-v4.7.8.js"></script>
<script src="js/vanilla.js"></script>
<script src="js/filter.js"></script>
<script>
/**
* Calculates the number of items in the data and finds the maximum and minimum values of the "Distance" property.
* @param {Array<Object>} data - An array of objects to process.
* @returns {Object} An object containing the length of the data array, the maximum "Distance" value, and the minimum "Distance" value.
*/
function numItems(data) {
length = data.length
var maxValue = -Infinity
var minValue = Infinity
var maxValuePrice = -Infinity
var minValuePrice = Infinity
for (let i = 0; i < length; i++) {
const item = data[i]
if (item.hasOwnProperty("Distance")) {
maxValue = Math.max(maxValue, item["Distance"])
minValue = Math.min(minValue, item["Distance"])
}
}
for (let i = 0; i < length; i++) {
const item = data[i]
if (item.hasOwnProperty("Price")) {
maxValuePrice = Math.max(maxValuePrice, item["Price"])
minValuePrice = Math.min(minValuePrice, item["Price"])
}
}
var returnDict = { "length": length, "max": maxValue, "min": minValue, "maxPrice": maxValuePrice, "minPrice": minValuePrice }
return returnDict
}
function init() {
render({}, '[type="text/x-handlebars-navbar"]')
render({}, '[type="text/x-handlebars-footer"]')
render(colors, '[type="text/x-handlebars-colors"]')
render({}, '[type="text/x-handlebars-navbar"]')
render({}, '[type="text/x-handlebars-footer"]')
$on($('#bestellen'), 'click', toSession)
var data = localStorage.getItem("data")
if (data !== null) {
var dict = JSON.parse(data)
render(numItems(dict), '[type="text/x-handlebars-template"]')
} else {
fetch('data/hygfull.json')
.then(response => response.json())
.then(data => {
localStorage.setItem("data", JSON.stringify(data))
render(numItems(data), '[type="text/x-handlebars-template"]')
})
.catch(error => console.error('Error fetching JSON file:', error))
}
}
/**
* Handles form submission by storing form data in session storage and redirecting to support.html.
*/
function toSession() {
// Selects the support submission form
const form = document.querySelector('.needs-validation')
// adds an eventlistener to the Submission form
form.addEventListener('submit', event => {
// if the form is not valid, the submit action is stopped
if (!form.checkValidity()) {
event.preventDefault()
event.stopPropagation()
}
else {
// saves all the relevant information from the support submission form to session Storage
const email = document.getElementById('email');
const name = document.getElementById('name');
const subject = document.getElementById('subject');
const question = document.getElementById('question');
const submission = {
"email": email.value,
"name": name.value,
"subject": subject.value,
"question": question.value
}
sessionStorage.setItem("supportSubmission", JSON.stringify(submission))
// redirect to the support.html to review the sent submission
location.replace("support.html")
}
form.classList.add('was-validated')
}, false)
}
</script>
</head>
<body>
<body onload="init()">
<script>
</script>
<script id="template" type="text/x-handlebars-navbar">
{{> navbar }}
</script>
<div></div>
<div class="parallax" id="parallax1">
<div class="parallax-text-white">
Choose any Star...
</div>
</div>
<div id="about" class="info-section border-top border-bottom text-center">
<div class="container ">
<div class="container">
<div class="row justify-content-center ">
<div class="col-lg-8">
<div class="card my-2 border-0 ">
<div class="card-body">
<script id="template" type="text/x-handlebars-template">
<li class="list-group-item text-center">
<h3 class="display-6">Over <strong>{{length}}</strong> stars available</h3>
</li>
<li class="list-group-item text-center">
<h3 class="display-6 "> <strong>{{min}}</strong> to <strong>{{max}}</strong> Parsecs from Earth</h3>
</li>
<li class="list-group-item text-center">
<h3 class="display-6 "> <strong>{{formatCurrency minPrice}} €</strong> to <strong>{{formatCurrency maxPrice}} €</strong></h3>
</li>
</script>
<ul class="list-group list-group-flush"></ul>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="parallax border-bottom" id="parallax2">
<div class="parallax-text-black">
Make it yours
</div>
</div>
<div id="features" class=" info-section text-center">
<div class="container">
<h2 class="display-5 my-4">Our Features</h2>
<div class="row">
<div class="col-md-4">
<i class="bi h1 bi-search"></i>
<h3 class="mt-3">Expansive Search and Filtering</h3>
<p class="lead text-muted">Find the best star, by name or price.</p>
</div>
<div class="col-md-4">
<i class="bi bi-stars h1"></i>
<h3 class="mt-3">Variety of Star Types</h3>
<p class="lead text-muted">Choose from seven different star colors and types.</p>
</div>
<div class="col-md-4">
<i class="bi bi-file-earmark-check h1"></i>
<h3 class="mt-3">Certificate of Authenticity</h3>
<p class="lead text-muted">Every purchase includes a signed certificate authenticating your
star.</p>
</div>
</div>
</div>
</div>
<div class="parallax border-top border-bottom my-3" id="parallax3">
<div class="parallax-text-white">
Own a Part of the Sky!
</div>
</div>
<div class="container justify-content-center text-center">
<h2 class="display-3">Gallery</h2>
<p class="lead my-4 text-muted">Choose Any Star Visible in the Sky from the Famous <a
href="https://github.com/astronexus/HYG-Database/blob/main/hyg/v2/hygfull.csv"><strong>HYG</strong></a>
Database - A Truly
Unique Gift for
the Rich and Successful</p>
<a href="articles.html" class="btn-outline-secondary mt-3 btn">
<div class="text-center">
<h2 class="h2">To Articles</h2>
</div>
</a>
<div class="border-top border-2 my-4"></div>
<div class="text-center display-3">Filter</div>
<script id="template" type="text/x-handlebars-colors">
{{# each this}}
<div class="col-6 col-sm-5 col-md-4 col-xl-3">
<div class="card mt-4 border-0">
<a href="articles.html?page=1&filter=Color&filterValue={{color}}&filterOperation=eq" class="btn btn-outline-secondary">
<img src="assets/stars/{{color}}.png" class="card-img-top image-fluid" alt="Star Image 1">
<p class="lead my-2">{{title}}</p>
</a>
</div>
</div>
{{/each}}
</script>
<div class="row justify-content-center"></div>
</div>
<div class="border-top border-2 mt-5"></div>
<!-- MARK: FAQ
-->
<section id="FAQ" class="bg-black">
<div class="text-center py-4">
<h2 class="display-5">Our Mission</h2>
<p class="lead text-muted">At <strong>Starshop</strong>, we offer the unique opportunity to purchase a
star in the night sky.
</p>
<p class="lead text-muted">
Our luxurious packages provide a celestial experience unlike any other, complete with a large
dataset and certificate of authenticity.
</p>
</div>
<div class="container-lg pb-4 justify-content-center">
<div class="border-top border-2 my-3"></div>
<div class="row justify-contents-center">
<div class="col-md-8">
<div class="text-center">
<h2 class="display-5 mt-4">FAQ</h2>
<p class="lead text-muted">frequently asked questions</p>
</div>
<div class="accordion" id="accordionPanelsStayOpenExample">
<div class="accordion-item">
<h2 class="accordion-header">
<button class="accordion-button" type="button" data-bs-toggle="collapse"
data-bs-target="#panelsStayOpen-collapseOne" aria-expanded="true"
aria-controls="panelsStayOpen-collapseOne">
Can I actually own a real star?
</button>
</h2>
<div id="panelsStayOpen-collapseOne" class="accordion-collapse collapse show">
<div class="accordion-body text-light">
Yes, with us you have the opportunity to own a real star. We offer you the
unique opportunity to
officially name and own a star in the sky.
</div>
</div>
</div>
<div class="accordion-item">
<h2 class="accordion-header">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse"
data-bs-target="#panelsStayOpen-collapseTwo" aria-expanded="false"
aria-controls="panelsStayOpen-collapseTwo">
How does the process of buying a star work?
</button>
</h2>
<div id="panelsStayOpen-collapseTwo" class="accordion-collapse collapse">
<div class="accordion-body text-light">
Buying a star is simple and straightforward. You first select a star from our
catalog, give it a
name of your choice and then fill out the order form. Once your order has been
processed, you will
receive a personalized certificate confirming your star and its coordinates.
</div>
</div>
</div>
<div class="accordion-item">
<h2 class="accordion-header">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse"
data-bs-target="#panelsStayOpen-collapseThree" aria-expanded="false"
aria-controls="panelsStayOpen-collapseThree">
Is the star I have named really unique?
</button>
</h2>
<div id="panelsStayOpen-collapseThree" class="accordion-collapse collapse">
<div class="accordion-body text-light">
Yes, every star we sell is unique. Once you have purchased and named a star, it
is exclusively
yours.
</div>
</div>
</div>
<div class="accordion-item">
<h2 class="accordion-header">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse"
data-bs-target="#panelsStayOpen-collapseFour" aria-expanded="false"
aria-controls="panelsStayOpen-collapseFour">
Can I see the star I have bought?
</button>
</h2>
<div id="panelsStayOpen-collapseFour" class="accordion-collapse collapse">
<div class="accordion-body text-light">
Yes, most of the stars we sell are visible to the naked eye and can be observed
depending on
location and time of year. We will also provide you with a star chart and other
information to help
you locate your star in the sky.
</div>
</div>
</div>
<div class="accordion-item">
<h2 class="accordion-header">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse"
data-bs-target="#panelsStayOpen-collapseFive" aria-expanded="false"
aria-controls="panelsStayOpen-collapseFive">
What items do I get with my star purchase?
</button>
</h2>
<div id="panelsStayOpen-collapseFive" class="accordion-collapse collapse">
<div class="accordion-body text-light">
With your star purchase you will receive a high quality certificate confirming
the star you have
named and its coordinates. You will also receive a personalized star map with
the position of your
star marked on it, as well as other informative materials about stars and
constellations.
</div>
</div>
</div>
<div class="accordion-item">
<h2 class="accordion-header">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse"
data-bs-target="#panelsStayOpen-collapseSix" aria-expanded="false"
aria-controls="panelsStayOpen-collapseSix">
Is the purchase of a star a symbolic gift or do I have actual ownership rights?
</button>
</h2>
<div id="panelsStayOpen-collapseSix" class="accordion-collapse collapse">
<div class="accordion-body text-light">
Buying a star is both a symbolic gift and a unique experience that gives you the
feeling of owning a
part of the universe. Although you have no legal ownership rights to the
physical star, the star you
name is registered exclusively to you.
</div>
</div>
</div>
<div class="accordion-item">
<h2 class="accordion-header">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse"
data-bs-target="#panelsStayOpen-collapseSeven" aria-expanded="false"
aria-controls="panelsStayOpen-collapseSeven">
Can I rename my star afterwards?
</button>
</h2>
<div id="panelsStayOpen-collapseSeven" class="accordion-collapse collapse">
<div class="accordion-body text-light">
No, once you have named your star, the name is final. Please choose your star
name carefully.
</div>
</div>
</div>
<div class="accordion-item">
<h2 class="accordion-header">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse"
data-bs-target="#panelsStayOpen-collapseEight" aria-expanded="false"
aria-controls="panelsStayOpen-collapseEight">
How long will it take to receive my star package?
</button>
</h2>
<div id="panelsStayOpen-collapseEight" class="accordion-collapse collapse">
<div class="accordion-body text-light">
Normally you will receive your personalized star package within 5-7 working days
after completing
your order. However, there may be slight delays during busy periods.
</div>
</div>
</div>
<div class="accordion-item">
<h2 class="accordion-header">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse"
data-bs-target="#panelsStayOpen-collapseNine" aria-expanded="false"
aria-controls="panelsStayOpen-collapseNine">
Can I buy my star as a gift for someone else?
</button>
</h2>
<div id="panelsStayOpen-collapseNine" class="accordion-collapse collapse">
<div class="accordion-body text-light">
Yes, buying a star is a wonderful and unique gift for special occasions such as
birthdays,
anniversaries or weddings. You can send the star package directly to the
recipient and give him or
her an unforgettable memory.
</div>
</div>
</div>
<div class="accordion-item">
<h2 class="accordion-header">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse"
data-bs-target="#panelsStayOpen-collapseTen" aria-expanded="false"
aria-controls="panelsStayOpen-collapseTen">
Do you offer a guarantee for the visibility of my star?
</button>
</h2>
<div id="panelsStayOpen-collapseTen" class="accordion-collapse collapse">
<div class="accordion-body text-light">
We cannot guarantee the visibility of your star as this depends on various
factors such as weather
conditions, light pollution and your location. However, we do our best to ensure
that your star is
visible and provides you with a wonderful astronomical experience.
</div>
</div>
</div>
</div>
</div>
<!-- MARK: Questions Form
-->
<div class="col-md-4 " id="support">
<div class="text-center mt-4">
<h2 class="display-5">Get in Touch</h2>
<p class="text-muted lead">Questions? Fill out the form</p>
</div>
<form class="needs-validation" onsubmit="return false;" novalidate>
<label for="email" class="form-label">Email address:</label>
<input type="email" class="form-control" id="email" placeholder="e.g. [email protected]"
required>
<div class="invalid-feedback">Please enter a valid email</div>
<label for="name" class="form-label">Name:</label>
<input type="name" class="form-control" id="name" placeholder="e.g. Name" required>
<div class="invalid-feedback">Please enter a name</div>
<label class="form-label">Subject:</label>
<select id="subject" class="form-select" required>
<option value="pricing" selected>Pricing</option>
<option value="legal">Legal</option>
<option value="other">Other</option>
</select>
<div class="form-floating mb-4 mt-5">
<textarea name="question" class="form-control" id="question" style="height: 140px;"
required></textarea>
<label for="question">Question:</label>
<div class="invalid-feedback">Please enter your question</div>
</div>
<div class=" text-center">
<button type="submit" id="bestellen" class="btn btn-outline-dark ">submit</button>
</div>
</form>
</div>
</div>
</div>
</div>
</section>
<section class="bg-black" id="feedback">
<div class="text-center py-4">
<h2 class="display-5">Feedback</h2>
<p class="lead text-muted">
Please fill out <a
href="https://docs.google.com/forms/d/e/1FAIpQLSenPqCeFj46mCNEtOiVKxqaG02hF1wO7EIgrjGwrUgApO9C9g/viewform?embedded=true">this</a>
google Form
</p>
</div>
</section>
<!-- Footer -->
<script id="template" type="text/x-handlebars-footer">
{{> footer }}
</script>
<div></div>
<!-- Bootstrap JavaScript Libraries -->
<script src="js/bootstrap.js"></script>
</body>
</html>