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