| @@ -2,8 +2,8 @@ |
| 2 | |
2 | |
| 3 | |
3 | |
| 4 | import Layout from '@layouts/Layout.astro'; |
4 | import Layout from '@layouts/Layout.astro'; |
| 5 | import ServiceList from '@components/things/ServiceList.astro'; |
5 | import ServiceCard from '@components/things/ServiceCard.astro'; |
| 6 | import type { AwesomePrivacy, Section } from '../types/Service'; |
6 | import type { AwesomePrivacy, Section, Service } from '../types/Service'; |
| 7 | import { fetchData, slugify } from '@utils/fetch-data'; |
7 | import { fetchData, slugify } from '@utils/fetch-data'; |
| 8 | import FontAwesome from '@components/form/FontAwesome.svelte'; |
8 | import FontAwesome from '@components/form/FontAwesome.svelte'; |
| 9 | |
9 | |
| @@ -14,10 +14,10 @@ const categories = (await fetchData() as AwesomePrivacy)?.categories || []; |
| 14 | <script> |
14 | <script> |
| 15 | |
15 | |
| 16 | const toggleSidebar = () => { |
16 | const toggleSidebar = () => { |
| 17 | const mainContent = document.querySelector('#content'); |
17 | const intro = document.querySelector('#welcome-to-all'); |
| 18 | mainContent && mainContent.classList.toggle('narrow'); |
| |
| 19 | const sidebar = document.querySelector('.sidebar'); |
18 | const sidebar = document.querySelector('.sidebar'); |
| 20 | sidebar && sidebar.classList.toggle('hidden'); |
19 | sidebar && sidebar.classList.toggle('hidden'); |
| |
20 | intro && intro.classList.toggle('hidden'); |
| 21 | const button = document.querySelector('#toggle-sidebar'); |
21 | const button = document.querySelector('#toggle-sidebar'); |
| 22 | if (button) { |
22 | if (button) { |
| 23 | button.textContent = (button.textContent === "Show Contents" ? "Hide Contents" : "Show Contents"); |
23 | button.textContent = (button.textContent === "Show Contents" ? "Hide Contents" : "Show Contents"); |
| @@ -34,31 +34,24 @@ const toggleSidebar = () => { |
| 34 | <main> |
34 | <main> |
| 35 | <div id="content"> |
35 | <div id="content"> |
| 36 | <button id="toggle-sidebar">Show Contents</button> |
36 | <button id="toggle-sidebar">Show Contents</button> |
| 37 | {categories.map((category) => ( |
37 | <div id="welcome-to-all" class="hidden"> |
| 38 | <h2 id={`${slugify(category.name)}`}> |
38 | <p> |
| 39 | <FontAwesome iconName={slugify(category.name)} /> |
39 | Welcome to <a href="/">Awesome Privacy</a>! |
| 40 | <a href={`/${slugify(category.name)}`}>{category.name}</a> |
40 | Here you'll find a summerized collection of all verified services we have listed. |
| 41 | </h2> |
41 | <br /><br /> |
| 42 | |
42 | Click a section or category heading, to view more listings and privacy tips in that group, |
| 43 | <article> |
43 | or a service title to view it's complete privacy report |
| 44 | {category.sections.map((section: Section) => ( |
44 | <br /><br /> |
| 45 | <section class="card"> |
45 | Looking for something specific? Try the <a href="/search">Search</a> page, or take a |
| 46 | <h3 id={`${slugify(category.name)}-${slugify(section.name)}`}> |
46 | scroll through the <a href="/sitemap">Sitemap</a> |
| 47 | <a href={`/${slugify(category.name)}/${slugify(section.name)}`}>{section.name}</a> |
47 | <br /><br /> |
| 48 | </h3> |
48 | If you want to make an edit, removal or submit an addition, then either click |
| 49 | <ServiceList |
49 | the Edit button within any sub-page, or visit our <a href="/about">About</a> page |
| 50 | services={section.services} |
50 | <br /><br /> |
| 51 | subHeading={true} |
51 | This project, all it's data as well as source code is freely availible |
| 52 | buttonLink={`/${slugify(category.name)}/${slugify(section.name)}`} |
52 | on <a href="https://github.com/lissy93/awesome-privacy">GitHub</a>, |
| 53 | noGitHubMetrics={true} |
53 | licensed under MIT, (C) <a href="https://aliciasykes.com">Alicia Sykes</a> 2024 |
| 54 | sectionName={section.name} |
54 | </p> |
| 55 | categoryName={category.name} |
| |
| 56 | /> |
| |
| 57 | </section> |
| |
| 58 | ))} |
| |
| 59 | </article> |
| |
| 60 | |
| |
| 61 | ))} |
| |
| 62 | </div> |
55 | </div> |
| 63 | <div class="sidebar hidden"> |
56 | <div class="sidebar hidden"> |
| 64 | <p class="sidebar-title">Contents</p> |
57 | <p class="sidebar-title">Contents</p> |
| @@ -79,6 +72,37 @@ const toggleSidebar = () => { |
| 79 | ))} |
72 | ))} |
| 80 | </ul> |
73 | </ul> |
| 81 | </div> |
74 | </div> |
| |
75 | {categories.map((category) => ( |
| |
76 | <h2 id={`${slugify(category.name)}`}> |
| |
77 | <FontAwesome iconName={slugify(category.name)} /> |
| |
78 | <a href={`/${slugify(category.name)}`}>{category.name}</a> |
| |
79 | </h2> |
| |
80 | |
| |
81 | <article> |
| |
82 | {category.sections.map((section: Section) => ( |
| |
83 | <h3 id={`${slugify(category.name)}-${slugify(section.name)}`}> |
| |
84 | <a href={`/${slugify(category.name)}/${slugify(section.name)}`}>{section.name}</a> |
| |
85 | </h3> |
| |
86 | <section class="section"> |
| |
87 | { section.services.map((service: Service) => ( |
| |
88 | <ServiceCard service={service} sectionName={section.name} categoryName={category.name}/> |
| |
89 | ))} |
| |
90 | </section> |
| |
91 | <div> |
| |
92 | {!section || !section.services || section.services.length === 0 ? ( |
| |
93 | <div class="nothing-yet"> |
| |
94 | <p> |
| |
95 | <strong>⚠️ This section is still a work in progress ⚠️</strong><br /> |
| |
96 | Check back soon, or help us complete it by submiting a pull request on GitHub. |
| |
97 | </p> |
| |
98 | </div> |
| |
99 | ) : null} |
| |
100 | </div> |
| |
101 | ))} |
| |
102 | </article> |
| |
103 | |
| |
104 | ))} |
| |
105 | </div> |
| 82 | </main> |
106 | </main> |
| 83 | |
107 | |
| 84 | </Layout> |
108 | </Layout> |
| @@ -86,23 +110,36 @@ const toggleSidebar = () => { |
| 86 | <style lang="scss"> |
110 | <style lang="scss"> |
| 87 | |
111 | |
| 88 | main { |
112 | main { |
| 89 | margin: 2rem auto; |
113 | margin: 0 auto 2rem auto; |
| 90 | padding: 1rem; |
114 | padding: 1rem; |
| 91 | width: 1000px; |
115 | width: 1200px; |
| 92 | max-width: calc(100% - 5rem); |
116 | max-width: calc(100% - 5rem); |
| 93 | |
117 | |
| 94 | display: flex; |
118 | display: flex; |
| 95 | justify-content: space-between; |
119 | justify-content: space-between; |
| 96 | } |
120 | } |
| 97 | |
121 | |
| 98 | .narrow { |
122 | // .narrow { |
| 99 | width: 70%; |
123 | // width: 70%; |
| 100 | } |
124 | // } |
| 101 | |
125 | |
| 102 | .hidden { |
126 | .hidden { |
| 103 | display: none; |
127 | display: none; |
| 104 | } |
128 | } |
| 105 | |
129 | |
| |
130 | #content { |
| |
131 | margin: 0 auto; |
| |
132 | } |
| |
133 | |
| |
134 | #welcome-to-all { |
| |
135 | text-align: justify; |
| |
136 | width: 600px; |
| |
137 | margin: 0 auto; |
| |
138 | background: #ffffff4d; |
| |
139 | padding: 1rem; |
| |
140 | border-radius: var(--curve-sm); |
| |
141 | } |
| |
142 | |
| 106 | #toggle-sidebar { |
143 | #toggle-sidebar { |
| 107 | // float: right; |
144 | // float: right; |
| 108 | background: none; |
145 | background: none; |
| @@ -114,31 +151,26 @@ main { |
| 114 | } |
151 | } |
| 115 | } |
152 | } |
| 116 | |
153 | |
| |
154 | |
| 117 | .sidebar { |
155 | .sidebar { |
| 118 | width: 25%; |
| |
| 119 | height: 87vh; |
| |
| 120 | overflow: scroll; |
| |
| 121 | position: fixed; |
| |
| 122 | right: 1rem; |
| |
| 123 | border-radius: var(--curve-md); |
156 | border-radius: var(--curve-md); |
| 124 | .sidebar-title { |
157 | .sidebar-title { |
| 125 | text-align: center; |
| |
| 126 | font-size: 1.6rem; |
158 | font-size: 1.6rem; |
| 127 | margin: 0; |
| |
| 128 | background: var(--accent-3); |
159 | background: var(--accent-3); |
| 129 | color: var(--accent-fg); |
160 | color: var(--accent-fg); |
| 130 | border: 2px solid var(--foreground); |
161 | border: 2px solid var(--foreground); |
| 131 | box-shadow: 6px 6px 0 var(--foreground); |
162 | box-shadow: 6px 6px 0 var(--foreground); |
| 132 | border-radius: var(--curve-sm); |
163 | border-radius: var(--curve-sm); |
| 133 | margin: 0 1rem; |
164 | margin: 1rem auto; |
| |
165 | text-align: center; |
| 134 | } |
166 | } |
| 135 | ul { |
167 | ul { |
| 136 | list-style: none; |
168 | list-style: none; |
| 137 | padding-left: 1.6rem; |
169 | padding-left: 1.6rem; |
| |
170 | column-width: 16rem; |
| 138 | a { |
171 | a { |
| 139 | text-decoration: none; |
172 | text-decoration: none; |
| 140 | color: var(--foreground); |
173 | color: var(--foreground); |
| 141 | opacity: 0.6; |
| |
| 142 | transition: all 0.18s ease-in-out; |
174 | transition: all 0.18s ease-in-out; |
| 143 | &:hover { |
175 | &:hover { |
| 144 | color: var(--accent); |
176 | color: var(--accent); |
| @@ -158,6 +190,13 @@ main { |
| 158 | } |
190 | } |
| 159 | } |
191 | } |
| 160 | |
192 | |
| |
193 | .section { |
| |
194 | display: grid; |
| |
195 | grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); |
| |
196 | gap: 1rem; |
| |
197 | width: 100%; |
| |
198 | margin: 0 auto; |
| |
199 | } |
| 161 | |
200 | |
| 162 | .card { |
201 | .card { |
| 163 | margin: 2rem auto 5rem auto; |
202 | margin: 2rem auto 5rem auto; |
| @@ -168,7 +207,7 @@ main { |
| 168 | } |
207 | } |
| 169 | |
208 | |
| 170 | h2 { |
209 | h2 { |
| 171 | margin: 0; |
210 | margin: 2rem auto 0 auto; |
| 172 | font-size: 3rem; |
211 | font-size: 3rem; |
| 173 | text-align: center; |
212 | text-align: center; |
| 174 | opacity: 0.6; |
213 | opacity: 0.6; |
| @@ -189,7 +228,7 @@ h2 { |
| 189 | |
228 | |
| 190 | h3 { |
229 | h3 { |
| 191 | font-size: 2rem; |
230 | font-size: 2rem; |
| 192 | margin: -2rem 0 2rem -4rem; |
231 | margin: 2rem 0 1rem 0; |
| 193 | box-shadow: 6px 6px 0 var(--foreground); |
232 | box-shadow: 6px 6px 0 var(--foreground); |
| 194 | background: var(--accent); |
233 | background: var(--accent); |
| 195 | color: var(--accent-fg); |
234 | color: var(--accent-fg); |
| @@ -202,5 +241,25 @@ h3 { |
| 202 | } |
241 | } |
| 203 | } |
242 | } |
| 204 | |
243 | |
| |
244 | .nothing-yet { |
| |
245 | width: 80vw; |
| |
246 | margin: 0 auto; |
| |
247 | background: var(--accent-fg); |
| |
248 | border: 2px solid var(--foreground); |
| |
249 | box-shadow: 6px 6px 0 var(--foreground); |
| |
250 | border-radius: var(--curve-sm); |
| |
251 | |
| |
252 | display: flex; |
| |
253 | width: 80vw; |
| |
254 | max-width: 28rem; |
| |
255 | p { |
| |
256 | font-size: 1.2rem; |
| |
257 | opacity: 0.8; |
| |
258 | font-style: italic; |
| |
259 | text-align: center; |
| |
260 | margin-bottom: 3rem; |
| |
261 | } |
| |
262 | } |
| |
263 | |
| 205 | |
264 | |
| 206 | </style> |
265 | </style> |