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