Commit 4f8ab87ea7

4f8ab87ea7cf858740bbc26de4a648541a274469

parent: 78d83c0266

Unsigned

Alicia Sykes <alicia@omg.lol> · 2026-02-26 12:53 UTC

Lints source files

Layout: unified · split

web/src/components/Card.astro +6 −8
@@ -21,19 +21,18 @@ const { href, title, body } = Astro.props;
2121</li>
2222<style lang="scss">
2323 .link-card {
24 color: var(--foreground);
25 background: var(--background);
26 border: 2px solid var(--box-outline);
27 box-shadow: 6px 6px 0 var(--box-outline);
28 font-family: "Lekton", sans-serif;
29 font-weight: 700;
24 color: var(--foreground);
25 background: var(--background);
26 border: 2px solid var(--box-outline);
27 box-shadow: 6px 6px 0 var(--box-outline);
28 font-family: 'Lekton', sans-serif;
29 font-weight: 700;
3030 transition: all ease-in-out 0.1s;
3131 list-style: none;
3232 &:hover {
3333 box-shadow: 8px 8px 0 var(--box-outline);
3434 background: var(--accent);
3535 color: var(--background);
36
3736 }
3837 a {
3938 box-sizing: border-box;
@@ -45,5 +44,4 @@ const { href, title, body } = Astro.props;
4544 margin: 0;
4645 }
4746 }
48
4947</style>
web/src/components/Hero.astro +127 −129
@@ -1,61 +1,60 @@
11---
2import FontAwesome from "@components/form/FontAwesome.svelte"
3import ThemeSwitcher from "@components/form/ThemeSwitcher.svelte"
2import FontAwesome from '@components/form/FontAwesome.svelte';
3import ThemeSwitcher from '@components/form/ThemeSwitcher.svelte';
44---
55
66<div class="theme-switcher">
7<ThemeSwitcher client:load />
7 <ThemeSwitcher client:load />
88</div>
99
1010<div class="hero">
11 <h1>Awesome Privacy</h1>
12 <p class="intro">
13 Your guide to finding and comparing privacy-respecting alternatives to popular software and services.
14 </p>
15 <div class="github-link-wrap">
16 <a href="https://github.com/lissy93/awesome-privacy">
17 <FontAwesome iconName="github" />
18 View on GitHub
19 </a>
20 </div>
11 <h1>Awesome Privacy</h1>
12 <p class="intro">
13 Your guide to finding and comparing privacy-respecting alternatives to
14 popular software and services.
15 </p>
16 <div class="github-link-wrap">
17 <a href="https://github.com/lissy93/awesome-privacy">
18 <FontAwesome iconName="github" />
19 View on GitHub
20 </a>
21 </div>
2122</div>
2223
2324<nav class="top-right">
24 <ul>
25 <li>
26 <a href="/">Home</a>
27 </li>
28 <li>
29 <a href="/search">Search</a>
30 </li>
31 <li>
32 <a href="/browse">Browse</a>
33 </li>
34 <li>
35 <a href="/about">About</a>
36 </li>
37 <li>
38 <a href="https://github.com/lissy93/awesome-privacy">Source</a>
39 </li>
40 <li>
41 <a href="https://as93.net">More Apps</a>
42 </li>
43 </ul>
25 <ul>
26 <li>
27 <a href="/">Home</a>
28 </li>
29 <li>
30 <a href="/search">Search</a>
31 </li>
32 <li>
33 <a href="/browse">Browse</a>
34 </li>
35 <li>
36 <a href="/about">About</a>
37 </li>
38 <li>
39 <a href="https://github.com/lissy93/awesome-privacy">Source</a>
40 </li>
41 <li>
42 <a href="https://as93.net">More Apps</a>
43 </li>
44 </ul>
4445</nav>
4546
46
4747<style lang="scss">
48
4948 .hero {
50 color: var(--accent-fg);
51 border-radius: var(--curve-sm);
52 padding: 2rem 4rem;
53 display: flex;
54 flex-direction: column;
55 gap: 2rem;
56 @media(max-width: 768px) {
57 padding: 2rem 1rem;
58 }
49 color: var(--accent-fg);
50 border-radius: var(--curve-sm);
51 padding: 2rem 4rem;
52 display: flex;
53 flex-direction: column;
54 gap: 2rem;
55 @media (max-width: 768px) {
56 padding: 2rem 1rem;
57 }
5958 }
6059 svg {
6160 position: absolute;
@@ -65,98 +64,97 @@ import ThemeSwitcher from "@components/form/ThemeSwitcher.svelte"
6564 width: 220px;
6665 height: auto;
6766 opacity: 0.6;
68 display: none;
67 display: none;
6968 }
7069 h1 {
71 margin: 0;
70 margin: 0;
7271 font-size: 5rem;
7372 font-weight: 700;
7473 line-height: 1;
7574 text-align: center;
76 font-family: 'Libre Franklin', sans-serif;
77 color: var(--accent-3);
78 -webkit-text-fill-color: var(--accent-3);
79 -webkit-text-stroke-width: 2px;
80 -webkit-text-stroke-color: var(--box-outline);
81 text-shadow: 3px 3px 0 var(--box-outline);
82 @media(max-width: 768px) {
83 font-size: 4rem;
84 }
75 font-family: 'Libre Franklin', sans-serif;
76 color: var(--accent-3);
77 -webkit-text-fill-color: var(--accent-3);
78 -webkit-text-stroke-width: 2px;
79 -webkit-text-stroke-color: var(--box-outline);
80 text-shadow: 3px 3px 0 var(--box-outline);
81 @media (max-width: 768px) {
82 font-size: 4rem;
83 }
84 }
85 .intro {
86 text-align: center;
87 font-size: 1.6rem;
88 padding: 0.5rem 1rem;
89 color: var(--accent-fg);
90 background: var(--accent-3);
91 border: 2px solid var(--box-outline);
92 border-radius: var(--curve-sm);
93 box-shadow: 6px 6px 0 var(--box-outline);
94 font-family: 'Lekton', sans-serif;
95 font-weight: 700;
96 max-width: 735px;
97 margin: 0 auto;
98 }
99 .github-link-wrap {
100 font-family: 'Lekton', sans-serif;
101 max-width: 735px;
102 text-align: center;
103 margin: 0 auto;
104 border: 1px solid var(--box-outline);
105 box-shadow: 3px 3px 0 var(--box-outline);
106 background: var(--accent);
107 border-radius: 18px;
108 padding: 0.5rem 1rem;
109 a {
110 text-decoration: none;
111 color: var(--accent-fg);
112 font-size: 1.2rem;
113 font-family: 'Lekton', sans-serif;
114 font-weight: bold;
115 display: flex;
116 align-items: center;
117 :global(svg) {
118 width: 1.5rem;
119 height: 1.5rem;
120 color: var(--accent-fg);
121 margin-right: 0.5rem;
122 }
123 }
85124 }
86 .intro {
87 text-align: center;
88 font-size: 1.6rem;
89 padding: 0.5rem 1rem;
90 color: var(--accent-fg);
91 background: var(--accent-3);
92 border: 2px solid var(--box-outline);
93 border-radius: var(--curve-sm);
94 box-shadow: 6px 6px 0 var(--box-outline);
95 font-family: "Lekton", sans-serif;
96 font-weight: 700;
97 max-width: 735px;
98 margin: 0 auto;
99 }
100 .github-link-wrap {
101 font-family: "Lekton", sans-serif;
102 max-width: 735px;
103 text-align: center;
104 margin: 0 auto;
105 border: 1px solid var(--box-outline);
106 box-shadow: 3px 3px 0 var(--box-outline);
107 background: var(--accent);
108 border-radius: 18px;
109 padding: 0.5rem 1rem;
110 a {
111 text-decoration: none;
112 color: var(--accent-fg);;
113 font-size: 1.2rem;
114 font-family: "Lekton", sans-serif;
115 font-weight: bold;
116 display: flex;
117 align-items: center;
118 :global(svg) {
119 width: 1.5rem;
120 height: 1.5rem;
121 color: var(--accent-fg);
122 margin-right: 0.5rem;
123 }
124 }
125 }
126125
127 .theme-switcher {
128 position: absolute;
129 right: 1rem;
130 top: 1rem;
131 }
126 .theme-switcher {
127 position: absolute;
128 right: 1rem;
129 top: 1rem;
130 }
132131
133 .top-right {
134 position: absolute;
135 top: 0;
136 right: 1rem;
137 opacity: 0.8;
138 display: none;
139 &:hover {
140 opacity: 1;
141 }
142 ul {
143 list-style: none;
144 display: flex;
145 padding: 0;
146 gap: 0.5rem;
147 li {
148 &:not(:last-child) {
149 border-right: 1px solid var(--accent);
150 padding-right: 0.5rem;
151 }
152 }
153 li a {
154 text-decoration: none;
155 &:hover {
156 text-decoration: underline;
157 }
158 }
159 }
160 }
161
132 .top-right {
133 position: absolute;
134 top: 0;
135 right: 1rem;
136 opacity: 0.8;
137 display: none;
138 &:hover {
139 opacity: 1;
140 }
141 ul {
142 list-style: none;
143 display: flex;
144 padding: 0;
145 gap: 0.5rem;
146 li {
147 &:not(:last-child) {
148 border-right: 1px solid var(--accent);
149 padding-right: 0.5rem;
150 }
151 }
152 li a {
153 text-decoration: none;
154 &:hover {
155 text-decoration: underline;
156 }
157 }
158 }
159 }
162160</style>
web/src/components/form/Button.astro +22 −29
@@ -1,37 +1,30 @@
11---
2
3const {
4 text,
5 url,
6 className,
7 title,
8} = Astro.props;
9
2const { text, url, className, title } = Astro.props;
103---
114
125<div class={`button ${className || ''}`} title={title}>
13 <a href={url}>{text}<slot /></a>
6 <a href={url}>{text}<slot /></a>
147</div>
158
169<style lang="scss">
17 .button {
18 font-family: "Lekton", sans-serif;
19 text-align: center;
20 border: 1px solid var(--box-outline);
21 box-shadow: 3px 3px 0 var(--box-outline);
22 background: var(--accent);
23 border-radius: 18px;
24 padding: 0.5rem 1rem;
25 transition: all 0.2s ease-in-out;
26 &:hover {
27 box-shadow: 4px 4px 0 var(--box-outline);
28 }
29 a {
30 text-decoration: none;
31 color: var(--accent-fg);;
32 font-size: 1.2rem;
33 font-family: "Lekton", sans-serif;
34 font-weight: bold;
35 }
36 }
10 .button {
11 font-family: 'Lekton', sans-serif;
12 text-align: center;
13 border: 1px solid var(--box-outline);
14 box-shadow: 3px 3px 0 var(--box-outline);
15 background: var(--accent);
16 border-radius: 18px;
17 padding: 0.5rem 1rem;
18 transition: all 0.2s ease-in-out;
19 &:hover {
20 box-shadow: 4px 4px 0 var(--box-outline);
21 }
22 a {
23 text-decoration: none;
24 color: var(--accent-fg);
25 font-size: 1.2rem;
26 font-family: 'Lekton', sans-serif;
27 font-weight: bold;
28 }
29 }
3730</style>
web/src/components/form/EditableTitle.svelte +13 −11
@@ -41,25 +41,27 @@
4141 }
4242</script>
4343
44<svelte:window on:click={handleClickOutside}/>
44<svelte:window on:click={handleClickOutside} />
4545
4646<!-- svelte-ignore a11y-no-noninteractive-tabindex -->
4747<div>
48<h2
49 contenteditable={true}
50 class:editable={editing}
51 on:click={() => editing = true}
52 on:keydown={handleKeydown}
53 on:blur={() => saveTitle(title)}
54 tabindex="0"
55>{title}</h2>
48 <h2
49 contenteditable={true}
50 class:editable={editing}
51 on:click={() => (editing = true)}
52 on:keydown={handleKeydown}
53 on:blur={() => saveTitle(title)}
54 tabindex="0"
55 >
56 {title}
57 </h2>
5658
57<small>Click the title, to edit your inventory name</small>
59 <small>Click the title, to edit your inventory name</small>
5860</div>
5961
6062<style>
6163 h2 {
62 font-family: "Lekton", sans-serif;
64 font-family: 'Lekton', sans-serif;
6365 font-weight: bold;
6466 font-size: 3rem;
6567 margin: 0;
web/src/components/form/FontAwesome.svelte +1 −7
@@ -4,7 +4,6 @@
44 import * as brands from '@fortawesome/free-brands-svg-icons';
55 import type { IconDefinition } from '@fortawesome/fontawesome-svg-core';
66
7
87 export const iconMap: Record<string, IconDefinition> = {
98 // Branding
109 logo: solidIcons.faEyeSlash,
@@ -83,13 +82,8 @@
8382 };
8483
8584 export let iconName: string;
86
8785</script>
8886
8987{#if iconMap[iconName]}
90 <FontAwesomeIcon
91 class="fa-icon"
92 icon={iconMap[iconName]} />
88 <FontAwesomeIcon class="fa-icon" icon={iconMap[iconName]} />
9389{/if}
94
95
web/src/components/form/Icon.astro +71 −60
@@ -1,73 +1,84 @@
11---
2
32interface IconProps {
4 icon: string;
5 color?: string;
6 class?: string;
7 width?: number;
8 height?: number;
3 icon: string;
4 color?: string;
5 class?: string;
6 width?: number;
7 height?: number;
98}
109
1110const getSvgPath = (icon: string) => {
12 switch (icon) {
13 case 'star':
14 return {
15 vb: "0 0 24 24",
16 path: "M10 15l-5.5 3 1-5.5L0 7.5l5.6-0.5L10 2l2 5 5.5 0.5-4 4 1 5.5z",
17 };
18 case 'mastodon':
19 return {
20 vb: "0 0 512 512",
21 path: "M433 179.1c0-97.2-63.7-125.7-63.7-125.7-62.5-28.7-228.6-28.4-290.5 0 0 0-63.7 28.5-63.7 125.7 0 115.7-6.6 259.4 105.6 289.1 40.5 10.7 75.3 13 103.3 11.4 50.8-2.8 79.3-18.1 79.3-18.1l-1.7-36.9s-36.3 11.4-77.1 10.1c-40.4-1.4-83-4.4-89.6-54a102.5 102.5 0 0 1 -.9-13.9c85.6 20.9 158.7 9.1 178.8 6.7 56.1-6.7 105-41.3 111.2-72.9 9.8-49.8 9-121.5 9-121.5zm-75.1 125.2h-46.6v-114.2c0-49.7-64-51.6-64 6.9v62.5h-46.3V197c0-58.5-64-56.6-64-6.9v114.2H90.2c0-122.1-5.2-147.9 18.4-175 25.9-28.9 79.8-30.8 103.8 6.1l11.6 19.5 11.6-19.5c24.1-37.1 78.1-34.8 103.8-6.1 23.7 27.3 18.4 53 18.4 175z",
22 };
23 case 'twitter':
24 return {
25 vb: "0 0 512 512",
26 path: "M389.2 48h70.6L305.6 224.2 487 464H345L233.7 318.6 106.5 464H35.8L200.7 275.5 26.8 48H172.4L272.9 180.9 389.2 48zM364.4 421.8h39.1L151.1 88h-42L364.4 421.8z",
27 };
28 case 'hub':
29 return {
30 vb: "0 0 512 512",
31 path: "M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3 .3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5 .3-6.2 2.3zm44.2-1.7c-2.9 .7-4.9 2.6-4.6 4.9 .3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3 .7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3 .3 2.9 2.3 3.9 1.6 1 3.6 .7 4.3-.7 .7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3 .7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3 .7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z",
32 };
33 case 'dev':
34 return {
35 vb: "0 0 512 512",
36 path: "M120.1 208.3c-3.9-2.9-7.8-4.4-11.7-4.4H91v104.5h17.5c3.9 0 7.8-1.5 11.7-4.4 3.9-2.9 5.8-7.3 5.8-13.1v-69.7c0-5.8-2-10.2-5.8-13.1zM404.1 32H43.9C19.7 32 .1 51.6 0 75.8v360.4C.1 460.4 19.7 480 43.9 480h360.2c24.2 0 43.8-19.6 43.9-43.8V75.8c-.1-24.2-19.7-43.8-43.9-43.8zM154.2 291.2c0 18.8-11.6 47.3-48.4 47.3h-46.4V173h47.4c35.4 0 47.4 28.5 47.4 47.3l0 70.9zm100.7-88.7H201.6v38.4h32.6v29.6H201.6v38.4h53.3v29.6h-62.2c-11.2 .3-20.4-8.5-20.7-19.7V193.7c-.3-11.2 8.6-20.4 19.7-20.7h63.2l0 29.5zm103.6 115.3c-13.2 30.8-36.9 24.6-47.4 0l-38.5-144.8h32.6l29.7 113.7 29.6-113.7h32.6l-38.5 144.8z",
37 };
38 case 'linkedin':
39 return {
40 vb: "0 0 512 512",
41 path: "M416 32H31.9C14.3 32 0 46.5 0 64.3v383.4C0 465.5 14.3 480 31.9 480H416c17.6 0 32-14.5 32-32.3V64.3c0-17.8-14.4-32.3-32-32.3zM135.4 416H69V202.2h66.5V416zm-33.2-243c-21.3 0-38.5-17.3-38.5-38.5S80.9 96 102.2 96c21.2 0 38.5 17.3 38.5 38.5 0 21.3-17.2 38.5-38.5 38.5zm282.1 243h-66.4V312c0-24.8-.5-56.7-34.5-56.7-34.6 0-39.9 27-39.9 54.9V416h-66.4V202.2h63.7v29.2h.9c8.9-16.8 30.6-34.5 62.9-34.5 67.2 0 79.7 44.3 79.7 101.9V416z",
42 };
43 case 'essentials':
44 return {
45 vb: "0 0 512 512",
46 path: "M208 176c0-70.7 57.3-128 128-128s128 57.3 128 128s-57.3 128-128 128c-10.4 0-20.5-1.2-30.1-3.6c-8.1-2-16.7 .4-22.6 6.4L254.1 336H200c-13.3 0-24 10.7-24 24v40H136c-13.3 0-24 10.7-24 24v40H48V385.9L205.2 228.7c5.9-5.9 8.3-14.5 6.4-22.6c-2.3-9.6-3.6-19.7-3.6-30.1zM336 0C238.8 0 160 78.8 160 176c0 9.5 .7 18.8 2.2 27.9L7 359c-4.5 4.5-7 10.6-7 17V488c0 13.3 10.7 24 24 24H136c13.3 0 24-10.7 24-24V448h40c13.3 0 24-10.7 24-24V384h40c6.4 0 12.5-2.5 17-7l27.2-27.2c9.1 1.4 18.4 2.2 27.9 2.2c97.2 0 176-78.8 176-176S433.2 0 336 0zm32 176a32 32 0 1 0 0-64 32 32 0 1 0 0 64z",
47 };
48 case 'communication':
49 return {
50 vb: "0 0 640 512",
51 path: "M48 72c0-13.3 10.7-24 24-24H344c13.3 0 24 10.7 24 24V248c0 13.3-10.7 24-24 24H216c-4.7 0-9.4 1.4-13.3 4L144 315.2V296c0-13.3-10.7-24-24-24H72c-13.3 0-24-10.7-24-24V72zM72 0C32.2 0 0 32.2 0 72V248c0 39.8 32.2 72 72 72H96v40c0 8.9 4.9 17 12.7 21.2s17.3 3.7 24.6-1.2l90-60H344c39.8 0 72-32.2 72-72V72c0-39.8-32.2-72-72-72H72zM256 376c0 39.8 32.2 72 72 72h88.7l90 60c7.4 4.9 16.8 5.4 24.6 1.2S544 496.9 544 488V448h24c39.8 0 72-32.2 72-72V200c0-39.8-32.2-72-72-72H448v48H568c13.3 0 24 10.7 24 24V376c0 13.3-10.7 24-24 24H520c-13.3 0-24 10.7-24 24v19.2L437.3 404c-3.9-2.6-8.6-4-13.3-4H328c-13.3 0-24-10.7-24-24V352H256v24z",
52 };
53 case 'security-tools':
54 return {
55 vp: "0 0 512 512",
56 path: "M232 60.8V447.4c-66.9-37.8-108.8-94.3-134.1-152.6C71 232.9 63.1 169.5 64.1 126L232 60.8zm48 386.5V60.8L448 126c1 43.5-6.9 106.9-33.8 168.8C388.8 353.1 346.9 409.5 280 447.3zM495.5 113l-1.2-20.5L475.1 85 267.6 4.5 256 0 244.4 4.5 36.9 85 17.8 92.5 16.6 113c-2.9 49.9 4.9 126.3 37.3 200.9c32.7 75.2 91 150 189.4 192.6L256 512l12.7-5.5c98.4-42.6 156.7-117.3 189.4-192.6c32.4-74.7 40.2-151 37.3-200.9z"
57 };
58 // Add more icons as needed...
59 default:
60 return { vb: "", path: "" }; // Default path or a placeholder icon
61 }
11 switch (icon) {
12 case 'star':
13 return {
14 vb: '0 0 24 24',
15 path: 'M10 15l-5.5 3 1-5.5L0 7.5l5.6-0.5L10 2l2 5 5.5 0.5-4 4 1 5.5z',
16 };
17 case 'mastodon':
18 return {
19 vb: '0 0 512 512',
20 path: 'M433 179.1c0-97.2-63.7-125.7-63.7-125.7-62.5-28.7-228.6-28.4-290.5 0 0 0-63.7 28.5-63.7 125.7 0 115.7-6.6 259.4 105.6 289.1 40.5 10.7 75.3 13 103.3 11.4 50.8-2.8 79.3-18.1 79.3-18.1l-1.7-36.9s-36.3 11.4-77.1 10.1c-40.4-1.4-83-4.4-89.6-54a102.5 102.5 0 0 1 -.9-13.9c85.6 20.9 158.7 9.1 178.8 6.7 56.1-6.7 105-41.3 111.2-72.9 9.8-49.8 9-121.5 9-121.5zm-75.1 125.2h-46.6v-114.2c0-49.7-64-51.6-64 6.9v62.5h-46.3V197c0-58.5-64-56.6-64-6.9v114.2H90.2c0-122.1-5.2-147.9 18.4-175 25.9-28.9 79.8-30.8 103.8 6.1l11.6 19.5 11.6-19.5c24.1-37.1 78.1-34.8 103.8-6.1 23.7 27.3 18.4 53 18.4 175z',
21 };
22 case 'twitter':
23 return {
24 vb: '0 0 512 512',
25 path: 'M389.2 48h70.6L305.6 224.2 487 464H345L233.7 318.6 106.5 464H35.8L200.7 275.5 26.8 48H172.4L272.9 180.9 389.2 48zM364.4 421.8h39.1L151.1 88h-42L364.4 421.8z',
26 };
27 case 'hub':
28 return {
29 vb: '0 0 512 512',
30 path: 'M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3 .3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5 .3-6.2 2.3zm44.2-1.7c-2.9 .7-4.9 2.6-4.6 4.9 .3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3 .7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3 .3 2.9 2.3 3.9 1.6 1 3.6 .7 4.3-.7 .7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3 .7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3 .7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z',
31 };
32 case 'dev':
33 return {
34 vb: '0 0 512 512',
35 path: 'M120.1 208.3c-3.9-2.9-7.8-4.4-11.7-4.4H91v104.5h17.5c3.9 0 7.8-1.5 11.7-4.4 3.9-2.9 5.8-7.3 5.8-13.1v-69.7c0-5.8-2-10.2-5.8-13.1zM404.1 32H43.9C19.7 32 .1 51.6 0 75.8v360.4C.1 460.4 19.7 480 43.9 480h360.2c24.2 0 43.8-19.6 43.9-43.8V75.8c-.1-24.2-19.7-43.8-43.9-43.8zM154.2 291.2c0 18.8-11.6 47.3-48.4 47.3h-46.4V173h47.4c35.4 0 47.4 28.5 47.4 47.3l0 70.9zm100.7-88.7H201.6v38.4h32.6v29.6H201.6v38.4h53.3v29.6h-62.2c-11.2 .3-20.4-8.5-20.7-19.7V193.7c-.3-11.2 8.6-20.4 19.7-20.7h63.2l0 29.5zm103.6 115.3c-13.2 30.8-36.9 24.6-47.4 0l-38.5-144.8h32.6l29.7 113.7 29.6-113.7h32.6l-38.5 144.8z',
36 };
37 case 'linkedin':
38 return {
39 vb: '0 0 512 512',
40 path: 'M416 32H31.9C14.3 32 0 46.5 0 64.3v383.4C0 465.5 14.3 480 31.9 480H416c17.6 0 32-14.5 32-32.3V64.3c0-17.8-14.4-32.3-32-32.3zM135.4 416H69V202.2h66.5V416zm-33.2-243c-21.3 0-38.5-17.3-38.5-38.5S80.9 96 102.2 96c21.2 0 38.5 17.3 38.5 38.5 0 21.3-17.2 38.5-38.5 38.5zm282.1 243h-66.4V312c0-24.8-.5-56.7-34.5-56.7-34.6 0-39.9 27-39.9 54.9V416h-66.4V202.2h63.7v29.2h.9c8.9-16.8 30.6-34.5 62.9-34.5 67.2 0 79.7 44.3 79.7 101.9V416z',
41 };
42 case 'essentials':
43 return {
44 vb: '0 0 512 512',
45 path: 'M208 176c0-70.7 57.3-128 128-128s128 57.3 128 128s-57.3 128-128 128c-10.4 0-20.5-1.2-30.1-3.6c-8.1-2-16.7 .4-22.6 6.4L254.1 336H200c-13.3 0-24 10.7-24 24v40H136c-13.3 0-24 10.7-24 24v40H48V385.9L205.2 228.7c5.9-5.9 8.3-14.5 6.4-22.6c-2.3-9.6-3.6-19.7-3.6-30.1zM336 0C238.8 0 160 78.8 160 176c0 9.5 .7 18.8 2.2 27.9L7 359c-4.5 4.5-7 10.6-7 17V488c0 13.3 10.7 24 24 24H136c13.3 0 24-10.7 24-24V448h40c13.3 0 24-10.7 24-24V384h40c6.4 0 12.5-2.5 17-7l27.2-27.2c9.1 1.4 18.4 2.2 27.9 2.2c97.2 0 176-78.8 176-176S433.2 0 336 0zm32 176a32 32 0 1 0 0-64 32 32 0 1 0 0 64z',
46 };
47 case 'communication':
48 return {
49 vb: '0 0 640 512',
50 path: 'M48 72c0-13.3 10.7-24 24-24H344c13.3 0 24 10.7 24 24V248c0 13.3-10.7 24-24 24H216c-4.7 0-9.4 1.4-13.3 4L144 315.2V296c0-13.3-10.7-24-24-24H72c-13.3 0-24-10.7-24-24V72zM72 0C32.2 0 0 32.2 0 72V248c0 39.8 32.2 72 72 72H96v40c0 8.9 4.9 17 12.7 21.2s17.3 3.7 24.6-1.2l90-60H344c39.8 0 72-32.2 72-72V72c0-39.8-32.2-72-72-72H72zM256 376c0 39.8 32.2 72 72 72h88.7l90 60c7.4 4.9 16.8 5.4 24.6 1.2S544 496.9 544 488V448h24c39.8 0 72-32.2 72-72V200c0-39.8-32.2-72-72-72H448v48H568c13.3 0 24 10.7 24 24V376c0 13.3-10.7 24-24 24H520c-13.3 0-24 10.7-24 24v19.2L437.3 404c-3.9-2.6-8.6-4-13.3-4H328c-13.3 0-24-10.7-24-24V352H256v24z',
51 };
52 case 'security-tools':
53 return {
54 vp: '0 0 512 512',
55 path: 'M232 60.8V447.4c-66.9-37.8-108.8-94.3-134.1-152.6C71 232.9 63.1 169.5 64.1 126L232 60.8zm48 386.5V60.8L448 126c1 43.5-6.9 106.9-33.8 168.8C388.8 353.1 346.9 409.5 280 447.3zM495.5 113l-1.2-20.5L475.1 85 267.6 4.5 256 0 244.4 4.5 36.9 85 17.8 92.5 16.6 113c-2.9 49.9 4.9 126.3 37.3 200.9c32.7 75.2 91 150 189.4 192.6L256 512l12.7-5.5c98.4-42.6 156.7-117.3 189.4-192.6c32.4-74.7 40.2-151 37.3-200.9z',
56 };
57 // Add more icons as needed...
58 default:
59 return { vb: '', path: '' }; // Default path or a placeholder icon
60 }
6261};
6362
64
6563// Props are defined in the component's signature
66const { icon, color = 'currentcolor', class: className = '', width = 80, height = 50 } = Astro.props as IconProps;
64const {
65 icon,
66 color = 'currentcolor',
67 class: className = '',
68 width = 80,
69 height = 50,
70} = Astro.props as IconProps;
6771const svgStyle = { fill: color };
6872const { vb, path } = getSvgPath(icon);
6973---
7074
71<svg class={className} style={svgStyle} xmlns="http://www.w3.org/2000/svg" viewBox={vb} width={width} height={height ?? width}>
72 <path d={path} />
75<svg
76 class={className}
77 style={svgStyle}
78 xmlns="http://www.w3.org/2000/svg"
79 viewBox={vb}
80 width={width}
81 height={height ?? width}
82>
83 <path d={path}></path>
7384</svg>
web/src/components/form/Social.astro +111 −103
@@ -1,12 +1,15 @@
11---
2
32import Icon from '@components/form/FontAwesome.svelte';
4import { site, title as defaultTitle, description as defaultDescription } from '@utils/config';
3import {
4 site,
5 title as defaultTitle,
6 description as defaultDescription,
7} from '@utils/config';
58
69interface Props {
7 url?: string;
8 title?: string;
9 description?: string;
10 url?: string;
11 title?: string;
12 description?: string;
1013}
1114
1215const url = Astro.props.url || site;
@@ -18,109 +21,114 @@ const encodedTitle = encodeURIComponent(title);
1821const encodedDescription = encodeURIComponent(description);
1922
2023const socialMedias = {
21 mastodon: {
22 url: `https://mastodon.social/share?text=${encodeURIComponent(`${title} ${description}`)}&url=${encodedUrl}`,
23 title: 'Mastodon',
24 icon: 'mastodon',
25 color: '#6364FF',
26 },
27 twitter: {
28 url: `https://twitter.com/intent/tweet?text=${encodeURIComponent(`${title} ${description}`)}&url=${url}`,
29 title: 'Twitter',
30 icon: 'twitter',
31 color: '#444343'
32 },
33 reddit: {
34 url: `https://reddit.com/submit?url=${encodedUrl}&title=${encodedTitle}`,
35 title: 'Reddit',
36 icon: 'reddit',
37 color: '#FF4500',
38 },
39 linkedIn: {
40 url: `https://www.linkedin.com/shareArticle?mini=true&url=${encodedUrl}&title=${encodedTitle}&summary=${encodedDescription}`,
41 title: 'LinkedIn',
42 icon: 'linkedin',
43 color: '#0A66C2'
44 },
45 pinterest: {
46 url: `https://pinterest.com/pin/create/button/?url=${encodedUrl}&description=${encodedTitle}`,
47 title: 'Pinterest',
48 icon: 'pinterest',
49 color: '#BD081C',
50 },
51 telegram: {
52 url: `https://t.me/share/url?url=${encodedUrl}&text=${encodeURIComponent(`${title} ${description}`)}`,
53 title: 'Telegram',
54 icon: 'telegram',
55 color: '#26A5E4',
56 },
57 whatsapp: {
58 url: `https://wa.me/?text=${encodedTitle} ${encodedUrl}`,
59 title: 'WhatsApp',
60 icon: 'whatsapp',
61 color: '#25D366',
62 },
63 signal: {
64 url: `https://signal.me/#p/+${encodedUrl}`,
65 title: 'Signal',
66 icon: 'signal',
67 color: '#3A76F0',
68 },
69 pocket: {
70 url: `https://getpocket.com/save?url=${encodedUrl}&title=${encodedTitle}`,
71 title: 'Pocket',
72 icon: 'pocket',
73 color: '#EF3F56',
74 },
24 mastodon: {
25 url: `https://mastodon.social/share?text=${encodeURIComponent(`${title} ${description}`)}&url=${encodedUrl}`,
26 title: 'Mastodon',
27 icon: 'mastodon',
28 color: '#6364FF',
29 },
30 twitter: {
31 url: `https://twitter.com/intent/tweet?text=${encodeURIComponent(`${title} ${description}`)}&url=${url}`,
32 title: 'Twitter',
33 icon: 'twitter',
34 color: '#444343',
35 },
36 reddit: {
37 url: `https://reddit.com/submit?url=${encodedUrl}&title=${encodedTitle}`,
38 title: 'Reddit',
39 icon: 'reddit',
40 color: '#FF4500',
41 },
42 linkedIn: {
43 url: `https://www.linkedin.com/shareArticle?mini=true&url=${encodedUrl}&title=${encodedTitle}&summary=${encodedDescription}`,
44 title: 'LinkedIn',
45 icon: 'linkedin',
46 color: '#0A66C2',
47 },
48 pinterest: {
49 url: `https://pinterest.com/pin/create/button/?url=${encodedUrl}&description=${encodedTitle}`,
50 title: 'Pinterest',
51 icon: 'pinterest',
52 color: '#BD081C',
53 },
54 telegram: {
55 url: `https://t.me/share/url?url=${encodedUrl}&text=${encodeURIComponent(`${title} ${description}`)}`,
56 title: 'Telegram',
57 icon: 'telegram',
58 color: '#26A5E4',
59 },
60 whatsapp: {
61 url: `https://wa.me/?text=${encodedTitle} ${encodedUrl}`,
62 title: 'WhatsApp',
63 icon: 'whatsapp',
64 color: '#25D366',
65 },
66 signal: {
67 url: `https://signal.me/#p/+${encodedUrl}`,
68 title: 'Signal',
69 icon: 'signal',
70 color: '#3A76F0',
71 },
72 pocket: {
73 url: `https://getpocket.com/save?url=${encodedUrl}&title=${encodedTitle}`,
74 title: 'Pocket',
75 icon: 'pocket',
76 color: '#EF3F56',
77 },
7578};
76
7779---
7880
7981<ul class="social-share">
80 {Object.entries(socialMedias).map(([platform, shareUrl]) => (
81 <li style={`--color: ${shareUrl.color}`}>
82 <a title={`Share on ${platform}`} href={shareUrl.url} target="_blank" rel="noopener noreferrer">
83 <Icon iconName={shareUrl.icon} />
84 </a>
85 </li>
86 ))}
82 {
83 Object.entries(socialMedias).map(([platform, shareUrl]) => (
84 <li style={`--color: ${shareUrl.color}`}>
85 <a
86 title={`Share on ${platform}`}
87 href={shareUrl.url}
88 target="_blank"
89 rel="noopener noreferrer"
90 >
91 <Icon iconName={shareUrl.icon} />
92 </a>
93 </li>
94 ))
95 }
8796</ul>
8897
8998<style lang="scss">
90.social-share {
91 list-style: none;
92 padding: 0;
93 display: flex;
94 gap: 0.5rem;
95 flex-wrap: wrap;
96 li {
97 padding: 0;
98 margin: 0;
99 opacity: 0.8;
100 border: 1px solid var(--box-outline);
101 box-shadow: 2px 2px 0 var(--box-outline);
102 border-radius: var(--curve-sm);
103 transition: all 0.2s ease-in-out;
104 background: var(--background-form);
105 a {
106 display: flex;
107 color: var(--foreground);
108 transition: all 0.2s ease-in-out;
109 padding: 4px;
110 :global(svg) {
111 width: 2rem;
112 height: 2rem;
113 }
114 }
115 &:hover {
116 box-shadow: 3px 3px 0 var(--box-outline);
117 border-radius: var(--curve-md);
118 opacity: 1;
119 a {
120 color: var(--color);
121 }
122 }
123 }
124}
99 .social-share {
100 list-style: none;
101 padding: 0;
102 display: flex;
103 gap: 0.5rem;
104 flex-wrap: wrap;
105 li {
106 padding: 0;
107 margin: 0;
108 opacity: 0.8;
109 border: 1px solid var(--box-outline);
110 box-shadow: 2px 2px 0 var(--box-outline);
111 border-radius: var(--curve-sm);
112 transition: all 0.2s ease-in-out;
113 background: var(--background-form);
114 a {
115 display: flex;
116 color: var(--foreground);
117 transition: all 0.2s ease-in-out;
118 padding: 4px;
119 :global(svg) {
120 width: 2rem;
121 height: 2rem;
122 }
123 }
124 &:hover {
125 box-shadow: 3px 3px 0 var(--box-outline);
126 border-radius: var(--curve-md);
127 opacity: 1;
128 a {
129 color: var(--color);
130 }
131 }
132 }
133 }
125134</style>
126
web/src/components/form/ThemeSwitcher.svelte +1 −4
@@ -28,7 +28,6 @@
2828 }
2929</script>
3030
31
3231<!-- svelte-ignore a11y-click-events-have-key-events -->
3332<!-- svelte-ignore a11y-no-static-element-interactions -->
3433<div class="theme-switcher" on:click={toggleTheme}>
@@ -38,7 +37,6 @@
3837 </div>
3938</div>
4039
41
4240<style lang="scss">
4341 .theme-switcher {
4442 cursor: pointer;
@@ -52,7 +50,7 @@
5250 transition: background-color 0.3s ease;
5351 border: 2px solid var(--box-outline);
5452 box-shadow: 3px 3px 0 var(--box-outline);
55
53
5654 &:hover {
5755 background-color: rgba(255, 255, 255, 0.3);
5856 }
@@ -96,5 +94,4 @@
9694 display: flex;
9795 font-size: 1.5rem;
9896 }
99
10097</style>
web/src/components/scafold/Footer.astro +16 −18
@@ -1,23 +1,21 @@
1
21<footer>
3 <a href="/about">Awesome Privacy</a> is licensed
4 under <a href="https://github.com/Lissy93/awesome-privacy/blob/main/LICENSE">MIT</a>
5 © <a href="https://aliciasykes.com">Alicia Sykes</a> 2024 |
6 Source code available on <a href="https://github.com/Lissy93/awesome-privacy">GitHub</a>
2 <a href="/about">Awesome Privacy</a> is licensed under <a
3 href="https://github.com/Lissy93/awesome-privacy/blob/main/LICENSE">MIT</a
4 >
5 © <a href="https://aliciasykes.com">Alicia Sykes</a> 2024 | Source code available
6 on <a href="https://github.com/Lissy93/awesome-privacy">GitHub</a>
77</footer>
88
99<style lang="scss">
10 footer {
11 font-family: "Lekton", sans-serif;
12 font-weight: bold;
13 text-align: center;
14 padding: 0.5rem 0;
15 margin: 0 auto;
16 a {
17 font-family: "Lekton", sans-serif;
18 color: var(--accent);
19 }
20
21
22 }
10 footer {
11 font-family: 'Lekton', sans-serif;
12 font-weight: bold;
13 text-align: center;
14 padding: 0.5rem 0;
15 margin: 0 auto;
16 a {
17 font-family: 'Lekton', sans-serif;
18 color: var(--accent);
19 }
20 }
2321</style>
web/src/components/scafold/MainCard.astro +3 −5
@@ -1,7 +1,5 @@
1
2
31<main>
4 <slot />
2 <slot />
53</main>
64
75<style lang="scss">
@@ -11,8 +9,8 @@
119 width: 1200px;
1210 max-width: calc(100% - 5rem);
1311 border: 2px solid var(--box-outline);
14 box-shadow: 6px 6px 0 var(--box-outline);
12 box-shadow: 6px 6px 0 var(--box-outline);
1513 background: var(--accent-fg);
1614 position: relative;
17 }
15 }
1816</style>
web/src/components/scafold/NavBar.astro +100 −95
@@ -1,106 +1,111 @@
11---
2import FontAwesome from "@components/form/FontAwesome.svelte"
3import ThemeSwitcher from "@components/form/ThemeSwitcher.svelte"
4
2import FontAwesome from '@components/form/FontAwesome.svelte';
3import ThemeSwitcher from '@components/form/ThemeSwitcher.svelte';
54---
65
76<div class="nav">
8 <a href="/" class="homepage">
9 <FontAwesome iconName="logo" />
10 <h1>Awesome Privacy</h1>
11 </a>
12 <nav>
13 <a href="/browse">Browse</a>
14 <a href="/search">Search</a>
15 <a href="/about">About</a>
16 <a href="https://github.com/lissy93/awesome-privacy">GitHub</a>
17 <div class="theme-switcher">
18 <ThemeSwitcher client:load />
19 </div>
20 </nav>
7 <a href="/" class="homepage">
8 <FontAwesome iconName="logo" />
9 <h1>Awesome Privacy</h1>
10 </a>
11 <nav>
12 <a href="/browse">Browse</a>
13 <a href="/search">Search</a>
14 <a href="/about">About</a>
15 <a href="https://github.com/lissy93/awesome-privacy">GitHub</a>
16 <div class="theme-switcher">
17 <ThemeSwitcher client:load />
18 </div>
19 </nav>
2120</div>
2221
2322<style lang="scss">
24 .nav {
25 background: var(--accent-fg);
26 display: flex;
27 justify-content: space-between;
28 align-items: center;
29 flex-wrap: wrap;
30 gap: 1rem;
31 border-bottom: 2px solid var(--accent-3);
32
33 .homepage {
34 text-decoration: none;
35 display: flex;
36 align-items: center;
37 padding: 0 0.5rem;
38 h1 {
39 margin: 0;
40 font-size: 2.4rem;
41 padding: 0 1rem;
42 color: var(--foreground);
43 font-family: "Lekton", sans-serif;
44 }
45 :global(svg) {
46 width: 2.5rem;
47 height: 2.5rem;
48 color: var(--accent-3);
49 transition: all 0.2s ease-in-out;
50 }
51 &:hover {
52 :global(svg) {
53 color: var(--accent);
54 transform: scale(1.05);
55 }
56 }
57 }
23 .nav {
24 background: var(--accent-fg);
25 display: flex;
26 justify-content: space-between;
27 align-items: center;
28 flex-wrap: wrap;
29 gap: 1rem;
30 border-bottom: 2px solid var(--accent-3);
5831
59 nav {
60 display: flex;
61 align-items: center;
62 height: 3rem;
63 a {
64 padding: 1rem;
65 font-size: 1.2rem;
66 font-family: "Lekton", sans-serif;
67 font-weight: bold;
68 color: var(--foreground);
69 transition: background 0.3s, transform 0.3s, box-shadow 0.3s;
70 transition-timing-function: ease-in-out;
71 &:hover {
72 background: var(--accent-3);
73 color: var(--accent-fg);
74 border-bottom: 2px solid var(--accent-3);
75 &:nth-child(4n+1) {
76 background-color: var(--accent);
77 }
78 &:nth-child(4n+2) {
79 background-color: var(--accent-2);
80 color: var(--foreground);
81 }
82 &:nth-child(4n+3) {
83 background-color: var(--accent-3);
84 }
85 &:nth-child(4n+4) {
86 background-color: var(--accent-4);
87 color: var(--foreground);
88 }
89 }
90 }
91 .theme-switcher {
92 transform: scale(0.7);
93 margin: 0.2rem auto;
94 @media(max-width: 768px) {
95 display: none;
96 }
97 }
98 }
99 .homepage, nav {
100 @media(max-width: 768px) {
32 .homepage {
33 text-decoration: none;
34 display: flex;
35 align-items: center;
36 padding: 0 0.5rem;
37 h1 {
38 margin: 0;
39 font-size: 2.4rem;
40 padding: 0 1rem;
41 color: var(--foreground);
42 font-family: 'Lekton', sans-serif;
43 }
44 :global(svg) {
45 width: 2.5rem;
46 height: 2.5rem;
47 color: var(--accent-3);
48 transition: all 0.2s ease-in-out;
49 }
50 &:hover {
51 :global(svg) {
52 color: var(--accent);
53 transform: scale(1.05);
54 }
55 }
56 }
57
58 nav {
59 display: flex;
60 align-items: center;
61 height: 3rem;
62 a {
63 padding: 1rem;
64 font-size: 1.2rem;
65 font-family: 'Lekton', sans-serif;
66 font-weight: bold;
67 color: var(--foreground);
68 transition:
69 background 0.3s,
70 transform 0.3s,
71 box-shadow 0.3s;
72 transition-timing-function: ease-in-out;
73 &:hover {
74 background: var(--accent-3);
75 color: var(--accent-fg);
76 border-bottom: 2px solid var(--accent-3);
77 &:nth-child(4n + 1) {
78 background-color: var(--accent);
79 }
80 &:nth-child(4n + 2) {
81 background-color: var(--accent-2);
82 color: var(--foreground);
83 }
84 &:nth-child(4n + 3) {
85 background-color: var(--accent-3);
86 }
87 &:nth-child(4n + 4) {
88 background-color: var(--accent-4);
89 color: var(--foreground);
90 }
91 }
92 }
93 .theme-switcher {
94 transform: scale(0.7);
95 margin: 0.2rem auto;
96 @media (max-width: 768px) {
97 display: none;
98 }
99 }
100 }
101 .homepage,
102 nav {
103 @media (max-width: 768px) {
101104 margin: 0 auto;
102 a { border: none; }
105 a {
106 border: none;
107 }
103108 }
104 }
105 }
109 }
110 }
106111</style>
web/src/components/things/AddNewService.svelte +184 −75
@@ -23,11 +23,11 @@
2323 let codeBlock: any;
2424 let interactiveActivated = false;
2525
26 $: yamlText, updateHighlighting();
26 $: (yamlText, updateHighlighting());
2727
2828 function updateHighlighting() {
2929 if (codeBlock) {
30 codeBlock.textContent = yamlText
30 codeBlock.textContent = yamlText;
3131 codeBlock.dataset.highlighted && delete codeBlock.dataset.highlighted;
3232 if (window && (window as any).hljs) {
3333 (window as any).hljs.highlightElement(codeBlock);
@@ -38,15 +38,17 @@
3838
3939 const filterEmptyValues = (obj: Record<string, any>) => {
4040 const filteredObj: Record<string, any> = {};
41 Object.keys(obj).forEach(key => {
41 Object.keys(obj).forEach((key) => {
4242 if (obj[key] || ['name', 'url', 'icon', 'description'].includes(key)) {
4343 filteredObj[key] = obj[key];
4444 }
4545 });
4646 return filteredObj;
47 }
48
49 $: yamlText = yaml.dump([{
47 };
48
49 $: yamlText = yaml.dump(
50 [
51 {
5052 name: $serviceName,
5153 url: $serviceUrl,
5254 icon: $serviceIcon,
@@ -60,9 +62,12 @@
6062 openSource: $serviceOpenSource,
6163 securityAudited: $serviceSecurityAudited,
6264 acceptsCrypto: $serviceCrypto,
63 }].map(obj => filterEmptyValues(obj)));
65 },
66 ].map((obj) => filterEmptyValues(obj)),
67 );
6468
65 $: issueUrl = makeAdditionRequest({
69 $: issueUrl = makeAdditionRequest(
70 {
6671 listingCategory: $listingCategory,
6772 serviceName: $serviceName,
6873 serviceUrl: $serviceUrl,
@@ -78,7 +83,9 @@
7883 serviceSecurityAudited: $serviceSecurityAudited,
7984 serviceCrypto: $serviceCrypto,
8085 additionalInfo: $additionalInfo,
81 }, yamlText);
86 },
87 yamlText,
88 );
8289
8390 // Form submission handler
8491 function handleSubmit() {
@@ -87,29 +94,39 @@
8794</script>
8895
8996<svelte:head>
90<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/an-old-hope.min.css">
91<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script>
92<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/yaml.min.js"></script>
97 <link
98 rel="stylesheet"
99 href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/an-old-hope.min.css"
100 />
101 <script
102 src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"
103 ></script>
104 <script
105 src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/yaml.min.js"
106 ></script>
93107</svelte:head>
94108
95109<p>
96 Before completing this form, you must ensure that the service you are adding aligns
97 with the <a href="/about#creteria">Requirements</a> for Awesome Privacy.
110 Before completing this form, you must ensure that the service you are adding
111 aligns with the <a href="/about#creteria">Requirements</a> for Awesome
112 Privacy.
98113 <br />
99114 You'll need a GitHub account in order to submit this form.
100115</p>
101116
102117<form on:submit|preventDefault={handleSubmit}>
103
104118 <h3>Basics</h3>
105 <p class="sub-title-description">
106 All fields here are required.
107 </p>
119 <p class="sub-title-description">All fields here are required.</p>
108120
109121 <!-- Category Dropdown -->
110122 <div class="form-row">
111123 <label for="listing-category">Category</label>
112 <select bind:value={$listingCategory} id="listing-category" required autocomplete="off">
124 <select
125 bind:value={$listingCategory}
126 id="listing-category"
127 required
128 autocomplete="off"
129 >
113130 <option value="">--Please choose an option--</option>
114131 <option value="Essentials">Essentials</option>
115132 <option value="Communication">Communication</option>
@@ -126,45 +143,78 @@
126143 <option value="Creativity">Creativity</option>
127144 </select>
128145 <p>
129 Choose the top-level category, which should align with
130 the <a href="/browse">one of these</a>.
146 Choose the top-level category, which should align with the <a
147 href="/browse">one of these</a
148 >.
131149 </p>
132150 </div>
133151
134152 <!-- Listing Name -->
135153 <div class="form-row">
136154 <label for="service-name">Listing Name</label>
137 <input type="text" bind:value={$serviceName} id="service-name" required autocomplete="off">
155 <input
156 type="text"
157 bind:value={$serviceName}
158 id="service-name"
159 required
160 autocomplete="off"
161 />
138162 <p>Enter the name of the app, software or service</p>
139163 </div>
140164
141165 <!-- Listing URL -->
142166 <div class="form-row">
143167 <label for="service-url">Listing URL</label>
144 <input type="url" bind:value={$serviceUrl} id="service-url" required autocomplete="off">
145 <p>Enter the fully-qualified domain name of the homepage for this listing</p>
168 <input
169 type="url"
170 bind:value={$serviceUrl}
171 id="service-url"
172 required
173 autocomplete="off"
174 />
175 <p>
176 Enter the fully-qualified domain name of the homepage for this listing
177 </p>
146178 </div>
147
179
148180 <!-- Listing Icon -->
149181 <div class="form-row">
150182 <label for="service-icon">Listing Icon</label>
151 <input type="url" bind:value={$serviceIcon} id="service-icon" required autocomplete="off">
152 <p>Paste a URL to a square logo for the service. Dimensions must be no less than 64x64, and no more than 512x512 pixels</p>
183 <input
184 type="url"
185 bind:value={$serviceIcon}
186 id="service-icon"
187 required
188 autocomplete="off"
189 />
190 <p>
191 Paste a URL to a square logo for the service. Dimensions must be no less
192 than 64x64, and no more than 512x512 pixels
193 </p>
153194 </div>
154195
155196 <!-- Listing Description -->
156197 <div class="form-row">
157198 <label for="service-description">Listing Description</label>
158 <textarea bind:value={$serviceDescription} id="service-description" required autocomplete="off"></textarea>
159 <p>Please provide a description for this listing. Keep it factual and objective. Markdown is supported.</p>
199 <textarea
200 bind:value={$serviceDescription}
201 id="service-description"
202 required
203 autocomplete="off"
204 ></textarea>
205 <p>
206 Please provide a description for this listing. Keep it factual and
207 objective. Markdown is supported.
208 </p>
160209 </div>
161210
162211 <!-- Section 2 -->
163212 <h3>Third-Party Referencing</h3>
164213 <p class="sub-title-description">
165 In order to create a comprehensive listing, we combine the data inputted above with other sources,
166 to give additional context and help users make informed decisions.
167 Metrics from these services are fetched automatically at build-time from our API.
214 In order to create a comprehensive listing, we combine the data inputted
215 above with other sources, to give additional context and help users make
216 informed decisions. Metrics from these services are fetched automatically at
217 build-time from our API.
168218 <br />
169219 All fields are optional, but the more information you provide, the better!
170220 </p>
@@ -172,7 +222,13 @@
172222 <!-- GitHub Repository -->
173223 <div class="form-row">
174224 <label for="service-github">GitHub Repository</label>
175 <input type="text" bind:value={$serviceGithub} id="service-github" required autocomplete="off">
225 <input
226 type="text"
227 bind:value={$serviceGithub}
228 id="service-github"
229 required
230 autocomplete="off"
231 />
176232 <p>
177233 Share a link to where the project's source is located.<br />
178234 Use the format [user]/[repo] e.g, lissy93/dashy
@@ -182,18 +238,29 @@
182238 <!-- ToS;DR ID -->
183239 <div class="form-row">
184240 <label for="service-tosdr-id">ToS;DR ID</label>
185 <input type="number" bind:value={$serviceTosdrId} id="service-tosdr-id" autocomplete="off">
241 <input
242 type="number"
243 bind:value={$serviceTosdrId}
244 id="service-tosdr-id"
245 autocomplete="off"
246 />
186247 <p>
187 Has the Privacy policy been documented by <a href="https://tosdr.org/">tosdr.org</a>?
188 If so, please include the report reference below (this is a 3 or 4-digit numerical ID).
189 Skip section if not applicable.
248 Has the Privacy policy been documented by <a href="https://tosdr.org/"
249 >tosdr.org</a
250 >? If so, please include the report reference below (this is a 3 or
251 4-digit numerical ID). Skip section if not applicable.
190252 </p>
191253 </div>
192254
193255 <!-- Apple App Store URL -->
194256 <div class="form-row">
195257 <label for="service-tosdr-id">iOS App</label>
196 <input type="url" bind:value={$serviceIosApp} id="service-ios-app" autocomplete="off">
258 <input
259 type="url"
260 bind:value={$serviceIosApp}
261 id="service-ios-app"
262 autocomplete="off"
263 />
197264 <p>
198265 Paste the link to the mobile app on the Apple App Store.<br />
199266 E.g. https://apps.apple.com/us/app/bitwarden-password-manager/id1137397744
@@ -203,7 +270,12 @@
203270 <!-- Google Play App Store URL -->
204271 <div class="form-row">
205272 <label for="service-tosdr-id">Android App</label>
206 <input type="url" bind:value={$serviceAndroidApp} id="service-android-app" autocomplete="off">
273 <input
274 type="url"
275 bind:value={$serviceAndroidApp}
276 id="service-android-app"
277 autocomplete="off"
278 />
207279 <p>
208280 Paste the link to the mobile app on the Google Play Store.<br />
209281 E.g. https://play.google.com/store/apps/details?id=com.x8bit.bitwarden
@@ -213,17 +285,28 @@
213285 <!-- Discord Server Invite Code -->
214286 <div class="form-row">
215287 <label for="service-tosdr-id">Discord Invite</label>
216 <input type="text" bind:value={$serviceDiscordInvite} id="service-discord-invite" autocomplete="off">
288 <input
289 type="text"
290 bind:value={$serviceDiscordInvite}
291 id="service-discord-invite"
292 autocomplete="off"
293 />
217294 <p>
218295 Paste the invite code to the Discord server for this service.<br />
219 E.g. If the invite URL is https://discord.com/invite/4JMAauFZBq the code is 4JMAauFZBq
296 E.g. If the invite URL is https://discord.com/invite/4JMAauFZBq the code is
297 4JMAauFZBq
220298 </p>
221299 </div>
222300
223301 <!-- Reddit sub name -->
224302 <div class="form-row">
225303 <label for="service-tosdr-id">Subreddit</label>
226 <input type="text" bind:value={$serviceSubreddit} id="service-subreddit" autocomplete="off">
304 <input
305 type="text"
306 bind:value={$serviceSubreddit}
307 id="service-subreddit"
308 autocomplete="off"
309 />
227310 <p>
228311 If the service has a subreddit, please provide the name here.<br />
229312 Don't include `r/` in the name, nor the full URL - just the sub name.
@@ -233,70 +316,94 @@
233316 <!-- Section 3 - Checklist and details -->
234317 <h3>Privacy Checklist</h3>
235318 <p class="sub-title-description">
236 Finally, check the boxes that apply to the service you are submitting,
237 and then provide any additional information to back this up in the text area below.
319 Finally, check the boxes that apply to the service you are submitting, and
320 then provide any additional information to back this up in the text area
321 below.
238322 </p>
239323
240 <!-- Open Source Checkbox -->
324 <!-- Open Source Checkbox -->
241325 <div class="form-row">
242326 <label for="service-open-source">Is Open Source?</label>
243 <input type="checkbox" bind:checked={$serviceOpenSource} id="service-open-source">
244 <p>Is this service fully open source? Aka, can it be compiled from source by the user, or self-hosted?</p>
327 <input
328 type="checkbox"
329 bind:checked={$serviceOpenSource}
330 id="service-open-source"
331 />
332 <p>
333 Is this service fully open source? Aka, can it be compiled from source by
334 the user, or self-hosted?
335 </p>
245336 </div>
246337
247338 <!-- Security Audited Checkbox -->
248339 <div class="form-row">
249340 <label for="service-security-audited">Security Audited?</label>
250 <input type="checkbox" bind:checked={$serviceSecurityAudited} id="service-security-audited">
251 <p>Has this service been independently security audited by an accredited auditor?</p>
341 <input
342 type="checkbox"
343 bind:checked={$serviceSecurityAudited}
344 id="service-security-audited"
345 />
346 <p>
347 Has this service been independently security audited by an accredited
348 auditor?
349 </p>
252350 </div>
253351
254352 <!-- Accepts Crypto Checkbox -->
255353 <div class="form-row">
256354 <label for="service-crypto">Accepts Anon Payment?</label>
257 <input type="checkbox" bind:checked={$serviceCrypto} id="service-crypto">
258 <p>If this is a hosted and paid for service, does it accept anonymous payment methods, including crypto (e.g., Monero)?</p>
355 <input type="checkbox" bind:checked={$serviceCrypto} id="service-crypto" />
356 <p>
357 If this is a hosted and paid for service, does it accept anonymous payment
358 methods, including crypto (e.g., Monero)?
359 </p>
259360 </div>
260361
261362 <div class="final-info">
262 <p>
263 Finally, please provide any supporting material, including:
264 </p>
363 <p>Finally, please provide any supporting material, including:</p>
265364 <ul>
266365 <li>
267366 A justification of why this app/service should be included in the list
268367 </li>
368 <li>Links to any published security audit, if they exist</li>
269369 <li>
270 Links to any published security audit, if they exist
370 Links to the services privacy policy, terms of service and other
371 relevant documents where applicable
271372 </li>
272373 <li>
273 Links to the services privacy policy, terms of service and other relevant
274 documents where applicable
374 Your affiliation with the service. For transparency, you must disclose
375 if you are associated with them or any similar items in any way
275376 </li>
276377 <li>
277 Your affiliation with the service.
278 For transparency, you must disclose if you are associated
279 with them or any similar items in any way
378 Links to relevant discussions, past issues/PRs related to this service
280379 </li>
281 <li>Links to relevant discussions, past issues/PRs related to this service</li>
282380 </ul>
283 <textarea bind:value={$additionalInfo} id="additional-info" rows="5"></textarea>
381 <textarea bind:value={$additionalInfo} id="additional-info" rows="5"
382 ></textarea>
284383 </div>
285384
286385 <button type="submit">Submit</button>
287 <a href={issueUrl} target="_blank" class="open-in-gh">Open in GitHub Issues</a>
386 <a href={issueUrl} target="_blank" class="open-in-gh">Open in GitHub Issues</a
387 >
288388</form>
289389
290390<div class="output-yaml">
291 <p>Below is the YAML content, which will be appended to the appropriate section
292 within <a href="github.com/lissy93/awesome-privacy/blob/main/awesome-privacy.yml">awesome-privacy.yml</a>
391 <p>
392 Below is the YAML content, which will be appended to the appropriate section
393 within <a
394 href="github.com/lissy93/awesome-privacy/blob/main/awesome-privacy.yml"
395 >awesome-privacy.yml</a
396 >
293397 upon approval.
294398 </p>
295399 {#if !interactiveActivated || !codeBlock}
296400 <pre><code class="language-yaml">{@html yamlText}</code></pre>
297401 {/if}
298402 <pre><code bind:this={codeBlock} class="language-yaml"></code></pre>
299 <p>Your submission will need to be reviewed by a maintainer and the community before it can be merged.</p>
403 <p>
404 Your submission will need to be reviewed by a maintainer and the community
405 before it can be merged.
406 </p>
300407</div>
301408
302409<style lang="scss">
@@ -332,7 +439,9 @@
332439 }
333440 }
334441
335 input, textarea, select {
442 input,
443 textarea,
444 select {
336445 width: 100%;
337446 border: 1px solid var(--accent-3);
338447 border-radius: var(--curve-md);
@@ -347,15 +456,15 @@
347456 }
348457 input {
349458 height: fit-content;
350 &[type="number"]::-webkit-outer-spin-button,
351 &[type="number"]::-webkit-inner-spin-button {
352 -webkit-appearance: none;
353 margin: 0;
459 &[type='number']::-webkit-outer-spin-button,
460 &[type='number']::-webkit-inner-spin-button {
461 -webkit-appearance: none;
462 margin: 0;
354463 }
355 &[type="number"] {
356 -moz-appearance: textfield;
464 &[type='number'] {
465 -moz-appearance: textfield;
357466 }
358 &[type="checkbox"] {
467 &[type='checkbox'] {
359468 width: 2rem;
360469 height: 2rem;
361470 background: var(--background-form);
@@ -381,7 +490,7 @@
381490 box-shadow: 3px 3px 0 var(--box-outline);
382491 border-radius: var(--curve-lg);
383492 font-size: 1.8rem;
384 font-family: "Lekton", sans-serif;
493 font-family: 'Lekton', sans-serif;
385494 margin: 1rem auto;
386495 display: flex;
387496 transition: all 0.2s ease-in-out;
web/src/components/things/AndroidDetailedInfo.astro +162 −154
@@ -1,170 +1,178 @@
11---
2
32import type { AndroidInfo } from '@utils/fetch-android-info';
4import { formatDate, timeAgo } from '@utils/dates-n-stuff';
5import FontAwesome from "@components/form/FontAwesome.svelte"
6
3import { formatDate, timeAgo } from '@utils/dates-n-stuff';
4import FontAwesome from '@components/form/FontAwesome.svelte';
75
86interface Props {
9 androidData: AndroidInfo;
10};
7 androidData: AndroidInfo;
8}
119
1210const { androidData } = Astro.props;
1311
1412function permissionToReadable(permission: string): string {
15 return (permission
16 .split('.')
17 .pop() || '')
18 .replace(/_/g, ' ')
19 .toLowerCase()
20 .split(' ')
21 .map(word => word.charAt(0).toUpperCase() + word.slice(1))
22 .join(' ')
13 return (permission.split('.').pop() || '')
14 .replace(/_/g, ' ')
15 .toLowerCase()
16 .split(' ')
17 .map((word) => word.charAt(0).toUpperCase() + word.slice(1))
18 .join(' ');
2319}
24
25
2620---
2721
2822<div class="android-info-wrapper">
29 <div class="left">
30 <h4>Update Info</h4>
31 <ul class="list-table">
32 <li>
33 <span class="lbl">App</span>
34 <span class="val">
35 <!-- <img width="20" src={`https://reports.exodus-privacy.eu.org/en/reports/${androidData.version_code}/icon`} alt="Android Icon" /> -->
36 <a href={`https://play.google.com/store/apps/details?id=${androidData.handle}`}>{androidData.app_name}</a>
37 </span>
38 </li>
39 <li>
40 <span class="lbl">Creation Date</span>
41 <span class="val">{formatDate(androidData.created)}</span>
42 </li>
43 <li>
44 <span class="lbl">Last Updated</span>
45 <span class="val">{formatDate(androidData.updated)}</span>
46 </li>
47 <li>
48 <span class="lbl">Current Version</span>
49 <span class="val">{androidData.version_name}</span>
50 </li>
51 {androidData.creator && (
52 <li>
53 <span class="lbl">Creator</span>
54 <span class="val">{androidData.creator}</span>
55 </li>
56 )}
57 {androidData.downloads && (
58 <li>
59 <span class="lbl">Downloads</span>
60 <span class="val">{androidData.downloads}</span>
61 </li>
62 )}
63 </ul>
64
65 <h4>Trackers</h4>
66 {(androidData.trackers || []).length === 0 && (
67 <p class="all-good">
68 <FontAwesome iconName="noTrackers" />
69 No trackers found
70 </p>
71 )}
72 <ul class="list">
73 {(androidData.trackers || []).map((track) => (
74 <li title={track.code_signature}>{track.name}</li>
75 ))}
76 </ul>
77 </div>
78
79 <div class="right">
80 <h4>Permissions</h4>
81 {(androidData.permissions || []).length === 0 && (
82 <p class="all-good">
83 <FontAwesome iconName="noTrackers" />
84 No permissions required
85 </p>
86 )}
87 <ul class="list">
88 {(androidData.permissions || []).map((perm) => (
89 <li title={perm}>{permissionToReadable(perm)}</li>
90 ))}
91 </ul>
92 </div>
23 <div class="left">
24 <h4>Update Info</h4>
25 <ul class="list-table">
26 <li>
27 <span class="lbl">App</span>
28 <span class="val">
29 <!-- <img width="20" src={`https://reports.exodus-privacy.eu.org/en/reports/${androidData.version_code}/icon`} alt="Android Icon" /> -->
30 <a
31 href={`https://play.google.com/store/apps/details?id=${androidData.handle}`}
32 >{androidData.app_name}</a
33 >
34 </span>
35 </li>
36 <li>
37 <span class="lbl">Creation Date</span>
38 <span class="val">{formatDate(androidData.created)}</span>
39 </li>
40 <li>
41 <span class="lbl">Last Updated</span>
42 <span class="val">{formatDate(androidData.updated)}</span>
43 </li>
44 <li>
45 <span class="lbl">Current Version</span>
46 <span class="val">{androidData.version_name}</span>
47 </li>
48 {
49 androidData.creator && (
50 <li>
51 <span class="lbl">Creator</span>
52 <span class="val">{androidData.creator}</span>
53 </li>
54 )
55 }
56 {
57 androidData.downloads && (
58 <li>
59 <span class="lbl">Downloads</span>
60 <span class="val">{androidData.downloads}</span>
61 </li>
62 )
63 }
64 </ul>
65
66 <h4>Trackers</h4>
67 {
68 (androidData.trackers || []).length === 0 && (
69 <p class="all-good">
70 <FontAwesome iconName="noTrackers" />
71 No trackers found
72 </p>
73 )
74 }
75 <ul class="list">
76 {
77 (androidData.trackers || []).map((track) => (
78 <li title={track.code_signature}>{track.name}</li>
79 ))
80 }
81 </ul>
82 </div>
83
84 <div class="right">
85 <h4>Permissions</h4>
86 {
87 (androidData.permissions || []).length === 0 && (
88 <p class="all-good">
89 <FontAwesome iconName="noTrackers" />
90 No permissions required
91 </p>
92 )
93 }
94 <ul class="list">
95 {
96 (androidData.permissions || []).map((perm) => (
97 <li title={perm}>{permissionToReadable(perm)}</li>
98 ))
99 }
100 </ul>
101 </div>
93102</div>
94103
95
96104<style lang="scss">
97.android-info-wrapper {
98 display: flex;
99 flex-wrap: wrap;
100 justify-content: space-between;
101 gap: 1rem;
102 .left, .right {
103 width: calc(50% - 1rem);
104 @media screen and (max-width: 768px){
105 width: 100%;
106 }
107 }
108}
109
110h3 {
111 margin: 0;
112 font-size: 1.6rem;
113}
114
115h4 {
116 margin: 1rem 0 0 0;
117 font-size: 1.2rem;
118}
119
120ul {
121 padding-left: 0;
122 list-style: none;
123 max-height: 300px;
124 overflow-y: auto;
125 overflow-x: hidden;
126 img {
127 border-radius: var(--curve-sm);
128 }
129 .list-item {
130 display: flex;
131 flex-direction: column;
132 margin-bottom: 0.5rem;
133 }
134 &.list-table {
135 font-size: 0.9rem;
136 padding-left: 0;
137 li {
138 display: flex;
139 justify-content: space-between;
140 padding: 0.1rem 0;
141 .lbl {
142 font-weight: 400;
143 }
144 .val {
145 img {
146 margin-right: 0.5rem;
147 }
148 }
149 &:not(:last-child) {
150 border-bottom: 1px solid #5f53f440;
151 }
152 }
153 }
154 &.list {
155 list-style: circle;
156 padding-left: 1rem;
157 }
158}
159
160.all-good {
161 color: var(--success);
162 display: flex;
163 align-items: center;
164 gap: 0.5rem;
165 :global(svg) {
166 width: 1.5rem;
167 }
168}
169
105 .android-info-wrapper {
106 display: flex;
107 flex-wrap: wrap;
108 justify-content: space-between;
109 gap: 1rem;
110 .left,
111 .right {
112 width: calc(50% - 1rem);
113 @media screen and (max-width: 768px) {
114 width: 100%;
115 }
116 }
117 }
118
119 h3 {
120 margin: 0;
121 font-size: 1.6rem;
122 }
123
124 h4 {
125 margin: 1rem 0 0 0;
126 font-size: 1.2rem;
127 }
128
129 ul {
130 padding-left: 0;
131 list-style: none;
132 max-height: 300px;
133 overflow-y: auto;
134 overflow-x: hidden;
135 img {
136 border-radius: var(--curve-sm);
137 }
138 .list-item {
139 display: flex;
140 flex-direction: column;
141 margin-bottom: 0.5rem;
142 }
143 &.list-table {
144 font-size: 0.9rem;
145 padding-left: 0;
146 li {
147 display: flex;
148 justify-content: space-between;
149 padding: 0.1rem 0;
150 .lbl {
151 font-weight: 400;
152 }
153 .val {
154 img {
155 margin-right: 0.5rem;
156 }
157 }
158 &:not(:last-child) {
159 border-bottom: 1px solid #5f53f440;
160 }
161 }
162 }
163 &.list {
164 list-style: circle;
165 padding-left: 1rem;
166 }
167 }
168
169 .all-good {
170 color: var(--success);
171 display: flex;
172 align-items: center;
173 gap: 0.5rem;
174 :global(svg) {
175 width: 1.5rem;
176 }
177 }
170178</style>
web/src/components/things/Comments.svelte +20 −14
@@ -1,19 +1,25 @@
11<svelte:head>
22 <script async lang="javascript">
3 var remark_config = {
4 host: 'https://comments.as93.net', site_id: 'awesome-privacy.xyz',
5 components: ['embed'], show_rss_subsription: true, theme: 'dark',
6 };
7 !(function (e, n) {
8 for (var o = 0; o < e.length; o++) {
9 var r = n.createElement('script'), d = n.head || n.body;
10 'noModule' in r ?
11 (r.type = 'module', r.src = remark_config.host + '/web/' + e[o] + '.mjs')
12 : ( r.async = !0, r.defer = !0, r.src = remark_config.host + '/web/' + e[o] + '.js'),
13 d.appendChild(r);
14 }
15 })(remark_config.components || ['embed'], document);
16
3 var remark_config = {
4 host: 'https://comments.as93.net',
5 site_id: 'awesome-privacy.xyz',
6 components: ['embed'],
7 show_rss_subsription: true,
8 theme: 'dark',
9 };
10 !(function (e, n) {
11 for (var o = 0; o < e.length; o++) {
12 var r = n.createElement('script'),
13 d = n.head || n.body;
14 ('noModule' in r
15 ? ((r.type = 'module'),
16 (r.src = remark_config.host + '/web/' + e[o] + '.mjs'))
17 : ((r.async = !0),
18 (r.defer = !0),
19 (r.src = remark_config.host + '/web/' + e[o] + '.js')),
20 d.appendChild(r));
21 }
22 })(remark_config.components || ['embed'], document);
1723
1824</script>
1925</svelte:head>
web/src/components/things/DataActions.svelte +61 −45
@@ -1,18 +1,23 @@
11<script lang="ts">
2 import { onMount } from "svelte";
3 import { fetchSrcData, makeRemovalRequest, makeEditRequest } from '@utils/data-src-delete-n-edit';
2 import { onMount } from 'svelte';
3 import {
4 fetchSrcData,
5 makeRemovalRequest,
6 makeEditRequest,
7 } from '@utils/data-src-delete-n-edit';
48 import FontAwesome from '@components/form/FontAwesome.svelte';
59
610 export let categoryName: string;
711 export let sectionName: string;
812 export let serviceName: string;
913
10 let lineNumbers: { start: number, end: number } | null = null;
14 let lineNumbers: { start: number; end: number } | null = null;
1115 let yamlContent = '';
1216
1317 const getGitHubSrcFile = () => {
1418 if (lineNumbers) {
15 const baseFile = 'https://github.com/lissy93/awesome-privacy/blob/main/awesome-privacy.yml';
19 const baseFile =
20 'https://github.com/lissy93/awesome-privacy/blob/main/awesome-privacy.yml';
1621 return `${baseFile}#L${lineNumbers.start}-L${lineNumbers.end}`;
1722 }
1823 return '';
@@ -21,56 +26,68 @@
2126 const getIframeSrc = () => {
2227 const host = 'https://github-embed.as93.net';
2328 const target = encodeURIComponent(getGitHubSrcFile());
24 const opts = 'style=felipec&type=code&showBorder=on&showLineNumbers=on&showFileMeta=on&showFullPath=on&showCopy=on';
29 const opts =
30 'style=felipec&type=code&showBorder=on&showLineNumbers=on&showFileMeta=on&showFullPath=on&showCopy=on';
2531 return `${host}/iframe.html?target=${target}&${opts}`;
2632 };
2733
2834 onMount(async () => {
2935 const results = await fetchSrcData(categoryName, sectionName, serviceName);
30 lineNumbers = results.lineNumbers
36 lineNumbers = results.lineNumbers;
3137 yamlContent = results.yamlContent;
3238 });
33
3439</script>
3540
3641{#if lineNumbers}
37
38<h4>Edit {serviceName} Data</h4>
39<p>
40 You can view or edit this {serviceName}'s entry in
41 <a href={getGitHubSrcFile()}>
42 this section
43 </a>
44 of <code>awesome-privacy.yml</code> in our GitHub repo.
45</p>
46
47<h4>Origin Data</h4>
48<iframe
49 frameborder="0"
50 scrolling="no"
51 class="yaml-embed"
52 allow="clipboard-write"
53 title="awesome-privacy.yml"
54 src={getIframeSrc()}></iframe>
55
56<h4>Modify Data</h4>
57<div class="button-wrap">
58 <a class="button-link" target="_blank"
59 href={makeRemovalRequest(categoryName, sectionName, serviceName, yamlContent)}>
60 <FontAwesome iconName="delete" /> Delete {serviceName}
61 </a>
62 <a class="button-link" target="_blank"
63 href={makeEditRequest(categoryName, sectionName, serviceName, yamlContent)}>
64 <FontAwesome iconName="edit" /> Submit Edit to {serviceName}
65 </a>
66 <a class="button-link" href="/submit">
67 <FontAwesome iconName="add" /> Add alternative
68 </a>
69</div>
70
42 <h4>Edit {serviceName} Data</h4>
43 <p>
44 You can view or edit this {serviceName}'s entry in
45 <a href={getGitHubSrcFile()}> this section </a>
46 of <code>awesome-privacy.yml</code> in our GitHub repo.
47 </p>
48
49 <h4>Origin Data</h4>
50 <iframe
51 frameborder="0"
52 scrolling="no"
53 class="yaml-embed"
54 allow="clipboard-write"
55 title="awesome-privacy.yml"
56 src={getIframeSrc()}
57 ></iframe>
58
59 <h4>Modify Data</h4>
60 <div class="button-wrap">
61 <a
62 class="button-link"
63 target="_blank"
64 href={makeRemovalRequest(
65 categoryName,
66 sectionName,
67 serviceName,
68 yamlContent,
69 )}
70 >
71 <FontAwesome iconName="delete" /> Delete {serviceName}
72 </a>
73 <a
74 class="button-link"
75 target="_blank"
76 href={makeEditRequest(
77 categoryName,
78 sectionName,
79 serviceName,
80 yamlContent,
81 )}
82 >
83 <FontAwesome iconName="edit" /> Submit Edit to {serviceName}
84 </a>
85 <a class="button-link" href="/submit">
86 <FontAwesome iconName="add" /> Add alternative
87 </a>
88 </div>
7189{/if}
7290
73
7491<style lang="scss">
7592 h4 {
7693 font-size: 1.4rem;
@@ -85,7 +102,7 @@
85102 gap: 1rem;
86103 justify-content: center;
87104 margin: 1rem auto;
88 @media(max-width: 768px) {
105 @media (max-width: 768px) {
89106 flex-direction: column;
90107 }
91108 }
@@ -101,7 +118,7 @@
101118 min-width: 15rem;
102119 display: inline-block;
103120 text-align: center;
104 font-family: "Lekton",sans-serif;
121 font-family: 'Lekton', sans-serif;
105122 font-size: 1.2rem;
106123 :global(svg) {
107124 width: 1rem;
@@ -118,5 +135,4 @@
118135 margin: 1rem auto;
119136 box-shadow: 3px 3px 0 var(--accent-3);
120137 }
121
122138</style>
web/src/components/things/DeleteListing.svelte +38 −28
@@ -1,15 +1,17 @@
1
21<script lang="ts">
32 import FontAwesome from '@components/form/FontAwesome.svelte';
4 import { fetchSrcData, makeRemovalRequest } from '@utils/data-src-delete-n-edit';
3 import {
4 fetchSrcData,
5 makeRemovalRequest,
6 } from '@utils/data-src-delete-n-edit';
57 import { onMount } from 'svelte';
68
7
89 export let categoryName: string;
910 export let sectionName: string;
1011 export let serviceName: string;
1112
12 const apYaml = 'https://github.com/lissy93/awesome-privacy/blob/main/awesome-privacy.yml';
13 const apYaml =
14 'https://github.com/lissy93/awesome-privacy/blob/main/awesome-privacy.yml';
1315
1416 let yamlContent = '';
1517 let editLink = apYaml;
@@ -19,43 +21,51 @@
1921 yamlContent = results.yamlContent;
2022
2123 const lineNumbers = results.lineNumbers || null;
22 const numberRange = lineNumbers ? `#L${lineNumbers.start}-L${lineNumbers.end}` : '';
23 const yamlLink = 'https://github.com/lissy93/awesome-privacy/blob/main/awesome-privacy.yml';
24 const numberRange = lineNumbers
25 ? `#L${lineNumbers.start}-L${lineNumbers.end}`
26 : '';
27 const yamlLink =
28 'https://github.com/lissy93/awesome-privacy/blob/main/awesome-privacy.yml';
2429 editLink = `${yamlLink}${numberRange}`;
2530 });
26
2731</script>
2832
2933<div class="actions">
30 <a title="Edit" target="_blank"
31 href={editLink}>
34 <a title="Edit" target="_blank" href={editLink}>
3235 <FontAwesome iconName="edit" />
3336 </a>
34 <a title="Delete" target="_blank"
35 href={makeRemovalRequest(categoryName, sectionName, serviceName, yamlContent)}>
37 <a
38 title="Delete"
39 target="_blank"
40 href={makeRemovalRequest(
41 categoryName,
42 sectionName,
43 serviceName,
44 yamlContent,
45 )}
46 >
3647 <FontAwesome iconName="delete" />
3748 </a>
3849</div>
3950
4051<style lang="scss">
41.actions {
42 position: absolute;
43 right: 3.5rem;
44 top: 1rem;
45 width: 2.8rem;
46 gap: 1rem;
47 opacity: 0;
48 display: flex;
49 transition: all 0.2s ease-in-out;
50 a {
51 color: var(--foreground);
52 width: 1rem;
52 .actions {
53 position: absolute;
54 right: 3.5rem;
55 top: 1rem;
56 width: 2.8rem;
57 gap: 1rem;
58 opacity: 0;
59 display: flex;
5360 transition: all 0.2s ease-in-out;
54 &:hover {
55 color: var(--accent-3);
56 opacity: 1;
61 a {
62 color: var(--foreground);
63 width: 1rem;
64 transition: all 0.2s ease-in-out;
65 &:hover {
66 color: var(--accent-3);
67 opacity: 1;
68 }
5769 }
5870 }
59
60}
6171</style>
web/src/components/things/DiscordDetailedInfo.astro +100 −97
@@ -1,110 +1,113 @@
11---
2
32import type { DiscordInfo } from '@utils/fetch-discord-info';
4import { formatDate, timeAgo } from '@utils/dates-n-stuff';
5import FontAwesome from "@components/form/FontAwesome.svelte"
6
3import { formatDate, timeAgo } from '@utils/dates-n-stuff';
4import FontAwesome from '@components/form/FontAwesome.svelte';
75
86interface Props {
9 discordData: DiscordInfo;
10};
7 discordData: DiscordInfo;
8}
119
1210const { discordData } = Astro.props;
13
14
1511---
1612
1713<div class="discord-info-wrapper">
18
19 <h3>Discord</h3>
20
21 <ul class="list-table">
22 <li>
23 <span class="lbl">Server Name</span>
24 <span class="val"><img src={discordData.icon} width="16" />{discordData.name}</span>
25 </li>
26 <li>
27 <span class="lbl">Member Count</span>
28 <span class="val">{discordData.memberCount} ({discordData.memberOnlineCount} online)</span>
29 </li>
30 <li>
31 <span class="lbl">Initial Channel</span>
32 <span class="val">{discordData.channel}</span>
33 </li>
34 <li>
35 <span class="lbl">Inviter</span>
36 <span class="val">{discordData.inviter || 'Anon'}</span>
37 </li>
38 <li>
39 <span class="lbl">Join Link</span>
40 <span class="val"><a href={`https://discord.com/invite/${discordData.inviteCode}`}>discord.com/invite/{discordData.inviteCode}</a></span>
41 </li>
42 </ul>
43
44 { discordData.banner && (<img class="banner" width="300" src={discordData.banner} />)}
45
46
14 <h3>Discord</h3>
15
16 <ul class="list-table">
17 <li>
18 <span class="lbl">Server Name</span>
19 <span class="val"
20 ><img src={discordData.icon} width="16" />{discordData.name}</span
21 >
22 </li>
23 <li>
24 <span class="lbl">Member Count</span>
25 <span class="val"
26 >{discordData.memberCount} ({discordData.memberOnlineCount} online)</span
27 >
28 </li>
29 <li>
30 <span class="lbl">Initial Channel</span>
31 <span class="val">{discordData.channel}</span>
32 </li>
33 <li>
34 <span class="lbl">Inviter</span>
35 <span class="val">{discordData.inviter || 'Anon'}</span>
36 </li>
37 <li>
38 <span class="lbl">Join Link</span>
39 <span class="val"
40 ><a href={`https://discord.com/invite/${discordData.inviteCode}`}
41 >discord.com/invite/{discordData.inviteCode}</a
42 ></span
43 >
44 </li>
45 </ul>
46
47 {
48 discordData.banner && (
49 <img class="banner" width="300" src={discordData.banner} />
50 )
51 }
4752</div>
4853
49
5054<style lang="scss">
51.discord-info-wrapper {
52 display: flex;
53 flex-direction: column;
54 max-width: 400px;
55}
56
57h3 {
58 margin: 0;
59 font-size: 1.6rem;
60}
61
62h4 {
63 margin: 1rem 0 0 0;
64 font-size: 1.2rem;
65}
66
67ul {
68 padding-left: 0;
69 list-style: none;
70 max-height: 300px;
71 overflow-y: auto;
72 overflow-x: hidden;
73 img {
74 border-radius: var(--curve-sm);
75 }
76 .list-item {
77 display: flex;
78 flex-direction: column;
79 margin-bottom: 0.5rem;
80 }
81 &.list-table {
82 font-size: 0.9rem;
83 padding-left: 0;
84 li {
85 display: flex;
86 justify-content: space-between;
87 padding: 0.1rem 0;
88 .lbl {
89 font-weight: 400;
90 }
91 .val {
92 img {
93 margin-right: 0.5rem;
94 }
95 }
96 &:not(:last-child) {
97 border-bottom: 1px solid #5f53f440;
98 }
99 }
100 }
101}
102
103.banner {
104 width: 80%;
105 margin: 1rem auto 0 auto;
106 display: flex;
107 border-radius: var(--curve-md);
108}
109
55 .discord-info-wrapper {
56 display: flex;
57 flex-direction: column;
58 max-width: 400px;
59 }
60
61 h3 {
62 margin: 0;
63 font-size: 1.6rem;
64 }
65
66 h4 {
67 margin: 1rem 0 0 0;
68 font-size: 1.2rem;
69 }
70
71 ul {
72 padding-left: 0;
73 list-style: none;
74 max-height: 300px;
75 overflow-y: auto;
76 overflow-x: hidden;
77 img {
78 border-radius: var(--curve-sm);
79 }
80 .list-item {
81 display: flex;
82 flex-direction: column;
83 margin-bottom: 0.5rem;
84 }
85 &.list-table {
86 font-size: 0.9rem;
87 padding-left: 0;
88 li {
89 display: flex;
90 justify-content: space-between;
91 padding: 0.1rem 0;
92 .lbl {
93 font-weight: 400;
94 }
95 .val {
96 img {
97 margin-right: 0.5rem;
98 }
99 }
100 &:not(:last-child) {
101 border-bottom: 1px solid #5f53f440;
102 }
103 }
104 }
105 }
106
107 .banner {
108 width: 80%;
109 margin: 1rem auto 0 auto;
110 display: flex;
111 border-radius: var(--curve-md);
112 }
110113</style>
web/src/components/things/GetSharableLink.svelte +30 −28
@@ -1,37 +1,39 @@
1
21<script lang="ts">
2 import { slugify } from '@utils/fetch-data';
33
4import { slugify } from "@utils/fetch-data";
5
6let linkId = '';
7let done = false;
8let error = false;
4 let linkId = '';
5 let done = false;
6 let error = false;
97
10const save = async () => {
11 const savedServices = JSON.parse(localStorage.getItem('savedServices') || '[]');
12 const inventoryTitle = localStorage.getItem('userTitle') || 'Anon\'s Inventory';
13 const uniqueId = Math.random().toString(36).substring(2);
14 const saveKey = `${uniqueId}_${slugify(inventoryTitle)}`;
15 const url = 'https://awesome-privacy-share-api.as93.net';
16 const data = { key: saveKey, services: savedServices };
17 fetch(url, {
8 const save = async () => {
9 const savedServices = JSON.parse(
10 localStorage.getItem('savedServices') || '[]',
11 );
12 const inventoryTitle =
13 localStorage.getItem('userTitle') || "Anon's Inventory";
14 const uniqueId = Math.random().toString(36).substring(2);
15 const saveKey = `${uniqueId}_${slugify(inventoryTitle)}`;
16 const url = 'https://awesome-privacy-share-api.as93.net';
17 const data = { key: saveKey, services: savedServices };
18 fetch(url, {
1819 method: 'PUT',
1920 headers: { 'Content-Type': 'application/json' },
2021 body: JSON.stringify(data),
21 })
22 .then(response => response.json())
23 .then(data => {
24 linkId = data.key;
25 done = true;
26 error = false;
27 navigator.clipboard.writeText(`https://awesome-privacy.xyz/inventory/${linkId}`);
28 })
29 .catch(error => {
30 error = true;
31 console.error('Error:', error)
32 });
33};
34
22 })
23 .then((response) => response.json())
24 .then((data) => {
25 linkId = data.key;
26 done = true;
27 error = false;
28 navigator.clipboard.writeText(
29 `https://awesome-privacy.xyz/inventory/${linkId}`,
30 );
31 })
32 .catch((error) => {
33 error = true;
34 console.error('Error:', error);
35 });
36 };
3537</script>
3638
3739<div class="share-container">
web/src/components/things/RedditDetailedInfo.astro +179 −159
@@ -1,172 +1,192 @@
11---
2
32import type { RedditData } from '@utils/fetch-reddit-info';
4import { timestampToDate, timeAgo } from '@utils/dates-n-stuff';
5import FontAwesome from "@components/form/FontAwesome.svelte"
6
3import { timestampToDate, timeAgo } from '@utils/dates-n-stuff';
4import FontAwesome from '@components/form/FontAwesome.svelte';
75
86interface Props {
9 redditData: RedditData;
10};
7 redditData: RedditData;
8}
119
1210const { redditData } = Astro.props;
13
1411---
1512
1613<div class="reddit-info-wrapper">
17 <div class="left">
18 <h3>Reddit</h3>
19 <p class="website-title">
20 <img src={redditData.info.icon} width="16" />
21 {redditData.info.title || redditData.info.name}
22 </p>
23 <p class="website-description">{redditData.info.description}</p>
24 {redditData.info.banner && (<img class="banner" width="300" src={redditData.info.banner} alt="Banner" />)}
25 <ul class="list-table">
26 {redditData.info.dateCreated && (
27 <li>
28 <span class="lbl">Created at</span>
29 <span class="val">{timestampToDate(redditData.info.dateCreated * 1000)}</span>
30 </li>
31 )}
32 <li>
33 <span class="lbl">Members</span>
34 <span class="val">{redditData.info.subscribers}</span>
35 </li>
36 <li>
37 <span class="lbl">Join</span>
38 <span class="val"><a href={`https://reddit.com/${redditData.info.name}`}>{redditData.info.name}</a></span>
39 </li>
40 </ul>
41 </div>
42 <div class="right">
43 <h4>Posts</h4>
44 <ul class="posts">
45 {redditData.posts.map((post) => (
46 <li title={post.body}>
47 ○ <a href={post.url} target="_blank">{post.title}</a>
48 <span class="votes">(▲ {post.upVotes} ▼ {post.downVotes})</span>
49 </li>
50 ))}
51 </ul>
52 </div>
14 <div class="left">
15 <h3>Reddit</h3>
16 <p class="website-title">
17 <img src={redditData.info.icon} width="16" />
18 {redditData.info.title || redditData.info.name}
19 </p>
20 <p class="website-description">{redditData.info.description}</p>
21 {
22 redditData.info.banner && (
23 <img
24 class="banner"
25 width="300"
26 src={redditData.info.banner}
27 alt="Banner"
28 />
29 )
30 }
31 <ul class="list-table">
32 {
33 redditData.info.dateCreated && (
34 <li>
35 <span class="lbl">Created at</span>
36 <span class="val">
37 {timestampToDate(redditData.info.dateCreated * 1000)}
38 </span>
39 </li>
40 )
41 }
42 <li>
43 <span class="lbl">Members</span>
44 <span class="val">{redditData.info.subscribers}</span>
45 </li>
46 <li>
47 <span class="lbl">Join</span>
48 <span class="val"
49 ><a href={`https://reddit.com/${redditData.info.name}`}
50 >{redditData.info.name}</a
51 ></span
52 >
53 </li>
54 </ul>
55 </div>
56 <div class="right">
57 <h4>Posts</h4>
58 <ul class="posts">
59 {
60 redditData.posts.map((post) => (
61 <li title={post.body}>
62 ○{' '}
63 <a href={post.url} target="_blank">
64 {post.title}
65 </a>
66 <span class="votes">
67 (▲ {post.upVotes} ▼ {post.downVotes})
68 </span>
69 </li>
70 ))
71 }
72 </ul>
73 </div>
5374</div>
5475
55
5676<style lang="scss">
57.reddit-info-wrapper {
58 display: flex;
59 flex-wrap: wrap;
60 justify-content: space-between;
61 gap: 1rem;
62 .left, .right {
63 width: calc(50% - 1rem);
64 @media screen and (max-width: 768px){
65 width: 100%;
66 }
67 }
68}
69
70.banner {
71 margin: 0.5rem auto;
72 border-radius: var(--curve-md);
73 width: 100%;
74}
75
76h3 {
77 margin: 0 0 1rem 0;
78 font-size: 1.6rem;
79}
80
81h4 {
82 margin: 1rem 0 0 0;
83 font-size: 1.2rem;
84}
85p {
86 margin: 0;
87 display: flex;
88 align-items: center;
89 gap: 0.25rem;
90 :global(svg) {
91 width: 1rem;
92 }
93 img {
94 border-radius: var(--curve-sm);
95 }
96}
97
98ul {
99 padding-left: 0;
100 list-style: none;
101 max-height: 300px;
102 overflow-y: auto;
103 overflow-x: hidden;
104 img {
105 border-radius: var(--curve-sm);
106 }
107 .list-item {
108 display: flex;
109 flex-direction: column;
110 margin-bottom: 0.5rem;
111 }
112 &.list-table {
113 font-size: 0.9rem;
114 padding-left: 0;
115 li {
116 display: flex;
117 justify-content: space-between;
118 padding: 0.1rem 0;
119 .lbl {
120 font-weight: 400;
121 }
122 &:not(:last-child) {
123 border-bottom: 1px solid #5f53f440;
124 }
125 }
126 }
127}
128
129.posts {
130 list-style: circle;
131 padding-left: 1rem;
132 font-size: 0.9rem;
133 li {
134 display: -webkit-box;
135 -webkit-line-clamp: 1;
136 -webkit-box-orient: vertical;
137 overflow: hidden;
138 a {
139 max-width: 80%;
140 }
141 .votes {
142 font-size: 0.8rem;
143 opacity: 0.5;
144 }
145 }
146}
147
148.website-title, .website-description {
149 font-size: 0.9rem;
150 opacity: 0.8;
151 display: -webkit-box;
152 -webkit-line-clamp: 1;
153 -webkit-box-orient: vertical;
154 overflow: hidden;
155 border-left: 2px solid var(--accent-3);
156 padding-left: 0.5rem;
157}
158.website-title {
159 font-weight: 500;
160}
161.website-description {
162 font-style: italic;
163 -webkit-line-clamp: 3;
164}
165.explainer {
166 font-size: 0.8rem;
167 opacity: 0.8;
168 font-style: italic;
169}
170
171
77 .reddit-info-wrapper {
78 display: flex;
79 flex-wrap: wrap;
80 justify-content: space-between;
81 gap: 1rem;
82 .left,
83 .right {
84 width: calc(50% - 1rem);
85 @media screen and (max-width: 768px) {
86 width: 100%;
87 }
88 }
89 }
90
91 .banner {
92 margin: 0.5rem auto;
93 border-radius: var(--curve-md);
94 width: 100%;
95 }
96
97 h3 {
98 margin: 0 0 1rem 0;
99 font-size: 1.6rem;
100 }
101
102 h4 {
103 margin: 1rem 0 0 0;
104 font-size: 1.2rem;
105 }
106 p {
107 margin: 0;
108 display: flex;
109 align-items: center;
110 gap: 0.25rem;
111 :global(svg) {
112 width: 1rem;
113 }
114 img {
115 border-radius: var(--curve-sm);
116 }
117 }
118
119 ul {
120 padding-left: 0;
121 list-style: none;
122 max-height: 300px;
123 overflow-y: auto;
124 overflow-x: hidden;
125 img {
126 border-radius: var(--curve-sm);
127 }
128 .list-item {
129 display: flex;
130 flex-direction: column;
131 margin-bottom: 0.5rem;
132 }
133 &.list-table {
134 font-size: 0.9rem;
135 padding-left: 0;
136 li {
137 display: flex;
138 justify-content: space-between;
139 padding: 0.1rem 0;
140 .lbl {
141 font-weight: 400;
142 }
143 &:not(:last-child) {
144 border-bottom: 1px solid #5f53f440;
145 }
146 }
147 }
148 }
149
150 .posts {
151 list-style: circle;
152 padding-left: 1rem;
153 font-size: 0.9rem;
154 li {
155 display: -webkit-box;
156 -webkit-line-clamp: 1;
157 -webkit-box-orient: vertical;
158 overflow: hidden;
159 a {
160 max-width: 80%;
161 }
162 .votes {
163 font-size: 0.8rem;
164 opacity: 0.5;
165 }
166 }
167 }
168
169 .website-title,
170 .website-description {
171 font-size: 0.9rem;
172 opacity: 0.8;
173 display: -webkit-box;
174 -webkit-line-clamp: 1;
175 -webkit-box-orient: vertical;
176 overflow: hidden;
177 border-left: 2px solid var(--accent-3);
178 padding-left: 0.5rem;
179 }
180 .website-title {
181 font-weight: 500;
182 }
183 .website-description {
184 font-style: italic;
185 -webkit-line-clamp: 3;
186 }
187 .explainer {
188 font-size: 0.8rem;
189 opacity: 0.8;
190 font-style: italic;
191 }
172192</style>
web/src/components/things/SaveListing.svelte +22 −22
@@ -1,7 +1,7 @@
11<script lang="ts">
22 import { onMount } from 'svelte';
3 import FontAwesome from "@components/form/FontAwesome.svelte";
4 import { slugify } from "@utils/fetch-data";
3 import FontAwesome from '@components/form/FontAwesome.svelte';
4 import { slugify } from '@utils/fetch-data';
55
66 export let categoryName: string;
77 export let sectionName: string;
@@ -34,23 +34,24 @@
3434</script>
3535
3636<div class="wrapper-or-something">
37<button
38 class={`save-container ${isSaved ? 'saved' : ''} ${showLabel ? 'label-button' : ''}`}
39 title={`Save ${serviceName}`}
40 on:click={toggleSave}>
41 {#if showLabel }
42 <span>
43 {isSaved ? 'Saved' : 'Save'}
44 </span>
45 {/if}
46 <FontAwesome iconName="saveListing"/>
47</button>
37 <button
38 class={`save-container ${isSaved ? 'saved' : ''} ${showLabel ? 'label-button' : ''}`}
39 title={`Save ${serviceName}`}
40 on:click={toggleSave}
41 >
42 {#if showLabel}
43 <span>
44 {isSaved ? 'Saved' : 'Save'}
45 </span>
46 {/if}
47 <FontAwesome iconName="saveListing" />
48 </button>
4849
49{#if showLabel && isSaved }
50<div class="done-msg">
51 You can view all saved items in your <a href="/inventory">Inventory</a>
52</div>
53{/if}
50 {#if showLabel && isSaved}
51 <div class="done-msg">
52 You can view all saved items in your <a href="/inventory">Inventory</a>
53 </div>
54 {/if}
5455</div>
5556
5657<style lang="scss">
@@ -71,7 +72,7 @@
7172 font-size: 1.2rem;
7273 opacity: 0.8;
7374 color: var(--foreground);
74 font-family: "Lekton";
75 font-family: 'Lekton';
7576 }
7677 :global(svg) {
7778 color: var(--foreground);
@@ -98,9 +99,8 @@
9899 box-shadow: 3px 3px 0 var(--box-outline);
99100 border: 1px solid var(--box-outline);
100101 background: var(--background-form);
101
102
102103 &:hover {
103
104104 box-shadow: 4px 4px 0 var(--box-outline);
105105 }
106106 }
@@ -110,7 +110,7 @@
110110 max-width: 165px;
111111 font-size: 0.8rem;
112112 opacity: 0.6;
113 @media(max-width: 768px) {
113 @media (max-width: 768px) {
114114 display: none;
115115 }
116116 }
web/src/components/things/SavedServices.svelte +43 −34
@@ -1,42 +1,48 @@
11<script lang="ts">
2import { onMount } from 'svelte';
3import { writable } from 'svelte/store';
2 import { onMount } from 'svelte';
3 import { writable } from 'svelte/store';
44
5import type { Category, Service } from '../../types/Service';
6import { slugify } from "@utils/fetch-data";
7import ServiceCard from './ServiceCard.svelte';
5 import type { Category, Service } from '../../types/Service';
6 import { slugify } from '@utils/fetch-data';
7 import ServiceCard from './ServiceCard.svelte';
88
9export let allData: Category[];
10export let serviceList: string[] | null = null;
9 export let allData: Category[];
10 export let serviceList: string[] | null = null;
1111
12interface SavedServices {
13 category: string;
14 section: string;
15 service: Service;
16}
12 interface SavedServices {
13 category: string;
14 section: string;
15 service: Service;
16 }
1717
18const savedServices = writable<SavedServices[]>([]);
18 const savedServices = writable<SavedServices[]>([]);
1919
20onMount(async () => {
21 const results: SavedServices[] = [];
22 const saved = serviceList || JSON.parse(localStorage.getItem('savedServices') || '[]');
23 saved.forEach((serviceId: string) => {
24 const parts = serviceId.split('/');
25 const categoryName = parts[0];
26 const sectionName = parts[1];
27 const serviceName = parts[2];
20 onMount(async () => {
21 const results: SavedServices[] = [];
22 const saved =
23 serviceList || JSON.parse(localStorage.getItem('savedServices') || '[]');
24 saved.forEach((serviceId: string) => {
25 const parts = serviceId.split('/');
26 const categoryName = parts[0];
27 const sectionName = parts[1];
28 const serviceName = parts[2];
2829
29 const category = allData.find((category) => slugify(category.name) === categoryName);
30 if (!category) return;
31 const section = category.sections.find((section) => slugify(section.name) === sectionName);
32 if (!section) return;
33 const service = section.services.find((service) => slugify(service.name) === serviceName);
34 if (!service) return;
35 results.push({ category: category.name, section: section.name, service});
30 const category = allData.find(
31 (category) => slugify(category.name) === categoryName,
32 );
33 if (!category) return;
34 const section = category.sections.find(
35 (section) => slugify(section.name) === sectionName,
36 );
37 if (!section) return;
38 const service = section.services.find(
39 (service) => slugify(service.name) === serviceName,
40 );
41 if (!service) return;
42 results.push({ category: category.name, section: section.name, service });
43 });
44 savedServices.set(results || []);
3645 });
37 savedServices.set(results || []);
38});
39
4046</script>
4147
4248<div>
@@ -52,10 +58,13 @@ onMount(async () => {
5258 </div>
5359 {:else if !serviceList}
5460 <div class="nothing-yet">
55 <p>Here you'll find a list of all the software and services you've bookmarked.</p>
61 <p>
62 Here you'll find a list of all the software and services you've
63 bookmarked.
64 </p>
5665 <small>
57 All data is stored on-device, in your browser's local storage,
58 and not sent anywhere unless you choose to share it
66 All data is stored on-device, in your browser's local storage, and not
67 sent anywhere unless you choose to share it
5968 </small>
6069 <p class="nope">Nothing saved yet!</p>
6170 </div>
web/src/components/things/Search.svelte +134 −115
@@ -2,7 +2,12 @@
22 import { onMount } from 'svelte';
33 import Fuse from 'fuse.js';
44 import { slugify } from '@utils/fetch-data';
5 import type { Category, Section, Service, ShortService } from '../../types/Service';
5 import type {
6 Category,
7 Section,
8 Service,
9 ShortService,
10 } from '../../types/Service';
611 import { formatLink } from '@utils/parse-markdown';
712 import { prepareSearchItems, searchOptions } from '@utils/do-searchy-searchy';
813
@@ -20,9 +25,9 @@
2025 });
2126
2227 const makeResultLink = (cat?: string, sec?: string, itm?: string) => {
23 if (!cat) return '/'
24 if (!sec) return `/${slugify(cat)}`
25 if (!itm) return `/${slugify(cat)}/${slugify(sec)}`
28 if (!cat) return '/';
29 if (!sec) return `/${slugify(cat)}`;
30 if (!itm) return `/${slugify(cat)}/${slugify(sec)}`;
2631 return `/${slugify(cat)}/${slugify(sec)}/${slugify(itm)}`;
2732 };
2833
@@ -40,7 +45,7 @@
4045
4146 const makeTitle = (typ: string, desc: string) => {
4247 if (desc && typ === 'Service') {
43 return `${desc.slice(0, 60)}...`
48 return `${desc.slice(0, 60)}...`;
4449 }
4550 return '';
4651 };
@@ -59,7 +64,10 @@
5964
6065 // Watch for changes in the search query and update results
6166 $: if (searchQuery) {
62 results = fuse.search(searchQuery).map(result => result.item).splice(0, 25);
67 results = fuse
68 .search(searchQuery)
69 .map((result) => result.item)
70 .splice(0, 25);
6371 } else {
6472 results = [];
6573 }
@@ -79,35 +87,48 @@
7987 bind:value={searchQuery}
8088 on:keydown={handleKeyDown}
8189 />
82
83
90
8491 {#if searchQuery.length > 0}
8592 <div class="suggestions">
8693 <ul>
8794 {#each results as result}
88 <li class="result-row">
89 <a
90 href={makeResultLink(result.category, result.sectionName, result.name)}
91 title={makeTitle(result.type, result.description)}
95 <li class="result-row">
96 <a
97 href={makeResultLink(
98 result.category,
99 result.sectionName,
100 result.name,
101 )}
102 title={makeTitle(result.type, result.description)}
92103 >
93 <span class="name">
94 {#if result.type === 'Service'}
95 <img src={makeLogoSrc(result.logo, result.url)} alt={result.name} width="20" height="20" loading="lazy" />
96 {/if}
97
98 {makeResultText(result.category, result.sectionName, result.name)}
99
100 {#if result.itemCount}
101 <i>({result.itemCount})</i>
102 {/if}
103 </span>
104 <span class="path">
105 {result.category ? `${result.category}` : ''}
106 {result.sectionName ? `➔ ${result.sectionName}` : ''}
107 {result.name ? `➔ ${result.name}` : ''}
108 </span>
109 </a>
110 </li>
104 <span class="name">
105 {#if result.type === 'Service'}
106 <img
107 src={makeLogoSrc(result.logo, result.url)}
108 alt={result.name}
109 width="20"
110 height="20"
111 loading="lazy"
112 />
113 {/if}
114
115 {makeResultText(
116 result.category,
117 result.sectionName,
118 result.name,
119 )}
120
121 {#if result.itemCount}
122 <i>({result.itemCount})</i>
123 {/if}
124 </span>
125 <span class="path">
126 {result.category ? `${result.category}` : ''}
127 {result.sectionName ? `➔ ${result.sectionName}` : ''}
128 {result.name ? `➔ ${result.name}` : ''}
129 </span>
130 </a>
131 </li>
111132 {/each}
112133 </ul>
113134 </div>
@@ -115,103 +136,101 @@
115136</div>
116137
117138<style lang="scss">
118
119.search-wrap {
120 display: flex;
121 flex-direction: column;
122 position: relative;
123 margin: 1rem auto;
124 max-width: 900px;
125 margin: 0 auto;
126 width: 80vw;
127 label {
128 margin: 0.5rem 0;
139 .search-wrap {
129140 display: flex;
130 justify-content: space-between;
131 align-items: center;
132 flex-wrap: wrap;
133 .enter-hint {
134 font-size:0.8rem;
135 opacity: 0.7;
136 }
137 }
138
139 input {
140 padding: 0.5rem 1rem;
141 font-size: 1.8rem;
142 border: 2px solid var(--box-outline);
143 border-radius: var(--curve-lg);
144 box-shadow: 3px 3px 0 var(--box-outline);
145 z-index: 4;
146 background: var(--accent-fg);
147 color: var(--foreground);
148 &:focus {
149 outline: none;
150 border-color: var(--accent);
151 box-shadow: 3px 3px 0 var(--accent);
141 flex-direction: column;
142 position: relative;
143 margin: 1rem auto;
144 max-width: 900px;
145 margin: 0 auto;
146 width: 80vw;
147 label {
148 margin: 0.5rem 0;
149 display: flex;
150 justify-content: space-between;
151 align-items: center;
152 flex-wrap: wrap;
153 .enter-hint {
154 font-size: 0.8rem;
155 opacity: 0.7;
156 }
152157 }
153 }
154
155 .suggestions {
156 ul {
157 position: absolute;
158 background: var(--background-form);
159 z-index: 3;
160 width: 100%;
161158
162 list-style: none;
163 padding: 0;
164 margin: 0;
159 input {
160 padding: 0.5rem 1rem;
161 font-size: 1.8rem;
165162 border: 2px solid var(--box-outline);
166 border-radius: 0 0 var(--curve-lg) var(--curve-lg);
163 border-radius: var(--curve-lg);
167164 box-shadow: 3px 3px 0 var(--box-outline);
168 transform: translateY(-0.5rem);
169 max-height: 500px;
170 overflow-y: scroll;
171 background: var(--background-form);
172 li.result-row {
173 padding: 0.5rem 1rem;
174 margin: 0.5rem 0;
175 a {
176 color: var(--foreground);
177 text-decoration: none;
178 display: flex;
179 justify-content: space-between;
180 flex-wrap: wrap;
181 .name {
165 z-index: 4;
166 background: var(--accent-fg);
167 color: var(--foreground);
168 &:focus {
169 outline: none;
170 border-color: var(--accent);
171 box-shadow: 3px 3px 0 var(--accent);
172 }
173 }
174
175 .suggestions {
176 ul {
177 position: absolute;
178 background: var(--background-form);
179 z-index: 3;
180 width: 100%;
181
182 list-style: none;
183 padding: 0;
184 margin: 0;
185 border: 2px solid var(--box-outline);
186 border-radius: 0 0 var(--curve-lg) var(--curve-lg);
187 box-shadow: 3px 3px 0 var(--box-outline);
188 transform: translateY(-0.5rem);
189 max-height: 500px;
190 overflow-y: scroll;
191 background: var(--background-form);
192 li.result-row {
193 padding: 0.5rem 1rem;
194 margin: 0.5rem 0;
195 a {
196 color: var(--foreground);
197 text-decoration: none;
182198 display: flex;
183 align-items: center;
184 gap: 0.5rem;
185 i {
186 color: var(--accent);
187 font-weight: bold;
188 font-style: normal;
199 justify-content: space-between;
200 flex-wrap: wrap;
201 .name {
202 display: flex;
203 align-items: center;
204 gap: 0.5rem;
205 i {
206 color: var(--accent);
207 font-weight: bold;
208 font-style: normal;
209 }
210 img {
211 border-radius: var(--curve-md);
212 width: 1.25rem;
213 height: 1.25rem;
214 font-size: 10px;
215 color: var(--accent);
216 overflow: hidden;
217 background: #f453974d;
218 padding: 1px;
219 }
189220 }
190 img {
191 border-radius: var(--curve-md);
192 width: 1.25rem;
193 height: 1.25rem;
194 font-size: 10px;
195 color: var(--accent);
196 overflow: hidden;
197 background: #f453974d;
198 padding: 1px;
221 .path {
222 font-size: 0.85rem;
223 opacity: 0.7;
199224 }
200225 }
201 .path {
202 font-size: 0.85rem;
203 opacity: 0.7;
204 }
205 }
206 &:hover {
207 background: var(--accent);
208 .name i {
209 color: var(--accent-fg);
226 &:hover {
227 background: var(--accent);
228 .name i {
229 color: var(--accent-fg);
230 }
210231 }
211232 }
212233 }
213234 }
214235 }
215}
216
217236</style>
web/src/components/things/SectionList.astro +148 −133
@@ -1,6 +1,4 @@
11---
2
3
42import FontAwesome from '@components/form/FontAwesome.svelte';
53import { slugify } from '../../utils/fetch-data';
64
@@ -9,144 +7,161 @@ import type { Section } from '../../types/Service';
97interface Props {
108 title: string;
119 sections: Section[];
12 bigTitle?: boolean;
10 bigTitle?: boolean;
1311}
1412
1513const { title, sections, bigTitle } = Astro.props;
16
1714---
1815
1916<div class="wrap">
20
21{ bigTitle ?
22 <h2><FontAwesome iconName={slugify(title)} />{title} </h2> :
23 <a class="category-title" href={`/${slugify(title)}`}><h3>{title}</h3></a>
24}
25
26{ !bigTitle && <span class="section-icon"><FontAwesome iconName={slugify(title)} /></span> }
27
28<ul>
29 {sections.map((section) => (
30 <li class="section">
31 <a href={`/${slugify(title)}/${slugify(section.name)}`}>
32 <span>{section.name}</span>
33 <span class="service-count">({section.services ? section.services.length : 0})</span>
34 </a>
35 </li>
36 ))}
37</ul>
17 {
18 bigTitle ? (
19 <h2>
20 <FontAwesome iconName={slugify(title)} />
21 {title}{' '}
22 </h2>
23 ) : (
24 <a class="category-title" href={`/${slugify(title)}`}>
25 <h3>{title}</h3>
26 </a>
27 )
28 }
29
30 {
31 !bigTitle && (
32 <span class="section-icon">
33 <FontAwesome iconName={slugify(title)} />
34 </span>
35 )
36 }
37
38 <ul>
39 {
40 sections.map((section) => (
41 <li class="section">
42 <a href={`/${slugify(title)}/${slugify(section.name)}`}>
43 <span>{section.name}</span>
44 <span class="service-count">
45 ({section.services ? section.services.length : 0})
46 </span>
47 </a>
48 </li>
49 ))
50 }
51 </ul>
3852</div>
3953
40
4154<style lang="scss">
42
43.wrap {
44 position: relative;
45 &:hover {
46 .section-icon :global(svg){
47 opacity: 1;
48 transform: scale(1.2);
49 }
50 }
51}
52
53h2 {
54 font-family: "Lekton", sans-serif;
55 font-size: 2rem;
56 margin: -2rem 0 2rem -2rem;
57 box-shadow: 6px 6px 0 var(--box-outline);
58 border: 2px solid var(--box-outline);
59 background: var(--accent);
60 color: var(--accent-fg);
61 width: fit-content;
62 padding: 0.25rem 0.5rem;
63 display: flex;
64 justify-content: center;
65 gap: 1rem;
66 :global(svg) {
67 width: 2rem;
68 height: 2rem;
69 color: var(--accent-fg);
70 }
71}
72
73.category-title {
74 text-decoration: none;
75 color: var(--foreground);
76 z-index: 2;
77 position: relative;
78 h3 {
79 font-family: "Lekton", sans-serif;
80 font-weight: bold;
81 margin: 0;
82 font-size: 1.8rem;
83 position: relative;
84 &:after {
85 background: none repeat scroll 0 0 transparent;
86 bottom: 0;
87 content: "";
88 display: block;
89 height: 3px;
90 left: 50%;
91 position: absolute;
92 background: var(--accent);
93 transition: width 0.3s ease 0s, left 0.3s ease 0s;
94 width: 0;
95 }
96 &:hover:after {
97 width: 80%;
98 left: 0;
99 }
100 }
101
102}
103
104ul {
105 list-style: circle;
106 padding-left: 1rem;
107 li {
108 margin: 0.5rem 0;
109 font-size: 1.25rem;
110 a {
111 text-decoration: none;
112 color: var(--foreground);
113 position: relative;
114 &:after {
115 background: none repeat scroll 0 0 transparent;
116 bottom: 0;
117 content: "";
118 display: block;
119 height: 2px;
120 left: 50%;
121 position: absolute;
122 background: var(--accent-3);
123 transition: width 0.15s ease 0s, left 0.15s ease 0s;
124 width: 0;
125 }
126 &:hover:after {
127 text-decoration: underline;
128 width: 80%;
129 left: 0;
130 }
131 }
132 .service-count {
133 color: var(--accent-3);
134 }
135 }
136}
137
138.section-icon {
139 position: absolute;
140 right: 0;
141 top: 0;
142 width: fit-content;
143 :global(svg) {
144 width: 2rem;
145 height: 2rem;
146 opacity: 0.5;
147 text-shadow: 3px 3px 0 black;
148 color: var(--accent-3);
149 transition: all 0.2s ease-in-out;
150 }
151}
55 .wrap {
56 position: relative;
57 &:hover {
58 .section-icon :global(svg) {
59 opacity: 1;
60 transform: scale(1.2);
61 }
62 }
63 }
64
65 h2 {
66 font-family: 'Lekton', sans-serif;
67 font-size: 2rem;
68 margin: -2rem 0 2rem -2rem;
69 box-shadow: 6px 6px 0 var(--box-outline);
70 border: 2px solid var(--box-outline);
71 background: var(--accent);
72 color: var(--accent-fg);
73 width: fit-content;
74 padding: 0.25rem 0.5rem;
75 display: flex;
76 justify-content: center;
77 gap: 1rem;
78 :global(svg) {
79 width: 2rem;
80 height: 2rem;
81 color: var(--accent-fg);
82 }
83 }
84
85 .category-title {
86 text-decoration: none;
87 color: var(--foreground);
88 z-index: 2;
89 position: relative;
90 h3 {
91 font-family: 'Lekton', sans-serif;
92 font-weight: bold;
93 margin: 0;
94 font-size: 1.8rem;
95 position: relative;
96 &:after {
97 background: none repeat scroll 0 0 transparent;
98 bottom: 0;
99 content: '';
100 display: block;
101 height: 3px;
102 left: 50%;
103 position: absolute;
104 background: var(--accent);
105 transition:
106 width 0.3s ease 0s,
107 left 0.3s ease 0s;
108 width: 0;
109 }
110 &:hover:after {
111 width: 80%;
112 left: 0;
113 }
114 }
115 }
116
117 ul {
118 list-style: circle;
119 padding-left: 1rem;
120 li {
121 margin: 0.5rem 0;
122 font-size: 1.25rem;
123 a {
124 text-decoration: none;
125 color: var(--foreground);
126 position: relative;
127 &:after {
128 background: none repeat scroll 0 0 transparent;
129 bottom: 0;
130 content: '';
131 display: block;
132 height: 2px;
133 left: 50%;
134 position: absolute;
135 background: var(--accent-3);
136 transition:
137 width 0.15s ease 0s,
138 left 0.15s ease 0s;
139 width: 0;
140 }
141 &:hover:after {
142 text-decoration: underline;
143 width: 80%;
144 left: 0;
145 }
146 }
147 .service-count {
148 color: var(--accent-3);
149 }
150 }
151 }
152
153 .section-icon {
154 position: absolute;
155 right: 0;
156 top: 0;
157 width: fit-content;
158 :global(svg) {
159 width: 2rem;
160 height: 2rem;
161 opacity: 0.5;
162 text-shadow: 3px 3px 0 black;
163 color: var(--accent-3);
164 transition: all 0.2s ease-in-out;
165 }
166 }
152167</style>
web/src/components/things/ServiceCard.astro +75 −71
@@ -1,5 +1,4 @@
11---
2
32import { formatLink } from '@utils/parse-markdown';
43import type { Service } from 'src/types/Service';
54import FontAwesome from '@components/form/FontAwesome.svelte';
@@ -7,86 +6,91 @@ import SaveListing from '@components/things/SaveListing.svelte';
76import { slugify } from '@utils/fetch-data';
87
98interface Props {
10 service: Service;
11 categoryName: string;
12 sectionName: string;
9 service: Service;
10 categoryName: string;
11 sectionName: string;
1312}
1413
15const {
16 service,
17 sectionName,
18 categoryName,
19} = Astro.props;
20
14const { service, sectionName, categoryName } = Astro.props;
2115---
2216
2317<script>
24 document.addEventListener('DOMContentLoaded', () => {
25 const serviceIcons = document.querySelectorAll<HTMLImageElement>('.service-icon');
26 const broke = '/broken-image.png';
18 document.addEventListener('DOMContentLoaded', () => {
19 const serviceIcons =
20 document.querySelectorAll<HTMLImageElement>('.service-icon');
21 const broke = '/broken-image.png';
2722
28 serviceIcons.forEach(function(icon) {
29 icon.onerror = function() {
30 const imgElement = this as HTMLImageElement;
31 const serviceUrl = imgElement.getAttribute('data-service-url');
32 const newSrcAttribute = (imgElement.src.includes('on.ho') ? broke : `https://icon.horse/icon/${serviceUrl}`);
33 imgElement.src = imgElement.src !== newSrcAttribute ? newSrcAttribute : broke;
34 imgElement.onerror = null;
35 };
36 });
37});
23 serviceIcons.forEach(function (icon) {
24 icon.onerror = function () {
25 const imgElement = this as HTMLImageElement;
26 const serviceUrl = imgElement.getAttribute('data-service-url');
27 const newSrcAttribute = imgElement.src.includes('on.ho')
28 ? broke
29 : `https://icon.horse/icon/${serviceUrl}`;
30 imgElement.src =
31 imgElement.src !== newSrcAttribute ? newSrcAttribute : broke;
32 imgElement.onerror = null;
33 };
34 });
35 });
3836</script>
3937
40
41
4238<div class="service" id={slugify(service.name)}>
43 <div class="service-head">
44 <a class="service-title" href={`/${slugify(categoryName)}/${slugify(sectionName)}/${slugify(service.name)}`}>
45 <h4>{service.name}</h4>
46 </a>
47 {service.followWith && <p class="follow-with">({service.followWith})</p> }
48 </div>
49
50 <div class="save-listing">
51 <SaveListing client:visible
52 categoryName={categoryName}
53 sectionName={sectionName}
54 serviceName={service.name}
55 />
56 </div>
39 <div class="service-head">
40 <a
41 class="service-title"
42 href={`/${slugify(categoryName)}/${slugify(sectionName)}/${slugify(service.name)}`}
43 >
44 <h4>{service.name}</h4>
45 </a>
46 {service.followWith && <p class="follow-with">({service.followWith})</p>}
47 </div>
5748
58 <div class="service-body">
59 <img
60 width="40"
61 height="40"
62 loading="lazy"
63 decoding="async"
64 class="service-icon"
65 alt={`${service.name} Icon`}
66 data-service-url={formatLink(service.url)}
67 src={service.icon || `https://icon.horse/icon/${formatLink(service.url)}`}
68 />
69 <div class="service-body">
70 <p set:html={service.description}></p>
71 </div>
72 </div>
49 <div class="save-listing">
50 <SaveListing
51 client:visible
52 categoryName={categoryName}
53 sectionName={sectionName}
54 serviceName={service.name}
55 />
56 </div>
7357
74 <div class="service-links">
75 <a class="link" href={service.url}>
76 <FontAwesome iconName="website"/> <span>{formatLink(service.url)}</span>
77 </a>
78 {service.github &&
79 <a class="link" href={`https://github.com/${service.github}`}>
80 <FontAwesome iconName="sourceCode"/> GitHub
81 </a>
82 }
83 <a href={`/${slugify(categoryName)}/${slugify(sectionName)}/${slugify(service.name)}`}>
84 <FontAwesome iconName="viewReport" /> View Report ➔
85 </a>
58 <div class="service-body">
59 <img
60 width="40"
61 height="40"
62 loading="lazy"
63 decoding="async"
64 class="service-icon"
65 alt={`${service.name} Icon`}
66 data-service-url={formatLink(service.url)}
67 src={service.icon || `https://icon.horse/icon/${formatLink(service.url)}`}
68 />
69 <div class="service-body">
70 <p set:html={service.description} />
71 </div>
72 </div>
8673
87 </div>
88 </div>
74 <div class="service-links">
75 <a class="link" href={service.url}>
76 <FontAwesome iconName="website" />
77 <span>{formatLink(service.url)}</span>
78 </a>
79 {
80 service.github && (
81 <a class="link" href={`https://github.com/${service.github}`}>
82 <FontAwesome iconName="sourceCode" /> GitHub
83 </a>
84 )
85 }
86 <a
87 href={`/${slugify(categoryName)}/${slugify(sectionName)}/${slugify(service.name)}`}
88 >
89 <FontAwesome iconName="viewReport" /> View Report ➔
90 </a>
91 </div>
92</div>
8993
90 <style lang="scss">
91 @import './service-card.scss';
92 </style>
94<style lang="scss">
95 @import './service-card.scss';
96</style>
web/src/components/things/ServiceCard.svelte +5 −6
@@ -17,7 +17,10 @@
1717
1818<div class="service" id={serviceRef}>
1919 <div class="service-head">
20 <a class="service-title" href={`/${categorySlug}/${sectionSlug}/${serviceRef}`}>
20 <a
21 class="service-title"
22 href={`/${categorySlug}/${sectionSlug}/${serviceRef}`}
23 >
2124 <h4>{service.name}</h4>
2225 </a>
2326 {#if service.followWith}
@@ -26,11 +29,7 @@
2629 </div>
2730
2831 <div class="save-listing">
29 <SaveListing
30 categoryName={categoryName}
31 sectionName={sectionName}
32 serviceName={service.name}
33 />
32 <SaveListing {categoryName} {sectionName} serviceName={service.name} />
3433 </div>
3534
3635 <div class="service-body">
web/src/components/things/ServiceList.astro +361 −301
@@ -1,5 +1,4 @@
11---
2
32import Button from '@components/form/Button.astro';
43import { parseMarkdown, formatLink } from '@utils/parse-markdown';
54import type { Service } from 'src/types/Service';
@@ -11,326 +10,387 @@ import GitHubMetrics from '@components/things/ItemGitHubMetrics.astro';
1110import SaveListing from '@components/things/SaveListing.svelte';
1211
1312interface Props {
14 services: Service[];
15 subHeading?: boolean;
16 buttonLink?: string;
17 noGitHubMetrics?: boolean;
18 sectionName: string;
19 categoryName: string;
13 services: Service[];
14 subHeading?: boolean;
15 buttonLink?: string;
16 noGitHubMetrics?: boolean;
17 sectionName: string;
18 categoryName: string;
2019}
2120
2221const {
23 services,
24 subHeading,
25 buttonLink,
26 noGitHubMetrics,
27 sectionName,
28 categoryName,
22 services,
23 subHeading,
24 buttonLink,
25 noGitHubMetrics,
26 sectionName,
27 categoryName,
2928} = Astro.props;
30
3129---
3230
3331<script>
34 document.addEventListener('DOMContentLoaded', () => {
35 const serviceIcons = document.querySelectorAll<HTMLImageElement>('.service-icon');
36 const broke = '/broken-image.png';
32 document.addEventListener('DOMContentLoaded', () => {
33 const serviceIcons =
34 document.querySelectorAll<HTMLImageElement>('.service-icon');
35 const broke = '/broken-image.png';
3736
38 serviceIcons.forEach(function(icon) {
39 icon.onerror = function() {
40 const imgElement = this as HTMLImageElement;
41 const serviceUrl = imgElement.getAttribute('data-service-url');
42 const newSrcAttribute = (imgElement.src.includes('on.ho') ? broke : `https://icon.horse/icon/${serviceUrl}`);
43 imgElement.src = imgElement.src !== newSrcAttribute ? newSrcAttribute : broke;
44 imgElement.onerror = null;
45 };
46 });
47});
37 serviceIcons.forEach(function (icon) {
38 icon.onerror = function () {
39 const imgElement = this as HTMLImageElement;
40 const serviceUrl = imgElement.getAttribute('data-service-url');
41 const newSrcAttribute = imgElement.src.includes('on.ho')
42 ? broke
43 : `https://icon.horse/icon/${serviceUrl}`;
44 imgElement.src =
45 imgElement.src !== newSrcAttribute ? newSrcAttribute : broke;
46 imgElement.onerror = null;
47 };
48 });
49 });
4850</script>
4951
50
51
5252<section>
53 {services && services.length > 0 ? (
54 <ul>
55 {services.map((service: Service) => (
56 <li id={slugify(service.name)}>
57 <DeleteListing client:load categoryName={categoryName} sectionName={sectionName} serviceName={service.name} />
58 <div class="save-listing">
59 <SaveListing client:visible
60 categoryName={categoryName}
61 sectionName={sectionName}
62 serviceName={service.name}
63 />
64 </div>
65 <div class="service-head">
66 <img
67 width="40"
68 height="40"
69 loading="lazy"
70 decoding="async"
71 class="service-icon"
72 alt={`${service.name} Icon`}
73 data-service-url={formatLink(service.url)}
74 src={service.icon || `https://icon.horse/icon/${formatLink(service.url)}`}
75 />
53 {
54 services && services.length > 0 ? (
55 <ul>
56 {services.map((service: Service) => (
57 <li id={slugify(service.name)}>
58 <DeleteListing
59 client:load
60 categoryName={categoryName}
61 sectionName={sectionName}
62 serviceName={service.name}
63 />
64 <div class="save-listing">
65 <SaveListing
66 client:visible
67 categoryName={categoryName}
68 sectionName={sectionName}
69 serviceName={service.name}
70 />
71 </div>
72 <div class="service-head">
73 <img
74 width="40"
75 height="40"
76 loading="lazy"
77 decoding="async"
78 class="service-icon"
79 alt={`${service.name} Icon`}
80 data-service-url={formatLink(service.url)}
81 src={
82 service.icon ||
83 `https://icon.horse/icon/${formatLink(service.url)}`
84 }
85 />
7686
77 <a class="service-title" href={`/${slugify(categoryName)}/${slugify(sectionName)}/${slugify(service.name)}`}>
78 {subHeading ? <h4>{service.name}</h4> : <h3>{service.name}</h3>}
79 </a>
80 {service.followWith && <p class="follow-with">({service.followWith})</p> }
81 <a class="service-link" href={service.url}>{formatLink(service.url)}</a>
82 </div>
83 <div class="service-body">
84 <p set:html={parseMarkdown(service.description)}></p>
85 <div class="service-stats">
86 <div class="left">
87 { service.securityAudited && (
88 <span class="meta-item great" title={`${service.name} has been security audited by an accredited auditor, with results published publicly`}>
89 <FontAwesome iconName="securityAudited" /> Security Audited
90 </span>
91 )}
92 { service.acceptsCrypto && (
93 <span class="meta-item great" title={`${service.name} accepts anonymous payment methods`}>
94 <FontAwesome iconName="cryptoAccepted" /> Crypto Payments Accepted
95 </span>
96 )}
97 { service.securityAudited === false && (
98 <span class="meta-item warning" title={`${service.name} has not been audited`}>
99 <FontAwesome iconName="notSecurityAudited" /> No Security Audit
100 </span>
101 )}
102 { (service.openSource === false) && (
103 <span class="warning">
104 <FontAwesome iconName="closedSource" />
105 Not Open Source
106 </span>
107 )}
108 { service.openSource || (service.github && service.openSource !== false) ? (
109 <span class="meta-item great" title={`${service.name} is open source`}>
110 <FontAwesome iconName="openSource" /> Open Source
111 </span>
112 ) : null }
113 { service.github && !noGitHubMetrics && <GitHubMetrics github={service.github} /> }
114 { service.github && noGitHubMetrics && (
115 <span class="meta-item" title={`View ${service.name} on GitHub`}>
116 <a href={`https://github.com/${service.github}`} target="_blank">
117 <FontAwesome iconName="github" /> {service.github}
118 </a>
119 </span>
120 ) }
121 </div>
122 <div class="view-service">
123 <a href={`/${slugify(categoryName)}/${slugify(sectionName)}/${slugify(service.name)}`}>View {service.name} Report</a>
124 </div>
125 </div>
126 </div>
127 </li>
128 ))}
129 </ul>
130 ) : (
131 <p class="nothing-yet">
132 <strong>⚠️ This section is still a work in progress ⚠️</strong><br />
133 Check back soon, or help us complete it by submiting a pull request on GitHub.
134 <br />
135 <span class="quick-submit">Or submit an entry <a href="/submit">here</a></span>
136 </p>
137 )}
87 <a
88 class="service-title"
89 href={`/${slugify(categoryName)}/${slugify(sectionName)}/${slugify(service.name)}`}
90 >
91 {subHeading ? <h4>{service.name}</h4> : <h3>{service.name}</h3>}
92 </a>
93 {service.followWith && (
94 <p class="follow-with">({service.followWith})</p>
95 )}
96 <a class="service-link" href={service.url}>
97 {formatLink(service.url)}
98 </a>
99 </div>
100 <div class="service-body">
101 <p set:html={parseMarkdown(service.description)} />
102 <div class="service-stats">
103 <div class="left">
104 {service.securityAudited && (
105 <span
106 class="meta-item great"
107 title={`${service.name} has been security audited by an accredited auditor, with results published publicly`}
108 >
109 <FontAwesome iconName="securityAudited" /> Security
110 Audited
111 </span>
112 )}
113 {service.acceptsCrypto && (
114 <span
115 class="meta-item great"
116 title={`${service.name} accepts anonymous payment methods`}
117 >
118 <FontAwesome iconName="cryptoAccepted" /> Crypto Payments
119 Accepted
120 </span>
121 )}
122 {service.securityAudited === false && (
123 <span
124 class="meta-item warning"
125 title={`${service.name} has not been audited`}
126 >
127 <FontAwesome iconName="notSecurityAudited" /> No Security
128 Audit
129 </span>
130 )}
131 {service.openSource === false && (
132 <span class="warning">
133 <FontAwesome iconName="closedSource" />
134 Not Open Source
135 </span>
136 )}
137 {service.openSource ||
138 (service.github && service.openSource !== false) ? (
139 <span
140 class="meta-item great"
141 title={`${service.name} is open source`}
142 >
143 <FontAwesome iconName="openSource" /> Open Source
144 </span>
145 ) : null}
146 {service.github && !noGitHubMetrics && (
147 <GitHubMetrics github={service.github} />
148 )}
149 {service.github && noGitHubMetrics && (
150 <span
151 class="meta-item"
152 title={`View ${service.name} on GitHub`}
153 >
154 <a
155 href={`https://github.com/${service.github}`}
156 target="_blank"
157 >
158 <FontAwesome iconName="github" /> {service.github}
159 </a>
160 </span>
161 )}
162 </div>
163 <div class="view-service">
164 <a
165 href={`/${slugify(categoryName)}/${slugify(sectionName)}/${slugify(service.name)}`}
166 >
167 View {service.name} Report
168 </a>
169 </div>
170 </div>
171 </div>
172 </li>
173 ))}
174 </ul>
175 ) : (
176 <p class="nothing-yet">
177 <>
178 <strong>⚠️ This section is still a work in progress ⚠️</strong>
179 <br />
180 </>
181 Check back soon, or help us complete it by submiting a pull request on
182 GitHub.
183 <br />
184 <span class="quick-submit">
185 Or submit an entry <a href="/submit">here</a>
186 </span>
187 </p>
188 )
189 }
138190
139 {buttonLink && (
140 <Button title={`View all ${categoryName}`} className="view-all" text="View More..." url={buttonLink} />
141 )}
191 {
192 buttonLink && (
193 <Button
194 title={`View all ${categoryName}`}
195 className="view-all"
196 text="View More..."
197 url={buttonLink}
198 />
199 )
200 }
142201</section>
143202
144
145203<style lang="scss">
204 section {
205 padding: 1rem 0;
206 position: relative;
207 &:not(:last-child) {
208 border-bottom: 2px solid var(--accent-3);
209 }
210 }
211
212 .nothing-yet {
213 font-size: 1.4rem;
214 opacity: 0.8;
215 font-style: italic;
216 text-align: center;
217 margin-bottom: 3rem;
218 .quick-submit {
219 margin-top: 1rem;
220 font-size: 0.8rem;
221 opacity: 0.8;
222 }
223 }
224
225 ul {
226 list-style: none;
227 padding: 0;
228 margin: 0 0 3rem 0;
229 li {
230 margin-bottom: 1rem;
231 position: relative;
232 .save-listing {
233 position: absolute;
234 right: 1rem;
235 top: 1rem;
236 }
237 .service-head {
238 display: flex;
239 align-items: center;
240 gap: 0.5rem;
241 flex-wrap: wrap;
242 .service-title {
243 text-decoration: none;
244 color: var(--foreground);
245 h3,
246 h4 {
247 margin: 0;
248 font-size: 1.6rem;
249 }
250
251 position: relative;
252 &:after {
253 background: none repeat scroll 0 0 transparent;
254 bottom: 0;
255 content: '';
256 display: block;
257 height: 3px;
258 left: 50%;
259 position: absolute;
260 background: var(--accent-3);
261 transition:
262 width 0.3s ease 0s,
263 left 0.3s ease 0s;
264 width: 0;
265 }
266 &:hover:after {
267 width: 100%;
268 left: 0;
269 }
270 }
146271
147 section {
148 padding: 1rem 0;
149 position: relative;
150 &:not(:last-child) {
151 border-bottom: 2px solid var(--accent-3);
152 }
153 }
154
155 .nothing-yet {
156 font-size: 1.4rem;
157 opacity: 0.8;
158 font-style: italic;
159 text-align: center;
160 margin-bottom: 3rem;
161 .quick-submit {
162 margin-top: 1rem;
163 font-size: 0.8rem;
164 opacity: 0.8;
165 }
166 }
167
168 ul {
169 list-style: none;
170 padding: 0;
171 margin: 0 0 3rem 0;
172 li {
173 margin-bottom: 1rem;
174 position: relative;
175 .save-listing {
176 position: absolute;
177 right: 1rem;
178 top: 1rem;
179 }
180 .service-head {
181 display: flex;
182 align-items: center;
183 gap: 0.5rem;
184 flex-wrap: wrap;
185 .service-title {
186 text-decoration: none;
187 color: var(--foreground);
188 h3, h4 {
189 margin: 0;
190 font-size: 1.6rem;
191 }
272 .service-icon {
273 width: 2.5rem;
274 height: 2.5rem;
275 border-radius: var(--curve-sm);
192276
193 position: relative;
194 &:after {
195 background: none repeat scroll 0 0 transparent;
196 bottom: 0;
197 content: "";
198 display: block;
199 height: 3px;
200 left: 50%;
201 position: absolute;
202 background: var(--accent-3);
203 transition: width 0.3s ease 0s, left 0.3s ease 0s;
204 width: 0;
205 }
206 &:hover:after {
207 width: 100%;
208 left: 0;
209 }
210 }
211
212 .service-icon {
213 width: 2.5rem;
214 height: 2.5rem;
215 border-radius: var(--curve-sm);
277 font-size: 10px;
278 overflow: hidden;
279 color: var(--accent);
280 }
281 .follow-with {
282 opacity: 0.7;
283 font-style: italic;
284 margin: 0;
285 }
286 .service-link {
287 max-width: 300px;
288 text-overflow: ellipsis;
289 overflow: hidden;
290 white-space: nowrap;
291 }
292 }
216293
217 font-size: 10px;
218 overflow: hidden;
219 color: var(--accent);
220 }
221 .follow-with {
222 opacity: 0.7;
223 font-style: italic;
224 margin: 0;
225 }
226 .service-link {
227 max-width: 300px;
228 text-overflow: ellipsis;
229 overflow: hidden;
230 white-space: nowrap;
231 }
232 }
233
234 .service-body {
235 margin: 0.5rem 0 2rem;
236 opacity: 0.8;
237 :global(p) {
238 margin: 0;
239 font-size: 1.2rem;
240 :global(a) {
241 color: var(--foregorund);
242 }
243 }
244 .service-stats {
245 .left {
246 display: flex;
247 gap: 1rem;
248 flex-wrap: wrap;
249 align-items: center;
250 }
251 display: flex;
252 gap: 1rem;
253 flex-wrap: wrap;
254 align-items: center;
255 justify-content: space-between;
256 }
257 .view-service {
258 transition: all 0.2s ease-in-out;
259 opacity: 0.95;
260 a {
261 padding: 0.25rem 0.6rem;
262 width: fit-content;
263 right: 1rem;
264 font-size: 0.9rem;
265 background: var(--accent-3);
266 color: var(--accent-fg);
267 text-decoration: none;
268 border-radius: var(--curve-md);
269 }
270 &:hover {
271 opacity: 1;
272 transform: scale(1.05);
273 }
274 }
294 .service-body {
295 margin: 0.5rem 0 2rem;
296 opacity: 0.8;
297 :global(p) {
298 margin: 0;
299 font-size: 1.2rem;
300 :global(a) {
301 color: var(--foregorund);
302 }
303 }
304 .service-stats {
305 .left {
306 display: flex;
307 gap: 1rem;
308 flex-wrap: wrap;
309 align-items: center;
310 }
311 display: flex;
312 gap: 1rem;
313 flex-wrap: wrap;
314 align-items: center;
315 justify-content: space-between;
316 }
317 .view-service {
318 transition: all 0.2s ease-in-out;
319 opacity: 0.95;
320 a {
321 padding: 0.25rem 0.6rem;
322 width: fit-content;
323 right: 1rem;
324 font-size: 0.9rem;
325 background: var(--accent-3);
326 color: var(--accent-fg);
327 text-decoration: none;
328 border-radius: var(--curve-md);
329 }
330 &:hover {
331 opacity: 1;
332 transform: scale(1.05);
333 }
334 }
275335
276 .meta-item, .warning {
277 display: flex;
278 align-items: center;
279 // justify-content: center;
280 gap: 0.25rem;
281 // opacity: 0.6;
282 font-size: 0.9rem;
283 padding: 0.5rem 0;
284 :global(svg) {
285 color: var(--foreground);
286 width: 1.2rem;
287 height: 1.2rem;
288 }
289 a {
290 text-decoration: none;
291 color: var(--foreground);
292 display: flex;
293 gap: 0.25rem;
294 &:hover {
295 color: var(--accent-3);
296 :global(svg) {
297 color: var(--accent-3);
298 }
299 }
300 }
301 }
302 .warning {
303 color: var(--danger);
304 :global(svg) {
305 color: var(--danger);
306 }
307 }
308 .great {
309 color: #0fb953; // var(--success);
310 :global(svg) {
311 color: #0fb953; // var(--success);
312 }
313 }
314 }
315 }
316 }
336 .meta-item,
337 .warning {
338 display: flex;
339 align-items: center;
340 // justify-content: center;
341 gap: 0.25rem;
342 // opacity: 0.6;
343 font-size: 0.9rem;
344 padding: 0.5rem 0;
345 :global(svg) {
346 color: var(--foreground);
347 width: 1.2rem;
348 height: 1.2rem;
349 }
350 a {
351 text-decoration: none;
352 color: var(--foreground);
353 display: flex;
354 gap: 0.25rem;
355 &:hover {
356 color: var(--accent-3);
357 :global(svg) {
358 color: var(--accent-3);
359 }
360 }
361 }
362 }
363 .warning {
364 color: var(--danger);
365 :global(svg) {
366 color: var(--danger);
367 }
368 }
369 .great {
370 color: #0fb953; // var(--success);
371 :global(svg) {
372 color: #0fb953; // var(--success);
373 }
374 }
375 }
376 }
377 }
317378
318 section :global(.view-all) {
319 width: fit-content;
320 position: absolute;
321 right: 1rem;
322 margin-top: -2.5rem;
323 background: var(--accent-3);
324 }
379 section :global(.view-all) {
380 width: fit-content;
381 position: absolute;
382 right: 1rem;
383 margin-top: -2.5rem;
384 background: var(--accent-3);
385 }
325386
326 li:hover :global(.actions) {
327 opacity: 0.6;
328 :global(a):hover {
329 opacity: 1;
330 }
331 }
332 :global(.actions a):hover {
333 opacity: 1;
334 }
335
387 li:hover :global(.actions) {
388 opacity: 0.6;
389 :global(a):hover {
390 opacity: 1;
391 }
392 }
393 :global(.actions a):hover {
394 opacity: 1;
395 }
336396</style>
web/src/components/things/SmartSuggestions.svelte +37 −34
@@ -1,7 +1,7 @@
11<script lang="ts">
2 import { onMount } from "svelte";
3 import { writable } from "svelte/store";
4 import type { Category, Service } from "../../types/Service";
2 import { onMount } from 'svelte';
3 import { writable } from 'svelte/store';
4 import type { Category, Service } from '../../types/Service';
55 import { formatLink } from '@utils/parse-markdown';
66 import { slugify } from '@utils/fetch-data';
77
@@ -14,21 +14,23 @@
1414
1515 let results = writable<ServiceResult[]>([]);
1616
17 const normalize = (str: string) => str.toLowerCase().replace(/[^a-z0-9]/g, '');
17 const normalize = (str: string) =>
18 str.toLowerCase().replace(/[^a-z0-9]/g, '');
1819
1920 onMount(async () => {
20
2121 const apiEndpoint = `https://awesome-privacy.as93.workers.dev/${searchTerm}`;
2222 const fetchedServices = await fetch(apiEndpoint)
2323 .then((response) => response.json())
24 .then((data) => (JSON.parse(data) || []).map((servName: string) => normalize(servName)));
24 .then((data) =>
25 (JSON.parse(data) || []).map((servName: string) => normalize(servName)),
26 );
2527
2628 const tmpResults: ServiceResult[] = [];
2729 categories.forEach((category) => {
2830 (category.sections || []).forEach((section) => {
2931 (section.services || []).forEach((service) => {
3032 if (fetchedServices.includes(normalize(service.name))) {
31 const path = `/${slugify(category.name)}/${slugify(section.name)}/${slugify(service.name)}`
33 const path = `/${slugify(category.name)}/${slugify(section.name)}/${slugify(service.name)}`;
3234 tmpResults.push({ ...service, path });
3335 return;
3436 }
@@ -45,35 +47,36 @@
4547{#if $results.length > 1}
4648 <h3>Top Results</h3>
4749{/if}
48 <section>
49 {#each $results as service (service)}
50 <a class="service-result" href={service.path}>
51 <div class="service-head">
52 <img
53 width="40"
54 height="40"
55 loading="lazy"
56 decoding="async"
57 class="service-icon"
58 alt={`${service.name} Icon`}
59 data-service-url={formatLink(service.url)}
60 src={service.icon || `https://icon.horse/icon/${formatLink(service.url)}`}
61 />
62 <div>
63 <h4>
64 {service.name}
65 {#if service.followWith}
50<section>
51 {#each $results as service (service)}
52 <a class="service-result" href={service.path}>
53 <div class="service-head">
54 <img
55 width="40"
56 height="40"
57 loading="lazy"
58 decoding="async"
59 class="service-icon"
60 alt={`${service.name} Icon`}
61 data-service-url={formatLink(service.url)}
62 src={service.icon ||
63 `https://icon.horse/icon/${formatLink(service.url)}`}
64 />
65 <div>
66 <h4>
67 {service.name}
68 {#if service.followWith}
6669 <p class="follow-with">({service.followWith})</p>
67 {/if}
68 </h4>
69 <a class="service-link" href={service.url}>{formatLink(service.url)}</a>
70 </div>
70 {/if}
71 </h4>
72 <a class="service-link" href={service.url}
73 >{formatLink(service.url)}</a
74 >
7175 </div>
72 </a>
73 {/each}
74 </section>
75
76
76 </div>
77 </a>
78 {/each}
79</section>
7780
7881<style lang="scss">
7982 h3 {
web/src/components/things/service-card.scss +9 −7
@@ -29,21 +29,23 @@
2929 h4 {
3030 text-decoration: none;
3131 position: relative;
32 &:after {
32 &:after {
3333 background: none repeat scroll 0 0 transparent;
3434 bottom: 0;
35 content: "";
35 content: '';
3636 display: block;
3737 height: 3px;
3838 left: 50%;
3939 position: absolute;
4040 background: var(--accent-3);
41 transition: width 0.2s ease 0s, left 0.2s ease 0s;
41 transition:
42 width 0.2s ease 0s,
43 left 0.2s ease 0s;
4244 width: 0;
4345 }
44 &:hover:after {
45 width: 100%;
46 left: 0;
46 &:hover:after {
47 width: 100%;
48 left: 0;
4749 }
4850 }
4951 }
@@ -66,7 +68,7 @@
6668 :global(p) {
6769 display: -webkit-box;
6870 -webkit-line-clamp: 3;
69 -webkit-box-orient: vertical;
71 -webkit-box-orient: vertical;
7072 overflow: hidden;
7173 margin: 0.5rem 0;
7274 width: calc(100% - 2rem);
web/src/layouts/Layout.astro +85 −63
@@ -1,5 +1,5 @@
11---
2import { ViewTransitions } from 'astro:transitions'
2import { ViewTransitions } from 'astro:transitions';
33import NavBar from '@components/scafold/NavBar.astro';
44import Footer from '@components/scafold/Footer.astro';
55import config from '../site-config';
@@ -7,14 +7,14 @@ import config from '../site-config';
77interface Props {
88 title?: string; // Page title
99 description?: string; // Overide description tag
10 keywords?: string; // Overide keywords tag
10 keywords?: string; // Overide keywords tag
1111 hideNav?: boolean; // Don't show the navbar (just homepage)
1212 author?: string; // Author of the content
1313 customSchemaJson?: any; // Custom schema item
1414 breadcrumbs?: Array<{
1515 name: string;
1616 item: string;
17 }>
17 }>;
1818}
1919
2020const {
@@ -30,92 +30,117 @@ const {
3030const makeBreadcrumbs = () => {
3131 if (!breadcrumbs) return null;
3232 return {
33 "@context": "https://schema.org",
34 "@type": "BreadcrumbList",
35 "itemListElement": breadcrumbs.map((breadcrumb, index) => ({
36 "@type": "ListItem",
37 "position": index + 1,
38 "name": breadcrumb.name,
39 "item": `https://awesome-privacy.xyz/${breadcrumb.item}`
40 }))
41 }
42}
33 '@context': 'https://schema.org',
34 '@type': 'BreadcrumbList',
35 itemListElement: breadcrumbs.map((breadcrumb, index) => ({
36 '@type': 'ListItem',
37 position: index + 1,
38 name: breadcrumb.name,
39 item: `https://awesome-privacy.xyz/${breadcrumb.item}`,
40 })),
41 };
42};
4343
4444const makeSearchLd = () => {
4545 return {
46 "@context": "https://schema.org",
47 "@type": "WebSite",
48 "url": "https://awesome-privacy.xyz/",
49 "potentialAction": [{
50 "@type": "SearchAction",
51 "target": {
52 "@type": "EntryPoint",
53 "urlTemplate": "https://awesome-privacy.xyz/search?q={search_term_string}"
46 '@context': 'https://schema.org',
47 '@type': 'WebSite',
48 url: 'https://awesome-privacy.xyz/',
49 potentialAction: [
50 {
51 '@type': 'SearchAction',
52 target: {
53 '@type': 'EntryPoint',
54 urlTemplate:
55 'https://awesome-privacy.xyz/search?q={search_term_string}',
56 },
57 'query-input': 'required name=search_term_string',
5458 },
55 "query-input": "required name=search_term_string"
56 }]
57 }
59 ],
60 };
5861};
59
6062---
6163
6264<!doctype html>
6365<html lang="en" data-theme="dark">
6466 <head>
65
6667 <ViewTransitions />
67
68
6869 <!-- Core info -->
6970 <title>{title}</title>
70 <meta name="description" content={description}>
71 <meta name="keywords" content={keywords}>
72 <meta name="author" content={author}>
71 <meta name="description" content={description} />
72 <meta name="keywords" content={keywords} />
73 <meta name="author" content={author} />
7374
7475 <!-- Page info, viewport, Astro credit -->
7576 <meta charset="UTF-8" />
76 <meta name="viewport" content="width=device-width, initial-scale=1.0">
77 <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7778 <meta name="generator" content={Astro.generator} />
78 <meta name="robots" content="index, follow">
79 <meta name="robots" content="index, follow" />
7980
8081 <!-- Icons and colors -->
8182 <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
82 <link rel="icon" type="image/png" sizes="64x64" href="/favicon.png">
83 <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
83 <link rel="icon" type="image/png" sizes="64x64" href="/favicon.png" />
84 <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
8485
8586 <!-- Social media meta tags (Open Graphh + Twitter) -->
86 <meta property="og:site_name" content="Awesome Privacy">
87 <meta property="og:type" content="website">
88 <meta property="og:url" content="https://awesome-privacy.xyz">
89 <meta property="og:title" content={title}>
90 <meta property="og:description" content={description}>
91 <meta property="og:image" content="https://awesome-privacy.xyz/banner.png">
92 <meta name="twitter:card" content="summary">
93 <meta name="twitter:url" content="https://awesome-privacy.xyz">
94 <meta name="twitter:title" content={title}>
95 <meta name="twitter:description" content={description}>
96 <meta name="twitter:image" content="https://awesome-privacy.xyz/banner.png">
97 <link rel="twitter:image" sizes="180x180" href="https://awesome-privacy.xyz/apple-touch-icon.png">
98 <meta name="twitter:site" content="@Lissy_Sykes">
99 <meta name="twitter:creator" content="@Lissy_Sykes">
87 <meta property="og:site_name" content="Awesome Privacy" />
88 <meta property="og:type" content="website" />
89 <meta property="og:url" content="https://awesome-privacy.xyz" />
90 <meta property="og:title" content={title} />
91 <meta property="og:description" content={description} />
92 <meta
93 property="og:image"
94 content="https://awesome-privacy.xyz/banner.png"
95 />
96 <meta name="twitter:card" content="summary" />
97 <meta name="twitter:url" content="https://awesome-privacy.xyz" />
98 <meta name="twitter:title" content={title} />
99 <meta name="twitter:description" content={description} />
100 <meta
101 name="twitter:image"
102 content="https://awesome-privacy.xyz/banner.png"
103 />
104 <link
105 rel="twitter:image"
106 sizes="180x180"
107 href="https://awesome-privacy.xyz/apple-touch-icon.png"
108 />
109 <meta name="twitter:site" content="@Lissy_Sykes" />
110 <meta name="twitter:creator" content="@Lissy_Sykes" />
100111
101112 <!-- Non-tracking hit counter -->
102 <script defer is:inline
113 <script
114 defer
115 is:inline
103116 type="text/partytown"
104117 data-domain="awesome-privacy.xyz"
105 src="https://no-track.as93.net/js/script.js">
106 </script>
118 src="https://no-track.as93.net/js/script.js"></script>
107119
108120 <!-- Schema.org markup for Google -->
109 {breadcrumbs && (
110 <script type="application/ld+json" set:html={JSON.stringify(makeBreadcrumbs())} />
111 )}
112 {customSchemaJson && (
113 <script type="application/ld+json" set:html={JSON.stringify(customSchemaJson)} />
114 )}
115 <script type="application/ld+json" set:html={JSON.stringify(makeSearchLd)} />
121 {
122 breadcrumbs && (
123 <script
124 type="application/ld+json"
125 set:html={JSON.stringify(makeBreadcrumbs())}
126 />
127 )
128 }
129 {
130 customSchemaJson && (
131 <script
132 type="application/ld+json"
133 set:html={JSON.stringify(customSchemaJson)}
134 />
135 )
136 }
137 <script
138 type="application/ld+json"
139 set:html={JSON.stringify(makeSearchLd)}
140 />
116141 </head>
117142 <body>
118 {!hideNav && <NavBar /> }
143 {!hideNav && <NavBar />}
119144 <slot />
120145 <Footer />
121146 </body>
@@ -124,11 +149,9 @@ const makeSearchLd = () => {
124149<style is:global>
125150 @import '../styles/values.css';
126151 @import '../styles/typography.css';
127 </style>
128
152</style>
129153
130154<style is:global>
131
132155 html {
133156 ::selection {
134157 background: var(--accent);
@@ -142,5 +165,4 @@ const makeSearchLd = () => {
142165 color: var(--foreground);
143166 background: var(--background);
144167 }
145
146168</style>
web/src/pages/404.astro +79 −86
@@ -1,98 +1,91 @@
11---
2
32import Layout from '@layouts/Layout.astro';
43import Buton from '@components/form/Button.astro';
5
64---
75
86<Layout title="404 | Awesome Privacy">
7 <article class="oh-crap">
8 <h2>404</h2>
9 <p class="what-happened">Page not found 😢</p>
10 <p class="why-happened">
11 It seems this page doesn't exist (yet). We're sorry about that.
12 </p>
13 <span class="back-you-go-then"><Buton url="/">Go back home</Buton></span>
914
10 <article class="oh-crap">
11 <h2>404</h2>
12 <p class="what-happened">Page not found 😢</p>
13 <p class="why-happened">
14 It seems this page doesn't exist (yet). We're sorry about that.
15 </p>
16 <span class="back-you-go-then"><Buton url="/">Go back home</Buton></span>
17
18 <nav class="other-places">
19 Looking for somewhere else?
20 <ul>
21 <li>
22 <a href="/search">Search</a>
23 </li>
24 <li>
25 <a href="/browse">Browse</a>
26 </li>
27 <li>
28 <a href="/about">About</a>
29 </li>
30 <li>
31 <a href="https://github.com/lissy93/awesome-privacy">Source</a>
32 </li>
33 <li>
34 <a href="https://as93.net">More Apps</a>
35 </li>
36 </ul>
37 </nav>
38 </article>
39
15 <nav class="other-places">
16 Looking for somewhere else?
17 <ul>
18 <li>
19 <a href="/search">Search</a>
20 </li>
21 <li>
22 <a href="/browse">Browse</a>
23 </li>
24 <li>
25 <a href="/about">About</a>
26 </li>
27 <li>
28 <a href="https://github.com/lissy93/awesome-privacy">Source</a>
29 </li>
30 <li>
31 <a href="https://as93.net">More Apps</a>
32 </li>
33 </ul>
34 </nav>
35 </article>
4036</Layout>
4137
42
4338<style lang="scss">
44.oh-crap {
45 display: flex;
46 flex-direction: column;
47 align-items: center;
48 justify-content: center;
49 min-height: calc(100vh - 6rem);
50 h2 {
51 font-size: 12rem;
52 margin: 0;
53 }
54 .what-happened {
55 font-size: 4rem;
56 margin: 0;
57 opacity: 0.8;
58 }
59 .why-happened {
60 font-size: 1.5rem;
61 text-align: center;
62 margin-bottom: 2rem;
63 opacity: 0.6;
64 }
65 .back-you-go-then :global(a) {
66 font-size: 2rem;
67 }
68
39 .oh-crap {
40 display: flex;
41 flex-direction: column;
42 align-items: center;
43 justify-content: center;
44 min-height: calc(100vh - 6rem);
45 h2 {
46 font-size: 12rem;
47 margin: 0;
48 }
49 .what-happened {
50 font-size: 4rem;
51 margin: 0;
52 opacity: 0.8;
53 }
54 .why-happened {
55 font-size: 1.5rem;
56 text-align: center;
57 margin-bottom: 2rem;
58 opacity: 0.6;
59 }
60 .back-you-go-then :global(a) {
61 font-size: 2rem;
62 }
6963
70 .other-places {
71 opacity: 0.8;
72 margin: 2rem auto 1rem auto;
73 text-align: center;
74 &:hover {
75 opacity: 1;
76 }
77 ul {
78 list-style: none;
79 display: flex;
80 padding: 0;
81 gap: 0.5rem;
82 li {
83 &:not(:last-child) {
84 border-right: 1px solid var(--accent);
85 padding-right: 0.5rem;
86 }
87 }
88 li a {
89 text-decoration: none;
90 &:hover {
91 text-decoration: underline;
92 }
93 }
94 }
95 }
96
97}
64 .other-places {
65 opacity: 0.8;
66 margin: 2rem auto 1rem auto;
67 text-align: center;
68 &:hover {
69 opacity: 1;
70 }
71 ul {
72 list-style: none;
73 display: flex;
74 padding: 0;
75 gap: 0.5rem;
76 li {
77 &:not(:last-child) {
78 border-right: 1px solid var(--accent);
79 padding-right: 0.5rem;
80 }
81 }
82 li a {
83 text-decoration: none;
84 &:hover {
85 text-decoration: underline;
86 }
87 }
88 }
89 }
90 }
9891</style>
web/src/pages/[...listing].astro +731 −629
@@ -1,5 +1,4 @@
11---
2
32import Layout from '@layouts/Layout.astro';
43import ServiceList from '@components/things/ServiceList.astro';
54import Comments from '@components/things/Comments.svelte';
@@ -30,123 +29,132 @@ import Button from '@components/form/Button.astro';
3029import SaveListing from '@components/things/SaveListing.svelte';
3130
3231interface Props extends Service {
33 slug: string;
34 parentSection: Section;
35 categoryName: string;
32 slug: string;
33 parentSection: Section;
34 categoryName: string;
3635}
3736
3837const {
39 name,
40 description,
41 url,
42 github,
43 tosdrId,
44 discordInvite,
45 subreddit,
46 iosApp,
47 androidApp,
48 icon,
49 followWith,
50 links,
51 securityAudited,
52 openSource,
53 acceptsCrypto,
54 parentSection,
55 categoryName,
38 name,
39 description,
40 url,
41 github,
42 tosdrId,
43 discordInvite,
44 subreddit,
45 iosApp,
46 androidApp,
47 icon,
48 followWith,
49 links,
50 securityAudited,
51 openSource,
52 acceptsCrypto,
53 parentSection,
54 categoryName,
5655} = Astro.props;
5756
58
5957/**
6058 * Make a list of keywords, for the <meta keywords> tag
6159 */
6260const makeKeyWordTag = () => {
63 const keywords: string[] = [];
64 keywords.push(`open source ${parentSection.name}`);
65 keywords.push(`${parentSection.name} comparison`);
66 (parentSection.alternativeTo || []).forEach((alt: string) => {
67 keywords.push(`${alt} alternative`);
68 });
69 (parentSection.services || []).forEach((serv: Service) => {
70 keywords.push(`${serv.name} vs`);
71 });
72 keywords.push('private');
73 keywords.push('ad free');
74 keywords.push('encrypted');
75 keywords.push('open source software');
76 keywords.push('privacy respecting apps');
77 keywords.push('free tools');
78 return keywords.join(', ');
61 const keywords: string[] = [];
62 keywords.push(`open source ${parentSection.name}`);
63 keywords.push(`${parentSection.name} comparison`);
64 (parentSection.alternativeTo || []).forEach((alt: string) => {
65 keywords.push(`${alt} alternative`);
66 });
67 (parentSection.services || []).forEach((serv: Service) => {
68 keywords.push(`${serv.name} vs`);
69 });
70 keywords.push('private');
71 keywords.push('ad free');
72 keywords.push('encrypted');
73 keywords.push('open source software');
74 keywords.push('privacy respecting apps');
75 keywords.push('free tools');
76 return keywords.join(', ');
7977};
8078
8179/**
8280 * Make a page title
8381 */
8482const makePageTitle = () => {
85 return `${name} | ${parentSection.name} | ${categoryName} | Awesome Privacy`;
83 return `${name} | ${parentSection.name} | ${categoryName} | Awesome Privacy`;
8684};
8785
8886const makeBreadcrumbs = () => {
89 return [
90 { name: 'Home', item: '/' },
91 { name: categoryName, item: slugify(categoryName) },
92 { name: parentSection.name, item: `${slugify(categoryName)}/${slugify(parentSection.name)}` },
93 { name: name, item: `${slugify(categoryName)}/${slugify(parentSection.name)}/${slugify(name)}` },
94 ];
87 return [
88 { name: 'Home', item: '/' },
89 { name: categoryName, item: slugify(categoryName) },
90 {
91 name: parentSection.name,
92 item: `${slugify(categoryName)}/${slugify(parentSection.name)}`,
93 },
94 {
95 name: name,
96 item: `${slugify(categoryName)}/${slugify(parentSection.name)}/${slugify(name)}`,
97 },
98 ];
9599};
96100
97101/**
98102 * Make a string page intro, for the description tag
99103 */
100104const makeDescriptionTag = () => {
101 let description = `Analysis of ${name}, and other privacy-respecting ${parentSection.name} `;
102 if (parentSection.services) {
103 const serviceList = parentSection.services.map((serv: Service) => serv.name);
104 description += `Compare ${serviceList.join(' vs ')} more apps. `
105 }
106 if (parentSection.alternativeTo && parentSection.alternativeTo.length > 0) {
107 description += `The best secure encrypted alternatives to ${parentSection.alternativeTo.join(', ')} in 2024. `;
108 }
109 description += 'All this, and many more free and awesome tools and software.'
110 return description;
105 let description = `Analysis of ${name}, and other privacy-respecting ${parentSection.name} `;
106 if (parentSection.services) {
107 const serviceList = parentSection.services.map(
108 (serv: Service) => serv.name,
109 );
110 description += `Compare ${serviceList.join(' vs ')} more apps. `;
111 }
112 if (parentSection.alternativeTo && parentSection.alternativeTo.length > 0) {
113 description += `The best secure encrypted alternatives to ${parentSection.alternativeTo.join(', ')} in 2024. `;
114 }
115 description += 'All this, and many more free and awesome tools and software.';
116 return description;
111117};
112118
113119// Return a list of Services, except for the currtent one
114120const filterServices = () => {
115 return parentSection.services.filter((service: Service) => service.name !== name);
121 return parentSection.services.filter(
122 (service: Service) => service.name !== name,
123 );
116124};
117125
118126export async function getStaticPaths() {
119 const pages = await fetchData().then((data) => {
120 const results: Array<Props> = [];
121 if (!data || !data.categories) return results;
122 (data as AwesomePrivacy).categories.forEach((category) => {
123 category.sections.forEach((section) => {
124 const services = (section.services || []).map((service) => {
125 return {
126 slug: `${slugify(category.name)}/${slugify(section.name)}/${slugify(service.name)}`,
127 parentSection: section,
128 categoryName: category.name,
129 ...service,
130 };
131 });
132 results.push(...services);
133 });
134
135 });
136 return results;
137 });
138
139 return pages.map((props: Props) => {
140 return {params: { listing: props.slug }, props };
141 });
127 const pages = await fetchData().then((data) => {
128 const results: Array<Props> = [];
129 if (!data || !data.categories) return results;
130 (data as AwesomePrivacy).categories.forEach((category) => {
131 category.sections.forEach((section) => {
132 const services = (section.services || []).map((service) => {
133 return {
134 slug: `${slugify(category.name)}/${slugify(section.name)}/${slugify(service.name)}`,
135 parentSection: section,
136 categoryName: category.name,
137 ...service,
138 };
139 });
140 results.push(...services);
141 });
142 });
143 return results;
144 });
145
146 return pages.map((props: Props) => {
147 return { params: { listing: props.slug }, props };
148 });
142149}
143150
144151const makePaginationLinks = () => {
145 const allServices = parentSection.services || [];
146 const index = allServices.findIndex(item => item.name === name);
147 const previousItem = index > 0 ? allServices[index - 1].name : null;
148 const nextItem = index < allServices.length - 1 ? allServices[index + 1].name : null;
149 return { previous: previousItem, next: nextItem };
152 const allServices = parentSection.services || [];
153 const index = allServices.findIndex((item) => item.name === name);
154 const previousItem = index > 0 ? allServices[index - 1].name : null;
155 const nextItem =
156 index < allServices.length - 1 ? allServices[index + 1].name : null;
157 return { previous: previousItem, next: nextItem };
150158};
151159
152160const { previous, next } = makePaginationLinks();
@@ -158,565 +166,659 @@ const githubData = github ? await fetchGitHubStats(github) : null;
158166const privacyData = tosdrId ? await fetchTosdrPrivacy(tosdrId) : null;
159167const iosData = iosApp ? await fetchIosInfo(iosApp) : null;
160168const androidData = androidApp ? await fetchAndroidInfo(androidApp) : null;
161const discordData = discordInvite ? await fetchDiscordInfo(discordInvite) : null;
169const discordData = discordInvite
170 ? await fetchDiscordInfo(discordInvite)
171 : null;
162172const redditData = subreddit ? await fetchRedditInfo(subreddit) : null;
163173const dockerData = await fetchDockerData(name);
164const websiteData = (url && !ignoredSites.some(ignoredSite => url.includes(ignoredSite))) ? await fetchWebsiteInfo(url) : null;
174const websiteData =
175 url && !ignoredSites.some((ignoredSite) => url.includes(ignoredSite))
176 ? await fetchWebsiteInfo(url)
177 : null;
165178
166179const findPrivacyPolicyLink = () => {
167 if (!privacyData) return null;
168 // const docs = privacyData?.parameters?.documents;
169 // if (docs) {
170 // const privacyPolicy = (docs || []).find((doc) => doc.name.toLowerCase().includes('privacy policy'));
171 // if (privacyPolicy) return privacyPolicy.url;
172 // }
173 return `https://tosdr.org/en/service/${tosdrId}`;
180 if (!privacyData) return null;
181 // const docs = privacyData?.parameters?.documents;
182 // if (docs) {
183 // const privacyPolicy = (docs || []).find((doc) => doc.name.toLowerCase().includes('privacy policy'));
184 // if (privacyPolicy) return privacyPolicy.url;
185 // }
186 return `https://tosdr.org/en/service/${tosdrId}`;
174187};
175188
176189const privacyPolicyLink = findPrivacyPolicyLink();
177190
178191const getApiEndpoint = () => {
179 return `https://api.awesome-privacy.xyz/${slugify(categoryName)}/${slugify(parentSection.name)}/${slugify(name)}`;
180}
181
192 return `https://api.awesome-privacy.xyz/${slugify(categoryName)}/${slugify(parentSection.name)}/${slugify(name)}`;
193};
182194---
183195
184196<Layout
185 title={makePageTitle()}
186 keywords={makeKeyWordTag()}
187 description={makeDescriptionTag()}
188 breadcrumbs={makeBreadcrumbs()}
197 title={makePageTitle()}
198 keywords={makeKeyWordTag()}
199 description={makeDescriptionTag()}
200 breadcrumbs={makeBreadcrumbs()}
189201>
190 <main>
191 <section>
192 <div class="service-head">
193 <h2>{name}</h2>
194 <span class="url-wrap">
195 <a class="service-url" href={url}>{formatLink(url)}</a>
196 <span class="follow-with">{followWith}</span>
197 </span>
198 </div>
199 <div class="breadcrumbs">
200 <span>
201 <a href="/">Awesome Privacy</a>
202 ➔ <a href={`/${slugify(categoryName)}`}>{categoryName}</a>
203 ➔ <a href={`/${slugify(categoryName)}/${slugify(parentSection.name)}`}>{parentSection.name}</a>
204 ➔ <a href={`/${slugify(categoryName)}/${slugify(parentSection.name)}/${slugify(name)}`}>{name}</a>
205 </span>
206 </div>
207 <div class="save-listing">
208 <SaveListing client:visible
209 categoryName={categoryName}
210 sectionName={parentSection.name}
211 serviceName={name}
212 showLabel={true}
213 />
214 </div>
215 <div class="intro">
216 <img
217 width="60"
218 height="60"
219 loading="lazy"
220 decoding="async"
221 class="service-icon"
222 alt={`${name} Icon`}
223 data-service-url={formatLink(url)}
224 src={icon || `https://icon.horse/icon/${formatLink(url)}`}
225 />
226 <div>
227 <p class="description" set:html={parseMarkdown(description)}></p>
228 <ul>
229 { url && (
230 <li>
231 <b>Homepage:</b>
232 <a href={url}>{formatLink(url)}</a>
233 </li>
234 )}
235 { github && (
236 <li>
237 <b>GitHub:</b>
238 <a href={`https://github.com/${github}`}>github.com/{github}</a>
239 </li>
240 )}
241 { tosdrId && (
242 <li>
243 <b>Privacy:</b>
244 <a href={privacyPolicyLink}>{formatLink(privacyPolicyLink || '')}</a>
245 </li>
246 )}
247 { iosApp && (
248 <li>
249 <b>iOS App:</b>
250 <a href={iosApp}>{formatLink(iosApp)}</a>
251 </li>
252 )}
253 { androidApp && (
254 <li>
255 <b>Android App:</b>
256 <a href={`https://play.google.com/store/apps/details?id=${androidApp}`}>{`https://play.google.com/store/apps/details?id=${androidApp}`}</a>
257 </li>
258 )}
259 { discordInvite && (
260 <li>
261 <b>Discord Invite:</b>
262 <a href={`https://discord.com/invite/${discordInvite}`}>{discordInvite}</a>
263 </li>
264 )}
265 { subreddit && (
266 <li>
267 <b>Subreddit:</b>
268 <a href={`https://reddit.com/r/${subreddit}`}>r/{subreddit}</a>
269 </li>
270 )}
271 { url && (
272 <li>
273 <b>Web info:</b>
274 <a href={`https://web-check.xyz/results/${formatLink(url)}`}>{`web-check.xyz/results/${formatLink(url).split('/')[0]}`}</a>
275 </li>
276 )}
277 { links && links.length > 0 && (
278 links.map((link) => (
279 <li>
280 <b>{link.title}</b>
281 <a href={link.url}>{link.url}</a>
282 </li>
283 ))
284 )}
285 </ul>
286 </div>
287 </div>
288 <div class="highlights">
289 { securityAudited && (
290 <span class="meta-item great" title={`${name} has been security audited by an accredited auditor, with results published publicly`}>
291 <FontAwesome iconName="securityAudited" /> Security Audited
292 </span>
293 )}
294 { acceptsCrypto && (
295 <span class="meta-item great" title={`${name} accepts anonymous payment methods`}>
296 <FontAwesome iconName="cryptoAccepted" /> Crypto Payments Accepted
297 </span>
298 )}
299 { securityAudited === false && (
300 <span class="meta-item warning" title={`${name} has not been audited`}>
301 <FontAwesome iconName="notSecurityAudited" /> No Security Audit
302 </span>
303 )}
304 { (openSource === false) && (
305 <span class="warning">
306 <FontAwesome iconName="closedSource" />
307 Not Open Source
308 </span>
309 )}
310 { openSource || (github && openSource !== false) ? (
311 <span class="meta-item great" title={`${name} is open source`}>
312 <FontAwesome iconName="openSource" /> Open Source
313 </span>
314 ) : null }
315 </div>
316 </section>
317 { privacyData && privacyData.parameters.points.length > 0 && (
318 <section>
319 <h3>{name} Privacy Policy</h3>
320 <PrivacyPolicyDetails privacyData={privacyData} />
321 </section>
322 )}
323 { github && githubData && (
324 <section class="github-wrap">
325 <h3>{name} Source Code</h3>
326 <GitHubDetailedInfo gitHubData={githubData} repo={github} />
327 </section>
328 )}
329 { websiteData && (
330 <section>
331 <h3>{name} Website</h3>
332 <WebsiteDetailedInfo url={url} websiteInfo={websiteData} />
333 </section>
334 )}
335 { (androidData && !androidData.error) && (
336 <section>
337 <h3>{name} Android App</h3>
338 <AndroidAppDetailedInfo androidData={androidData} />
339 </section>
340 )}
341 { iosData && typeof iosData === 'object' && Object.keys(iosData).length > 0 && (
342 <section>
343 <h3>{name} iOS App</h3>
344 <IosAppDetailedInfo url={url} iosData={iosData} />
345 </section>
346 )}
347 { dockerData && dockerData.found && (
348 <section>
349 <h3>{name} Docker</h3>
350 <DockerDetailedInfo docker={dockerData} />
351 </section>
352 )}
353 { (discordData || redditData) && (
354 <section>
355 <h3>{name} Socials</h3>
356 <div class="social-wrap">
357 { discordData && <DiscordDetailedInfo discordData={discordData} /> }
358 { redditData && <RedditDetailedInfo redditData={redditData} /> }
359 </div>
360 </section>
361 )}
362
363 <section>
364 <h3>{name} Reviews</h3>
365 <Comments client:visible />
366 </section>
367
368 <section>
369 <h3>More {parentSection.name}</h3>
370 <ServiceList
371 services={filterServices()}
372 subHeading={true}
373 noGitHubMetrics={true}
374 buttonLink={`/${slugify(categoryName)}/${slugify(parentSection.name)}`}
375 categoryName={categoryName}
376 sectionName={parentSection.name}
377 />
378 </section>
379 <section>
380 <h3>About the Data: {name}</h3>
381 <DataActions client:load categoryName={categoryName} sectionName={parentSection.name} serviceName={name} />
382 <h4>API</h4>
383 <p>
384 You can access {name}'s data programmatically via our API.
385 Simply make a <code>GET</code> request to:
386 </p>
387 <pre><a href={getApiEndpoint()}><code>{getApiEndpoint()}</code></a></pre>
388 <p>
389 The REST API is free, no-auth and CORS-enabled.
390 To learn more, view the <a href="/api">Swagger Docs</a> or read the <a href="/about#api">API Usage Guide</a>.
391 </p>
392
393 <h4>About the Data</h4>
394 <p>
395 Beyond the user-submitted YAML you see above, we also augment each listing with
396 additional data dynamically fetched from several sources.
397 To learn more about where the rest of data included in this page comes from,
398 and how it is computed,
399 see the <a href="/about#our-data">About the Data</a> section of our About page.
400 </p>
401 </section>
402
403 <section>
404 <h3>Share {name}</h3>
405 <p>
406 Help your friends compare {parentSection.name}, and pick privacy-respecting software and services.<br />
407 Share {name} and Awesome Privacy with your network!
408 <div>
409 <SocialShare
410 url={`${site}/${slugify(categoryName)}/${slugify(parentSection.name)}/${slugify(name)} `}
411 title={`Checkout ${name}! \n`}
412 description={
413 `Compare #${name} and other privacy-respecting ${parentSection.name} at `
414 + `Awesome-Privacy.xyz, the free and open source list of private software alternatives. `
415 + `#privacy #opensource #awesomeprivacy by @Lissy_Sykes`}
416 />
417 </div>
418 </p>
419 </section>
420
421 <div class="pagination-navigation">
422 { previous ? (
423 <Button url={`/${slugify(categoryName)}/${slugify(parentSection.name)}/${slugify(previous)}`}>
424 <span>← Previous</span>
425 <p>{previous}</p>
426 </Button>
427 ) : <p class="nothing"></p>}
428 <a href={`/${slugify(categoryName)}/${slugify(parentSection.name)}`} class="go-to-category">
429 View {parentSection.name} ({(parentSection.services || []).length})
430 </a>
431 { next && (
432 <Button url={`/${slugify(categoryName)}/${slugify(parentSection.name)}/${slugify(next)}`}>
433 <span>Next →</span>
434 <p>{next}</p>
435 </Button>
436 )}
437 </div>
438 </main>
202 <main>
203 <section>
204 <div class="service-head">
205 <h2>{name}</h2>
206 <span class="url-wrap">
207 <a class="service-url" href={url}>{formatLink(url)}</a>
208 <span class="follow-with">{followWith}</span>
209 </span>
210 </div>
211 <div class="breadcrumbs">
212 <span>
213 <a href="/">Awesome Privacy</a>
214 ➔ <a href={`/${slugify(categoryName)}`}>{categoryName}</a>
215 ➔ <a href={`/${slugify(categoryName)}/${slugify(parentSection.name)}`}
216 >{parentSection.name}</a
217 >
218 ➔ <a
219 href={`/${slugify(categoryName)}/${slugify(parentSection.name)}/${slugify(name)}`}
220 >{name}</a
221 >
222 </span>
223 </div>
224 <div class="save-listing">
225 <SaveListing
226 client:visible
227 categoryName={categoryName}
228 sectionName={parentSection.name}
229 serviceName={name}
230 showLabel={true}
231 />
232 </div>
233 <div class="intro">
234 <img
235 width="60"
236 height="60"
237 loading="lazy"
238 decoding="async"
239 class="service-icon"
240 alt={`${name} Icon`}
241 data-service-url={formatLink(url)}
242 src={icon || `https://icon.horse/icon/${formatLink(url)}`}
243 />
244 <div>
245 <p class="description" set:html={parseMarkdown(description)} />
246 <ul>
247 {
248 url && (
249 <li>
250 <b>Homepage:</b>
251 <a href={url}>{formatLink(url)}</a>
252 </li>
253 )
254 }
255 {
256 github && (
257 <li>
258 <b>GitHub:</b>
259 <a href={`https://github.com/${github}`}>
260 github.com/{github}
261 </a>
262 </li>
263 )
264 }
265 {
266 tosdrId && (
267 <li>
268 <b>Privacy:</b>
269 <a href={privacyPolicyLink}>
270 {formatLink(privacyPolicyLink || '')}
271 </a>
272 </li>
273 )
274 }
275 {
276 iosApp && (
277 <li>
278 <b>iOS App:</b>
279 <a href={iosApp}>{formatLink(iosApp)}</a>
280 </li>
281 )
282 }
283 {
284 androidApp && (
285 <li>
286 <b>Android App:</b>
287 <a
288 href={`https://play.google.com/store/apps/details?id=${androidApp}`}
289 >{`https://play.google.com/store/apps/details?id=${androidApp}`}</a>
290 </li>
291 )
292 }
293 {
294 discordInvite && (
295 <li>
296 <b>Discord Invite:</b>
297 <a href={`https://discord.com/invite/${discordInvite}`}>
298 {discordInvite}
299 </a>
300 </li>
301 )
302 }
303 {
304 subreddit && (
305 <li>
306 <b>Subreddit:</b>
307 <a href={`https://reddit.com/r/${subreddit}`}>
308 r/{subreddit}
309 </a>
310 </li>
311 )
312 }
313 {
314 url && (
315 <li>
316 <b>Web info:</b>
317 <a
318 href={`https://web-check.xyz/results/${formatLink(url)}`}
319 >{`web-check.xyz/results/${formatLink(url).split('/')[0]}`}</a>
320 </li>
321 )
322 }
323 {
324 links &&
325 links.length > 0 &&
326 links.map((link) => (
327 <li>
328 <b>{link.title}</b>
329 <a href={link.url}>{link.url}</a>
330 </li>
331 ))
332 }
333 </ul>
334 </div>
335 </div>
336 <div class="highlights">
337 {
338 securityAudited && (
339 <span
340 class="meta-item great"
341 title={`${name} has been security audited by an accredited auditor, with results published publicly`}
342 >
343 <FontAwesome iconName="securityAudited" /> Security Audited
344 </span>
345 )
346 }
347 {
348 acceptsCrypto && (
349 <span
350 class="meta-item great"
351 title={`${name} accepts anonymous payment methods`}
352 >
353 <FontAwesome iconName="cryptoAccepted" /> Crypto Payments Accepted
354 </span>
355 )
356 }
357 {
358 securityAudited === false && (
359 <span
360 class="meta-item warning"
361 title={`${name} has not been audited`}
362 >
363 <FontAwesome iconName="notSecurityAudited" /> No Security Audit
364 </span>
365 )
366 }
367 {
368 openSource === false && (
369 <span class="warning">
370 <FontAwesome iconName="closedSource" />
371 Not Open Source
372 </span>
373 )
374 }
375 {
376 openSource || (github && openSource !== false) ? (
377 <span class="meta-item great" title={`${name} is open source`}>
378 <FontAwesome iconName="openSource" /> Open Source
379 </span>
380 ) : null
381 }
382 </div>
383 </section>
384 {
385 privacyData && privacyData.parameters.points.length > 0 && (
386 <section>
387 <h3>{name} Privacy Policy</h3>
388 <PrivacyPolicyDetails privacyData={privacyData} />
389 </section>
390 )
391 }
392 {
393 github && githubData && (
394 <section class="github-wrap">
395 <h3>{name} Source Code</h3>
396 <GitHubDetailedInfo gitHubData={githubData} repo={github} />
397 </section>
398 )
399 }
400 {
401 websiteData && (
402 <section>
403 <h3>{name} Website</h3>
404 <WebsiteDetailedInfo url={url} websiteInfo={websiteData} />
405 </section>
406 )
407 }
408 {
409 androidData && !androidData.error && (
410 <section>
411 <h3>{name} Android App</h3>
412 <AndroidAppDetailedInfo androidData={androidData} />
413 </section>
414 )
415 }
416 {
417 iosData &&
418 typeof iosData === 'object' &&
419 Object.keys(iosData).length > 0 && (
420 <section>
421 <h3>{name} iOS App</h3>
422 <IosAppDetailedInfo url={url} iosData={iosData} />
423 </section>
424 )
425 }
426 {
427 dockerData && dockerData.found && (
428 <section>
429 <h3>{name} Docker</h3>
430 <DockerDetailedInfo docker={dockerData} />
431 </section>
432 )
433 }
434 {
435 (discordData || redditData) && (
436 <section>
437 <h3>{name} Socials</h3>
438 <div class="social-wrap">
439 {discordData && <DiscordDetailedInfo discordData={discordData} />}
440 {redditData && <RedditDetailedInfo redditData={redditData} />}
441 </div>
442 </section>
443 )
444 }
445
446 <section>
447 <h3>{name} Reviews</h3>
448 <Comments client:visible />
449 </section>
450
451 <section>
452 <h3>More {parentSection.name}</h3>
453 <ServiceList
454 services={filterServices()}
455 subHeading={true}
456 noGitHubMetrics={true}
457 buttonLink={`/${slugify(categoryName)}/${slugify(parentSection.name)}`}
458 categoryName={categoryName}
459 sectionName={parentSection.name}
460 />
461 </section>
462 <section>
463 <h3>About the Data: {name}</h3>
464 <DataActions
465 client:load
466 categoryName={categoryName}
467 sectionName={parentSection.name}
468 serviceName={name}
469 />
470 <h4>API</h4>
471 <p>
472 You can access {name}'s data programmatically via our API. Simply make a <code
473 >GET</code
474 > request to:
475 </p>
476 <pre><a href={getApiEndpoint()}><code>{getApiEndpoint()}</code></a></pre>
477 <p>
478 The REST API is free, no-auth and CORS-enabled. To learn more, view the <a
479 href="/api">Swagger Docs</a
480 > or read the <a href="/about#api">API Usage Guide</a>.
481 </p>
482
483 <h4>About the Data</h4>
484 <p>
485 Beyond the user-submitted YAML you see above, we also augment each
486 listing with additional data dynamically fetched from several sources.
487 To learn more about where the rest of data included in this page comes
488 from, and how it is computed, see the <a href="/about#our-data"
489 >About the Data</a
490 > section of our About page.
491 </p>
492 </section>
493
494 <section>
495 <h3>Share {name}</h3>
496 <p>
497 Help your friends compare {parentSection.name}, and pick
498 privacy-respecting software and services.<br />
499 Share {name} and Awesome Privacy with your network!
500 <div>
501 <SocialShare
502 url={`${site}/${slugify(categoryName)}/${slugify(parentSection.name)}/${slugify(name)} `}
503 title={`Checkout ${name}! \n`}
504 description={`Compare #${name} and other privacy-respecting ${parentSection.name} at ` +
505 `Awesome-Privacy.xyz, the free and open source list of private software alternatives. ` +
506 `#privacy #opensource #awesomeprivacy by @Lissy_Sykes`}
507 />
508 </div>
509 </p>
510 </section>
511
512 <div class="pagination-navigation">
513 {
514 previous ? (
515 <Button
516 url={`/${slugify(categoryName)}/${slugify(parentSection.name)}/${slugify(previous)}`}
517 >
518 <span>← Previous</span>
519 <p>{previous}</p>
520 </Button>
521 ) : (
522 <p class="nothing" />
523 )
524 }
525 <a
526 href={`/${slugify(categoryName)}/${slugify(parentSection.name)}`}
527 class="go-to-category"
528 >
529 View {parentSection.name} ({(parentSection.services || []).length})
530 </a>
531 {
532 next && (
533 <Button
534 url={`/${slugify(categoryName)}/${slugify(parentSection.name)}/${slugify(next)}`}
535 >
536 <span>Next →</span>
537 <p>{next}</p>
538 </Button>
539 )
540 }
541 </div>
542 </main>
439543</Layout>
440544
441545<style lang="scss">
442
443main {
444 margin: 2rem auto;
445 padding: 1rem;
446 width: 1200px;
447 max-width: calc(100% - 5rem);
448 position: relative;
449 @media(max-width: 768px) {
450 max-width: 95%;
451 padding: 0.5rem;
452 margin: 0 auto;
453 }
454}
455
456section {
457 margin: 1rem 0 4rem 0;
458 padding: 1rem;
459 min-height: 8rem;
460 position: relative;
461 border: 2px solid var(--box-outline);
462 box-shadow: 6px 6px 0 var(--box-outline);
463 background: var(--accent-fg);
464
465}
466
467p {
468 margin: 0.25rem 0 0.5rem 0;
469}
470
471h3 {
472 font-size: 2rem;
473 margin: -2rem 0 1rem -2rem;
474 box-shadow: 6px 6px 0 var(--box-outline);
475 background: var(--accent);
476 color: var(--accent-fg);
477 width: fit-content;
478 padding: 0.25rem 0.5rem;
479 @media(max-width: 768px) {
480 margin: -2rem auto 2rem auto;
481 }
482 }
483
484.service-head {
485 h2 {
486 font-size: 3rem;
487 margin: 0;
488 @media(max-width: 768px) {
489 text-align: center;
490 }
491 }
492 .url-wrap {
493 display: flex;
494 align-items: center;
495 gap: 0.5rem;
496 a {
497 font-size: 1.2rem;
498 }
499 .follow-with {
500 font-style: italic;
501 opacity: 0.6;
502 }
503 @media(max-width: 768px) {
504 flex-direction: column;
505 }
506 }
507
508}
509
510.breadcrumbs {
511 opacity: 0.5;
512 font-size: 0.8rem;
513 position: absolute;
514 right: 1rem;
515 top: 1rem;
516 a {
517 color: var(--foreground);
518 transition: all 0.15s ease-in-out;
519
520 &:hover {
521 color: var(--accent);
522 }
523 }
524 @media(max-width: 768px) {
525 display: none;
526 }
527}
528
529.save-listing {
530 position: absolute;
531 top: 3rem;
532 right: 1rem;
533}
534
535h4 {
536 font-size: 1.4rem;
537 margin-bottom: 0;
538}
539
540.intro {
541 font-size: 1.2rem;
542 font-style: italic;
543 opacity: 0.9;
544 display: flex;
545 gap: 0.5rem;
546 @media(max-width: 768px) {
547 flex-direction: column;
548 }
549 .service-icon {
550 border-radius: var(--curve-md);
551 margin-top: 1rem;
552 @media(max-width: 768px) {
553 margin: 1rem auto 0 auto;
554 }
555 }
556 ul {
557 padding-left: 1rem;
558 list-style: circle;
559 font-style: normal;
560 font-size: 1rem;
561 margin-top: 0;
562 b {
563 font-size: 1rem;
564 font-weight: 400;
565 min-width: 100px;
566 display: inline-block;
567 @media(max-width: 768px) {
568 width: auto;
569 display: block;
570 }
571 }
572 }
573}
574
575.pagination-navigation {
576 display: flex;
577 justify-content: space-between;
578 align-items: center;
579 padding: 1rem 0;
580 :global(.button) {
581 min-width: 120px;
582 width: fit-content;
583 padding: 0.25rem 1rem;
584 text-align: right;
585 &:first-child { text-align: left; }
586 p {
587 margin: 0;
588 font-weight: normal;
589 font-size: 1rem;
590 }
591 span {
592 font-size: 0.8rem;
593 }
594
595 }
596 .nothing {
597 width: 120px;
598 }
599 .go-to-category {
600 color: var(--foreground);
601 font-size: 0.8rem;
602 opacity: 0.5;
603 @media (max-width: 768px) {
604 display: none;
605 }
606 }
607}
608
609
610
611.further-info, .notable-mentions, .word-of-warning {
612 h3 {
613 font-size: 1.4rem;
614 margin: 1rem 0;
615 }
616 :global(p) {
617 font-size: 0.9rem;
618 opacity: 0.7;
619 :global(strong) {
620 font-weight: 500;
621 }
622 :global(a) {
623 color: var(--foreground);
624 transition: all 0.15s ease-in-out;
625 &:hover {
626 color: var(--accent);
627 }
628 }
629 }
630 :global(strong) {
631 font-weight: 500;
632 }
633 :global(h4) {
634 font-size: 1.2rem;
635 margin: 0.5rem 0 0 0;
636 }
637 :global(ul) {
638 list-style: circle;
639 padding-left: 1rem;
640 font-size: 0.9rem;
641 opacity: 0.7;
642 li {
643 margin-bottom: 0.25rem;
644 :global(p) {
645 display: inline;
646 }
647 }
648 }
649}
650
651pre {
652 a {
653 text-decoration: none;
654 color: var(--foreground);
655 code {
656 background: #acabb782;
657 padding: 0.2rem 0.4rem;
658 border-radius: var(--curve-sm);
659 font-family: Courier New;
660 font-size: 0.9rem;
661 @media(max-width: 768px) {
662 white-space: break-spaces;
663 }
664 }
665 }
666}
667
668.social-wrap {
669 display: flex;
670 gap: 1rem;
671 flex-wrap: wrap;
672 justify-content: space-between;
673}
674
675.highlights {
676 display: flex;
677 gap: 1rem;
678 flex-wrap: wrap;
679 align-items: center;
680 justify-content: end;
681
682 .meta-item, .warning {
683 display: flex;
684 align-items: center;
685 // justify-content: center;
686 gap: 0.25rem;
687 opacity: 0.6;
688 font-size: 0.9rem;
689 padding: 0.5rem 0;
690 :global(svg) {
691 color: var(--foreground);
692 width: 1.2rem;
693 height: 1.2rem;
694 }
695 a {
696 text-decoration: none;
697 color: var(--foreground);
698 display: flex;
699 gap: 0.25rem;
700 &:hover {
701 color: var(--accent-3);
702 :global(svg) {
703 color: var(--accent-3);
704 }
705 }
706 }
707 }
708 .warning {
709 color: var(--danger);
710 :global(svg) {
711 color: var(--danger);
712 }
713 }
714 .great {
715 color: #007930; // var(--success);
716 :global(svg) {
717 color: #007930; // var(--success);
718 }
719 }
720}
721
546 main {
547 margin: 2rem auto;
548 padding: 1rem;
549 width: 1200px;
550 max-width: calc(100% - 5rem);
551 position: relative;
552 @media (max-width: 768px) {
553 max-width: 95%;
554 padding: 0.5rem;
555 margin: 0 auto;
556 }
557 }
558
559 section {
560 margin: 1rem 0 4rem 0;
561 padding: 1rem;
562 min-height: 8rem;
563 position: relative;
564 border: 2px solid var(--box-outline);
565 box-shadow: 6px 6px 0 var(--box-outline);
566 background: var(--accent-fg);
567 }
568
569 p {
570 margin: 0.25rem 0 0.5rem 0;
571 }
572
573 h3 {
574 font-size: 2rem;
575 margin: -2rem 0 1rem -2rem;
576 box-shadow: 6px 6px 0 var(--box-outline);
577 background: var(--accent);
578 color: var(--accent-fg);
579 width: fit-content;
580 padding: 0.25rem 0.5rem;
581 @media (max-width: 768px) {
582 margin: -2rem auto 2rem auto;
583 }
584 }
585
586 .service-head {
587 h2 {
588 font-size: 3rem;
589 margin: 0;
590 @media (max-width: 768px) {
591 text-align: center;
592 }
593 }
594 .url-wrap {
595 display: flex;
596 align-items: center;
597 gap: 0.5rem;
598 a {
599 font-size: 1.2rem;
600 }
601 .follow-with {
602 font-style: italic;
603 opacity: 0.6;
604 }
605 @media (max-width: 768px) {
606 flex-direction: column;
607 }
608 }
609 }
610
611 .breadcrumbs {
612 opacity: 0.5;
613 font-size: 0.8rem;
614 position: absolute;
615 right: 1rem;
616 top: 1rem;
617 a {
618 color: var(--foreground);
619 transition: all 0.15s ease-in-out;
620
621 &:hover {
622 color: var(--accent);
623 }
624 }
625 @media (max-width: 768px) {
626 display: none;
627 }
628 }
629
630 .save-listing {
631 position: absolute;
632 top: 3rem;
633 right: 1rem;
634 }
635
636 h4 {
637 font-size: 1.4rem;
638 margin-bottom: 0;
639 }
640
641 .intro {
642 font-size: 1.2rem;
643 font-style: italic;
644 opacity: 0.9;
645 display: flex;
646 gap: 0.5rem;
647 @media (max-width: 768px) {
648 flex-direction: column;
649 }
650 .service-icon {
651 border-radius: var(--curve-md);
652 margin-top: 1rem;
653 @media (max-width: 768px) {
654 margin: 1rem auto 0 auto;
655 }
656 }
657 ul {
658 padding-left: 1rem;
659 list-style: circle;
660 font-style: normal;
661 font-size: 1rem;
662 margin-top: 0;
663 b {
664 font-size: 1rem;
665 font-weight: 400;
666 min-width: 100px;
667 display: inline-block;
668 @media (max-width: 768px) {
669 width: auto;
670 display: block;
671 }
672 }
673 }
674 }
675
676 .pagination-navigation {
677 display: flex;
678 justify-content: space-between;
679 align-items: center;
680 padding: 1rem 0;
681 :global(.button) {
682 min-width: 120px;
683 width: fit-content;
684 padding: 0.25rem 1rem;
685 text-align: right;
686 &:first-child {
687 text-align: left;
688 }
689 p {
690 margin: 0;
691 font-weight: normal;
692 font-size: 1rem;
693 }
694 span {
695 font-size: 0.8rem;
696 }
697 }
698 .nothing {
699 width: 120px;
700 }
701 .go-to-category {
702 color: var(--foreground);
703 font-size: 0.8rem;
704 opacity: 0.5;
705 @media (max-width: 768px) {
706 display: none;
707 }
708 }
709 }
710
711 .further-info,
712 .notable-mentions,
713 .word-of-warning {
714 h3 {
715 font-size: 1.4rem;
716 margin: 1rem 0;
717 }
718 :global(p) {
719 font-size: 0.9rem;
720 opacity: 0.7;
721 :global(strong) {
722 font-weight: 500;
723 }
724 :global(a) {
725 color: var(--foreground);
726 transition: all 0.15s ease-in-out;
727 &:hover {
728 color: var(--accent);
729 }
730 }
731 }
732 :global(strong) {
733 font-weight: 500;
734 }
735 :global(h4) {
736 font-size: 1.2rem;
737 margin: 0.5rem 0 0 0;
738 }
739 :global(ul) {
740 list-style: circle;
741 padding-left: 1rem;
742 font-size: 0.9rem;
743 opacity: 0.7;
744 li {
745 margin-bottom: 0.25rem;
746 :global(p) {
747 display: inline;
748 }
749 }
750 }
751 }
752
753 pre {
754 a {
755 text-decoration: none;
756 color: var(--foreground);
757 code {
758 background: #acabb782;
759 padding: 0.2rem 0.4rem;
760 border-radius: var(--curve-sm);
761 font-family: Courier New;
762 font-size: 0.9rem;
763 @media (max-width: 768px) {
764 white-space: break-spaces;
765 }
766 }
767 }
768 }
769
770 .social-wrap {
771 display: flex;
772 gap: 1rem;
773 flex-wrap: wrap;
774 justify-content: space-between;
775 }
776
777 .highlights {
778 display: flex;
779 gap: 1rem;
780 flex-wrap: wrap;
781 align-items: center;
782 justify-content: end;
783
784 .meta-item,
785 .warning {
786 display: flex;
787 align-items: center;
788 // justify-content: center;
789 gap: 0.25rem;
790 opacity: 0.6;
791 font-size: 0.9rem;
792 padding: 0.5rem 0;
793 :global(svg) {
794 color: var(--foreground);
795 width: 1.2rem;
796 height: 1.2rem;
797 }
798 a {
799 text-decoration: none;
800 color: var(--foreground);
801 display: flex;
802 gap: 0.25rem;
803 &:hover {
804 color: var(--accent-3);
805 :global(svg) {
806 color: var(--accent-3);
807 }
808 }
809 }
810 }
811 .warning {
812 color: var(--danger);
813 :global(svg) {
814 color: var(--danger);
815 }
816 }
817 .great {
818 color: #007930; // var(--success);
819 :global(svg) {
820 color: #007930; // var(--success);
821 }
822 }
823 }
722824</style>
web/src/pages/[category].astro +112 −105
@@ -1,5 +1,4 @@
11---
2
32import Layout from '@layouts/Layout.astro';
43import SectionList from '@components/things/SectionList.astro';
54import Main from '@components/scafold/MainCard.astro';
@@ -29,129 +28,137 @@ export async function getStaticPaths() {
2928 });
3029 });
3130
32 return pages.map(({ category, title, sections }) => {
33 return {
34 params: { category },
35 props: { title, sections },
36 };
37 });
31 return pages.map(({ category, title, sections }) => {
32 return {
33 params: { category },
34 props: { title, sections },
35 };
36 });
3837}
3938
4039const makeCarasolData = () => {
41 return {
42 "@context": "https://schema.org",
43 "@type": "ItemList",
44 "itemListElement": [
45 sections.map((section, index) => ({
46 "@type": "ListItem",
47 "position": index + 1,
48 "url": `https://awesomeprivacy.com/${slugify(title)}/${slugify(section.name)}`,
49 "item": {
50 "@type": "Service",
51 "name": section.name,
52 "url": `https://awesomeprivacy.com/${slugify(title)}/${slugify(section.name)}`,
53 }
54 })),
55 ]
56 }
40 return {
41 '@context': 'https://schema.org',
42 '@type': 'ItemList',
43 itemListElement: [
44 sections.map((section, index) => ({
45 '@type': 'ListItem',
46 position: index + 1,
47 url: `https://awesomeprivacy.com/${slugify(title)}/${slugify(section.name)}`,
48 item: {
49 '@type': 'Service',
50 name: section.name,
51 url: `https://awesomeprivacy.com/${slugify(title)}/${slugify(section.name)}`,
52 },
53 })),
54 ],
55 };
5756};
5857
5958const makeBreadcrumbs = () => {
60 return [
61 { name: 'Home', item: '/' },
62 { name: title, item: slugify(title) },
63 ];
59 return [
60 { name: 'Home', item: '/' },
61 { name: title, item: slugify(title) },
62 ];
6463};
6564
66
6765const makePaginationLinks = () => {
68 const index = categories.findIndex(category => category.name === title);
69 const previousCategory = index > 0 ? categories[index - 1].name : null;
70 const nextCategory = index < categories.length - 1 ? categories[index + 1].name : null;
71 return { previous: previousCategory, next: nextCategory };
66 const index = categories.findIndex((category) => category.name === title);
67 const previousCategory = index > 0 ? categories[index - 1].name : null;
68 const nextCategory =
69 index < categories.length - 1 ? categories[index + 1].name : null;
70 return { previous: previousCategory, next: nextCategory };
7271};
7372
7473const { previous, next } = makePaginationLinks();
75
7674---
7775
78<Layout title={`${title} | Awesome Privacy`} breadcrumbs={makeBreadcrumbs()} customSchemaJson={makeCarasolData()}>
76<Layout
77 title={`${title} | Awesome Privacy`}
78 breadcrumbs={makeBreadcrumbs()}
79 customSchemaJson={makeCarasolData()}
80>
7981 <Main>
80 <div class="breadcrumbs">
81 <span>
82 <a href="/">Awesome Privacy</a>
83 ➔ <a href={`/${slugify(title)}`}>{title}</a>
84 </span>
85 </div>
82 <div class="breadcrumbs">
83 <span>
84 <a href="/">Awesome Privacy</a>
85 ➔ <a href={`/${slugify(title)}`}>{title}</a>
86 </span>
87 </div>
8688 <SectionList title={title} sections={sections} bigTitle={true} />
87 Or, <a href={`/all#${slugify(title)}`}>Browse All {title}</a>
89 Or, <a href={`/all#${slugify(title)}`}>Browse All {title}</a>
8890 <div class="pagination-navigation">
89 { previous ? (
90 <Button url={`/${slugify(previous)}`}>
91 <span>← Previous</span>
92 <p>{previous}</p>
93 </Button>
94 ) : <p class="nothing"></p>}
95 { next && (
96 <Button url={`/${slugify(next)}`}>
97 <span>Next →</span>
98 <p>{next}</p>
99 </Button>
100 )}
101 </div>
91 {
92 previous ? (
93 <Button url={`/${slugify(previous)}`}>
94 <span>← Previous</span>
95 <p>{previous}</p>
96 </Button>
97 ) : (
98 <p class="nothing" />
99 )
100 }
101 {
102 next && (
103 <Button url={`/${slugify(next)}`}>
104 <span>Next →</span>
105 <p>{next}</p>
106 </Button>
107 )
108 }
109 </div>
102110 </Main>
103111</Layout>
104112
105113<style lang="scss">
106.pagination-navigation {
107 display: flex;
108 justify-content: space-between;
109 align-items: center;
110 padding: 1rem 0;
111 :global(.button) {
112 min-width: 120px;
113 width: fit-content;
114 padding: 0.25rem 1rem;
115 text-align: right;
116 &:first-child { text-align: left; }
117 p {
118 margin: 0;
119 font-weight: normal;
120 font-size: 1rem;
121 }
122 span {
123 font-size: 0.8rem;
124 }
125
126 }
127 .nothing {
128 width: 120px;
129 }
130 .go-to-category {
131 color: var(--foreground);
132 font-size: 0.8rem;
133 opacity: 0.5;
134 }
135}
136
137
138.breadcrumbs {
139 opacity: 0.5;
140 font-size: 0.8rem;
141 position: absolute;
142 right: 1rem;
143 top: 1rem;
144 a {
145 color: var(--foreground);
146 transition: all 0.15s ease-in-out;
147
148 &:hover {
149 color: var(--accent);
150 }
151 }
152 @media(max-width: 768px) {
153 display: none;
154 }
155}
156
114 .pagination-navigation {
115 display: flex;
116 justify-content: space-between;
117 align-items: center;
118 padding: 1rem 0;
119 :global(.button) {
120 min-width: 120px;
121 width: fit-content;
122 padding: 0.25rem 1rem;
123 text-align: right;
124 &:first-child {
125 text-align: left;
126 }
127 p {
128 margin: 0;
129 font-weight: normal;
130 font-size: 1rem;
131 }
132 span {
133 font-size: 0.8rem;
134 }
135 }
136 .nothing {
137 width: 120px;
138 }
139 .go-to-category {
140 color: var(--foreground);
141 font-size: 0.8rem;
142 opacity: 0.5;
143 }
144 }
145
146 .breadcrumbs {
147 opacity: 0.5;
148 font-size: 0.8rem;
149 position: absolute;
150 right: 1rem;
151 top: 1rem;
152 a {
153 color: var(--foreground);
154 transition: all 0.15s ease-in-out;
155
156 &:hover {
157 color: var(--accent);
158 }
159 }
160 @media (max-width: 768px) {
161 display: none;
162 }
163 }
157164</style>
web/src/pages/about.astro +333 −258
@@ -1,14 +1,20 @@
11---
2
32import Layout from '@layouts/Layout.astro';
43import Main from '@components/scafold/MainCard.astro';
54import Icon from '@components/form/Icon.astro';
65import SocialShare from '@components/form/Social.astro';
76import { parseMarkdown } from '@utils/parse-markdown';
8import { authorProjects, authorSocials, aboutOurData, projectRequirements, appDescription } from '../site-config';
7import {
8 authorProjects,
9 authorSocials,
10 aboutOurData,
11 projectRequirements,
12 appDescription,
13} from '../site-config';
914
1015const contributorsResource = async () => {
11 const url = 'https://api.github.com/repos/lissy93/personal-security-checklist/contributors?per_page=100';
16 const url =
17 'https://api.github.com/repos/lissy93/personal-security-checklist/contributors?per_page=100';
1218 const response = await fetch(url);
1319 if (!response.ok) {
1420 throw new Error('Failed to fetch contributors');
@@ -26,334 +32,403 @@ const sponsorsResource = async () => {
2632};
2733
2834const licenseContent = async () => {
29 const url = 'https://raw.githubusercontent.com/Lissy93/awesome-privacy/HEAD/LICENSE';
35 const url =
36 'https://raw.githubusercontent.com/Lissy93/awesome-privacy/HEAD/LICENSE';
3037 const response = await fetch(url);
3138 if (!response.ok) {
3239 throw new Error('Failed to fetch license');
3340 }
3441 return await response.text();
3542};
36
3743---
3844
3945<Layout title="About | Awesome Privacy" description={appDescription}>
4046 <div class="about-page">
41 <Main>
42 <h2 id="objective">Objective</h2>
43 <p>
44 Large data-hungry corporations dominate the digital world but with little,
45 or no respect for your privacy.
46 We believe that privacy is a fundamental human right and that it should be protected.
47 <br /><br />
48 Migrating to open-source applications and those with a strong emphasis on
49 privacy & security will help safegaurd you from corporations,
50 governments, and hackers who log, store or sell your sensetive personal data.
51 <br /><br />
52 Awesome Privacy is a directory of alternative software which respects your privacy.
53 <br /><br />
54
55 </p>
56 <hr />
47 <Main>
48 <h2 id="objective">Objective</h2>
49 <p>
50 Large data-hungry corporations dominate the digital world but with
51 little, or no respect for your privacy. We believe that privacy is a
52 fundamental human right and that it should be protected.
53 <br /><br />
54 Migrating to open-source applications and those with a strong emphasis on
55 privacy & security will help safegaurd you from corporations, governments,
56 and hackers who log, store or sell your sensetive personal data.
57 <br /><br />
58 Awesome Privacy is a directory of alternative software which respects your
59 privacy.
60 <br /><br />
61 </p>
62 <hr />
5763
58 <h2 id="creteria">Software Requirements</h2>
59 <div class="software-requirements"><p set:html={parseMarkdown(projectRequirements)}></p></div>
60 <hr />
64 <h2 id="creteria">Software Requirements</h2>
65 <div class="software-requirements">
66 <p set:html={parseMarkdown(projectRequirements)} />
67 </div>
68 <hr />
6169
62 <h2 id="our-data">Our Data</h2>
63 <div class="about-the-data"><p set:html={parseMarkdown(aboutOurData)}></p></div>
64 <hr />
70 <h2 id="our-data">Our Data</h2>
71 <div class="about-the-data">
72 <p set:html={parseMarkdown(aboutOurData)} />
73 </div>
74 <hr />
6575
66 <h2 id="contributing">Contributing</h2>
67 <p>
68 Awesome Privacy (including all data and code) is fully open source,
69 maintained by a core group of volenteers, with a lot of help from the community.
70 <br /><br />
71 We welcome suggestions, additions, edits and removals to the list.<br />
72 It's thanks to contributors like you that this project is possible 💜
73 <br /><br />
74 To get started, head over to our <a href="https://github.com/lissy93/awesome-privacy">GitHub repository</a>.
75 From here, you'll be able to edit <a href="#"><code>awesome-privacy.yml</code></a>
76 where all data is stored, and then submit your changes as a pull request.
77 <br /><br />
78 If you're new to open source, you can find some resources to get you started
79 at <a href="https://git-in.to">git-in.to</a>, but feel free to reach out if you need any help 😊
80 </p>
81 <hr />
76 <h2 id="contributing">Contributing</h2>
77 <p>
78 Awesome Privacy (including all data and code) is fully open source,
79 maintained by a core group of volenteers, with a lot of help from the
80 community.
81 <br /><br />
82 We welcome suggestions, additions, edits and removals to the list.<br />
83 It's thanks to contributors like you that this project is possible 💜
84 <br /><br />
85 To get started, head over to our <a
86 href="https://github.com/lissy93/awesome-privacy">GitHub repository</a
87 >. From here, you'll be able to edit <a href="#"
88 ><code>awesome-privacy.yml</code></a
89 >
90 where all data is stored, and then submit your changes as a pull request.
91 <br /><br />
92 If you're new to open source, you can find some resources to get you started
93 at <a href="https://git-in.to">git-in.to</a>, but feel free to reach out
94 if you need any help 😊
95 </p>
96 <hr />
8297
83 <h2 id="acknowledgements">Acknowledgements</h2>
84 <h3 id="sponsors">Sponsors</h3>
85 <p>Huge thanks to the following sponsors, for their ongoing support 💖</p>
86 <div class="user-list">
87 {sponsorsResource().then((sponsors) => {
88 return sponsors.map((sponsor: any) => (
89 <a class="user" href={`https://github.com/${sponsor.login}`} target="_blank" rel="noreferrer">
90 <img src={sponsor.avatarUrl} alt={sponsor.login} />
91 <p>{sponsor.name || sponsor.login}</p>
92 </a>
93 ));
94 })}
95 </div>
98 <h2 id="acknowledgements">Acknowledgements</h2>
99 <h3 id="sponsors">Sponsors</h3>
100 <p>Huge thanks to the following sponsors, for their ongoing support 💖</p>
101 <div class="user-list">
102 {
103 sponsorsResource().then((sponsors) => {
104 return sponsors.map((sponsor: any) => (
105 <a
106 class="user"
107 href={`https://github.com/${sponsor.login}`}
108 target="_blank"
109 rel="noreferrer"
110 >
111 <img src={sponsor.avatarUrl} alt={sponsor.login} />
112 <p>{sponsor.name || sponsor.login}</p>
113 </a>
114 ));
115 })
116 }
117 </div>
96118
97 <h3 id="contributors">Contributors</h3>
98 <p>
99 This project exists thanks to all the people who've helped build and maintain it.<br />
100 Special thanks to the below, top-100 contributors 🌟
101 </p>
102 <div class="user-list">
103 {contributorsResource().then((sponsors) => {
104 return sponsors.map((sponsor: any) => (
105 <a class="user" href={sponsor.html_url} target="_blank" rel="noreferrer">
106 <img src={sponsor.avatar_url} alt={sponsor.login} />
107 <p>{sponsor.login}</p>
108 </a>
109 ));
110 })}
111 </div>
119 <h3 id="contributors">Contributors</h3>
120 <p>
121 This project exists thanks to all the people who've helped build and
122 maintain it.<br />
123 Special thanks to the below, top-100 contributors 🌟
124 </p>
125 <div class="user-list">
126 {
127 contributorsResource().then((sponsors) => {
128 return sponsors.map((sponsor: any) => (
129 <a
130 class="user"
131 href={sponsor.html_url}
132 target="_blank"
133 rel="noreferrer"
134 >
135 <img src={sponsor.avatar_url} alt={sponsor.login} />
136 <p>{sponsor.login}</p>
137 </a>
138 ));
139 })
140 }
141 </div>
112142
113 <hr />
143 <hr />
114144
115 <h2 id="support-us">Help us out</h2>
116 <p>
117 Awesome Privacy is a free, open source and community-maintained resource.<br />
118 There's a few ways you can support us:
119 <ul class="help-list">
120 <li>Visiting, forking, or starring or our <a href="https://github.com/lissy93/awesome-privacy">GitHub repository</a></li>
121 <li>Help us keep our info up-to-date, but submitting an addition, removal or ammendment</li>
122 <li>Leave feedback on services that you've used, to help others make a more informed decission</li>
123 <li>Consider <a href="https://github.com/sponsors/Lissy93">sponsoring us on GitHub</a>, if you're able 💖</li>
124 <li>Share Awesome Privacy with your network</li>
125 </ul>
126 <SocialShare />
127 </p>
145 <h2 id="support-us">Help us out</h2>
146 <p>
147 Awesome Privacy is a free, open source and community-maintained
148 resource.<br />
149 There's a few ways you can support us:
150 <ul class="help-list">
151 <li>
152 Visiting, forking, or starring or our <a
153 href="https://github.com/lissy93/awesome-privacy"
154 >GitHub repository</a
155 >
156 </li>
157 <li>
158 Help us keep our info up-to-date, but submitting an addition,
159 removal or ammendment
160 </li>
161 <li>
162 Leave feedback on services that you've used, to help others make a
163 more informed decission
164 </li>
165 <li>
166 Consider <a href="https://github.com/sponsors/Lissy93"
167 >sponsoring us on GitHub</a
168 >, if you're able 💖
169 </li>
170 <li>Share Awesome Privacy with your network</li>
171 </ul>
172 <SocialShare />
173 </p>
128174
129 <hr />
175 <hr />
130176
131 <h2 id="author">Author</h2>
132 <article class="author">
177 <h2 id="author">Author</h2>
178 <article class="author">
133179 <p>
134 This project was originally started by
135 me, <a href="https://aliciasykes.com">Alicia Sykes</a>
180 This project was originally started by me, <a
181 href="https://aliciasykes.com">Alicia Sykes</a
182 >
136183 (with a lot of help from the community)
137184 </p>
138185 <br />
139186 <p class="about">
140 I build apps which aim to help people escape big tech, secure their data,
141 and protect their privacy.
187 I build apps which aim to help people escape big tech, secure their
188 data, and protect their privacy.
142189 </p>
143190 <br />
144191 <div class="pic-and-socials">
145192 <a href="https://aliciasykes.com">
146 <img class="pic" width="180" height="240" alt="Alicia Sykes" src="https://i.ibb.co/fq10qhL/DSC-0597.jpg" />
193 <img
194 class="pic"
195 width="180"
196 height="240"
197 alt="Alicia Sykes"
198 src="https://i.ibb.co/fq10qhL/DSC-0597.jpg"
199 />
147200 </a>
148201 <div class="socials">
149202 {
150 authorSocials.map((social: { link: string; color: string; icon: string; }) => (
151 <a href={social.link} style={`--color: ${social.color}`} target="_blank">
152 <Icon icon={social.icon} width={24} height={24} />
153 </a>
154 ))
203 authorSocials.map(
204 (social: { link: string; color: string; icon: string }) => (
205 <a
206 href={social.link}
207 style={`--color: ${social.color}`}
208 target="_blank"
209 >
210 <Icon icon={social.icon} width={24} height={24} />
211 </a>
212 ),
213 )
155214 }
156215 </div>
157216 </div>
158217 <p class="more-about">
159 I have a particular interest in self-hosting, Linux, security and OSINT.<br />
218 I have a particular interest in self-hosting, Linux, security and
219 OSINT.<br />
160220 So if this type of stuff interests you, check out these other projects:
161221 </p>
162222 <ul>
163223 {
164 authorProjects.map((project: { title: string; icon: string; link: string; description: string; }) => (
165 <li>
166 <img width="20" height="20" alt={project.title} src={project.icon} />
167 <a href={project.link} target="_blank" rel="noreferrer">
168 {project.title}
169 </a> - {project.description}
170 </li>
171 ))
224 authorProjects.map(
225 (project: {
226 title: string;
227 icon: string;
228 link: string;
229 description: string;
230 }) => (
231 <li>
232 <img
233 width="20"
234 height="20"
235 alt={project.title}
236 src={project.icon}
237 />
238 <a href={project.link} target="_blank" rel="noreferrer">
239 {project.title}
240 </a>{' '}
241 - {project.description}
242 </li>
243 ),
244 )
172245 }
173246 <li>
174 ...and loads more, over at <a href="https://apps.aliciasykes.com/">apps.aliciasykes.com</a>
247 ...and loads more, over at <a href="https://apps.aliciasykes.com/"
248 >apps.aliciasykes.com</a
249 >
175250 and on <a href="https://github.com/lissy93">github.com/lissy93</a>
176251 </li>
177252 </ul>
178253 <br />
179254 <p>
180 If you'd like to support the ongoing work on Awesome Privacy,
181 and other similar projects,
182 consider <a href="https://github.com/sponsors/lissy93">sponsoring me</a> on GitHub 💖
255 If you'd like to support the ongoing work on Awesome Privacy, and
256 other similar projects, consider <a
257 href="https://github.com/sponsors/lissy93">sponsoring me</a
258 > on GitHub 💖
183259 </p>
260 </article>
184261
185 </article>
186
187 <hr />
188
189 <h2 id="license">License</h2>
190 <p>
191 All content on Awesome Privacy is freely available, within the public domain,
192 licensed under Creative Commons Zero v1.0 Universal.
193 The code for the website is licensed under MIT.
194 </p>
195 <p>
196 {licenseContent().then((license) => {
197 return (<pre class="license-content">{license}</pre>)
198 })}
199 </p>
262 <hr />
200263
201 </Main>
264 <h2 id="license">License</h2>
265 <p>
266 All content on Awesome Privacy is freely available, within the public
267 domain, licensed under Creative Commons Zero v1.0 Universal. The code
268 for the website is licensed under MIT.
269 </p>
270 <p>
271 {
272 licenseContent().then((license) => {
273 return <pre class="license-content">{license}</pre>;
274 })
275 }
276 </p>
277 </Main>
202278 </div>
203279</Layout>
204280
205281<style lang="scss">
206h2 {
207 font-size: 2rem;
208 margin: 2rem 0 1rem 0;
209}
210p {
211 font-size: 1.2rem;
212}
213hr {
214 margin: 2rem 0;
215 border: 0;
216 border-top: 2px solid var(--accent);
217 &:nth-child(6) {
218 border-color: var(--accent-3);
219 }
220 &:nth-child(9) {
221 border-color: var(--accent-2);
282 h2 {
283 font-size: 2rem;
284 margin: 2rem 0 1rem 0;
222285 }
223}
224
225h3 {
226 font-size: 1.6rem;
227}
228
229.software-requirements, .about-the-data {
230 :global(p) {
286 p {
231287 font-size: 1.2rem;
232 margin: 0 0 0.5rem 0;
233288 }
234 :global(ul) {
235 padding-left: 0.5rem;
236 list-style: none;
237 font-size: 1.2rem;
238 :global(li ul) {
239 padding: 0 0 0.5rem 1rem;
240 list-style: circle;
289 hr {
290 margin: 2rem 0;
291 border: 0;
292 border-top: 2px solid var(--accent);
293 &:nth-child(6) {
294 border-color: var(--accent-3);
295 }
296 &:nth-child(9) {
297 border-color: var(--accent-2);
241298 }
242
243299 }
244 :global(h3) {
300
301 h3 {
245302 font-size: 1.6rem;
246 margin-bottom: 0;
247 }
248 :global(strong) {
249 font-weight: 500;
250303 }
251 :global(small) {
252 font-size: 0.8rem;
253 opacity: 0.7;
254 :global(a) {
255 color: var(--accent-3);
304
305 .software-requirements,
306 .about-the-data {
307 :global(p) {
308 font-size: 1.2rem;
309 margin: 0 0 0.5rem 0;
310 }
311 :global(ul) {
312 padding-left: 0.5rem;
313 list-style: none;
314 font-size: 1.2rem;
315 :global(li ul) {
316 padding: 0 0 0.5rem 1rem;
317 list-style: circle;
318 }
319 }
320 :global(h3) {
321 font-size: 1.6rem;
322 margin-bottom: 0;
323 }
324 :global(strong) {
325 font-weight: 500;
326 }
327 :global(small) {
328 font-size: 0.8rem;
329 opacity: 0.7;
330 :global(a) {
331 color: var(--accent-3);
332 }
333 }
334 :global(code) {
335 font-family: 'Courier New', Courier, monospace;
336 background: #acabb782;
337 padding: 0.2rem 0.4rem;
338 border-radius: var(--curve-sm);
339 font-size: 0.9rem;
256340 }
257341 }
258 :global(code) {
259 font-family: 'Courier New', Courier, monospace;
260 background: #acabb782;
261 padding: 0.2rem 0.4rem;
262 border-radius: var(--curve-sm);
263 font-size: 0.9rem;
264 }
265}
266342
267.user-list {
268 display: flex;
269 flex-wrap: wrap;
270 gap: 1rem;
271 margin: 2rem 0;
272 .user {
273 width: 6rem;
274 overflow: hidden;
275 text-align: center;
276 img {
277 width: 5rem;
278 height: 5rem;
279 border-radius: var(--curve-md);
280 }
281 p {
282 font-size: 1rem;
283 display: -webkit-box;
284 -webkit-line-clamp: 1;
285 -webkit-box-orient: vertical;
343 .user-list {
344 display: flex;
345 flex-wrap: wrap;
346 gap: 1rem;
347 margin: 2rem 0;
348 .user {
349 width: 6rem;
286350 overflow: hidden;
351 text-align: center;
352 img {
353 width: 5rem;
354 height: 5rem;
355 border-radius: var(--curve-md);
356 }
357 p {
358 font-size: 1rem;
359 display: -webkit-box;
360 -webkit-line-clamp: 1;
361 -webkit-box-orient: vertical;
362 overflow: hidden;
363 }
287364 }
288365 }
289}
290
291.license-content {
292 max-height: 500px;
293 overflow: scroll;
294 background: var(--background-form);
295 width: fit-content;
296 border-radius: var(--curve-sm);
297 padding: 0.5rem;
298 font-size: 0.7rem;
299 font-family: mono;
300 max-width: 100vw;
301 white-space: pre-line;
302}
303
304.help-list {
305 padding-left: 1rem;
306 list-style: circle;
307 font-size: 1.1rem;
308}
309366
310.author {
311 p {
312 margin: 1rem 0 0 0;
367 .license-content {
368 max-height: 500px;
369 overflow: scroll;
370 background: var(--background-form);
371 width: fit-content;
372 border-radius: var(--curve-sm);
373 padding: 0.5rem;
374 font-size: 0.7rem;
375 font-family: mono;
376 max-width: 100vw;
377 white-space: pre-line;
313378 }
314 ul {
315 padding-left: 1.5rem;
379
380 .help-list {
381 padding-left: 1rem;
316382 list-style: circle;
317 margin-bottom: 0;
318 li {
319 font-size: 1.1rem;
320 }
383 font-size: 1.1rem;
321384 }
322 .about {
323 font-size: 1.4rem;
324 font-style: italic;
325 font-weight: 300;
326 color: var(--accent-3);
327 text-align: center;
328 max-width: 550px;
329 margin: 0 auto;
330 }
331
332 small {
333 font-size: 1rem;
334 margin: 1rem 0;
335 }
336 .pic-and-socials {
337 float:right;
338 img {
339 margin: 0.5rem 1rem;
340 border-radius: var(--curve-md);
341 border: 2px solid var(--box-outline);
342 box-shadow: 4px 4px 0 var(--box-outline);
385
386 .author {
387 p {
388 margin: 1rem 0 0 0;
343389 }
344 .socials {
345 display: flex;
346 margin: 0.5rem 1rem;
347 justify-content: space-between;
348 :global(a svg) {
349 color: var(--foreground);
350 transition: color 0.2s ease-in-out;
351 &:hover {
352 color: var(--color);
390 ul {
391 padding-left: 1.5rem;
392 list-style: circle;
393 margin-bottom: 0;
394 li {
395 font-size: 1.1rem;
396 }
397 }
398 .about {
399 font-size: 1.4rem;
400 font-style: italic;
401 font-weight: 300;
402 color: var(--accent-3);
403 text-align: center;
404 max-width: 550px;
405 margin: 0 auto;
406 }
407
408 small {
409 font-size: 1rem;
410 margin: 1rem 0;
411 }
412 .pic-and-socials {
413 float: right;
414 img {
415 margin: 0.5rem 1rem;
416 border-radius: var(--curve-md);
417 border: 2px solid var(--box-outline);
418 box-shadow: 4px 4px 0 var(--box-outline);
419 }
420 .socials {
421 display: flex;
422 margin: 0.5rem 1rem;
423 justify-content: space-between;
424 :global(a svg) {
425 color: var(--foreground);
426 transition: color 0.2s ease-in-out;
427 &:hover {
428 color: var(--color);
429 }
353430 }
354431 }
355432 }
356433 }
357}
358
359434</style>
web/src/pages/api/awesome-privacy.json.ts +13 −10
@@ -3,19 +3,22 @@ import yaml from 'js-yaml';
33
44import type { AwesomePrivacy } from '../../types/Service';
55
6const awesomePrivacyYamlPath = 'https://raw.githubusercontent.com/Lissy93/awesome-privacy/main/awesome-privacy.yml';
6const awesomePrivacyYamlPath =
7 'https://raw.githubusercontent.com/Lissy93/awesome-privacy/main/awesome-privacy.yml';
78
89export const GET: APIRoute = async () => {
9
1010 const yamlContent = await fetch(awesomePrivacyYamlPath)
11 .then(response => response.text())
12 .catch(error => {
13 return JSON.stringify({ error: "Failed to fetch YAML file", details: error });
14 });
11 .then((response) => response.text())
12 .catch((error) => {
13 return JSON.stringify({
14 error: 'Failed to fetch YAML file',
15 details: error,
16 });
17 });
1518
1619 const yamlObject = yaml.load(yamlContent) as AwesomePrivacy;
1720
18 return new Response(
19 JSON.stringify(yamlObject), { headers: { 'content-type': 'application/json' } }
20 )
21}
21 return new Response(JSON.stringify(yamlObject), {
22 headers: { 'content-type': 'application/json' },
23 });
24};
web/src/pages/api/index.astro +32 −30
@@ -3,43 +3,45 @@ import Layout from '@layouts/Layout.astro';
33import Button from '@components/form/Button.astro';
44
55import MainCard from '@components/scafold/MainCard.astro';
6
76---
87
98<Layout title="API Docs | Awesome Privacy">
10
11 <MainCard>
12 <div id="swagger-ui"></div>
13 <div class="go">
14 <Button url="https://api.awesome-privacy.xyz" text="Try it Out" />
15 </div>
16 </MainCard>
17
9 <MainCard>
10 <div id="swagger-ui"></div>
11 <div class="go">
12 <Button url="https://api.awesome-privacy.xyz" text="Try it Out" />
13 </div>
14 </MainCard>
1815</Layout>
1916
20<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/swagger-ui/4.1.3/swagger-ui.css">
21<script is:inline src="https://cdnjs.cloudflare.com/ajax/libs/swagger-ui/4.1.3/swagger-ui-bundle.js"></script>
17<link
18 rel="stylesheet"
19 type="text/css"
20 href="https://cdnjs.cloudflare.com/ajax/libs/swagger-ui/4.1.3/swagger-ui.css"
21/>
22<script
23 is:inline
24 src="https://cdnjs.cloudflare.com/ajax/libs/swagger-ui/4.1.3/swagger-ui-bundle.js"
25></script>
2226<script type="module" is:inline>
23 window.onload = () => {
24 SwaggerUIBundle({
25 url: 'https://raw.githubusercontent.com/Lissy93/awesome-privacy/main/api/open-api-spec.yml',
26 dom_id: '#swagger-ui',
27 deepLinking: true,
28 presets: [
29 SwaggerUIBundle.presets.apis,
30 SwaggerUIBundle.SwaggerUIStandalonePreset
31 ],
32 plugins: [
33 SwaggerUIBundle.plugins.DownloadUrl
34 ]
35 });
36 }
27 window.onload = () => {
28 SwaggerUIBundle({
29 url: 'https://raw.githubusercontent.com/Lissy93/awesome-privacy/main/api/open-api-spec.yml',
30 dom_id: '#swagger-ui',
31 deepLinking: true,
32 presets: [
33 SwaggerUIBundle.presets.apis,
34 SwaggerUIBundle.SwaggerUIStandalonePreset,
35 ],
36 plugins: [SwaggerUIBundle.plugins.DownloadUrl],
37 });
38 };
3739</script>
3840
3941<style lang="scss">
40 .go {
41 display: flex;
42 justify-content: center;
43 margin-top: 1rem;
44 }
42 .go {
43 display: flex;
44 justify-content: center;
45 margin-top: 1rem;
46 }
4547</style>
web/src/pages/api/line-numbers.json.ts +42 −25
@@ -14,35 +14,47 @@ interface LineNumberData {
1414 [service: string]: {
1515 lineNumbers: LineNumberRange | null;
1616 yaml: string;
17 }
17 };
1818 };
1919 };
2020}
2121
22const awesomePrivacyYamlPath = 'https://raw.githubusercontent.com/Lissy93/awesome-privacy/main/awesome-privacy.yml';
22const awesomePrivacyYamlPath =
23 'https://raw.githubusercontent.com/Lissy93/awesome-privacy/main/awesome-privacy.yml';
2324
2425/**
2526 * Given a service object and an array of string lines from the raw YAML
2627 * Find the starting and ending line number for that service
2728 */
28const calculateServiceRange = (service: Service, category: Category, yamlLines: string[]): LineNumberRange | null => {
29const calculateServiceRange = (
30 service: Service,
31 category: Category,
32 yamlLines: string[],
33): LineNumberRange | null => {
2934 const lookFor = `- name: ${service.name}`;
30 const categoryStart = yamlLines.findIndex(line => line.includes(category.name));
31 const start = yamlLines.slice(categoryStart).findIndex(line => line.includes(lookFor)) + categoryStart + 1;
35 const categoryStart = yamlLines.findIndex((line) =>
36 line.includes(category.name),
37 );
38 const start =
39 yamlLines.slice(categoryStart).findIndex((line) => line.includes(lookFor)) +
40 categoryStart +
41 1;
3242 if (start === -1) return null;
3343 const detectEnd = (line: string) => {
34 return line.trim().length === 0
35 || line.startsWith(' - ')
36 || line.includes('- name:')
37 || line.includes('notableMentions:')
38 || line.includes('furtherInfo:')
39 || line.includes('wordOfWarning:')
40 }
44 return (
45 line.trim().length === 0 ||
46 line.startsWith(' - ') ||
47 line.includes('- name:') ||
48 line.includes('notableMentions:') ||
49 line.includes('furtherInfo:') ||
50 line.includes('wordOfWarning:')
51 );
52 };
4153 const remainingLines = yamlLines.slice(start);
4254 const end = start + remainingLines.findIndex(detectEnd);
43
55
4456 return { start, end };
45}
57};
4658
4759/**
4860 * Given a service object, convert it into a correctly formatted YAML string
@@ -55,7 +67,10 @@ const convertJsonIntoYaml = (service: Service): string => {
5567 * Given the object representation of the YAML and the array of lines from the raw YAML
5668 * Organize the data into a format that can be returned as JSON
5769 */
58const makeResults = (yamlObject: AwesomePrivacy, yamlLines: string[]): LineNumberData => {
70const makeResults = (
71 yamlObject: AwesomePrivacy,
72 yamlLines: string[],
73): LineNumberData => {
5974 const organizedData: LineNumberData = {};
6075 (yamlObject.categories || []).forEach((category) => {
6176 organizedData[category.name] = {};
@@ -70,16 +85,18 @@ const makeResults = (yamlObject: AwesomePrivacy, yamlLines: string[]): LineNumbe
7085 });
7186 });
7287 return organizedData;
73}
88};
7489
7590export const GET: APIRoute = async () => {
76
7791 // Fetch the raw YAML from the awesome-privacy repository
7892 const yamlContent = await fetch(awesomePrivacyYamlPath)
79 .then(response => response.text())
80 .catch(error => {
81 return JSON.stringify({ error: "Failed to fetch YAML file", details: error });
82 });
93 .then((response) => response.text())
94 .catch((error) => {
95 return JSON.stringify({
96 error: 'Failed to fetch YAML file',
97 details: error,
98 });
99 });
83100
84101 // Array of lines from the raw YAML
85102 const yamlLines: string[] = yamlContent.split('\n');
@@ -90,7 +107,7 @@ export const GET: APIRoute = async () => {
90107 // Make results
91108 const results = makeResults(yamlObject, yamlLines);
92109
93 return new Response(
94 JSON.stringify(results), { headers: { 'content-type': 'application/json' } }
95 )
96}
110 return new Response(JSON.stringify(results), {
111 headers: { 'content-type': 'application/json' },
112 });
113};
web/src/pages/browse.astro +208 −198
@@ -1,5 +1,4 @@
11---
2
32import Layout from '@layouts/Layout.astro';
43import SectionList from '@components/things/SectionList.astro';
54
@@ -7,210 +6,221 @@ import { fetchData } from '@utils/fetch-data';
76import type { Category } from '../types/Service';
87
98const categories: Category[] = (await fetchData())?.categories;
10
119---
1210
1311<Layout title="Browse">
14
15<div class="head-wrap">
16 <h2>Browse</h2>
17 <span>
18 <input id="searchInput" type="search" placeholder="Start typing to filter..." />
19 <p id="press-enter-msg" class="press-enter">Press enter for deep search</p>
20 </span>
21</div>
22<p class="sitemap-link">Not sure what you're looking for? Take a look through <a href="/all">all listings</a></p>
23
24<ul class="categories">
25 {categories.map((category) => (
26 <li class="category">
27 <SectionList title={category.name} sections={category.sections} />
28 </li>
29 ))}
30</ul>
31
32<div class="no-results">
33 <p class="zilch">Nothing found 😢</p>
34 <p>Try a <a href="/search">deep search</a> instead</p>
35</div>
12 <div class="head-wrap">
13 <h2>Browse</h2>
14 <span>
15 <input
16 id="searchInput"
17 type="search"
18 placeholder="Start typing to filter..."
19 />
20 <p id="press-enter-msg" class="press-enter">
21 Press enter for deep search
22 </p>
23 </span>
24 </div>
25 <p class="sitemap-link">
26 Not sure what you're looking for? Take a look through <a href="/all"
27 >all listings</a
28 >
29 </p>
30
31 <ul class="categories">
32 {
33 categories.map((category) => (
34 <li class="category">
35 <SectionList title={category.name} sections={category.sections} />
36 </li>
37 ))
38 }
39 </ul>
40
41 <div class="no-results">
42 <p class="zilch">Nothing found 😢</p>
43 <p>Try a <a href="/search">deep search</a> instead</p>
44 </div>
3645</Layout>
3746
3847<script>
39// Time for some good ol' fashioned vanilla JS...
40// I reccomend you not to look at this code for too long, it's not pretty.
41const filterInput = document.querySelector('input');
42const categories = document.querySelectorAll<HTMLElement>('.category');
43const pressEnterMsg = document.getElementById('press-enter-msg') as HTMLElement | null;
44const noResults = document.querySelector('.no-results') as HTMLElement | null;
45
46if (!pressEnterMsg || !noResults) {
47 throw new Error('No pressEnterMsg or noResults');
48};
49
50filterInput?.addEventListener('input', (e) => {
51 let resultsCount = 0;
52 const filter = (e.target as HTMLInputElement).value.toLowerCase();
53 if (filter.length > 0) {
54 pressEnterMsg.style.visibility = 'visible';
55 } else {
56 pressEnterMsg.style.visibility = 'hidden';
57 }
58 categories.forEach((category) => {
59 const titleElement = category.querySelector('.category-title');
60 const title = titleElement ? titleElement.textContent?.toLowerCase() : '';
61 const sections = category.querySelectorAll<HTMLElement>('.section');
62 let count = 0;
63 sections.forEach((section) => {
64 const sectionTitle = section.textContent?.toLowerCase();
65 if (sectionTitle?.includes(filter)) {
66 section.style.display = 'block';
67 count++;
68 resultsCount++;
69 } else {
70 section.style.display = 'none';
71 }
72 });
73 if (title && title.includes(filter)) {
74 category.style.display = 'inline-flex';
75 resultsCount++;
76 } else if (count === 0) {
77 category.style.display = 'none';
78 }
79 });
80 noResults.style.display = resultsCount === 0 ? 'block' : 'none';
81});
82
83if (typeof window !== 'undefined') {
84 document.addEventListener('DOMContentLoaded', function() {
85 const searchInput = document.getElementById('searchInput') as HTMLInputElement | null;
86 if (searchInput === null) return;
87 searchInput.addEventListener('keydown', function(event) {
88 if (event.key === 'Enter') {
89 event.preventDefault();
90 window.location.href = `/search/${encodeURIComponent(searchInput.value.trim())}`;
91 }
92 if (event.key === 'Escape') {
93 searchInput.value = '';
94 searchInput.blur();
95 pressEnterMsg.style.visibility = 'hidden';
96 categories.forEach((category) => {
97 category.style.display = 'inline-flex';
98 const sections = category.querySelectorAll<HTMLElement>('.section');
99 sections.forEach((section) => {
100 section.style.display = 'block';
101 });
102 });
103 }
104 });
105 });
106}
48 // Time for some good ol' fashioned vanilla JS...
49 // I reccomend you not to look at this code for too long, it's not pretty.
50 const filterInput = document.querySelector('input');
51 const categories = document.querySelectorAll<HTMLElement>('.category');
52 const pressEnterMsg = document.getElementById(
53 'press-enter-msg',
54 ) as HTMLElement | null;
55 const noResults = document.querySelector('.no-results') as HTMLElement | null;
56
57 if (!pressEnterMsg || !noResults) {
58 throw new Error('No pressEnterMsg or noResults');
59 }
60
61 filterInput?.addEventListener('input', (e) => {
62 let resultsCount = 0;
63 const filter = (e.target as HTMLInputElement).value.toLowerCase();
64 if (filter.length > 0) {
65 pressEnterMsg.style.visibility = 'visible';
66 } else {
67 pressEnterMsg.style.visibility = 'hidden';
68 }
69 categories.forEach((category) => {
70 const titleElement = category.querySelector('.category-title');
71 const title = titleElement ? titleElement.textContent?.toLowerCase() : '';
72 const sections = category.querySelectorAll<HTMLElement>('.section');
73 let count = 0;
74 sections.forEach((section) => {
75 const sectionTitle = section.textContent?.toLowerCase();
76 if (sectionTitle?.includes(filter)) {
77 section.style.display = 'block';
78 count++;
79 resultsCount++;
80 } else {
81 section.style.display = 'none';
82 }
83 });
84 if (title && title.includes(filter)) {
85 category.style.display = 'inline-flex';
86 resultsCount++;
87 } else if (count === 0) {
88 category.style.display = 'none';
89 }
90 });
91 noResults.style.display = resultsCount === 0 ? 'block' : 'none';
92 });
93
94 if (typeof window !== 'undefined') {
95 document.addEventListener('DOMContentLoaded', function () {
96 const searchInput = document.getElementById(
97 'searchInput',
98 ) as HTMLInputElement | null;
99 if (searchInput === null) return;
100 searchInput.addEventListener('keydown', function (event) {
101 if (event.key === 'Enter') {
102 event.preventDefault();
103 window.location.href = `/search/${encodeURIComponent(searchInput.value.trim())}`;
104 }
105 if (event.key === 'Escape') {
106 searchInput.value = '';
107 searchInput.blur();
108 pressEnterMsg.style.visibility = 'hidden';
109 categories.forEach((category) => {
110 category.style.display = 'inline-flex';
111 const sections = category.querySelectorAll<HTMLElement>('.section');
112 sections.forEach((section) => {
113 section.style.display = 'block';
114 });
115 });
116 }
117 });
118 });
119 }
107120</script>
108121
109
110122<style lang="scss">
111
112.head-wrap {
113 margin: 1rem auto 0 auto;
114 width: 85vw;
115 display: flex;
116 align-items: center;
117 justify-content: space-between;
118 flex-wrap: wrap;
119 .press-enter {
120 margin: 0.5rem 0 0 0;
121 opacity: 0.5;
122 visibility: hidden;
123 }
124 input {
125 padding: 0.5rem;
126 border: 2px solid var(--box-outline);
127 border-radius: var(--curve-sm);
128 font-size: 1.2rem;
129 box-shadow: 3px 3px 0 var(--box-outline);
130 color: var(--accent-3);
131 background: var(--background-form);
132 &:focus {
133 outline: none;
134 box-shadow: 4px 4px 0 var(--box-outline);
135 }
136 }
137 h2 {
138 font-family: "Lekton", sans-serif;
139 font-weight: bold;
140 font-size: 3rem;
141 margin: 0;
142 color: var(--accent-3);
143 }
144}
145
146.sitemap-link {
147 margin: 0 auto;
148 width: 85vw;
149 a {
150 color: var(--accent-3);
151 }
152}
153
154.no-results {
155 text-align: center;
156 width: 85vw;
157 margin: 2rem auto 4rem auto;
158 display: none;
159 .zilch {
160 font-size: 2rem;
161 color: var(--accent-3);
162 opacity: 0.5;
163 font-weight: bold;
164 }
165 p {
166 margin: 0.25rem;
167 }
168}
169
170.categories {
171 columns: 6 300px;
172 column-gap: 1rem;
173 margin: 0 auto;
174 width: 85vw;
175 max-width: 1800px;
176 padding: 1rem 0 2rem 0;
177 @media(max-width: 768px) {
178 padding: 0;
179 width: 95%;
180 }
181 .category {
182 background: var(--accent-fg);
183 border: 2px solid var(--box-outline);
184 border-radius: var(--curve-sm);
185 box-shadow: 4px 4px 0 var(--box-outline);
186 padding: 1rem;
187 width: 85%;
188 display: inline-flex;
189 flex-direction: column;
190 margin: 1rem;
191 .category-title {
192 text-decoration: none;
193 color: var(--foreground);
194 }
195 h3 {
196 font-family: "Lekton", sans-serif;
197 font-weight: bold;
198 margin: 0;
199 font-size: 1.8rem;
200 }
201 .sections {
202 padding-left: 1rem;
203 .section {
204 a {
205 text-decoration: none;
206 color: var(--foreground);
207 }
208 .service-count {
209 color: var(--accent-3);
210 }
211 }
212 }
213 }
214}
215
123 .head-wrap {
124 margin: 1rem auto 0 auto;
125 width: 85vw;
126 display: flex;
127 align-items: center;
128 justify-content: space-between;
129 flex-wrap: wrap;
130 .press-enter {
131 margin: 0.5rem 0 0 0;
132 opacity: 0.5;
133 visibility: hidden;
134 }
135 input {
136 padding: 0.5rem;
137 border: 2px solid var(--box-outline);
138 border-radius: var(--curve-sm);
139 font-size: 1.2rem;
140 box-shadow: 3px 3px 0 var(--box-outline);
141 color: var(--accent-3);
142 background: var(--background-form);
143 &:focus {
144 outline: none;
145 box-shadow: 4px 4px 0 var(--box-outline);
146 }
147 }
148 h2 {
149 font-family: 'Lekton', sans-serif;
150 font-weight: bold;
151 font-size: 3rem;
152 margin: 0;
153 color: var(--accent-3);
154 }
155 }
156
157 .sitemap-link {
158 margin: 0 auto;
159 width: 85vw;
160 a {
161 color: var(--accent-3);
162 }
163 }
164
165 .no-results {
166 text-align: center;
167 width: 85vw;
168 margin: 2rem auto 4rem auto;
169 display: none;
170 .zilch {
171 font-size: 2rem;
172 color: var(--accent-3);
173 opacity: 0.5;
174 font-weight: bold;
175 }
176 p {
177 margin: 0.25rem;
178 }
179 }
180
181 .categories {
182 columns: 6 300px;
183 column-gap: 1rem;
184 margin: 0 auto;
185 width: 85vw;
186 max-width: 1800px;
187 padding: 1rem 0 2rem 0;
188 @media (max-width: 768px) {
189 padding: 0;
190 width: 95%;
191 }
192 .category {
193 background: var(--accent-fg);
194 border: 2px solid var(--box-outline);
195 border-radius: var(--curve-sm);
196 box-shadow: 4px 4px 0 var(--box-outline);
197 padding: 1rem;
198 width: 85%;
199 display: inline-flex;
200 flex-direction: column;
201 margin: 1rem;
202 .category-title {
203 text-decoration: none;
204 color: var(--foreground);
205 }
206 h3 {
207 font-family: 'Lekton', sans-serif;
208 font-weight: bold;
209 margin: 0;
210 font-size: 1.8rem;
211 }
212 .sections {
213 padding-left: 1rem;
214 .section {
215 a {
216 text-decoration: none;
217 color: var(--foreground);
218 }
219 .service-count {
220 color: var(--accent-3);
221 }
222 }
223 }
224 }
225 }
216226</style>
web/src/pages/index.astro +49 −43
@@ -1,5 +1,4 @@
11---
2
32import Layout from '@layouts/Layout.astro';
43import Hero from '@components/Hero.astro';
54import Search from '@components/things/Search.svelte';
@@ -10,14 +9,14 @@ import { fetchData } from '@utils/fetch-data';
109import Button from '@components/form/Button.astro';
1110import type { Category } from 'src/types/Service';
1211
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.';
12const categories = (await fetchData())?.categories || ([] as Category[]);
2013
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.';
2120---
2221
2322<Layout title="Home | Awesome Privacy" hideNav={true} description={description}>
@@ -29,11 +28,13 @@ const description = 'Privacy is a fundamental human right; '
2928 <Search client:visible data={categories} />
3029 <h2 class="browse-title"><a href="/browse">Browse</a></h2>
3130 <ul class="categories">
32 {categories.map((category) => (
33 <li class="category">
34 <SectionList title={category.name} sections={category.sections} />
35 </li>
36 ))}
31 {
32 categories.map((category) => (
33 <li class="category">
34 <SectionList title={category.name} sections={category.sections} />
35 </li>
36 ))
37 }
3738 </ul>
3839 <div class="view-all">
3940 <span>Or, just</span>
@@ -48,28 +49,33 @@ const description = 'Privacy is a fundamental human right; '
4849 </h2>
4950 <div class="about-summary">
5051 <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.
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.
5355 </p>
5456 <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 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.
5760 </p>
5861 <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 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 >.
6267 </p>
6368 <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.
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.
6673 </p>
6774 </div>
6875 <div class="view-all">
6976 <span>Want to learn more?</span>
7077 <Button url="/about" text="Keep Reading..." />
7178 </div>
72
7379 </main>
7480</Layout>
7581
@@ -81,8 +87,8 @@ const description = 'Privacy is a fundamental human right; '
8187 max-width: calc(100% - 5rem);
8288 font-size: 20px;
8389 line-height: 1.6;
84 @media(max-width: 768px) {
85 padding: 0;
90 @media (max-width: 768px) {
91 padding: 0;
8692 }
8793 .view-all {
8894 text-align: center;
@@ -97,41 +103,43 @@ const description = 'Privacy is a fundamental human right; '
97103 h2 {
98104 font-size: 3rem;
99105 color: var(--accent-3);
100 font-family: "Lekton", sans-serif;
106 font-family: 'Lekton', sans-serif;
101107 text-align: center;
102108 margin: 3rem 0 1rem 0;
103109 a {
104110 text-decoration: none;
105111 color: var(--accent-3);
106 font-family: "Lekton", sans-serif;
112 font-family: 'Lekton', sans-serif;
107113 position: relative;
108 &:after {
114 &:after {
109115 background: none repeat scroll 0 0 transparent;
110116 bottom: 0;
111 content: "";
117 content: '';
112118 display: block;
113119 height: 3px;
114120 left: 50%;
115121 position: absolute;
116122 background: var(--accent);
117 transition: width 0.3s ease 0s, left 0.3s ease 0s;
123 transition:
124 width 0.3s ease 0s,
125 left 0.3s ease 0s;
118126 width: 0;
119127 }
120 &:hover:after {
121 width: 100%;
122 left: 0;
128 &:hover:after {
129 width: 100%;
130 left: 0;
123131 }
124132 }
125133 }
126134
127135 .about-summary {
128136 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;
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;
135143 }
136144
137145 .categories {
@@ -148,7 +156,7 @@ const description = 'Privacy is a fundamental human right; '
148156 display: inline-flex;
149157 flex-direction: column;
150158 margin: 1rem;
151 @media(max-width: 768px) {
159 @media (max-width: 768px) {
152160 margin: 1rem 0;
153161 width: 90%;
154162 }
@@ -157,7 +165,7 @@ const description = 'Privacy is a fundamental human right; '
157165 color: var(--foreground);
158166 }
159167 h3 {
160 font-family: "Lekton", sans-serif;
168 font-family: 'Lekton', sans-serif;
161169 font-weight: bold;
162170 margin: 0;
163171 font-size: 1.8rem;
@@ -176,6 +184,4 @@ const description = 'Privacy is a fundamental human right; '
176184 }
177185 }
178186 }
179
180
181187</style>
web/src/pages/inventory/[...inventoryId].astro +78 −72
@@ -1,5 +1,4 @@
11---
2
32import Layout from '@layouts/Layout.astro';
43import SavedServices from '@components/things/SavedServices.svelte';
54import GetSharableLink from '@components/things/GetSharableLink.svelte';
@@ -9,7 +8,7 @@ import Button from '@components/form/Button.astro';
98import EditableTitle from '@components/form/EditableTitle.svelte';
109import type { Category } from '../../types/Service';
1110
12const categories = (await fetchData())?.categories || [] as Category[];
11const categories = (await fetchData())?.categories || ([] as Category[]);
1312
1413export const prerender = false;
1514
@@ -17,85 +16,92 @@ const inventoryId = Astro.params.inventoryId || 'Inventory';
1716let cheekyLilError = '';
1817
1918function makeTitle(input: string): string {
20 return (input.includes('_') ? input : `mystry_${input}`)
21 .split('_')[1]
22 .replace(/-/g, ' ')
23 .replace(/\b\w/g, (match) => match.toUpperCase());
19 return (input.includes('_') ? input : `mystry_${input}`)
20 .split('_')[1]
21 .replace(/-/g, ' ')
22 .replace(/\b\w/g, (match) => match.toUpperCase());
2423}
2524
26const serviceList = await fetch(`https://awesome-privacy-share-api.as93.net/${inventoryId}`).then((res) => res.json()) || [];
25const serviceList =
26 (await fetch(
27 `https://awesome-privacy-share-api.as93.net/${inventoryId}`,
28 ).then((res) => res.json())) || [];
2729
2830if (serviceList.error) {
29 cheekyLilError = serviceList.error;
31 cheekyLilError = serviceList.error;
3032}
31
3233---
3334
3435<Layout title="Saved Services">
35 <main>
36 <h2>{makeTitle(inventoryId)}</h2>
37 {cheekyLilError && (
38 <div class="error">
39 <p class="oh-deary-me">An error occoured</p>
40 <p class="what-the-fuck-happened">{cheekyLilError}</p>
41 <p class="what-next">
42 We're sorry about that.<br />
43 Try going <a href="/">back home</a>,
44 or <a href="https://github.com/Lissy93/awesome-privacy/issues/new/choose">raising a ticket</a> on
45 GitHub.
46 </p>
47 </div>
48 )}
49 <SavedServices allData={categories} serviceList={serviceList} client:load />
50 <div class="buttons">
51 <p>Not found what you're looking for?</p>
52 <Button url="/all">Browse Services</Button>
53 </div>
54 </main>
36 <main>
37 <h2>{makeTitle(inventoryId)}</h2>
38 {
39 cheekyLilError && (
40 <div class="error">
41 <p class="oh-deary-me">An error occoured</p>
42 <p class="what-the-fuck-happened">{cheekyLilError}</p>
43 <p class="what-next">
44 We're sorry about that.
45 <br />
46 Try going <a href="/">back home</a>, or{' '}
47 <a href="https://github.com/Lissy93/awesome-privacy/issues/new/choose">
48 raising a ticket
49 </a>{' '}
50 on GitHub.
51 </p>
52 </div>
53 )
54 }
55 <SavedServices allData={categories} serviceList={serviceList} client:load />
56 <div class="buttons">
57 <p>Not found what you're looking for?</p>
58 <Button url="/all">Browse Services</Button>
59 </div>
60 </main>
5561</Layout>
5662
5763<style lang="scss">
58 main {
59 margin: 0 auto 2rem auto;
60 padding: 1rem;
61 width: 1200px;
62 max-width: calc(100% - 5rem);
63 display: flex;
64 justify-content: space-between;
65 flex-direction: column;
66 min-height: calc(100vh - 12rem);
67 font-size: 1.25rem;
68 h2 {
69 font-family: "Lekton", sans-serif;
70 font-weight: bold;
71 font-size: 3rem;
72 margin: 0;
73 color: var(--accent-3);
74 }
75 .buttons {
76 margin: 1rem auto;
77 display: flex;
78 flex-direction: column;
79 }
80 .error {
81 text-align: center;
82 font-size: 1.4rem;
83 .oh-deary-me {
84 font-size: 1.8rem;
85 margin: 0.2rem auto;
86 }
87 .what-the-fuck-happened {
88 color: var(--danger);
89 margin: 0.2rem auto;
90 }
91 .what-next {
92 font-size: 1rem;
93 margin-top: 3rem;
94 opacity: 0.6;
95 a {
96 color: var(--foreground);
97 }
98 }
99 }
100 }
64 main {
65 margin: 0 auto 2rem auto;
66 padding: 1rem;
67 width: 1200px;
68 max-width: calc(100% - 5rem);
69 display: flex;
70 justify-content: space-between;
71 flex-direction: column;
72 min-height: calc(100vh - 12rem);
73 font-size: 1.25rem;
74 h2 {
75 font-family: 'Lekton', sans-serif;
76 font-weight: bold;
77 font-size: 3rem;
78 margin: 0;
79 color: var(--accent-3);
80 }
81 .buttons {
82 margin: 1rem auto;
83 display: flex;
84 flex-direction: column;
85 }
86 .error {
87 text-align: center;
88 font-size: 1.4rem;
89 .oh-deary-me {
90 font-size: 1.8rem;
91 margin: 0.2rem auto;
92 }
93 .what-the-fuck-happened {
94 color: var(--danger);
95 margin: 0.2rem auto;
96 }
97 .what-next {
98 font-size: 1rem;
99 margin-top: 3rem;
100 opacity: 0.6;
101 a {
102 color: var(--foreground);
103 }
104 }
105 }
106 }
101107</style>
web/src/pages/inventory/index.astro +42 −44
@@ -1,5 +1,4 @@
11---
2
32import Layout from '@layouts/Layout.astro';
43import SavedServices from '@components/things/SavedServices.svelte';
54import GetSharableLink from '@components/things/GetSharableLink.svelte';
@@ -9,53 +8,52 @@ import Button from '@components/form/Button.astro';
98import EditableTitle from '@components/form/EditableTitle.svelte';
109import type { Category } from '../../types/Service';
1110
12const categories = (await fetchData())?.categories || [] as Category[];
13
11const categories = (await fetchData())?.categories || ([] as Category[]);
1412---
1513
1614<Layout title="Saved Services">
17 <main>
18 <div class="top-row">
19 <!-- <h2>Inventory</h2> -->
20 <EditableTitle client:load />
21 <GetSharableLink client:load />
22 </div>
23 <SavedServices allData={categories} client:load />
24 <div class="buttons">
25 <p>Not found what you're looking for?</p>
26 <Button url="/all">Browse Services</Button>
27 </div>
28 </main>
15 <main>
16 <div class="top-row">
17 <!-- <h2>Inventory</h2> -->
18 <EditableTitle client:load />
19 <GetSharableLink client:load />
20 </div>
21 <SavedServices allData={categories} client:load />
22 <div class="buttons">
23 <p>Not found what you're looking for?</p>
24 <Button url="/all">Browse Services</Button>
25 </div>
26 </main>
2927</Layout>
3028
3129<style lang="scss">
32 main {
33 margin: 0 auto 2rem auto;
34 padding: 1rem;
35 width: 1200px;
36 max-width: calc(100% - 5rem);
37 display: flex;
38 justify-content: space-between;
39 flex-direction: column;
40 min-height: calc(100vh - 12rem);
41 font-size: 1.25rem;
42 .top-row {
43 display: flex;
44 justify-content: space-between;
45 align-items: center;
46 margin-bottom: 1rem;
47 }
48 h2 {
49 font-family: "Lekton", sans-serif;
50 font-weight: bold;
51 font-size: 3rem;
52 margin: 0;
53 color: var(--accent-3);
54 }
55 .buttons {
56 margin: 1rem auto;
57 display: flex;
58 flex-direction: column;
59 }
60 }
30 main {
31 margin: 0 auto 2rem auto;
32 padding: 1rem;
33 width: 1200px;
34 max-width: calc(100% - 5rem);
35 display: flex;
36 justify-content: space-between;
37 flex-direction: column;
38 min-height: calc(100vh - 12rem);
39 font-size: 1.25rem;
40 .top-row {
41 display: flex;
42 justify-content: space-between;
43 align-items: center;
44 margin-bottom: 1rem;
45 }
46 h2 {
47 font-family: 'Lekton', sans-serif;
48 font-weight: bold;
49 font-size: 3rem;
50 margin: 0;
51 color: var(--accent-3);
52 }
53 .buttons {
54 margin: 1rem auto;
55 display: flex;
56 flex-direction: column;
57 }
58 }
6159</style>
web/src/pages/search/[...searchTerm].astro +158 −151
@@ -1,5 +1,5 @@
11---
2 import Fuse from 'fuse.js';
2import Fuse from 'fuse.js';
33
44import Layout from '@layouts/Layout.astro';
55import { fetchData, slugify } from '@utils/fetch-data';
@@ -22,171 +22,178 @@ fuse = new Fuse(items, searchOptions);
2222
2323const searchTerm = Astro.params.searchTerm;
2424
25const searchResults = fuse.search(searchTerm || '').map(result => result.item);
25const searchResults = fuse
26 .search(searchTerm || '')
27 .map((result) => result.item);
2628
27const services = searchResults.filter(result => result.type === 'Service');
29const services = searchResults.filter((result) => result.type === 'Service');
2830
2931const putResultsIntoGroups = () => {
30 const grouped = services.reduce((acc, item) => {
31 const { category: categoryName, sectionName, ...service } = item;
32 const grouped = services.reduce((acc, item) => {
33 const { category: categoryName, sectionName, ...service } = item;
3234
33 if (!acc[categoryName]) {
34 acc[categoryName] = { categoryName, sections: {} };
35 }
35 if (!acc[categoryName]) {
36 acc[categoryName] = { categoryName, sections: {} };
37 }
3638
37 if (!acc[categoryName].sections[sectionName]) {
38 acc[categoryName].sections[sectionName] = { sectionName, items: [] };
39 }
39 if (!acc[categoryName].sections[sectionName]) {
40 acc[categoryName].sections[sectionName] = { sectionName, items: [] };
41 }
4042
41 acc[categoryName].sections[sectionName].items.push(service);
43 acc[categoryName].sections[sectionName].items.push(service);
4244
43 return acc;
44 }, {});
45 return acc;
46 }, {});
4547
46 // Convert the grouped object into the desired array structure.
47 // And fuck it, let's use `any`
48 return Object.values(grouped).map((category: any) => ({
49 categoryName: category.categoryName,
50 sections: Object.values(category.sections)
51 }));
48 // Convert the grouped object into the desired array structure.
49 // And fuck it, let's use `any`
50 return Object.values(grouped).map((category: any) => ({
51 categoryName: category.categoryName,
52 sections: Object.values(category.sections),
53 }));
5254};
5355
5456const beer = putResultsIntoGroups();
55
5657---
5758
5859<Layout title="Search | Awesome Privacy">
59 <section>
60 <h1>Search</h1>
61 <Search client:visible data={categories} previousSearch={searchTerm} />
62 </section>
63 <SmartSuggestions client:visible searchTerm={searchTerm || ''} categories={categories} />
64 <section class="result-count">
65 <h3>Deep Search</h3>
66 <p>Showing {services.length} results for "{searchTerm}" sorted by relevence</p>
67 </section>
68 <div class="results">
69 {
70 beer.map((category: any) => (
71 <div class="category">
72 <a class="category-title" href={`/${slugify(category.categoryName)}`}>
73 <h3>{category.categoryName}</h3>
74 </a>
75 <span class="section-icon"><FontAwesome iconName={slugify(category.categoryName)} /></span>
76 <ul class="section-list">
77 {category.sections.map((section: any) => (
78 <li class="section-item">
79 <h4>{section.sectionName}</h4>
80 <ul class="service-list">
81 {section.items.map((item: Service) => (
82 <li>
83 <a href={item.url}>{item.name}</a>
84 </li>
85 ))}
86 </ul>
87 </li>
88 ))}
89 </ul>
90 </div>
91 ))
92 }
93</div>
60 <section>
61 <h1>Search</h1>
62 <Search client:visible data={categories} previousSearch={searchTerm} />
63 </section>
64 <SmartSuggestions
65 client:visible
66 searchTerm={searchTerm || ''}
67 categories={categories}
68 />
69 <section class="result-count">
70 <h3>Deep Search</h3>
71 <p>
72 Showing {services.length} results for "{searchTerm}" sorted by relevence
73 </p>
74 </section>
75 <div class="results">
76 {
77 beer.map((category: any) => (
78 <div class="category">
79 <a class="category-title" href={`/${slugify(category.categoryName)}`}>
80 <h3>{category.categoryName}</h3>
81 </a>
82 <span class="section-icon">
83 <FontAwesome iconName={slugify(category.categoryName)} />
84 </span>
85 <ul class="section-list">
86 {category.sections.map((section: any) => (
87 <li class="section-item">
88 <h4>{section.sectionName}</h4>
89 <ul class="service-list">
90 {section.items.map((item: Service) => (
91 <li>
92 <a href={item.url}>{item.name}</a>
93 </li>
94 ))}
95 </ul>
96 </li>
97 ))}
98 </ul>
99 </div>
100 ))
101 }
102 </div>
94103</Layout>
95104
96
97105<style lang="scss">
98
99section {
100 display: flex;
101 flex-direction: column;
102 padding: 1rem;
103 margin: 2rem auto;
104 padding: 1rem;
105 width: calc(100% - 2rem);
106 max-width: 1100px;
107
108 h1 {
109 font-size: 3rem;
110 color: var(--accent-3);
111 font-family: "Lekton", sans-serif;
112 text-align: center;
113 margin: 1rem 0;
114 }
115}
116
117.result-count {
118 padding: 0;
119 width: 80vw;
120 max-width: 900px;
121 margin: 1rem auto 0 auto;
122 h3 {
123 margin: 0;
124 color: var(--accent-3);
125 font-size: 1.6rem;
126 }
127 p {
128 margin: 0;
129 opacity: 0.6;
130 }
131}
132
133.results {
134 margin: 0 auto 2rem auto;
135 padding: 1rem;
136 width: calc(100% - 2rem);
137 max-width: 1100px;
138 columns: 6 300px;
139 column-gap: 1rem;
140 .category {
141 padding: 1rem;
142 box-shadow: 4px 4px 0 var(--box-outline);
143 background: var(--accent-fg);
144 border: 2px solid var(--box-outline);
145 border-radius: var(--curve-sm);
146 display: inline-flex;
147 flex-direction: column;
148 width: 85%;
149 margin: 1rem;
150 position: relative;
151 .category-title {
152 text-decoration: none;
153 color: var(--foreground);
154 z-index: 2;
155 position: relative;
156 h3 {
157 font-family: "Lekton", sans-serif;
158 font-weight: bold;
159 margin: 0;
160 font-size: 1.8rem;
161 }
162 }
163 .section-icon {
164 position: absolute;
165 right: 0.5rem;
166 top: 0.5rem;
167 width: fit-content;
168 :global(svg) {
169 width: 2rem;
170 height: 2rem;
171 opacity: 0.5;
172 text-shadow: 3px 3px 0 black;
173 color: var(--accent-3);
174 transition: all 0.2s ease-in-out;
175 }
176 }
177 .section-list {
178 list-style: none;
179 padding: 0;
180 margin: 0;
181 h4 {
182 margin: 1rem 0 0 0;
183 }
184 .service-list {
185 list-style: none;
186 padding: 0;
187 margin: 0;
188 }
189 }
190 }
191}
106 section {
107 display: flex;
108 flex-direction: column;
109 padding: 1rem;
110 margin: 2rem auto;
111 padding: 1rem;
112 width: calc(100% - 2rem);
113 max-width: 1100px;
114
115 h1 {
116 font-size: 3rem;
117 color: var(--accent-3);
118 font-family: 'Lekton', sans-serif;
119 text-align: center;
120 margin: 1rem 0;
121 }
122 }
123
124 .result-count {
125 padding: 0;
126 width: 80vw;
127 max-width: 900px;
128 margin: 1rem auto 0 auto;
129 h3 {
130 margin: 0;
131 color: var(--accent-3);
132 font-size: 1.6rem;
133 }
134 p {
135 margin: 0;
136 opacity: 0.6;
137 }
138 }
139
140 .results {
141 margin: 0 auto 2rem auto;
142 padding: 1rem;
143 width: calc(100% - 2rem);
144 max-width: 1100px;
145 columns: 6 300px;
146 column-gap: 1rem;
147 .category {
148 padding: 1rem;
149 box-shadow: 4px 4px 0 var(--box-outline);
150 background: var(--accent-fg);
151 border: 2px solid var(--box-outline);
152 border-radius: var(--curve-sm);
153 display: inline-flex;
154 flex-direction: column;
155 width: 85%;
156 margin: 1rem;
157 position: relative;
158 .category-title {
159 text-decoration: none;
160 color: var(--foreground);
161 z-index: 2;
162 position: relative;
163 h3 {
164 font-family: 'Lekton', sans-serif;
165 font-weight: bold;
166 margin: 0;
167 font-size: 1.8rem;
168 }
169 }
170 .section-icon {
171 position: absolute;
172 right: 0.5rem;
173 top: 0.5rem;
174 width: fit-content;
175 :global(svg) {
176 width: 2rem;
177 height: 2rem;
178 opacity: 0.5;
179 text-shadow: 3px 3px 0 black;
180 color: var(--accent-3);
181 transition: all 0.2s ease-in-out;
182 }
183 }
184 .section-list {
185 list-style: none;
186 padding: 0;
187 margin: 0;
188 h4 {
189 margin: 1rem 0 0 0;
190 }
191 .service-list {
192 list-style: none;
193 padding: 0;
194 margin: 0;
195 }
196 }
197 }
198 }
192199</style>
web/src/pages/search/index.astro +41 −43
@@ -1,57 +1,55 @@
11---
2
32import Layout from '@layouts/Layout.astro';
43import { fetchData } from '@utils/fetch-data';
54
65import Search from '@components/things/Search.svelte';
76
87const categories = (await fetchData())?.categories;
9
108---
119
1210<Layout title="Search | Awesome Privacy">
13 <section>
14 <h1>Search</h1>
15 <Search client:visible data={categories} />
16 <p class="sitemap-link">
17 Browse <a href="/all">all listings</a>, or see all pages in the <a href="/sitemap">Sitemap</a>
18 </p>
19 </section>
11 <section>
12 <h1>Search</h1>
13 <Search client:visible data={categories} />
14 <p class="sitemap-link">
15 Browse <a href="/all">all listings</a>, or see all pages in the <a
16 href="/sitemap">Sitemap</a
17 >
18 </p>
19 </section>
2020</Layout>
2121
22
2322<style lang="scss">
24
25section {
26 display: flex;
27 flex-direction: column;
28 padding: 1rem;
29 box-shadow: 4px 4px 0 var(--box-outline);
30 background: var(--accent-fg);
31 border: 2px solid var(--box-outline);
32 border-radius: var(--curve-sm);
33 margin: 2rem auto;
34 padding: 1rem;
35 width: calc(100% - 5rem);
36 max-width: 1100px;
37 min-height: 80vh;
38
39 h1 {
40 font-size: 3rem;
41 color: var(--accent-3);
42 font-family: "Lekton", sans-serif;
43 text-align: center;
44 margin: 1rem 0;
45 }
46 .sitemap-link {
47 opacity: 0.6;
48 text-align: center;
49 font-size: 0.8rem;
50 margin: 2rem auto;
51 transition: all 0.2s ease-in-out;
52 &:hover {
53 opacity: 0.8;
54 }
55 }
56}
23 section {
24 display: flex;
25 flex-direction: column;
26 padding: 1rem;
27 box-shadow: 4px 4px 0 var(--box-outline);
28 background: var(--accent-fg);
29 border: 2px solid var(--box-outline);
30 border-radius: var(--curve-sm);
31 margin: 2rem auto;
32 padding: 1rem;
33 width: calc(100% - 5rem);
34 max-width: 1100px;
35 min-height: 80vh;
36
37 h1 {
38 font-size: 3rem;
39 color: var(--accent-3);
40 font-family: 'Lekton', sans-serif;
41 text-align: center;
42 margin: 1rem 0;
43 }
44 .sitemap-link {
45 opacity: 0.6;
46 text-align: center;
47 font-size: 0.8rem;
48 margin: 2rem auto;
49 transition: all 0.2s ease-in-out;
50 &:hover {
51 opacity: 0.8;
52 }
53 }
54 }
5755</style>
web/src/pages/sitemap.astro +226 −216
@@ -1,234 +1,244 @@
11---
2
3
42import Layout from '@layouts/Layout.astro';
53import type { AwesomePrivacy } from '../types/Service';
64import { fetchData, slugify } from '@utils/fetch-data';
75
8const categories = (await fetchData() as AwesomePrivacy)?.categories || [];
9
6const categories = ((await fetchData()) as AwesomePrivacy)?.categories || [];
107---
118
129<Layout title="All Links | Awesome Privacy">
13 <main>
14 <h2>Sitemap</h2>
15 <p>
16 Below is a full listing of all pages on this site.<br>
17 <small>As reflected in our <a href="/sitemap-index.xml">sitemap.xml</a></small>
18 </p>
19 <span class="search-controlls">
20 <input id="searchInput" type="search" placeholder="Start typing to filter..." />
21 <p id="press-enter-msg" class="press-enter">Press enter for deep search</p>
22 </span>
23 <ul>
24 <li>
25 <a href="/">Home</a>
26 </li>
27 <li>
28 <a href="/search">Search</a>
29 </li>
30 <li>
31 <a href="/all">View All</a>
32 </li>
33 <li>
34 <a href="/inventory">My Inventory</a>
35 </li>
36 <li>
37 <a href="/submit">Submit Listing</a>
38 </li>
39 <li>
40 <a href="/api">API</a>
41 </li>
42 <li>
43 <a href="/browse">Categories</a>
44 <ul>
45 {categories.map((category) => (
46 <li>
47 <a href={`/${slugify(category.name)}`}>{category.name}</a>
48 <ul>
49 {category.sections.map((section) => (
50 <li>
51 <a href={`/${slugify(category.name)}/${slugify(section.name)}`}>{section.name}</a>
52 <ul>
53 {(section.services || []).map((service) => (
54 <li title={service.description || ''}>
55 <a href={`/${slugify(category.name)}/${slugify(section.name)}/${slugify(service.name)}`}>
56 {service.name}
57 </a>
58 </li>
59 ))}
60 </ul>
61 </li>
62 ))}
63 </ul>
64 </li>
65 ))}
66 </ul>
67 </li>
68 <li>
69 <a href="/about">About</a>
70 <ul>
71 <li><a href="/about#objective">Objective</a></li>
72 <li><a href="/about#criteria">Listing Criteria</a></li>
73 <li><a href="/about#contributing">Contributing</a></li>
74 <li>
75 <a href="/about#acknowledgements">Acknowledgements</a>
76 <ul>
77 <li><a href="/about#contributors">Contributors</a></li>
78 <li><a href="/about#sponsors">Sponsors</a></li>
79 </ul>
80 </li>
81 <li><a href="/about#author">Author</a></li>
82 <li><a href="/about#license">License</a></li>
83 </ul>
84 </li>
85 <li>
86 <a href="/sitemap">Sitemap</a>
87 </li>
88 </ul>
89 </main>
90
10 <main>
11 <h2>Sitemap</h2>
12 <p>
13 Below is a full listing of all pages on this site.<br />
14 <small
15 >As reflected in our <a href="/sitemap-index.xml">sitemap.xml</a></small
16 >
17 </p>
18 <span class="search-controlls">
19 <input
20 id="searchInput"
21 type="search"
22 placeholder="Start typing to filter..."
23 />
24 <p id="press-enter-msg" class="press-enter">
25 Press enter for deep search
26 </p>
27 </span>
28 <ul>
29 <li>
30 <a href="/">Home</a>
31 </li>
32 <li>
33 <a href="/search">Search</a>
34 </li>
35 <li>
36 <a href="/all">View All</a>
37 </li>
38 <li>
39 <a href="/inventory">My Inventory</a>
40 </li>
41 <li>
42 <a href="/submit">Submit Listing</a>
43 </li>
44 <li>
45 <a href="/api">API</a>
46 </li>
47 <li>
48 <a href="/browse">Categories</a>
49 <ul>
50 {
51 categories.map((category) => (
52 <li>
53 <a href={`/${slugify(category.name)}`}>{category.name}</a>
54 <ul>
55 {category.sections.map((section) => (
56 <li>
57 <a
58 href={`/${slugify(category.name)}/${slugify(section.name)}`}
59 >
60 {section.name}
61 </a>
62 <ul>
63 {(section.services || []).map((service) => (
64 <li title={service.description || ''}>
65 <a
66 href={`/${slugify(category.name)}/${slugify(section.name)}/${slugify(service.name)}`}
67 >
68 {service.name}
69 </a>
70 </li>
71 ))}
72 </ul>
73 </li>
74 ))}
75 </ul>
76 </li>
77 ))
78 }
79 </ul>
80 </li>
81 <li>
82 <a href="/about">About</a>
83 <ul>
84 <li><a href="/about#objective">Objective</a></li>
85 <li><a href="/about#criteria">Listing Criteria</a></li>
86 <li><a href="/about#contributing">Contributing</a></li>
87 <li>
88 <a href="/about#acknowledgements">Acknowledgements</a>
89 <ul>
90 <li><a href="/about#contributors">Contributors</a></li>
91 <li><a href="/about#sponsors">Sponsors</a></li>
92 </ul>
93 </li>
94 <li><a href="/about#author">Author</a></li>
95 <li><a href="/about#license">License</a></li>
96 </ul>
97 </li>
98 <li>
99 <a href="/sitemap">Sitemap</a>
100 </li>
101 </ul>
102 </main>
91103</Layout>
92104
93105<script>
94 document.addEventListener('DOMContentLoaded', () => {
95 // Select elements for events (search field, each result, and message str)
96 const filterInput = document.querySelector<HTMLInputElement>('input');
97 const pages = document.querySelectorAll<HTMLElement>('li');
98 const pressEnterMsg = document.getElementById('press-enter-msg');
99 if (!pressEnterMsg) throw new Error('pressEnterMsg element not found');
106 document.addEventListener('DOMContentLoaded', () => {
107 // Select elements for events (search field, each result, and message str)
108 const filterInput = document.querySelector<HTMLInputElement>('input');
109 const pages = document.querySelectorAll<HTMLElement>('li');
110 const pressEnterMsg = document.getElementById('press-enter-msg');
111 if (!pressEnterMsg) throw new Error('pressEnterMsg element not found');
100112
101 // Instant search/filter functionality
102 filterInput?.addEventListener('input', (e: Event) => {
103 const filter = (e.target as HTMLInputElement).value.toLowerCase();
104 pressEnterMsg.style.visibility = filter.length > 0 ? 'visible' : 'hidden';
105 Array.from(pages).reduce((count, page) => {
106 const match = page.textContent?.toLowerCase().includes(filter) || false;
107 page.style.display = match ? 'block' : 'none';
108 return count + (match ? 1 : 0);
109 }, 0);
110 });
111 // Handle keypress events, so Esc clears search, and Entr runs deep search
112 document.addEventListener('keydown', (event: KeyboardEvent) => {
113 if (!filterInput) return;
114 switch (event.key) {
115 case 'Enter':
116 event.preventDefault();
117 const searchTerm = encodeURIComponent(filterInput.value);
118 window.location.href = `/search/${searchTerm}`;
119 break;
120 case 'Escape':
121 filterInput.value = '';
122 filterInput.blur();
123 pressEnterMsg.style.visibility = 'hidden';
124 pages.forEach(page => page.style.display = 'block');
125 break;
126 }
127 });
128 });
113 // Instant search/filter functionality
114 filterInput?.addEventListener('input', (e: Event) => {
115 const filter = (e.target as HTMLInputElement).value.toLowerCase();
116 pressEnterMsg.style.visibility = filter.length > 0 ? 'visible' : 'hidden';
117 Array.from(pages).reduce((count, page) => {
118 const match = page.textContent?.toLowerCase().includes(filter) || false;
119 page.style.display = match ? 'block' : 'none';
120 return count + (match ? 1 : 0);
121 }, 0);
122 });
123 // Handle keypress events, so Esc clears search, and Entr runs deep search
124 document.addEventListener('keydown', (event: KeyboardEvent) => {
125 if (!filterInput) return;
126 switch (event.key) {
127 case 'Enter':
128 event.preventDefault();
129 const searchTerm = encodeURIComponent(filterInput.value);
130 window.location.href = `/search/${searchTerm}`;
131 break;
132 case 'Escape':
133 filterInput.value = '';
134 filterInput.blur();
135 pressEnterMsg.style.visibility = 'hidden';
136 pages.forEach((page) => (page.style.display = 'block'));
137 break;
138 }
139 });
140 });
129141</script>
130142
131143<style lang="scss">
144 main {
145 padding: 1rem;
146 width: 1000px;
147 max-width: calc(100% - 5rem);
148 margin: 4rem auto 5rem auto;
149 padding: 0 2rem;
150 border: 2px solid var(--box-outline);
151 box-shadow: 6px 6px 0 var(--box-outline);
152 background: var(--accent-fg);
153 position: relative;
154 p {
155 font-size: 1.3rem;
156 margin: 0;
157 small {
158 font-size: 0.8rem;
159 opacity: 0.5;
160 transition: all 0.2s ease-in-out;
161 &:hover {
162 opacity: 0.8;
163 }
164 }
165 }
166 ul {
167 padding-left: 1.2rem;
168 list-style: none;
169 border-left: 3px solid #5f53f482;
170 border-radius: 4px;
171 li {
172 font-weight: 600;
173 ul li {
174 font-weight: 500;
175 ul li {
176 font-weight: 400;
177 ul li {
178 font-weight: 300;
179 }
180 }
181 }
182 &::before {
183 content: '━ ';
184 color: #5f53f482;
185 margin-left: -1.2rem;
186 }
187 a {
188 transition: all ease-in-out 0.2s;
189 text-decoration: none;
190 &:hover {
191 text-decoration: underline;
192 }
193 }
194 }
195 }
196 }
132197
133main {
134 padding: 1rem;
135 width: 1000px;
136 max-width: calc(100% - 5rem);
137 margin: 4rem auto 5rem auto;
138 padding: 0 2rem;
139 border: 2px solid var(--box-outline);
140 box-shadow: 6px 6px 0 var(--box-outline);
141 background: var(--accent-fg);
142 position: relative;
143 p {
144 font-size: 1.3rem;
145 margin: 0;
146 small {
147 font-size: 0.8rem;
148 opacity: 0.5;
149 transition: all 0.2s ease-in-out;
150 &:hover { opacity: 0.8; }
151 }
152 }
153 ul {
154 padding-left: 1.2rem;
155 list-style: none;
156 border-left: 3px solid #5f53f482;
157 border-radius: 4px;;
158 li {
159 font-weight: 600;
160 ul li {
161 font-weight: 500;
162 ul li {
163 font-weight: 400;
164 ul li {
165 font-weight: 300;
166 }
167 }
168 }
169 &::before {
170 content: "━ ";
171 color: #5f53f482;
172 margin-left: -1.2rem;
173 }
174 a {
175 transition: all ease-in-out 0.2s;
176 text-decoration: none;
177 &:hover {
178 text-decoration: underline;
179 }
180 }
181 }
182 }
183}
184
185h2 {
186 margin: 0;
187 gap: 1rem;
188 font-size: 2rem;
189 margin: -2rem 0 2rem -4rem;
190 box-shadow: 6px 6px 0 var(--box-outline);
191 background: var(--accent);
192 color: var(--accent-fg);
193 width: fit-content;
194 padding: 0.25rem 0.5rem;
195 @media (max-width: 768px) {
196 margin: -2rem auto 1rem auto;
197 }
198}
199
200.search-controlls {
201 float: right;
202 top: 1rem;
203 right: 1rem;
204 position: absolute;
205 @media (max-width: 768px) {
206 position: relative;
207 float: none;
208 top: 0;
209 right: 0;
210 }
211 .press-enter {
212 margin: 0.5rem 0 0 0;
213 opacity: 0.5;
214 visibility: hidden;
215 font-size: 1rem;
216 }
217 input {
218 padding: 0.25rem;
219 border: 2px solid var(--box-outline);
220 border-radius: var(--curve-sm);
221 font-size: 1rem;
222 box-shadow: 3px 3px 0 var(--box-outline);
223 color: var(--accent-3);
224 background: var(--background-form);
225 &:focus {
226 outline: none;
227 box-shadow: 4px 4px 0 var(--box-outline);
228 }
229 }
230}
231
232
198 h2 {
199 margin: 0;
200 gap: 1rem;
201 font-size: 2rem;
202 margin: -2rem 0 2rem -4rem;
203 box-shadow: 6px 6px 0 var(--box-outline);
204 background: var(--accent);
205 color: var(--accent-fg);
206 width: fit-content;
207 padding: 0.25rem 0.5rem;
208 @media (max-width: 768px) {
209 margin: -2rem auto 1rem auto;
210 }
211 }
233212
213 .search-controlls {
214 float: right;
215 top: 1rem;
216 right: 1rem;
217 position: absolute;
218 @media (max-width: 768px) {
219 position: relative;
220 float: none;
221 top: 0;
222 right: 0;
223 }
224 .press-enter {
225 margin: 0.5rem 0 0 0;
226 opacity: 0.5;
227 visibility: hidden;
228 font-size: 1rem;
229 }
230 input {
231 padding: 0.25rem;
232 border: 2px solid var(--box-outline);
233 border-radius: var(--curve-sm);
234 font-size: 1rem;
235 box-shadow: 3px 3px 0 var(--box-outline);
236 color: var(--accent-3);
237 background: var(--background-form);
238 &:focus {
239 outline: none;
240 box-shadow: 4px 4px 0 var(--box-outline);
241 }
242 }
243 }
234244</style>
web/src/pages/submit.astro +170 −125
@@ -2,142 +2,187 @@
22import Layout from '@layouts/Layout.astro';
33import AddNewService from '@components/things/AddNewService.svelte';
44
5import { fetchGitHubStats } from '@utils/fetch-repo-info'
5import { fetchGitHubStats } from '@utils/fetch-repo-info';
66import { formatDate } from '@utils/dates-n-stuff';
77
8const commits = (await fetchGitHubStats('lissy93/awesome-privacy') || {}).commits;
9
8const commits = ((await fetchGitHubStats('lissy93/awesome-privacy')) || {})
9 .commits;
1010---
1111
1212<Layout title="Awesome Privacy">
13 <section>
14 <h2>About our Data</h2>
15 <p class="about-data">
16 All data on Awesome Privacy is community maintained via Git,
17 this keeps everything transparent, and means anyone can submit edits.
18 You can learn more about how our data is managed on our <a href="/about#our-data">about page</a>.
19 <br /><br />
20 You can make ammendments/additions/removals simply by editing the
21 <a href="github.com/lissy93/awesome-privacy/blob/main/awesome-privacy.yml">awesome-privacy.yml</a> file.
22 <br />
23 Before you proceed, please first read our <a href="https://github.com/Lissy93/awesome-privacy/blob/main/.github/CONTRIBUTING.md">Contributing Docs</a>
24 <br /><br />
25 Awesome Privacy is a community-maintained resource, it's thanks to
26 contributors like you, that it's able to grow and stay up to date 💜
27 </p>
28 </section>
29 <section>
30 <h2>Submit an Addition</h2>
31 <AddNewService client:load />
32 </section>
13 <section>
14 <h2>About our Data</h2>
15 <p class="about-data">
16 All data on Awesome Privacy is community maintained via Git, this keeps
17 everything transparent, and means anyone can submit edits. You can learn
18 more about how our data is managed on our <a href="/about#our-data"
19 >about page</a
20 >.
21 <br /><br />
22 You can make ammendments/additions/removals simply by editing the
23 <a href="github.com/lissy93/awesome-privacy/blob/main/awesome-privacy.yml"
24 >awesome-privacy.yml</a
25 > file.
26 <br />
27 Before you proceed, please first read our <a
28 href="https://github.com/Lissy93/awesome-privacy/blob/main/.github/CONTRIBUTING.md"
29 >Contributing Docs</a
30 >
31 <br /><br />
32 Awesome Privacy is a community-maintained resource, it's thanks to contributors
33 like you, that it's able to grow and stay up to date 💜
34 </p>
35 </section>
36 <section>
37 <h2>Submit an Addition</h2>
38 <AddNewService client:load />
39 </section>
3340
34 <section>
35 <h2>Submit a Removal Request</h2>
36 <p>
37 You can submit a removal request by browsing to a given service's page,
38 and clicking the "Request Removal" button.
39 This will open a form where you can justify your reasoning, to get it
40 deleted from the <a href="github.com/lissy93/awesome-privacy/blob/main/awesome-privacy.yml">awesome-privacy.yml</a> file.
41 </p>
42 </section>
41 <section>
42 <h2>Submit a Removal Request</h2>
43 <p>
44 You can submit a removal request by browsing to a given service's page,
45 and clicking the "Request Removal" button. This will open a form where you
46 can justify your reasoning, to get it deleted from the <a
47 href="github.com/lissy93/awesome-privacy/blob/main/awesome-privacy.yml"
48 >awesome-privacy.yml</a
49 > file.
50 </p>
51 </section>
4352
44 <section>
45 <h2>Edit a Listing</h2>
46 <p>
47 Edits are welcome! All data is located in
48 <a href="github.com/lissy93/awesome-privacy/blob/main/awesome-privacy.yml">awesome-privacy.yml</a>.
49 <br>
50 To modify an entry, navigate to it's page, scroll to the bottom, and click "Edit".
51 This will take you to directly to the relevant lines in the file, where you can make your changes.
52 </p>
53 </section>
53 <section>
54 <h2>Edit a Listing</h2>
55 <p>
56 Edits are welcome! All data is located in
57 <a href="github.com/lissy93/awesome-privacy/blob/main/awesome-privacy.yml"
58 >awesome-privacy.yml</a
59 >.
60 <br />
61 To modify an entry, navigate to it's page, scroll to the bottom, and click "Edit".
62 This will take you to directly to the relevant lines in the file, where you
63 can make your changes.
64 </p>
65 </section>
5466
55 <section>
56 <h2>Checklist</h2>
57 <ul>
58 <li>You must read the <a href="https://github.com/Lissy93/awesome-privacy/blob/main/.github/CONTRIBUTING.md">Contributing</a> guidelines before proceeding</li>
59 <li>All listing must meed our <a href="/about#creteria">Criteria</a> to be considered privacy-respecting</li>
60 <li>Double check that your changes haven't already been proposed</li>
61 <li>If you're associated with a service included, you must declare your affiliation</li>
62 <li>Before commiting changes, ensure the YAML syntax is valid and it complies with our schema</li>
63 <li>Please complete the issue or PR description template in full, do not remove any fields</li>
64 <li>All submissions must be made via <a href="https://github.com/Lissy93/awesome-privacy">our GitHub</a>, do not email/PM maintainers</li>
65 </ul>
66 </section>
67 <section>
68 <h2>Checklist</h2>
69 <ul>
70 <li>
71 You must read the <a
72 href="https://github.com/Lissy93/awesome-privacy/blob/main/.github/CONTRIBUTING.md"
73 >Contributing</a
74 > guidelines before proceeding
75 </li>
76 <li>
77 All listing must meed our <a href="/about#creteria">Criteria</a> to be considered
78 privacy-respecting
79 </li>
80 <li>Double check that your changes haven't already been proposed</li>
81 <li>
82 If you're associated with a service included, you must declare your
83 affiliation
84 </li>
85 <li>
86 Before commiting changes, ensure the YAML syntax is valid and it
87 complies with our schema
88 </li>
89 <li>
90 Please complete the issue or PR description template in full, do not
91 remove any fields
92 </li>
93 <li>
94 All submissions must be made via <a
95 href="https://github.com/Lissy93/awesome-privacy">our GitHub</a
96 >, do not email/PM maintainers
97 </li>
98 </ul>
99 </section>
67100
68 {commits && commits.length > 0 && (
69 <section>
70 <h2>Recent Changes</h2>
71 <p class="about-data">
72 You can view a full ledger of all updates made
73 at <a href="https://github.com/lissy93/awesome-privacy">github.com/lissy93/awesome-privacy</a>
74 </p>
75 <ul class="commit-log">
76 {commits.map((commit) => (
77 <li title={commit.sha}>
78 {commit.message}<br />
79 <img width="14" src={commit.authorAvatar} />
80 <small>
81 By <a href={`https://github.com/${commit.authorUsername}`}>{commit.authorName || commit.authorUsername}</a>
82 on <a href={`https://github.com/Lissy93/awesome-privacy/commit/${commit.sha}`}>{formatDate(commit.authorDate)}</a>
83 </small>
84 </li>
85 ))}
86 </ul>
87 </section>
88 )}
89
101 {
102 commits && commits.length > 0 && (
103 <section>
104 <h2>Recent Changes</h2>
105 <p class="about-data">
106 You can view a full ledger of all updates made at{' '}
107 <a href="https://github.com/lissy93/awesome-privacy">
108 github.com/lissy93/awesome-privacy
109 </a>
110 </p>
111 <ul class="commit-log">
112 {commits.map((commit) => (
113 <li title={commit.sha}>
114 {commit.message}
115 <br />
116 <img width="14" src={commit.authorAvatar} />
117 <small>
118 By{' '}
119 <a href={`https://github.com/${commit.authorUsername}`}>
120 {commit.authorName || commit.authorUsername}
121 </a>
122 on{' '}
123 <a
124 href={`https://github.com/Lissy93/awesome-privacy/commit/${commit.sha}`}
125 >
126 {formatDate(commit.authorDate)}
127 </a>
128 </small>
129 </li>
130 ))}
131 </ul>
132 </section>
133 )
134 }
90135</Layout>
91136
92137<style lang="scss">
138 section {
139 margin: 2rem auto;
140 padding: 1rem;
141 width: 1000px;
142 max-width: calc(100% - 5rem);
143 display: flex;
144 flex-direction: column;
145 justify-content: space-between;
146 padding: 0 2rem;
147 border: 2px solid var(--box-outline);
148 box-shadow: 6px 6px 0 var(--box-outline);
149 background: var(--accent-fg);
150 border-radius: var(--curve-sm);
151 @media (max-width: 768px) {
152 max-width: 95%;
153 padding: 0.5rem;
154 margin: 0 auto;
155 }
156 p {
157 margin-top: 0;
158 }
159 h2 {
160 margin-bottom: 0.5rem;
161 }
162 ul {
163 margin-top: 0;
164 padding-left: 1rem;
165 list-style: circle;
166 }
167 .about-data {
168 font-size: 1.2rem;
169 }
93170
94section {
95 margin: 2rem auto;
96 padding: 1rem;
97 width: 1000px;
98 max-width: calc(100% - 5rem);
99 display: flex;
100 flex-direction: column;
101 justify-content: space-between;
102 padding: 0 2rem;
103 border: 2px solid var(--box-outline);
104 box-shadow: 6px 6px 0 var(--box-outline);
105 background: var(--accent-fg);
106 border-radius: var(--curve-sm);
107 @media(max-width: 768px) {
108 max-width: 95%;
109 padding: 0.5rem;
110 margin: 0 auto;
111 }
112 p {
113 margin-top: 0;
114 }
115 h2 {
116 margin-bottom: 0.5rem;
117 }
118 ul {
119 margin-top: 0;
120 padding-left: 1rem;
121 list-style: circle;
122 }
123 .about-data {
124 font-size: 1.2rem;
125 }
126
127 .commit-log {
128 column-width: 350px;
129 li {
130 small {
131 font-size: 0.8rem;
132 opacity: 0.7;
133 a { text-transform: capitalize;}
134 }
135 img {
136 border-radius: var(--curve-md);
137 margin-right: 0.5rem;
138 }
139 }
140 }
141}
142
171 .commit-log {
172 column-width: 350px;
173 li {
174 small {
175 font-size: 0.8rem;
176 opacity: 0.7;
177 a {
178 text-transform: capitalize;
179 }
180 }
181 img {
182 border-radius: var(--curve-md);
183 margin-right: 0.5rem;
184 }
185 }
186 }
187 }
143188</style>
web/src/site-config.ts +15 −12
@@ -31,13 +31,15 @@ export const authorProjects = [
3131 },
3232 {
3333 title: 'AdGuardian',
34 description: 'CLI tool for monitoring your networks traffic and AdGuard DNS stats',
34 description:
35 'CLI tool for monitoring your networks traffic and AdGuard DNS stats',
3536 icon: 'https://adguardian.as93.net/favicon.png',
3637 link: 'https://github.com/lissy93/adguardian-term',
3738 },
3839 {
3940 title: 'Bug-Bounties',
40 description: 'Database of websites which accept responsible vulnerability disclosure',
41 description:
42 'Database of websites which accept responsible vulnerability disclosure',
4143 icon: 'https://bug-bounties.as93.net/favicon.png',
4244 link: 'https://github.com/lissy93/bug-bounties',
4345 },
@@ -82,7 +84,6 @@ export const authorSocials = [
8284 },
8385];
8486
85
8687export const aboutOurData = `
8788All data is stored in
8889[\`awesome-privacy.yml\`](https://github.com/lissy93/awesome-privacy/blob/main/awesome-privacy.yml).
@@ -167,18 +168,20 @@ by the community, and the drawbacks / anti-features must be clearly listed along
167168Usually these entries go within the "Notable Mentions" section instead._
168169`;
169170
170export const appDescription = 'Privacy is a fundamental human right; '
171 + 'without it, we\'re just open books in a world where everyone\'s '
172 + 'watching. Let\'s take control back.\n'
173 + 'Migrating open-source applications which do not collect, sell or log your data is a great first step.'
174 + 'Awesome Privacy is a directory of alternative privacy-respecting software and services.';
175
171export const appDescription =
172 'Privacy is a fundamental human right; ' +
173 "without it, we're just open books in a world where everyone's " +
174 "watching. Let's take control back.\n" +
175 'Migrating open-source applications which do not collect, sell or log your data is a great first step.' +
176 'Awesome Privacy is a directory of alternative privacy-respecting software and services.';
176177
177178export default {
178179 title: 'Awesome Privacy | The Ultimate List of Private Apps',
179 description: 'Your guide to finding privacy-respecting alternatives to popular software and services.',
180 keywords: 'security, privacy, awesome privacy, data collection, free software, open source, privacy tools, privacy respecting software',
181 author: 'Alicia Sykes',
180 description:
181 'Your guide to finding privacy-respecting alternatives to popular software and services.',
182 keywords:
183 'security, privacy, awesome privacy, data collection, free software, open source, privacy tools, privacy respecting software',
184 author: 'Alicia Sykes',
182185 authorProjects,
183186 authorSocials,
184187 aboutOurData,
web/src/styles/typography.css +86 −54
@@ -3,91 +3,123 @@
33
44/* Rubik Font Faces */
55@font-face {
6 font-family: 'Rubik';
7 font-style: normal;
8 font-weight: 400;
9 src: local('Rubik'), url('/fonts/Rubik/Rubik-Regular.ttf') format('truetype');
6 font-family: 'Rubik';
7 font-style: normal;
8 font-weight: 400;
9 src:
10 local('Rubik'),
11 url('/fonts/Rubik/Rubik-Regular.ttf') format('truetype');
1012}
1113@font-face {
12 font-family: 'Rubik';
13 font-style: italic;
14 font-weight: 400;
15 src: local('Rubik Italic'), url('/fonts/Rubik/Rubik-Italic.ttf') format('truetype');
14 font-family: 'Rubik';
15 font-style: italic;
16 font-weight: 400;
17 src:
18 local('Rubik Italic'),
19 url('/fonts/Rubik/Rubik-Italic.ttf') format('truetype');
1620}
1721@font-face {
18 font-family: 'Rubik';
19 font-style: normal;
20 font-weight: 500;
21 src: local('Rubik Medium'), url('/fonts/Rubik/Rubik-Medium.ttf') format('truetype');
22 font-family: 'Rubik';
23 font-style: normal;
24 font-weight: 500;
25 src:
26 local('Rubik Medium'),
27 url('/fonts/Rubik/Rubik-Medium.ttf') format('truetype');
2228}
2329@font-face {
24 font-family: 'Rubik';
25 font-style: italic;
26 font-weight: 500;
27 src: local('Rubik Medium Italic'), url('/fonts/Rubik/Rubik-MediumItalic.ttf') format('truetype');
30 font-family: 'Rubik';
31 font-style: italic;
32 font-weight: 500;
33 src:
34 local('Rubik Medium Italic'),
35 url('/fonts/Rubik/Rubik-MediumItalic.ttf') format('truetype');
2836}
2937@font-face {
30 font-family: 'Rubik';
31 font-style: normal;
32 font-weight: 600;
33 src: local('Rubik SemiBold'), url('/fonts/Rubik/Rubik-SemiBold.ttf') format('truetype');
38 font-family: 'Rubik';
39 font-style: normal;
40 font-weight: 600;
41 src:
42 local('Rubik SemiBold'),
43 url('/fonts/Rubik/Rubik-SemiBold.ttf') format('truetype');
3444}
3545@font-face {
36 font-family: 'Rubik';
37 font-style: italic;
38 font-weight: 600;
39 src: local('Rubik SemiBold Italic'), url('/fonts/Rubik/Rubik-SemiBoldItalic.ttf') format('truetype');
46 font-family: 'Rubik';
47 font-style: italic;
48 font-weight: 600;
49 src:
50 local('Rubik SemiBold Italic'),
51 url('/fonts/Rubik/Rubik-SemiBoldItalic.ttf') format('truetype');
4052}
4153
4254/* Libre Franklin Font Faces */
4355@font-face {
44 font-family: 'Libre Franklin';
45 font-style: normal;
46 font-weight: 500;
47 src: local('Libre Franklin Bold'), url('/fonts/Libre_Franklin/LibreFranklin-Bold.ttf') format('truetype');
56 font-family: 'Libre Franklin';
57 font-style: normal;
58 font-weight: 500;
59 src:
60 local('Libre Franklin Bold'),
61 url('/fonts/Libre_Franklin/LibreFranklin-Bold.ttf') format('truetype');
4862}
4963
5064/* Lekton Font Faces */
5165@font-face {
52 font-family: 'Lekton';
53 font-style: normal;
54 font-weight: 700;
55 src: local('Lekton Bold'), url('/fonts/Lekton/Lekton-Bold.ttf') format('truetype');
66 font-family: 'Lekton';
67 font-style: normal;
68 font-weight: 700;
69 src:
70 local('Lekton Bold'),
71 url('/fonts/Lekton/Lekton-Bold.ttf') format('truetype');
5672}
5773
5874html {
59 font-family: system-ui, sans-serif;
75 font-family: system-ui, sans-serif;
6076}
6177
6278code {
63 font-family:
64 Menlo,
65 Monaco,
66 Lucida Console,
67 Liberation Mono,
68 DejaVu Sans Mono,
69 Bitstream Vera Sans Mono,
70 Courier New,
71 monospace;
79 font-family:
80 Menlo,
81 Monaco,
82 Lucida Console,
83 Liberation Mono,
84 DejaVu Sans Mono,
85 Bitstream Vera Sans Mono,
86 Courier New,
87 monospace;
7288}
7389
74.heading, h1 {
75 font-family: "Libre Franklin", sans-serif;
76 font-optical-sizing: auto;
77 font-weight: 800;
78 font-style: normal;
90.heading,
91h1 {
92 font-family: 'Libre Franklin', sans-serif;
93 font-optical-sizing: auto;
94 font-weight: 800;
95 font-style: normal;
7996}
8097
81.subtitle, h2, h3, h4, h5, h6 {
82 font-family: "Lekton", sans-serif;
83 font-weight: 700;
84 font-style: normal;
98.subtitle,
99h2,
100h3,
101h4,
102h5,
103h6 {
104 font-family: 'Lekton', sans-serif;
105 font-weight: 700;
106 font-style: normal;
85107}
86108
87html, body, p, a, ul, ol, li, blockquote, pre, strong, i {
88 font-family: "Rubik", sans-serif;
109html,
110body,
111p,
112a,
113ul,
114ol,
115li,
116blockquote,
117pre,
118strong,
119i {
120 font-family: 'Rubik', sans-serif;
89121}
90122
91123a {
92 color: var(--accent);
124 color: var(--accent);
93125}
web/src/styles/values.css +49 −51
@@ -1,53 +1,51 @@
1html {
2 --accent: #f45397;
3 --accent-fg: #1e1f21;
14
2 html {
3 --accent: #f45397;
4 --accent-fg: #1e1f21;
5
6 --accent-2: #ffdf60;
7 --accent-3: #5f53f4;
8 --accent-4: #28dffd;
9
10 --foreground: #fff;
11
12 --curve-sm: 4px;
13 --curve-md: 6px;
14 --curve-lg: 12px;
15
16 --danger: #ff0048;
17 --success: #00ff64;
18
19 --transparent-accent: #5f53f482;
20
21 --background: #151517;
22 --bg-gradient-comp-1: #151517;
23 --bg-gradient-comp-2: #151517;
24 --background-form: #19191c;
25
26 --box-outline: #000;
27
28 &[data-theme='light'] {
29 --accent: #f45397;
30 --accent-fg: #fff;
31
32 --accent-2: #ffdf60;
33 --accent-3: #5f53f4;
34 --accent-4: #28dffd;
35
36 --foreground: #13151a;
37
38 --curve-sm: 4px;
39 --curve-md: 6px;
40 --curve-lg: 12px;
41
42 --danger: #ff0048;
43 --success: #00ff64;
44
45 --transparent-accent: #5f53f482;
46
47 --background: #feecff;
48 --bg-gradient-comp-1: #feecff;
49 --bg-gradient-comp-2: #e1e4fb;
50 --background-form: #fff;
51 }
52}
5 --accent-2: #ffdf60;
6 --accent-3: #5f53f4;
7 --accent-4: #28dffd;
8
9 --foreground: #fff;
10
11 --curve-sm: 4px;
12 --curve-md: 6px;
13 --curve-lg: 12px;
14
15 --danger: #ff0048;
16 --success: #00ff64;
17
18 --transparent-accent: #5f53f482;
19
20 --background: #151517;
21 --bg-gradient-comp-1: #151517;
22 --bg-gradient-comp-2: #151517;
23 --background-form: #19191c;
24
25 --box-outline: #000;
5326
27 &[data-theme='light'] {
28 --accent: #f45397;
29 --accent-fg: #fff;
30
31 --accent-2: #ffdf60;
32 --accent-3: #5f53f4;
33 --accent-4: #28dffd;
34
35 --foreground: #13151a;
36
37 --curve-sm: 4px;
38 --curve-md: 6px;
39 --curve-lg: 12px;
40
41 --danger: #ff0048;
42 --success: #00ff64;
43
44 --transparent-accent: #5f53f482;
45
46 --background: #feecff;
47 --bg-gradient-comp-1: #feecff;
48 --bg-gradient-comp-2: #e1e4fb;
49 --background-form: #fff;
50 }
51}
web/src/types/Service.ts −3
@@ -1,5 +1,3 @@
1
2
31export interface ShortService {
42 name: string;
53 description: string;
@@ -42,7 +40,6 @@ export interface Category {
4240 sections: Section[];
4341}
4442
45
4643export interface AwesomePrivacy {
4744 categories: Array<{
4845 name: string;
web/src/utils/config.ts +7 −5
@@ -1,11 +1,13 @@
1
21function cleanUrl(inputString: string) {
32 return inputString.replace(/['";]+/g, '').trim();
43}
54
5export const site = cleanUrl(
6 import.meta.env.SITE_URL || 'https://awesome-privacy.xyz',
7);
68
7export const site = cleanUrl(import.meta.env.SITE_URL || 'https://awesome-privacy.xyz');
8
9export const title = 'Awesome Privacy | Compare privacy-respecting alternatives to popular software & services';
9export const title =
10 'Awesome Privacy | Compare privacy-respecting alternatives to popular software & services';
1011
11export const description = 'Your guide to escaping big tech, protecting your privacy, and reclaiming your digital life.';
12export const description =
13 'Your guide to escaping big tech, protecting your privacy, and reclaiming your digital life.';
web/src/utils/data-src-delete-n-edit.ts +102 −59
@@ -1,60 +1,82 @@
11import { slugify } from '@utils/fetch-data';
22
3export const makeRemovalRequest = (categoryName: string, sectionName: string, serviceName: string, yaml?: string) => {
3export const makeRemovalRequest = (
4 categoryName: string,
5 sectionName: string,
6 serviceName: string,
7 yaml?: string,
8) => {
49 const title = `[REMOVAL] ${serviceName}`;
5 const under = `**${serviceName}** (source: [${categoryName} ➜ ${sectionName} ➜ ${serviceName}`
6 + `](https://github.com/Lissy93/awesome-privacy/tree/main#${slugify(sectionName)}))`;
7 const removalData = `&title=${encodeURIComponent(title)}&removal-data=`
8 + `${encodeURIComponent(yaml || '')}&service-title=${encodeURIComponent(under)}`;
9 const issueCreate = 'https://github.com/Lissy93/awesome-privacy/issues/new'
10 const baseOptions = '?assignees=lissy93&labels=Suggested+Removal%2CAwaiting+'
11 + 'Review&projects=&template=removal.yml'
10 const under =
11 `**${serviceName}** (source: [${categoryName} ➜ ${sectionName} ➜ ${serviceName}` +
12 `](https://github.com/Lissy93/awesome-privacy/tree/main#${slugify(sectionName)}))`;
13 const removalData =
14 `&title=${encodeURIComponent(title)}&removal-data=` +
15 `${encodeURIComponent(yaml || '')}&service-title=${encodeURIComponent(under)}`;
16 const issueCreate = 'https://github.com/Lissy93/awesome-privacy/issues/new';
17 const baseOptions =
18 '?assignees=lissy93&labels=Suggested+Removal%2CAwaiting+' +
19 'Review&projects=&template=removal.yml';
1220 return `${issueCreate}${baseOptions}${removalData}`;
1321};
1422
15export const makeEditRequest = (categoryName: string, sectionName: string, serviceName: string, yaml?: string) => {
23export const makeEditRequest = (
24 categoryName: string,
25 sectionName: string,
26 serviceName: string,
27 yaml?: string,
28) => {
1629 const title = `[AMENDMENT] ${serviceName}`;
17 const under = `**${serviceName}** (source: [${categoryName} ➜ ${sectionName} ➜ ${serviceName}`
18 + `](https://github.com/Lissy93/awesome-privacy/tree/main#${slugify(sectionName)}))`;
19 const removalData = `&title=${encodeURIComponent(title)}&amendment-data=`
20 + `${encodeURIComponent(yaml || '')}&service-title=${encodeURIComponent(under)}`;
21 const issueCreate = 'https://github.com/Lissy93/awesome-privacy/issues/new'
22 const baseOptions = '?assignees=lissy93&labels=Suggested+Removal%2CAwaiting+'
23 + 'Review&projects=&template=amendment.yml'
30 const under =
31 `**${serviceName}** (source: [${categoryName} ➜ ${sectionName} ➜ ${serviceName}` +
32 `](https://github.com/Lissy93/awesome-privacy/tree/main#${slugify(sectionName)}))`;
33 const removalData =
34 `&title=${encodeURIComponent(title)}&amendment-data=` +
35 `${encodeURIComponent(yaml || '')}&service-title=${encodeURIComponent(under)}`;
36 const issueCreate = 'https://github.com/Lissy93/awesome-privacy/issues/new';
37 const baseOptions =
38 '?assignees=lissy93&labels=Suggested+Removal%2CAwaiting+' +
39 'Review&projects=&template=amendment.yml';
2440 return `${issueCreate}${baseOptions}${removalData}`;
2541};
2642
27export const makeAdditionRequest = (formData: {
28 listingCategory: string;
29 serviceName: string;
30 serviceUrl: string;
31 serviceIcon: string;
32 serviceDescription: string;
33 serviceGithub: string;
34 serviceTosdrId: string;
35 serviceIosApp: string,
36 serviceAndroidApp: string,
37 serviceDiscordInvite: string,
38 serviceSubreddit: string,
39 serviceOpenSource: boolean;
40 serviceSecurityAudited: boolean;
41 serviceCrypto: boolean;
42 additionalInfo: string;
43}, yamlText?: string) => {
44
45 const userInfo = formData.additionalInfo.split('\n').map(line => `> ${line}`).join('\n');
46 const additionalInfoText: string = `\n${userInfo}`
47 + `\n\n**YAML Content for Addition**\n\n\`\`\`yaml\n${yamlText || '# nothing yet'}\n\`\`\`\n`
48 + `\n\n<sup>This ticket was submitted via `
49 + `<a href="https://awesome-privacy.xyz/submit">awesome-privacy.xyz/submit</a></sup>`;
43export const makeAdditionRequest = (
44 formData: {
45 listingCategory: string;
46 serviceName: string;
47 serviceUrl: string;
48 serviceIcon: string;
49 serviceDescription: string;
50 serviceGithub: string;
51 serviceTosdrId: string;
52 serviceIosApp: string;
53 serviceAndroidApp: string;
54 serviceDiscordInvite: string;
55 serviceSubreddit: string;
56 serviceOpenSource: boolean;
57 serviceSecurityAudited: boolean;
58 serviceCrypto: boolean;
59 additionalInfo: string;
60 },
61 yamlText?: string,
62) => {
63 const userInfo = formData.additionalInfo
64 .split('\n')
65 .map((line) => `> ${line}`)
66 .join('\n');
67 const additionalInfoText: string =
68 `\n${userInfo}` +
69 `\n\n**YAML Content for Addition**\n\n\`\`\`yaml\n${yamlText || '# nothing yet'}\n\`\`\`\n` +
70 `\n\n<sup>This ticket was submitted via ` +
71 `<a href="https://awesome-privacy.xyz/submit">awesome-privacy.xyz/submit</a></sup>`;
5072
5173 const issueTitle = `[ADDITION] ${formData.serviceName} (Complete)`;
5274 const queryParams = new URLSearchParams({
53 'assignees': 'lissy93,liss-bot',
54 'labels': '',
55 'projects': '',
56 'template': 'complete-addition.yml',
57 'title': issueTitle,
75 assignees: 'lissy93,liss-bot',
76 labels: '',
77 projects: '',
78 template: 'complete-addition.yml',
79 title: issueTitle,
5880 'listing-category': formData.listingCategory,
5981 'service-name': formData.serviceName,
6082 'service-url': formData.serviceUrl,
@@ -63,38 +85,59 @@ export const makeAdditionRequest = (formData: {
6385 'service-github': formData.serviceGithub,
6486 'service-tosdr-id': formData.serviceTosdrId,
6587 'service-opensource': formData.serviceOpenSource ? 'true' : 'false',
66 'service-security-audited': formData.serviceSecurityAudited ? 'true' : 'false',
88 'service-security-audited': formData.serviceSecurityAudited
89 ? 'true'
90 : 'false',
6791 'service-crypto': formData.serviceCrypto ? 'true' : 'false',
6892 'additional-info': additionalInfoText,
6993 });
70 const issueCreateUrl = 'https://github.com/Lissy93/awesome-privacy/issues/new';
94 const issueCreateUrl =
95 'https://github.com/Lissy93/awesome-privacy/issues/new';
7196 return `${issueCreateUrl}?${queryParams.toString()}`;
7297};
7398
74
75export const makeSourceYamlLink = async (categoryName: string, sectionName: string, serviceName: string) => {
99export const makeSourceYamlLink = async (
100 categoryName: string,
101 sectionName: string,
102 serviceName: string,
103) => {
76104 const sourceData = await fetchSrcData(categoryName, sectionName, serviceName);
77105 const lineNumbers = sourceData.lineNumbers || null;
78 const numberRange = lineNumbers ? `L${lineNumbers.start}-L${lineNumbers.end}` : '';
79 const yamlLink = 'https://github.com/lissy93/awesome-privacy/blob/main/awesome-privacy.yml';
106 const numberRange = lineNumbers
107 ? `L${lineNumbers.start}-L${lineNumbers.end}`
108 : '';
109 const yamlLink =
110 'https://github.com/lissy93/awesome-privacy/blob/main/awesome-privacy.yml';
80111 return `${yamlLink}${numberRange}`;
81112};
82113
83export const fetchSrcData = async (categoryName: string, sectionName: string, serviceName: string) => {
84 const lineNumberData = await fetch('/api/line-numbers.json')
85 .then((res) => res.json());
114export const fetchSrcData = async (
115 categoryName: string,
116 sectionName: string,
117 serviceName: string,
118) => {
119 const lineNumberData = await fetch('/api/line-numbers.json').then((res) =>
120 res.json(),
121 );
86122
87 if ( lineNumberData
88 && lineNumberData[categoryName]
89 && lineNumberData[categoryName][sectionName]
90 && lineNumberData[categoryName][sectionName][serviceName]
123 if (
124 lineNumberData &&
125 lineNumberData[categoryName] &&
126 lineNumberData[categoryName][sectionName] &&
127 lineNumberData[categoryName][sectionName][serviceName]
91128 ) {
92129 return {
93 lineNumbers: lineNumberData[categoryName][sectionName][serviceName].lineNumbers,
130 lineNumbers:
131 lineNumberData[categoryName][sectionName][serviceName].lineNumbers,
94132 yamlContent: lineNumberData[categoryName][sectionName][serviceName].yaml,
95133 };
96134 } else {
97 console.error('No line number data found for', categoryName, sectionName, serviceName);
135 console.error(
136 'No line number data found for',
137 categoryName,
138 sectionName,
139 serviceName,
140 );
98141 return { lineNumbers: [], yamlContent: '' };
99142 }
100143};
web/src/utils/dates-n-stuff.test.ts added +32
@@ -0,0 +1,32 @@
1import { describe, it, expect } from 'vitest';
2import { formatDate, timestampToDate } from './dates-n-stuff';
3
4describe('formatDate', () => {
5 it('formats an ISO date string to en-GB short format', () => {
6 const result = formatDate('2024-01-15');
7 expect(result).toBe('15 Jan 24');
8 });
9
10 it('formats a different date correctly', () => {
11 const result = formatDate('2023-12-25');
12 expect(result).toBe('25 Dec 23');
13 });
14
15 it('handles full ISO datetime string', () => {
16 const result = formatDate('2024-06-01T12:00:00Z');
17 expect(result).toBe('01 Jun 24');
18 });
19});
20
21describe('timestampToDate', () => {
22 it('converts a Unix timestamp (ms) to en-GB short format', () => {
23 // 2024-01-15T00:00:00Z = 1705276800000
24 const result = timestampToDate(1705276800000);
25 expect(result).toBe('15 Jan 24');
26 });
27
28 it('converts epoch 0 to 01 Jan 70', () => {
29 const result = timestampToDate(0);
30 expect(result).toBe('01 Jan 70');
31 });
32});
web/src/utils/dates-n-stuff.ts +7 −6
@@ -2,21 +2,22 @@ export const formatDate = (date: string): string => {
22 return new Date(date).toLocaleDateString('en-GB', {
33 day: '2-digit',
44 month: 'short',
5 year: '2-digit'
5 year: '2-digit',
66 });
7}
7};
88
99export const timestampToDate = (timestamp: number): string => {
1010 return new Date(timestamp).toLocaleDateString('en-GB', {
1111 day: '2-digit',
1212 month: 'short',
13 year: '2-digit'
13 year: '2-digit',
1414 });
15
16}
15};
1716
1817export const timeAgo = (dateStr: string): string => {
19 const seconds = Math.floor((new Date().getTime() - new Date(dateStr).getTime()) / 1000);
18 const seconds = Math.floor(
19 (new Date().getTime() - new Date(dateStr).getTime()) / 1000,
20 );
2021 const intervals = {
2122 year: 31536000,
2223 month: 2592000,
web/src/utils/do-searchy-searchy.test.ts added +105
@@ -0,0 +1,105 @@
1import { describe, it, expect } from 'vitest';
2import { prepareSearchItems } from './do-searchy-searchy';
3import type { Category } from '../types/Service';
4
5const makeCategory = (overrides: Partial<Category> = {}): Category =>
6 ({
7 name: 'Test Category',
8 sections: [],
9 ...overrides,
10 }) as Category;
11
12describe('prepareSearchItems', () => {
13 it('returns an empty array for no categories', () => {
14 expect(prepareSearchItems([])).toEqual([]);
15 });
16
17 it('creates a category item', () => {
18 const categories = [makeCategory({ name: 'Privacy Tools' })];
19 const items = prepareSearchItems(categories);
20 expect(items).toHaveLength(1);
21 expect(items[0]).toMatchObject({
22 type: 'Category',
23 category: 'Privacy Tools',
24 itemCount: 0,
25 });
26 });
27
28 it('creates section items with category context', () => {
29 const categories = [
30 makeCategory({
31 name: 'Comms',
32 sections: [
33 { name: 'Messaging', intro: 'Secure messaging apps', services: [] },
34 ],
35 }),
36 ] as Category[];
37 const items = prepareSearchItems(categories);
38 const section = items.find((i: { type: string }) => i.type === 'Section');
39 expect(section).toMatchObject({
40 type: 'Section',
41 sectionName: 'Messaging',
42 description: 'Secure messaging apps',
43 category: 'Comms',
44 itemCount: 0,
45 });
46 });
47
48 it('creates service items with section and category context', () => {
49 const categories = [
50 makeCategory({
51 name: 'Comms',
52 sections: [
53 {
54 name: 'Messaging',
55 services: [
56 {
57 name: 'Signal',
58 description: 'Encrypted messenger',
59 url: 'https://signal.org',
60 github: 'signalapp/Signal-Android',
61 icon: 'signal.png',
62 },
63 ],
64 },
65 ],
66 }),
67 ] as Category[];
68 const items = prepareSearchItems(categories);
69 const service = items.find((i: { type: string }) => i.type === 'Service');
70 expect(service).toMatchObject({
71 type: 'Service',
72 name: 'Signal',
73 description: 'Encrypted messenger',
74 url: 'https://signal.org',
75 github: 'signalapp/Signal-Android',
76 category: 'Comms',
77 sectionName: 'Messaging',
78 logo: 'signal.png',
79 });
80 });
81
82 it('counts services across sections for category itemCount', () => {
83 const categories = [
84 makeCategory({
85 name: 'Tools',
86 sections: [
87 {
88 name: 'A',
89 services: [
90 { name: 's1', description: '', url: '' },
91 { name: 's2', description: '', url: '' },
92 ],
93 },
94 {
95 name: 'B',
96 services: [{ name: 's3', description: '', url: '' }],
97 },
98 ],
99 }),
100 ] as Category[];
101 const items = prepareSearchItems(categories);
102 const cat = items.find((i: { type: string }) => i.type === 'Category');
103 expect(cat.itemCount).toBe(3);
104 });
105});
web/src/utils/do-searchy-searchy.ts +7 −7
@@ -3,17 +3,17 @@ import type { Category } from '../types/Service';
33export const prepareSearchItems = (categories: Category[]) => {
44 const items: any = [];
55 // Add each category
6 categories.forEach(category => {
6 categories.forEach((category) => {
77 items.push({
88 type: 'Category',
99 category: category.name,
1010 itemCount: (category.sections || []).reduce((acc, section) => {
11 return acc + (section.services || []).length;
12 }, 0),
11 return acc + (section.services || []).length;
12 }, 0),
1313 });
1414
1515 // Add section with category context
16 category.sections.forEach(section => {
16 category.sections.forEach((section) => {
1717 items.push({
1818 type: 'Section',
1919 sectionName: section.name,
@@ -21,9 +21,9 @@ export const prepareSearchItems = (categories: Category[]) => {
2121 category: category.name,
2222 itemCount: (section.services || []).length,
2323 });
24
24
2525 // Add service with section and category context
26 (section.services || []).forEach(service => {
26 (section.services || []).forEach((service) => {
2727 items.push({
2828 type: 'Service',
2929 name: service.name,
@@ -53,6 +53,6 @@ export const searchOptions = {
5353 { name: 'description', weight: 0.1 },
5454 { name: 'intro', weight: 0.1 },
5555 { name: 'furtherInfo', weight: 0.1 },
56 { name: 'wordOfWarning', weight: 0.1 },
56 { name: 'wordOfWarning', weight: 0.1 },
5757 ],
5858};
web/src/utils/fetch-android-info.ts +4 −5
@@ -1,9 +1,10 @@
1
21const doubleCheckPackageName = (packageStr: string) => {
32 return packageStr.includes('id=') ? packageStr.split('id=')[1] : packageStr;
4}
3};
54
6export const fetchAndroidInfo = async (androidPackage: string): Promise<AndroidInfo | null> => {
5export const fetchAndroidInfo = async (
6 androidPackage: string,
7): Promise<AndroidInfo | null> => {
78 const endpoint = `https://android-app-privacy.as93.net/${doubleCheckPackageName(androidPackage)}`;
89 try {
910 return await fetch(endpoint).then((res) => res.json());
@@ -43,5 +44,3 @@ export interface AndroidInfo {
4344 trackers: Tracker[];
4445 permissions: string[];
4546}
46
47
web/src/utils/fetch-data.test.ts added +37
@@ -0,0 +1,37 @@
1import { describe, it, expect } from 'vitest';
2import { slugify } from './fetch-data';
3
4describe('slugify', () => {
5 it('lowercases and replaces spaces with hyphens', () => {
6 expect(slugify('Hello World')).toBe('hello-world');
7 });
8
9 it('replaces & with "and"', () => {
10 expect(slugify('Privacy & Security')).toBe('privacy-and-security');
11 });
12
13 it('replaces + with "and"', () => {
14 expect(slugify('Tools + Tips')).toBe('tools-and-tips');
15 });
16
17 it('removes question marks', () => {
18 expect(slugify('What is Privacy?')).toBe('what-is-privacy');
19 });
20
21 it('handles multiple spaces', () => {
22 expect(slugify('a b c')).toBe('a--b---c');
23 });
24
25 it('returns empty string for empty input', () => {
26 expect(slugify('')).toBe('');
27 });
28
29 it('returns empty string for undefined-like input', () => {
30 // eslint-disable-next-line @typescript-eslint/no-explicit-any
31 expect(slugify(undefined as any)).toBe('');
32 });
33
34 it('handles combined special characters', () => {
35 expect(slugify('Q&A + FAQ?')).toBe('qanda-and-faq');
36 });
37});
web/src/utils/fetch-data.ts +11 −7
@@ -1,17 +1,21 @@
1
21import yaml from 'js-yaml';
32
43import type { AwesomePrivacy } from '../types/Service';
54
6const awesomePrivacyData = 'https://raw.githubusercontent.com/Lissy93/awesome-privacy/main/awesome-privacy.yml';
5const awesomePrivacyData =
6 'https://raw.githubusercontent.com/Lissy93/awesome-privacy/main/awesome-privacy.yml';
77
88export const fetchData = async (): Promise<AwesomePrivacy> => {
9 return await fetch(awesomePrivacyData)
9 return (await fetch(awesomePrivacyData)
1010 .then((res) => res.text())
1111 .then((data) => yaml.load(data))
12 .catch((err) => console.error('ah crap', err)) as AwesomePrivacy;
13}
12 .catch((err) => console.error('ah crap', err))) as AwesomePrivacy;
13};
1414
1515export const slugify = (title: string) => {
16 return (title || '').toLowerCase().replace(/\s/g, '-').replace(/\+|&/g, 'and').replaceAll('?', '');
17};
16 return (title || '')
17 .toLowerCase()
18 .replace(/\s/g, '-')
19 .replace(/\+|&/g, 'and')
20 .replaceAll('?', '');
21};
web/src/utils/fetch-discord-info.ts +3 −2
@@ -1,5 +1,6 @@
1
2export const fetchDiscordInfo = async (discordInvite: string): Promise<DiscordInfo | null> => {
1export const fetchDiscordInfo = async (
2 discordInvite: string,
3): Promise<DiscordInfo | null> => {
34 const endpoint = `https://discord-invite-info.as93.net/${discordInvite}`;
45 try {
56 return await fetch(endpoint).then((res) => res.json());
web/src/utils/fetch-docker-instructions.ts +3 −3
@@ -1,6 +1,6 @@
1
2
3export const fetchDockerData = async (serviceName: string): Promise<TemplateResponse | null> => {
1export const fetchDockerData = async (
2 serviceName: string,
3): Promise<TemplateResponse | null> => {
44 const endpoint = `https://docker-info.as93.workers.dev/${serviceName}`;
55 try {
66 return await fetch(endpoint).then((res) => res.json());
web/src/utils/fetch-ios-info.ts +3 −2
@@ -1,5 +1,6 @@
1
2export const fetchIosInfo = async (iosUrl: string): Promise<IoSApiResponse | null> => {
1export const fetchIosInfo = async (
2 iosUrl: string,
3): Promise<IoSApiResponse | null> => {
34 const endpoint = `https://ios-app-info.as93.net?appStoreUrl=${iosUrl}`;
45 try {
56 return await fetch(endpoint).then((res) => res.json());
web/src/utils/fetch-privacy-policy.ts +3 −2
@@ -1,5 +1,6 @@
1
2export const fetchTosdrPrivacy = async (serviceId: string): Promise<PrivacyPolicyResponse | null> => {
1export const fetchTosdrPrivacy = async (
2 serviceId: string,
3): Promise<PrivacyPolicyResponse | null> => {
34 const endpoint = `https://privacy-policies.as93.workers.dev/${serviceId}`;
45 try {
56 return await fetch(endpoint).then((res) => res.json());
web/src/utils/fetch-reddit-info.ts +3 −2
@@ -1,5 +1,6 @@
1
2export const fetchRedditInfo = async (subreddit: string): Promise<RedditData | null> => {
1export const fetchRedditInfo = async (
2 subreddit: string,
3): Promise<RedditData | null> => {
34 const endpoint = `https://subreddit-info.as93.net/${subreddit}`;
45 try {
56 return await fetch(endpoint).then((res) => res.json());
web/src/utils/fetch-repo-info.ts +3 −4
@@ -1,7 +1,6 @@
1
2
3
4export const fetchGitHubStats = async (github: string): Promise<GitHubStatsResponse | null> => {
1export const fetchGitHubStats = async (
2 github: string,
3): Promise<GitHubStatsResponse | null> => {
54 const endpoint = `https://repo-info.as93.workers.dev/${github}`;
65 try {
76 return await fetch(endpoint).then((res) => res.json());
web/src/utils/fetch-website-info.ts +5 −4
@@ -1,5 +1,6 @@
1
2export const fetchWebsiteInfo = async (url: string): Promise<WebsiteData | null> => {
1export const fetchWebsiteInfo = async (
2 url: string,
3): Promise<WebsiteData | null> => {
34 const endpoint = `https://site-info-fetch.as93.workers.dev/?url=${url}`;
45 try {
56 return await fetch(endpoint).then((res) => res.json());
@@ -19,10 +20,10 @@ interface DNSRecord {
1920
2021interface DNSRecords {
2122 ns: {
22 records: DNSRecord[];
23 records: DNSRecord[];
2324 };
2425 mx: {
25 records: DNSRecord[];
26 records: DNSRecord[];
2627 };
2728}
2829
web/src/utils/parse-markdown.test.ts added +43
@@ -0,0 +1,43 @@
1import { describe, it, expect } from 'vitest';
2import { formatLink } from './parse-markdown';
3
4describe('formatLink', () => {
5 it('strips https://', () => {
6 expect(formatLink('https://example.com')).toBe('example.com');
7 });
8
9 it('strips http://', () => {
10 expect(formatLink('http://example.com')).toBe('example.com');
11 });
12
13 it('strips www.', () => {
14 expect(formatLink('https://www.example.com')).toBe('example.com');
15 });
16
17 it('strips trailing slash', () => {
18 expect(formatLink('https://example.com/')).toBe('example.com');
19 });
20
21 it('strips multiple trailing slashes', () => {
22 expect(formatLink('https://example.com///')).toBe('example.com');
23 });
24
25 it('preserves path segments', () => {
26 expect(formatLink('https://example.com/path/to/page')).toBe(
27 'example.com/path/to/page',
28 );
29 });
30
31 it('handles bare domain', () => {
32 expect(formatLink('example.com')).toBe('example.com');
33 });
34
35 it('handles empty string', () => {
36 expect(formatLink('')).toBe('');
37 });
38
39 it('handles undefined-like input', () => {
40 // eslint-disable-next-line @typescript-eslint/no-explicit-any
41 expect(formatLink(undefined as any)).toBe('');
42 });
43});
web/src/utils/parse-markdown.ts +8 −3
@@ -23,19 +23,24 @@ export const parseMarkdown = (text: string | undefined): string => {
2323
2424 // Sanitize the input to remove <script> tags
2525 const sanitizeHtml = (html: string): string => {
26 return html.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, '');
26 return html.replace(
27 /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
28 '',
29 );
2730 };
2831
2932 // Configure marked with the custom renderer
3033 marked.use({ renderer });
3134
3235 // Parse the markdown, then sanitize the HTML to remove <script> tags
33 const rawHtml = marked.parse(text, { async: false}) as string;
36 const rawHtml = marked.parse(text, { async: false }) as string;
3437 const sanitizedHtml = sanitizeHtml(rawHtml);
3538
3639 return sanitizedHtml;
3740};
3841
3942export const formatLink = (link: string) => {
40 return (link || '').replace(/^(https?:\/\/)?(www\.)?/, '').replace(/\/+$/, '');
43 return (link || '')
44 .replace(/^(https?:\/\/)?(www\.)?/, '')
45 .replace(/\/+$/, '');
4146};
web/src/utils/security-check-mappings.test.ts added +68
@@ -0,0 +1,68 @@
1import { describe, it, expect } from 'vitest';
2import { analyzeSecurityChecks } from './security-check-mappings';
3
4describe('analyzeSecurityChecks', () => {
5 it('classifies a passing HTTPS check as passed', () => {
6 const { passedChecks, failedChecks } = analyzeSecurityChecks({
7 is_valid_https: true,
8 });
9 expect(passedChecks).toContain('Valid HTTPS Connection');
10 expect(failedChecks).toHaveLength(0);
11 });
12
13 it('classifies is_valid_https: "no" as failed', () => {
14 // The pass logic uses (value === shouldPass) || (shouldPass === true && value !== "no")
15 // For boolean false, the second condition still passes (false !== "no" is true).
16 // Only the string "no" actually triggers a failure when shouldPass is true.
17 const { failedChecks } = analyzeSecurityChecks({
18 is_valid_https: 'no',
19 });
20 expect(failedChecks).toContain('Valid HTTPS Connection');
21 });
22
23 it('classifies a false-means-pass check correctly', () => {
24 // is_host_an_ipv4 should be false to pass
25 const { passedChecks } = analyzeSecurityChecks({
26 is_host_an_ipv4: false,
27 });
28 expect(passedChecks).toContain('Host is an IPv4 Address');
29 });
30
31 it('classifies a false-means-pass check as failed when true', () => {
32 const { failedChecks } = analyzeSecurityChecks({
33 is_host_an_ipv4: true,
34 });
35 expect(failedChecks).toContain('Host is an IPv4 Address');
36 });
37
38 it('handles multiple checks at once', () => {
39 const { passedChecks, failedChecks } = analyzeSecurityChecks({
40 is_valid_https: true,
41 is_host_an_ipv4: false,
42 is_suspended_page: true, // should fail (expected false)
43 });
44 expect(passedChecks).toHaveLength(2);
45 expect(failedChecks).toHaveLength(1);
46 expect(failedChecks).toContain('Suspended Page');
47 });
48
49 it('handles string "no" values for domain_recent checks', () => {
50 const { passedChecks } = analyzeSecurityChecks({
51 is_domain_recent: 'no',
52 });
53 expect(passedChecks).toContain('Domain Recently Created');
54 });
55
56 it('fails domain_recent when value is not "no"', () => {
57 const { failedChecks } = analyzeSecurityChecks({
58 is_domain_recent: 'yes',
59 });
60 expect(failedChecks).toContain('Domain Recently Created');
61 });
62
63 it('returns empty arrays for empty input', () => {
64 const { passedChecks, failedChecks } = analyzeSecurityChecks({});
65 expect(passedChecks).toHaveLength(0);
66 expect(failedChecks).toHaveLength(0);
67 });
68});
web/src/utils/security-check-mappings.ts +91 −84
@@ -1,5 +1,4 @@
1
2const securityCheckMapping: {[key: string]: string} = {
1const securityCheckMapping: { [key: string]: string } = {
32 is_host_an_ipv4: 'Host is an IPv4 Address',
43 is_uncommon_host_length: 'Uncommon Host Length',
54 is_uncommon_dash_char_count: 'Uncommon Number of Dashes in Host',
@@ -51,7 +50,8 @@ const securityCheckMapping: {[key: string]: string} = {
5150 is_masked_linux_elf_file: 'Masked Linux ELF File Detected',
5251 is_masked_windows_exe_file: 'Masked Windows Executable Detected',
5352 is_ms_office_file: 'Microsoft Office File Detected',
54 is_windows_exe_file_on_free_dynamic_dns: 'Windows Executable on Free Dynamic DNS',
53 is_windows_exe_file_on_free_dynamic_dns:
54 'Windows Executable on Free Dynamic DNS',
5555 is_windows_exe_file_on_free_hosting: 'Windows Executable on Free Hosting',
5656 is_windows_exe_file_on_ipv4: 'Windows Executable on IPv4 Address',
5757 is_windows_exe_file: 'Windows Executable Detected',
@@ -65,91 +65,98 @@ const securityCheckMapping: {[key: string]: string} = {
6565 is_domain_very_recent: 'Domain Very Recently Created',
6666 is_credit_card_field: 'Credit Card Field Present',
6767 is_password_field: 'Password Field Present',
68 is_valid_https: 'Valid HTTPS Connection'
68 is_valid_https: 'Valid HTTPS Connection',
6969};
70const passFailLogic: {[key: string]: boolean | string} = {
71 // True means the check needs to be true to pass
72 is_valid_https: true,
73 is_host_an_ipv4: false,
74 is_uncommon_host_length: false,
75 is_uncommon_dash_char_count: false,
76 is_uncommon_dot_char_count: false,
77 is_uncommon_host_name: false,
78 is_suspicious_url_pattern: false,
79 is_suspicious_file_extension: false,
80 is_robots_noindex: false,
81 is_suspended_page: false,
82 is_most_abused_tld: false,
83 is_uncommon_clickable_url: false,
84 is_phishing_heuristic: false,
85 is_possible_emotet: false,
86 is_redirect_to_search_engine: false,
87 is_redirect_to_wikipedia: false,
88 is_http_status_error: false,
89 is_http_server_error: false,
90 is_http_client_error: false,
91 is_suspicious_content: false,
92 is_url_accessible: true,
93 is_empty_page_title: false,
94 is_empty_page_content: false,
95 is_domain_ipv4_assigned: true,
96 is_domain_ipv4_private: false,
97 is_domain_ipv4_loopback: false,
98 is_domain_ipv4_reserved: false,
99 is_domain_ipv4_valid: true,
100 is_domain_blacklisted: false,
101 is_suspicious_domain: false,
102 is_sinkholed_domain: false,
103 is_defaced_heuristic: false,
104 is_masked_file: false,
105 is_risky_geo_location: false,
106 is_china_country: false,
107 is_nigeria_country: false,
108 is_non_standard_port: false,
109 is_email_address_on_url_query: false,
110 is_directory_listing: false,
111 is_exe_on_directory_listing: false,
112 is_zip_on_directory_listing: false,
113 is_php_on_directory_listing: false,
114 is_doc_on_directory_listing: false,
115 is_pdf_on_directory_listing: false,
116 is_apk_on_directory_listing: false,
117 is_linux_elf_file: false,
118 is_linux_elf_file_on_free_dynamic_dns: false,
119 is_linux_elf_file_on_free_hosting: false,
120 is_linux_elf_file_on_ipv4: false,
121 is_masked_linux_elf_file: false,
122 is_masked_windows_exe_file: false,
123 is_ms_office_file: false,
124 is_windows_exe_file_on_free_dynamic_dns: false,
125 is_windows_exe_file_on_free_hosting: false,
126 is_windows_exe_file_on_ipv4: false,
127 is_windows_exe_file: false,
128 is_android_apk_file_on_free_dynamic_dns: false,
129 is_android_apk_file_on_free_hosting: false,
130 is_android_apk_file_on_ipv4: false,
131 is_android_apk_file: false,
132 is_external_redirect: false,
133 is_risky_category: false,
134 is_domain_recent: "no",
135 is_domain_very_recent: "no",
136 is_credit_card_field: false,
137 is_password_field: false,
70const passFailLogic: { [key: string]: boolean | string } = {
71 // True means the check needs to be true to pass
72 is_valid_https: true,
73 is_host_an_ipv4: false,
74 is_uncommon_host_length: false,
75 is_uncommon_dash_char_count: false,
76 is_uncommon_dot_char_count: false,
77 is_uncommon_host_name: false,
78 is_suspicious_url_pattern: false,
79 is_suspicious_file_extension: false,
80 is_robots_noindex: false,
81 is_suspended_page: false,
82 is_most_abused_tld: false,
83 is_uncommon_clickable_url: false,
84 is_phishing_heuristic: false,
85 is_possible_emotet: false,
86 is_redirect_to_search_engine: false,
87 is_redirect_to_wikipedia: false,
88 is_http_status_error: false,
89 is_http_server_error: false,
90 is_http_client_error: false,
91 is_suspicious_content: false,
92 is_url_accessible: true,
93 is_empty_page_title: false,
94 is_empty_page_content: false,
95 is_domain_ipv4_assigned: true,
96 is_domain_ipv4_private: false,
97 is_domain_ipv4_loopback: false,
98 is_domain_ipv4_reserved: false,
99 is_domain_ipv4_valid: true,
100 is_domain_blacklisted: false,
101 is_suspicious_domain: false,
102 is_sinkholed_domain: false,
103 is_defaced_heuristic: false,
104 is_masked_file: false,
105 is_risky_geo_location: false,
106 is_china_country: false,
107 is_nigeria_country: false,
108 is_non_standard_port: false,
109 is_email_address_on_url_query: false,
110 is_directory_listing: false,
111 is_exe_on_directory_listing: false,
112 is_zip_on_directory_listing: false,
113 is_php_on_directory_listing: false,
114 is_doc_on_directory_listing: false,
115 is_pdf_on_directory_listing: false,
116 is_apk_on_directory_listing: false,
117 is_linux_elf_file: false,
118 is_linux_elf_file_on_free_dynamic_dns: false,
119 is_linux_elf_file_on_free_hosting: false,
120 is_linux_elf_file_on_ipv4: false,
121 is_masked_linux_elf_file: false,
122 is_masked_windows_exe_file: false,
123 is_ms_office_file: false,
124 is_windows_exe_file_on_free_dynamic_dns: false,
125 is_windows_exe_file_on_free_hosting: false,
126 is_windows_exe_file_on_ipv4: false,
127 is_windows_exe_file: false,
128 is_android_apk_file_on_free_dynamic_dns: false,
129 is_android_apk_file_on_free_hosting: false,
130 is_android_apk_file_on_ipv4: false,
131 is_android_apk_file: false,
132 is_external_redirect: false,
133 is_risky_category: false,
134 is_domain_recent: 'no',
135 is_domain_very_recent: 'no',
136 is_credit_card_field: false,
137 is_password_field: false,
138138};
139139
140export const analyzeSecurityChecks = (checks: { [key: string]: boolean | string }) => {
141
142 let passedChecks = [];
143 let failedChecks = [];
140export const analyzeSecurityChecks = (checks: {
141 [key: string]: boolean | string;
142}) => {
143 const passedChecks = [];
144 const failedChecks = [];
144145 for (const [check, value] of Object.entries(checks)) {
145 let shouldPass = passFailLogic.hasOwnProperty(check) ? passFailLogic[check] : false;
146 let actualPass = (value === shouldPass) || (shouldPass === true && value !== "no");
146 const shouldPass = Object.prototype.hasOwnProperty.call(
147 passFailLogic,
148 check,
149 )
150 ? passFailLogic[check]
151 : false;
152 const actualPass =
153 value === shouldPass || (shouldPass === true && value !== 'no');
147154
148 if (actualPass) {
149 passedChecks.push(securityCheckMapping[check]);
150 } else {
151 failedChecks.push(securityCheckMapping[check]);
152 }
155 if (actualPass) {
156 passedChecks.push(securityCheckMapping[check]);
157 } else {
158 failedChecks.push(securityCheckMapping[check]);
159 }
153160 }
154161 return { passedChecks, failedChecks };
155}
162};