web/src/pages/index.astro
176 lines · 4386 bytes
1---
2
3import Layout from '@layouts/Layout.astro';
4import Hero from '@components/Hero.astro';
5import Search from '@components/things/Search.svelte';
6import SectionList from '@components/things/SectionList.astro';
7
8import { fetchData } from '@utils/fetch-data';
9import Button from '@components/form/Button.astro';
10import type { Category } from 'src/types/Service';
11
12const categories = (await fetchData())?.categories || [] as Category[];
13
14const description = 'Privacy is a fundamental human right; '
15 + 'without it, we\'re just open books in a world where everyone\'s '
16 + 'watching. Let\'s take control back.\n'
17 + 'Migrating open-source applications which do not collect, sell or log your data is a great first step.'
18 + 'Awesome Privacy is a directory of alternative privacy-respecting software and services.';
19
20---
21
22<Layout title="Home | Awesome Privacy" hideNav={true} description={description}>
23 <Hero />
24 <main>
25 <h2>
26 <a href="/search">Search</a>
27 </h2>
28 <Search client:visible data={categories} />
29 <h2 class="browse-title"><a href="/browse">Browse</a></h2>
30 <ul class="categories">
31 {categories.map((category) => (
32 <li class="category">
33 <SectionList title={category.name} sections={category.sections} />
34 </li>
35 ))}
36 </ul>
37 <div class="view-all">
38 <span>Or, just</span>
39 <Button url="/all" text="View Everything" />
40 </div>
41 <h2>
42 <a href="/about">About</a>
43 </h2>
44 <div class="about-summary">
45 <p>
46 Awesome Privacy is a collection of privacy-respecting services and tools.
47 The aim is to help you escape big tech, and choose software that respects your privacy.
48 </p>
49 <p>
50 Why? Because privacy is a fundamental human right; without it, we're just open books
51 in a world where everyone's watching. Let's take control back.
52 </p>
53 <p>
54 Noticed something that should be added / removed / ammended?
55 We're a community-driven resource, so welcome contributions of any nature.
56 All content and code is <a href="https://github.com/lissy93/awesome-privacy">open source</a>.
57 </p>
58 <p>
59 If you've found Awesome Privacy useful, help us out by sharing it with others,
60 contributing, or consider <a href="https://github.com/sponsors/lissy93">sponsoring me</a> on GitHub.
61 </p>
62 </div>
63 <div class="view-all">
64 <span>Want to learn more?</span>
65 <Button url="/about" text="Keep Reading..." />
66 </div>
67
68 </main>
69</Layout>
70
71<style lang="scss">
72 main {
73 margin: auto;
74 padding: 1rem;
75 width: 1100px;
76 max-width: calc(100% - 5rem);
77 font-size: 20px;
78 line-height: 1.6;
79 @media(max-width: 768px) {
80 padding: 0;
81 }
82 .view-all {
83 text-align: center;
84 width: 16rem;
85 margin: 0 auto;
86 span {
87 opacity: 0.5;
88 font-size: 1rem;
89 }
90 }
91 }
92 h2 {
93 font-size: 3rem;
94 color: var(--accent-3);
95 font-family: "Lekton", sans-serif;
96 text-align: center;
97 margin: 3rem 0 1rem 0;
98 a {
99 text-decoration: none;
100 color: var(--accent-3);
101 font-family: "Lekton", sans-serif;
102 position: relative;
103 &:after {
104 background: none repeat scroll 0 0 transparent;
105 bottom: 0;
106 content: "";
107 display: block;
108 height: 3px;
109 left: 50%;
110 position: absolute;
111 background: var(--accent);
112 transition: width 0.3s ease 0s, left 0.3s ease 0s;
113 width: 0;
114 }
115 &:hover:after {
116 width: 100%;
117 left: 0;
118 }
119 }
120 }
121
122 .about-summary {
123 background: var(--accent-fg);
124 border: 2px solid var(--box-outline);
125 border-radius: var(--curve-sm);
126 box-shadow: 4px 4px 0 var(--box-outline);
127 padding: 1rem;
128 width: 85%;
129 margin: 0 auto;
130 }
131
132 .categories {
133 columns: 6 300px;
134 column-gap: 1rem;
135 padding: 0;
136 .category {
137 background: var(--accent-fg);
138 border: 2px solid var(--box-outline);
139 border-radius: var(--curve-sm);
140 box-shadow: 4px 4px 0 var(--box-outline);
141 padding: 1rem;
142 width: 85%;
143 display: inline-flex;
144 flex-direction: column;
145 margin: 1rem;
146 @media(max-width: 768px) {
147 margin: 1rem 0;
148 width: 90%;
149 }
150 .category-title {
151 text-decoration: none;
152 color: var(--foreground);
153 }
154 h3 {
155 font-family: "Lekton", sans-serif;
156 font-weight: bold;
157 margin: 0;
158 font-size: 1.8rem;
159 }
160 .sections {
161 padding-left: 1rem;
162 .section {
163 a {
164 text-decoration: none;
165 color: var(--foreground);
166 }
167 .service-count {
168 color: var(--accent-3);
169 }
170 }
171 }
172 }
173 }
174
175
176</style>