This repository has been archived by the owner on Mar 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
63 lines (55 loc) · 1.59 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
---
layout: default
---
{% include components/notification-breach.html %}
<div class="introduction">
{% include assets/privacy-protection.svg %}
<section>
<h1>Learn about privacy and security</h1>
<p>
{{ site.description }}
</p>
</section>
</div>
<section class="select-wrapper">
<h2>Select services you use</h2>
<div class="select">
{% for service in site.services %}
<label
class="service"
for="{{ service.name | downcase }}-select"
aria-label="Select {{ service.name }}"
>
<input
type="checkbox"
class="service-checkbox"
id="{{ service.name | downcase }}-select"
value="{{ service.name | lowercase }}"
name="{{ service.name }}"
/>
<div class="service-container">
<img src="{{ service.logo }}" alt="{{ service.name }} logo" />
<h3>{{ service.name }}</h3>
</div>
</label>
{% endfor %}
</div>
<button class="submit" onclick="setLocalStorageAndRedirect()">Submit</button>
</section>
<script>
function getCheckedBoxes(checkboxName) {
var checkboxes = document.getElementsByClassName(checkboxName);
var servicesChecked = [];
for (var i = 0; i < checkboxes.length; i++) {
if (checkboxes[i].checked) {
servicesChecked.push(checkboxes[i].getAttribute("name"));
}
}
return servicesChecked.length > 0 ? servicesChecked : null;
}
function setLocalStorageAndRedirect() {
var services = getCheckedBoxes("service-checkbox");
localStorage.setItem("services", JSON.stringify(services));
location.href = "/my.html";
}
</script>