web/src/pages/index.astro

168 lines · 4248 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		.view-all {
 80			text-align: center;
 81			width: 16rem;
 82			margin: 0 auto;
 83			span {
 84				opacity: 0.5;
 85				font-size: 1rem;
 86			}
 87		}
 88	}
 89	h2 {
 90		font-size: 3rem;
 91		color: var(--accent-3);
 92		font-family: "Lekton", sans-serif;
 93		text-align: center;
 94		margin: 3rem 0 1rem 0;
 95		a {
 96			text-decoration: none;
 97			color: var(--accent-3);
 98			font-family: "Lekton", sans-serif;
 99			position: relative;
100			&:after {    
101				background: none repeat scroll 0 0 transparent;
102				bottom: 0;
103				content: "";
104				display: block;
105				height: 3px;
106				left: 50%;
107				position: absolute;
108				background: var(--accent);
109				transition: width 0.3s ease 0s, left 0.3s ease 0s;
110				width: 0;
111			}
112			&:hover:after { 
113				width: 100%; 
114				left: 0; 
115			}
116		}
117	}
118
119	.about-summary {
120		background: var(--accent-fg);
121			border: 2px solid var(--foreground);
122			border-radius: var(--curve-sm);
123			box-shadow: 4px 4px 0 var(--foreground);
124			padding: 1rem;
125			width: 85%;
126			margin: 0 auto;
127	}
128
129	.categories {
130		columns: 6 300px;
131		column-gap: 1rem;
132		.category {
133			background: var(--accent-fg);
134			border: 2px solid var(--foreground);
135			border-radius: var(--curve-sm);
136			box-shadow: 4px 4px 0 var(--foreground);
137			padding: 1rem;
138			width: 85%;
139			display: inline-flex;
140			flex-direction: column;
141			margin: 1rem;
142			.category-title {
143				text-decoration: none;
144				color: var(--foreground);
145			}
146			h3 {
147				font-family: "Lekton", sans-serif;
148				font-weight: bold;
149				margin: 0;
150				font-size: 1.8rem;
151			}
152			.sections {
153				padding-left: 1rem;
154				.section {
155					a {
156						text-decoration: none;
157						color: var(--foreground);
158					}
159					.service-count {
160						color: var(--accent-3);
161					}
162				}
163			}
164		}
165	}
166
167
168</style>