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