Commit 4f8ab87ea7
Unsigned
Layout: unified · split
web/src/components/Card.astro +6 −8
| @@ -21,19 +21,18 @@ const { href, title, body } = Astro.props; | |||
| 21 | </li> | 21 | </li> |
| 22 | <style lang="scss"> | 22 | <style lang="scss"> |
| 23 | .link-card { | 23 | .link-card { |
| 24 | color: var(--foreground); | 24 | color: var(--foreground); |
| 25 | background: var(--background); | 25 | background: var(--background); |
| 26 | border: 2px solid var(--box-outline); | 26 | border: 2px solid var(--box-outline); |
| 27 | box-shadow: 6px 6px 0 var(--box-outline); | 27 | box-shadow: 6px 6px 0 var(--box-outline); |
| 28 | font-family: "Lekton", sans-serif; | 28 | font-family: 'Lekton', sans-serif; |
| 29 | font-weight: 700; | 29 | font-weight: 700; |
| 30 | transition: all ease-in-out 0.1s; | 30 | transition: all ease-in-out 0.1s; |
| 31 | list-style: none; | 31 | list-style: none; |
| 32 | &:hover { | 32 | &:hover { |
| 33 | box-shadow: 8px 8px 0 var(--box-outline); | 33 | box-shadow: 8px 8px 0 var(--box-outline); |
| 34 | background: var(--accent); | 34 | background: var(--accent); |
| 35 | color: var(--background); | 35 | color: var(--background); |
| 36 | |||
| 37 | } | 36 | } |
| 38 | a { | 37 | a { |
| 39 | box-sizing: border-box; | 38 | box-sizing: border-box; |
| @@ -45,5 +44,4 @@ const { href, title, body } = Astro.props; | |||
| 45 | margin: 0; | 44 | margin: 0; |
| 46 | } | 45 | } |
| 47 | } | 46 | } |
| 48 | |||
| 49 | </style> | 47 | </style> |
web/src/components/Hero.astro +127 −129
| @@ -1,61 +1,60 @@ | |||
| 1 | --- | 1 | --- |
| 2 | import FontAwesome from "@components/form/FontAwesome.svelte" | 2 | import FontAwesome from '@components/form/FontAwesome.svelte'; |
| 3 | import ThemeSwitcher from "@components/form/ThemeSwitcher.svelte" | 3 | import ThemeSwitcher from '@components/form/ThemeSwitcher.svelte'; |
| 4 | --- | 4 | --- |
| 5 | 5 | ||
| 6 | <div class="theme-switcher"> | 6 | <div class="theme-switcher"> |
| 7 | <ThemeSwitcher client:load /> | 7 | <ThemeSwitcher client:load /> |
| 8 | </div> | 8 | </div> |
| 9 | 9 | ||
| 10 | <div class="hero"> | 10 | <div class="hero"> |
| 11 | <h1>Awesome Privacy</h1> | 11 | <h1>Awesome Privacy</h1> |
| 12 | <p class="intro"> | 12 | <p class="intro"> |
| 13 | Your guide to finding and comparing privacy-respecting alternatives to popular software and services. | 13 | Your guide to finding and comparing privacy-respecting alternatives to |
| 14 | </p> | 14 | popular software and services. |
| 15 | <div class="github-link-wrap"> | 15 | </p> |
| 16 | <a href="https://github.com/lissy93/awesome-privacy"> | 16 | <div class="github-link-wrap"> |
| 17 | <FontAwesome iconName="github" /> | 17 | <a href="https://github.com/lissy93/awesome-privacy"> |
| 18 | View on GitHub | 18 | <FontAwesome iconName="github" /> |
| 19 | </a> | 19 | View on GitHub |
| 20 | </div> | 20 | </a> |
| 21 | </div> | ||
| 21 | </div> | 22 | </div> |
| 22 | 23 | ||
| 23 | <nav class="top-right"> | 24 | <nav class="top-right"> |
| 24 | <ul> | 25 | <ul> |
| 25 | <li> | 26 | <li> |
| 26 | <a href="/">Home</a> | 27 | <a href="/">Home</a> |
| 27 | </li> | 28 | </li> |
| 28 | <li> | 29 | <li> |
| 29 | <a href="/search">Search</a> | 30 | <a href="/search">Search</a> |
| 30 | </li> | 31 | </li> |
| 31 | <li> | 32 | <li> |
| 32 | <a href="/browse">Browse</a> | 33 | <a href="/browse">Browse</a> |
| 33 | </li> | 34 | </li> |
| 34 | <li> | 35 | <li> |
| 35 | <a href="/about">About</a> | 36 | <a href="/about">About</a> |
| 36 | </li> | 37 | </li> |
| 37 | <li> | 38 | <li> |
| 38 | <a href="https://github.com/lissy93/awesome-privacy">Source</a> | 39 | <a href="https://github.com/lissy93/awesome-privacy">Source</a> |
| 39 | </li> | 40 | </li> |
| 40 | <li> | 41 | <li> |
| 41 | <a href="https://as93.net">More Apps</a> | 42 | <a href="https://as93.net">More Apps</a> |
| 42 | </li> | 43 | </li> |
| 43 | </ul> | 44 | </ul> |
| 44 | </nav> | 45 | </nav> |
| 45 | 46 | ||
| 46 | |||
| 47 | <style lang="scss"> | 47 | <style lang="scss"> |
| 48 | |||
| 49 | .hero { | 48 | .hero { |
| 50 | color: var(--accent-fg); | 49 | color: var(--accent-fg); |
| 51 | border-radius: var(--curve-sm); | 50 | border-radius: var(--curve-sm); |
| 52 | padding: 2rem 4rem; | 51 | padding: 2rem 4rem; |
| 53 | display: flex; | 52 | display: flex; |
| 54 | flex-direction: column; | 53 | flex-direction: column; |
| 55 | gap: 2rem; | 54 | gap: 2rem; |
| 56 | @media(max-width: 768px) { | 55 | @media (max-width: 768px) { |
| 57 | padding: 2rem 1rem; | 56 | padding: 2rem 1rem; |
| 58 | } | 57 | } |
| 59 | } | 58 | } |
| 60 | svg { | 59 | svg { |
| 61 | position: absolute; | 60 | position: absolute; |
| @@ -65,98 +64,97 @@ import ThemeSwitcher from "@components/form/ThemeSwitcher.svelte" | |||
| 65 | width: 220px; | 64 | width: 220px; |
| 66 | height: auto; | 65 | height: auto; |
| 67 | opacity: 0.6; | 66 | opacity: 0.6; |
| 68 | display: none; | 67 | display: none; |
| 69 | } | 68 | } |
| 70 | h1 { | 69 | h1 { |
| 71 | margin: 0; | 70 | margin: 0; |
| 72 | font-size: 5rem; | 71 | font-size: 5rem; |
| 73 | font-weight: 700; | 72 | font-weight: 700; |
| 74 | line-height: 1; | 73 | line-height: 1; |
| 75 | text-align: center; | 74 | text-align: center; |
| 76 | font-family: 'Libre Franklin', sans-serif; | 75 | font-family: 'Libre Franklin', sans-serif; |
| 77 | color: var(--accent-3); | 76 | color: var(--accent-3); |
| 78 | -webkit-text-fill-color: var(--accent-3); | 77 | -webkit-text-fill-color: var(--accent-3); |
| 79 | -webkit-text-stroke-width: 2px; | 78 | -webkit-text-stroke-width: 2px; |
| 80 | -webkit-text-stroke-color: var(--box-outline); | 79 | -webkit-text-stroke-color: var(--box-outline); |
| 81 | text-shadow: 3px 3px 0 var(--box-outline); | 80 | text-shadow: 3px 3px 0 var(--box-outline); |
| 82 | @media(max-width: 768px) { | 81 | @media (max-width: 768px) { |
| 83 | font-size: 4rem; | 82 | font-size: 4rem; |
| 84 | } | 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 | } | ||
| 85 | } | 124 | } |
| 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 | } | ||
| 126 | 125 | ||
| 127 | .theme-switcher { | 126 | .theme-switcher { |
| 128 | position: absolute; | 127 | position: absolute; |
| 129 | right: 1rem; | 128 | right: 1rem; |
| 130 | top: 1rem; | 129 | top: 1rem; |
| 131 | } | 130 | } |
| 132 | 131 | ||
| 133 | .top-right { | 132 | .top-right { |
| 134 | position: absolute; | 133 | position: absolute; |
| 135 | top: 0; | 134 | top: 0; |
| 136 | right: 1rem; | 135 | right: 1rem; |
| 137 | opacity: 0.8; | 136 | opacity: 0.8; |
| 138 | display: none; | 137 | display: none; |
| 139 | &:hover { | 138 | &:hover { |
| 140 | opacity: 1; | 139 | opacity: 1; |
| 141 | } | 140 | } |
| 142 | ul { | 141 | ul { |
| 143 | list-style: none; | 142 | list-style: none; |
| 144 | display: flex; | 143 | display: flex; |
| 145 | padding: 0; | 144 | padding: 0; |
| 146 | gap: 0.5rem; | 145 | gap: 0.5rem; |
| 147 | li { | 146 | li { |
| 148 | &:not(:last-child) { | 147 | &:not(:last-child) { |
| 149 | border-right: 1px solid var(--accent); | 148 | border-right: 1px solid var(--accent); |
| 150 | padding-right: 0.5rem; | 149 | padding-right: 0.5rem; |
| 151 | } | 150 | } |
| 152 | } | 151 | } |
| 153 | li a { | 152 | li a { |
| 154 | text-decoration: none; | 153 | text-decoration: none; |
| 155 | &:hover { | 154 | &:hover { |
| 156 | text-decoration: underline; | 155 | text-decoration: underline; |
| 157 | } | 156 | } |
| 158 | } | 157 | } |
| 159 | } | 158 | } |
| 160 | } | 159 | } |
| 161 | |||
| 162 | </style> | 160 | </style> |
web/src/components/form/Button.astro +22 −29
| @@ -1,37 +1,30 @@ | |||
| 1 | --- | 1 | --- |
| 2 | 2 | const { text, url, className, title } = Astro.props; | |
| 3 | const { | ||
| 4 | text, | ||
| 5 | url, | ||
| 6 | className, | ||
| 7 | title, | ||
| 8 | } = Astro.props; | ||
| 9 | |||
| 10 | --- | 3 | --- |
| 11 | 4 | ||
| 12 | <div class={`button ${className || ''}`} title={title}> | 5 | <div class={`button ${className || ''}`} title={title}> |
| 13 | <a href={url}>{text}<slot /></a> | 6 | <a href={url}>{text}<slot /></a> |
| 14 | </div> | 7 | </div> |
| 15 | 8 | ||
| 16 | <style lang="scss"> | 9 | <style lang="scss"> |
| 17 | .button { | 10 | .button { |
| 18 | font-family: "Lekton", sans-serif; | 11 | font-family: 'Lekton', sans-serif; |
| 19 | text-align: center; | 12 | text-align: center; |
| 20 | border: 1px solid var(--box-outline); | 13 | border: 1px solid var(--box-outline); |
| 21 | box-shadow: 3px 3px 0 var(--box-outline); | 14 | box-shadow: 3px 3px 0 var(--box-outline); |
| 22 | background: var(--accent); | 15 | background: var(--accent); |
| 23 | border-radius: 18px; | 16 | border-radius: 18px; |
| 24 | padding: 0.5rem 1rem; | 17 | padding: 0.5rem 1rem; |
| 25 | transition: all 0.2s ease-in-out; | 18 | transition: all 0.2s ease-in-out; |
| 26 | &:hover { | 19 | &:hover { |
| 27 | box-shadow: 4px 4px 0 var(--box-outline); | 20 | box-shadow: 4px 4px 0 var(--box-outline); |
| 28 | } | 21 | } |
| 29 | a { | 22 | a { |
| 30 | text-decoration: none; | 23 | text-decoration: none; |
| 31 | color: var(--accent-fg);; | 24 | color: var(--accent-fg); |
| 32 | font-size: 1.2rem; | 25 | font-size: 1.2rem; |
| 33 | font-family: "Lekton", sans-serif; | 26 | font-family: 'Lekton', sans-serif; |
| 34 | font-weight: bold; | 27 | font-weight: bold; |
| 35 | } | 28 | } |
| 36 | } | 29 | } |
| 37 | </style> | 30 | </style> |
web/src/components/form/EditableTitle.svelte +13 −11
| @@ -41,25 +41,27 @@ | |||
| 41 | } | 41 | } |
| 42 | </script> | 42 | </script> |
| 43 | 43 | ||
| 44 | <svelte:window on:click={handleClickOutside}/> | 44 | <svelte:window on:click={handleClickOutside} /> |
| 45 | 45 | ||
| 46 | <!-- svelte-ignore a11y-no-noninteractive-tabindex --> | 46 | <!-- svelte-ignore a11y-no-noninteractive-tabindex --> |
| 47 | <div> | 47 | <div> |
| 48 | <h2 | 48 | <h2 |
| 49 | contenteditable={true} | 49 | contenteditable={true} |
| 50 | class:editable={editing} | 50 | class:editable={editing} |
| 51 | on:click={() => editing = true} | 51 | on:click={() => (editing = true)} |
| 52 | on:keydown={handleKeydown} | 52 | on:keydown={handleKeydown} |
| 53 | on:blur={() => saveTitle(title)} | 53 | on:blur={() => saveTitle(title)} |
| 54 | tabindex="0" | 54 | tabindex="0" |
| 55 | >{title}</h2> | 55 | > |
| 56 | {title} | ||
| 57 | </h2> | ||
| 56 | 58 | ||
| 57 | <small>Click the title, to edit your inventory name</small> | 59 | <small>Click the title, to edit your inventory name</small> |
| 58 | </div> | 60 | </div> |
| 59 | 61 | ||
| 60 | <style> | 62 | <style> |
| 61 | h2 { | 63 | h2 { |
| 62 | font-family: "Lekton", sans-serif; | 64 | font-family: 'Lekton', sans-serif; |
| 63 | font-weight: bold; | 65 | font-weight: bold; |
| 64 | font-size: 3rem; | 66 | font-size: 3rem; |
| 65 | margin: 0; | 67 | margin: 0; |
web/src/components/form/FontAwesome.svelte +1 −7
| @@ -4,7 +4,6 @@ | |||
| 4 | import * as brands from '@fortawesome/free-brands-svg-icons'; | 4 | import * as brands from '@fortawesome/free-brands-svg-icons'; |
| 5 | import type { IconDefinition } from '@fortawesome/fontawesome-svg-core'; | 5 | import type { IconDefinition } from '@fortawesome/fontawesome-svg-core'; |
| 6 | 6 | ||
| 7 | |||
| 8 | export const iconMap: Record<string, IconDefinition> = { | 7 | export const iconMap: Record<string, IconDefinition> = { |
| 9 | // Branding | 8 | // Branding |
| 10 | logo: solidIcons.faEyeSlash, | 9 | logo: solidIcons.faEyeSlash, |
| @@ -83,13 +82,8 @@ | |||
| 83 | }; | 82 | }; |
| 84 | 83 | ||
| 85 | export let iconName: string; | 84 | export let iconName: string; |
| 86 | |||
| 87 | </script> | 85 | </script> |
| 88 | 86 | ||
| 89 | {#if iconMap[iconName]} | 87 | {#if iconMap[iconName]} |
| 90 | <FontAwesomeIcon | 88 | <FontAwesomeIcon class="fa-icon" icon={iconMap[iconName]} /> |
| 91 | class="fa-icon" | ||
| 92 | icon={iconMap[iconName]} /> | ||
| 93 | {/if} | 89 | {/if} |
| 94 | |||
| 95 | |||
web/src/components/form/Icon.astro +71 −60
| @@ -1,73 +1,84 @@ | |||
| 1 | --- | 1 | --- |
| 2 | |||
| 3 | interface IconProps { | 2 | interface IconProps { |
| 4 | icon: string; | 3 | icon: string; |
| 5 | color?: string; | 4 | color?: string; |
| 6 | class?: string; | 5 | class?: string; |
| 7 | width?: number; | 6 | width?: number; |
| 8 | height?: number; | 7 | height?: number; |
| 9 | } | 8 | } |
| 10 | 9 | ||
| 11 | const getSvgPath = (icon: string) => { | 10 | const getSvgPath = (icon: string) => { |
| 12 | switch (icon) { | 11 | switch (icon) { |
| 13 | case 'star': | 12 | case 'star': |
| 14 | return { | 13 | return { |
| 15 | vb: "0 0 24 24", | 14 | 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", | 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', |
| 17 | }; | 16 | }; |
| 18 | case 'mastodon': | 17 | case 'mastodon': |
| 19 | return { | 18 | return { |
| 20 | vb: "0 0 512 512", | 19 | 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", | 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', |
| 22 | }; | 21 | }; |
| 23 | case 'twitter': | 22 | case 'twitter': |
| 24 | return { | 23 | return { |
| 25 | vb: "0 0 512 512", | 24 | 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", | 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', |
| 27 | }; | 26 | }; |
| 28 | case 'hub': | 27 | case 'hub': |
| 29 | return { | 28 | return { |
| 30 | vb: "0 0 512 512", | 29 | 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", | 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', |
| 32 | }; | 31 | }; |
| 33 | case 'dev': | 32 | case 'dev': |
| 34 | return { | 33 | return { |
| 35 | vb: "0 0 512 512", | 34 | 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", | 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', |
| 37 | }; | 36 | }; |
| 38 | case 'linkedin': | 37 | case 'linkedin': |
| 39 | return { | 38 | return { |
| 40 | vb: "0 0 512 512", | 39 | 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", | 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', |
| 42 | }; | 41 | }; |
| 43 | case 'essentials': | 42 | case 'essentials': |
| 44 | return { | 43 | return { |
| 45 | vb: "0 0 512 512", | 44 | 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", | 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', |
| 47 | }; | 46 | }; |
| 48 | case 'communication': | 47 | case 'communication': |
| 49 | return { | 48 | return { |
| 50 | vb: "0 0 640 512", | 49 | 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", | 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', |
| 52 | }; | 51 | }; |
| 53 | case 'security-tools': | 52 | case 'security-tools': |
| 54 | return { | 53 | return { |
| 55 | vp: "0 0 512 512", | 54 | 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" | 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', |
| 57 | }; | 56 | }; |
| 58 | // Add more icons as needed... | 57 | // Add more icons as needed... |
| 59 | default: | 58 | default: |
| 60 | return { vb: "", path: "" }; // Default path or a placeholder icon | 59 | return { vb: '', path: '' }; // Default path or a placeholder icon |
| 61 | } | 60 | } |
| 62 | }; | 61 | }; |
| 63 | 62 | ||
| 64 | |||
| 65 | // Props are defined in the component's signature | 63 | // Props are defined in the component's signature |
| 66 | const { icon, color = 'currentcolor', class: className = '', width = 80, height = 50 } = Astro.props as IconProps; | 64 | const { |
| 65 | icon, | ||
| 66 | color = 'currentcolor', | ||
| 67 | class: className = '', | ||
| 68 | width = 80, | ||
| 69 | height = 50, | ||
| 70 | } = Astro.props as IconProps; | ||
| 67 | const svgStyle = { fill: color }; | 71 | const svgStyle = { fill: color }; |
| 68 | const { vb, path } = getSvgPath(icon); | 72 | const { vb, path } = getSvgPath(icon); |
| 69 | --- | 73 | --- |
| 70 | 74 | ||
| 71 | <svg class={className} style={svgStyle} xmlns="http://www.w3.org/2000/svg" viewBox={vb} width={width} height={height ?? width}> | 75 | <svg |
| 72 | <path d={path} /> | 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> | ||
| 73 | </svg> | 84 | </svg> |
web/src/components/form/Social.astro +111 −103
| @@ -1,12 +1,15 @@ | |||
| 1 | --- | 1 | --- |
| 2 | |||
| 3 | import Icon from '@components/form/FontAwesome.svelte'; | 2 | import Icon from '@components/form/FontAwesome.svelte'; |
| 4 | import { site, title as defaultTitle, description as defaultDescription } from '@utils/config'; | 3 | import { |
| 4 | site, | ||
| 5 | title as defaultTitle, | ||
| 6 | description as defaultDescription, | ||
| 7 | } from '@utils/config'; | ||
| 5 | 8 | ||
| 6 | interface Props { | 9 | interface Props { |
| 7 | url?: string; | 10 | url?: string; |
| 8 | title?: string; | 11 | title?: string; |
| 9 | description?: string; | 12 | description?: string; |
| 10 | } | 13 | } |
| 11 | 14 | ||
| 12 | const url = Astro.props.url || site; | 15 | const url = Astro.props.url || site; |
| @@ -18,109 +21,114 @@ const encodedTitle = encodeURIComponent(title); | |||
| 18 | const encodedDescription = encodeURIComponent(description); | 21 | const encodedDescription = encodeURIComponent(description); |
| 19 | 22 | ||
| 20 | const socialMedias = { | 23 | const socialMedias = { |
| 21 | mastodon: { | 24 | mastodon: { |
| 22 | url: `https://mastodon.social/share?text=${encodeURIComponent(`${title} ${description}`)}&url=${encodedUrl}`, | 25 | url: `https://mastodon.social/share?text=${encodeURIComponent(`${title} ${description}`)}&url=${encodedUrl}`, |
| 23 | title: 'Mastodon', | 26 | title: 'Mastodon', |
| 24 | icon: 'mastodon', | 27 | icon: 'mastodon', |
| 25 | color: '#6364FF', | 28 | color: '#6364FF', |
| 26 | }, | 29 | }, |
| 27 | twitter: { | 30 | twitter: { |
| 28 | url: `https://twitter.com/intent/tweet?text=${encodeURIComponent(`${title} ${description}`)}&url=${url}`, | 31 | url: `https://twitter.com/intent/tweet?text=${encodeURIComponent(`${title} ${description}`)}&url=${url}`, |
| 29 | title: 'Twitter', | 32 | title: 'Twitter', |
| 30 | icon: 'twitter', | 33 | icon: 'twitter', |
| 31 | color: '#444343' | 34 | color: '#444343', |
| 32 | }, | 35 | }, |
| 33 | reddit: { | 36 | reddit: { |
| 34 | url: `https://reddit.com/submit?url=${encodedUrl}&title=${encodedTitle}`, | 37 | url: `https://reddit.com/submit?url=${encodedUrl}&title=${encodedTitle}`, |
| 35 | title: 'Reddit', | 38 | title: 'Reddit', |
| 36 | icon: 'reddit', | 39 | icon: 'reddit', |
| 37 | color: '#FF4500', | 40 | color: '#FF4500', |
| 38 | }, | 41 | }, |
| 39 | linkedIn: { | 42 | linkedIn: { |
| 40 | url: `https://www.linkedin.com/shareArticle?mini=true&url=${encodedUrl}&title=${encodedTitle}&summary=${encodedDescription}`, | 43 | url: `https://www.linkedin.com/shareArticle?mini=true&url=${encodedUrl}&title=${encodedTitle}&summary=${encodedDescription}`, |
| 41 | title: 'LinkedIn', | 44 | title: 'LinkedIn', |
| 42 | icon: 'linkedin', | 45 | icon: 'linkedin', |
| 43 | color: '#0A66C2' | 46 | color: '#0A66C2', |
| 44 | }, | 47 | }, |
| 45 | pinterest: { | 48 | pinterest: { |
| 46 | url: `https://pinterest.com/pin/create/button/?url=${encodedUrl}&description=${encodedTitle}`, | 49 | url: `https://pinterest.com/pin/create/button/?url=${encodedUrl}&description=${encodedTitle}`, |
| 47 | title: 'Pinterest', | 50 | title: 'Pinterest', |
| 48 | icon: 'pinterest', | 51 | icon: 'pinterest', |
| 49 | color: '#BD081C', | 52 | color: '#BD081C', |
| 50 | }, | 53 | }, |
| 51 | telegram: { | 54 | telegram: { |
| 52 | url: `https://t.me/share/url?url=${encodedUrl}&text=${encodeURIComponent(`${title} ${description}`)}`, | 55 | url: `https://t.me/share/url?url=${encodedUrl}&text=${encodeURIComponent(`${title} ${description}`)}`, |
| 53 | title: 'Telegram', | 56 | title: 'Telegram', |
| 54 | icon: 'telegram', | 57 | icon: 'telegram', |
| 55 | color: '#26A5E4', | 58 | color: '#26A5E4', |
| 56 | }, | 59 | }, |
| 57 | whatsapp: { | 60 | whatsapp: { |
| 58 | url: `https://wa.me/?text=${encodedTitle} ${encodedUrl}`, | 61 | url: `https://wa.me/?text=${encodedTitle} ${encodedUrl}`, |
| 59 | title: 'WhatsApp', | 62 | title: 'WhatsApp', |
| 60 | icon: 'whatsapp', | 63 | icon: 'whatsapp', |
| 61 | color: '#25D366', | 64 | color: '#25D366', |
| 62 | }, | 65 | }, |
| 63 | signal: { | 66 | signal: { |
| 64 | url: `https://signal.me/#p/+${encodedUrl}`, | 67 | url: `https://signal.me/#p/+${encodedUrl}`, |
| 65 | title: 'Signal', | 68 | title: 'Signal', |
| 66 | icon: 'signal', | 69 | icon: 'signal', |
| 67 | color: '#3A76F0', | 70 | color: '#3A76F0', |
| 68 | }, | 71 | }, |
| 69 | pocket: { | 72 | pocket: { |
| 70 | url: `https://getpocket.com/save?url=${encodedUrl}&title=${encodedTitle}`, | 73 | url: `https://getpocket.com/save?url=${encodedUrl}&title=${encodedTitle}`, |
| 71 | title: 'Pocket', | 74 | title: 'Pocket', |
| 72 | icon: 'pocket', | 75 | icon: 'pocket', |
| 73 | color: '#EF3F56', | 76 | color: '#EF3F56', |
| 74 | }, | 77 | }, |
| 75 | }; | 78 | }; |
| 76 | |||
| 77 | --- | 79 | --- |
| 78 | 80 | ||
| 79 | <ul class="social-share"> | 81 | <ul class="social-share"> |
| 80 | {Object.entries(socialMedias).map(([platform, shareUrl]) => ( | 82 | { |
| 81 | <li style={`--color: ${shareUrl.color}`}> | 83 | Object.entries(socialMedias).map(([platform, shareUrl]) => ( |
| 82 | <a title={`Share on ${platform}`} href={shareUrl.url} target="_blank" rel="noopener noreferrer"> | 84 | <li style={`--color: ${shareUrl.color}`}> |
| 83 | <Icon iconName={shareUrl.icon} /> | 85 | <a |
| 84 | </a> | 86 | title={`Share on ${platform}`} |
| 85 | </li> | 87 | href={shareUrl.url} |
| 86 | ))} | 88 | target="_blank" |
| 89 | rel="noopener noreferrer" | ||
| 90 | > | ||
| 91 | <Icon iconName={shareUrl.icon} /> | ||
| 92 | </a> | ||
| 93 | </li> | ||
| 94 | )) | ||
| 95 | } | ||
| 87 | </ul> | 96 | </ul> |
| 88 | 97 | ||
| 89 | <style lang="scss"> | 98 | <style lang="scss"> |
| 90 | .social-share { | 99 | .social-share { |
| 91 | list-style: none; | 100 | list-style: none; |
| 92 | padding: 0; | 101 | padding: 0; |
| 93 | display: flex; | 102 | display: flex; |
| 94 | gap: 0.5rem; | 103 | gap: 0.5rem; |
| 95 | flex-wrap: wrap; | 104 | flex-wrap: wrap; |
| 96 | li { | 105 | li { |
| 97 | padding: 0; | 106 | padding: 0; |
| 98 | margin: 0; | 107 | margin: 0; |
| 99 | opacity: 0.8; | 108 | opacity: 0.8; |
| 100 | border: 1px solid var(--box-outline); | 109 | border: 1px solid var(--box-outline); |
| 101 | box-shadow: 2px 2px 0 var(--box-outline); | 110 | box-shadow: 2px 2px 0 var(--box-outline); |
| 102 | border-radius: var(--curve-sm); | 111 | border-radius: var(--curve-sm); |
| 103 | transition: all 0.2s ease-in-out; | 112 | transition: all 0.2s ease-in-out; |
| 104 | background: var(--background-form); | 113 | background: var(--background-form); |
| 105 | a { | 114 | a { |
| 106 | display: flex; | 115 | display: flex; |
| 107 | color: var(--foreground); | 116 | color: var(--foreground); |
| 108 | transition: all 0.2s ease-in-out; | 117 | transition: all 0.2s ease-in-out; |
| 109 | padding: 4px; | 118 | padding: 4px; |
| 110 | :global(svg) { | 119 | :global(svg) { |
| 111 | width: 2rem; | 120 | width: 2rem; |
| 112 | height: 2rem; | 121 | height: 2rem; |
| 113 | } | 122 | } |
| 114 | } | 123 | } |
| 115 | &:hover { | 124 | &:hover { |
| 116 | box-shadow: 3px 3px 0 var(--box-outline); | 125 | box-shadow: 3px 3px 0 var(--box-outline); |
| 117 | border-radius: var(--curve-md); | 126 | border-radius: var(--curve-md); |
| 118 | opacity: 1; | 127 | opacity: 1; |
| 119 | a { | 128 | a { |
| 120 | color: var(--color); | 129 | color: var(--color); |
| 121 | } | 130 | } |
| 122 | } | 131 | } |
| 123 | } | 132 | } |
| 124 | } | 133 | } |
| 125 | </style> | 134 | </style> |
| 126 | |||
web/src/components/form/ThemeSwitcher.svelte +1 −4
| @@ -28,7 +28,6 @@ | |||
| 28 | } | 28 | } |
| 29 | </script> | 29 | </script> |
| 30 | 30 | ||
| 31 | |||
| 32 | <!-- svelte-ignore a11y-click-events-have-key-events --> | 31 | <!-- svelte-ignore a11y-click-events-have-key-events --> |
| 33 | <!-- svelte-ignore a11y-no-static-element-interactions --> | 32 | <!-- svelte-ignore a11y-no-static-element-interactions --> |
| 34 | <div class="theme-switcher" on:click={toggleTheme}> | 33 | <div class="theme-switcher" on:click={toggleTheme}> |
| @@ -38,7 +37,6 @@ | |||
| 38 | </div> | 37 | </div> |
| 39 | </div> | 38 | </div> |
| 40 | 39 | ||
| 41 | |||
| 42 | <style lang="scss"> | 40 | <style lang="scss"> |
| 43 | .theme-switcher { | 41 | .theme-switcher { |
| 44 | cursor: pointer; | 42 | cursor: pointer; |
| @@ -52,7 +50,7 @@ | |||
| 52 | transition: background-color 0.3s ease; | 50 | transition: background-color 0.3s ease; |
| 53 | border: 2px solid var(--box-outline); | 51 | border: 2px solid var(--box-outline); |
| 54 | box-shadow: 3px 3px 0 var(--box-outline); | 52 | box-shadow: 3px 3px 0 var(--box-outline); |
| 55 | 53 | ||
| 56 | &:hover { | 54 | &:hover { |
| 57 | background-color: rgba(255, 255, 255, 0.3); | 55 | background-color: rgba(255, 255, 255, 0.3); |
| 58 | } | 56 | } |
| @@ -96,5 +94,4 @@ | |||
| 96 | display: flex; | 94 | display: flex; |
| 97 | font-size: 1.5rem; | 95 | font-size: 1.5rem; |
| 98 | } | 96 | } |
| 99 | |||
| 100 | </style> | 97 | </style> |
web/src/components/scafold/Footer.astro +16 −18
| @@ -1,23 +1,21 @@ | |||
| 1 | |||
| 2 | <footer> | 1 | <footer> |
| 3 | <a href="/about">Awesome Privacy</a> is licensed | 2 | <a href="/about">Awesome Privacy</a> is licensed under <a |
| 4 | under <a href="https://github.com/Lissy93/awesome-privacy/blob/main/LICENSE">MIT</a> | 3 | href="https://github.com/Lissy93/awesome-privacy/blob/main/LICENSE">MIT</a |
| 5 | © <a href="https://aliciasykes.com">Alicia Sykes</a> 2024 | | 4 | > |
| 6 | Source code available on <a href="https://github.com/Lissy93/awesome-privacy">GitHub</a> | 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> | ||
| 7 | </footer> | 7 | </footer> |
| 8 | 8 | ||
| 9 | <style lang="scss"> | 9 | <style lang="scss"> |
| 10 | footer { | 10 | footer { |
| 11 | font-family: "Lekton", sans-serif; | 11 | font-family: 'Lekton', sans-serif; |
| 12 | font-weight: bold; | 12 | font-weight: bold; |
| 13 | text-align: center; | 13 | text-align: center; |
| 14 | padding: 0.5rem 0; | 14 | padding: 0.5rem 0; |
| 15 | margin: 0 auto; | 15 | margin: 0 auto; |
| 16 | a { | 16 | a { |
| 17 | font-family: "Lekton", sans-serif; | 17 | font-family: 'Lekton', sans-serif; |
| 18 | color: var(--accent); | 18 | color: var(--accent); |
| 19 | } | 19 | } |
| 20 | 20 | } | |
| 21 | |||
| 22 | } | ||
| 23 | </style> | 21 | </style> |
web/src/components/scafold/MainCard.astro +3 −5
| @@ -1,7 +1,5 @@ | |||
| 1 | |||
| 2 | |||
| 3 | <main> | 1 | <main> |
| 4 | <slot /> | 2 | <slot /> |
| 5 | </main> | 3 | </main> |
| 6 | 4 | ||
| 7 | <style lang="scss"> | 5 | <style lang="scss"> |
| @@ -11,8 +9,8 @@ | |||
| 11 | width: 1200px; | 9 | width: 1200px; |
| 12 | max-width: calc(100% - 5rem); | 10 | max-width: calc(100% - 5rem); |
| 13 | border: 2px solid var(--box-outline); | 11 | border: 2px solid var(--box-outline); |
| 14 | box-shadow: 6px 6px 0 var(--box-outline); | 12 | box-shadow: 6px 6px 0 var(--box-outline); |
| 15 | background: var(--accent-fg); | 13 | background: var(--accent-fg); |
| 16 | position: relative; | 14 | position: relative; |
| 17 | } | 15 | } |
| 18 | </style> | 16 | </style> |
web/src/components/scafold/NavBar.astro +100 −95
| @@ -1,106 +1,111 @@ | |||
| 1 | --- | 1 | --- |
| 2 | import FontAwesome from "@components/form/FontAwesome.svelte" | 2 | import FontAwesome from '@components/form/FontAwesome.svelte'; |
| 3 | import ThemeSwitcher from "@components/form/ThemeSwitcher.svelte" | 3 | import ThemeSwitcher from '@components/form/ThemeSwitcher.svelte'; |
| 4 | |||
| 5 | --- | 4 | --- |
| 6 | 5 | ||
| 7 | <div class="nav"> | 6 | <div class="nav"> |
| 8 | <a href="/" class="homepage"> | 7 | <a href="/" class="homepage"> |
| 9 | <FontAwesome iconName="logo" /> | 8 | <FontAwesome iconName="logo" /> |
| 10 | <h1>Awesome Privacy</h1> | 9 | <h1>Awesome Privacy</h1> |
| 11 | </a> | 10 | </a> |
| 12 | <nav> | 11 | <nav> |
| 13 | <a href="/browse">Browse</a> | 12 | <a href="/browse">Browse</a> |
| 14 | <a href="/search">Search</a> | 13 | <a href="/search">Search</a> |
| 15 | <a href="/about">About</a> | 14 | <a href="/about">About</a> |
| 16 | <a href="https://github.com/lissy93/awesome-privacy">GitHub</a> | 15 | <a href="https://github.com/lissy93/awesome-privacy">GitHub</a> |
| 17 | <div class="theme-switcher"> | 16 | <div class="theme-switcher"> |
| 18 | <ThemeSwitcher client:load /> | 17 | <ThemeSwitcher client:load /> |
| 19 | </div> | 18 | </div> |
| 20 | </nav> | 19 | </nav> |
| 21 | </div> | 20 | </div> |
| 22 | 21 | ||
| 23 | <style lang="scss"> | 22 | <style lang="scss"> |
| 24 | .nav { | 23 | .nav { |
| 25 | background: var(--accent-fg); | 24 | background: var(--accent-fg); |
| 26 | display: flex; | 25 | display: flex; |
| 27 | justify-content: space-between; | 26 | justify-content: space-between; |
| 28 | align-items: center; | 27 | align-items: center; |
| 29 | flex-wrap: wrap; | 28 | flex-wrap: wrap; |
| 30 | gap: 1rem; | 29 | gap: 1rem; |
| 31 | border-bottom: 2px solid var(--accent-3); | 30 | 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 | } | ||
| 58 | 31 | ||
| 59 | nav { | 32 | .homepage { |
| 60 | display: flex; | 33 | text-decoration: none; |
| 61 | align-items: center; | 34 | display: flex; |
| 62 | height: 3rem; | 35 | align-items: center; |
| 63 | a { | 36 | padding: 0 0.5rem; |
| 64 | padding: 1rem; | 37 | h1 { |
| 65 | font-size: 1.2rem; | 38 | margin: 0; |
| 66 | font-family: "Lekton", sans-serif; | 39 | font-size: 2.4rem; |
| 67 | font-weight: bold; | 40 | padding: 0 1rem; |
| 68 | color: var(--foreground); | 41 | color: var(--foreground); |
| 69 | transition: background 0.3s, transform 0.3s, box-shadow 0.3s; | 42 | font-family: 'Lekton', sans-serif; |
| 70 | transition-timing-function: ease-in-out; | 43 | } |
| 71 | &:hover { | 44 | :global(svg) { |
| 72 | background: var(--accent-3); | 45 | width: 2.5rem; |
| 73 | color: var(--accent-fg); | 46 | height: 2.5rem; |
| 74 | border-bottom: 2px solid var(--accent-3); | 47 | color: var(--accent-3); |
| 75 | &:nth-child(4n+1) { | 48 | transition: all 0.2s ease-in-out; |
| 76 | background-color: var(--accent); | 49 | } |
| 77 | } | 50 | &:hover { |
| 78 | &:nth-child(4n+2) { | 51 | :global(svg) { |
| 79 | background-color: var(--accent-2); | 52 | color: var(--accent); |
| 80 | color: var(--foreground); | 53 | transform: scale(1.05); |
| 81 | } | 54 | } |
| 82 | &:nth-child(4n+3) { | 55 | } |
| 83 | background-color: var(--accent-3); | 56 | } |
| 84 | } | 57 | |
| 85 | &:nth-child(4n+4) { | 58 | nav { |
| 86 | background-color: var(--accent-4); | 59 | display: flex; |
| 87 | color: var(--foreground); | 60 | align-items: center; |
| 88 | } | 61 | height: 3rem; |
| 89 | } | 62 | a { |
| 90 | } | 63 | padding: 1rem; |
| 91 | .theme-switcher { | 64 | font-size: 1.2rem; |
| 92 | transform: scale(0.7); | 65 | font-family: 'Lekton', sans-serif; |
| 93 | margin: 0.2rem auto; | 66 | font-weight: bold; |
| 94 | @media(max-width: 768px) { | 67 | color: var(--foreground); |
| 95 | display: none; | 68 | transition: |
| 96 | } | 69 | background 0.3s, |
| 97 | } | 70 | transform 0.3s, |
| 98 | } | 71 | box-shadow 0.3s; |
| 99 | .homepage, nav { | 72 | transition-timing-function: ease-in-out; |
| 100 | @media(max-width: 768px) { | 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) { | ||
| 101 | margin: 0 auto; | 104 | margin: 0 auto; |
| 102 | a { border: none; } | 105 | a { |
| 106 | border: none; | ||
| 107 | } | ||
| 103 | } | 108 | } |
| 104 | } | 109 | } |
| 105 | } | 110 | } |
| 106 | </style> | 111 | </style> |
web/src/components/things/AddNewService.svelte +184 −75
| @@ -23,11 +23,11 @@ | |||
| 23 | let codeBlock: any; | 23 | let codeBlock: any; |
| 24 | let interactiveActivated = false; | 24 | let interactiveActivated = false; |
| 25 | 25 | ||
| 26 | $: yamlText, updateHighlighting(); | 26 | $: (yamlText, updateHighlighting()); |
| 27 | 27 | ||
| 28 | function updateHighlighting() { | 28 | function updateHighlighting() { |
| 29 | if (codeBlock) { | 29 | if (codeBlock) { |
| 30 | codeBlock.textContent = yamlText | 30 | codeBlock.textContent = yamlText; |
| 31 | codeBlock.dataset.highlighted && delete codeBlock.dataset.highlighted; | 31 | codeBlock.dataset.highlighted && delete codeBlock.dataset.highlighted; |
| 32 | if (window && (window as any).hljs) { | 32 | if (window && (window as any).hljs) { |
| 33 | (window as any).hljs.highlightElement(codeBlock); | 33 | (window as any).hljs.highlightElement(codeBlock); |
| @@ -38,15 +38,17 @@ | |||
| 38 | 38 | ||
| 39 | const filterEmptyValues = (obj: Record<string, any>) => { | 39 | const filterEmptyValues = (obj: Record<string, any>) => { |
| 40 | const filteredObj: Record<string, any> = {}; | 40 | const filteredObj: Record<string, any> = {}; |
| 41 | Object.keys(obj).forEach(key => { | 41 | Object.keys(obj).forEach((key) => { |
| 42 | if (obj[key] || ['name', 'url', 'icon', 'description'].includes(key)) { | 42 | if (obj[key] || ['name', 'url', 'icon', 'description'].includes(key)) { |
| 43 | filteredObj[key] = obj[key]; | 43 | filteredObj[key] = obj[key]; |
| 44 | } | 44 | } |
| 45 | }); | 45 | }); |
| 46 | return filteredObj; | 46 | return filteredObj; |
| 47 | } | 47 | }; |
| 48 | 48 | ||
| 49 | $: yamlText = yaml.dump([{ | 49 | $: yamlText = yaml.dump( |
| 50 | [ | ||
| 51 | { | ||
| 50 | name: $serviceName, | 52 | name: $serviceName, |
| 51 | url: $serviceUrl, | 53 | url: $serviceUrl, |
| 52 | icon: $serviceIcon, | 54 | icon: $serviceIcon, |
| @@ -60,9 +62,12 @@ | |||
| 60 | openSource: $serviceOpenSource, | 62 | openSource: $serviceOpenSource, |
| 61 | securityAudited: $serviceSecurityAudited, | 63 | securityAudited: $serviceSecurityAudited, |
| 62 | acceptsCrypto: $serviceCrypto, | 64 | acceptsCrypto: $serviceCrypto, |
| 63 | }].map(obj => filterEmptyValues(obj))); | 65 | }, |
| 66 | ].map((obj) => filterEmptyValues(obj)), | ||
| 67 | ); | ||
| 64 | 68 | ||
| 65 | $: issueUrl = makeAdditionRequest({ | 69 | $: issueUrl = makeAdditionRequest( |
| 70 | { | ||
| 66 | listingCategory: $listingCategory, | 71 | listingCategory: $listingCategory, |
| 67 | serviceName: $serviceName, | 72 | serviceName: $serviceName, |
| 68 | serviceUrl: $serviceUrl, | 73 | serviceUrl: $serviceUrl, |
| @@ -78,7 +83,9 @@ | |||
| 78 | serviceSecurityAudited: $serviceSecurityAudited, | 83 | serviceSecurityAudited: $serviceSecurityAudited, |
| 79 | serviceCrypto: $serviceCrypto, | 84 | serviceCrypto: $serviceCrypto, |
| 80 | additionalInfo: $additionalInfo, | 85 | additionalInfo: $additionalInfo, |
| 81 | }, yamlText); | 86 | }, |
| 87 | yamlText, | ||
| 88 | ); | ||
| 82 | 89 | ||
| 83 | // Form submission handler | 90 | // Form submission handler |
| 84 | function handleSubmit() { | 91 | function handleSubmit() { |
| @@ -87,29 +94,39 @@ | |||
| 87 | </script> | 94 | </script> |
| 88 | 95 | ||
| 89 | <svelte:head> | 96 | <svelte:head> |
| 90 | <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/an-old-hope.min.css"> | 97 | <link |
| 91 | <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script> | 98 | rel="stylesheet" |
| 92 | <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/yaml.min.js"></script> | 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> | ||
| 93 | </svelte:head> | 107 | </svelte:head> |
| 94 | 108 | ||
| 95 | <p> | 109 | <p> |
| 96 | Before completing this form, you must ensure that the service you are adding aligns | 110 | Before completing this form, you must ensure that the service you are adding |
| 97 | with the <a href="/about#creteria">Requirements</a> for Awesome Privacy. | 111 | aligns with the <a href="/about#creteria">Requirements</a> for Awesome |
| 112 | Privacy. | ||
| 98 | <br /> | 113 | <br /> |
| 99 | You'll need a GitHub account in order to submit this form. | 114 | You'll need a GitHub account in order to submit this form. |
| 100 | </p> | 115 | </p> |
| 101 | 116 | ||
| 102 | <form on:submit|preventDefault={handleSubmit}> | 117 | <form on:submit|preventDefault={handleSubmit}> |
| 103 | |||
| 104 | <h3>Basics</h3> | 118 | <h3>Basics</h3> |
| 105 | <p class="sub-title-description"> | 119 | <p class="sub-title-description">All fields here are required.</p> |
| 106 | All fields here are required. | ||
| 107 | </p> | ||
| 108 | 120 | ||
| 109 | <!-- Category Dropdown --> | 121 | <!-- Category Dropdown --> |
| 110 | <div class="form-row"> | 122 | <div class="form-row"> |
| 111 | <label for="listing-category">Category</label> | 123 | <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 | > | ||
| 113 | <option value="">--Please choose an option--</option> | 130 | <option value="">--Please choose an option--</option> |
| 114 | <option value="Essentials">Essentials</option> | 131 | <option value="Essentials">Essentials</option> |
| 115 | <option value="Communication">Communication</option> | 132 | <option value="Communication">Communication</option> |
| @@ -126,45 +143,78 @@ | |||
| 126 | <option value="Creativity">Creativity</option> | 143 | <option value="Creativity">Creativity</option> |
| 127 | </select> | 144 | </select> |
| 128 | <p> | 145 | <p> |
| 129 | Choose the top-level category, which should align with | 146 | Choose the top-level category, which should align with the <a |
| 130 | the <a href="/browse">one of these</a>. | 147 | href="/browse">one of these</a |
| 148 | >. | ||
| 131 | </p> | 149 | </p> |
| 132 | </div> | 150 | </div> |
| 133 | 151 | ||
| 134 | <!-- Listing Name --> | 152 | <!-- Listing Name --> |
| 135 | <div class="form-row"> | 153 | <div class="form-row"> |
| 136 | <label for="service-name">Listing Name</label> | 154 | <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 | /> | ||
| 138 | <p>Enter the name of the app, software or service</p> | 162 | <p>Enter the name of the app, software or service</p> |
| 139 | </div> | 163 | </div> |
| 140 | 164 | ||
| 141 | <!-- Listing URL --> | 165 | <!-- Listing URL --> |
| 142 | <div class="form-row"> | 166 | <div class="form-row"> |
| 143 | <label for="service-url">Listing URL</label> | 167 | <label for="service-url">Listing URL</label> |
| 144 | <input type="url" bind:value={$serviceUrl} id="service-url" required autocomplete="off"> | 168 | <input |
| 145 | <p>Enter the fully-qualified domain name of the homepage for this listing</p> | 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> | ||
| 146 | </div> | 178 | </div> |
| 147 | 179 | ||
| 148 | <!-- Listing Icon --> | 180 | <!-- Listing Icon --> |
| 149 | <div class="form-row"> | 181 | <div class="form-row"> |
| 150 | <label for="service-icon">Listing Icon</label> | 182 | <label for="service-icon">Listing Icon</label> |
| 151 | <input type="url" bind:value={$serviceIcon} id="service-icon" required autocomplete="off"> | 183 | <input |
| 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> | 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> | ||
| 153 | </div> | 194 | </div> |
| 154 | 195 | ||
| 155 | <!-- Listing Description --> | 196 | <!-- Listing Description --> |
| 156 | <div class="form-row"> | 197 | <div class="form-row"> |
| 157 | <label for="service-description">Listing Description</label> | 198 | <label for="service-description">Listing Description</label> |
| 158 | <textarea bind:value={$serviceDescription} id="service-description" required autocomplete="off"></textarea> | 199 | <textarea |
| 159 | <p>Please provide a description for this listing. Keep it factual and objective. Markdown is supported.</p> | 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> | ||
| 160 | </div> | 209 | </div> |
| 161 | 210 | ||
| 162 | <!-- Section 2 --> | 211 | <!-- Section 2 --> |
| 163 | <h3>Third-Party Referencing</h3> | 212 | <h3>Third-Party Referencing</h3> |
| 164 | <p class="sub-title-description"> | 213 | <p class="sub-title-description"> |
| 165 | In order to create a comprehensive listing, we combine the data inputted above with other sources, | 214 | In order to create a comprehensive listing, we combine the data inputted |
| 166 | to give additional context and help users make informed decisions. | 215 | above with other sources, to give additional context and help users make |
| 167 | Metrics from these services are fetched automatically at build-time from our API. | 216 | informed decisions. Metrics from these services are fetched automatically at |
| 217 | build-time from our API. | ||
| 168 | <br /> | 218 | <br /> |
| 169 | All fields are optional, but the more information you provide, the better! | 219 | All fields are optional, but the more information you provide, the better! |
| 170 | </p> | 220 | </p> |
| @@ -172,7 +222,13 @@ | |||
| 172 | <!-- GitHub Repository --> | 222 | <!-- GitHub Repository --> |
| 173 | <div class="form-row"> | 223 | <div class="form-row"> |
| 174 | <label for="service-github">GitHub Repository</label> | 224 | <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 | /> | ||
| 176 | <p> | 232 | <p> |
| 177 | Share a link to where the project's source is located.<br /> | 233 | Share a link to where the project's source is located.<br /> |
| 178 | Use the format [user]/[repo] e.g, lissy93/dashy | 234 | Use the format [user]/[repo] e.g, lissy93/dashy |
| @@ -182,18 +238,29 @@ | |||
| 182 | <!-- ToS;DR ID --> | 238 | <!-- ToS;DR ID --> |
| 183 | <div class="form-row"> | 239 | <div class="form-row"> |
| 184 | <label for="service-tosdr-id">ToS;DR ID</label> | 240 | <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 | /> | ||
| 186 | <p> | 247 | <p> |
| 187 | Has the Privacy policy been documented by <a href="https://tosdr.org/">tosdr.org</a>? | 248 | Has the Privacy policy been documented by <a href="https://tosdr.org/" |
| 188 | If so, please include the report reference below (this is a 3 or 4-digit numerical ID). | 249 | >tosdr.org</a |
| 189 | Skip section if not applicable. | 250 | >? If so, please include the report reference below (this is a 3 or |
| 251 | 4-digit numerical ID). Skip section if not applicable. | ||
| 190 | </p> | 252 | </p> |
| 191 | </div> | 253 | </div> |
| 192 | 254 | ||
| 193 | <!-- Apple App Store URL --> | 255 | <!-- Apple App Store URL --> |
| 194 | <div class="form-row"> | 256 | <div class="form-row"> |
| 195 | <label for="service-tosdr-id">iOS App</label> | 257 | <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 | /> | ||
| 197 | <p> | 264 | <p> |
| 198 | Paste the link to the mobile app on the Apple App Store.<br /> | 265 | Paste the link to the mobile app on the Apple App Store.<br /> |
| 199 | E.g. https://apps.apple.com/us/app/bitwarden-password-manager/id1137397744 | 266 | E.g. https://apps.apple.com/us/app/bitwarden-password-manager/id1137397744 |
| @@ -203,7 +270,12 @@ | |||
| 203 | <!-- Google Play App Store URL --> | 270 | <!-- Google Play App Store URL --> |
| 204 | <div class="form-row"> | 271 | <div class="form-row"> |
| 205 | <label for="service-tosdr-id">Android App</label> | 272 | <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 | /> | ||
| 207 | <p> | 279 | <p> |
| 208 | Paste the link to the mobile app on the Google Play Store.<br /> | 280 | Paste the link to the mobile app on the Google Play Store.<br /> |
| 209 | E.g. https://play.google.com/store/apps/details?id=com.x8bit.bitwarden | 281 | E.g. https://play.google.com/store/apps/details?id=com.x8bit.bitwarden |
| @@ -213,17 +285,28 @@ | |||
| 213 | <!-- Discord Server Invite Code --> | 285 | <!-- Discord Server Invite Code --> |
| 214 | <div class="form-row"> | 286 | <div class="form-row"> |
| 215 | <label for="service-tosdr-id">Discord Invite</label> | 287 | <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 | /> | ||
| 217 | <p> | 294 | <p> |
| 218 | Paste the invite code to the Discord server for this service.<br /> | 295 | 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 | ||
| 220 | </p> | 298 | </p> |
| 221 | </div> | 299 | </div> |
| 222 | 300 | ||
| 223 | <!-- Reddit sub name --> | 301 | <!-- Reddit sub name --> |
| 224 | <div class="form-row"> | 302 | <div class="form-row"> |
| 225 | <label for="service-tosdr-id">Subreddit</label> | 303 | <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 | /> | ||
| 227 | <p> | 310 | <p> |
| 228 | If the service has a subreddit, please provide the name here.<br /> | 311 | If the service has a subreddit, please provide the name here.<br /> |
| 229 | Don't include `r/` in the name, nor the full URL - just the sub name. | 312 | Don't include `r/` in the name, nor the full URL - just the sub name. |
| @@ -233,70 +316,94 @@ | |||
| 233 | <!-- Section 3 - Checklist and details --> | 316 | <!-- Section 3 - Checklist and details --> |
| 234 | <h3>Privacy Checklist</h3> | 317 | <h3>Privacy Checklist</h3> |
| 235 | <p class="sub-title-description"> | 318 | <p class="sub-title-description"> |
| 236 | Finally, check the boxes that apply to the service you are submitting, | 319 | Finally, check the boxes that apply to the service you are submitting, and |
| 237 | and then provide any additional information to back this up in the text area below. | 320 | then provide any additional information to back this up in the text area |
| 321 | below. | ||
| 238 | </p> | 322 | </p> |
| 239 | 323 | ||
| 240 | <!-- Open Source Checkbox --> | 324 | <!-- Open Source Checkbox --> |
| 241 | <div class="form-row"> | 325 | <div class="form-row"> |
| 242 | <label for="service-open-source">Is Open Source?</label> | 326 | <label for="service-open-source">Is Open Source?</label> |
| 243 | <input type="checkbox" bind:checked={$serviceOpenSource} id="service-open-source"> | 327 | <input |
| 244 | <p>Is this service fully open source? Aka, can it be compiled from source by the user, or self-hosted?</p> | 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> | ||
| 245 | </div> | 336 | </div> |
| 246 | 337 | ||
| 247 | <!-- Security Audited Checkbox --> | 338 | <!-- Security Audited Checkbox --> |
| 248 | <div class="form-row"> | 339 | <div class="form-row"> |
| 249 | <label for="service-security-audited">Security Audited?</label> | 340 | <label for="service-security-audited">Security Audited?</label> |
| 250 | <input type="checkbox" bind:checked={$serviceSecurityAudited} id="service-security-audited"> | 341 | <input |
| 251 | <p>Has this service been independently security audited by an accredited auditor?</p> | 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> | ||
| 252 | </div> | 350 | </div> |
| 253 | 351 | ||
| 254 | <!-- Accepts Crypto Checkbox --> | 352 | <!-- Accepts Crypto Checkbox --> |
| 255 | <div class="form-row"> | 353 | <div class="form-row"> |
| 256 | <label for="service-crypto">Accepts Anon Payment?</label> | 354 | <label for="service-crypto">Accepts Anon Payment?</label> |
| 257 | <input type="checkbox" bind:checked={$serviceCrypto} id="service-crypto"> | 355 | <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> | 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> | ||
| 259 | </div> | 360 | </div> |
| 260 | 361 | ||
| 261 | <div class="final-info"> | 362 | <div class="final-info"> |
| 262 | <p> | 363 | <p>Finally, please provide any supporting material, including:</p> |
| 263 | Finally, please provide any supporting material, including: | ||
| 264 | </p> | ||
| 265 | <ul> | 364 | <ul> |
| 266 | <li> | 365 | <li> |
| 267 | A justification of why this app/service should be included in the list | 366 | A justification of why this app/service should be included in the list |
| 268 | </li> | 367 | </li> |
| 368 | <li>Links to any published security audit, if they exist</li> | ||
| 269 | <li> | 369 | <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 | ||
| 271 | </li> | 372 | </li> |
| 272 | <li> | 373 | <li> |
| 273 | Links to the services privacy policy, terms of service and other relevant | 374 | Your affiliation with the service. For transparency, you must disclose |
| 274 | documents where applicable | 375 | if you are associated with them or any similar items in any way |
| 275 | </li> | 376 | </li> |
| 276 | <li> | 377 | <li> |
| 277 | Your affiliation with the service. | 378 | Links to relevant discussions, past issues/PRs related to this service |
| 278 | For transparency, you must disclose if you are associated | ||
| 279 | with them or any similar items in any way | ||
| 280 | </li> | 379 | </li> |
| 281 | <li>Links to relevant discussions, past issues/PRs related to this service</li> | ||
| 282 | </ul> | 380 | </ul> |
| 283 | <textarea bind:value={$additionalInfo} id="additional-info" rows="5"></textarea> | 381 | <textarea bind:value={$additionalInfo} id="additional-info" rows="5" |
| 382 | ></textarea> | ||
| 284 | </div> | 383 | </div> |
| 285 | 384 | ||
| 286 | <button type="submit">Submit</button> | 385 | <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 | > | ||
| 288 | </form> | 388 | </form> |
| 289 | 389 | ||
| 290 | <div class="output-yaml"> | 390 | <div class="output-yaml"> |
| 291 | <p>Below is the YAML content, which will be appended to the appropriate section | 391 | <p> |
| 292 | within <a href="github.com/lissy93/awesome-privacy/blob/main/awesome-privacy.yml">awesome-privacy.yml</a> | 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 | > | ||
| 293 | upon approval. | 397 | upon approval. |
| 294 | </p> | 398 | </p> |
| 295 | {#if !interactiveActivated || !codeBlock} | 399 | {#if !interactiveActivated || !codeBlock} |
| 296 | <pre><code class="language-yaml">{@html yamlText}</code></pre> | 400 | <pre><code class="language-yaml">{@html yamlText}</code></pre> |
| 297 | {/if} | 401 | {/if} |
| 298 | <pre><code bind:this={codeBlock} class="language-yaml"></code></pre> | 402 | <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> | ||
| 300 | </div> | 407 | </div> |
| 301 | 408 | ||
| 302 | <style lang="scss"> | 409 | <style lang="scss"> |
| @@ -332,7 +439,9 @@ | |||
| 332 | } | 439 | } |
| 333 | } | 440 | } |
| 334 | 441 | ||
| 335 | input, textarea, select { | 442 | input, |
| 443 | textarea, | ||
| 444 | select { | ||
| 336 | width: 100%; | 445 | width: 100%; |
| 337 | border: 1px solid var(--accent-3); | 446 | border: 1px solid var(--accent-3); |
| 338 | border-radius: var(--curve-md); | 447 | border-radius: var(--curve-md); |
| @@ -347,15 +456,15 @@ | |||
| 347 | } | 456 | } |
| 348 | input { | 457 | input { |
| 349 | height: fit-content; | 458 | height: fit-content; |
| 350 | &[type="number"]::-webkit-outer-spin-button, | 459 | &[type='number']::-webkit-outer-spin-button, |
| 351 | &[type="number"]::-webkit-inner-spin-button { | 460 | &[type='number']::-webkit-inner-spin-button { |
| 352 | -webkit-appearance: none; | 461 | -webkit-appearance: none; |
| 353 | margin: 0; | 462 | margin: 0; |
| 354 | } | 463 | } |
| 355 | &[type="number"] { | 464 | &[type='number'] { |
| 356 | -moz-appearance: textfield; | 465 | -moz-appearance: textfield; |
| 357 | } | 466 | } |
| 358 | &[type="checkbox"] { | 467 | &[type='checkbox'] { |
| 359 | width: 2rem; | 468 | width: 2rem; |
| 360 | height: 2rem; | 469 | height: 2rem; |
| 361 | background: var(--background-form); | 470 | background: var(--background-form); |
| @@ -381,7 +490,7 @@ | |||
| 381 | box-shadow: 3px 3px 0 var(--box-outline); | 490 | box-shadow: 3px 3px 0 var(--box-outline); |
| 382 | border-radius: var(--curve-lg); | 491 | border-radius: var(--curve-lg); |
| 383 | font-size: 1.8rem; | 492 | font-size: 1.8rem; |
| 384 | font-family: "Lekton", sans-serif; | 493 | font-family: 'Lekton', sans-serif; |
| 385 | margin: 1rem auto; | 494 | margin: 1rem auto; |
| 386 | display: flex; | 495 | display: flex; |
| 387 | transition: all 0.2s ease-in-out; | 496 | transition: all 0.2s ease-in-out; |
web/src/components/things/AndroidDetailedInfo.astro +162 −154
| @@ -1,170 +1,178 @@ | |||
| 1 | --- | 1 | --- |
| 2 | |||
| 3 | import type { AndroidInfo } from '@utils/fetch-android-info'; | 2 | import type { AndroidInfo } from '@utils/fetch-android-info'; |
| 4 | import { formatDate, timeAgo } from '@utils/dates-n-stuff'; | 3 | import { formatDate, timeAgo } from '@utils/dates-n-stuff'; |
| 5 | import FontAwesome from "@components/form/FontAwesome.svelte" | 4 | import FontAwesome from '@components/form/FontAwesome.svelte'; |
| 6 | |||
| 7 | 5 | ||
| 8 | interface Props { | 6 | interface Props { |
| 9 | androidData: AndroidInfo; | 7 | androidData: AndroidInfo; |
| 10 | }; | 8 | } |
| 11 | 9 | ||
| 12 | const { androidData } = Astro.props; | 10 | const { androidData } = Astro.props; |
| 13 | 11 | ||
| 14 | function permissionToReadable(permission: string): string { | 12 | function permissionToReadable(permission: string): string { |
| 15 | return (permission | 13 | return (permission.split('.').pop() || '') |
| 16 | .split('.') | 14 | .replace(/_/g, ' ') |
| 17 | .pop() || '') | 15 | .toLowerCase() |
| 18 | .replace(/_/g, ' ') | 16 | .split(' ') |
| 19 | .toLowerCase() | 17 | .map((word) => word.charAt(0).toUpperCase() + word.slice(1)) |
| 20 | .split(' ') | 18 | .join(' '); |
| 21 | .map(word => word.charAt(0).toUpperCase() + word.slice(1)) | ||
| 22 | .join(' ') | ||
| 23 | } | 19 | } |
| 24 | |||
| 25 | |||
| 26 | --- | 20 | --- |
| 27 | 21 | ||
| 28 | <div class="android-info-wrapper"> | 22 | <div class="android-info-wrapper"> |
| 29 | <div class="left"> | 23 | <div class="left"> |
| 30 | <h4>Update Info</h4> | 24 | <h4>Update Info</h4> |
| 31 | <ul class="list-table"> | 25 | <ul class="list-table"> |
| 32 | <li> | 26 | <li> |
| 33 | <span class="lbl">App</span> | 27 | <span class="lbl">App</span> |
| 34 | <span class="val"> | 28 | <span class="val"> |
| 35 | <!-- <img width="20" src={`https://reports.exodus-privacy.eu.org/en/reports/${androidData.version_code}/icon`} alt="Android Icon" /> --> | 29 | <!-- <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> | 30 | <a |
| 37 | </span> | 31 | href={`https://play.google.com/store/apps/details?id=${androidData.handle}`} |
| 38 | </li> | 32 | >{androidData.app_name}</a |
| 39 | <li> | 33 | > |
| 40 | <span class="lbl">Creation Date</span> | 34 | </span> |
| 41 | <span class="val">{formatDate(androidData.created)}</span> | 35 | </li> |
| 42 | </li> | 36 | <li> |
| 43 | <li> | 37 | <span class="lbl">Creation Date</span> |
| 44 | <span class="lbl">Last Updated</span> | 38 | <span class="val">{formatDate(androidData.created)}</span> |
| 45 | <span class="val">{formatDate(androidData.updated)}</span> | 39 | </li> |
| 46 | </li> | 40 | <li> |
| 47 | <li> | 41 | <span class="lbl">Last Updated</span> |
| 48 | <span class="lbl">Current Version</span> | 42 | <span class="val">{formatDate(androidData.updated)}</span> |
| 49 | <span class="val">{androidData.version_name}</span> | 43 | </li> |
| 50 | </li> | 44 | <li> |
| 51 | {androidData.creator && ( | 45 | <span class="lbl">Current Version</span> |
| 52 | <li> | 46 | <span class="val">{androidData.version_name}</span> |
| 53 | <span class="lbl">Creator</span> | 47 | </li> |
| 54 | <span class="val">{androidData.creator}</span> | 48 | { |
| 55 | </li> | 49 | androidData.creator && ( |
| 56 | )} | 50 | <li> |
| 57 | {androidData.downloads && ( | 51 | <span class="lbl">Creator</span> |
| 58 | <li> | 52 | <span class="val">{androidData.creator}</span> |
| 59 | <span class="lbl">Downloads</span> | 53 | </li> |
| 60 | <span class="val">{androidData.downloads}</span> | 54 | ) |
| 61 | </li> | 55 | } |
| 62 | )} | 56 | { |
| 63 | </ul> | 57 | androidData.downloads && ( |
| 64 | 58 | <li> | |
| 65 | <h4>Trackers</h4> | 59 | <span class="lbl">Downloads</span> |
| 66 | {(androidData.trackers || []).length === 0 && ( | 60 | <span class="val">{androidData.downloads}</span> |
| 67 | <p class="all-good"> | 61 | </li> |
| 68 | <FontAwesome iconName="noTrackers" /> | 62 | ) |
| 69 | No trackers found | 63 | } |
| 70 | </p> | 64 | </ul> |
| 71 | )} | 65 | |
| 72 | <ul class="list"> | 66 | <h4>Trackers</h4> |
| 73 | {(androidData.trackers || []).map((track) => ( | 67 | { |
| 74 | <li title={track.code_signature}>{track.name}</li> | 68 | (androidData.trackers || []).length === 0 && ( |
| 75 | ))} | 69 | <p class="all-good"> |
| 76 | </ul> | 70 | <FontAwesome iconName="noTrackers" /> |
| 77 | </div> | 71 | No trackers found |
| 78 | 72 | </p> | |
| 79 | <div class="right"> | 73 | ) |
| 80 | <h4>Permissions</h4> | 74 | } |
| 81 | {(androidData.permissions || []).length === 0 && ( | 75 | <ul class="list"> |
| 82 | <p class="all-good"> | 76 | { |
| 83 | <FontAwesome iconName="noTrackers" /> | 77 | (androidData.trackers || []).map((track) => ( |
| 84 | No permissions required | 78 | <li title={track.code_signature}>{track.name}</li> |
| 85 | </p> | 79 | )) |
| 86 | )} | 80 | } |
| 87 | <ul class="list"> | 81 | </ul> |
| 88 | {(androidData.permissions || []).map((perm) => ( | 82 | </div> |
| 89 | <li title={perm}>{permissionToReadable(perm)}</li> | 83 | |
| 90 | ))} | 84 | <div class="right"> |
| 91 | </ul> | 85 | <h4>Permissions</h4> |
| 92 | </div> | 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> | ||
| 93 | </div> | 102 | </div> |
| 94 | 103 | ||
| 95 | |||
| 96 | <style lang="scss"> | 104 | <style lang="scss"> |
| 97 | .android-info-wrapper { | 105 | .android-info-wrapper { |
| 98 | display: flex; | 106 | display: flex; |
| 99 | flex-wrap: wrap; | 107 | flex-wrap: wrap; |
| 100 | justify-content: space-between; | 108 | justify-content: space-between; |
| 101 | gap: 1rem; | 109 | gap: 1rem; |
| 102 | .left, .right { | 110 | .left, |
| 103 | width: calc(50% - 1rem); | 111 | .right { |
| 104 | @media screen and (max-width: 768px){ | 112 | width: calc(50% - 1rem); |
| 105 | width: 100%; | 113 | @media screen and (max-width: 768px) { |
| 106 | } | 114 | width: 100%; |
| 107 | } | 115 | } |
| 108 | } | 116 | } |
| 109 | 117 | } | |
| 110 | h3 { | 118 | |
| 111 | margin: 0; | 119 | h3 { |
| 112 | font-size: 1.6rem; | 120 | margin: 0; |
| 113 | } | 121 | font-size: 1.6rem; |
| 114 | 122 | } | |
| 115 | h4 { | 123 | |
| 116 | margin: 1rem 0 0 0; | 124 | h4 { |
| 117 | font-size: 1.2rem; | 125 | margin: 1rem 0 0 0; |
| 118 | } | 126 | font-size: 1.2rem; |
| 119 | 127 | } | |
| 120 | ul { | 128 | |
| 121 | padding-left: 0; | 129 | ul { |
| 122 | list-style: none; | 130 | padding-left: 0; |
| 123 | max-height: 300px; | 131 | list-style: none; |
| 124 | overflow-y: auto; | 132 | max-height: 300px; |
| 125 | overflow-x: hidden; | 133 | overflow-y: auto; |
| 126 | img { | 134 | overflow-x: hidden; |
| 127 | border-radius: var(--curve-sm); | 135 | img { |
| 128 | } | 136 | border-radius: var(--curve-sm); |
| 129 | .list-item { | 137 | } |
| 130 | display: flex; | 138 | .list-item { |
| 131 | flex-direction: column; | 139 | display: flex; |
| 132 | margin-bottom: 0.5rem; | 140 | flex-direction: column; |
| 133 | } | 141 | margin-bottom: 0.5rem; |
| 134 | &.list-table { | 142 | } |
| 135 | font-size: 0.9rem; | 143 | &.list-table { |
| 136 | padding-left: 0; | 144 | font-size: 0.9rem; |
| 137 | li { | 145 | padding-left: 0; |
| 138 | display: flex; | 146 | li { |
| 139 | justify-content: space-between; | 147 | display: flex; |
| 140 | padding: 0.1rem 0; | 148 | justify-content: space-between; |
| 141 | .lbl { | 149 | padding: 0.1rem 0; |
| 142 | font-weight: 400; | 150 | .lbl { |
| 143 | } | 151 | font-weight: 400; |
| 144 | .val { | 152 | } |
| 145 | img { | 153 | .val { |
| 146 | margin-right: 0.5rem; | 154 | img { |
| 147 | } | 155 | margin-right: 0.5rem; |
| 148 | } | 156 | } |
| 149 | &:not(:last-child) { | 157 | } |
| 150 | border-bottom: 1px solid #5f53f440; | 158 | &:not(:last-child) { |
| 151 | } | 159 | border-bottom: 1px solid #5f53f440; |
| 152 | } | 160 | } |
| 153 | } | 161 | } |
| 154 | &.list { | 162 | } |
| 155 | list-style: circle; | 163 | &.list { |
| 156 | padding-left: 1rem; | 164 | list-style: circle; |
| 157 | } | 165 | padding-left: 1rem; |
| 158 | } | 166 | } |
| 159 | 167 | } | |
| 160 | .all-good { | 168 | |
| 161 | color: var(--success); | 169 | .all-good { |
| 162 | display: flex; | 170 | color: var(--success); |
| 163 | align-items: center; | 171 | display: flex; |
| 164 | gap: 0.5rem; | 172 | align-items: center; |
| 165 | :global(svg) { | 173 | gap: 0.5rem; |
| 166 | width: 1.5rem; | 174 | :global(svg) { |
| 167 | } | 175 | width: 1.5rem; |
| 168 | } | 176 | } |
| 169 | 177 | } | |
| 170 | </style> | 178 | </style> |
web/src/components/things/Comments.svelte +20 −14
| @@ -1,19 +1,25 @@ | |||
| 1 | <svelte:head> | 1 | <svelte:head> |
| 2 | <script async lang="javascript"> | 2 | <script async lang="javascript"> |
| 3 | var remark_config = { | 3 | var remark_config = { |
| 4 | host: 'https://comments.as93.net', site_id: 'awesome-privacy.xyz', | 4 | host: 'https://comments.as93.net', |
| 5 | components: ['embed'], show_rss_subsription: true, theme: 'dark', | 5 | site_id: 'awesome-privacy.xyz', |
| 6 | }; | 6 | components: ['embed'], |
| 7 | !(function (e, n) { | 7 | show_rss_subsription: true, |
| 8 | for (var o = 0; o < e.length; o++) { | 8 | theme: 'dark', |
| 9 | var r = n.createElement('script'), d = n.head || n.body; | 9 | }; |
| 10 | 'noModule' in r ? | 10 | !(function (e, n) { |
| 11 | (r.type = 'module', r.src = remark_config.host + '/web/' + e[o] + '.mjs') | 11 | for (var o = 0; o < e.length; o++) { |
| 12 | : ( r.async = !0, r.defer = !0, r.src = remark_config.host + '/web/' + e[o] + '.js'), | 12 | var r = n.createElement('script'), |
| 13 | d.appendChild(r); | 13 | d = n.head || n.body; |
| 14 | } | 14 | ('noModule' in r |
| 15 | })(remark_config.components || ['embed'], document); | 15 | ? ((r.type = 'module'), |
| 16 | 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); | ||
| 17 | 23 | ||
| 18 | </script> | 24 | </script> |
| 19 | </svelte:head> | 25 | </svelte:head> |
web/src/components/things/DataActions.svelte +61 −45
| @@ -1,18 +1,23 @@ | |||
| 1 | <script lang="ts"> | 1 | <script lang="ts"> |
| 2 | import { onMount } from "svelte"; | 2 | import { onMount } from 'svelte'; |
| 3 | import { fetchSrcData, makeRemovalRequest, makeEditRequest } from '@utils/data-src-delete-n-edit'; | 3 | import { |
| 4 | fetchSrcData, | ||
| 5 | makeRemovalRequest, | ||
| 6 | makeEditRequest, | ||
| 7 | } from '@utils/data-src-delete-n-edit'; | ||
| 4 | import FontAwesome from '@components/form/FontAwesome.svelte'; | 8 | import FontAwesome from '@components/form/FontAwesome.svelte'; |
| 5 | 9 | ||
| 6 | export let categoryName: string; | 10 | export let categoryName: string; |
| 7 | export let sectionName: string; | 11 | export let sectionName: string; |
| 8 | export let serviceName: string; | 12 | export let serviceName: string; |
| 9 | 13 | ||
| 10 | let lineNumbers: { start: number, end: number } | null = null; | 14 | let lineNumbers: { start: number; end: number } | null = null; |
| 11 | let yamlContent = ''; | 15 | let yamlContent = ''; |
| 12 | 16 | ||
| 13 | const getGitHubSrcFile = () => { | 17 | const getGitHubSrcFile = () => { |
| 14 | if (lineNumbers) { | 18 | 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'; | ||
| 16 | return `${baseFile}#L${lineNumbers.start}-L${lineNumbers.end}`; | 21 | return `${baseFile}#L${lineNumbers.start}-L${lineNumbers.end}`; |
| 17 | } | 22 | } |
| 18 | return ''; | 23 | return ''; |
| @@ -21,56 +26,68 @@ | |||
| 21 | const getIframeSrc = () => { | 26 | const getIframeSrc = () => { |
| 22 | const host = 'https://github-embed.as93.net'; | 27 | const host = 'https://github-embed.as93.net'; |
| 23 | const target = encodeURIComponent(getGitHubSrcFile()); | 28 | 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'; | ||
| 25 | return `${host}/iframe.html?target=${target}&${opts}`; | 31 | return `${host}/iframe.html?target=${target}&${opts}`; |
| 26 | }; | 32 | }; |
| 27 | 33 | ||
| 28 | onMount(async () => { | 34 | onMount(async () => { |
| 29 | const results = await fetchSrcData(categoryName, sectionName, serviceName); | 35 | const results = await fetchSrcData(categoryName, sectionName, serviceName); |
| 30 | lineNumbers = results.lineNumbers | 36 | lineNumbers = results.lineNumbers; |
| 31 | yamlContent = results.yamlContent; | 37 | yamlContent = results.yamlContent; |
| 32 | }); | 38 | }); |
| 33 | |||
| 34 | </script> | 39 | </script> |
| 35 | 40 | ||
| 36 | {#if lineNumbers} | 41 | {#if lineNumbers} |
| 37 | 42 | <h4>Edit {serviceName} Data</h4> | |
| 38 | <h4>Edit {serviceName} Data</h4> | 43 | <p> |
| 39 | <p> | 44 | You can view or edit this {serviceName}'s entry in |
| 40 | You can view or edit this {serviceName}'s entry in | 45 | <a href={getGitHubSrcFile()}> this section </a> |
| 41 | <a href={getGitHubSrcFile()}> | 46 | of <code>awesome-privacy.yml</code> in our GitHub repo. |
| 42 | this section | 47 | </p> |
| 43 | </a> | 48 | |
| 44 | of <code>awesome-privacy.yml</code> in our GitHub repo. | 49 | <h4>Origin Data</h4> |
| 45 | </p> | 50 | <iframe |
| 46 | 51 | frameborder="0" | |
| 47 | <h4>Origin Data</h4> | 52 | scrolling="no" |
| 48 | <iframe | 53 | class="yaml-embed" |
| 49 | frameborder="0" | 54 | allow="clipboard-write" |
| 50 | scrolling="no" | 55 | title="awesome-privacy.yml" |
| 51 | class="yaml-embed" | 56 | src={getIframeSrc()} |
| 52 | allow="clipboard-write" | 57 | ></iframe> |
| 53 | title="awesome-privacy.yml" | 58 | |
| 54 | src={getIframeSrc()}></iframe> | 59 | <h4>Modify Data</h4> |
| 55 | 60 | <div class="button-wrap"> | |
| 56 | <h4>Modify Data</h4> | 61 | <a |
| 57 | <div class="button-wrap"> | 62 | class="button-link" |
| 58 | <a class="button-link" target="_blank" | 63 | target="_blank" |
| 59 | href={makeRemovalRequest(categoryName, sectionName, serviceName, yamlContent)}> | 64 | href={makeRemovalRequest( |
| 60 | <FontAwesome iconName="delete" /> Delete {serviceName} | 65 | categoryName, |
| 61 | </a> | 66 | sectionName, |
| 62 | <a class="button-link" target="_blank" | 67 | serviceName, |
| 63 | href={makeEditRequest(categoryName, sectionName, serviceName, yamlContent)}> | 68 | yamlContent, |
| 64 | <FontAwesome iconName="edit" /> Submit Edit to {serviceName} | 69 | )} |
| 65 | </a> | 70 | > |
| 66 | <a class="button-link" href="/submit"> | 71 | <FontAwesome iconName="delete" /> Delete {serviceName} |
| 67 | <FontAwesome iconName="add" /> Add alternative | 72 | </a> |
| 68 | </a> | 73 | <a |
| 69 | </div> | 74 | class="button-link" |
| 70 | 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> | ||
| 71 | {/if} | 89 | {/if} |
| 72 | 90 | ||
| 73 | |||
| 74 | <style lang="scss"> | 91 | <style lang="scss"> |
| 75 | h4 { | 92 | h4 { |
| 76 | font-size: 1.4rem; | 93 | font-size: 1.4rem; |
| @@ -85,7 +102,7 @@ | |||
| 85 | gap: 1rem; | 102 | gap: 1rem; |
| 86 | justify-content: center; | 103 | justify-content: center; |
| 87 | margin: 1rem auto; | 104 | margin: 1rem auto; |
| 88 | @media(max-width: 768px) { | 105 | @media (max-width: 768px) { |
| 89 | flex-direction: column; | 106 | flex-direction: column; |
| 90 | } | 107 | } |
| 91 | } | 108 | } |
| @@ -101,7 +118,7 @@ | |||
| 101 | min-width: 15rem; | 118 | min-width: 15rem; |
| 102 | display: inline-block; | 119 | display: inline-block; |
| 103 | text-align: center; | 120 | text-align: center; |
| 104 | font-family: "Lekton",sans-serif; | 121 | font-family: 'Lekton', sans-serif; |
| 105 | font-size: 1.2rem; | 122 | font-size: 1.2rem; |
| 106 | :global(svg) { | 123 | :global(svg) { |
| 107 | width: 1rem; | 124 | width: 1rem; |
| @@ -118,5 +135,4 @@ | |||
| 118 | margin: 1rem auto; | 135 | margin: 1rem auto; |
| 119 | box-shadow: 3px 3px 0 var(--accent-3); | 136 | box-shadow: 3px 3px 0 var(--accent-3); |
| 120 | } | 137 | } |
| 121 | |||
| 122 | </style> | 138 | </style> |
web/src/components/things/DeleteListing.svelte +38 −28
| @@ -1,15 +1,17 @@ | |||
| 1 | |||
| 2 | <script lang="ts"> | 1 | <script lang="ts"> |
| 3 | import FontAwesome from '@components/form/FontAwesome.svelte'; | 2 | 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'; | ||
| 5 | import { onMount } from 'svelte'; | 7 | import { onMount } from 'svelte'; |
| 6 | 8 | ||
| 7 | |||
| 8 | export let categoryName: string; | 9 | export let categoryName: string; |
| 9 | export let sectionName: string; | 10 | export let sectionName: string; |
| 10 | export let serviceName: string; | 11 | export let serviceName: string; |
| 11 | 12 | ||
| 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'; | ||
| 13 | 15 | ||
| 14 | let yamlContent = ''; | 16 | let yamlContent = ''; |
| 15 | let editLink = apYaml; | 17 | let editLink = apYaml; |
| @@ -19,43 +21,51 @@ | |||
| 19 | yamlContent = results.yamlContent; | 21 | yamlContent = results.yamlContent; |
| 20 | 22 | ||
| 21 | const lineNumbers = results.lineNumbers || null; | 23 | const lineNumbers = results.lineNumbers || null; |
| 22 | const numberRange = lineNumbers ? `#L${lineNumbers.start}-L${lineNumbers.end}` : ''; | 24 | const numberRange = lineNumbers |
| 23 | const yamlLink = 'https://github.com/lissy93/awesome-privacy/blob/main/awesome-privacy.yml'; | 25 | ? `#L${lineNumbers.start}-L${lineNumbers.end}` |
| 26 | : ''; | ||
| 27 | const yamlLink = | ||
| 28 | 'https://github.com/lissy93/awesome-privacy/blob/main/awesome-privacy.yml'; | ||
| 24 | editLink = `${yamlLink}${numberRange}`; | 29 | editLink = `${yamlLink}${numberRange}`; |
| 25 | }); | 30 | }); |
| 26 | |||
| 27 | </script> | 31 | </script> |
| 28 | 32 | ||
| 29 | <div class="actions"> | 33 | <div class="actions"> |
| 30 | <a title="Edit" target="_blank" | 34 | <a title="Edit" target="_blank" href={editLink}> |
| 31 | href={editLink}> | ||
| 32 | <FontAwesome iconName="edit" /> | 35 | <FontAwesome iconName="edit" /> |
| 33 | </a> | 36 | </a> |
| 34 | <a title="Delete" target="_blank" | 37 | <a |
| 35 | href={makeRemovalRequest(categoryName, sectionName, serviceName, yamlContent)}> | 38 | title="Delete" |
| 39 | target="_blank" | ||
| 40 | href={makeRemovalRequest( | ||
| 41 | categoryName, | ||
| 42 | sectionName, | ||
| 43 | serviceName, | ||
| 44 | yamlContent, | ||
| 45 | )} | ||
| 46 | > | ||
| 36 | <FontAwesome iconName="delete" /> | 47 | <FontAwesome iconName="delete" /> |
| 37 | </a> | 48 | </a> |
| 38 | </div> | 49 | </div> |
| 39 | 50 | ||
| 40 | <style lang="scss"> | 51 | <style lang="scss"> |
| 41 | .actions { | 52 | .actions { |
| 42 | position: absolute; | 53 | position: absolute; |
| 43 | right: 3.5rem; | 54 | right: 3.5rem; |
| 44 | top: 1rem; | 55 | top: 1rem; |
| 45 | width: 2.8rem; | 56 | width: 2.8rem; |
| 46 | gap: 1rem; | 57 | gap: 1rem; |
| 47 | opacity: 0; | 58 | opacity: 0; |
| 48 | display: flex; | 59 | display: flex; |
| 49 | transition: all 0.2s ease-in-out; | ||
| 50 | a { | ||
| 51 | color: var(--foreground); | ||
| 52 | width: 1rem; | ||
| 53 | transition: all 0.2s ease-in-out; | 60 | transition: all 0.2s ease-in-out; |
| 54 | &:hover { | 61 | a { |
| 55 | color: var(--accent-3); | 62 | color: var(--foreground); |
| 56 | opacity: 1; | 63 | width: 1rem; |
| 64 | transition: all 0.2s ease-in-out; | ||
| 65 | &:hover { | ||
| 66 | color: var(--accent-3); | ||
| 67 | opacity: 1; | ||
| 68 | } | ||
| 57 | } | 69 | } |
| 58 | } | 70 | } |
| 59 | |||
| 60 | } | ||
| 61 | </style> | 71 | </style> |
web/src/components/things/DiscordDetailedInfo.astro +100 −97
| @@ -1,110 +1,113 @@ | |||
| 1 | --- | 1 | --- |
| 2 | |||
| 3 | import type { DiscordInfo } from '@utils/fetch-discord-info'; | 2 | import type { DiscordInfo } from '@utils/fetch-discord-info'; |
| 4 | import { formatDate, timeAgo } from '@utils/dates-n-stuff'; | 3 | import { formatDate, timeAgo } from '@utils/dates-n-stuff'; |
| 5 | import FontAwesome from "@components/form/FontAwesome.svelte" | 4 | import FontAwesome from '@components/form/FontAwesome.svelte'; |
| 6 | |||
| 7 | 5 | ||
| 8 | interface Props { | 6 | interface Props { |
| 9 | discordData: DiscordInfo; | 7 | discordData: DiscordInfo; |
| 10 | }; | 8 | } |
| 11 | 9 | ||
| 12 | const { discordData } = Astro.props; | 10 | const { discordData } = Astro.props; |
| 13 | |||
| 14 | |||
| 15 | --- | 11 | --- |
| 16 | 12 | ||
| 17 | <div class="discord-info-wrapper"> | 13 | <div class="discord-info-wrapper"> |
| 18 | 14 | <h3>Discord</h3> | |
| 19 | <h3>Discord</h3> | 15 | |
| 20 | 16 | <ul class="list-table"> | |
| 21 | <ul class="list-table"> | 17 | <li> |
| 22 | <li> | 18 | <span class="lbl">Server Name</span> |
| 23 | <span class="lbl">Server Name</span> | 19 | <span class="val" |
| 24 | <span class="val"><img src={discordData.icon} width="16" />{discordData.name}</span> | 20 | ><img src={discordData.icon} width="16" />{discordData.name}</span |
| 25 | </li> | 21 | > |
| 26 | <li> | 22 | </li> |
| 27 | <span class="lbl">Member Count</span> | 23 | <li> |
| 28 | <span class="val">{discordData.memberCount} ({discordData.memberOnlineCount} online)</span> | 24 | <span class="lbl">Member Count</span> |
| 29 | </li> | 25 | <span class="val" |
| 30 | <li> | 26 | >{discordData.memberCount} ({discordData.memberOnlineCount} online)</span |
| 31 | <span class="lbl">Initial Channel</span> | 27 | > |
| 32 | <span class="val">{discordData.channel}</span> | 28 | </li> |
| 33 | </li> | 29 | <li> |
| 34 | <li> | 30 | <span class="lbl">Initial Channel</span> |
| 35 | <span class="lbl">Inviter</span> | 31 | <span class="val">{discordData.channel}</span> |
| 36 | <span class="val">{discordData.inviter || 'Anon'}</span> | 32 | </li> |
| 37 | </li> | 33 | <li> |
| 38 | <li> | 34 | <span class="lbl">Inviter</span> |
| 39 | <span class="lbl">Join Link</span> | 35 | <span class="val">{discordData.inviter || 'Anon'}</span> |
| 40 | <span class="val"><a href={`https://discord.com/invite/${discordData.inviteCode}`}>discord.com/invite/{discordData.inviteCode}</a></span> | 36 | </li> |
| 41 | </li> | 37 | <li> |
| 42 | </ul> | 38 | <span class="lbl">Join Link</span> |
| 43 | 39 | <span class="val" | |
| 44 | { discordData.banner && (<img class="banner" width="300" src={discordData.banner} />)} | 40 | ><a href={`https://discord.com/invite/${discordData.inviteCode}`} |
| 45 | 41 | >discord.com/invite/{discordData.inviteCode}</a | |
| 46 | 42 | ></span | |
| 43 | > | ||
| 44 | </li> | ||
| 45 | </ul> | ||
| 46 | |||
| 47 | { | ||
| 48 | discordData.banner && ( | ||
| 49 | <img class="banner" width="300" src={discordData.banner} /> | ||
| 50 | ) | ||
| 51 | } | ||
| 47 | </div> | 52 | </div> |
| 48 | 53 | ||
| 49 | |||
| 50 | <style lang="scss"> | 54 | <style lang="scss"> |
| 51 | .discord-info-wrapper { | 55 | .discord-info-wrapper { |
| 52 | display: flex; | 56 | display: flex; |
| 53 | flex-direction: column; | 57 | flex-direction: column; |
| 54 | max-width: 400px; | 58 | max-width: 400px; |
| 55 | } | 59 | } |
| 56 | 60 | ||
| 57 | h3 { | 61 | h3 { |
| 58 | margin: 0; | 62 | margin: 0; |
| 59 | font-size: 1.6rem; | 63 | font-size: 1.6rem; |
| 60 | } | 64 | } |
| 61 | 65 | ||
| 62 | h4 { | 66 | h4 { |
| 63 | margin: 1rem 0 0 0; | 67 | margin: 1rem 0 0 0; |
| 64 | font-size: 1.2rem; | 68 | font-size: 1.2rem; |
| 65 | } | 69 | } |
| 66 | 70 | ||
| 67 | ul { | 71 | ul { |
| 68 | padding-left: 0; | 72 | padding-left: 0; |
| 69 | list-style: none; | 73 | list-style: none; |
| 70 | max-height: 300px; | 74 | max-height: 300px; |
| 71 | overflow-y: auto; | 75 | overflow-y: auto; |
| 72 | overflow-x: hidden; | 76 | overflow-x: hidden; |
| 73 | img { | 77 | img { |
| 74 | border-radius: var(--curve-sm); | 78 | border-radius: var(--curve-sm); |
| 75 | } | 79 | } |
| 76 | .list-item { | 80 | .list-item { |
| 77 | display: flex; | 81 | display: flex; |
| 78 | flex-direction: column; | 82 | flex-direction: column; |
| 79 | margin-bottom: 0.5rem; | 83 | margin-bottom: 0.5rem; |
| 80 | } | 84 | } |
| 81 | &.list-table { | 85 | &.list-table { |
| 82 | font-size: 0.9rem; | 86 | font-size: 0.9rem; |
| 83 | padding-left: 0; | 87 | padding-left: 0; |
| 84 | li { | 88 | li { |
| 85 | display: flex; | 89 | display: flex; |
| 86 | justify-content: space-between; | 90 | justify-content: space-between; |
| 87 | padding: 0.1rem 0; | 91 | padding: 0.1rem 0; |
| 88 | .lbl { | 92 | .lbl { |
| 89 | font-weight: 400; | 93 | font-weight: 400; |
| 90 | } | 94 | } |
| 91 | .val { | 95 | .val { |
| 92 | img { | 96 | img { |
| 93 | margin-right: 0.5rem; | 97 | margin-right: 0.5rem; |
| 94 | } | 98 | } |
| 95 | } | 99 | } |
| 96 | &:not(:last-child) { | 100 | &:not(:last-child) { |
| 97 | border-bottom: 1px solid #5f53f440; | 101 | border-bottom: 1px solid #5f53f440; |
| 98 | } | 102 | } |
| 99 | } | 103 | } |
| 100 | } | 104 | } |
| 101 | } | 105 | } |
| 102 | 106 | ||
| 103 | .banner { | 107 | .banner { |
| 104 | width: 80%; | 108 | width: 80%; |
| 105 | margin: 1rem auto 0 auto; | 109 | margin: 1rem auto 0 auto; |
| 106 | display: flex; | 110 | display: flex; |
| 107 | border-radius: var(--curve-md); | 111 | border-radius: var(--curve-md); |
| 108 | } | 112 | } |
| 109 | |||
| 110 | </style> | 113 | </style> |
web/src/components/things/GetSharableLink.svelte +30 −28
| @@ -1,37 +1,39 @@ | |||
| 1 | |||
| 2 | <script lang="ts"> | 1 | <script lang="ts"> |
| 2 | import { slugify } from '@utils/fetch-data'; | ||
| 3 | 3 | ||
| 4 | import { slugify } from "@utils/fetch-data"; | 4 | let linkId = ''; |
| 5 | 5 | let done = false; | |
| 6 | let linkId = ''; | 6 | let error = false; |
| 7 | let done = false; | ||
| 8 | let error = false; | ||
| 9 | 7 | ||
| 10 | const save = async () => { | 8 | const save = async () => { |
| 11 | const savedServices = JSON.parse(localStorage.getItem('savedServices') || '[]'); | 9 | const savedServices = JSON.parse( |
| 12 | const inventoryTitle = localStorage.getItem('userTitle') || 'Anon\'s Inventory'; | 10 | localStorage.getItem('savedServices') || '[]', |
| 13 | const uniqueId = Math.random().toString(36).substring(2); | 11 | ); |
| 14 | const saveKey = `${uniqueId}_${slugify(inventoryTitle)}`; | 12 | const inventoryTitle = |
| 15 | const url = 'https://awesome-privacy-share-api.as93.net'; | 13 | localStorage.getItem('userTitle') || "Anon's Inventory"; |
| 16 | const data = { key: saveKey, services: savedServices }; | 14 | const uniqueId = Math.random().toString(36).substring(2); |
| 17 | fetch(url, { | 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, { | ||
| 18 | method: 'PUT', | 19 | method: 'PUT', |
| 19 | headers: { 'Content-Type': 'application/json' }, | 20 | headers: { 'Content-Type': 'application/json' }, |
| 20 | body: JSON.stringify(data), | 21 | body: JSON.stringify(data), |
| 21 | }) | 22 | }) |
| 22 | .then(response => response.json()) | 23 | .then((response) => response.json()) |
| 23 | .then(data => { | 24 | .then((data) => { |
| 24 | linkId = data.key; | 25 | linkId = data.key; |
| 25 | done = true; | 26 | done = true; |
| 26 | error = false; | 27 | error = false; |
| 27 | navigator.clipboard.writeText(`https://awesome-privacy.xyz/inventory/${linkId}`); | 28 | navigator.clipboard.writeText( |
| 28 | }) | 29 | `https://awesome-privacy.xyz/inventory/${linkId}`, |
| 29 | .catch(error => { | 30 | ); |
| 30 | error = true; | 31 | }) |
| 31 | console.error('Error:', error) | 32 | .catch((error) => { |
| 32 | }); | 33 | error = true; |
| 33 | }; | 34 | console.error('Error:', error); |
| 34 | 35 | }); | |
| 36 | }; | ||
| 35 | </script> | 37 | </script> |
| 36 | 38 | ||
| 37 | <div class="share-container"> | 39 | <div class="share-container"> |
web/src/components/things/RedditDetailedInfo.astro +179 −159
| @@ -1,172 +1,192 @@ | |||
| 1 | --- | 1 | --- |
| 2 | |||
| 3 | import type { RedditData } from '@utils/fetch-reddit-info'; | 2 | import type { RedditData } from '@utils/fetch-reddit-info'; |
| 4 | import { timestampToDate, timeAgo } from '@utils/dates-n-stuff'; | 3 | import { timestampToDate, timeAgo } from '@utils/dates-n-stuff'; |
| 5 | import FontAwesome from "@components/form/FontAwesome.svelte" | 4 | import FontAwesome from '@components/form/FontAwesome.svelte'; |
| 6 | |||
| 7 | 5 | ||
| 8 | interface Props { | 6 | interface Props { |
| 9 | redditData: RedditData; | 7 | redditData: RedditData; |
| 10 | }; | 8 | } |
| 11 | 9 | ||
| 12 | const { redditData } = Astro.props; | 10 | const { redditData } = Astro.props; |
| 13 | |||
| 14 | --- | 11 | --- |
| 15 | 12 | ||
| 16 | <div class="reddit-info-wrapper"> | 13 | <div class="reddit-info-wrapper"> |
| 17 | <div class="left"> | 14 | <div class="left"> |
| 18 | <h3>Reddit</h3> | 15 | <h3>Reddit</h3> |
| 19 | <p class="website-title"> | 16 | <p class="website-title"> |
| 20 | <img src={redditData.info.icon} width="16" /> | 17 | <img src={redditData.info.icon} width="16" /> |
| 21 | {redditData.info.title || redditData.info.name} | 18 | {redditData.info.title || redditData.info.name} |
| 22 | </p> | 19 | </p> |
| 23 | <p class="website-description">{redditData.info.description}</p> | 20 | <p class="website-description">{redditData.info.description}</p> |
| 24 | {redditData.info.banner && (<img class="banner" width="300" src={redditData.info.banner} alt="Banner" />)} | 21 | { |
| 25 | <ul class="list-table"> | 22 | redditData.info.banner && ( |
| 26 | {redditData.info.dateCreated && ( | 23 | <img |
| 27 | <li> | 24 | class="banner" |
| 28 | <span class="lbl">Created at</span> | 25 | width="300" |
| 29 | <span class="val">{timestampToDate(redditData.info.dateCreated * 1000)}</span> | 26 | src={redditData.info.banner} |
| 30 | </li> | 27 | alt="Banner" |
| 31 | )} | 28 | /> |
| 32 | <li> | 29 | ) |
| 33 | <span class="lbl">Members</span> | 30 | } |
| 34 | <span class="val">{redditData.info.subscribers}</span> | 31 | <ul class="list-table"> |
| 35 | </li> | 32 | { |
| 36 | <li> | 33 | redditData.info.dateCreated && ( |
| 37 | <span class="lbl">Join</span> | 34 | <li> |
| 38 | <span class="val"><a href={`https://reddit.com/${redditData.info.name}`}>{redditData.info.name}</a></span> | 35 | <span class="lbl">Created at</span> |
| 39 | </li> | 36 | <span class="val"> |
| 40 | </ul> | 37 | {timestampToDate(redditData.info.dateCreated * 1000)} |
| 41 | </div> | 38 | </span> |
| 42 | <div class="right"> | 39 | </li> |
| 43 | <h4>Posts</h4> | 40 | ) |
| 44 | <ul class="posts"> | 41 | } |
| 45 | {redditData.posts.map((post) => ( | 42 | <li> |
| 46 | <li title={post.body}> | 43 | <span class="lbl">Members</span> |
| 47 | ○ <a href={post.url} target="_blank">{post.title}</a> | 44 | <span class="val">{redditData.info.subscribers}</span> |
| 48 | <span class="votes">(▲ {post.upVotes} ▼ {post.downVotes})</span> | 45 | </li> |
| 49 | </li> | 46 | <li> |
| 50 | ))} | 47 | <span class="lbl">Join</span> |
| 51 | </ul> | 48 | <span class="val" |
| 52 | </div> | 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> | ||
| 53 | </div> | 74 | </div> |
| 54 | 75 | ||
| 55 | |||
| 56 | <style lang="scss"> | 76 | <style lang="scss"> |
| 57 | .reddit-info-wrapper { | 77 | .reddit-info-wrapper { |
| 58 | display: flex; | 78 | display: flex; |
| 59 | flex-wrap: wrap; | 79 | flex-wrap: wrap; |
| 60 | justify-content: space-between; | 80 | justify-content: space-between; |
| 61 | gap: 1rem; | 81 | gap: 1rem; |
| 62 | .left, .right { | 82 | .left, |
| 63 | width: calc(50% - 1rem); | 83 | .right { |
| 64 | @media screen and (max-width: 768px){ | 84 | width: calc(50% - 1rem); |
| 65 | width: 100%; | 85 | @media screen and (max-width: 768px) { |
| 66 | } | 86 | width: 100%; |
| 67 | } | 87 | } |
| 68 | } | 88 | } |
| 69 | 89 | } | |
| 70 | .banner { | 90 | |
| 71 | margin: 0.5rem auto; | 91 | .banner { |
| 72 | border-radius: var(--curve-md); | 92 | margin: 0.5rem auto; |
| 73 | width: 100%; | 93 | border-radius: var(--curve-md); |
| 74 | } | 94 | width: 100%; |
| 75 | 95 | } | |
| 76 | h3 { | 96 | |
| 77 | margin: 0 0 1rem 0; | 97 | h3 { |
| 78 | font-size: 1.6rem; | 98 | margin: 0 0 1rem 0; |
| 79 | } | 99 | font-size: 1.6rem; |
| 80 | 100 | } | |
| 81 | h4 { | 101 | |
| 82 | margin: 1rem 0 0 0; | 102 | h4 { |
| 83 | font-size: 1.2rem; | 103 | margin: 1rem 0 0 0; |
| 84 | } | 104 | font-size: 1.2rem; |
| 85 | p { | 105 | } |
| 86 | margin: 0; | 106 | p { |
| 87 | display: flex; | 107 | margin: 0; |
| 88 | align-items: center; | 108 | display: flex; |
| 89 | gap: 0.25rem; | 109 | align-items: center; |
| 90 | :global(svg) { | 110 | gap: 0.25rem; |
| 91 | width: 1rem; | 111 | :global(svg) { |
| 92 | } | 112 | width: 1rem; |
| 93 | img { | 113 | } |
| 94 | border-radius: var(--curve-sm); | 114 | img { |
| 95 | } | 115 | border-radius: var(--curve-sm); |
| 96 | } | 116 | } |
| 97 | 117 | } | |
| 98 | ul { | 118 | |
| 99 | padding-left: 0; | 119 | ul { |
| 100 | list-style: none; | 120 | padding-left: 0; |
| 101 | max-height: 300px; | 121 | list-style: none; |
| 102 | overflow-y: auto; | 122 | max-height: 300px; |
| 103 | overflow-x: hidden; | 123 | overflow-y: auto; |
| 104 | img { | 124 | overflow-x: hidden; |
| 105 | border-radius: var(--curve-sm); | 125 | img { |
| 106 | } | 126 | border-radius: var(--curve-sm); |
| 107 | .list-item { | 127 | } |
| 108 | display: flex; | 128 | .list-item { |
| 109 | flex-direction: column; | 129 | display: flex; |
| 110 | margin-bottom: 0.5rem; | 130 | flex-direction: column; |
| 111 | } | 131 | margin-bottom: 0.5rem; |
| 112 | &.list-table { | 132 | } |
| 113 | font-size: 0.9rem; | 133 | &.list-table { |
| 114 | padding-left: 0; | 134 | font-size: 0.9rem; |
| 115 | li { | 135 | padding-left: 0; |
| 116 | display: flex; | 136 | li { |
| 117 | justify-content: space-between; | 137 | display: flex; |
| 118 | padding: 0.1rem 0; | 138 | justify-content: space-between; |
| 119 | .lbl { | 139 | padding: 0.1rem 0; |
| 120 | font-weight: 400; | 140 | .lbl { |
| 121 | } | 141 | font-weight: 400; |
| 122 | &:not(:last-child) { | 142 | } |
| 123 | border-bottom: 1px solid #5f53f440; | 143 | &:not(:last-child) { |
| 124 | } | 144 | border-bottom: 1px solid #5f53f440; |
| 125 | } | 145 | } |
| 126 | } | 146 | } |
| 127 | } | 147 | } |
| 128 | 148 | } | |
| 129 | .posts { | 149 | |
| 130 | list-style: circle; | 150 | .posts { |
| 131 | padding-left: 1rem; | 151 | list-style: circle; |
| 132 | font-size: 0.9rem; | 152 | padding-left: 1rem; |
| 133 | li { | 153 | font-size: 0.9rem; |
| 134 | display: -webkit-box; | 154 | li { |
| 135 | -webkit-line-clamp: 1; | 155 | display: -webkit-box; |
| 136 | -webkit-box-orient: vertical; | 156 | -webkit-line-clamp: 1; |
| 137 | overflow: hidden; | 157 | -webkit-box-orient: vertical; |
| 138 | a { | 158 | overflow: hidden; |
| 139 | max-width: 80%; | 159 | a { |
| 140 | } | 160 | max-width: 80%; |
| 141 | .votes { | 161 | } |
| 142 | font-size: 0.8rem; | 162 | .votes { |
| 143 | opacity: 0.5; | 163 | font-size: 0.8rem; |
| 144 | } | 164 | opacity: 0.5; |
| 145 | } | 165 | } |
| 146 | } | 166 | } |
| 147 | 167 | } | |
| 148 | .website-title, .website-description { | 168 | |
| 149 | font-size: 0.9rem; | 169 | .website-title, |
| 150 | opacity: 0.8; | 170 | .website-description { |
| 151 | display: -webkit-box; | 171 | font-size: 0.9rem; |
| 152 | -webkit-line-clamp: 1; | 172 | opacity: 0.8; |
| 153 | -webkit-box-orient: vertical; | 173 | display: -webkit-box; |
| 154 | overflow: hidden; | 174 | -webkit-line-clamp: 1; |
| 155 | border-left: 2px solid var(--accent-3); | 175 | -webkit-box-orient: vertical; |
| 156 | padding-left: 0.5rem; | 176 | overflow: hidden; |
| 157 | } | 177 | border-left: 2px solid var(--accent-3); |
| 158 | .website-title { | 178 | padding-left: 0.5rem; |
| 159 | font-weight: 500; | 179 | } |
| 160 | } | 180 | .website-title { |
| 161 | .website-description { | 181 | font-weight: 500; |
| 162 | font-style: italic; | 182 | } |
| 163 | -webkit-line-clamp: 3; | 183 | .website-description { |
| 164 | } | 184 | font-style: italic; |
| 165 | .explainer { | 185 | -webkit-line-clamp: 3; |
| 166 | font-size: 0.8rem; | 186 | } |
| 167 | opacity: 0.8; | 187 | .explainer { |
| 168 | font-style: italic; | 188 | font-size: 0.8rem; |
| 169 | } | 189 | opacity: 0.8; |
| 170 | 190 | font-style: italic; | |
| 171 | 191 | } | |
| 172 | </style> | 192 | </style> |
web/src/components/things/SaveListing.svelte +22 −22
| @@ -1,7 +1,7 @@ | |||
| 1 | <script lang="ts"> | 1 | <script lang="ts"> |
| 2 | import { onMount } from 'svelte'; | 2 | import { onMount } from 'svelte'; |
| 3 | import FontAwesome from "@components/form/FontAwesome.svelte"; | 3 | import FontAwesome from '@components/form/FontAwesome.svelte'; |
| 4 | import { slugify } from "@utils/fetch-data"; | 4 | import { slugify } from '@utils/fetch-data'; |
| 5 | 5 | ||
| 6 | export let categoryName: string; | 6 | export let categoryName: string; |
| 7 | export let sectionName: string; | 7 | export let sectionName: string; |
| @@ -34,23 +34,24 @@ | |||
| 34 | </script> | 34 | </script> |
| 35 | 35 | ||
| 36 | <div class="wrapper-or-something"> | 36 | <div class="wrapper-or-something"> |
| 37 | <button | 37 | <button |
| 38 | class={`save-container ${isSaved ? 'saved' : ''} ${showLabel ? 'label-button' : ''}`} | 38 | class={`save-container ${isSaved ? 'saved' : ''} ${showLabel ? 'label-button' : ''}`} |
| 39 | title={`Save ${serviceName}`} | 39 | title={`Save ${serviceName}`} |
| 40 | on:click={toggleSave}> | 40 | on:click={toggleSave} |
| 41 | {#if showLabel } | 41 | > |
| 42 | <span> | 42 | {#if showLabel} |
| 43 | {isSaved ? 'Saved' : 'Save'} | 43 | <span> |
| 44 | </span> | 44 | {isSaved ? 'Saved' : 'Save'} |
| 45 | {/if} | 45 | </span> |
| 46 | <FontAwesome iconName="saveListing"/> | 46 | {/if} |
| 47 | </button> | 47 | <FontAwesome iconName="saveListing" /> |
| 48 | </button> | ||
| 48 | 49 | ||
| 49 | {#if showLabel && isSaved } | 50 | {#if showLabel && isSaved} |
| 50 | <div class="done-msg"> | 51 | <div class="done-msg"> |
| 51 | You can view all saved items in your <a href="/inventory">Inventory</a> | 52 | You can view all saved items in your <a href="/inventory">Inventory</a> |
| 52 | </div> | 53 | </div> |
| 53 | {/if} | 54 | {/if} |
| 54 | </div> | 55 | </div> |
| 55 | 56 | ||
| 56 | <style lang="scss"> | 57 | <style lang="scss"> |
| @@ -71,7 +72,7 @@ | |||
| 71 | font-size: 1.2rem; | 72 | font-size: 1.2rem; |
| 72 | opacity: 0.8; | 73 | opacity: 0.8; |
| 73 | color: var(--foreground); | 74 | color: var(--foreground); |
| 74 | font-family: "Lekton"; | 75 | font-family: 'Lekton'; |
| 75 | } | 76 | } |
| 76 | :global(svg) { | 77 | :global(svg) { |
| 77 | color: var(--foreground); | 78 | color: var(--foreground); |
| @@ -98,9 +99,8 @@ | |||
| 98 | box-shadow: 3px 3px 0 var(--box-outline); | 99 | box-shadow: 3px 3px 0 var(--box-outline); |
| 99 | border: 1px solid var(--box-outline); | 100 | border: 1px solid var(--box-outline); |
| 100 | background: var(--background-form); | 101 | background: var(--background-form); |
| 101 | 102 | ||
| 102 | &:hover { | 103 | &:hover { |
| 103 | |||
| 104 | box-shadow: 4px 4px 0 var(--box-outline); | 104 | box-shadow: 4px 4px 0 var(--box-outline); |
| 105 | } | 105 | } |
| 106 | } | 106 | } |
| @@ -110,7 +110,7 @@ | |||
| 110 | max-width: 165px; | 110 | max-width: 165px; |
| 111 | font-size: 0.8rem; | 111 | font-size: 0.8rem; |
| 112 | opacity: 0.6; | 112 | opacity: 0.6; |
| 113 | @media(max-width: 768px) { | 113 | @media (max-width: 768px) { |
| 114 | display: none; | 114 | display: none; |
| 115 | } | 115 | } |
| 116 | } | 116 | } |
web/src/components/things/SavedServices.svelte +43 −34
| @@ -1,42 +1,48 @@ | |||
| 1 | <script lang="ts"> | 1 | <script lang="ts"> |
| 2 | import { onMount } from 'svelte'; | 2 | import { onMount } from 'svelte'; |
| 3 | import { writable } from 'svelte/store'; | 3 | import { writable } from 'svelte/store'; |
| 4 | 4 | ||
| 5 | import type { Category, Service } from '../../types/Service'; | 5 | import type { Category, Service } from '../../types/Service'; |
| 6 | import { slugify } from "@utils/fetch-data"; | 6 | import { slugify } from '@utils/fetch-data'; |
| 7 | import ServiceCard from './ServiceCard.svelte'; | 7 | import ServiceCard from './ServiceCard.svelte'; |
| 8 | 8 | ||
| 9 | export let allData: Category[]; | 9 | export let allData: Category[]; |
| 10 | export let serviceList: string[] | null = null; | 10 | export let serviceList: string[] | null = null; |
| 11 | 11 | ||
| 12 | interface SavedServices { | 12 | interface SavedServices { |
| 13 | category: string; | 13 | category: string; |
| 14 | section: string; | 14 | section: string; |
| 15 | service: Service; | 15 | service: Service; |
| 16 | } | 16 | } |
| 17 | 17 | ||
| 18 | const savedServices = writable<SavedServices[]>([]); | 18 | const savedServices = writable<SavedServices[]>([]); |
| 19 | 19 | ||
| 20 | onMount(async () => { | 20 | onMount(async () => { |
| 21 | const results: SavedServices[] = []; | 21 | const results: SavedServices[] = []; |
| 22 | const saved = serviceList || JSON.parse(localStorage.getItem('savedServices') || '[]'); | 22 | const saved = |
| 23 | saved.forEach((serviceId: string) => { | 23 | serviceList || JSON.parse(localStorage.getItem('savedServices') || '[]'); |
| 24 | const parts = serviceId.split('/'); | 24 | saved.forEach((serviceId: string) => { |
| 25 | const categoryName = parts[0]; | 25 | const parts = serviceId.split('/'); |
| 26 | const sectionName = parts[1]; | 26 | const categoryName = parts[0]; |
| 27 | const serviceName = parts[2]; | 27 | const sectionName = parts[1]; |
| 28 | const serviceName = parts[2]; | ||
| 28 | 29 | ||
| 29 | const category = allData.find((category) => slugify(category.name) === categoryName); | 30 | const category = allData.find( |
| 30 | if (!category) return; | 31 | (category) => slugify(category.name) === categoryName, |
| 31 | const section = category.sections.find((section) => slugify(section.name) === sectionName); | 32 | ); |
| 32 | if (!section) return; | 33 | if (!category) return; |
| 33 | const service = section.services.find((service) => slugify(service.name) === serviceName); | 34 | const section = category.sections.find( |
| 34 | if (!service) return; | 35 | (section) => slugify(section.name) === sectionName, |
| 35 | results.push({ category: category.name, section: section.name, service}); | 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 || []); | ||
| 36 | }); | 45 | }); |
| 37 | savedServices.set(results || []); | ||
| 38 | }); | ||
| 39 | |||
| 40 | </script> | 46 | </script> |
| 41 | 47 | ||
| 42 | <div> | 48 | <div> |
| @@ -52,10 +58,13 @@ onMount(async () => { | |||
| 52 | </div> | 58 | </div> |
| 53 | {:else if !serviceList} | 59 | {:else if !serviceList} |
| 54 | <div class="nothing-yet"> | 60 | <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> | ||
| 56 | <small> | 65 | <small> |
| 57 | All data is stored on-device, in your browser's local storage, | 66 | All data is stored on-device, in your browser's local storage, and not |
| 58 | and not sent anywhere unless you choose to share it | 67 | sent anywhere unless you choose to share it |
| 59 | </small> | 68 | </small> |
| 60 | <p class="nope">Nothing saved yet!</p> | 69 | <p class="nope">Nothing saved yet!</p> |
| 61 | </div> | 70 | </div> |
web/src/components/things/Search.svelte +134 −115
| @@ -2,7 +2,12 @@ | |||
| 2 | import { onMount } from 'svelte'; | 2 | import { onMount } from 'svelte'; |
| 3 | import Fuse from 'fuse.js'; | 3 | import Fuse from 'fuse.js'; |
| 4 | import { slugify } from '@utils/fetch-data'; | 4 | 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'; | ||
| 6 | import { formatLink } from '@utils/parse-markdown'; | 11 | import { formatLink } from '@utils/parse-markdown'; |
| 7 | import { prepareSearchItems, searchOptions } from '@utils/do-searchy-searchy'; | 12 | import { prepareSearchItems, searchOptions } from '@utils/do-searchy-searchy'; |
| 8 | 13 | ||
| @@ -20,9 +25,9 @@ | |||
| 20 | }); | 25 | }); |
| 21 | 26 | ||
| 22 | const makeResultLink = (cat?: string, sec?: string, itm?: string) => { | 27 | const makeResultLink = (cat?: string, sec?: string, itm?: string) => { |
| 23 | if (!cat) return '/' | 28 | if (!cat) return '/'; |
| 24 | if (!sec) return `/${slugify(cat)}` | 29 | if (!sec) return `/${slugify(cat)}`; |
| 25 | if (!itm) return `/${slugify(cat)}/${slugify(sec)}` | 30 | if (!itm) return `/${slugify(cat)}/${slugify(sec)}`; |
| 26 | return `/${slugify(cat)}/${slugify(sec)}/${slugify(itm)}`; | 31 | return `/${slugify(cat)}/${slugify(sec)}/${slugify(itm)}`; |
| 27 | }; | 32 | }; |
| 28 | 33 | ||
| @@ -40,7 +45,7 @@ | |||
| 40 | 45 | ||
| 41 | const makeTitle = (typ: string, desc: string) => { | 46 | const makeTitle = (typ: string, desc: string) => { |
| 42 | if (desc && typ === 'Service') { | 47 | if (desc && typ === 'Service') { |
| 43 | return `${desc.slice(0, 60)}...` | 48 | return `${desc.slice(0, 60)}...`; |
| 44 | } | 49 | } |
| 45 | return ''; | 50 | return ''; |
| 46 | }; | 51 | }; |
| @@ -59,7 +64,10 @@ | |||
| 59 | 64 | ||
| 60 | // Watch for changes in the search query and update results | 65 | // Watch for changes in the search query and update results |
| 61 | $: if (searchQuery) { | 66 | $: 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); | ||
| 63 | } else { | 71 | } else { |
| 64 | results = []; | 72 | results = []; |
| 65 | } | 73 | } |
| @@ -79,35 +87,48 @@ | |||
| 79 | bind:value={searchQuery} | 87 | bind:value={searchQuery} |
| 80 | on:keydown={handleKeyDown} | 88 | on:keydown={handleKeyDown} |
| 81 | /> | 89 | /> |
| 82 | 90 | ||
| 83 | |||
| 84 | {#if searchQuery.length > 0} | 91 | {#if searchQuery.length > 0} |
| 85 | <div class="suggestions"> | 92 | <div class="suggestions"> |
| 86 | <ul> | 93 | <ul> |
| 87 | {#each results as result} | 94 | {#each results as result} |
| 88 | <li class="result-row"> | 95 | <li class="result-row"> |
| 89 | <a | 96 | <a |
| 90 | href={makeResultLink(result.category, result.sectionName, result.name)} | 97 | href={makeResultLink( |
| 91 | title={makeTitle(result.type, result.description)} | 98 | result.category, |
| 99 | result.sectionName, | ||
| 100 | result.name, | ||
| 101 | )} | ||
| 102 | title={makeTitle(result.type, result.description)} | ||
| 92 | > | 103 | > |
| 93 | <span class="name"> | 104 | <span class="name"> |
| 94 | {#if result.type === 'Service'} | 105 | {#if result.type === 'Service'} |
| 95 | <img src={makeLogoSrc(result.logo, result.url)} alt={result.name} width="20" height="20" loading="lazy" /> | 106 | <img |
| 96 | {/if} | 107 | src={makeLogoSrc(result.logo, result.url)} |
| 97 | 108 | alt={result.name} | |
| 98 | {makeResultText(result.category, result.sectionName, result.name)} | 109 | width="20" |
| 99 | 110 | height="20" | |
| 100 | {#if result.itemCount} | 111 | loading="lazy" |
| 101 | <i>({result.itemCount})</i> | 112 | /> |
| 102 | {/if} | 113 | {/if} |
| 103 | </span> | 114 | |
| 104 | <span class="path"> | 115 | {makeResultText( |
| 105 | {result.category ? `${result.category}` : ''} | 116 | result.category, |
| 106 | {result.sectionName ? `➔ ${result.sectionName}` : ''} | 117 | result.sectionName, |
| 107 | {result.name ? `➔ ${result.name}` : ''} | 118 | result.name, |
| 108 | </span> | 119 | )} |
| 109 | </a> | 120 | |
| 110 | </li> | 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> | ||
| 111 | {/each} | 132 | {/each} |
| 112 | </ul> | 133 | </ul> |
| 113 | </div> | 134 | </div> |
| @@ -115,103 +136,101 @@ | |||
| 115 | </div> | 136 | </div> |
| 116 | 137 | ||
| 117 | <style lang="scss"> | 138 | <style lang="scss"> |
| 118 | 139 | .search-wrap { | |
| 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; | ||
| 129 | display: flex; | 140 | display: flex; |
| 130 | justify-content: space-between; | 141 | flex-direction: column; |
| 131 | align-items: center; | 142 | position: relative; |
| 132 | flex-wrap: wrap; | 143 | margin: 1rem auto; |
| 133 | .enter-hint { | 144 | max-width: 900px; |
| 134 | font-size:0.8rem; | 145 | margin: 0 auto; |
| 135 | opacity: 0.7; | 146 | width: 80vw; |
| 136 | } | 147 | label { |
| 137 | } | 148 | margin: 0.5rem 0; |
| 138 | 149 | display: flex; | |
| 139 | input { | 150 | justify-content: space-between; |
| 140 | padding: 0.5rem 1rem; | 151 | align-items: center; |
| 141 | font-size: 1.8rem; | 152 | flex-wrap: wrap; |
| 142 | border: 2px solid var(--box-outline); | 153 | .enter-hint { |
| 143 | border-radius: var(--curve-lg); | 154 | font-size: 0.8rem; |
| 144 | box-shadow: 3px 3px 0 var(--box-outline); | 155 | opacity: 0.7; |
| 145 | z-index: 4; | 156 | } |
| 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); | ||
| 152 | } | 157 | } |
| 153 | } | ||
| 154 | |||
| 155 | .suggestions { | ||
| 156 | ul { | ||
| 157 | position: absolute; | ||
| 158 | background: var(--background-form); | ||
| 159 | z-index: 3; | ||
| 160 | width: 100%; | ||
| 161 | 158 | ||
| 162 | list-style: none; | 159 | input { |
| 163 | padding: 0; | 160 | padding: 0.5rem 1rem; |
| 164 | margin: 0; | 161 | font-size: 1.8rem; |
| 165 | border: 2px solid var(--box-outline); | 162 | border: 2px solid var(--box-outline); |
| 166 | border-radius: 0 0 var(--curve-lg) var(--curve-lg); | 163 | border-radius: var(--curve-lg); |
| 167 | box-shadow: 3px 3px 0 var(--box-outline); | 164 | box-shadow: 3px 3px 0 var(--box-outline); |
| 168 | transform: translateY(-0.5rem); | 165 | z-index: 4; |
| 169 | max-height: 500px; | 166 | background: var(--accent-fg); |
| 170 | overflow-y: scroll; | 167 | color: var(--foreground); |
| 171 | background: var(--background-form); | 168 | &:focus { |
| 172 | li.result-row { | 169 | outline: none; |
| 173 | padding: 0.5rem 1rem; | 170 | border-color: var(--accent); |
| 174 | margin: 0.5rem 0; | 171 | box-shadow: 3px 3px 0 var(--accent); |
| 175 | a { | 172 | } |
| 176 | color: var(--foreground); | 173 | } |
| 177 | text-decoration: none; | 174 | |
| 178 | display: flex; | 175 | .suggestions { |
| 179 | justify-content: space-between; | 176 | ul { |
| 180 | flex-wrap: wrap; | 177 | position: absolute; |
| 181 | .name { | 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; | ||
| 182 | display: flex; | 198 | display: flex; |
| 183 | align-items: center; | 199 | justify-content: space-between; |
| 184 | gap: 0.5rem; | 200 | flex-wrap: wrap; |
| 185 | i { | 201 | .name { |
| 186 | color: var(--accent); | 202 | display: flex; |
| 187 | font-weight: bold; | 203 | align-items: center; |
| 188 | font-style: normal; | 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 | } | ||
| 189 | } | 220 | } |
| 190 | img { | 221 | .path { |
| 191 | border-radius: var(--curve-md); | 222 | font-size: 0.85rem; |
| 192 | width: 1.25rem; | 223 | opacity: 0.7; |
| 193 | height: 1.25rem; | ||
| 194 | font-size: 10px; | ||
| 195 | color: var(--accent); | ||
| 196 | overflow: hidden; | ||
| 197 | background: #f453974d; | ||
| 198 | padding: 1px; | ||
| 199 | } | 224 | } |
| 200 | } | 225 | } |
| 201 | .path { | 226 | &:hover { |
| 202 | font-size: 0.85rem; | 227 | background: var(--accent); |
| 203 | opacity: 0.7; | 228 | .name i { |
| 204 | } | 229 | color: var(--accent-fg); |
| 205 | } | 230 | } |
| 206 | &:hover { | ||
| 207 | background: var(--accent); | ||
| 208 | .name i { | ||
| 209 | color: var(--accent-fg); | ||
| 210 | } | 231 | } |
| 211 | } | 232 | } |
| 212 | } | 233 | } |
| 213 | } | 234 | } |
| 214 | } | 235 | } |
| 215 | } | ||
| 216 | |||
| 217 | </style> | 236 | </style> |
web/src/components/things/SectionList.astro +148 −133
| @@ -1,6 +1,4 @@ | |||
| 1 | --- | 1 | --- |
| 2 | |||
| 3 | |||
| 4 | import FontAwesome from '@components/form/FontAwesome.svelte'; | 2 | import FontAwesome from '@components/form/FontAwesome.svelte'; |
| 5 | import { slugify } from '../../utils/fetch-data'; | 3 | import { slugify } from '../../utils/fetch-data'; |
| 6 | 4 | ||
| @@ -9,144 +7,161 @@ import type { Section } from '../../types/Service'; | |||
| 9 | interface Props { | 7 | interface Props { |
| 10 | title: string; | 8 | title: string; |
| 11 | sections: Section[]; | 9 | sections: Section[]; |
| 12 | bigTitle?: boolean; | 10 | bigTitle?: boolean; |
| 13 | } | 11 | } |
| 14 | 12 | ||
| 15 | const { title, sections, bigTitle } = Astro.props; | 13 | const { title, sections, bigTitle } = Astro.props; |
| 16 | |||
| 17 | --- | 14 | --- |
| 18 | 15 | ||
| 19 | <div class="wrap"> | 16 | <div class="wrap"> |
| 20 | 17 | { | |
| 21 | { bigTitle ? | 18 | bigTitle ? ( |
| 22 | <h2><FontAwesome iconName={slugify(title)} />{title} </h2> : | 19 | <h2> |
| 23 | <a class="category-title" href={`/${slugify(title)}`}><h3>{title}</h3></a> | 20 | <FontAwesome iconName={slugify(title)} /> |
| 24 | } | 21 | {title}{' '} |
| 25 | 22 | </h2> | |
| 26 | { !bigTitle && <span class="section-icon"><FontAwesome iconName={slugify(title)} /></span> } | 23 | ) : ( |
| 27 | 24 | <a class="category-title" href={`/${slugify(title)}`}> | |
| 28 | <ul> | 25 | <h3>{title}</h3> |
| 29 | {sections.map((section) => ( | 26 | </a> |
| 30 | <li class="section"> | 27 | ) |
| 31 | <a href={`/${slugify(title)}/${slugify(section.name)}`}> | 28 | } |
| 32 | <span>{section.name}</span> | 29 | |
| 33 | <span class="service-count">({section.services ? section.services.length : 0})</span> | 30 | { |
| 34 | </a> | 31 | !bigTitle && ( |
| 35 | </li> | 32 | <span class="section-icon"> |
| 36 | ))} | 33 | <FontAwesome iconName={slugify(title)} /> |
| 37 | </ul> | 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> | ||
| 38 | </div> | 52 | </div> |
| 39 | 53 | ||
| 40 | |||
| 41 | <style lang="scss"> | 54 | <style lang="scss"> |
| 42 | 55 | .wrap { | |
| 43 | .wrap { | 56 | position: relative; |
| 44 | position: relative; | 57 | &:hover { |
| 45 | &:hover { | 58 | .section-icon :global(svg) { |
| 46 | .section-icon :global(svg){ | 59 | opacity: 1; |
| 47 | opacity: 1; | 60 | transform: scale(1.2); |
| 48 | transform: scale(1.2); | 61 | } |
| 49 | } | 62 | } |
| 50 | } | 63 | } |
| 51 | } | 64 | |
| 52 | 65 | h2 { | |
| 53 | h2 { | 66 | font-family: 'Lekton', sans-serif; |
| 54 | font-family: "Lekton", sans-serif; | 67 | font-size: 2rem; |
| 55 | font-size: 2rem; | 68 | margin: -2rem 0 2rem -2rem; |
| 56 | margin: -2rem 0 2rem -2rem; | 69 | box-shadow: 6px 6px 0 var(--box-outline); |
| 57 | box-shadow: 6px 6px 0 var(--box-outline); | 70 | border: 2px solid var(--box-outline); |
| 58 | border: 2px solid var(--box-outline); | 71 | background: var(--accent); |
| 59 | background: var(--accent); | 72 | color: var(--accent-fg); |
| 60 | color: var(--accent-fg); | 73 | width: fit-content; |
| 61 | width: fit-content; | 74 | padding: 0.25rem 0.5rem; |
| 62 | padding: 0.25rem 0.5rem; | 75 | display: flex; |
| 63 | display: flex; | 76 | justify-content: center; |
| 64 | justify-content: center; | 77 | gap: 1rem; |
| 65 | gap: 1rem; | 78 | :global(svg) { |
| 66 | :global(svg) { | 79 | width: 2rem; |
| 67 | width: 2rem; | 80 | height: 2rem; |
| 68 | height: 2rem; | 81 | color: var(--accent-fg); |
| 69 | color: var(--accent-fg); | 82 | } |
| 70 | } | 83 | } |
| 71 | } | 84 | |
| 72 | 85 | .category-title { | |
| 73 | .category-title { | 86 | text-decoration: none; |
| 74 | text-decoration: none; | 87 | color: var(--foreground); |
| 75 | color: var(--foreground); | 88 | z-index: 2; |
| 76 | z-index: 2; | 89 | position: relative; |
| 77 | position: relative; | 90 | h3 { |
| 78 | h3 { | 91 | font-family: 'Lekton', sans-serif; |
| 79 | font-family: "Lekton", sans-serif; | 92 | font-weight: bold; |
| 80 | font-weight: bold; | 93 | margin: 0; |
| 81 | margin: 0; | 94 | font-size: 1.8rem; |
| 82 | font-size: 1.8rem; | 95 | position: relative; |
| 83 | position: relative; | 96 | &:after { |
| 84 | &:after { | 97 | background: none repeat scroll 0 0 transparent; |
| 85 | background: none repeat scroll 0 0 transparent; | 98 | bottom: 0; |
| 86 | bottom: 0; | 99 | content: ''; |
| 87 | content: ""; | 100 | display: block; |
| 88 | display: block; | 101 | height: 3px; |
| 89 | height: 3px; | 102 | left: 50%; |
| 90 | left: 50%; | 103 | position: absolute; |
| 91 | position: absolute; | 104 | background: var(--accent); |
| 92 | background: var(--accent); | 105 | transition: |
| 93 | transition: width 0.3s ease 0s, left 0.3s ease 0s; | 106 | width 0.3s ease 0s, |
| 94 | width: 0; | 107 | left 0.3s ease 0s; |
| 95 | } | 108 | width: 0; |
| 96 | &:hover:after { | 109 | } |
| 97 | width: 80%; | 110 | &:hover:after { |
| 98 | left: 0; | 111 | width: 80%; |
| 99 | } | 112 | left: 0; |
| 100 | } | 113 | } |
| 101 | 114 | } | |
| 102 | } | 115 | } |
| 103 | 116 | ||
| 104 | ul { | 117 | ul { |
| 105 | list-style: circle; | 118 | list-style: circle; |
| 106 | padding-left: 1rem; | 119 | padding-left: 1rem; |
| 107 | li { | 120 | li { |
| 108 | margin: 0.5rem 0; | 121 | margin: 0.5rem 0; |
| 109 | font-size: 1.25rem; | 122 | font-size: 1.25rem; |
| 110 | a { | 123 | a { |
| 111 | text-decoration: none; | 124 | text-decoration: none; |
| 112 | color: var(--foreground); | 125 | color: var(--foreground); |
| 113 | position: relative; | 126 | position: relative; |
| 114 | &:after { | 127 | &:after { |
| 115 | background: none repeat scroll 0 0 transparent; | 128 | background: none repeat scroll 0 0 transparent; |
| 116 | bottom: 0; | 129 | bottom: 0; |
| 117 | content: ""; | 130 | content: ''; |
| 118 | display: block; | 131 | display: block; |
| 119 | height: 2px; | 132 | height: 2px; |
| 120 | left: 50%; | 133 | left: 50%; |
| 121 | position: absolute; | 134 | position: absolute; |
| 122 | background: var(--accent-3); | 135 | background: var(--accent-3); |
| 123 | transition: width 0.15s ease 0s, left 0.15s ease 0s; | 136 | transition: |
| 124 | width: 0; | 137 | width 0.15s ease 0s, |
| 125 | } | 138 | left 0.15s ease 0s; |
| 126 | &:hover:after { | 139 | width: 0; |
| 127 | text-decoration: underline; | 140 | } |
| 128 | width: 80%; | 141 | &:hover:after { |
| 129 | left: 0; | 142 | text-decoration: underline; |
| 130 | } | 143 | width: 80%; |
| 131 | } | 144 | left: 0; |
| 132 | .service-count { | 145 | } |
| 133 | color: var(--accent-3); | 146 | } |
| 134 | } | 147 | .service-count { |
| 135 | } | 148 | color: var(--accent-3); |
| 136 | } | 149 | } |
| 137 | 150 | } | |
| 138 | .section-icon { | 151 | } |
| 139 | position: absolute; | 152 | |
| 140 | right: 0; | 153 | .section-icon { |
| 141 | top: 0; | 154 | position: absolute; |
| 142 | width: fit-content; | 155 | right: 0; |
| 143 | :global(svg) { | 156 | top: 0; |
| 144 | width: 2rem; | 157 | width: fit-content; |
| 145 | height: 2rem; | 158 | :global(svg) { |
| 146 | opacity: 0.5; | 159 | width: 2rem; |
| 147 | text-shadow: 3px 3px 0 black; | 160 | height: 2rem; |
| 148 | color: var(--accent-3); | 161 | opacity: 0.5; |
| 149 | transition: all 0.2s ease-in-out; | 162 | text-shadow: 3px 3px 0 black; |
| 150 | } | 163 | color: var(--accent-3); |
| 151 | } | 164 | transition: all 0.2s ease-in-out; |
| 165 | } | ||
| 166 | } | ||
| 152 | </style> | 167 | </style> |
web/src/components/things/ServiceCard.astro +75 −71
| @@ -1,5 +1,4 @@ | |||
| 1 | --- | 1 | --- |
| 2 | |||
| 3 | import { formatLink } from '@utils/parse-markdown'; | 2 | import { formatLink } from '@utils/parse-markdown'; |
| 4 | import type { Service } from 'src/types/Service'; | 3 | import type { Service } from 'src/types/Service'; |
| 5 | import FontAwesome from '@components/form/FontAwesome.svelte'; | 4 | import FontAwesome from '@components/form/FontAwesome.svelte'; |
| @@ -7,86 +6,91 @@ import SaveListing from '@components/things/SaveListing.svelte'; | |||
| 7 | import { slugify } from '@utils/fetch-data'; | 6 | import { slugify } from '@utils/fetch-data'; |
| 8 | 7 | ||
| 9 | interface Props { | 8 | interface Props { |
| 10 | service: Service; | 9 | service: Service; |
| 11 | categoryName: string; | 10 | categoryName: string; |
| 12 | sectionName: string; | 11 | sectionName: string; |
| 13 | } | 12 | } |
| 14 | 13 | ||
| 15 | const { | 14 | const { service, sectionName, categoryName } = Astro.props; |
| 16 | service, | ||
| 17 | sectionName, | ||
| 18 | categoryName, | ||
| 19 | } = Astro.props; | ||
| 20 | |||
| 21 | --- | 15 | --- |
| 22 | 16 | ||
| 23 | <script> | 17 | <script> |
| 24 | document.addEventListener('DOMContentLoaded', () => { | 18 | document.addEventListener('DOMContentLoaded', () => { |
| 25 | const serviceIcons = document.querySelectorAll<HTMLImageElement>('.service-icon'); | 19 | const serviceIcons = |
| 26 | const broke = '/broken-image.png'; | 20 | document.querySelectorAll<HTMLImageElement>('.service-icon'); |
| 21 | const broke = '/broken-image.png'; | ||
| 27 | 22 | ||
| 28 | serviceIcons.forEach(function(icon) { | 23 | serviceIcons.forEach(function (icon) { |
| 29 | icon.onerror = function() { | 24 | icon.onerror = function () { |
| 30 | const imgElement = this as HTMLImageElement; | 25 | const imgElement = this as HTMLImageElement; |
| 31 | const serviceUrl = imgElement.getAttribute('data-service-url'); | 26 | const serviceUrl = imgElement.getAttribute('data-service-url'); |
| 32 | const newSrcAttribute = (imgElement.src.includes('on.ho') ? broke : `https://icon.horse/icon/${serviceUrl}`); | 27 | const newSrcAttribute = imgElement.src.includes('on.ho') |
| 33 | imgElement.src = imgElement.src !== newSrcAttribute ? newSrcAttribute : broke; | 28 | ? broke |
| 34 | imgElement.onerror = null; | 29 | : `https://icon.horse/icon/${serviceUrl}`; |
| 35 | }; | 30 | imgElement.src = |
| 36 | }); | 31 | imgElement.src !== newSrcAttribute ? newSrcAttribute : broke; |
| 37 | }); | 32 | imgElement.onerror = null; |
| 33 | }; | ||
| 34 | }); | ||
| 35 | }); | ||
| 38 | </script> | 36 | </script> |
| 39 | 37 | ||
| 40 | |||
| 41 | |||
| 42 | <div class="service" id={slugify(service.name)}> | 38 | <div class="service" id={slugify(service.name)}> |
| 43 | <div class="service-head"> | 39 | <div class="service-head"> |
| 44 | <a class="service-title" href={`/${slugify(categoryName)}/${slugify(sectionName)}/${slugify(service.name)}`}> | 40 | <a |
| 45 | <h4>{service.name}</h4> | 41 | class="service-title" |
| 46 | </a> | 42 | href={`/${slugify(categoryName)}/${slugify(sectionName)}/${slugify(service.name)}`} |
| 47 | {service.followWith && <p class="follow-with">({service.followWith})</p> } | 43 | > |
| 48 | </div> | 44 | <h4>{service.name}</h4> |
| 49 | 45 | </a> | |
| 50 | <div class="save-listing"> | 46 | {service.followWith && <p class="follow-with">({service.followWith})</p>} |
| 51 | <SaveListing client:visible | 47 | </div> |
| 52 | categoryName={categoryName} | ||
| 53 | sectionName={sectionName} | ||
| 54 | serviceName={service.name} | ||
| 55 | /> | ||
| 56 | </div> | ||
| 57 | 48 | ||
| 58 | <div class="service-body"> | 49 | <div class="save-listing"> |
| 59 | <img | 50 | <SaveListing |
| 60 | width="40" | 51 | client:visible |
| 61 | height="40" | 52 | categoryName={categoryName} |
| 62 | loading="lazy" | 53 | sectionName={sectionName} |
| 63 | decoding="async" | 54 | serviceName={service.name} |
| 64 | class="service-icon" | 55 | /> |
| 65 | alt={`${service.name} Icon`} | 56 | </div> |
| 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> | ||
| 73 | 57 | ||
| 74 | <div class="service-links"> | 58 | <div class="service-body"> |
| 75 | <a class="link" href={service.url}> | 59 | <img |
| 76 | <FontAwesome iconName="website"/> <span>{formatLink(service.url)}</span> | 60 | width="40" |
| 77 | </a> | 61 | height="40" |
| 78 | {service.github && | 62 | loading="lazy" |
| 79 | <a class="link" href={`https://github.com/${service.github}`}> | 63 | decoding="async" |
| 80 | <FontAwesome iconName="sourceCode"/> GitHub | 64 | class="service-icon" |
| 81 | </a> | 65 | alt={`${service.name} Icon`} |
| 82 | } | 66 | data-service-url={formatLink(service.url)} |
| 83 | <a href={`/${slugify(categoryName)}/${slugify(sectionName)}/${slugify(service.name)}`}> | 67 | src={service.icon || `https://icon.horse/icon/${formatLink(service.url)}`} |
| 84 | <FontAwesome iconName="viewReport" /> View Report ➔ | 68 | /> |
| 85 | </a> | 69 | <div class="service-body"> |
| 70 | <p set:html={service.description} /> | ||
| 71 | </div> | ||
| 72 | </div> | ||
| 86 | 73 | ||
| 87 | </div> | 74 | <div class="service-links"> |
| 88 | </div> | 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> | ||
| 89 | 93 | ||
| 90 | <style lang="scss"> | 94 | <style lang="scss"> |
| 91 | @import './service-card.scss'; | 95 | @import './service-card.scss'; |
| 92 | </style> | 96 | </style> |
web/src/components/things/ServiceCard.svelte +5 −6
| @@ -17,7 +17,10 @@ | |||
| 17 | 17 | ||
| 18 | <div class="service" id={serviceRef}> | 18 | <div class="service" id={serviceRef}> |
| 19 | <div class="service-head"> | 19 | <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 | > | ||
| 21 | <h4>{service.name}</h4> | 24 | <h4>{service.name}</h4> |
| 22 | </a> | 25 | </a> |
| 23 | {#if service.followWith} | 26 | {#if service.followWith} |
| @@ -26,11 +29,7 @@ | |||
| 26 | </div> | 29 | </div> |
| 27 | 30 | ||
| 28 | <div class="save-listing"> | 31 | <div class="save-listing"> |
| 29 | <SaveListing | 32 | <SaveListing {categoryName} {sectionName} serviceName={service.name} /> |
| 30 | categoryName={categoryName} | ||
| 31 | sectionName={sectionName} | ||
| 32 | serviceName={service.name} | ||
| 33 | /> | ||
| 34 | </div> | 33 | </div> |
| 35 | 34 | ||
| 36 | <div class="service-body"> | 35 | <div class="service-body"> |
web/src/components/things/ServiceList.astro +361 −301
| @@ -1,5 +1,4 @@ | |||
| 1 | --- | 1 | --- |
| 2 | |||
| 3 | import Button from '@components/form/Button.astro'; | 2 | import Button from '@components/form/Button.astro'; |
| 4 | import { parseMarkdown, formatLink } from '@utils/parse-markdown'; | 3 | import { parseMarkdown, formatLink } from '@utils/parse-markdown'; |
| 5 | import type { Service } from 'src/types/Service'; | 4 | import type { Service } from 'src/types/Service'; |
| @@ -11,326 +10,387 @@ import GitHubMetrics from '@components/things/ItemGitHubMetrics.astro'; | |||
| 11 | import SaveListing from '@components/things/SaveListing.svelte'; | 10 | import SaveListing from '@components/things/SaveListing.svelte'; |
| 12 | 11 | ||
| 13 | interface Props { | 12 | interface Props { |
| 14 | services: Service[]; | 13 | services: Service[]; |
| 15 | subHeading?: boolean; | 14 | subHeading?: boolean; |
| 16 | buttonLink?: string; | 15 | buttonLink?: string; |
| 17 | noGitHubMetrics?: boolean; | 16 | noGitHubMetrics?: boolean; |
| 18 | sectionName: string; | 17 | sectionName: string; |
| 19 | categoryName: string; | 18 | categoryName: string; |
| 20 | } | 19 | } |
| 21 | 20 | ||
| 22 | const { | 21 | const { |
| 23 | services, | 22 | services, |
| 24 | subHeading, | 23 | subHeading, |
| 25 | buttonLink, | 24 | buttonLink, |
| 26 | noGitHubMetrics, | 25 | noGitHubMetrics, |
| 27 | sectionName, | 26 | sectionName, |
| 28 | categoryName, | 27 | categoryName, |
| 29 | } = Astro.props; | 28 | } = Astro.props; |
| 30 | |||
| 31 | --- | 29 | --- |
| 32 | 30 | ||
| 33 | <script> | 31 | <script> |
| 34 | document.addEventListener('DOMContentLoaded', () => { | 32 | document.addEventListener('DOMContentLoaded', () => { |
| 35 | const serviceIcons = document.querySelectorAll<HTMLImageElement>('.service-icon'); | 33 | const serviceIcons = |
| 36 | const broke = '/broken-image.png'; | 34 | document.querySelectorAll<HTMLImageElement>('.service-icon'); |
| 35 | const broke = '/broken-image.png'; | ||
| 37 | 36 | ||
| 38 | serviceIcons.forEach(function(icon) { | 37 | serviceIcons.forEach(function (icon) { |
| 39 | icon.onerror = function() { | 38 | icon.onerror = function () { |
| 40 | const imgElement = this as HTMLImageElement; | 39 | const imgElement = this as HTMLImageElement; |
| 41 | const serviceUrl = imgElement.getAttribute('data-service-url'); | 40 | const serviceUrl = imgElement.getAttribute('data-service-url'); |
| 42 | const newSrcAttribute = (imgElement.src.includes('on.ho') ? broke : `https://icon.horse/icon/${serviceUrl}`); | 41 | const newSrcAttribute = imgElement.src.includes('on.ho') |
| 43 | imgElement.src = imgElement.src !== newSrcAttribute ? newSrcAttribute : broke; | 42 | ? broke |
| 44 | imgElement.onerror = null; | 43 | : `https://icon.horse/icon/${serviceUrl}`; |
| 45 | }; | 44 | imgElement.src = |
| 46 | }); | 45 | imgElement.src !== newSrcAttribute ? newSrcAttribute : broke; |
| 47 | }); | 46 | imgElement.onerror = null; |
| 47 | }; | ||
| 48 | }); | ||
| 49 | }); | ||
| 48 | </script> | 50 | </script> |
| 49 | 51 | ||
| 50 | |||
| 51 | |||
| 52 | <section> | 52 | <section> |
| 53 | {services && services.length > 0 ? ( | 53 | { |
| 54 | <ul> | 54 | services && services.length > 0 ? ( |
| 55 | {services.map((service: Service) => ( | 55 | <ul> |
| 56 | <li id={slugify(service.name)}> | 56 | {services.map((service: Service) => ( |
| 57 | <DeleteListing client:load categoryName={categoryName} sectionName={sectionName} serviceName={service.name} /> | 57 | <li id={slugify(service.name)}> |
| 58 | <div class="save-listing"> | 58 | <DeleteListing |
| 59 | <SaveListing client:visible | 59 | client:load |
| 60 | categoryName={categoryName} | 60 | categoryName={categoryName} |
| 61 | sectionName={sectionName} | 61 | sectionName={sectionName} |
| 62 | serviceName={service.name} | 62 | serviceName={service.name} |
| 63 | /> | 63 | /> |
| 64 | </div> | 64 | <div class="save-listing"> |
| 65 | <div class="service-head"> | 65 | <SaveListing |
| 66 | <img | 66 | client:visible |
| 67 | width="40" | 67 | categoryName={categoryName} |
| 68 | height="40" | 68 | sectionName={sectionName} |
| 69 | loading="lazy" | 69 | serviceName={service.name} |
| 70 | decoding="async" | 70 | /> |
| 71 | class="service-icon" | 71 | </div> |
| 72 | alt={`${service.name} Icon`} | 72 | <div class="service-head"> |
| 73 | data-service-url={formatLink(service.url)} | 73 | <img |
| 74 | src={service.icon || `https://icon.horse/icon/${formatLink(service.url)}`} | 74 | width="40" |
| 75 | /> | 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 | /> | ||
| 76 | 86 | ||
| 77 | <a class="service-title" href={`/${slugify(categoryName)}/${slugify(sectionName)}/${slugify(service.name)}`}> | 87 | <a |
| 78 | {subHeading ? <h4>{service.name}</h4> : <h3>{service.name}</h3>} | 88 | class="service-title" |
| 79 | </a> | 89 | href={`/${slugify(categoryName)}/${slugify(sectionName)}/${slugify(service.name)}`} |
| 80 | {service.followWith && <p class="follow-with">({service.followWith})</p> } | 90 | > |
| 81 | <a class="service-link" href={service.url}>{formatLink(service.url)}</a> | 91 | {subHeading ? <h4>{service.name}</h4> : <h3>{service.name}</h3>} |
| 82 | </div> | 92 | </a> |
| 83 | <div class="service-body"> | 93 | {service.followWith && ( |
| 84 | <p set:html={parseMarkdown(service.description)}></p> | 94 | <p class="follow-with">({service.followWith})</p> |
| 85 | <div class="service-stats"> | 95 | )} |
| 86 | <div class="left"> | 96 | <a class="service-link" href={service.url}> |
| 87 | { service.securityAudited && ( | 97 | {formatLink(service.url)} |
| 88 | <span class="meta-item great" title={`${service.name} has been security audited by an accredited auditor, with results published publicly`}> | 98 | </a> |
| 89 | <FontAwesome iconName="securityAudited" /> Security Audited | 99 | </div> |
| 90 | </span> | 100 | <div class="service-body"> |
| 91 | )} | 101 | <p set:html={parseMarkdown(service.description)} /> |
| 92 | { service.acceptsCrypto && ( | 102 | <div class="service-stats"> |
| 93 | <span class="meta-item great" title={`${service.name} accepts anonymous payment methods`}> | 103 | <div class="left"> |
| 94 | <FontAwesome iconName="cryptoAccepted" /> Crypto Payments Accepted | 104 | {service.securityAudited && ( |
| 95 | </span> | 105 | <span |
| 96 | )} | 106 | class="meta-item great" |
| 97 | { service.securityAudited === false && ( | 107 | title={`${service.name} has been security audited by an accredited auditor, with results published publicly`} |
| 98 | <span class="meta-item warning" title={`${service.name} has not been audited`}> | 108 | > |
| 99 | <FontAwesome iconName="notSecurityAudited" /> No Security Audit | 109 | <FontAwesome iconName="securityAudited" /> Security |
| 100 | </span> | 110 | Audited |
| 101 | )} | 111 | </span> |
| 102 | { (service.openSource === false) && ( | 112 | )} |
| 103 | <span class="warning"> | 113 | {service.acceptsCrypto && ( |
| 104 | <FontAwesome iconName="closedSource" /> | 114 | <span |
| 105 | Not Open Source | 115 | class="meta-item great" |
| 106 | </span> | 116 | title={`${service.name} accepts anonymous payment methods`} |
| 107 | )} | 117 | > |
| 108 | { service.openSource || (service.github && service.openSource !== false) ? ( | 118 | <FontAwesome iconName="cryptoAccepted" /> Crypto Payments |
| 109 | <span class="meta-item great" title={`${service.name} is open source`}> | 119 | Accepted |
| 110 | <FontAwesome iconName="openSource" /> Open Source | 120 | </span> |
| 111 | </span> | 121 | )} |
| 112 | ) : null } | 122 | {service.securityAudited === false && ( |
| 113 | { service.github && !noGitHubMetrics && <GitHubMetrics github={service.github} /> } | 123 | <span |
| 114 | { service.github && noGitHubMetrics && ( | 124 | class="meta-item warning" |
| 115 | <span class="meta-item" title={`View ${service.name} on GitHub`}> | 125 | title={`${service.name} has not been audited`} |
| 116 | <a href={`https://github.com/${service.github}`} target="_blank"> | 126 | > |
| 117 | <FontAwesome iconName="github" /> {service.github} | 127 | <FontAwesome iconName="notSecurityAudited" /> No Security |
| 118 | </a> | 128 | Audit |
| 119 | </span> | 129 | </span> |
| 120 | ) } | 130 | )} |
| 121 | </div> | 131 | {service.openSource === false && ( |
| 122 | <div class="view-service"> | 132 | <span class="warning"> |
| 123 | <a href={`/${slugify(categoryName)}/${slugify(sectionName)}/${slugify(service.name)}`}>View {service.name} Report</a> | 133 | <FontAwesome iconName="closedSource" /> |
| 124 | </div> | 134 | Not Open Source |
| 125 | </div> | 135 | </span> |
| 126 | </div> | 136 | )} |
| 127 | </li> | 137 | {service.openSource || |
| 128 | ))} | 138 | (service.github && service.openSource !== false) ? ( |
| 129 | </ul> | 139 | <span |
| 130 | ) : ( | 140 | class="meta-item great" |
| 131 | <p class="nothing-yet"> | 141 | title={`${service.name} is open source`} |
| 132 | <strong>⚠️ This section is still a work in progress ⚠️</strong><br /> | 142 | > |
| 133 | Check back soon, or help us complete it by submiting a pull request on GitHub. | 143 | <FontAwesome iconName="openSource" /> Open Source |
| 134 | <br /> | 144 | </span> |
| 135 | <span class="quick-submit">Or submit an entry <a href="/submit">here</a></span> | 145 | ) : null} |
| 136 | </p> | 146 | {service.github && !noGitHubMetrics && ( |
| 137 | )} | 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 | } | ||
| 138 | 190 | ||
| 139 | {buttonLink && ( | 191 | { |
| 140 | <Button title={`View all ${categoryName}`} className="view-all" text="View More..." url={buttonLink} /> | 192 | buttonLink && ( |
| 141 | )} | 193 | <Button |
| 194 | title={`View all ${categoryName}`} | ||
| 195 | className="view-all" | ||
| 196 | text="View More..." | ||
| 197 | url={buttonLink} | ||
| 198 | /> | ||
| 199 | ) | ||
| 200 | } | ||
| 142 | </section> | 201 | </section> |
| 143 | 202 | ||
| 144 | |||
| 145 | <style lang="scss"> | 203 | <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 | } | ||
| 146 | 271 | ||
| 147 | section { | 272 | .service-icon { |
| 148 | padding: 1rem 0; | 273 | width: 2.5rem; |
| 149 | position: relative; | 274 | height: 2.5rem; |
| 150 | &:not(:last-child) { | 275 | border-radius: var(--curve-sm); |
| 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 | } | ||
| 192 | 276 | ||
| 193 | position: relative; | 277 | font-size: 10px; |
| 194 | &:after { | 278 | overflow: hidden; |
| 195 | background: none repeat scroll 0 0 transparent; | 279 | color: var(--accent); |
| 196 | bottom: 0; | 280 | } |
| 197 | content: ""; | 281 | .follow-with { |
| 198 | display: block; | 282 | opacity: 0.7; |
| 199 | height: 3px; | 283 | font-style: italic; |
| 200 | left: 50%; | 284 | margin: 0; |
| 201 | position: absolute; | 285 | } |
| 202 | background: var(--accent-3); | 286 | .service-link { |
| 203 | transition: width 0.3s ease 0s, left 0.3s ease 0s; | 287 | max-width: 300px; |
| 204 | width: 0; | 288 | text-overflow: ellipsis; |
| 205 | } | 289 | overflow: hidden; |
| 206 | &:hover:after { | 290 | white-space: nowrap; |
| 207 | width: 100%; | 291 | } |
| 208 | left: 0; | 292 | } |
| 209 | } | ||
| 210 | } | ||
| 211 | |||
| 212 | .service-icon { | ||
| 213 | width: 2.5rem; | ||
| 214 | height: 2.5rem; | ||
| 215 | border-radius: var(--curve-sm); | ||
| 216 | 293 | ||
| 217 | font-size: 10px; | 294 | .service-body { |
| 218 | overflow: hidden; | 295 | margin: 0.5rem 0 2rem; |
| 219 | color: var(--accent); | 296 | opacity: 0.8; |
| 220 | } | 297 | :global(p) { |
| 221 | .follow-with { | 298 | margin: 0; |
| 222 | opacity: 0.7; | 299 | font-size: 1.2rem; |
| 223 | font-style: italic; | 300 | :global(a) { |
| 224 | margin: 0; | 301 | color: var(--foregorund); |
| 225 | } | 302 | } |
| 226 | .service-link { | 303 | } |
| 227 | max-width: 300px; | 304 | .service-stats { |
| 228 | text-overflow: ellipsis; | 305 | .left { |
| 229 | overflow: hidden; | 306 | display: flex; |
| 230 | white-space: nowrap; | 307 | gap: 1rem; |
| 231 | } | 308 | flex-wrap: wrap; |
| 232 | } | 309 | align-items: center; |
| 233 | 310 | } | |
| 234 | .service-body { | 311 | display: flex; |
| 235 | margin: 0.5rem 0 2rem; | 312 | gap: 1rem; |
| 236 | opacity: 0.8; | 313 | flex-wrap: wrap; |
| 237 | :global(p) { | 314 | align-items: center; |
| 238 | margin: 0; | 315 | justify-content: space-between; |
| 239 | font-size: 1.2rem; | 316 | } |
| 240 | :global(a) { | 317 | .view-service { |
| 241 | color: var(--foregorund); | 318 | transition: all 0.2s ease-in-out; |
| 242 | } | 319 | opacity: 0.95; |
| 243 | } | 320 | a { |
| 244 | .service-stats { | 321 | padding: 0.25rem 0.6rem; |
| 245 | .left { | 322 | width: fit-content; |
| 246 | display: flex; | 323 | right: 1rem; |
| 247 | gap: 1rem; | 324 | font-size: 0.9rem; |
| 248 | flex-wrap: wrap; | 325 | background: var(--accent-3); |
| 249 | align-items: center; | 326 | color: var(--accent-fg); |
| 250 | } | 327 | text-decoration: none; |
| 251 | display: flex; | 328 | border-radius: var(--curve-md); |
| 252 | gap: 1rem; | 329 | } |
| 253 | flex-wrap: wrap; | 330 | &:hover { |
| 254 | align-items: center; | 331 | opacity: 1; |
| 255 | justify-content: space-between; | 332 | transform: scale(1.05); |
| 256 | } | 333 | } |
| 257 | .view-service { | 334 | } |
| 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 | } | ||
| 275 | 335 | ||
| 276 | .meta-item, .warning { | 336 | .meta-item, |
| 277 | display: flex; | 337 | .warning { |
| 278 | align-items: center; | 338 | display: flex; |
| 279 | // justify-content: center; | 339 | align-items: center; |
| 280 | gap: 0.25rem; | 340 | // justify-content: center; |
| 281 | // opacity: 0.6; | 341 | gap: 0.25rem; |
| 282 | font-size: 0.9rem; | 342 | // opacity: 0.6; |
| 283 | padding: 0.5rem 0; | 343 | font-size: 0.9rem; |
| 284 | :global(svg) { | 344 | padding: 0.5rem 0; |
| 285 | color: var(--foreground); | 345 | :global(svg) { |
| 286 | width: 1.2rem; | 346 | color: var(--foreground); |
| 287 | height: 1.2rem; | 347 | width: 1.2rem; |
| 288 | } | 348 | height: 1.2rem; |
| 289 | a { | 349 | } |
| 290 | text-decoration: none; | 350 | a { |
| 291 | color: var(--foreground); | 351 | text-decoration: none; |
| 292 | display: flex; | 352 | color: var(--foreground); |
| 293 | gap: 0.25rem; | 353 | display: flex; |
| 294 | &:hover { | 354 | gap: 0.25rem; |
| 295 | color: var(--accent-3); | 355 | &:hover { |
| 296 | :global(svg) { | 356 | color: var(--accent-3); |
| 297 | color: var(--accent-3); | 357 | :global(svg) { |
| 298 | } | 358 | color: var(--accent-3); |
| 299 | } | 359 | } |
| 300 | } | 360 | } |
| 301 | } | 361 | } |
| 302 | .warning { | 362 | } |
| 303 | color: var(--danger); | 363 | .warning { |
| 304 | :global(svg) { | 364 | color: var(--danger); |
| 305 | color: var(--danger); | 365 | :global(svg) { |
| 306 | } | 366 | color: var(--danger); |
| 307 | } | 367 | } |
| 308 | .great { | 368 | } |
| 309 | color: #0fb953; // var(--success); | 369 | .great { |
| 310 | :global(svg) { | 370 | color: #0fb953; // var(--success); |
| 311 | color: #0fb953; // var(--success); | 371 | :global(svg) { |
| 312 | } | 372 | color: #0fb953; // var(--success); |
| 313 | } | 373 | } |
| 314 | } | 374 | } |
| 315 | } | 375 | } |
| 316 | } | 376 | } |
| 377 | } | ||
| 317 | 378 | ||
| 318 | section :global(.view-all) { | 379 | section :global(.view-all) { |
| 319 | width: fit-content; | 380 | width: fit-content; |
| 320 | position: absolute; | 381 | position: absolute; |
| 321 | right: 1rem; | 382 | right: 1rem; |
| 322 | margin-top: -2.5rem; | 383 | margin-top: -2.5rem; |
| 323 | background: var(--accent-3); | 384 | background: var(--accent-3); |
| 324 | } | 385 | } |
| 325 | 386 | ||
| 326 | li:hover :global(.actions) { | 387 | li:hover :global(.actions) { |
| 327 | opacity: 0.6; | 388 | opacity: 0.6; |
| 328 | :global(a):hover { | 389 | :global(a):hover { |
| 329 | opacity: 1; | 390 | opacity: 1; |
| 330 | } | 391 | } |
| 331 | } | 392 | } |
| 332 | :global(.actions a):hover { | 393 | :global(.actions a):hover { |
| 333 | opacity: 1; | 394 | opacity: 1; |
| 334 | } | 395 | } |
| 335 | |||
| 336 | </style> | 396 | </style> |
web/src/components/things/SmartSuggestions.svelte +37 −34
| @@ -1,7 +1,7 @@ | |||
| 1 | <script lang="ts"> | 1 | <script lang="ts"> |
| 2 | import { onMount } from "svelte"; | 2 | import { onMount } from 'svelte'; |
| 3 | import { writable } from "svelte/store"; | 3 | import { writable } from 'svelte/store'; |
| 4 | import type { Category, Service } from "../../types/Service"; | 4 | import type { Category, Service } from '../../types/Service'; |
| 5 | import { formatLink } from '@utils/parse-markdown'; | 5 | import { formatLink } from '@utils/parse-markdown'; |
| 6 | import { slugify } from '@utils/fetch-data'; | 6 | import { slugify } from '@utils/fetch-data'; |
| 7 | 7 | ||
| @@ -14,21 +14,23 @@ | |||
| 14 | 14 | ||
| 15 | let results = writable<ServiceResult[]>([]); | 15 | let results = writable<ServiceResult[]>([]); |
| 16 | 16 | ||
| 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, ''); | ||
| 18 | 19 | ||
| 19 | onMount(async () => { | 20 | onMount(async () => { |
| 20 | |||
| 21 | const apiEndpoint = `https://awesome-privacy.as93.workers.dev/${searchTerm}`; | 21 | const apiEndpoint = `https://awesome-privacy.as93.workers.dev/${searchTerm}`; |
| 22 | const fetchedServices = await fetch(apiEndpoint) | 22 | const fetchedServices = await fetch(apiEndpoint) |
| 23 | .then((response) => response.json()) | 23 | .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 | ); | ||
| 25 | 27 | ||
| 26 | const tmpResults: ServiceResult[] = []; | 28 | const tmpResults: ServiceResult[] = []; |
| 27 | categories.forEach((category) => { | 29 | categories.forEach((category) => { |
| 28 | (category.sections || []).forEach((section) => { | 30 | (category.sections || []).forEach((section) => { |
| 29 | (section.services || []).forEach((service) => { | 31 | (section.services || []).forEach((service) => { |
| 30 | if (fetchedServices.includes(normalize(service.name))) { | 32 | 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)}`; |
| 32 | tmpResults.push({ ...service, path }); | 34 | tmpResults.push({ ...service, path }); |
| 33 | return; | 35 | return; |
| 34 | } | 36 | } |
| @@ -45,35 +47,36 @@ | |||
| 45 | {#if $results.length > 1} | 47 | {#if $results.length > 1} |
| 46 | <h3>Top Results</h3> | 48 | <h3>Top Results</h3> |
| 47 | {/if} | 49 | {/if} |
| 48 | <section> | 50 | <section> |
| 49 | {#each $results as service (service)} | 51 | {#each $results as service (service)} |
| 50 | <a class="service-result" href={service.path}> | 52 | <a class="service-result" href={service.path}> |
| 51 | <div class="service-head"> | 53 | <div class="service-head"> |
| 52 | <img | 54 | <img |
| 53 | width="40" | 55 | width="40" |
| 54 | height="40" | 56 | height="40" |
| 55 | loading="lazy" | 57 | loading="lazy" |
| 56 | decoding="async" | 58 | decoding="async" |
| 57 | class="service-icon" | 59 | class="service-icon" |
| 58 | alt={`${service.name} Icon`} | 60 | alt={`${service.name} Icon`} |
| 59 | data-service-url={formatLink(service.url)} | 61 | data-service-url={formatLink(service.url)} |
| 60 | src={service.icon || `https://icon.horse/icon/${formatLink(service.url)}`} | 62 | src={service.icon || |
| 61 | /> | 63 | `https://icon.horse/icon/${formatLink(service.url)}`} |
| 62 | <div> | 64 | /> |
| 63 | <h4> | 65 | <div> |
| 64 | {service.name} | 66 | <h4> |
| 65 | {#if service.followWith} | 67 | {service.name} |
| 68 | {#if service.followWith} | ||
| 66 | <p class="follow-with">({service.followWith})</p> | 69 | <p class="follow-with">({service.followWith})</p> |
| 67 | {/if} | 70 | {/if} |
| 68 | </h4> | 71 | </h4> |
| 69 | <a class="service-link" href={service.url}>{formatLink(service.url)}</a> | 72 | <a class="service-link" href={service.url} |
| 70 | </div> | 73 | >{formatLink(service.url)}</a |
| 74 | > | ||
| 71 | </div> | 75 | </div> |
| 72 | </a> | 76 | </div> |
| 73 | {/each} | 77 | </a> |
| 74 | </section> | 78 | {/each} |
| 75 | 79 | </section> | |
| 76 | |||
| 77 | 80 | ||
| 78 | <style lang="scss"> | 81 | <style lang="scss"> |
| 79 | h3 { | 82 | h3 { |
web/src/components/things/service-card.scss +9 −7
| @@ -29,21 +29,23 @@ | |||
| 29 | h4 { | 29 | h4 { |
| 30 | text-decoration: none; | 30 | text-decoration: none; |
| 31 | position: relative; | 31 | position: relative; |
| 32 | &:after { | 32 | &:after { |
| 33 | background: none repeat scroll 0 0 transparent; | 33 | background: none repeat scroll 0 0 transparent; |
| 34 | bottom: 0; | 34 | bottom: 0; |
| 35 | content: ""; | 35 | content: ''; |
| 36 | display: block; | 36 | display: block; |
| 37 | height: 3px; | 37 | height: 3px; |
| 38 | left: 50%; | 38 | left: 50%; |
| 39 | position: absolute; | 39 | position: absolute; |
| 40 | background: var(--accent-3); | 40 | 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; | ||
| 42 | width: 0; | 44 | width: 0; |
| 43 | } | 45 | } |
| 44 | &:hover:after { | 46 | &:hover:after { |
| 45 | width: 100%; | 47 | width: 100%; |
| 46 | left: 0; | 48 | left: 0; |
| 47 | } | 49 | } |
| 48 | } | 50 | } |
| 49 | } | 51 | } |
| @@ -66,7 +68,7 @@ | |||
| 66 | :global(p) { | 68 | :global(p) { |
| 67 | display: -webkit-box; | 69 | display: -webkit-box; |
| 68 | -webkit-line-clamp: 3; | 70 | -webkit-line-clamp: 3; |
| 69 | -webkit-box-orient: vertical; | 71 | -webkit-box-orient: vertical; |
| 70 | overflow: hidden; | 72 | overflow: hidden; |
| 71 | margin: 0.5rem 0; | 73 | margin: 0.5rem 0; |
| 72 | width: calc(100% - 2rem); | 74 | width: calc(100% - 2rem); |
web/src/layouts/Layout.astro +85 −63
| @@ -1,5 +1,5 @@ | |||
| 1 | --- | 1 | --- |
| 2 | import { ViewTransitions } from 'astro:transitions' | 2 | import { ViewTransitions } from 'astro:transitions'; |
| 3 | import NavBar from '@components/scafold/NavBar.astro'; | 3 | import NavBar from '@components/scafold/NavBar.astro'; |
| 4 | import Footer from '@components/scafold/Footer.astro'; | 4 | import Footer from '@components/scafold/Footer.astro'; |
| 5 | import config from '../site-config'; | 5 | import config from '../site-config'; |
| @@ -7,14 +7,14 @@ import config from '../site-config'; | |||
| 7 | interface Props { | 7 | interface Props { |
| 8 | title?: string; // Page title | 8 | title?: string; // Page title |
| 9 | description?: string; // Overide description tag | 9 | description?: string; // Overide description tag |
| 10 | keywords?: string; // Overide keywords tag | 10 | keywords?: string; // Overide keywords tag |
| 11 | hideNav?: boolean; // Don't show the navbar (just homepage) | 11 | hideNav?: boolean; // Don't show the navbar (just homepage) |
| 12 | author?: string; // Author of the content | 12 | author?: string; // Author of the content |
| 13 | customSchemaJson?: any; // Custom schema item | 13 | customSchemaJson?: any; // Custom schema item |
| 14 | breadcrumbs?: Array<{ | 14 | breadcrumbs?: Array<{ |
| 15 | name: string; | 15 | name: string; |
| 16 | item: string; | 16 | item: string; |
| 17 | }> | 17 | }>; |
| 18 | } | 18 | } |
| 19 | 19 | ||
| 20 | const { | 20 | const { |
| @@ -30,92 +30,117 @@ const { | |||
| 30 | const makeBreadcrumbs = () => { | 30 | const makeBreadcrumbs = () => { |
| 31 | if (!breadcrumbs) return null; | 31 | if (!breadcrumbs) return null; |
| 32 | return { | 32 | return { |
| 33 | "@context": "https://schema.org", | 33 | '@context': 'https://schema.org', |
| 34 | "@type": "BreadcrumbList", | 34 | '@type': 'BreadcrumbList', |
| 35 | "itemListElement": breadcrumbs.map((breadcrumb, index) => ({ | 35 | itemListElement: breadcrumbs.map((breadcrumb, index) => ({ |
| 36 | "@type": "ListItem", | 36 | '@type': 'ListItem', |
| 37 | "position": index + 1, | 37 | position: index + 1, |
| 38 | "name": breadcrumb.name, | 38 | name: breadcrumb.name, |
| 39 | "item": `https://awesome-privacy.xyz/${breadcrumb.item}` | 39 | item: `https://awesome-privacy.xyz/${breadcrumb.item}`, |
| 40 | })) | 40 | })), |
| 41 | } | 41 | }; |
| 42 | } | 42 | }; |
| 43 | 43 | ||
| 44 | const makeSearchLd = () => { | 44 | const makeSearchLd = () => { |
| 45 | return { | 45 | return { |
| 46 | "@context": "https://schema.org", | 46 | '@context': 'https://schema.org', |
| 47 | "@type": "WebSite", | 47 | '@type': 'WebSite', |
| 48 | "url": "https://awesome-privacy.xyz/", | 48 | url: 'https://awesome-privacy.xyz/', |
| 49 | "potentialAction": [{ | 49 | potentialAction: [ |
| 50 | "@type": "SearchAction", | 50 | { |
| 51 | "target": { | 51 | '@type': 'SearchAction', |
| 52 | "@type": "EntryPoint", | 52 | target: { |
| 53 | "urlTemplate": "https://awesome-privacy.xyz/search?q={search_term_string}" | 53 | '@type': 'EntryPoint', |
| 54 | urlTemplate: | ||
| 55 | 'https://awesome-privacy.xyz/search?q={search_term_string}', | ||
| 56 | }, | ||
| 57 | 'query-input': 'required name=search_term_string', | ||
| 54 | }, | 58 | }, |
| 55 | "query-input": "required name=search_term_string" | 59 | ], |
| 56 | }] | 60 | }; |
| 57 | } | ||
| 58 | }; | 61 | }; |
| 59 | |||
| 60 | --- | 62 | --- |
| 61 | 63 | ||
| 62 | <!doctype html> | 64 | <!doctype html> |
| 63 | <html lang="en" data-theme="dark"> | 65 | <html lang="en" data-theme="dark"> |
| 64 | <head> | 66 | <head> |
| 65 | |||
| 66 | <ViewTransitions /> | 67 | <ViewTransitions /> |
| 67 | 68 | ||
| 68 | <!-- Core info --> | 69 | <!-- Core info --> |
| 69 | <title>{title}</title> | 70 | <title>{title}</title> |
| 70 | <meta name="description" content={description}> | 71 | <meta name="description" content={description} /> |
| 71 | <meta name="keywords" content={keywords}> | 72 | <meta name="keywords" content={keywords} /> |
| 72 | <meta name="author" content={author}> | 73 | <meta name="author" content={author} /> |
| 73 | 74 | ||
| 74 | <!-- Page info, viewport, Astro credit --> | 75 | <!-- Page info, viewport, Astro credit --> |
| 75 | <meta charset="UTF-8" /> | 76 | <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" /> |
| 77 | <meta name="generator" content={Astro.generator} /> | 78 | <meta name="generator" content={Astro.generator} /> |
| 78 | <meta name="robots" content="index, follow"> | 79 | <meta name="robots" content="index, follow" /> |
| 79 | 80 | ||
| 80 | <!-- Icons and colors --> | 81 | <!-- Icons and colors --> |
| 81 | <link rel="icon" type="image/svg+xml" href="/favicon.svg" /> | 82 | <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="icon" type="image/png" sizes="64x64" href="/favicon.png" /> |
| 83 | <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"> | 84 | <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" /> |
| 84 | 85 | ||
| 85 | <!-- Social media meta tags (Open Graphh + Twitter) --> | 86 | <!-- Social media meta tags (Open Graphh + Twitter) --> |
| 86 | <meta property="og:site_name" content="Awesome Privacy"> | 87 | <meta property="og:site_name" content="Awesome Privacy" /> |
| 87 | <meta property="og:type" content="website"> | 88 | <meta property="og:type" content="website" /> |
| 88 | <meta property="og:url" content="https://awesome-privacy.xyz"> | 89 | <meta property="og:url" content="https://awesome-privacy.xyz" /> |
| 89 | <meta property="og:title" content={title}> | 90 | <meta property="og:title" content={title} /> |
| 90 | <meta property="og:description" content={description}> | 91 | <meta property="og:description" content={description} /> |
| 91 | <meta property="og:image" content="https://awesome-privacy.xyz/banner.png"> | 92 | <meta |
| 92 | <meta name="twitter:card" content="summary"> | 93 | property="og:image" |
| 93 | <meta name="twitter:url" content="https://awesome-privacy.xyz"> | 94 | content="https://awesome-privacy.xyz/banner.png" |
| 94 | <meta name="twitter:title" content={title}> | 95 | /> |
| 95 | <meta name="twitter:description" content={description}> | 96 | <meta name="twitter:card" content="summary" /> |
| 96 | <meta name="twitter:image" content="https://awesome-privacy.xyz/banner.png"> | 97 | <meta name="twitter:url" content="https://awesome-privacy.xyz" /> |
| 97 | <link rel="twitter:image" sizes="180x180" href="https://awesome-privacy.xyz/apple-touch-icon.png"> | 98 | <meta name="twitter:title" content={title} /> |
| 98 | <meta name="twitter:site" content="@Lissy_Sykes"> | 99 | <meta name="twitter:description" content={description} /> |
| 99 | <meta name="twitter:creator" content="@Lissy_Sykes"> | 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" /> | ||
| 100 | 111 | ||
| 101 | <!-- Non-tracking hit counter --> | 112 | <!-- Non-tracking hit counter --> |
| 102 | <script defer is:inline | 113 | <script |
| 114 | defer | ||
| 115 | is:inline | ||
| 103 | type="text/partytown" | 116 | type="text/partytown" |
| 104 | data-domain="awesome-privacy.xyz" | 117 | data-domain="awesome-privacy.xyz" |
| 105 | src="https://no-track.as93.net/js/script.js"> | 118 | src="https://no-track.as93.net/js/script.js"></script> |
| 106 | </script> | ||
| 107 | 119 | ||
| 108 | <!-- Schema.org markup for Google --> | 120 | <!-- Schema.org markup for Google --> |
| 109 | {breadcrumbs && ( | 121 | { |
| 110 | <script type="application/ld+json" set:html={JSON.stringify(makeBreadcrumbs())} /> | 122 | breadcrumbs && ( |
| 111 | )} | 123 | <script |
| 112 | {customSchemaJson && ( | 124 | type="application/ld+json" |
| 113 | <script type="application/ld+json" set:html={JSON.stringify(customSchemaJson)} /> | 125 | set:html={JSON.stringify(makeBreadcrumbs())} |
| 114 | )} | 126 | /> |
| 115 | <script type="application/ld+json" set:html={JSON.stringify(makeSearchLd)} /> | 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 | /> | ||
| 116 | </head> | 141 | </head> |
| 117 | <body> | 142 | <body> |
| 118 | {!hideNav && <NavBar /> } | 143 | {!hideNav && <NavBar />} |
| 119 | <slot /> | 144 | <slot /> |
| 120 | <Footer /> | 145 | <Footer /> |
| 121 | </body> | 146 | </body> |
| @@ -124,11 +149,9 @@ const makeSearchLd = () => { | |||
| 124 | <style is:global> | 149 | <style is:global> |
| 125 | @import '../styles/values.css'; | 150 | @import '../styles/values.css'; |
| 126 | @import '../styles/typography.css'; | 151 | @import '../styles/typography.css'; |
| 127 | </style> | 152 | </style> |
| 128 | |||
| 129 | 153 | ||
| 130 | <style is:global> | 154 | <style is:global> |
| 131 | |||
| 132 | html { | 155 | html { |
| 133 | ::selection { | 156 | ::selection { |
| 134 | background: var(--accent); | 157 | background: var(--accent); |
| @@ -142,5 +165,4 @@ const makeSearchLd = () => { | |||
| 142 | color: var(--foreground); | 165 | color: var(--foreground); |
| 143 | background: var(--background); | 166 | background: var(--background); |
| 144 | } | 167 | } |
| 145 | |||
| 146 | </style> | 168 | </style> |
web/src/pages/404.astro +79 −86
| @@ -1,98 +1,91 @@ | |||
| 1 | --- | 1 | --- |
| 2 | |||
| 3 | import Layout from '@layouts/Layout.astro'; | 2 | import Layout from '@layouts/Layout.astro'; |
| 4 | import Buton from '@components/form/Button.astro'; | 3 | import Buton from '@components/form/Button.astro'; |
| 5 | |||
| 6 | --- | 4 | --- |
| 7 | 5 | ||
| 8 | <Layout title="404 | Awesome Privacy"> | 6 | <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> | ||
| 9 | 14 | ||
| 10 | <article class="oh-crap"> | 15 | <nav class="other-places"> |
| 11 | <h2>404</h2> | 16 | Looking for somewhere else? |
| 12 | <p class="what-happened">Page not found 😢</p> | 17 | <ul> |
| 13 | <p class="why-happened"> | 18 | <li> |
| 14 | It seems this page doesn't exist (yet). We're sorry about that. | 19 | <a href="/search">Search</a> |
| 15 | </p> | 20 | </li> |
| 16 | <span class="back-you-go-then"><Buton url="/">Go back home</Buton></span> | 21 | <li> |
| 17 | 22 | <a href="/browse">Browse</a> | |
| 18 | <nav class="other-places"> | 23 | </li> |
| 19 | Looking for somewhere else? | 24 | <li> |
| 20 | <ul> | 25 | <a href="/about">About</a> |
| 21 | <li> | 26 | </li> |
| 22 | <a href="/search">Search</a> | 27 | <li> |
| 23 | </li> | 28 | <a href="https://github.com/lissy93/awesome-privacy">Source</a> |
| 24 | <li> | 29 | </li> |
| 25 | <a href="/browse">Browse</a> | 30 | <li> |
| 26 | </li> | 31 | <a href="https://as93.net">More Apps</a> |
| 27 | <li> | 32 | </li> |
| 28 | <a href="/about">About</a> | 33 | </ul> |
| 29 | </li> | 34 | </nav> |
| 30 | <li> | 35 | </article> |
| 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 | |||
| 40 | </Layout> | 36 | </Layout> |
| 41 | 37 | ||
| 42 | |||
| 43 | <style lang="scss"> | 38 | <style lang="scss"> |
| 44 | .oh-crap { | 39 | .oh-crap { |
| 45 | display: flex; | 40 | display: flex; |
| 46 | flex-direction: column; | 41 | flex-direction: column; |
| 47 | align-items: center; | 42 | align-items: center; |
| 48 | justify-content: center; | 43 | justify-content: center; |
| 49 | min-height: calc(100vh - 6rem); | 44 | min-height: calc(100vh - 6rem); |
| 50 | h2 { | 45 | h2 { |
| 51 | font-size: 12rem; | 46 | font-size: 12rem; |
| 52 | margin: 0; | 47 | margin: 0; |
| 53 | } | 48 | } |
| 54 | .what-happened { | 49 | .what-happened { |
| 55 | font-size: 4rem; | 50 | font-size: 4rem; |
| 56 | margin: 0; | 51 | margin: 0; |
| 57 | opacity: 0.8; | 52 | opacity: 0.8; |
| 58 | } | 53 | } |
| 59 | .why-happened { | 54 | .why-happened { |
| 60 | font-size: 1.5rem; | 55 | font-size: 1.5rem; |
| 61 | text-align: center; | 56 | text-align: center; |
| 62 | margin-bottom: 2rem; | 57 | margin-bottom: 2rem; |
| 63 | opacity: 0.6; | 58 | opacity: 0.6; |
| 64 | } | 59 | } |
| 65 | .back-you-go-then :global(a) { | 60 | .back-you-go-then :global(a) { |
| 66 | font-size: 2rem; | 61 | font-size: 2rem; |
| 67 | } | 62 | } |
| 68 | |||
| 69 | 63 | ||
| 70 | .other-places { | 64 | .other-places { |
| 71 | opacity: 0.8; | 65 | opacity: 0.8; |
| 72 | margin: 2rem auto 1rem auto; | 66 | margin: 2rem auto 1rem auto; |
| 73 | text-align: center; | 67 | text-align: center; |
| 74 | &:hover { | 68 | &:hover { |
| 75 | opacity: 1; | 69 | opacity: 1; |
| 76 | } | 70 | } |
| 77 | ul { | 71 | ul { |
| 78 | list-style: none; | 72 | list-style: none; |
| 79 | display: flex; | 73 | display: flex; |
| 80 | padding: 0; | 74 | padding: 0; |
| 81 | gap: 0.5rem; | 75 | gap: 0.5rem; |
| 82 | li { | 76 | li { |
| 83 | &:not(:last-child) { | 77 | &:not(:last-child) { |
| 84 | border-right: 1px solid var(--accent); | 78 | border-right: 1px solid var(--accent); |
| 85 | padding-right: 0.5rem; | 79 | padding-right: 0.5rem; |
| 86 | } | 80 | } |
| 87 | } | 81 | } |
| 88 | li a { | 82 | li a { |
| 89 | text-decoration: none; | 83 | text-decoration: none; |
| 90 | &:hover { | 84 | &:hover { |
| 91 | text-decoration: underline; | 85 | text-decoration: underline; |
| 92 | } | 86 | } |
| 93 | } | 87 | } |
| 94 | } | 88 | } |
| 95 | } | 89 | } |
| 96 | 90 | } | |
| 97 | } | ||
| 98 | </style> | 91 | </style> |
web/src/pages/[...listing].astro +731 −629
| @@ -1,5 +1,4 @@ | |||
| 1 | --- | 1 | --- |
| 2 | |||
| 3 | import Layout from '@layouts/Layout.astro'; | 2 | import Layout from '@layouts/Layout.astro'; |
| 4 | import ServiceList from '@components/things/ServiceList.astro'; | 3 | import ServiceList from '@components/things/ServiceList.astro'; |
| 5 | import Comments from '@components/things/Comments.svelte'; | 4 | import Comments from '@components/things/Comments.svelte'; |
| @@ -30,123 +29,132 @@ import Button from '@components/form/Button.astro'; | |||
| 30 | import SaveListing from '@components/things/SaveListing.svelte'; | 29 | import SaveListing from '@components/things/SaveListing.svelte'; |
| 31 | 30 | ||
| 32 | interface Props extends Service { | 31 | interface Props extends Service { |
| 33 | slug: string; | 32 | slug: string; |
| 34 | parentSection: Section; | 33 | parentSection: Section; |
| 35 | categoryName: string; | 34 | categoryName: string; |
| 36 | } | 35 | } |
| 37 | 36 | ||
| 38 | const { | 37 | const { |
| 39 | name, | 38 | name, |
| 40 | description, | 39 | description, |
| 41 | url, | 40 | url, |
| 42 | github, | 41 | github, |
| 43 | tosdrId, | 42 | tosdrId, |
| 44 | discordInvite, | 43 | discordInvite, |
| 45 | subreddit, | 44 | subreddit, |
| 46 | iosApp, | 45 | iosApp, |
| 47 | androidApp, | 46 | androidApp, |
| 48 | icon, | 47 | icon, |
| 49 | followWith, | 48 | followWith, |
| 50 | links, | 49 | links, |
| 51 | securityAudited, | 50 | securityAudited, |
| 52 | openSource, | 51 | openSource, |
| 53 | acceptsCrypto, | 52 | acceptsCrypto, |
| 54 | parentSection, | 53 | parentSection, |
| 55 | categoryName, | 54 | categoryName, |
| 56 | } = Astro.props; | 55 | } = Astro.props; |
| 57 | 56 | ||
| 58 | |||
| 59 | /** | 57 | /** |
| 60 | * Make a list of keywords, for the <meta keywords> tag | 58 | * Make a list of keywords, for the <meta keywords> tag |
| 61 | */ | 59 | */ |
| 62 | const makeKeyWordTag = () => { | 60 | const makeKeyWordTag = () => { |
| 63 | const keywords: string[] = []; | 61 | const keywords: string[] = []; |
| 64 | keywords.push(`open source ${parentSection.name}`); | 62 | keywords.push(`open source ${parentSection.name}`); |
| 65 | keywords.push(`${parentSection.name} comparison`); | 63 | keywords.push(`${parentSection.name} comparison`); |
| 66 | (parentSection.alternativeTo || []).forEach((alt: string) => { | 64 | (parentSection.alternativeTo || []).forEach((alt: string) => { |
| 67 | keywords.push(`${alt} alternative`); | 65 | keywords.push(`${alt} alternative`); |
| 68 | }); | 66 | }); |
| 69 | (parentSection.services || []).forEach((serv: Service) => { | 67 | (parentSection.services || []).forEach((serv: Service) => { |
| 70 | keywords.push(`${serv.name} vs`); | 68 | keywords.push(`${serv.name} vs`); |
| 71 | }); | 69 | }); |
| 72 | keywords.push('private'); | 70 | keywords.push('private'); |
| 73 | keywords.push('ad free'); | 71 | keywords.push('ad free'); |
| 74 | keywords.push('encrypted'); | 72 | keywords.push('encrypted'); |
| 75 | keywords.push('open source software'); | 73 | keywords.push('open source software'); |
| 76 | keywords.push('privacy respecting apps'); | 74 | keywords.push('privacy respecting apps'); |
| 77 | keywords.push('free tools'); | 75 | keywords.push('free tools'); |
| 78 | return keywords.join(', '); | 76 | return keywords.join(', '); |
| 79 | }; | 77 | }; |
| 80 | 78 | ||
| 81 | /** | 79 | /** |
| 82 | * Make a page title | 80 | * Make a page title |
| 83 | */ | 81 | */ |
| 84 | const makePageTitle = () => { | 82 | const makePageTitle = () => { |
| 85 | return `${name} | ${parentSection.name} | ${categoryName} | Awesome Privacy`; | 83 | return `${name} | ${parentSection.name} | ${categoryName} | Awesome Privacy`; |
| 86 | }; | 84 | }; |
| 87 | 85 | ||
| 88 | const makeBreadcrumbs = () => { | 86 | const makeBreadcrumbs = () => { |
| 89 | return [ | 87 | return [ |
| 90 | { name: 'Home', item: '/' }, | 88 | { name: 'Home', item: '/' }, |
| 91 | { name: categoryName, item: slugify(categoryName) }, | 89 | { name: categoryName, item: slugify(categoryName) }, |
| 92 | { name: parentSection.name, item: `${slugify(categoryName)}/${slugify(parentSection.name)}` }, | 90 | { |
| 93 | { name: name, item: `${slugify(categoryName)}/${slugify(parentSection.name)}/${slugify(name)}` }, | 91 | name: parentSection.name, |
| 94 | ]; | 92 | item: `${slugify(categoryName)}/${slugify(parentSection.name)}`, |
| 93 | }, | ||
| 94 | { | ||
| 95 | name: name, | ||
| 96 | item: `${slugify(categoryName)}/${slugify(parentSection.name)}/${slugify(name)}`, | ||
| 97 | }, | ||
| 98 | ]; | ||
| 95 | }; | 99 | }; |
| 96 | 100 | ||
| 97 | /** | 101 | /** |
| 98 | * Make a string page intro, for the description tag | 102 | * Make a string page intro, for the description tag |
| 99 | */ | 103 | */ |
| 100 | const makeDescriptionTag = () => { | 104 | const makeDescriptionTag = () => { |
| 101 | let description = `Analysis of ${name}, and other privacy-respecting ${parentSection.name} `; | 105 | let description = `Analysis of ${name}, and other privacy-respecting ${parentSection.name} `; |
| 102 | if (parentSection.services) { | 106 | if (parentSection.services) { |
| 103 | const serviceList = parentSection.services.map((serv: Service) => serv.name); | 107 | const serviceList = parentSection.services.map( |
| 104 | description += `Compare ${serviceList.join(' vs ')} more apps. ` | 108 | (serv: Service) => serv.name, |
| 105 | } | 109 | ); |
| 106 | if (parentSection.alternativeTo && parentSection.alternativeTo.length > 0) { | 110 | description += `Compare ${serviceList.join(' vs ')} more apps. `; |
| 107 | description += `The best secure encrypted alternatives to ${parentSection.alternativeTo.join(', ')} in 2024. `; | 111 | } |
| 108 | } | 112 | if (parentSection.alternativeTo && parentSection.alternativeTo.length > 0) { |
| 109 | description += 'All this, and many more free and awesome tools and software.' | 113 | description += `The best secure encrypted alternatives to ${parentSection.alternativeTo.join(', ')} in 2024. `; |
| 110 | return description; | 114 | } |
| 115 | description += 'All this, and many more free and awesome tools and software.'; | ||
| 116 | return description; | ||
| 111 | }; | 117 | }; |
| 112 | 118 | ||
| 113 | // Return a list of Services, except for the currtent one | 119 | // Return a list of Services, except for the currtent one |
| 114 | const filterServices = () => { | 120 | const filterServices = () => { |
| 115 | return parentSection.services.filter((service: Service) => service.name !== name); | 121 | return parentSection.services.filter( |
| 122 | (service: Service) => service.name !== name, | ||
| 123 | ); | ||
| 116 | }; | 124 | }; |
| 117 | 125 | ||
| 118 | export async function getStaticPaths() { | 126 | export async function getStaticPaths() { |
| 119 | const pages = await fetchData().then((data) => { | 127 | const pages = await fetchData().then((data) => { |
| 120 | const results: Array<Props> = []; | 128 | const results: Array<Props> = []; |
| 121 | if (!data || !data.categories) return results; | 129 | if (!data || !data.categories) return results; |
| 122 | (data as AwesomePrivacy).categories.forEach((category) => { | 130 | (data as AwesomePrivacy).categories.forEach((category) => { |
| 123 | category.sections.forEach((section) => { | 131 | category.sections.forEach((section) => { |
| 124 | const services = (section.services || []).map((service) => { | 132 | const services = (section.services || []).map((service) => { |
| 125 | return { | 133 | return { |
| 126 | slug: `${slugify(category.name)}/${slugify(section.name)}/${slugify(service.name)}`, | 134 | slug: `${slugify(category.name)}/${slugify(section.name)}/${slugify(service.name)}`, |
| 127 | parentSection: section, | 135 | parentSection: section, |
| 128 | categoryName: category.name, | 136 | categoryName: category.name, |
| 129 | ...service, | 137 | ...service, |
| 130 | }; | 138 | }; |
| 131 | }); | 139 | }); |
| 132 | results.push(...services); | 140 | results.push(...services); |
| 133 | }); | 141 | }); |
| 134 | 142 | }); | |
| 135 | }); | 143 | return results; |
| 136 | return results; | 144 | }); |
| 137 | }); | 145 | |
| 138 | 146 | return pages.map((props: Props) => { | |
| 139 | return pages.map((props: Props) => { | 147 | return { params: { listing: props.slug }, props }; |
| 140 | return {params: { listing: props.slug }, props }; | 148 | }); |
| 141 | }); | ||
| 142 | } | 149 | } |
| 143 | 150 | ||
| 144 | const makePaginationLinks = () => { | 151 | const makePaginationLinks = () => { |
| 145 | const allServices = parentSection.services || []; | 152 | const allServices = parentSection.services || []; |
| 146 | const index = allServices.findIndex(item => item.name === name); | 153 | const index = allServices.findIndex((item) => item.name === name); |
| 147 | const previousItem = index > 0 ? allServices[index - 1].name : null; | 154 | const previousItem = index > 0 ? allServices[index - 1].name : null; |
| 148 | const nextItem = index < allServices.length - 1 ? allServices[index + 1].name : null; | 155 | const nextItem = |
| 149 | return { previous: previousItem, next: nextItem }; | 156 | index < allServices.length - 1 ? allServices[index + 1].name : null; |
| 157 | return { previous: previousItem, next: nextItem }; | ||
| 150 | }; | 158 | }; |
| 151 | 159 | ||
| 152 | const { previous, next } = makePaginationLinks(); | 160 | const { previous, next } = makePaginationLinks(); |
| @@ -158,565 +166,659 @@ const githubData = github ? await fetchGitHubStats(github) : null; | |||
| 158 | const privacyData = tosdrId ? await fetchTosdrPrivacy(tosdrId) : null; | 166 | const privacyData = tosdrId ? await fetchTosdrPrivacy(tosdrId) : null; |
| 159 | const iosData = iosApp ? await fetchIosInfo(iosApp) : null; | 167 | const iosData = iosApp ? await fetchIosInfo(iosApp) : null; |
| 160 | const androidData = androidApp ? await fetchAndroidInfo(androidApp) : null; | 168 | const androidData = androidApp ? await fetchAndroidInfo(androidApp) : null; |
| 161 | const discordData = discordInvite ? await fetchDiscordInfo(discordInvite) : null; | 169 | const discordData = discordInvite |
| 170 | ? await fetchDiscordInfo(discordInvite) | ||
| 171 | : null; | ||
| 162 | const redditData = subreddit ? await fetchRedditInfo(subreddit) : null; | 172 | const redditData = subreddit ? await fetchRedditInfo(subreddit) : null; |
| 163 | const dockerData = await fetchDockerData(name); | 173 | const dockerData = await fetchDockerData(name); |
| 164 | const websiteData = (url && !ignoredSites.some(ignoredSite => url.includes(ignoredSite))) ? await fetchWebsiteInfo(url) : null; | 174 | const websiteData = |
| 175 | url && !ignoredSites.some((ignoredSite) => url.includes(ignoredSite)) | ||
| 176 | ? await fetchWebsiteInfo(url) | ||
| 177 | : null; | ||
| 165 | 178 | ||
| 166 | const findPrivacyPolicyLink = () => { | 179 | const findPrivacyPolicyLink = () => { |
| 167 | if (!privacyData) return null; | 180 | if (!privacyData) return null; |
| 168 | // const docs = privacyData?.parameters?.documents; | 181 | // const docs = privacyData?.parameters?.documents; |
| 169 | // if (docs) { | 182 | // if (docs) { |
| 170 | // const privacyPolicy = (docs || []).find((doc) => doc.name.toLowerCase().includes('privacy policy')); | 183 | // const privacyPolicy = (docs || []).find((doc) => doc.name.toLowerCase().includes('privacy policy')); |
| 171 | // if (privacyPolicy) return privacyPolicy.url; | 184 | // if (privacyPolicy) return privacyPolicy.url; |
| 172 | // } | 185 | // } |
| 173 | return `https://tosdr.org/en/service/${tosdrId}`; | 186 | return `https://tosdr.org/en/service/${tosdrId}`; |
| 174 | }; | 187 | }; |
| 175 | 188 | ||
| 176 | const privacyPolicyLink = findPrivacyPolicyLink(); | 189 | const privacyPolicyLink = findPrivacyPolicyLink(); |
| 177 | 190 | ||
| 178 | const getApiEndpoint = () => { | 191 | const getApiEndpoint = () => { |
| 179 | return `https://api.awesome-privacy.xyz/${slugify(categoryName)}/${slugify(parentSection.name)}/${slugify(name)}`; | 192 | return `https://api.awesome-privacy.xyz/${slugify(categoryName)}/${slugify(parentSection.name)}/${slugify(name)}`; |
| 180 | } | 193 | }; |
| 181 | |||
| 182 | --- | 194 | --- |
| 183 | 195 | ||
| 184 | <Layout | 196 | <Layout |
| 185 | title={makePageTitle()} | 197 | title={makePageTitle()} |
| 186 | keywords={makeKeyWordTag()} | 198 | keywords={makeKeyWordTag()} |
| 187 | description={makeDescriptionTag()} | 199 | description={makeDescriptionTag()} |
| 188 | breadcrumbs={makeBreadcrumbs()} | 200 | breadcrumbs={makeBreadcrumbs()} |
| 189 | > | 201 | > |
| 190 | <main> | 202 | <main> |
| 191 | <section> | 203 | <section> |
| 192 | <div class="service-head"> | 204 | <div class="service-head"> |
| 193 | <h2>{name}</h2> | 205 | <h2>{name}</h2> |
| 194 | <span class="url-wrap"> | 206 | <span class="url-wrap"> |
| 195 | <a class="service-url" href={url}>{formatLink(url)}</a> | 207 | <a class="service-url" href={url}>{formatLink(url)}</a> |
| 196 | <span class="follow-with">{followWith}</span> | 208 | <span class="follow-with">{followWith}</span> |
| 197 | </span> | 209 | </span> |
| 198 | </div> | 210 | </div> |
| 199 | <div class="breadcrumbs"> | 211 | <div class="breadcrumbs"> |
| 200 | <span> | 212 | <span> |
| 201 | <a href="/">Awesome Privacy</a> | 213 | <a href="/">Awesome Privacy</a> |
| 202 | ➔ <a href={`/${slugify(categoryName)}`}>{categoryName}</a> | 214 | ➔ <a href={`/${slugify(categoryName)}`}>{categoryName}</a> |
| 203 | ➔ <a href={`/${slugify(categoryName)}/${slugify(parentSection.name)}`}>{parentSection.name}</a> | 215 | ➔ <a href={`/${slugify(categoryName)}/${slugify(parentSection.name)}`} |
| 204 | ➔ <a href={`/${slugify(categoryName)}/${slugify(parentSection.name)}/${slugify(name)}`}>{name}</a> | 216 | >{parentSection.name}</a |
| 205 | </span> | 217 | > |
| 206 | </div> | 218 | ➔ <a |
| 207 | <div class="save-listing"> | 219 | href={`/${slugify(categoryName)}/${slugify(parentSection.name)}/${slugify(name)}`} |
| 208 | <SaveListing client:visible | 220 | >{name}</a |
| 209 | categoryName={categoryName} | 221 | > |
| 210 | sectionName={parentSection.name} | 222 | </span> |
| 211 | serviceName={name} | 223 | </div> |
| 212 | showLabel={true} | 224 | <div class="save-listing"> |
| 213 | /> | 225 | <SaveListing |
| 214 | </div> | 226 | client:visible |
| 215 | <div class="intro"> | 227 | categoryName={categoryName} |
| 216 | <img | 228 | sectionName={parentSection.name} |
| 217 | width="60" | 229 | serviceName={name} |
| 218 | height="60" | 230 | showLabel={true} |
| 219 | loading="lazy" | 231 | /> |
| 220 | decoding="async" | 232 | </div> |
| 221 | class="service-icon" | 233 | <div class="intro"> |
| 222 | alt={`${name} Icon`} | 234 | <img |
| 223 | data-service-url={formatLink(url)} | 235 | width="60" |
| 224 | src={icon || `https://icon.horse/icon/${formatLink(url)}`} | 236 | height="60" |
| 225 | /> | 237 | loading="lazy" |
| 226 | <div> | 238 | decoding="async" |
| 227 | <p class="description" set:html={parseMarkdown(description)}></p> | 239 | class="service-icon" |
| 228 | <ul> | 240 | alt={`${name} Icon`} |
| 229 | { url && ( | 241 | data-service-url={formatLink(url)} |
| 230 | <li> | 242 | src={icon || `https://icon.horse/icon/${formatLink(url)}`} |
| 231 | <b>Homepage:</b> | 243 | /> |
| 232 | <a href={url}>{formatLink(url)}</a> | 244 | <div> |
| 233 | </li> | 245 | <p class="description" set:html={parseMarkdown(description)} /> |
| 234 | )} | 246 | <ul> |
| 235 | { github && ( | 247 | { |
| 236 | <li> | 248 | url && ( |
| 237 | <b>GitHub:</b> | 249 | <li> |
| 238 | <a href={`https://github.com/${github}`}>github.com/{github}</a> | 250 | <b>Homepage:</b> |
| 239 | </li> | 251 | <a href={url}>{formatLink(url)}</a> |
| 240 | )} | 252 | </li> |
| 241 | { tosdrId && ( | 253 | ) |
| 242 | <li> | 254 | } |
| 243 | <b>Privacy:</b> | 255 | { |
| 244 | <a href={privacyPolicyLink}>{formatLink(privacyPolicyLink || '')}</a> | 256 | github && ( |
| 245 | </li> | 257 | <li> |
| 246 | )} | 258 | <b>GitHub:</b> |
| 247 | { iosApp && ( | 259 | <a href={`https://github.com/${github}`}> |
| 248 | <li> | 260 | github.com/{github} |
| 249 | <b>iOS App:</b> | 261 | </a> |
| 250 | <a href={iosApp}>{formatLink(iosApp)}</a> | 262 | </li> |
| 251 | </li> | 263 | ) |
| 252 | )} | 264 | } |
| 253 | { androidApp && ( | 265 | { |
| 254 | <li> | 266 | tosdrId && ( |
| 255 | <b>Android App:</b> | 267 | <li> |
| 256 | <a href={`https://play.google.com/store/apps/details?id=${androidApp}`}>{`https://play.google.com/store/apps/details?id=${androidApp}`}</a> | 268 | <b>Privacy:</b> |
| 257 | </li> | 269 | <a href={privacyPolicyLink}> |
| 258 | )} | 270 | {formatLink(privacyPolicyLink || '')} |
| 259 | { discordInvite && ( | 271 | </a> |
| 260 | <li> | 272 | </li> |
| 261 | <b>Discord Invite:</b> | 273 | ) |
| 262 | <a href={`https://discord.com/invite/${discordInvite}`}>{discordInvite}</a> | 274 | } |
| 263 | </li> | 275 | { |
| 264 | )} | 276 | iosApp && ( |
| 265 | { subreddit && ( | 277 | <li> |
| 266 | <li> | 278 | <b>iOS App:</b> |
| 267 | <b>Subreddit:</b> | 279 | <a href={iosApp}>{formatLink(iosApp)}</a> |
| 268 | <a href={`https://reddit.com/r/${subreddit}`}>r/{subreddit}</a> | 280 | </li> |
| 269 | </li> | 281 | ) |
| 270 | )} | 282 | } |
| 271 | { url && ( | 283 | { |
| 272 | <li> | 284 | androidApp && ( |
| 273 | <b>Web info:</b> | 285 | <li> |
| 274 | <a href={`https://web-check.xyz/results/${formatLink(url)}`}>{`web-check.xyz/results/${formatLink(url).split('/')[0]}`}</a> | 286 | <b>Android App:</b> |
| 275 | </li> | 287 | <a |
| 276 | )} | 288 | href={`https://play.google.com/store/apps/details?id=${androidApp}`} |
| 277 | { links && links.length > 0 && ( | 289 | >{`https://play.google.com/store/apps/details?id=${androidApp}`}</a> |
| 278 | links.map((link) => ( | 290 | </li> |
| 279 | <li> | 291 | ) |
| 280 | <b>{link.title}</b> | 292 | } |
| 281 | <a href={link.url}>{link.url}</a> | 293 | { |
| 282 | </li> | 294 | discordInvite && ( |
| 283 | )) | 295 | <li> |
| 284 | )} | 296 | <b>Discord Invite:</b> |
| 285 | </ul> | 297 | <a href={`https://discord.com/invite/${discordInvite}`}> |
| 286 | </div> | 298 | {discordInvite} |
| 287 | </div> | 299 | </a> |
| 288 | <div class="highlights"> | 300 | </li> |
| 289 | { securityAudited && ( | 301 | ) |
| 290 | <span class="meta-item great" title={`${name} has been security audited by an accredited auditor, with results published publicly`}> | 302 | } |
| 291 | <FontAwesome iconName="securityAudited" /> Security Audited | 303 | { |
| 292 | </span> | 304 | subreddit && ( |
| 293 | )} | 305 | <li> |
| 294 | { acceptsCrypto && ( | 306 | <b>Subreddit:</b> |
| 295 | <span class="meta-item great" title={`${name} accepts anonymous payment methods`}> | 307 | <a href={`https://reddit.com/r/${subreddit}`}> |
| 296 | <FontAwesome iconName="cryptoAccepted" /> Crypto Payments Accepted | 308 | r/{subreddit} |
| 297 | </span> | 309 | </a> |
| 298 | )} | 310 | </li> |
| 299 | { securityAudited === false && ( | 311 | ) |
| 300 | <span class="meta-item warning" title={`${name} has not been audited`}> | 312 | } |
| 301 | <FontAwesome iconName="notSecurityAudited" /> No Security Audit | 313 | { |
| 302 | </span> | 314 | url && ( |
| 303 | )} | 315 | <li> |
| 304 | { (openSource === false) && ( | 316 | <b>Web info:</b> |
| 305 | <span class="warning"> | 317 | <a |
| 306 | <FontAwesome iconName="closedSource" /> | 318 | href={`https://web-check.xyz/results/${formatLink(url)}`} |
| 307 | Not Open Source | 319 | >{`web-check.xyz/results/${formatLink(url).split('/')[0]}`}</a> |
| 308 | </span> | 320 | </li> |
| 309 | )} | 321 | ) |
| 310 | { openSource || (github && openSource !== false) ? ( | 322 | } |
| 311 | <span class="meta-item great" title={`${name} is open source`}> | 323 | { |
| 312 | <FontAwesome iconName="openSource" /> Open Source | 324 | links && |
| 313 | </span> | 325 | links.length > 0 && |
| 314 | ) : null } | 326 | links.map((link) => ( |
| 315 | </div> | 327 | <li> |
| 316 | </section> | 328 | <b>{link.title}</b> |
| 317 | { privacyData && privacyData.parameters.points.length > 0 && ( | 329 | <a href={link.url}>{link.url}</a> |
| 318 | <section> | 330 | </li> |
| 319 | <h3>{name} Privacy Policy</h3> | 331 | )) |
| 320 | <PrivacyPolicyDetails privacyData={privacyData} /> | 332 | } |
| 321 | </section> | 333 | </ul> |
| 322 | )} | 334 | </div> |
| 323 | { github && githubData && ( | 335 | </div> |
| 324 | <section class="github-wrap"> | 336 | <div class="highlights"> |
| 325 | <h3>{name} Source Code</h3> | 337 | { |
| 326 | <GitHubDetailedInfo gitHubData={githubData} repo={github} /> | 338 | securityAudited && ( |
| 327 | </section> | 339 | <span |
| 328 | )} | 340 | class="meta-item great" |
| 329 | { websiteData && ( | 341 | title={`${name} has been security audited by an accredited auditor, with results published publicly`} |
| 330 | <section> | 342 | > |
| 331 | <h3>{name} Website</h3> | 343 | <FontAwesome iconName="securityAudited" /> Security Audited |
| 332 | <WebsiteDetailedInfo url={url} websiteInfo={websiteData} /> | 344 | </span> |
| 333 | </section> | 345 | ) |
| 334 | )} | 346 | } |
| 335 | { (androidData && !androidData.error) && ( | 347 | { |
| 336 | <section> | 348 | acceptsCrypto && ( |
| 337 | <h3>{name} Android App</h3> | 349 | <span |
| 338 | <AndroidAppDetailedInfo androidData={androidData} /> | 350 | class="meta-item great" |
| 339 | </section> | 351 | title={`${name} accepts anonymous payment methods`} |
| 340 | )} | 352 | > |
| 341 | { iosData && typeof iosData === 'object' && Object.keys(iosData).length > 0 && ( | 353 | <FontAwesome iconName="cryptoAccepted" /> Crypto Payments Accepted |
| 342 | <section> | 354 | </span> |
| 343 | <h3>{name} iOS App</h3> | 355 | ) |
| 344 | <IosAppDetailedInfo url={url} iosData={iosData} /> | 356 | } |
| 345 | </section> | 357 | { |
| 346 | )} | 358 | securityAudited === false && ( |
| 347 | { dockerData && dockerData.found && ( | 359 | <span |
| 348 | <section> | 360 | class="meta-item warning" |
| 349 | <h3>{name} Docker</h3> | 361 | title={`${name} has not been audited`} |
| 350 | <DockerDetailedInfo docker={dockerData} /> | 362 | > |
| 351 | </section> | 363 | <FontAwesome iconName="notSecurityAudited" /> No Security Audit |
| 352 | )} | 364 | </span> |
| 353 | { (discordData || redditData) && ( | 365 | ) |
| 354 | <section> | 366 | } |
| 355 | <h3>{name} Socials</h3> | 367 | { |
| 356 | <div class="social-wrap"> | 368 | openSource === false && ( |
| 357 | { discordData && <DiscordDetailedInfo discordData={discordData} /> } | 369 | <span class="warning"> |
| 358 | { redditData && <RedditDetailedInfo redditData={redditData} /> } | 370 | <FontAwesome iconName="closedSource" /> |
| 359 | </div> | 371 | Not Open Source |
| 360 | </section> | 372 | </span> |
| 361 | )} | 373 | ) |
| 362 | 374 | } | |
| 363 | <section> | 375 | { |
| 364 | <h3>{name} Reviews</h3> | 376 | openSource || (github && openSource !== false) ? ( |
| 365 | <Comments client:visible /> | 377 | <span class="meta-item great" title={`${name} is open source`}> |
| 366 | </section> | 378 | <FontAwesome iconName="openSource" /> Open Source |
| 367 | 379 | </span> | |
| 368 | <section> | 380 | ) : null |
| 369 | <h3>More {parentSection.name}</h3> | 381 | } |
| 370 | <ServiceList | 382 | </div> |
| 371 | services={filterServices()} | 383 | </section> |
| 372 | subHeading={true} | 384 | { |
| 373 | noGitHubMetrics={true} | 385 | privacyData && privacyData.parameters.points.length > 0 && ( |
| 374 | buttonLink={`/${slugify(categoryName)}/${slugify(parentSection.name)}`} | 386 | <section> |
| 375 | categoryName={categoryName} | 387 | <h3>{name} Privacy Policy</h3> |
| 376 | sectionName={parentSection.name} | 388 | <PrivacyPolicyDetails privacyData={privacyData} /> |
| 377 | /> | 389 | </section> |
| 378 | </section> | 390 | ) |
| 379 | <section> | 391 | } |
| 380 | <h3>About the Data: {name}</h3> | 392 | { |
| 381 | <DataActions client:load categoryName={categoryName} sectionName={parentSection.name} serviceName={name} /> | 393 | github && githubData && ( |
| 382 | <h4>API</h4> | 394 | <section class="github-wrap"> |
| 383 | <p> | 395 | <h3>{name} Source Code</h3> |
| 384 | You can access {name}'s data programmatically via our API. | 396 | <GitHubDetailedInfo gitHubData={githubData} repo={github} /> |
| 385 | Simply make a <code>GET</code> request to: | 397 | </section> |
| 386 | </p> | 398 | ) |
| 387 | <pre><a href={getApiEndpoint()}><code>{getApiEndpoint()}</code></a></pre> | 399 | } |
| 388 | <p> | 400 | { |
| 389 | The REST API is free, no-auth and CORS-enabled. | 401 | websiteData && ( |
| 390 | To learn more, view the <a href="/api">Swagger Docs</a> or read the <a href="/about#api">API Usage Guide</a>. | 402 | <section> |
| 391 | </p> | 403 | <h3>{name} Website</h3> |
| 392 | 404 | <WebsiteDetailedInfo url={url} websiteInfo={websiteData} /> | |
| 393 | <h4>About the Data</h4> | 405 | </section> |
| 394 | <p> | 406 | ) |
| 395 | Beyond the user-submitted YAML you see above, we also augment each listing with | 407 | } |
| 396 | additional data dynamically fetched from several sources. | 408 | { |
| 397 | To learn more about where the rest of data included in this page comes from, | 409 | androidData && !androidData.error && ( |
| 398 | and how it is computed, | 410 | <section> |
| 399 | see the <a href="/about#our-data">About the Data</a> section of our About page. | 411 | <h3>{name} Android App</h3> |
| 400 | </p> | 412 | <AndroidAppDetailedInfo androidData={androidData} /> |
| 401 | </section> | 413 | </section> |
| 402 | 414 | ) | |
| 403 | <section> | 415 | } |
| 404 | <h3>Share {name}</h3> | 416 | { |
| 405 | <p> | 417 | iosData && |
| 406 | Help your friends compare {parentSection.name}, and pick privacy-respecting software and services.<br /> | 418 | typeof iosData === 'object' && |
| 407 | Share {name} and Awesome Privacy with your network! | 419 | Object.keys(iosData).length > 0 && ( |
| 408 | <div> | 420 | <section> |
| 409 | <SocialShare | 421 | <h3>{name} iOS App</h3> |
| 410 | url={`${site}/${slugify(categoryName)}/${slugify(parentSection.name)}/${slugify(name)} `} | 422 | <IosAppDetailedInfo url={url} iosData={iosData} /> |
| 411 | title={`Checkout ${name}! \n`} | 423 | </section> |
| 412 | description={ | 424 | ) |
| 413 | `Compare #${name} and other privacy-respecting ${parentSection.name} at ` | 425 | } |
| 414 | + `Awesome-Privacy.xyz, the free and open source list of private software alternatives. ` | 426 | { |
| 415 | + `#privacy #opensource #awesomeprivacy by @Lissy_Sykes`} | 427 | dockerData && dockerData.found && ( |
| 416 | /> | 428 | <section> |
| 417 | </div> | 429 | <h3>{name} Docker</h3> |
| 418 | </p> | 430 | <DockerDetailedInfo docker={dockerData} /> |
| 419 | </section> | 431 | </section> |
| 420 | 432 | ) | |
| 421 | <div class="pagination-navigation"> | 433 | } |
| 422 | { previous ? ( | 434 | { |
| 423 | <Button url={`/${slugify(categoryName)}/${slugify(parentSection.name)}/${slugify(previous)}`}> | 435 | (discordData || redditData) && ( |
| 424 | <span>← Previous</span> | 436 | <section> |
| 425 | <p>{previous}</p> | 437 | <h3>{name} Socials</h3> |
| 426 | </Button> | 438 | <div class="social-wrap"> |
| 427 | ) : <p class="nothing"></p>} | 439 | {discordData && <DiscordDetailedInfo discordData={discordData} />} |
| 428 | <a href={`/${slugify(categoryName)}/${slugify(parentSection.name)}`} class="go-to-category"> | 440 | {redditData && <RedditDetailedInfo redditData={redditData} />} |
| 429 | View {parentSection.name} ({(parentSection.services || []).length}) | 441 | </div> |
| 430 | </a> | 442 | </section> |
| 431 | { next && ( | 443 | ) |
| 432 | <Button url={`/${slugify(categoryName)}/${slugify(parentSection.name)}/${slugify(next)}`}> | 444 | } |
| 433 | <span>Next →</span> | 445 | |
| 434 | <p>{next}</p> | 446 | <section> |
| 435 | </Button> | 447 | <h3>{name} Reviews</h3> |
| 436 | )} | 448 | <Comments client:visible /> |
| 437 | </div> | 449 | </section> |
| 438 | </main> | 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> | ||
| 439 | </Layout> | 543 | </Layout> |
| 440 | 544 | ||
| 441 | <style lang="scss"> | 545 | <style lang="scss"> |
| 442 | 546 | main { | |
| 443 | main { | 547 | margin: 2rem auto; |
| 444 | margin: 2rem auto; | 548 | padding: 1rem; |
| 445 | padding: 1rem; | 549 | width: 1200px; |
| 446 | width: 1200px; | 550 | max-width: calc(100% - 5rem); |
| 447 | max-width: calc(100% - 5rem); | 551 | position: relative; |
| 448 | position: relative; | 552 | @media (max-width: 768px) { |
| 449 | @media(max-width: 768px) { | 553 | max-width: 95%; |
| 450 | max-width: 95%; | 554 | padding: 0.5rem; |
| 451 | padding: 0.5rem; | 555 | margin: 0 auto; |
| 452 | margin: 0 auto; | 556 | } |
| 453 | } | 557 | } |
| 454 | } | 558 | |
| 455 | 559 | section { | |
| 456 | section { | 560 | margin: 1rem 0 4rem 0; |
| 457 | margin: 1rem 0 4rem 0; | 561 | padding: 1rem; |
| 458 | padding: 1rem; | 562 | min-height: 8rem; |
| 459 | min-height: 8rem; | 563 | position: relative; |
| 460 | position: relative; | 564 | border: 2px solid var(--box-outline); |
| 461 | border: 2px solid var(--box-outline); | 565 | box-shadow: 6px 6px 0 var(--box-outline); |
| 462 | box-shadow: 6px 6px 0 var(--box-outline); | 566 | background: var(--accent-fg); |
| 463 | background: var(--accent-fg); | 567 | } |
| 464 | 568 | ||
| 465 | } | 569 | p { |
| 466 | 570 | margin: 0.25rem 0 0.5rem 0; | |
| 467 | p { | 571 | } |
| 468 | margin: 0.25rem 0 0.5rem 0; | 572 | |
| 469 | } | 573 | h3 { |
| 470 | 574 | font-size: 2rem; | |
| 471 | h3 { | 575 | margin: -2rem 0 1rem -2rem; |
| 472 | font-size: 2rem; | 576 | box-shadow: 6px 6px 0 var(--box-outline); |
| 473 | margin: -2rem 0 1rem -2rem; | 577 | background: var(--accent); |
| 474 | box-shadow: 6px 6px 0 var(--box-outline); | 578 | color: var(--accent-fg); |
| 475 | background: var(--accent); | 579 | width: fit-content; |
| 476 | color: var(--accent-fg); | 580 | padding: 0.25rem 0.5rem; |
| 477 | width: fit-content; | 581 | @media (max-width: 768px) { |
| 478 | padding: 0.25rem 0.5rem; | 582 | margin: -2rem auto 2rem auto; |
| 479 | @media(max-width: 768px) { | 583 | } |
| 480 | margin: -2rem auto 2rem auto; | 584 | } |
| 481 | } | 585 | |
| 482 | } | 586 | .service-head { |
| 483 | 587 | h2 { | |
| 484 | .service-head { | 588 | font-size: 3rem; |
| 485 | h2 { | 589 | margin: 0; |
| 486 | font-size: 3rem; | 590 | @media (max-width: 768px) { |
| 487 | margin: 0; | 591 | text-align: center; |
| 488 | @media(max-width: 768px) { | 592 | } |
| 489 | text-align: center; | 593 | } |
| 490 | } | 594 | .url-wrap { |
| 491 | } | 595 | display: flex; |
| 492 | .url-wrap { | 596 | align-items: center; |
| 493 | display: flex; | 597 | gap: 0.5rem; |
| 494 | align-items: center; | 598 | a { |
| 495 | gap: 0.5rem; | 599 | font-size: 1.2rem; |
| 496 | a { | 600 | } |
| 497 | font-size: 1.2rem; | 601 | .follow-with { |
| 498 | } | 602 | font-style: italic; |
| 499 | .follow-with { | 603 | opacity: 0.6; |
| 500 | font-style: italic; | 604 | } |
| 501 | opacity: 0.6; | 605 | @media (max-width: 768px) { |
| 502 | } | 606 | flex-direction: column; |
| 503 | @media(max-width: 768px) { | 607 | } |
| 504 | flex-direction: column; | 608 | } |
| 505 | } | 609 | } |
| 506 | } | 610 | |
| 507 | 611 | .breadcrumbs { | |
| 508 | } | 612 | opacity: 0.5; |
| 509 | 613 | font-size: 0.8rem; | |
| 510 | .breadcrumbs { | 614 | position: absolute; |
| 511 | opacity: 0.5; | 615 | right: 1rem; |
| 512 | font-size: 0.8rem; | 616 | top: 1rem; |
| 513 | position: absolute; | 617 | a { |
| 514 | right: 1rem; | 618 | color: var(--foreground); |
| 515 | top: 1rem; | 619 | transition: all 0.15s ease-in-out; |
| 516 | a { | 620 | |
| 517 | color: var(--foreground); | 621 | &:hover { |
| 518 | transition: all 0.15s ease-in-out; | 622 | color: var(--accent); |
| 519 | 623 | } | |
| 520 | &:hover { | 624 | } |
| 521 | color: var(--accent); | 625 | @media (max-width: 768px) { |
| 522 | } | 626 | display: none; |
| 523 | } | 627 | } |
| 524 | @media(max-width: 768px) { | 628 | } |
| 525 | display: none; | 629 | |
| 526 | } | 630 | .save-listing { |
| 527 | } | 631 | position: absolute; |
| 528 | 632 | top: 3rem; | |
| 529 | .save-listing { | 633 | right: 1rem; |
| 530 | position: absolute; | 634 | } |
| 531 | top: 3rem; | 635 | |
| 532 | right: 1rem; | 636 | h4 { |
| 533 | } | 637 | font-size: 1.4rem; |
| 534 | 638 | margin-bottom: 0; | |
| 535 | h4 { | 639 | } |
| 536 | font-size: 1.4rem; | 640 | |
| 537 | margin-bottom: 0; | 641 | .intro { |
| 538 | } | 642 | font-size: 1.2rem; |
| 539 | 643 | font-style: italic; | |
| 540 | .intro { | 644 | opacity: 0.9; |
| 541 | font-size: 1.2rem; | 645 | display: flex; |
| 542 | font-style: italic; | 646 | gap: 0.5rem; |
| 543 | opacity: 0.9; | 647 | @media (max-width: 768px) { |
| 544 | display: flex; | 648 | flex-direction: column; |
| 545 | gap: 0.5rem; | 649 | } |
| 546 | @media(max-width: 768px) { | 650 | .service-icon { |
| 547 | flex-direction: column; | 651 | border-radius: var(--curve-md); |
| 548 | } | 652 | margin-top: 1rem; |
| 549 | .service-icon { | 653 | @media (max-width: 768px) { |
| 550 | border-radius: var(--curve-md); | 654 | margin: 1rem auto 0 auto; |
| 551 | margin-top: 1rem; | 655 | } |
| 552 | @media(max-width: 768px) { | 656 | } |
| 553 | margin: 1rem auto 0 auto; | 657 | ul { |
| 554 | } | 658 | padding-left: 1rem; |
| 555 | } | 659 | list-style: circle; |
| 556 | ul { | 660 | font-style: normal; |
| 557 | padding-left: 1rem; | 661 | font-size: 1rem; |
| 558 | list-style: circle; | 662 | margin-top: 0; |
| 559 | font-style: normal; | 663 | b { |
| 560 | font-size: 1rem; | 664 | font-size: 1rem; |
| 561 | margin-top: 0; | 665 | font-weight: 400; |
| 562 | b { | 666 | min-width: 100px; |
| 563 | font-size: 1rem; | 667 | display: inline-block; |
| 564 | font-weight: 400; | 668 | @media (max-width: 768px) { |
| 565 | min-width: 100px; | 669 | width: auto; |
| 566 | display: inline-block; | 670 | display: block; |
| 567 | @media(max-width: 768px) { | 671 | } |
| 568 | width: auto; | 672 | } |
| 569 | display: block; | 673 | } |
| 570 | } | 674 | } |
| 571 | } | 675 | |
| 572 | } | 676 | .pagination-navigation { |
| 573 | } | 677 | display: flex; |
| 574 | 678 | justify-content: space-between; | |
| 575 | .pagination-navigation { | 679 | align-items: center; |
| 576 | display: flex; | 680 | padding: 1rem 0; |
| 577 | justify-content: space-between; | 681 | :global(.button) { |
| 578 | align-items: center; | 682 | min-width: 120px; |
| 579 | padding: 1rem 0; | 683 | width: fit-content; |
| 580 | :global(.button) { | 684 | padding: 0.25rem 1rem; |
| 581 | min-width: 120px; | 685 | text-align: right; |
| 582 | width: fit-content; | 686 | &:first-child { |
| 583 | padding: 0.25rem 1rem; | 687 | text-align: left; |
| 584 | text-align: right; | 688 | } |
| 585 | &:first-child { text-align: left; } | 689 | p { |
| 586 | p { | 690 | margin: 0; |
| 587 | margin: 0; | 691 | font-weight: normal; |
| 588 | font-weight: normal; | 692 | font-size: 1rem; |
| 589 | font-size: 1rem; | 693 | } |
| 590 | } | 694 | span { |
| 591 | span { | 695 | font-size: 0.8rem; |
| 592 | font-size: 0.8rem; | 696 | } |
| 593 | } | 697 | } |
| 594 | 698 | .nothing { | |
| 595 | } | 699 | width: 120px; |
| 596 | .nothing { | 700 | } |
| 597 | width: 120px; | 701 | .go-to-category { |
| 598 | } | 702 | color: var(--foreground); |
| 599 | .go-to-category { | 703 | font-size: 0.8rem; |
| 600 | color: var(--foreground); | 704 | opacity: 0.5; |
| 601 | font-size: 0.8rem; | 705 | @media (max-width: 768px) { |
| 602 | opacity: 0.5; | 706 | display: none; |
| 603 | @media (max-width: 768px) { | 707 | } |
| 604 | display: none; | 708 | } |
| 605 | } | 709 | } |
| 606 | } | 710 | |
| 607 | } | 711 | .further-info, |
| 608 | 712 | .notable-mentions, | |
| 609 | 713 | .word-of-warning { | |
| 610 | 714 | h3 { | |
| 611 | .further-info, .notable-mentions, .word-of-warning { | 715 | font-size: 1.4rem; |
| 612 | h3 { | 716 | margin: 1rem 0; |
| 613 | font-size: 1.4rem; | 717 | } |
| 614 | margin: 1rem 0; | 718 | :global(p) { |
| 615 | } | 719 | font-size: 0.9rem; |
| 616 | :global(p) { | 720 | opacity: 0.7; |
| 617 | font-size: 0.9rem; | 721 | :global(strong) { |
| 618 | opacity: 0.7; | 722 | font-weight: 500; |
| 619 | :global(strong) { | 723 | } |
| 620 | font-weight: 500; | 724 | :global(a) { |
| 621 | } | 725 | color: var(--foreground); |
| 622 | :global(a) { | 726 | transition: all 0.15s ease-in-out; |
| 623 | color: var(--foreground); | 727 | &:hover { |
| 624 | transition: all 0.15s ease-in-out; | 728 | color: var(--accent); |
| 625 | &:hover { | 729 | } |
| 626 | color: var(--accent); | 730 | } |
| 627 | } | 731 | } |
| 628 | } | 732 | :global(strong) { |
| 629 | } | 733 | font-weight: 500; |
| 630 | :global(strong) { | 734 | } |
| 631 | font-weight: 500; | 735 | :global(h4) { |
| 632 | } | 736 | font-size: 1.2rem; |
| 633 | :global(h4) { | 737 | margin: 0.5rem 0 0 0; |
| 634 | font-size: 1.2rem; | 738 | } |
| 635 | margin: 0.5rem 0 0 0; | 739 | :global(ul) { |
| 636 | } | 740 | list-style: circle; |
| 637 | :global(ul) { | 741 | padding-left: 1rem; |
| 638 | list-style: circle; | 742 | font-size: 0.9rem; |
| 639 | padding-left: 1rem; | 743 | opacity: 0.7; |
| 640 | font-size: 0.9rem; | 744 | li { |
| 641 | opacity: 0.7; | 745 | margin-bottom: 0.25rem; |
| 642 | li { | 746 | :global(p) { |
| 643 | margin-bottom: 0.25rem; | 747 | display: inline; |
| 644 | :global(p) { | 748 | } |
| 645 | display: inline; | 749 | } |
| 646 | } | 750 | } |
| 647 | } | 751 | } |
| 648 | } | 752 | |
| 649 | } | 753 | pre { |
| 650 | 754 | a { | |
| 651 | pre { | 755 | text-decoration: none; |
| 652 | a { | 756 | color: var(--foreground); |
| 653 | text-decoration: none; | 757 | code { |
| 654 | color: var(--foreground); | 758 | background: #acabb782; |
| 655 | code { | 759 | padding: 0.2rem 0.4rem; |
| 656 | background: #acabb782; | 760 | border-radius: var(--curve-sm); |
| 657 | padding: 0.2rem 0.4rem; | 761 | font-family: Courier New; |
| 658 | border-radius: var(--curve-sm); | 762 | font-size: 0.9rem; |
| 659 | font-family: Courier New; | 763 | @media (max-width: 768px) { |
| 660 | font-size: 0.9rem; | 764 | white-space: break-spaces; |
| 661 | @media(max-width: 768px) { | 765 | } |
| 662 | white-space: break-spaces; | 766 | } |
| 663 | } | 767 | } |
| 664 | } | 768 | } |
| 665 | } | 769 | |
| 666 | } | 770 | .social-wrap { |
| 667 | 771 | display: flex; | |
| 668 | .social-wrap { | 772 | gap: 1rem; |
| 669 | display: flex; | 773 | flex-wrap: wrap; |
| 670 | gap: 1rem; | 774 | justify-content: space-between; |
| 671 | flex-wrap: wrap; | 775 | } |
| 672 | justify-content: space-between; | 776 | |
| 673 | } | 777 | .highlights { |
| 674 | 778 | display: flex; | |
| 675 | .highlights { | 779 | gap: 1rem; |
| 676 | display: flex; | 780 | flex-wrap: wrap; |
| 677 | gap: 1rem; | 781 | align-items: center; |
| 678 | flex-wrap: wrap; | 782 | justify-content: end; |
| 679 | align-items: center; | 783 | |
| 680 | justify-content: end; | 784 | .meta-item, |
| 681 | 785 | .warning { | |
| 682 | .meta-item, .warning { | 786 | display: flex; |
| 683 | display: flex; | 787 | align-items: center; |
| 684 | align-items: center; | 788 | // justify-content: center; |
| 685 | // justify-content: center; | 789 | gap: 0.25rem; |
| 686 | gap: 0.25rem; | 790 | opacity: 0.6; |
| 687 | opacity: 0.6; | 791 | font-size: 0.9rem; |
| 688 | font-size: 0.9rem; | 792 | padding: 0.5rem 0; |
| 689 | padding: 0.5rem 0; | 793 | :global(svg) { |
| 690 | :global(svg) { | 794 | color: var(--foreground); |
| 691 | color: var(--foreground); | 795 | width: 1.2rem; |
| 692 | width: 1.2rem; | 796 | height: 1.2rem; |
| 693 | height: 1.2rem; | 797 | } |
| 694 | } | 798 | a { |
| 695 | a { | 799 | text-decoration: none; |
| 696 | text-decoration: none; | 800 | color: var(--foreground); |
| 697 | color: var(--foreground); | 801 | display: flex; |
| 698 | display: flex; | 802 | gap: 0.25rem; |
| 699 | gap: 0.25rem; | 803 | &:hover { |
| 700 | &:hover { | 804 | color: var(--accent-3); |
| 701 | color: var(--accent-3); | 805 | :global(svg) { |
| 702 | :global(svg) { | 806 | color: var(--accent-3); |
| 703 | color: var(--accent-3); | 807 | } |
| 704 | } | 808 | } |
| 705 | } | 809 | } |
| 706 | } | 810 | } |
| 707 | } | 811 | .warning { |
| 708 | .warning { | 812 | color: var(--danger); |
| 709 | color: var(--danger); | 813 | :global(svg) { |
| 710 | :global(svg) { | 814 | color: var(--danger); |
| 711 | color: var(--danger); | 815 | } |
| 712 | } | 816 | } |
| 713 | } | 817 | .great { |
| 714 | .great { | 818 | color: #007930; // var(--success); |
| 715 | color: #007930; // var(--success); | 819 | :global(svg) { |
| 716 | :global(svg) { | 820 | color: #007930; // var(--success); |
| 717 | color: #007930; // var(--success); | 821 | } |
| 718 | } | 822 | } |
| 719 | } | 823 | } |
| 720 | } | ||
| 721 | |||
| 722 | </style> | 824 | </style> |
web/src/pages/[category].astro +112 −105
| @@ -1,5 +1,4 @@ | |||
| 1 | --- | 1 | --- |
| 2 | |||
| 3 | import Layout from '@layouts/Layout.astro'; | 2 | import Layout from '@layouts/Layout.astro'; |
| 4 | import SectionList from '@components/things/SectionList.astro'; | 3 | import SectionList from '@components/things/SectionList.astro'; |
| 5 | import Main from '@components/scafold/MainCard.astro'; | 4 | import Main from '@components/scafold/MainCard.astro'; |
| @@ -29,129 +28,137 @@ export async function getStaticPaths() { | |||
| 29 | }); | 28 | }); |
| 30 | }); | 29 | }); |
| 31 | 30 | ||
| 32 | return pages.map(({ category, title, sections }) => { | 31 | return pages.map(({ category, title, sections }) => { |
| 33 | return { | 32 | return { |
| 34 | params: { category }, | 33 | params: { category }, |
| 35 | props: { title, sections }, | 34 | props: { title, sections }, |
| 36 | }; | 35 | }; |
| 37 | }); | 36 | }); |
| 38 | } | 37 | } |
| 39 | 38 | ||
| 40 | const makeCarasolData = () => { | 39 | const makeCarasolData = () => { |
| 41 | return { | 40 | return { |
| 42 | "@context": "https://schema.org", | 41 | '@context': 'https://schema.org', |
| 43 | "@type": "ItemList", | 42 | '@type': 'ItemList', |
| 44 | "itemListElement": [ | 43 | itemListElement: [ |
| 45 | sections.map((section, index) => ({ | 44 | sections.map((section, index) => ({ |
| 46 | "@type": "ListItem", | 45 | '@type': 'ListItem', |
| 47 | "position": index + 1, | 46 | position: index + 1, |
| 48 | "url": `https://awesomeprivacy.com/${slugify(title)}/${slugify(section.name)}`, | 47 | url: `https://awesomeprivacy.com/${slugify(title)}/${slugify(section.name)}`, |
| 49 | "item": { | 48 | item: { |
| 50 | "@type": "Service", | 49 | '@type': 'Service', |
| 51 | "name": section.name, | 50 | name: section.name, |
| 52 | "url": `https://awesomeprivacy.com/${slugify(title)}/${slugify(section.name)}`, | 51 | url: `https://awesomeprivacy.com/${slugify(title)}/${slugify(section.name)}`, |
| 53 | } | 52 | }, |
| 54 | })), | 53 | })), |
| 55 | ] | 54 | ], |
| 56 | } | 55 | }; |
| 57 | }; | 56 | }; |
| 58 | 57 | ||
| 59 | const makeBreadcrumbs = () => { | 58 | const makeBreadcrumbs = () => { |
| 60 | return [ | 59 | return [ |
| 61 | { name: 'Home', item: '/' }, | 60 | { name: 'Home', item: '/' }, |
| 62 | { name: title, item: slugify(title) }, | 61 | { name: title, item: slugify(title) }, |
| 63 | ]; | 62 | ]; |
| 64 | }; | 63 | }; |
| 65 | 64 | ||
| 66 | |||
| 67 | const makePaginationLinks = () => { | 65 | const makePaginationLinks = () => { |
| 68 | const index = categories.findIndex(category => category.name === title); | 66 | const index = categories.findIndex((category) => category.name === title); |
| 69 | const previousCategory = index > 0 ? categories[index - 1].name : null; | 67 | const previousCategory = index > 0 ? categories[index - 1].name : null; |
| 70 | const nextCategory = index < categories.length - 1 ? categories[index + 1].name : null; | 68 | const nextCategory = |
| 71 | return { previous: previousCategory, next: nextCategory }; | 69 | index < categories.length - 1 ? categories[index + 1].name : null; |
| 70 | return { previous: previousCategory, next: nextCategory }; | ||
| 72 | }; | 71 | }; |
| 73 | 72 | ||
| 74 | const { previous, next } = makePaginationLinks(); | 73 | const { previous, next } = makePaginationLinks(); |
| 75 | |||
| 76 | --- | 74 | --- |
| 77 | 75 | ||
| 78 | <Layout title={`${title} | Awesome Privacy`} breadcrumbs={makeBreadcrumbs()} customSchemaJson={makeCarasolData()}> | 76 | <Layout |
| 77 | title={`${title} | Awesome Privacy`} | ||
| 78 | breadcrumbs={makeBreadcrumbs()} | ||
| 79 | customSchemaJson={makeCarasolData()} | ||
| 80 | > | ||
| 79 | <Main> | 81 | <Main> |
| 80 | <div class="breadcrumbs"> | 82 | <div class="breadcrumbs"> |
| 81 | <span> | 83 | <span> |
| 82 | <a href="/">Awesome Privacy</a> | 84 | <a href="/">Awesome Privacy</a> |
| 83 | ➔ <a href={`/${slugify(title)}`}>{title}</a> | 85 | ➔ <a href={`/${slugify(title)}`}>{title}</a> |
| 84 | </span> | 86 | </span> |
| 85 | </div> | 87 | </div> |
| 86 | <SectionList title={title} sections={sections} bigTitle={true} /> | 88 | <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> |
| 88 | <div class="pagination-navigation"> | 90 | <div class="pagination-navigation"> |
| 89 | { previous ? ( | 91 | { |
| 90 | <Button url={`/${slugify(previous)}`}> | 92 | previous ? ( |
| 91 | <span>← Previous</span> | 93 | <Button url={`/${slugify(previous)}`}> |
| 92 | <p>{previous}</p> | 94 | <span>← Previous</span> |
| 93 | </Button> | 95 | <p>{previous}</p> |
| 94 | ) : <p class="nothing"></p>} | 96 | </Button> |
| 95 | { next && ( | 97 | ) : ( |
| 96 | <Button url={`/${slugify(next)}`}> | 98 | <p class="nothing" /> |
| 97 | <span>Next →</span> | 99 | ) |
| 98 | <p>{next}</p> | 100 | } |
| 99 | </Button> | 101 | { |
| 100 | )} | 102 | next && ( |
| 101 | </div> | 103 | <Button url={`/${slugify(next)}`}> |
| 104 | <span>Next →</span> | ||
| 105 | <p>{next}</p> | ||
| 106 | </Button> | ||
| 107 | ) | ||
| 108 | } | ||
| 109 | </div> | ||
| 102 | </Main> | 110 | </Main> |
| 103 | </Layout> | 111 | </Layout> |
| 104 | 112 | ||
| 105 | <style lang="scss"> | 113 | <style lang="scss"> |
| 106 | .pagination-navigation { | 114 | .pagination-navigation { |
| 107 | display: flex; | 115 | display: flex; |
| 108 | justify-content: space-between; | 116 | justify-content: space-between; |
| 109 | align-items: center; | 117 | align-items: center; |
| 110 | padding: 1rem 0; | 118 | padding: 1rem 0; |
| 111 | :global(.button) { | 119 | :global(.button) { |
| 112 | min-width: 120px; | 120 | min-width: 120px; |
| 113 | width: fit-content; | 121 | width: fit-content; |
| 114 | padding: 0.25rem 1rem; | 122 | padding: 0.25rem 1rem; |
| 115 | text-align: right; | 123 | text-align: right; |
| 116 | &:first-child { text-align: left; } | 124 | &:first-child { |
| 117 | p { | 125 | text-align: left; |
| 118 | margin: 0; | 126 | } |
| 119 | font-weight: normal; | 127 | p { |
| 120 | font-size: 1rem; | 128 | margin: 0; |
| 121 | } | 129 | font-weight: normal; |
| 122 | span { | 130 | font-size: 1rem; |
| 123 | font-size: 0.8rem; | 131 | } |
| 124 | } | 132 | span { |
| 125 | 133 | font-size: 0.8rem; | |
| 126 | } | 134 | } |
| 127 | .nothing { | 135 | } |
| 128 | width: 120px; | 136 | .nothing { |
| 129 | } | 137 | width: 120px; |
| 130 | .go-to-category { | 138 | } |
| 131 | color: var(--foreground); | 139 | .go-to-category { |
| 132 | font-size: 0.8rem; | 140 | color: var(--foreground); |
| 133 | opacity: 0.5; | 141 | font-size: 0.8rem; |
| 134 | } | 142 | opacity: 0.5; |
| 135 | } | 143 | } |
| 136 | 144 | } | |
| 137 | 145 | ||
| 138 | .breadcrumbs { | 146 | .breadcrumbs { |
| 139 | opacity: 0.5; | 147 | opacity: 0.5; |
| 140 | font-size: 0.8rem; | 148 | font-size: 0.8rem; |
| 141 | position: absolute; | 149 | position: absolute; |
| 142 | right: 1rem; | 150 | right: 1rem; |
| 143 | top: 1rem; | 151 | top: 1rem; |
| 144 | a { | 152 | a { |
| 145 | color: var(--foreground); | 153 | color: var(--foreground); |
| 146 | transition: all 0.15s ease-in-out; | 154 | transition: all 0.15s ease-in-out; |
| 147 | 155 | ||
| 148 | &:hover { | 156 | &:hover { |
| 149 | color: var(--accent); | 157 | color: var(--accent); |
| 150 | } | 158 | } |
| 151 | } | 159 | } |
| 152 | @media(max-width: 768px) { | 160 | @media (max-width: 768px) { |
| 153 | display: none; | 161 | display: none; |
| 154 | } | 162 | } |
| 155 | } | 163 | } |
| 156 | |||
| 157 | </style> | 164 | </style> |
web/src/pages/about.astro +333 −258
| @@ -1,14 +1,20 @@ | |||
| 1 | --- | 1 | --- |
| 2 | |||
| 3 | import Layout from '@layouts/Layout.astro'; | 2 | import Layout from '@layouts/Layout.astro'; |
| 4 | import Main from '@components/scafold/MainCard.astro'; | 3 | import Main from '@components/scafold/MainCard.astro'; |
| 5 | import Icon from '@components/form/Icon.astro'; | 4 | import Icon from '@components/form/Icon.astro'; |
| 6 | import SocialShare from '@components/form/Social.astro'; | 5 | import SocialShare from '@components/form/Social.astro'; |
| 7 | import { parseMarkdown } from '@utils/parse-markdown'; | 6 | import { parseMarkdown } from '@utils/parse-markdown'; |
| 8 | import { authorProjects, authorSocials, aboutOurData, projectRequirements, appDescription } from '../site-config'; | 7 | import { |
| 8 | authorProjects, | ||
| 9 | authorSocials, | ||
| 10 | aboutOurData, | ||
| 11 | projectRequirements, | ||
| 12 | appDescription, | ||
| 13 | } from '../site-config'; | ||
| 9 | 14 | ||
| 10 | const contributorsResource = async () => { | 15 | const 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'; | ||
| 12 | const response = await fetch(url); | 18 | const response = await fetch(url); |
| 13 | if (!response.ok) { | 19 | if (!response.ok) { |
| 14 | throw new Error('Failed to fetch contributors'); | 20 | throw new Error('Failed to fetch contributors'); |
| @@ -26,334 +32,403 @@ const sponsorsResource = async () => { | |||
| 26 | }; | 32 | }; |
| 27 | 33 | ||
| 28 | const licenseContent = async () => { | 34 | const 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'; | ||
| 30 | const response = await fetch(url); | 37 | const response = await fetch(url); |
| 31 | if (!response.ok) { | 38 | if (!response.ok) { |
| 32 | throw new Error('Failed to fetch license'); | 39 | throw new Error('Failed to fetch license'); |
| 33 | } | 40 | } |
| 34 | return await response.text(); | 41 | return await response.text(); |
| 35 | }; | 42 | }; |
| 36 | |||
| 37 | --- | 43 | --- |
| 38 | 44 | ||
| 39 | <Layout title="About | Awesome Privacy" description={appDescription}> | 45 | <Layout title="About | Awesome Privacy" description={appDescription}> |
| 40 | <div class="about-page"> | 46 | <div class="about-page"> |
| 41 | <Main> | 47 | <Main> |
| 42 | <h2 id="objective">Objective</h2> | 48 | <h2 id="objective">Objective</h2> |
| 43 | <p> | 49 | <p> |
| 44 | Large data-hungry corporations dominate the digital world but with little, | 50 | Large data-hungry corporations dominate the digital world but with |
| 45 | or no respect for your privacy. | 51 | little, or no respect for your privacy. We believe that privacy is a |
| 46 | We believe that privacy is a fundamental human right and that it should be protected. | 52 | fundamental human right and that it should be protected. |
| 47 | <br /><br /> | 53 | <br /><br /> |
| 48 | Migrating to open-source applications and those with a strong emphasis on | 54 | Migrating to open-source applications and those with a strong emphasis on |
| 49 | privacy & security will help safegaurd you from corporations, | 55 | privacy & security will help safegaurd you from corporations, governments, |
| 50 | governments, and hackers who log, store or sell your sensetive personal data. | 56 | and hackers who log, store or sell your sensetive personal data. |
| 51 | <br /><br /> | 57 | <br /><br /> |
| 52 | Awesome Privacy is a directory of alternative software which respects your privacy. | 58 | Awesome Privacy is a directory of alternative software which respects your |
| 53 | <br /><br /> | 59 | privacy. |
| 54 | 60 | <br /><br /> | |
| 55 | </p> | 61 | </p> |
| 56 | <hr /> | 62 | <hr /> |
| 57 | 63 | ||
| 58 | <h2 id="creteria">Software Requirements</h2> | 64 | <h2 id="creteria">Software Requirements</h2> |
| 59 | <div class="software-requirements"><p set:html={parseMarkdown(projectRequirements)}></p></div> | 65 | <div class="software-requirements"> |
| 60 | <hr /> | 66 | <p set:html={parseMarkdown(projectRequirements)} /> |
| 67 | </div> | ||
| 68 | <hr /> | ||
| 61 | 69 | ||
| 62 | <h2 id="our-data">Our Data</h2> | 70 | <h2 id="our-data">Our Data</h2> |
| 63 | <div class="about-the-data"><p set:html={parseMarkdown(aboutOurData)}></p></div> | 71 | <div class="about-the-data"> |
| 64 | <hr /> | 72 | <p set:html={parseMarkdown(aboutOurData)} /> |
| 73 | </div> | ||
| 74 | <hr /> | ||
| 65 | 75 | ||
| 66 | <h2 id="contributing">Contributing</h2> | 76 | <h2 id="contributing">Contributing</h2> |
| 67 | <p> | 77 | <p> |
| 68 | Awesome Privacy (including all data and code) is fully open source, | 78 | 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. | 79 | maintained by a core group of volenteers, with a lot of help from the |
| 70 | <br /><br /> | 80 | community. |
| 71 | We welcome suggestions, additions, edits and removals to the list.<br /> | 81 | <br /><br /> |
| 72 | It's thanks to contributors like you that this project is possible 💜 | 82 | We welcome suggestions, additions, edits and removals to the list.<br /> |
| 73 | <br /><br /> | 83 | It's thanks to contributors like you that this project is possible 💜 |
| 74 | To get started, head over to our <a href="https://github.com/lissy93/awesome-privacy">GitHub repository</a>. | 84 | <br /><br /> |
| 75 | From here, you'll be able to edit <a href="#"><code>awesome-privacy.yml</code></a> | 85 | To get started, head over to our <a |
| 76 | where all data is stored, and then submit your changes as a pull request. | 86 | href="https://github.com/lissy93/awesome-privacy">GitHub repository</a |
| 77 | <br /><br /> | 87 | >. From here, you'll be able to edit <a href="#" |
| 78 | If you're new to open source, you can find some resources to get you started | 88 | ><code>awesome-privacy.yml</code></a |
| 79 | at <a href="https://git-in.to">git-in.to</a>, but feel free to reach out if you need any help 😊 | 89 | > |
| 80 | </p> | 90 | where all data is stored, and then submit your changes as a pull request. |
| 81 | <hr /> | 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 /> | ||
| 82 | 97 | ||
| 83 | <h2 id="acknowledgements">Acknowledgements</h2> | 98 | <h2 id="acknowledgements">Acknowledgements</h2> |
| 84 | <h3 id="sponsors">Sponsors</h3> | 99 | <h3 id="sponsors">Sponsors</h3> |
| 85 | <p>Huge thanks to the following sponsors, for their ongoing support 💖</p> | 100 | <p>Huge thanks to the following sponsors, for their ongoing support 💖</p> |
| 86 | <div class="user-list"> | 101 | <div class="user-list"> |
| 87 | {sponsorsResource().then((sponsors) => { | 102 | { |
| 88 | return sponsors.map((sponsor: any) => ( | 103 | sponsorsResource().then((sponsors) => { |
| 89 | <a class="user" href={`https://github.com/${sponsor.login}`} target="_blank" rel="noreferrer"> | 104 | return sponsors.map((sponsor: any) => ( |
| 90 | <img src={sponsor.avatarUrl} alt={sponsor.login} /> | 105 | <a |
| 91 | <p>{sponsor.name || sponsor.login}</p> | 106 | class="user" |
| 92 | </a> | 107 | href={`https://github.com/${sponsor.login}`} |
| 93 | )); | 108 | target="_blank" |
| 94 | })} | 109 | rel="noreferrer" |
| 95 | </div> | 110 | > |
| 111 | <img src={sponsor.avatarUrl} alt={sponsor.login} /> | ||
| 112 | <p>{sponsor.name || sponsor.login}</p> | ||
| 113 | </a> | ||
| 114 | )); | ||
| 115 | }) | ||
| 116 | } | ||
| 117 | </div> | ||
| 96 | 118 | ||
| 97 | <h3 id="contributors">Contributors</h3> | 119 | <h3 id="contributors">Contributors</h3> |
| 98 | <p> | 120 | <p> |
| 99 | This project exists thanks to all the people who've helped build and maintain it.<br /> | 121 | This project exists thanks to all the people who've helped build and |
| 100 | Special thanks to the below, top-100 contributors 🌟 | 122 | maintain it.<br /> |
| 101 | </p> | 123 | Special thanks to the below, top-100 contributors 🌟 |
| 102 | <div class="user-list"> | 124 | </p> |
| 103 | {contributorsResource().then((sponsors) => { | 125 | <div class="user-list"> |
| 104 | return sponsors.map((sponsor: any) => ( | 126 | { |
| 105 | <a class="user" href={sponsor.html_url} target="_blank" rel="noreferrer"> | 127 | contributorsResource().then((sponsors) => { |
| 106 | <img src={sponsor.avatar_url} alt={sponsor.login} /> | 128 | return sponsors.map((sponsor: any) => ( |
| 107 | <p>{sponsor.login}</p> | 129 | <a |
| 108 | </a> | 130 | class="user" |
| 109 | )); | 131 | href={sponsor.html_url} |
| 110 | })} | 132 | target="_blank" |
| 111 | </div> | 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> | ||
| 112 | 142 | ||
| 113 | <hr /> | 143 | <hr /> |
| 114 | 144 | ||
| 115 | <h2 id="support-us">Help us out</h2> | 145 | <h2 id="support-us">Help us out</h2> |
| 116 | <p> | 146 | <p> |
| 117 | Awesome Privacy is a free, open source and community-maintained resource.<br /> | 147 | Awesome Privacy is a free, open source and community-maintained |
| 118 | There's a few ways you can support us: | 148 | resource.<br /> |
| 119 | <ul class="help-list"> | 149 | There's a few ways you can support us: |
| 120 | <li>Visiting, forking, or starring or our <a href="https://github.com/lissy93/awesome-privacy">GitHub repository</a></li> | 150 | <ul class="help-list"> |
| 121 | <li>Help us keep our info up-to-date, but submitting an addition, removal or ammendment</li> | 151 | <li> |
| 122 | <li>Leave feedback on services that you've used, to help others make a more informed decission</li> | 152 | Visiting, forking, or starring or our <a |
| 123 | <li>Consider <a href="https://github.com/sponsors/Lissy93">sponsoring us on GitHub</a>, if you're able 💖</li> | 153 | href="https://github.com/lissy93/awesome-privacy" |
| 124 | <li>Share Awesome Privacy with your network</li> | 154 | >GitHub repository</a |
| 125 | </ul> | 155 | > |
| 126 | <SocialShare /> | 156 | </li> |
| 127 | </p> | 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> | ||
| 128 | 174 | ||
| 129 | <hr /> | 175 | <hr /> |
| 130 | 176 | ||
| 131 | <h2 id="author">Author</h2> | 177 | <h2 id="author">Author</h2> |
| 132 | <article class="author"> | 178 | <article class="author"> |
| 133 | <p> | 179 | <p> |
| 134 | This project was originally started by | 180 | This project was originally started by me, <a |
| 135 | me, <a href="https://aliciasykes.com">Alicia Sykes</a> | 181 | href="https://aliciasykes.com">Alicia Sykes</a |
| 182 | > | ||
| 136 | (with a lot of help from the community) | 183 | (with a lot of help from the community) |
| 137 | </p> | 184 | </p> |
| 138 | <br /> | 185 | <br /> |
| 139 | <p class="about"> | 186 | <p class="about"> |
| 140 | I build apps which aim to help people escape big tech, secure their data, | 187 | I build apps which aim to help people escape big tech, secure their |
| 141 | and protect their privacy. | 188 | data, and protect their privacy. |
| 142 | </p> | 189 | </p> |
| 143 | <br /> | 190 | <br /> |
| 144 | <div class="pic-and-socials"> | 191 | <div class="pic-and-socials"> |
| 145 | <a href="https://aliciasykes.com"> | 192 | <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 | /> | ||
| 147 | </a> | 200 | </a> |
| 148 | <div class="socials"> | 201 | <div class="socials"> |
| 149 | { | 202 | { |
| 150 | authorSocials.map((social: { link: string; color: string; icon: string; }) => ( | 203 | authorSocials.map( |
| 151 | <a href={social.link} style={`--color: ${social.color}`} target="_blank"> | 204 | (social: { link: string; color: string; icon: string }) => ( |
| 152 | <Icon icon={social.icon} width={24} height={24} /> | 205 | <a |
| 153 | </a> | 206 | href={social.link} |
| 154 | )) | 207 | style={`--color: ${social.color}`} |
| 208 | target="_blank" | ||
| 209 | > | ||
| 210 | <Icon icon={social.icon} width={24} height={24} /> | ||
| 211 | </a> | ||
| 212 | ), | ||
| 213 | ) | ||
| 155 | } | 214 | } |
| 156 | </div> | 215 | </div> |
| 157 | </div> | 216 | </div> |
| 158 | <p class="more-about"> | 217 | <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 /> | ||
| 160 | So if this type of stuff interests you, check out these other projects: | 220 | So if this type of stuff interests you, check out these other projects: |
| 161 | </p> | 221 | </p> |
| 162 | <ul> | 222 | <ul> |
| 163 | { | 223 | { |
| 164 | authorProjects.map((project: { title: string; icon: string; link: string; description: string; }) => ( | 224 | authorProjects.map( |
| 165 | <li> | 225 | (project: { |
| 166 | <img width="20" height="20" alt={project.title} src={project.icon} /> | 226 | title: string; |
| 167 | <a href={project.link} target="_blank" rel="noreferrer"> | 227 | icon: string; |
| 168 | {project.title} | 228 | link: string; |
| 169 | </a> - {project.description} | 229 | description: string; |
| 170 | </li> | 230 | }) => ( |
| 171 | )) | 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 | ) | ||
| 172 | } | 245 | } |
| 173 | <li> | 246 | <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 | > | ||
| 175 | and on <a href="https://github.com/lissy93">github.com/lissy93</a> | 250 | and on <a href="https://github.com/lissy93">github.com/lissy93</a> |
| 176 | </li> | 251 | </li> |
| 177 | </ul> | 252 | </ul> |
| 178 | <br /> | 253 | <br /> |
| 179 | <p> | 254 | <p> |
| 180 | If you'd like to support the ongoing work on Awesome Privacy, | 255 | If you'd like to support the ongoing work on Awesome Privacy, and |
| 181 | and other similar projects, | 256 | other similar projects, consider <a |
| 182 | consider <a href="https://github.com/sponsors/lissy93">sponsoring me</a> on GitHub 💖 | 257 | href="https://github.com/sponsors/lissy93">sponsoring me</a |
| 258 | > on GitHub 💖 | ||
| 183 | </p> | 259 | </p> |
| 260 | </article> | ||
| 184 | 261 | ||
| 185 | </article> | 262 | <hr /> |
| 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> | ||
| 200 | 263 | ||
| 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> | ||
| 202 | </div> | 278 | </div> |
| 203 | </Layout> | 279 | </Layout> |
| 204 | 280 | ||
| 205 | <style lang="scss"> | 281 | <style lang="scss"> |
| 206 | h2 { | 282 | h2 { |
| 207 | font-size: 2rem; | 283 | font-size: 2rem; |
| 208 | margin: 2rem 0 1rem 0; | 284 | margin: 2rem 0 1rem 0; |
| 209 | } | ||
| 210 | p { | ||
| 211 | font-size: 1.2rem; | ||
| 212 | } | ||
| 213 | hr { | ||
| 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); | ||
| 222 | } | 285 | } |
| 223 | } | 286 | p { |
| 224 | |||
| 225 | h3 { | ||
| 226 | font-size: 1.6rem; | ||
| 227 | } | ||
| 228 | |||
| 229 | .software-requirements, .about-the-data { | ||
| 230 | :global(p) { | ||
| 231 | font-size: 1.2rem; | 287 | font-size: 1.2rem; |
| 232 | margin: 0 0 0.5rem 0; | ||
| 233 | } | 288 | } |
| 234 | :global(ul) { | 289 | hr { |
| 235 | padding-left: 0.5rem; | 290 | margin: 2rem 0; |
| 236 | list-style: none; | 291 | border: 0; |
| 237 | font-size: 1.2rem; | 292 | border-top: 2px solid var(--accent); |
| 238 | :global(li ul) { | 293 | &:nth-child(6) { |
| 239 | padding: 0 0 0.5rem 1rem; | 294 | border-color: var(--accent-3); |
| 240 | list-style: circle; | 295 | } |
| 296 | &:nth-child(9) { | ||
| 297 | border-color: var(--accent-2); | ||
| 241 | } | 298 | } |
| 242 | |||
| 243 | } | 299 | } |
| 244 | :global(h3) { | 300 | |
| 301 | h3 { | ||
| 245 | font-size: 1.6rem; | 302 | font-size: 1.6rem; |
| 246 | margin-bottom: 0; | ||
| 247 | } | ||
| 248 | :global(strong) { | ||
| 249 | font-weight: 500; | ||
| 250 | } | 303 | } |
| 251 | :global(small) { | 304 | |
| 252 | font-size: 0.8rem; | 305 | .software-requirements, |
| 253 | opacity: 0.7; | 306 | .about-the-data { |
| 254 | :global(a) { | 307 | :global(p) { |
| 255 | color: var(--accent-3); | 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; | ||
| 256 | } | 340 | } |
| 257 | } | 341 | } |
| 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 | } | ||
| 266 | 342 | ||
| 267 | .user-list { | 343 | .user-list { |
| 268 | display: flex; | 344 | display: flex; |
| 269 | flex-wrap: wrap; | 345 | flex-wrap: wrap; |
| 270 | gap: 1rem; | 346 | gap: 1rem; |
| 271 | margin: 2rem 0; | 347 | margin: 2rem 0; |
| 272 | .user { | 348 | .user { |
| 273 | width: 6rem; | 349 | 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; | ||
| 286 | overflow: hidden; | 350 | 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 | } | ||
| 287 | } | 364 | } |
| 288 | } | 365 | } |
| 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 | } | ||
| 309 | 366 | ||
| 310 | .author { | 367 | .license-content { |
| 311 | p { | 368 | max-height: 500px; |
| 312 | margin: 1rem 0 0 0; | 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; | ||
| 313 | } | 378 | } |
| 314 | ul { | 379 | |
| 315 | padding-left: 1.5rem; | 380 | .help-list { |
| 381 | padding-left: 1rem; | ||
| 316 | list-style: circle; | 382 | list-style: circle; |
| 317 | margin-bottom: 0; | 383 | font-size: 1.1rem; |
| 318 | li { | ||
| 319 | font-size: 1.1rem; | ||
| 320 | } | ||
| 321 | } | 384 | } |
| 322 | .about { | 385 | |
| 323 | font-size: 1.4rem; | 386 | .author { |
| 324 | font-style: italic; | 387 | p { |
| 325 | font-weight: 300; | 388 | margin: 1rem 0 0 0; |
| 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); | ||
| 343 | } | 389 | } |
| 344 | .socials { | 390 | ul { |
| 345 | display: flex; | 391 | padding-left: 1.5rem; |
| 346 | margin: 0.5rem 1rem; | 392 | list-style: circle; |
| 347 | justify-content: space-between; | 393 | margin-bottom: 0; |
| 348 | :global(a svg) { | 394 | li { |
| 349 | color: var(--foreground); | 395 | font-size: 1.1rem; |
| 350 | transition: color 0.2s ease-in-out; | 396 | } |
| 351 | &:hover { | 397 | } |
| 352 | color: var(--color); | 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 | } | ||
| 353 | } | 430 | } |
| 354 | } | 431 | } |
| 355 | } | 432 | } |
| 356 | } | 433 | } |
| 357 | } | ||
| 358 | |||
| 359 | </style> | 434 | </style> |
web/src/pages/api/awesome-privacy.json.ts +13 −10
| @@ -3,19 +3,22 @@ import yaml from 'js-yaml'; | |||
| 3 | 3 | ||
| 4 | import type { AwesomePrivacy } from '../../types/Service'; | 4 | import type { AwesomePrivacy } from '../../types/Service'; |
| 5 | 5 | ||
| 6 | const awesomePrivacyYamlPath = 'https://raw.githubusercontent.com/Lissy93/awesome-privacy/main/awesome-privacy.yml'; | 6 | const awesomePrivacyYamlPath = |
| 7 | 'https://raw.githubusercontent.com/Lissy93/awesome-privacy/main/awesome-privacy.yml'; | ||
| 7 | 8 | ||
| 8 | export const GET: APIRoute = async () => { | 9 | export const GET: APIRoute = async () => { |
| 9 | |||
| 10 | const yamlContent = await fetch(awesomePrivacyYamlPath) | 10 | const yamlContent = await fetch(awesomePrivacyYamlPath) |
| 11 | .then(response => response.text()) | 11 | .then((response) => response.text()) |
| 12 | .catch(error => { | 12 | .catch((error) => { |
| 13 | return JSON.stringify({ error: "Failed to fetch YAML file", details: error }); | 13 | return JSON.stringify({ |
| 14 | }); | 14 | error: 'Failed to fetch YAML file', |
| 15 | details: error, | ||
| 16 | }); | ||
| 17 | }); | ||
| 15 | 18 | ||
| 16 | const yamlObject = yaml.load(yamlContent) as AwesomePrivacy; | 19 | const yamlObject = yaml.load(yamlContent) as AwesomePrivacy; |
| 17 | 20 | ||
| 18 | return new Response( | 21 | return new Response(JSON.stringify(yamlObject), { |
| 19 | JSON.stringify(yamlObject), { headers: { 'content-type': 'application/json' } } | 22 | headers: { 'content-type': 'application/json' }, |
| 20 | ) | 23 | }); |
| 21 | } | 24 | }; |
web/src/pages/api/index.astro +32 −30
| @@ -3,43 +3,45 @@ import Layout from '@layouts/Layout.astro'; | |||
| 3 | import Button from '@components/form/Button.astro'; | 3 | import Button from '@components/form/Button.astro'; |
| 4 | 4 | ||
| 5 | import MainCard from '@components/scafold/MainCard.astro'; | 5 | import MainCard from '@components/scafold/MainCard.astro'; |
| 6 | |||
| 7 | --- | 6 | --- |
| 8 | 7 | ||
| 9 | <Layout title="API Docs | Awesome Privacy"> | 8 | <Layout title="API Docs | Awesome Privacy"> |
| 10 | 9 | <MainCard> | |
| 11 | <MainCard> | 10 | <div id="swagger-ui"></div> |
| 12 | <div id="swagger-ui"></div> | 11 | <div class="go"> |
| 13 | <div class="go"> | 12 | <Button url="https://api.awesome-privacy.xyz" text="Try it Out" /> |
| 14 | <Button url="https://api.awesome-privacy.xyz" text="Try it Out" /> | 13 | </div> |
| 15 | </div> | 14 | </MainCard> |
| 16 | </MainCard> | ||
| 17 | |||
| 18 | </Layout> | 15 | </Layout> |
| 19 | 16 | ||
| 20 | <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/swagger-ui/4.1.3/swagger-ui.css"> | 17 | <link |
| 21 | <script is:inline src="https://cdnjs.cloudflare.com/ajax/libs/swagger-ui/4.1.3/swagger-ui-bundle.js"></script> | 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> | ||
| 22 | <script type="module" is:inline> | 26 | <script type="module" is:inline> |
| 23 | window.onload = () => { | 27 | window.onload = () => { |
| 24 | SwaggerUIBundle({ | 28 | SwaggerUIBundle({ |
| 25 | url: 'https://raw.githubusercontent.com/Lissy93/awesome-privacy/main/api/open-api-spec.yml', | 29 | url: 'https://raw.githubusercontent.com/Lissy93/awesome-privacy/main/api/open-api-spec.yml', |
| 26 | dom_id: '#swagger-ui', | 30 | dom_id: '#swagger-ui', |
| 27 | deepLinking: true, | 31 | deepLinking: true, |
| 28 | presets: [ | 32 | presets: [ |
| 29 | SwaggerUIBundle.presets.apis, | 33 | SwaggerUIBundle.presets.apis, |
| 30 | SwaggerUIBundle.SwaggerUIStandalonePreset | 34 | SwaggerUIBundle.SwaggerUIStandalonePreset, |
| 31 | ], | 35 | ], |
| 32 | plugins: [ | 36 | plugins: [SwaggerUIBundle.plugins.DownloadUrl], |
| 33 | SwaggerUIBundle.plugins.DownloadUrl | 37 | }); |
| 34 | ] | 38 | }; |
| 35 | }); | ||
| 36 | } | ||
| 37 | </script> | 39 | </script> |
| 38 | 40 | ||
| 39 | <style lang="scss"> | 41 | <style lang="scss"> |
| 40 | .go { | 42 | .go { |
| 41 | display: flex; | 43 | display: flex; |
| 42 | justify-content: center; | 44 | justify-content: center; |
| 43 | margin-top: 1rem; | 45 | margin-top: 1rem; |
| 44 | } | 46 | } |
| 45 | </style> | 47 | </style> |
web/src/pages/api/line-numbers.json.ts +42 −25
| @@ -14,35 +14,47 @@ interface LineNumberData { | |||
| 14 | [service: string]: { | 14 | [service: string]: { |
| 15 | lineNumbers: LineNumberRange | null; | 15 | lineNumbers: LineNumberRange | null; |
| 16 | yaml: string; | 16 | yaml: string; |
| 17 | } | 17 | }; |
| 18 | }; | 18 | }; |
| 19 | }; | 19 | }; |
| 20 | } | 20 | } |
| 21 | 21 | ||
| 22 | const awesomePrivacyYamlPath = 'https://raw.githubusercontent.com/Lissy93/awesome-privacy/main/awesome-privacy.yml'; | 22 | const awesomePrivacyYamlPath = |
| 23 | 'https://raw.githubusercontent.com/Lissy93/awesome-privacy/main/awesome-privacy.yml'; | ||
| 23 | 24 | ||
| 24 | /** | 25 | /** |
| 25 | * Given a service object and an array of string lines from the raw YAML | 26 | * Given a service object and an array of string lines from the raw YAML |
| 26 | * Find the starting and ending line number for that service | 27 | * Find the starting and ending line number for that service |
| 27 | */ | 28 | */ |
| 28 | const calculateServiceRange = (service: Service, category: Category, yamlLines: string[]): LineNumberRange | null => { | 29 | const calculateServiceRange = ( |
| 30 | service: Service, | ||
| 31 | category: Category, | ||
| 32 | yamlLines: string[], | ||
| 33 | ): LineNumberRange | null => { | ||
| 29 | const lookFor = `- name: ${service.name}`; | 34 | const lookFor = `- name: ${service.name}`; |
| 30 | const categoryStart = yamlLines.findIndex(line => line.includes(category.name)); | 35 | const categoryStart = yamlLines.findIndex((line) => |
| 31 | const start = yamlLines.slice(categoryStart).findIndex(line => line.includes(lookFor)) + categoryStart + 1; | 36 | line.includes(category.name), |
| 37 | ); | ||
| 38 | const start = | ||
| 39 | yamlLines.slice(categoryStart).findIndex((line) => line.includes(lookFor)) + | ||
| 40 | categoryStart + | ||
| 41 | 1; | ||
| 32 | if (start === -1) return null; | 42 | if (start === -1) return null; |
| 33 | const detectEnd = (line: string) => { | 43 | const detectEnd = (line: string) => { |
| 34 | return line.trim().length === 0 | 44 | return ( |
| 35 | || line.startsWith(' - ') | 45 | line.trim().length === 0 || |
| 36 | || line.includes('- name:') | 46 | line.startsWith(' - ') || |
| 37 | || line.includes('notableMentions:') | 47 | line.includes('- name:') || |
| 38 | || line.includes('furtherInfo:') | 48 | line.includes('notableMentions:') || |
| 39 | || line.includes('wordOfWarning:') | 49 | line.includes('furtherInfo:') || |
| 40 | } | 50 | line.includes('wordOfWarning:') |
| 51 | ); | ||
| 52 | }; | ||
| 41 | const remainingLines = yamlLines.slice(start); | 53 | const remainingLines = yamlLines.slice(start); |
| 42 | const end = start + remainingLines.findIndex(detectEnd); | 54 | const end = start + remainingLines.findIndex(detectEnd); |
| 43 | 55 | ||
| 44 | return { start, end }; | 56 | return { start, end }; |
| 45 | } | 57 | }; |
| 46 | 58 | ||
| 47 | /** | 59 | /** |
| 48 | * Given a service object, convert it into a correctly formatted YAML string | 60 | * Given a service object, convert it into a correctly formatted YAML string |
| @@ -55,7 +67,10 @@ const convertJsonIntoYaml = (service: Service): string => { | |||
| 55 | * Given the object representation of the YAML and the array of lines from the raw YAML | 67 | * Given the object representation of the YAML and the array of lines from the raw YAML |
| 56 | * Organize the data into a format that can be returned as JSON | 68 | * Organize the data into a format that can be returned as JSON |
| 57 | */ | 69 | */ |
| 58 | const makeResults = (yamlObject: AwesomePrivacy, yamlLines: string[]): LineNumberData => { | 70 | const makeResults = ( |
| 71 | yamlObject: AwesomePrivacy, | ||
| 72 | yamlLines: string[], | ||
| 73 | ): LineNumberData => { | ||
| 59 | const organizedData: LineNumberData = {}; | 74 | const organizedData: LineNumberData = {}; |
| 60 | (yamlObject.categories || []).forEach((category) => { | 75 | (yamlObject.categories || []).forEach((category) => { |
| 61 | organizedData[category.name] = {}; | 76 | organizedData[category.name] = {}; |
| @@ -70,16 +85,18 @@ const makeResults = (yamlObject: AwesomePrivacy, yamlLines: string[]): LineNumbe | |||
| 70 | }); | 85 | }); |
| 71 | }); | 86 | }); |
| 72 | return organizedData; | 87 | return organizedData; |
| 73 | } | 88 | }; |
| 74 | 89 | ||
| 75 | export const GET: APIRoute = async () => { | 90 | export const GET: APIRoute = async () => { |
| 76 | |||
| 77 | // Fetch the raw YAML from the awesome-privacy repository | 91 | // Fetch the raw YAML from the awesome-privacy repository |
| 78 | const yamlContent = await fetch(awesomePrivacyYamlPath) | 92 | const yamlContent = await fetch(awesomePrivacyYamlPath) |
| 79 | .then(response => response.text()) | 93 | .then((response) => response.text()) |
| 80 | .catch(error => { | 94 | .catch((error) => { |
| 81 | return JSON.stringify({ error: "Failed to fetch YAML file", details: error }); | 95 | return JSON.stringify({ |
| 82 | }); | 96 | error: 'Failed to fetch YAML file', |
| 97 | details: error, | ||
| 98 | }); | ||
| 99 | }); | ||
| 83 | 100 | ||
| 84 | // Array of lines from the raw YAML | 101 | // Array of lines from the raw YAML |
| 85 | const yamlLines: string[] = yamlContent.split('\n'); | 102 | const yamlLines: string[] = yamlContent.split('\n'); |
| @@ -90,7 +107,7 @@ export const GET: APIRoute = async () => { | |||
| 90 | // Make results | 107 | // Make results |
| 91 | const results = makeResults(yamlObject, yamlLines); | 108 | const results = makeResults(yamlObject, yamlLines); |
| 92 | 109 | ||
| 93 | return new Response( | 110 | return new Response(JSON.stringify(results), { |
| 94 | JSON.stringify(results), { headers: { 'content-type': 'application/json' } } | 111 | headers: { 'content-type': 'application/json' }, |
| 95 | ) | 112 | }); |
| 96 | } | 113 | }; |
web/src/pages/browse.astro +208 −198
| @@ -1,5 +1,4 @@ | |||
| 1 | --- | 1 | --- |
| 2 | |||
| 3 | import Layout from '@layouts/Layout.astro'; | 2 | import Layout from '@layouts/Layout.astro'; |
| 4 | import SectionList from '@components/things/SectionList.astro'; | 3 | import SectionList from '@components/things/SectionList.astro'; |
| 5 | 4 | ||
| @@ -7,210 +6,221 @@ import { fetchData } from '@utils/fetch-data'; | |||
| 7 | import type { Category } from '../types/Service'; | 6 | import type { Category } from '../types/Service'; |
| 8 | 7 | ||
| 9 | const categories: Category[] = (await fetchData())?.categories; | 8 | const categories: Category[] = (await fetchData())?.categories; |
| 10 | |||
| 11 | --- | 9 | --- |
| 12 | 10 | ||
| 13 | <Layout title="Browse"> | 11 | <Layout title="Browse"> |
| 14 | 12 | <div class="head-wrap"> | |
| 15 | <div class="head-wrap"> | 13 | <h2>Browse</h2> |
| 16 | <h2>Browse</h2> | 14 | <span> |
| 17 | <span> | 15 | <input |
| 18 | <input id="searchInput" type="search" placeholder="Start typing to filter..." /> | 16 | id="searchInput" |
| 19 | <p id="press-enter-msg" class="press-enter">Press enter for deep search</p> | 17 | type="search" |
| 20 | </span> | 18 | placeholder="Start typing to filter..." |
| 21 | </div> | 19 | /> |
| 22 | <p class="sitemap-link">Not sure what you're looking for? Take a look through <a href="/all">all listings</a></p> | 20 | <p id="press-enter-msg" class="press-enter"> |
| 23 | 21 | Press enter for deep search | |
| 24 | <ul class="categories"> | 22 | </p> |
| 25 | {categories.map((category) => ( | 23 | </span> |
| 26 | <li class="category"> | 24 | </div> |
| 27 | <SectionList title={category.name} sections={category.sections} /> | 25 | <p class="sitemap-link"> |
| 28 | </li> | 26 | Not sure what you're looking for? Take a look through <a href="/all" |
| 29 | ))} | 27 | >all listings</a |
| 30 | </ul> | 28 | > |
| 31 | 29 | </p> | |
| 32 | <div class="no-results"> | 30 | |
| 33 | <p class="zilch">Nothing found 😢</p> | 31 | <ul class="categories"> |
| 34 | <p>Try a <a href="/search">deep search</a> instead</p> | 32 | { |
| 35 | </div> | 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> | ||
| 36 | </Layout> | 45 | </Layout> |
| 37 | 46 | ||
| 38 | <script> | 47 | <script> |
| 39 | // Time for some good ol' fashioned vanilla JS... | 48 | // 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. | 49 | // I reccomend you not to look at this code for too long, it's not pretty. |
| 41 | const filterInput = document.querySelector('input'); | 50 | const filterInput = document.querySelector('input'); |
| 42 | const categories = document.querySelectorAll<HTMLElement>('.category'); | 51 | const categories = document.querySelectorAll<HTMLElement>('.category'); |
| 43 | const pressEnterMsg = document.getElementById('press-enter-msg') as HTMLElement | null; | 52 | const pressEnterMsg = document.getElementById( |
| 44 | const noResults = document.querySelector('.no-results') as HTMLElement | null; | 53 | 'press-enter-msg', |
| 45 | 54 | ) as HTMLElement | null; | |
| 46 | if (!pressEnterMsg || !noResults) { | 55 | const noResults = document.querySelector('.no-results') as HTMLElement | null; |
| 47 | throw new Error('No pressEnterMsg or noResults'); | 56 | |
| 48 | }; | 57 | if (!pressEnterMsg || !noResults) { |
| 49 | 58 | throw new Error('No pressEnterMsg or noResults'); | |
| 50 | filterInput?.addEventListener('input', (e) => { | 59 | } |
| 51 | let resultsCount = 0; | 60 | |
| 52 | const filter = (e.target as HTMLInputElement).value.toLowerCase(); | 61 | filterInput?.addEventListener('input', (e) => { |
| 53 | if (filter.length > 0) { | 62 | let resultsCount = 0; |
| 54 | pressEnterMsg.style.visibility = 'visible'; | 63 | const filter = (e.target as HTMLInputElement).value.toLowerCase(); |
| 55 | } else { | 64 | if (filter.length > 0) { |
| 56 | pressEnterMsg.style.visibility = 'hidden'; | 65 | pressEnterMsg.style.visibility = 'visible'; |
| 57 | } | 66 | } else { |
| 58 | categories.forEach((category) => { | 67 | pressEnterMsg.style.visibility = 'hidden'; |
| 59 | const titleElement = category.querySelector('.category-title'); | 68 | } |
| 60 | const title = titleElement ? titleElement.textContent?.toLowerCase() : ''; | 69 | categories.forEach((category) => { |
| 61 | const sections = category.querySelectorAll<HTMLElement>('.section'); | 70 | const titleElement = category.querySelector('.category-title'); |
| 62 | let count = 0; | 71 | const title = titleElement ? titleElement.textContent?.toLowerCase() : ''; |
| 63 | sections.forEach((section) => { | 72 | const sections = category.querySelectorAll<HTMLElement>('.section'); |
| 64 | const sectionTitle = section.textContent?.toLowerCase(); | 73 | let count = 0; |
| 65 | if (sectionTitle?.includes(filter)) { | 74 | sections.forEach((section) => { |
| 66 | section.style.display = 'block'; | 75 | const sectionTitle = section.textContent?.toLowerCase(); |
| 67 | count++; | 76 | if (sectionTitle?.includes(filter)) { |
| 68 | resultsCount++; | 77 | section.style.display = 'block'; |
| 69 | } else { | 78 | count++; |
| 70 | section.style.display = 'none'; | 79 | resultsCount++; |
| 71 | } | 80 | } else { |
| 72 | }); | 81 | section.style.display = 'none'; |
| 73 | if (title && title.includes(filter)) { | 82 | } |
| 74 | category.style.display = 'inline-flex'; | 83 | }); |
| 75 | resultsCount++; | 84 | if (title && title.includes(filter)) { |
| 76 | } else if (count === 0) { | 85 | category.style.display = 'inline-flex'; |
| 77 | category.style.display = 'none'; | 86 | resultsCount++; |
| 78 | } | 87 | } else if (count === 0) { |
| 79 | }); | 88 | category.style.display = 'none'; |
| 80 | noResults.style.display = resultsCount === 0 ? 'block' : 'none'; | 89 | } |
| 81 | }); | 90 | }); |
| 82 | 91 | noResults.style.display = resultsCount === 0 ? 'block' : 'none'; | |
| 83 | if (typeof window !== 'undefined') { | 92 | }); |
| 84 | document.addEventListener('DOMContentLoaded', function() { | 93 | |
| 85 | const searchInput = document.getElementById('searchInput') as HTMLInputElement | null; | 94 | if (typeof window !== 'undefined') { |
| 86 | if (searchInput === null) return; | 95 | document.addEventListener('DOMContentLoaded', function () { |
| 87 | searchInput.addEventListener('keydown', function(event) { | 96 | const searchInput = document.getElementById( |
| 88 | if (event.key === 'Enter') { | 97 | 'searchInput', |
| 89 | event.preventDefault(); | 98 | ) as HTMLInputElement | null; |
| 90 | window.location.href = `/search/${encodeURIComponent(searchInput.value.trim())}`; | 99 | if (searchInput === null) return; |
| 91 | } | 100 | searchInput.addEventListener('keydown', function (event) { |
| 92 | if (event.key === 'Escape') { | 101 | if (event.key === 'Enter') { |
| 93 | searchInput.value = ''; | 102 | event.preventDefault(); |
| 94 | searchInput.blur(); | 103 | window.location.href = `/search/${encodeURIComponent(searchInput.value.trim())}`; |
| 95 | pressEnterMsg.style.visibility = 'hidden'; | 104 | } |
| 96 | categories.forEach((category) => { | 105 | if (event.key === 'Escape') { |
| 97 | category.style.display = 'inline-flex'; | 106 | searchInput.value = ''; |
| 98 | const sections = category.querySelectorAll<HTMLElement>('.section'); | 107 | searchInput.blur(); |
| 99 | sections.forEach((section) => { | 108 | pressEnterMsg.style.visibility = 'hidden'; |
| 100 | section.style.display = 'block'; | 109 | categories.forEach((category) => { |
| 101 | }); | 110 | category.style.display = 'inline-flex'; |
| 102 | }); | 111 | const sections = category.querySelectorAll<HTMLElement>('.section'); |
| 103 | } | 112 | sections.forEach((section) => { |
| 104 | }); | 113 | section.style.display = 'block'; |
| 105 | }); | 114 | }); |
| 106 | } | 115 | }); |
| 116 | } | ||
| 117 | }); | ||
| 118 | }); | ||
| 119 | } | ||
| 107 | </script> | 120 | </script> |
| 108 | 121 | ||
| 109 | |||
| 110 | <style lang="scss"> | 122 | <style lang="scss"> |
| 111 | 123 | .head-wrap { | |
| 112 | .head-wrap { | 124 | margin: 1rem auto 0 auto; |
| 113 | margin: 1rem auto 0 auto; | 125 | width: 85vw; |
| 114 | width: 85vw; | 126 | display: flex; |
| 115 | display: flex; | 127 | align-items: center; |
| 116 | align-items: center; | 128 | justify-content: space-between; |
| 117 | justify-content: space-between; | 129 | flex-wrap: wrap; |
| 118 | flex-wrap: wrap; | 130 | .press-enter { |
| 119 | .press-enter { | 131 | margin: 0.5rem 0 0 0; |
| 120 | margin: 0.5rem 0 0 0; | 132 | opacity: 0.5; |
| 121 | opacity: 0.5; | 133 | visibility: hidden; |
| 122 | visibility: hidden; | 134 | } |
| 123 | } | 135 | input { |
| 124 | input { | 136 | padding: 0.5rem; |
| 125 | padding: 0.5rem; | 137 | border: 2px solid var(--box-outline); |
| 126 | border: 2px solid var(--box-outline); | 138 | border-radius: var(--curve-sm); |
| 127 | border-radius: var(--curve-sm); | 139 | font-size: 1.2rem; |
| 128 | font-size: 1.2rem; | 140 | box-shadow: 3px 3px 0 var(--box-outline); |
| 129 | box-shadow: 3px 3px 0 var(--box-outline); | 141 | color: var(--accent-3); |
| 130 | color: var(--accent-3); | 142 | background: var(--background-form); |
| 131 | background: var(--background-form); | 143 | &:focus { |
| 132 | &:focus { | 144 | outline: none; |
| 133 | outline: none; | 145 | box-shadow: 4px 4px 0 var(--box-outline); |
| 134 | box-shadow: 4px 4px 0 var(--box-outline); | 146 | } |
| 135 | } | 147 | } |
| 136 | } | 148 | h2 { |
| 137 | h2 { | 149 | font-family: 'Lekton', sans-serif; |
| 138 | font-family: "Lekton", sans-serif; | 150 | font-weight: bold; |
| 139 | font-weight: bold; | 151 | font-size: 3rem; |
| 140 | font-size: 3rem; | 152 | margin: 0; |
| 141 | margin: 0; | 153 | color: var(--accent-3); |
| 142 | color: var(--accent-3); | 154 | } |
| 143 | } | 155 | } |
| 144 | } | 156 | |
| 145 | 157 | .sitemap-link { | |
| 146 | .sitemap-link { | 158 | margin: 0 auto; |
| 147 | margin: 0 auto; | 159 | width: 85vw; |
| 148 | width: 85vw; | 160 | a { |
| 149 | a { | 161 | color: var(--accent-3); |
| 150 | color: var(--accent-3); | 162 | } |
| 151 | } | 163 | } |
| 152 | } | 164 | |
| 153 | 165 | .no-results { | |
| 154 | .no-results { | 166 | text-align: center; |
| 155 | text-align: center; | 167 | width: 85vw; |
| 156 | width: 85vw; | 168 | margin: 2rem auto 4rem auto; |
| 157 | margin: 2rem auto 4rem auto; | 169 | display: none; |
| 158 | display: none; | 170 | .zilch { |
| 159 | .zilch { | 171 | font-size: 2rem; |
| 160 | font-size: 2rem; | 172 | color: var(--accent-3); |
| 161 | color: var(--accent-3); | 173 | opacity: 0.5; |
| 162 | opacity: 0.5; | 174 | font-weight: bold; |
| 163 | font-weight: bold; | 175 | } |
| 164 | } | 176 | p { |
| 165 | p { | 177 | margin: 0.25rem; |
| 166 | margin: 0.25rem; | 178 | } |
| 167 | } | 179 | } |
| 168 | } | 180 | |
| 169 | 181 | .categories { | |
| 170 | .categories { | 182 | columns: 6 300px; |
| 171 | columns: 6 300px; | 183 | column-gap: 1rem; |
| 172 | column-gap: 1rem; | 184 | margin: 0 auto; |
| 173 | margin: 0 auto; | 185 | width: 85vw; |
| 174 | width: 85vw; | 186 | max-width: 1800px; |
| 175 | max-width: 1800px; | 187 | padding: 1rem 0 2rem 0; |
| 176 | padding: 1rem 0 2rem 0; | 188 | @media (max-width: 768px) { |
| 177 | @media(max-width: 768px) { | 189 | padding: 0; |
| 178 | padding: 0; | 190 | width: 95%; |
| 179 | width: 95%; | 191 | } |
| 180 | } | 192 | .category { |
| 181 | .category { | 193 | background: var(--accent-fg); |
| 182 | background: var(--accent-fg); | 194 | border: 2px solid var(--box-outline); |
| 183 | border: 2px solid var(--box-outline); | 195 | border-radius: var(--curve-sm); |
| 184 | border-radius: var(--curve-sm); | 196 | box-shadow: 4px 4px 0 var(--box-outline); |
| 185 | box-shadow: 4px 4px 0 var(--box-outline); | 197 | padding: 1rem; |
| 186 | padding: 1rem; | 198 | width: 85%; |
| 187 | width: 85%; | 199 | display: inline-flex; |
| 188 | display: inline-flex; | 200 | flex-direction: column; |
| 189 | flex-direction: column; | 201 | margin: 1rem; |
| 190 | margin: 1rem; | 202 | .category-title { |
| 191 | .category-title { | 203 | text-decoration: none; |
| 192 | text-decoration: none; | 204 | color: var(--foreground); |
| 193 | color: var(--foreground); | 205 | } |
| 194 | } | 206 | h3 { |
| 195 | h3 { | 207 | font-family: 'Lekton', sans-serif; |
| 196 | font-family: "Lekton", sans-serif; | 208 | font-weight: bold; |
| 197 | font-weight: bold; | 209 | margin: 0; |
| 198 | margin: 0; | 210 | font-size: 1.8rem; |
| 199 | font-size: 1.8rem; | 211 | } |
| 200 | } | 212 | .sections { |
| 201 | .sections { | 213 | padding-left: 1rem; |
| 202 | padding-left: 1rem; | 214 | .section { |
| 203 | .section { | 215 | a { |
| 204 | a { | 216 | text-decoration: none; |
| 205 | text-decoration: none; | 217 | color: var(--foreground); |
| 206 | color: var(--foreground); | 218 | } |
| 207 | } | 219 | .service-count { |
| 208 | .service-count { | 220 | color: var(--accent-3); |
| 209 | color: var(--accent-3); | 221 | } |
| 210 | } | 222 | } |
| 211 | } | 223 | } |
| 212 | } | 224 | } |
| 213 | } | 225 | } |
| 214 | } | ||
| 215 | |||
| 216 | </style> | 226 | </style> |
web/src/pages/index.astro +49 −43
| @@ -1,5 +1,4 @@ | |||
| 1 | --- | 1 | --- |
| 2 | |||
| 3 | import Layout from '@layouts/Layout.astro'; | 2 | import Layout from '@layouts/Layout.astro'; |
| 4 | import Hero from '@components/Hero.astro'; | 3 | import Hero from '@components/Hero.astro'; |
| 5 | import Search from '@components/things/Search.svelte'; | 4 | import Search from '@components/things/Search.svelte'; |
| @@ -10,14 +9,14 @@ import { fetchData } from '@utils/fetch-data'; | |||
| 10 | import Button from '@components/form/Button.astro'; | 9 | import Button from '@components/form/Button.astro'; |
| 11 | import type { Category } from 'src/types/Service'; | 10 | import type { Category } from 'src/types/Service'; |
| 12 | 11 | ||
| 13 | const categories = (await fetchData())?.categories || [] as Category[]; | 12 | const categories = (await fetchData())?.categories || ([] as Category[]); |
| 14 | |||
| 15 | const description = 'Privacy is a fundamental human right; ' | ||
| 16 | + 'without it, we\'re just open books in a world where everyone\'s ' | ||
| 17 | + 'watching. Let\'s take control back.\n' | ||
| 18 | + 'Migrating open-source applications which do not collect, sell or log your data is a great first step.' | ||
| 19 | + 'Awesome Privacy is a directory of alternative privacy-respecting software and services.'; | ||
| 20 | 13 | ||
| 14 | const 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.'; | ||
| 21 | --- | 20 | --- |
| 22 | 21 | ||
| 23 | <Layout title="Home | Awesome Privacy" hideNav={true} description={description}> | 22 | <Layout title="Home | Awesome Privacy" hideNav={true} description={description}> |
| @@ -29,11 +28,13 @@ const description = 'Privacy is a fundamental human right; ' | |||
| 29 | <Search client:visible data={categories} /> | 28 | <Search client:visible data={categories} /> |
| 30 | <h2 class="browse-title"><a href="/browse">Browse</a></h2> | 29 | <h2 class="browse-title"><a href="/browse">Browse</a></h2> |
| 31 | <ul class="categories"> | 30 | <ul class="categories"> |
| 32 | {categories.map((category) => ( | 31 | { |
| 33 | <li class="category"> | 32 | categories.map((category) => ( |
| 34 | <SectionList title={category.name} sections={category.sections} /> | 33 | <li class="category"> |
| 35 | </li> | 34 | <SectionList title={category.name} sections={category.sections} /> |
| 36 | ))} | 35 | </li> |
| 36 | )) | ||
| 37 | } | ||
| 37 | </ul> | 38 | </ul> |
| 38 | <div class="view-all"> | 39 | <div class="view-all"> |
| 39 | <span>Or, just</span> | 40 | <span>Or, just</span> |
| @@ -48,28 +49,33 @@ const description = 'Privacy is a fundamental human right; ' | |||
| 48 | </h2> | 49 | </h2> |
| 49 | <div class="about-summary"> | 50 | <div class="about-summary"> |
| 50 | <p> | 51 | <p> |
| 51 | Awesome Privacy is a collection of privacy-respecting services and tools. | 52 | Awesome Privacy is a collection of privacy-respecting services and |
| 52 | The aim is to help you escape big tech, and choose software that respects your privacy. | 53 | tools. The aim is to help you escape big tech, and choose software that |
| 54 | respects your privacy. | ||
| 53 | </p> | 55 | </p> |
| 54 | <p> | 56 | <p> |
| 55 | Why? Because privacy is a fundamental human right; without it, we're just open books | 57 | Why? Because privacy is a fundamental human right; without it, we're |
| 56 | in a world where everyone's watching. Let's take control back. | 58 | just open books in a world where everyone's watching. Let's take control |
| 59 | back. | ||
| 57 | </p> | 60 | </p> |
| 58 | <p> | 61 | <p> |
| 59 | Noticed something that should be added / removed / amended? | 62 | Noticed something that should be added / removed / amended? We're a |
| 60 | We're a community-driven resource, so welcome contributions of any nature. | 63 | community-driven resource, so welcome contributions of any nature. All |
| 61 | All content and code is <a href="https://github.com/lissy93/awesome-privacy">open source</a>. | 64 | content and code is <a href="https://github.com/lissy93/awesome-privacy" |
| 65 | >open source</a | ||
| 66 | >. | ||
| 62 | </p> | 67 | </p> |
| 63 | <p> | 68 | <p> |
| 64 | If you've found Awesome Privacy useful, help us out by sharing it with others, | 69 | If you've found Awesome Privacy useful, help us out by sharing it with |
| 65 | contributing, or consider <a href="https://github.com/sponsors/lissy93">sponsoring me</a> on GitHub. | 70 | others, contributing, or consider <a |
| 71 | href="https://github.com/sponsors/lissy93">sponsoring me</a | ||
| 72 | > on GitHub. | ||
| 66 | </p> | 73 | </p> |
| 67 | </div> | 74 | </div> |
| 68 | <div class="view-all"> | 75 | <div class="view-all"> |
| 69 | <span>Want to learn more?</span> | 76 | <span>Want to learn more?</span> |
| 70 | <Button url="/about" text="Keep Reading..." /> | 77 | <Button url="/about" text="Keep Reading..." /> |
| 71 | </div> | 78 | </div> |
| 72 | |||
| 73 | </main> | 79 | </main> |
| 74 | </Layout> | 80 | </Layout> |
| 75 | 81 | ||
| @@ -81,8 +87,8 @@ const description = 'Privacy is a fundamental human right; ' | |||
| 81 | max-width: calc(100% - 5rem); | 87 | max-width: calc(100% - 5rem); |
| 82 | font-size: 20px; | 88 | font-size: 20px; |
| 83 | line-height: 1.6; | 89 | line-height: 1.6; |
| 84 | @media(max-width: 768px) { | 90 | @media (max-width: 768px) { |
| 85 | padding: 0; | 91 | padding: 0; |
| 86 | } | 92 | } |
| 87 | .view-all { | 93 | .view-all { |
| 88 | text-align: center; | 94 | text-align: center; |
| @@ -97,41 +103,43 @@ const description = 'Privacy is a fundamental human right; ' | |||
| 97 | h2 { | 103 | h2 { |
| 98 | font-size: 3rem; | 104 | font-size: 3rem; |
| 99 | color: var(--accent-3); | 105 | color: var(--accent-3); |
| 100 | font-family: "Lekton", sans-serif; | 106 | font-family: 'Lekton', sans-serif; |
| 101 | text-align: center; | 107 | text-align: center; |
| 102 | margin: 3rem 0 1rem 0; | 108 | margin: 3rem 0 1rem 0; |
| 103 | a { | 109 | a { |
| 104 | text-decoration: none; | 110 | text-decoration: none; |
| 105 | color: var(--accent-3); | 111 | color: var(--accent-3); |
| 106 | font-family: "Lekton", sans-serif; | 112 | font-family: 'Lekton', sans-serif; |
| 107 | position: relative; | 113 | position: relative; |
| 108 | &:after { | 114 | &:after { |
| 109 | background: none repeat scroll 0 0 transparent; | 115 | background: none repeat scroll 0 0 transparent; |
| 110 | bottom: 0; | 116 | bottom: 0; |
| 111 | content: ""; | 117 | content: ''; |
| 112 | display: block; | 118 | display: block; |
| 113 | height: 3px; | 119 | height: 3px; |
| 114 | left: 50%; | 120 | left: 50%; |
| 115 | position: absolute; | 121 | position: absolute; |
| 116 | background: var(--accent); | 122 | 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; | ||
| 118 | width: 0; | 126 | width: 0; |
| 119 | } | 127 | } |
| 120 | &:hover:after { | 128 | &:hover:after { |
| 121 | width: 100%; | 129 | width: 100%; |
| 122 | left: 0; | 130 | left: 0; |
| 123 | } | 131 | } |
| 124 | } | 132 | } |
| 125 | } | 133 | } |
| 126 | 134 | ||
| 127 | .about-summary { | 135 | .about-summary { |
| 128 | background: var(--accent-fg); | 136 | background: var(--accent-fg); |
| 129 | border: 2px solid var(--box-outline); | 137 | border: 2px solid var(--box-outline); |
| 130 | border-radius: var(--curve-sm); | 138 | border-radius: var(--curve-sm); |
| 131 | box-shadow: 4px 4px 0 var(--box-outline); | 139 | box-shadow: 4px 4px 0 var(--box-outline); |
| 132 | padding: 1rem; | 140 | padding: 1rem; |
| 133 | width: 85%; | 141 | width: 85%; |
| 134 | margin: 0 auto; | 142 | margin: 0 auto; |
| 135 | } | 143 | } |
| 136 | 144 | ||
| 137 | .categories { | 145 | .categories { |
| @@ -148,7 +156,7 @@ const description = 'Privacy is a fundamental human right; ' | |||
| 148 | display: inline-flex; | 156 | display: inline-flex; |
| 149 | flex-direction: column; | 157 | flex-direction: column; |
| 150 | margin: 1rem; | 158 | margin: 1rem; |
| 151 | @media(max-width: 768px) { | 159 | @media (max-width: 768px) { |
| 152 | margin: 1rem 0; | 160 | margin: 1rem 0; |
| 153 | width: 90%; | 161 | width: 90%; |
| 154 | } | 162 | } |
| @@ -157,7 +165,7 @@ const description = 'Privacy is a fundamental human right; ' | |||
| 157 | color: var(--foreground); | 165 | color: var(--foreground); |
| 158 | } | 166 | } |
| 159 | h3 { | 167 | h3 { |
| 160 | font-family: "Lekton", sans-serif; | 168 | font-family: 'Lekton', sans-serif; |
| 161 | font-weight: bold; | 169 | font-weight: bold; |
| 162 | margin: 0; | 170 | margin: 0; |
| 163 | font-size: 1.8rem; | 171 | font-size: 1.8rem; |
| @@ -176,6 +184,4 @@ const description = 'Privacy is a fundamental human right; ' | |||
| 176 | } | 184 | } |
| 177 | } | 185 | } |
| 178 | } | 186 | } |
| 179 | |||
| 180 | |||
| 181 | </style> | 187 | </style> |
web/src/pages/inventory/[...inventoryId].astro +78 −72
| @@ -1,5 +1,4 @@ | |||
| 1 | --- | 1 | --- |
| 2 | |||
| 3 | import Layout from '@layouts/Layout.astro'; | 2 | import Layout from '@layouts/Layout.astro'; |
| 4 | import SavedServices from '@components/things/SavedServices.svelte'; | 3 | import SavedServices from '@components/things/SavedServices.svelte'; |
| 5 | import GetSharableLink from '@components/things/GetSharableLink.svelte'; | 4 | import GetSharableLink from '@components/things/GetSharableLink.svelte'; |
| @@ -9,7 +8,7 @@ import Button from '@components/form/Button.astro'; | |||
| 9 | import EditableTitle from '@components/form/EditableTitle.svelte'; | 8 | import EditableTitle from '@components/form/EditableTitle.svelte'; |
| 10 | import type { Category } from '../../types/Service'; | 9 | import type { Category } from '../../types/Service'; |
| 11 | 10 | ||
| 12 | const categories = (await fetchData())?.categories || [] as Category[]; | 11 | const categories = (await fetchData())?.categories || ([] as Category[]); |
| 13 | 12 | ||
| 14 | export const prerender = false; | 13 | export const prerender = false; |
| 15 | 14 | ||
| @@ -17,85 +16,92 @@ const inventoryId = Astro.params.inventoryId || 'Inventory'; | |||
| 17 | let cheekyLilError = ''; | 16 | let cheekyLilError = ''; |
| 18 | 17 | ||
| 19 | function makeTitle(input: string): string { | 18 | function makeTitle(input: string): string { |
| 20 | return (input.includes('_') ? input : `mystry_${input}`) | 19 | return (input.includes('_') ? input : `mystry_${input}`) |
| 21 | .split('_')[1] | 20 | .split('_')[1] |
| 22 | .replace(/-/g, ' ') | 21 | .replace(/-/g, ' ') |
| 23 | .replace(/\b\w/g, (match) => match.toUpperCase()); | 22 | .replace(/\b\w/g, (match) => match.toUpperCase()); |
| 24 | } | 23 | } |
| 25 | 24 | ||
| 26 | const serviceList = await fetch(`https://awesome-privacy-share-api.as93.net/${inventoryId}`).then((res) => res.json()) || []; | 25 | const serviceList = |
| 26 | (await fetch( | ||
| 27 | `https://awesome-privacy-share-api.as93.net/${inventoryId}`, | ||
| 28 | ).then((res) => res.json())) || []; | ||
| 27 | 29 | ||
| 28 | if (serviceList.error) { | 30 | if (serviceList.error) { |
| 29 | cheekyLilError = serviceList.error; | 31 | cheekyLilError = serviceList.error; |
| 30 | } | 32 | } |
| 31 | |||
| 32 | --- | 33 | --- |
| 33 | 34 | ||
| 34 | <Layout title="Saved Services"> | 35 | <Layout title="Saved Services"> |
| 35 | <main> | 36 | <main> |
| 36 | <h2>{makeTitle(inventoryId)}</h2> | 37 | <h2>{makeTitle(inventoryId)}</h2> |
| 37 | {cheekyLilError && ( | 38 | { |
| 38 | <div class="error"> | 39 | cheekyLilError && ( |
| 39 | <p class="oh-deary-me">An error occoured</p> | 40 | <div class="error"> |
| 40 | <p class="what-the-fuck-happened">{cheekyLilError}</p> | 41 | <p class="oh-deary-me">An error occoured</p> |
| 41 | <p class="what-next"> | 42 | <p class="what-the-fuck-happened">{cheekyLilError}</p> |
| 42 | We're sorry about that.<br /> | 43 | <p class="what-next"> |
| 43 | Try going <a href="/">back home</a>, | 44 | We're sorry about that. |
| 44 | or <a href="https://github.com/Lissy93/awesome-privacy/issues/new/choose">raising a ticket</a> on | 45 | <br /> |
| 45 | GitHub. | 46 | Try going <a href="/">back home</a>, or{' '} |
| 46 | </p> | 47 | <a href="https://github.com/Lissy93/awesome-privacy/issues/new/choose"> |
| 47 | </div> | 48 | raising a ticket |
| 48 | )} | 49 | </a>{' '} |
| 49 | <SavedServices allData={categories} serviceList={serviceList} client:load /> | 50 | on GitHub. |
| 50 | <div class="buttons"> | 51 | </p> |
| 51 | <p>Not found what you're looking for?</p> | 52 | </div> |
| 52 | <Button url="/all">Browse Services</Button> | 53 | ) |
| 53 | </div> | 54 | } |
| 54 | </main> | 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> | ||
| 55 | </Layout> | 61 | </Layout> |
| 56 | 62 | ||
| 57 | <style lang="scss"> | 63 | <style lang="scss"> |
| 58 | main { | 64 | main { |
| 59 | margin: 0 auto 2rem auto; | 65 | margin: 0 auto 2rem auto; |
| 60 | padding: 1rem; | 66 | padding: 1rem; |
| 61 | width: 1200px; | 67 | width: 1200px; |
| 62 | max-width: calc(100% - 5rem); | 68 | max-width: calc(100% - 5rem); |
| 63 | display: flex; | 69 | display: flex; |
| 64 | justify-content: space-between; | 70 | justify-content: space-between; |
| 65 | flex-direction: column; | 71 | flex-direction: column; |
| 66 | min-height: calc(100vh - 12rem); | 72 | min-height: calc(100vh - 12rem); |
| 67 | font-size: 1.25rem; | 73 | font-size: 1.25rem; |
| 68 | h2 { | 74 | h2 { |
| 69 | font-family: "Lekton", sans-serif; | 75 | font-family: 'Lekton', sans-serif; |
| 70 | font-weight: bold; | 76 | font-weight: bold; |
| 71 | font-size: 3rem; | 77 | font-size: 3rem; |
| 72 | margin: 0; | 78 | margin: 0; |
| 73 | color: var(--accent-3); | 79 | color: var(--accent-3); |
| 74 | } | 80 | } |
| 75 | .buttons { | 81 | .buttons { |
| 76 | margin: 1rem auto; | 82 | margin: 1rem auto; |
| 77 | display: flex; | 83 | display: flex; |
| 78 | flex-direction: column; | 84 | flex-direction: column; |
| 79 | } | 85 | } |
| 80 | .error { | 86 | .error { |
| 81 | text-align: center; | 87 | text-align: center; |
| 82 | font-size: 1.4rem; | 88 | font-size: 1.4rem; |
| 83 | .oh-deary-me { | 89 | .oh-deary-me { |
| 84 | font-size: 1.8rem; | 90 | font-size: 1.8rem; |
| 85 | margin: 0.2rem auto; | 91 | margin: 0.2rem auto; |
| 86 | } | 92 | } |
| 87 | .what-the-fuck-happened { | 93 | .what-the-fuck-happened { |
| 88 | color: var(--danger); | 94 | color: var(--danger); |
| 89 | margin: 0.2rem auto; | 95 | margin: 0.2rem auto; |
| 90 | } | 96 | } |
| 91 | .what-next { | 97 | .what-next { |
| 92 | font-size: 1rem; | 98 | font-size: 1rem; |
| 93 | margin-top: 3rem; | 99 | margin-top: 3rem; |
| 94 | opacity: 0.6; | 100 | opacity: 0.6; |
| 95 | a { | 101 | a { |
| 96 | color: var(--foreground); | 102 | color: var(--foreground); |
| 97 | } | 103 | } |
| 98 | } | 104 | } |
| 99 | } | 105 | } |
| 100 | } | 106 | } |
| 101 | </style> | 107 | </style> |
web/src/pages/inventory/index.astro +42 −44
| @@ -1,5 +1,4 @@ | |||
| 1 | --- | 1 | --- |
| 2 | |||
| 3 | import Layout from '@layouts/Layout.astro'; | 2 | import Layout from '@layouts/Layout.astro'; |
| 4 | import SavedServices from '@components/things/SavedServices.svelte'; | 3 | import SavedServices from '@components/things/SavedServices.svelte'; |
| 5 | import GetSharableLink from '@components/things/GetSharableLink.svelte'; | 4 | import GetSharableLink from '@components/things/GetSharableLink.svelte'; |
| @@ -9,53 +8,52 @@ import Button from '@components/form/Button.astro'; | |||
| 9 | import EditableTitle from '@components/form/EditableTitle.svelte'; | 8 | import EditableTitle from '@components/form/EditableTitle.svelte'; |
| 10 | import type { Category } from '../../types/Service'; | 9 | import type { Category } from '../../types/Service'; |
| 11 | 10 | ||
| 12 | const categories = (await fetchData())?.categories || [] as Category[]; | 11 | const categories = (await fetchData())?.categories || ([] as Category[]); |
| 13 | |||
| 14 | --- | 12 | --- |
| 15 | 13 | ||
| 16 | <Layout title="Saved Services"> | 14 | <Layout title="Saved Services"> |
| 17 | <main> | 15 | <main> |
| 18 | <div class="top-row"> | 16 | <div class="top-row"> |
| 19 | <!-- <h2>Inventory</h2> --> | 17 | <!-- <h2>Inventory</h2> --> |
| 20 | <EditableTitle client:load /> | 18 | <EditableTitle client:load /> |
| 21 | <GetSharableLink client:load /> | 19 | <GetSharableLink client:load /> |
| 22 | </div> | 20 | </div> |
| 23 | <SavedServices allData={categories} client:load /> | 21 | <SavedServices allData={categories} client:load /> |
| 24 | <div class="buttons"> | 22 | <div class="buttons"> |
| 25 | <p>Not found what you're looking for?</p> | 23 | <p>Not found what you're looking for?</p> |
| 26 | <Button url="/all">Browse Services</Button> | 24 | <Button url="/all">Browse Services</Button> |
| 27 | </div> | 25 | </div> |
| 28 | </main> | 26 | </main> |
| 29 | </Layout> | 27 | </Layout> |
| 30 | 28 | ||
| 31 | <style lang="scss"> | 29 | <style lang="scss"> |
| 32 | main { | 30 | main { |
| 33 | margin: 0 auto 2rem auto; | 31 | margin: 0 auto 2rem auto; |
| 34 | padding: 1rem; | 32 | padding: 1rem; |
| 35 | width: 1200px; | 33 | width: 1200px; |
| 36 | max-width: calc(100% - 5rem); | 34 | max-width: calc(100% - 5rem); |
| 37 | display: flex; | 35 | display: flex; |
| 38 | justify-content: space-between; | 36 | justify-content: space-between; |
| 39 | flex-direction: column; | 37 | flex-direction: column; |
| 40 | min-height: calc(100vh - 12rem); | 38 | min-height: calc(100vh - 12rem); |
| 41 | font-size: 1.25rem; | 39 | font-size: 1.25rem; |
| 42 | .top-row { | 40 | .top-row { |
| 43 | display: flex; | 41 | display: flex; |
| 44 | justify-content: space-between; | 42 | justify-content: space-between; |
| 45 | align-items: center; | 43 | align-items: center; |
| 46 | margin-bottom: 1rem; | 44 | margin-bottom: 1rem; |
| 47 | } | 45 | } |
| 48 | h2 { | 46 | h2 { |
| 49 | font-family: "Lekton", sans-serif; | 47 | font-family: 'Lekton', sans-serif; |
| 50 | font-weight: bold; | 48 | font-weight: bold; |
| 51 | font-size: 3rem; | 49 | font-size: 3rem; |
| 52 | margin: 0; | 50 | margin: 0; |
| 53 | color: var(--accent-3); | 51 | color: var(--accent-3); |
| 54 | } | 52 | } |
| 55 | .buttons { | 53 | .buttons { |
| 56 | margin: 1rem auto; | 54 | margin: 1rem auto; |
| 57 | display: flex; | 55 | display: flex; |
| 58 | flex-direction: column; | 56 | flex-direction: column; |
| 59 | } | 57 | } |
| 60 | } | 58 | } |
| 61 | </style> | 59 | </style> |
web/src/pages/search/[...searchTerm].astro +158 −151
| @@ -1,5 +1,5 @@ | |||
| 1 | --- | 1 | --- |
| 2 | import Fuse from 'fuse.js'; | 2 | import Fuse from 'fuse.js'; |
| 3 | 3 | ||
| 4 | import Layout from '@layouts/Layout.astro'; | 4 | import Layout from '@layouts/Layout.astro'; |
| 5 | import { fetchData, slugify } from '@utils/fetch-data'; | 5 | import { fetchData, slugify } from '@utils/fetch-data'; |
| @@ -22,171 +22,178 @@ fuse = new Fuse(items, searchOptions); | |||
| 22 | 22 | ||
| 23 | const searchTerm = Astro.params.searchTerm; | 23 | const searchTerm = Astro.params.searchTerm; |
| 24 | 24 | ||
| 25 | const searchResults = fuse.search(searchTerm || '').map(result => result.item); | 25 | const searchResults = fuse |
| 26 | .search(searchTerm || '') | ||
| 27 | .map((result) => result.item); | ||
| 26 | 28 | ||
| 27 | const services = searchResults.filter(result => result.type === 'Service'); | 29 | const services = searchResults.filter((result) => result.type === 'Service'); |
| 28 | 30 | ||
| 29 | const putResultsIntoGroups = () => { | 31 | const putResultsIntoGroups = () => { |
| 30 | const grouped = services.reduce((acc, item) => { | 32 | const grouped = services.reduce((acc, item) => { |
| 31 | const { category: categoryName, sectionName, ...service } = item; | 33 | const { category: categoryName, sectionName, ...service } = item; |
| 32 | 34 | ||
| 33 | if (!acc[categoryName]) { | 35 | if (!acc[categoryName]) { |
| 34 | acc[categoryName] = { categoryName, sections: {} }; | 36 | acc[categoryName] = { categoryName, sections: {} }; |
| 35 | } | 37 | } |
| 36 | 38 | ||
| 37 | if (!acc[categoryName].sections[sectionName]) { | 39 | if (!acc[categoryName].sections[sectionName]) { |
| 38 | acc[categoryName].sections[sectionName] = { sectionName, items: [] }; | 40 | acc[categoryName].sections[sectionName] = { sectionName, items: [] }; |
| 39 | } | 41 | } |
| 40 | 42 | ||
| 41 | acc[categoryName].sections[sectionName].items.push(service); | 43 | acc[categoryName].sections[sectionName].items.push(service); |
| 42 | 44 | ||
| 43 | return acc; | 45 | return acc; |
| 44 | }, {}); | 46 | }, {}); |
| 45 | 47 | ||
| 46 | // Convert the grouped object into the desired array structure. | 48 | // Convert the grouped object into the desired array structure. |
| 47 | // And fuck it, let's use `any` | 49 | // And fuck it, let's use `any` |
| 48 | return Object.values(grouped).map((category: any) => ({ | 50 | return Object.values(grouped).map((category: any) => ({ |
| 49 | categoryName: category.categoryName, | 51 | categoryName: category.categoryName, |
| 50 | sections: Object.values(category.sections) | 52 | sections: Object.values(category.sections), |
| 51 | })); | 53 | })); |
| 52 | }; | 54 | }; |
| 53 | 55 | ||
| 54 | const beer = putResultsIntoGroups(); | 56 | const beer = putResultsIntoGroups(); |
| 55 | |||
| 56 | --- | 57 | --- |
| 57 | 58 | ||
| 58 | <Layout title="Search | Awesome Privacy"> | 59 | <Layout title="Search | Awesome Privacy"> |
| 59 | <section> | 60 | <section> |
| 60 | <h1>Search</h1> | 61 | <h1>Search</h1> |
| 61 | <Search client:visible data={categories} previousSearch={searchTerm} /> | 62 | <Search client:visible data={categories} previousSearch={searchTerm} /> |
| 62 | </section> | 63 | </section> |
| 63 | <SmartSuggestions client:visible searchTerm={searchTerm || ''} categories={categories} /> | 64 | <SmartSuggestions |
| 64 | <section class="result-count"> | 65 | client:visible |
| 65 | <h3>Deep Search</h3> | 66 | searchTerm={searchTerm || ''} |
| 66 | <p>Showing {services.length} results for "{searchTerm}" sorted by relevence</p> | 67 | categories={categories} |
| 67 | </section> | 68 | /> |
| 68 | <div class="results"> | 69 | <section class="result-count"> |
| 69 | { | 70 | <h3>Deep Search</h3> |
| 70 | beer.map((category: any) => ( | 71 | <p> |
| 71 | <div class="category"> | 72 | Showing {services.length} results for "{searchTerm}" sorted by relevence |
| 72 | <a class="category-title" href={`/${slugify(category.categoryName)}`}> | 73 | </p> |
| 73 | <h3>{category.categoryName}</h3> | 74 | </section> |
| 74 | </a> | 75 | <div class="results"> |
| 75 | <span class="section-icon"><FontAwesome iconName={slugify(category.categoryName)} /></span> | 76 | { |
| 76 | <ul class="section-list"> | 77 | beer.map((category: any) => ( |
| 77 | {category.sections.map((section: any) => ( | 78 | <div class="category"> |
| 78 | <li class="section-item"> | 79 | <a class="category-title" href={`/${slugify(category.categoryName)}`}> |
| 79 | <h4>{section.sectionName}</h4> | 80 | <h3>{category.categoryName}</h3> |
| 80 | <ul class="service-list"> | 81 | </a> |
| 81 | {section.items.map((item: Service) => ( | 82 | <span class="section-icon"> |
| 82 | <li> | 83 | <FontAwesome iconName={slugify(category.categoryName)} /> |
| 83 | <a href={item.url}>{item.name}</a> | 84 | </span> |
| 84 | </li> | 85 | <ul class="section-list"> |
| 85 | ))} | 86 | {category.sections.map((section: any) => ( |
| 86 | </ul> | 87 | <li class="section-item"> |
| 87 | </li> | 88 | <h4>{section.sectionName}</h4> |
| 88 | ))} | 89 | <ul class="service-list"> |
| 89 | </ul> | 90 | {section.items.map((item: Service) => ( |
| 90 | </div> | 91 | <li> |
| 91 | )) | 92 | <a href={item.url}>{item.name}</a> |
| 92 | } | 93 | </li> |
| 93 | </div> | 94 | ))} |
| 95 | </ul> | ||
| 96 | </li> | ||
| 97 | ))} | ||
| 98 | </ul> | ||
| 99 | </div> | ||
| 100 | )) | ||
| 101 | } | ||
| 102 | </div> | ||
| 94 | </Layout> | 103 | </Layout> |
| 95 | 104 | ||
| 96 | |||
| 97 | <style lang="scss"> | 105 | <style lang="scss"> |
| 98 | 106 | section { | |
| 99 | section { | 107 | display: flex; |
| 100 | display: flex; | 108 | flex-direction: column; |
| 101 | flex-direction: column; | 109 | padding: 1rem; |
| 102 | padding: 1rem; | 110 | margin: 2rem auto; |
| 103 | margin: 2rem auto; | 111 | padding: 1rem; |
| 104 | padding: 1rem; | 112 | width: calc(100% - 2rem); |
| 105 | width: calc(100% - 2rem); | 113 | max-width: 1100px; |
| 106 | max-width: 1100px; | 114 | |
| 107 | 115 | h1 { | |
| 108 | h1 { | 116 | font-size: 3rem; |
| 109 | font-size: 3rem; | 117 | color: var(--accent-3); |
| 110 | color: var(--accent-3); | 118 | font-family: 'Lekton', sans-serif; |
| 111 | font-family: "Lekton", sans-serif; | 119 | text-align: center; |
| 112 | text-align: center; | 120 | margin: 1rem 0; |
| 113 | margin: 1rem 0; | 121 | } |
| 114 | } | 122 | } |
| 115 | } | 123 | |
| 116 | 124 | .result-count { | |
| 117 | .result-count { | 125 | padding: 0; |
| 118 | padding: 0; | 126 | width: 80vw; |
| 119 | width: 80vw; | 127 | max-width: 900px; |
| 120 | max-width: 900px; | 128 | margin: 1rem auto 0 auto; |
| 121 | margin: 1rem auto 0 auto; | 129 | h3 { |
| 122 | h3 { | 130 | margin: 0; |
| 123 | margin: 0; | 131 | color: var(--accent-3); |
| 124 | color: var(--accent-3); | 132 | font-size: 1.6rem; |
| 125 | font-size: 1.6rem; | 133 | } |
| 126 | } | 134 | p { |
| 127 | p { | 135 | margin: 0; |
| 128 | margin: 0; | 136 | opacity: 0.6; |
| 129 | opacity: 0.6; | 137 | } |
| 130 | } | 138 | } |
| 131 | } | 139 | |
| 132 | 140 | .results { | |
| 133 | .results { | 141 | margin: 0 auto 2rem auto; |
| 134 | margin: 0 auto 2rem auto; | 142 | padding: 1rem; |
| 135 | padding: 1rem; | 143 | width: calc(100% - 2rem); |
| 136 | width: calc(100% - 2rem); | 144 | max-width: 1100px; |
| 137 | max-width: 1100px; | 145 | columns: 6 300px; |
| 138 | columns: 6 300px; | 146 | column-gap: 1rem; |
| 139 | column-gap: 1rem; | 147 | .category { |
| 140 | .category { | 148 | padding: 1rem; |
| 141 | padding: 1rem; | 149 | box-shadow: 4px 4px 0 var(--box-outline); |
| 142 | box-shadow: 4px 4px 0 var(--box-outline); | 150 | background: var(--accent-fg); |
| 143 | background: var(--accent-fg); | 151 | border: 2px solid var(--box-outline); |
| 144 | border: 2px solid var(--box-outline); | 152 | border-radius: var(--curve-sm); |
| 145 | border-radius: var(--curve-sm); | 153 | display: inline-flex; |
| 146 | display: inline-flex; | 154 | flex-direction: column; |
| 147 | flex-direction: column; | 155 | width: 85%; |
| 148 | width: 85%; | 156 | margin: 1rem; |
| 149 | margin: 1rem; | 157 | position: relative; |
| 150 | position: relative; | 158 | .category-title { |
| 151 | .category-title { | 159 | text-decoration: none; |
| 152 | text-decoration: none; | 160 | color: var(--foreground); |
| 153 | color: var(--foreground); | 161 | z-index: 2; |
| 154 | z-index: 2; | 162 | position: relative; |
| 155 | position: relative; | 163 | h3 { |
| 156 | h3 { | 164 | font-family: 'Lekton', sans-serif; |
| 157 | font-family: "Lekton", sans-serif; | 165 | font-weight: bold; |
| 158 | font-weight: bold; | 166 | margin: 0; |
| 159 | margin: 0; | 167 | font-size: 1.8rem; |
| 160 | font-size: 1.8rem; | 168 | } |
| 161 | } | 169 | } |
| 162 | } | 170 | .section-icon { |
| 163 | .section-icon { | 171 | position: absolute; |
| 164 | position: absolute; | 172 | right: 0.5rem; |
| 165 | right: 0.5rem; | 173 | top: 0.5rem; |
| 166 | top: 0.5rem; | 174 | width: fit-content; |
| 167 | width: fit-content; | 175 | :global(svg) { |
| 168 | :global(svg) { | 176 | width: 2rem; |
| 169 | width: 2rem; | 177 | height: 2rem; |
| 170 | height: 2rem; | 178 | opacity: 0.5; |
| 171 | opacity: 0.5; | 179 | text-shadow: 3px 3px 0 black; |
| 172 | text-shadow: 3px 3px 0 black; | 180 | color: var(--accent-3); |
| 173 | color: var(--accent-3); | 181 | transition: all 0.2s ease-in-out; |
| 174 | transition: all 0.2s ease-in-out; | 182 | } |
| 175 | } | 183 | } |
| 176 | } | 184 | .section-list { |
| 177 | .section-list { | 185 | list-style: none; |
| 178 | list-style: none; | 186 | padding: 0; |
| 179 | padding: 0; | 187 | margin: 0; |
| 180 | margin: 0; | 188 | h4 { |
| 181 | h4 { | 189 | margin: 1rem 0 0 0; |
| 182 | margin: 1rem 0 0 0; | 190 | } |
| 183 | } | 191 | .service-list { |
| 184 | .service-list { | 192 | list-style: none; |
| 185 | list-style: none; | 193 | padding: 0; |
| 186 | padding: 0; | 194 | margin: 0; |
| 187 | margin: 0; | 195 | } |
| 188 | } | 196 | } |
| 189 | } | 197 | } |
| 190 | } | 198 | } |
| 191 | } | ||
| 192 | </style> | 199 | </style> |
web/src/pages/search/index.astro +41 −43
| @@ -1,57 +1,55 @@ | |||
| 1 | --- | 1 | --- |
| 2 | |||
| 3 | import Layout from '@layouts/Layout.astro'; | 2 | import Layout from '@layouts/Layout.astro'; |
| 4 | import { fetchData } from '@utils/fetch-data'; | 3 | import { fetchData } from '@utils/fetch-data'; |
| 5 | 4 | ||
| 6 | import Search from '@components/things/Search.svelte'; | 5 | import Search from '@components/things/Search.svelte'; |
| 7 | 6 | ||
| 8 | const categories = (await fetchData())?.categories; | 7 | const categories = (await fetchData())?.categories; |
| 9 | |||
| 10 | --- | 8 | --- |
| 11 | 9 | ||
| 12 | <Layout title="Search | Awesome Privacy"> | 10 | <Layout title="Search | Awesome Privacy"> |
| 13 | <section> | 11 | <section> |
| 14 | <h1>Search</h1> | 12 | <h1>Search</h1> |
| 15 | <Search client:visible data={categories} /> | 13 | <Search client:visible data={categories} /> |
| 16 | <p class="sitemap-link"> | 14 | <p class="sitemap-link"> |
| 17 | Browse <a href="/all">all listings</a>, or see all pages in the <a href="/sitemap">Sitemap</a> | 15 | Browse <a href="/all">all listings</a>, or see all pages in the <a |
| 18 | </p> | 16 | href="/sitemap">Sitemap</a |
| 19 | </section> | 17 | > |
| 18 | </p> | ||
| 19 | </section> | ||
| 20 | </Layout> | 20 | </Layout> |
| 21 | 21 | ||
| 22 | |||
| 23 | <style lang="scss"> | 22 | <style lang="scss"> |
| 24 | 23 | section { | |
| 25 | section { | 24 | display: flex; |
| 26 | display: flex; | 25 | flex-direction: column; |
| 27 | flex-direction: column; | 26 | padding: 1rem; |
| 28 | padding: 1rem; | 27 | box-shadow: 4px 4px 0 var(--box-outline); |
| 29 | box-shadow: 4px 4px 0 var(--box-outline); | 28 | background: var(--accent-fg); |
| 30 | background: var(--accent-fg); | 29 | border: 2px solid var(--box-outline); |
| 31 | border: 2px solid var(--box-outline); | 30 | border-radius: var(--curve-sm); |
| 32 | border-radius: var(--curve-sm); | 31 | margin: 2rem auto; |
| 33 | margin: 2rem auto; | 32 | padding: 1rem; |
| 34 | padding: 1rem; | 33 | width: calc(100% - 5rem); |
| 35 | width: calc(100% - 5rem); | 34 | max-width: 1100px; |
| 36 | max-width: 1100px; | 35 | min-height: 80vh; |
| 37 | min-height: 80vh; | 36 | |
| 38 | 37 | h1 { | |
| 39 | h1 { | 38 | font-size: 3rem; |
| 40 | font-size: 3rem; | 39 | color: var(--accent-3); |
| 41 | color: var(--accent-3); | 40 | font-family: 'Lekton', sans-serif; |
| 42 | font-family: "Lekton", sans-serif; | 41 | text-align: center; |
| 43 | text-align: center; | 42 | margin: 1rem 0; |
| 44 | margin: 1rem 0; | 43 | } |
| 45 | } | 44 | .sitemap-link { |
| 46 | .sitemap-link { | 45 | opacity: 0.6; |
| 47 | opacity: 0.6; | 46 | text-align: center; |
| 48 | text-align: center; | 47 | font-size: 0.8rem; |
| 49 | font-size: 0.8rem; | 48 | margin: 2rem auto; |
| 50 | margin: 2rem auto; | 49 | transition: all 0.2s ease-in-out; |
| 51 | transition: all 0.2s ease-in-out; | 50 | &:hover { |
| 52 | &:hover { | 51 | opacity: 0.8; |
| 53 | opacity: 0.8; | 52 | } |
| 54 | } | 53 | } |
| 55 | } | 54 | } |
| 56 | } | ||
| 57 | </style> | 55 | </style> |
web/src/pages/sitemap.astro +226 −216
| @@ -1,234 +1,244 @@ | |||
| 1 | --- | 1 | --- |
| 2 | |||
| 3 | |||
| 4 | import Layout from '@layouts/Layout.astro'; | 2 | import Layout from '@layouts/Layout.astro'; |
| 5 | import type { AwesomePrivacy } from '../types/Service'; | 3 | import type { AwesomePrivacy } from '../types/Service'; |
| 6 | import { fetchData, slugify } from '@utils/fetch-data'; | 4 | import { fetchData, slugify } from '@utils/fetch-data'; |
| 7 | 5 | ||
| 8 | const categories = (await fetchData() as AwesomePrivacy)?.categories || []; | 6 | const categories = ((await fetchData()) as AwesomePrivacy)?.categories || []; |
| 9 | |||
| 10 | --- | 7 | --- |
| 11 | 8 | ||
| 12 | <Layout title="All Links | Awesome Privacy"> | 9 | <Layout title="All Links | Awesome Privacy"> |
| 13 | <main> | 10 | <main> |
| 14 | <h2>Sitemap</h2> | 11 | <h2>Sitemap</h2> |
| 15 | <p> | 12 | <p> |
| 16 | Below is a full listing of all pages on this site.<br> | 13 | 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> | 14 | <small |
| 18 | </p> | 15 | >As reflected in our <a href="/sitemap-index.xml">sitemap.xml</a></small |
| 19 | <span class="search-controlls"> | 16 | > |
| 20 | <input id="searchInput" type="search" placeholder="Start typing to filter..." /> | 17 | </p> |
| 21 | <p id="press-enter-msg" class="press-enter">Press enter for deep search</p> | 18 | <span class="search-controlls"> |
| 22 | </span> | 19 | <input |
| 23 | <ul> | 20 | id="searchInput" |
| 24 | <li> | 21 | type="search" |
| 25 | <a href="/">Home</a> | 22 | placeholder="Start typing to filter..." |
| 26 | </li> | 23 | /> |
| 27 | <li> | 24 | <p id="press-enter-msg" class="press-enter"> |
| 28 | <a href="/search">Search</a> | 25 | Press enter for deep search |
| 29 | </li> | 26 | </p> |
| 30 | <li> | 27 | </span> |
| 31 | <a href="/all">View All</a> | 28 | <ul> |
| 32 | </li> | 29 | <li> |
| 33 | <li> | 30 | <a href="/">Home</a> |
| 34 | <a href="/inventory">My Inventory</a> | 31 | </li> |
| 35 | </li> | 32 | <li> |
| 36 | <li> | 33 | <a href="/search">Search</a> |
| 37 | <a href="/submit">Submit Listing</a> | 34 | </li> |
| 38 | </li> | 35 | <li> |
| 39 | <li> | 36 | <a href="/all">View All</a> |
| 40 | <a href="/api">API</a> | 37 | </li> |
| 41 | </li> | 38 | <li> |
| 42 | <li> | 39 | <a href="/inventory">My Inventory</a> |
| 43 | <a href="/browse">Categories</a> | 40 | </li> |
| 44 | <ul> | 41 | <li> |
| 45 | {categories.map((category) => ( | 42 | <a href="/submit">Submit Listing</a> |
| 46 | <li> | 43 | </li> |
| 47 | <a href={`/${slugify(category.name)}`}>{category.name}</a> | 44 | <li> |
| 48 | <ul> | 45 | <a href="/api">API</a> |
| 49 | {category.sections.map((section) => ( | 46 | </li> |
| 50 | <li> | 47 | <li> |
| 51 | <a href={`/${slugify(category.name)}/${slugify(section.name)}`}>{section.name}</a> | 48 | <a href="/browse">Categories</a> |
| 52 | <ul> | 49 | <ul> |
| 53 | {(section.services || []).map((service) => ( | 50 | { |
| 54 | <li title={service.description || ''}> | 51 | categories.map((category) => ( |
| 55 | <a href={`/${slugify(category.name)}/${slugify(section.name)}/${slugify(service.name)}`}> | 52 | <li> |
| 56 | {service.name} | 53 | <a href={`/${slugify(category.name)}`}>{category.name}</a> |
| 57 | </a> | 54 | <ul> |
| 58 | </li> | 55 | {category.sections.map((section) => ( |
| 59 | ))} | 56 | <li> |
| 60 | </ul> | 57 | <a |
| 61 | </li> | 58 | href={`/${slugify(category.name)}/${slugify(section.name)}`} |
| 62 | ))} | 59 | > |
| 63 | </ul> | 60 | {section.name} |
| 64 | </li> | 61 | </a> |
| 65 | ))} | 62 | <ul> |
| 66 | </ul> | 63 | {(section.services || []).map((service) => ( |
| 67 | </li> | 64 | <li title={service.description || ''}> |
| 68 | <li> | 65 | <a |
| 69 | <a href="/about">About</a> | 66 | href={`/${slugify(category.name)}/${slugify(section.name)}/${slugify(service.name)}`} |
| 70 | <ul> | 67 | > |
| 71 | <li><a href="/about#objective">Objective</a></li> | 68 | {service.name} |
| 72 | <li><a href="/about#criteria">Listing Criteria</a></li> | 69 | </a> |
| 73 | <li><a href="/about#contributing">Contributing</a></li> | 70 | </li> |
| 74 | <li> | 71 | ))} |
| 75 | <a href="/about#acknowledgements">Acknowledgements</a> | 72 | </ul> |
| 76 | <ul> | 73 | </li> |
| 77 | <li><a href="/about#contributors">Contributors</a></li> | 74 | ))} |
| 78 | <li><a href="/about#sponsors">Sponsors</a></li> | 75 | </ul> |
| 79 | </ul> | 76 | </li> |
| 80 | </li> | 77 | )) |
| 81 | <li><a href="/about#author">Author</a></li> | 78 | } |
| 82 | <li><a href="/about#license">License</a></li> | 79 | </ul> |
| 83 | </ul> | 80 | </li> |
| 84 | </li> | 81 | <li> |
| 85 | <li> | 82 | <a href="/about">About</a> |
| 86 | <a href="/sitemap">Sitemap</a> | 83 | <ul> |
| 87 | </li> | 84 | <li><a href="/about#objective">Objective</a></li> |
| 88 | </ul> | 85 | <li><a href="/about#criteria">Listing Criteria</a></li> |
| 89 | </main> | 86 | <li><a href="/about#contributing">Contributing</a></li> |
| 90 | 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> | ||
| 91 | </Layout> | 103 | </Layout> |
| 92 | 104 | ||
| 93 | <script> | 105 | <script> |
| 94 | document.addEventListener('DOMContentLoaded', () => { | 106 | document.addEventListener('DOMContentLoaded', () => { |
| 95 | // Select elements for events (search field, each result, and message str) | 107 | // Select elements for events (search field, each result, and message str) |
| 96 | const filterInput = document.querySelector<HTMLInputElement>('input'); | 108 | const filterInput = document.querySelector<HTMLInputElement>('input'); |
| 97 | const pages = document.querySelectorAll<HTMLElement>('li'); | 109 | const pages = document.querySelectorAll<HTMLElement>('li'); |
| 98 | const pressEnterMsg = document.getElementById('press-enter-msg'); | 110 | const pressEnterMsg = document.getElementById('press-enter-msg'); |
| 99 | if (!pressEnterMsg) throw new Error('pressEnterMsg element not found'); | 111 | if (!pressEnterMsg) throw new Error('pressEnterMsg element not found'); |
| 100 | 112 | ||
| 101 | // Instant search/filter functionality | 113 | // Instant search/filter functionality |
| 102 | filterInput?.addEventListener('input', (e: Event) => { | 114 | filterInput?.addEventListener('input', (e: Event) => { |
| 103 | const filter = (e.target as HTMLInputElement).value.toLowerCase(); | 115 | const filter = (e.target as HTMLInputElement).value.toLowerCase(); |
| 104 | pressEnterMsg.style.visibility = filter.length > 0 ? 'visible' : 'hidden'; | 116 | pressEnterMsg.style.visibility = filter.length > 0 ? 'visible' : 'hidden'; |
| 105 | Array.from(pages).reduce((count, page) => { | 117 | Array.from(pages).reduce((count, page) => { |
| 106 | const match = page.textContent?.toLowerCase().includes(filter) || false; | 118 | const match = page.textContent?.toLowerCase().includes(filter) || false; |
| 107 | page.style.display = match ? 'block' : 'none'; | 119 | page.style.display = match ? 'block' : 'none'; |
| 108 | return count + (match ? 1 : 0); | 120 | return count + (match ? 1 : 0); |
| 109 | }, 0); | 121 | }, 0); |
| 110 | }); | 122 | }); |
| 111 | // Handle keypress events, so Esc clears search, and Entr runs deep search | 123 | // Handle keypress events, so Esc clears search, and Entr runs deep search |
| 112 | document.addEventListener('keydown', (event: KeyboardEvent) => { | 124 | document.addEventListener('keydown', (event: KeyboardEvent) => { |
| 113 | if (!filterInput) return; | 125 | if (!filterInput) return; |
| 114 | switch (event.key) { | 126 | switch (event.key) { |
| 115 | case 'Enter': | 127 | case 'Enter': |
| 116 | event.preventDefault(); | 128 | event.preventDefault(); |
| 117 | const searchTerm = encodeURIComponent(filterInput.value); | 129 | const searchTerm = encodeURIComponent(filterInput.value); |
| 118 | window.location.href = `/search/${searchTerm}`; | 130 | window.location.href = `/search/${searchTerm}`; |
| 119 | break; | 131 | break; |
| 120 | case 'Escape': | 132 | case 'Escape': |
| 121 | filterInput.value = ''; | 133 | filterInput.value = ''; |
| 122 | filterInput.blur(); | 134 | filterInput.blur(); |
| 123 | pressEnterMsg.style.visibility = 'hidden'; | 135 | pressEnterMsg.style.visibility = 'hidden'; |
| 124 | pages.forEach(page => page.style.display = 'block'); | 136 | pages.forEach((page) => (page.style.display = 'block')); |
| 125 | break; | 137 | break; |
| 126 | } | 138 | } |
| 127 | }); | 139 | }); |
| 128 | }); | 140 | }); |
| 129 | </script> | 141 | </script> |
| 130 | 142 | ||
| 131 | <style lang="scss"> | 143 | <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 | } | ||
| 132 | 197 | ||
| 133 | main { | 198 | h2 { |
| 134 | padding: 1rem; | 199 | margin: 0; |
| 135 | width: 1000px; | 200 | gap: 1rem; |
| 136 | max-width: calc(100% - 5rem); | 201 | font-size: 2rem; |
| 137 | margin: 4rem auto 5rem auto; | 202 | margin: -2rem 0 2rem -4rem; |
| 138 | padding: 0 2rem; | 203 | box-shadow: 6px 6px 0 var(--box-outline); |
| 139 | border: 2px solid var(--box-outline); | 204 | background: var(--accent); |
| 140 | box-shadow: 6px 6px 0 var(--box-outline); | 205 | color: var(--accent-fg); |
| 141 | background: var(--accent-fg); | 206 | width: fit-content; |
| 142 | position: relative; | 207 | padding: 0.25rem 0.5rem; |
| 143 | p { | 208 | @media (max-width: 768px) { |
| 144 | font-size: 1.3rem; | 209 | margin: -2rem auto 1rem auto; |
| 145 | margin: 0; | 210 | } |
| 146 | small { | 211 | } |
| 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 | |||
| 185 | h2 { | ||
| 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 | |||
| 233 | 212 | ||
| 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 | } | ||
| 234 | </style> | 244 | </style> |
web/src/pages/submit.astro +170 −125
| @@ -2,142 +2,187 @@ | |||
| 2 | import Layout from '@layouts/Layout.astro'; | 2 | import Layout from '@layouts/Layout.astro'; |
| 3 | import AddNewService from '@components/things/AddNewService.svelte'; | 3 | import AddNewService from '@components/things/AddNewService.svelte'; |
| 4 | 4 | ||
| 5 | import { fetchGitHubStats } from '@utils/fetch-repo-info' | 5 | import { fetchGitHubStats } from '@utils/fetch-repo-info'; |
| 6 | import { formatDate } from '@utils/dates-n-stuff'; | 6 | import { formatDate } from '@utils/dates-n-stuff'; |
| 7 | 7 | ||
| 8 | const commits = (await fetchGitHubStats('lissy93/awesome-privacy') || {}).commits; | 8 | const commits = ((await fetchGitHubStats('lissy93/awesome-privacy')) || {}) |
| 9 | 9 | .commits; | |
| 10 | --- | 10 | --- |
| 11 | 11 | ||
| 12 | <Layout title="Awesome Privacy"> | 12 | <Layout title="Awesome Privacy"> |
| 13 | <section> | 13 | <section> |
| 14 | <h2>About our Data</h2> | 14 | <h2>About our Data</h2> |
| 15 | <p class="about-data"> | 15 | <p class="about-data"> |
| 16 | All data on Awesome Privacy is community maintained via Git, | 16 | All data on Awesome Privacy is community maintained via Git, this keeps |
| 17 | this keeps everything transparent, and means anyone can submit edits. | 17 | everything transparent, and means anyone can submit edits. You can learn |
| 18 | You can learn more about how our data is managed on our <a href="/about#our-data">about page</a>. | 18 | more about how our data is managed on our <a href="/about#our-data" |
| 19 | <br /><br /> | 19 | >about page</a |
| 20 | You can make ammendments/additions/removals simply by editing the | 20 | >. |
| 21 | <a href="github.com/lissy93/awesome-privacy/blob/main/awesome-privacy.yml">awesome-privacy.yml</a> file. | 21 | <br /><br /> |
| 22 | <br /> | 22 | You can make ammendments/additions/removals simply by editing the |
| 23 | Before you proceed, please first read our <a href="https://github.com/Lissy93/awesome-privacy/blob/main/.github/CONTRIBUTING.md">Contributing Docs</a> | 23 | <a href="github.com/lissy93/awesome-privacy/blob/main/awesome-privacy.yml" |
| 24 | <br /><br /> | 24 | >awesome-privacy.yml</a |
| 25 | Awesome Privacy is a community-maintained resource, it's thanks to | 25 | > file. |
| 26 | contributors like you, that it's able to grow and stay up to date 💜 | 26 | <br /> |
| 27 | </p> | 27 | Before you proceed, please first read our <a |
| 28 | </section> | 28 | href="https://github.com/Lissy93/awesome-privacy/blob/main/.github/CONTRIBUTING.md" |
| 29 | <section> | 29 | >Contributing Docs</a |
| 30 | <h2>Submit an Addition</h2> | 30 | > |
| 31 | <AddNewService client:load /> | 31 | <br /><br /> |
| 32 | </section> | 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> | ||
| 33 | 40 | ||
| 34 | <section> | 41 | <section> |
| 35 | <h2>Submit a Removal Request</h2> | 42 | <h2>Submit a Removal Request</h2> |
| 36 | <p> | 43 | <p> |
| 37 | You can submit a removal request by browsing to a given service's page, | 44 | You can submit a removal request by browsing to a given service's page, |
| 38 | and clicking the "Request Removal" button. | 45 | and clicking the "Request Removal" button. This will open a form where you |
| 39 | This will open a form where you can justify your reasoning, to get it | 46 | can justify your reasoning, to get it deleted from the <a |
| 40 | deleted from the <a href="github.com/lissy93/awesome-privacy/blob/main/awesome-privacy.yml">awesome-privacy.yml</a> file. | 47 | href="github.com/lissy93/awesome-privacy/blob/main/awesome-privacy.yml" |
| 41 | </p> | 48 | >awesome-privacy.yml</a |
| 42 | </section> | 49 | > file. |
| 50 | </p> | ||
| 51 | </section> | ||
| 43 | 52 | ||
| 44 | <section> | 53 | <section> |
| 45 | <h2>Edit a Listing</h2> | 54 | <h2>Edit a Listing</h2> |
| 46 | <p> | 55 | <p> |
| 47 | Edits are welcome! All data is located in | 56 | 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>. | 57 | <a href="github.com/lissy93/awesome-privacy/blob/main/awesome-privacy.yml" |
| 49 | <br> | 58 | >awesome-privacy.yml</a |
| 50 | To modify an entry, navigate to it's page, scroll to the bottom, and click "Edit". | 59 | >. |
| 51 | This will take you to directly to the relevant lines in the file, where you can make your changes. | 60 | <br /> |
| 52 | </p> | 61 | To modify an entry, navigate to it's page, scroll to the bottom, and click "Edit". |
| 53 | </section> | 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> | ||
| 54 | 66 | ||
| 55 | <section> | 67 | <section> |
| 56 | <h2>Checklist</h2> | 68 | <h2>Checklist</h2> |
| 57 | <ul> | 69 | <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> | 70 | <li> |
| 59 | <li>All listing must meed our <a href="/about#creteria">Criteria</a> to be considered privacy-respecting</li> | 71 | You must read the <a |
| 60 | <li>Double check that your changes haven't already been proposed</li> | 72 | href="https://github.com/Lissy93/awesome-privacy/blob/main/.github/CONTRIBUTING.md" |
| 61 | <li>If you're associated with a service included, you must declare your affiliation</li> | 73 | >Contributing</a |
| 62 | <li>Before commiting changes, ensure the YAML syntax is valid and it complies with our schema</li> | 74 | > guidelines before proceeding |
| 63 | <li>Please complete the issue or PR description template in full, do not remove any fields</li> | 75 | </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> | 76 | <li> |
| 65 | </ul> | 77 | All listing must meed our <a href="/about#creteria">Criteria</a> to be considered |
| 66 | </section> | 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> | ||
| 67 | 100 | ||
| 68 | {commits && commits.length > 0 && ( | 101 | { |
| 69 | <section> | 102 | commits && commits.length > 0 && ( |
| 70 | <h2>Recent Changes</h2> | 103 | <section> |
| 71 | <p class="about-data"> | 104 | <h2>Recent Changes</h2> |
| 72 | You can view a full ledger of all updates made | 105 | <p class="about-data"> |
| 73 | at <a href="https://github.com/lissy93/awesome-privacy">github.com/lissy93/awesome-privacy</a> | 106 | You can view a full ledger of all updates made at{' '} |
| 74 | </p> | 107 | <a href="https://github.com/lissy93/awesome-privacy"> |
| 75 | <ul class="commit-log"> | 108 | github.com/lissy93/awesome-privacy |
| 76 | {commits.map((commit) => ( | 109 | </a> |
| 77 | <li title={commit.sha}> | 110 | </p> |
| 78 | {commit.message}<br /> | 111 | <ul class="commit-log"> |
| 79 | <img width="14" src={commit.authorAvatar} /> | 112 | {commits.map((commit) => ( |
| 80 | <small> | 113 | <li title={commit.sha}> |
| 81 | By <a href={`https://github.com/${commit.authorUsername}`}>{commit.authorName || commit.authorUsername}</a> | 114 | {commit.message} |
| 82 | on <a href={`https://github.com/Lissy93/awesome-privacy/commit/${commit.sha}`}>{formatDate(commit.authorDate)}</a> | 115 | <br /> |
| 83 | </small> | 116 | <img width="14" src={commit.authorAvatar} /> |
| 84 | </li> | 117 | <small> |
| 85 | ))} | 118 | By{' '} |
| 86 | </ul> | 119 | <a href={`https://github.com/${commit.authorUsername}`}> |
| 87 | </section> | 120 | {commit.authorName || commit.authorUsername} |
| 88 | )} | 121 | </a> |
| 89 | 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 | } | ||
| 90 | </Layout> | 135 | </Layout> |
| 91 | 136 | ||
| 92 | <style lang="scss"> | 137 | <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 | } | ||
| 93 | 170 | ||
| 94 | section { | 171 | .commit-log { |
| 95 | margin: 2rem auto; | 172 | column-width: 350px; |
| 96 | padding: 1rem; | 173 | li { |
| 97 | width: 1000px; | 174 | small { |
| 98 | max-width: calc(100% - 5rem); | 175 | font-size: 0.8rem; |
| 99 | display: flex; | 176 | opacity: 0.7; |
| 100 | flex-direction: column; | 177 | a { |
| 101 | justify-content: space-between; | 178 | text-transform: capitalize; |
| 102 | padding: 0 2rem; | 179 | } |
| 103 | border: 2px solid var(--box-outline); | 180 | } |
| 104 | box-shadow: 6px 6px 0 var(--box-outline); | 181 | img { |
| 105 | background: var(--accent-fg); | 182 | border-radius: var(--curve-md); |
| 106 | border-radius: var(--curve-sm); | 183 | margin-right: 0.5rem; |
| 107 | @media(max-width: 768px) { | 184 | } |
| 108 | max-width: 95%; | 185 | } |
| 109 | padding: 0.5rem; | 186 | } |
| 110 | margin: 0 auto; | 187 | } |
| 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 | |||
| 143 | </style> | 188 | </style> |
web/src/site-config.ts +15 −12
| @@ -31,13 +31,15 @@ export const authorProjects = [ | |||
| 31 | }, | 31 | }, |
| 32 | { | 32 | { |
| 33 | title: 'AdGuardian', | 33 | 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', | ||
| 35 | icon: 'https://adguardian.as93.net/favicon.png', | 36 | icon: 'https://adguardian.as93.net/favicon.png', |
| 36 | link: 'https://github.com/lissy93/adguardian-term', | 37 | link: 'https://github.com/lissy93/adguardian-term', |
| 37 | }, | 38 | }, |
| 38 | { | 39 | { |
| 39 | title: 'Bug-Bounties', | 40 | title: 'Bug-Bounties', |
| 40 | description: 'Database of websites which accept responsible vulnerability disclosure', | 41 | description: |
| 42 | 'Database of websites which accept responsible vulnerability disclosure', | ||
| 41 | icon: 'https://bug-bounties.as93.net/favicon.png', | 43 | icon: 'https://bug-bounties.as93.net/favicon.png', |
| 42 | link: 'https://github.com/lissy93/bug-bounties', | 44 | link: 'https://github.com/lissy93/bug-bounties', |
| 43 | }, | 45 | }, |
| @@ -82,7 +84,6 @@ export const authorSocials = [ | |||
| 82 | }, | 84 | }, |
| 83 | ]; | 85 | ]; |
| 84 | 86 | ||
| 85 | |||
| 86 | export const aboutOurData = ` | 87 | export const aboutOurData = ` |
| 87 | All data is stored in | 88 | All data is stored in |
| 88 | [\`awesome-privacy.yml\`](https://github.com/lissy93/awesome-privacy/blob/main/awesome-privacy.yml). | 89 | [\`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 | |||
| 167 | Usually these entries go within the "Notable Mentions" section instead._ | 168 | Usually these entries go within the "Notable Mentions" section instead._ |
| 168 | `; | 169 | `; |
| 169 | 170 | ||
| 170 | export const appDescription = 'Privacy is a fundamental human right; ' | 171 | export const appDescription = |
| 171 | + 'without it, we\'re just open books in a world where everyone\'s ' | 172 | 'Privacy is a fundamental human right; ' + |
| 172 | + 'watching. Let\'s take control back.\n' | 173 | "without it, we're just open books in a world where everyone's " + |
| 173 | + 'Migrating open-source applications which do not collect, sell or log your data is a great first step.' | 174 | "watching. Let's take control back.\n" + |
| 174 | + 'Awesome Privacy is a directory of alternative privacy-respecting software and services.'; | 175 | 'Migrating open-source applications which do not collect, sell or log your data is a great first step.' + |
| 175 | 176 | 'Awesome Privacy is a directory of alternative privacy-respecting software and services.'; | |
| 176 | 177 | ||
| 177 | export default { | 178 | export default { |
| 178 | title: 'Awesome Privacy | The Ultimate List of Private Apps', | 179 | title: 'Awesome Privacy | The Ultimate List of Private Apps', |
| 179 | description: 'Your guide to finding privacy-respecting alternatives to popular software and services.', | 180 | description: |
| 180 | keywords: 'security, privacy, awesome privacy, data collection, free software, open source, privacy tools, privacy respecting software', | 181 | 'Your guide to finding privacy-respecting alternatives to popular software and services.', |
| 181 | author: 'Alicia Sykes', | 182 | keywords: |
| 183 | 'security, privacy, awesome privacy, data collection, free software, open source, privacy tools, privacy respecting software', | ||
| 184 | author: 'Alicia Sykes', | ||
| 182 | authorProjects, | 185 | authorProjects, |
| 183 | authorSocials, | 186 | authorSocials, |
| 184 | aboutOurData, | 187 | aboutOurData, |
web/src/styles/typography.css +86 −54
| @@ -3,91 +3,123 @@ | |||
| 3 | 3 | ||
| 4 | /* Rubik Font Faces */ | 4 | /* Rubik Font Faces */ |
| 5 | @font-face { | 5 | @font-face { |
| 6 | font-family: 'Rubik'; | 6 | font-family: 'Rubik'; |
| 7 | font-style: normal; | 7 | font-style: normal; |
| 8 | font-weight: 400; | 8 | font-weight: 400; |
| 9 | src: local('Rubik'), url('/fonts/Rubik/Rubik-Regular.ttf') format('truetype'); | 9 | src: |
| 10 | local('Rubik'), | ||
| 11 | url('/fonts/Rubik/Rubik-Regular.ttf') format('truetype'); | ||
| 10 | } | 12 | } |
| 11 | @font-face { | 13 | @font-face { |
| 12 | font-family: 'Rubik'; | 14 | font-family: 'Rubik'; |
| 13 | font-style: italic; | 15 | font-style: italic; |
| 14 | font-weight: 400; | 16 | font-weight: 400; |
| 15 | src: local('Rubik Italic'), url('/fonts/Rubik/Rubik-Italic.ttf') format('truetype'); | 17 | src: |
| 18 | local('Rubik Italic'), | ||
| 19 | url('/fonts/Rubik/Rubik-Italic.ttf') format('truetype'); | ||
| 16 | } | 20 | } |
| 17 | @font-face { | 21 | @font-face { |
| 18 | font-family: 'Rubik'; | 22 | font-family: 'Rubik'; |
| 19 | font-style: normal; | 23 | font-style: normal; |
| 20 | font-weight: 500; | 24 | font-weight: 500; |
| 21 | src: local('Rubik Medium'), url('/fonts/Rubik/Rubik-Medium.ttf') format('truetype'); | 25 | src: |
| 26 | local('Rubik Medium'), | ||
| 27 | url('/fonts/Rubik/Rubik-Medium.ttf') format('truetype'); | ||
| 22 | } | 28 | } |
| 23 | @font-face { | 29 | @font-face { |
| 24 | font-family: 'Rubik'; | 30 | font-family: 'Rubik'; |
| 25 | font-style: italic; | 31 | font-style: italic; |
| 26 | font-weight: 500; | 32 | font-weight: 500; |
| 27 | src: local('Rubik Medium Italic'), url('/fonts/Rubik/Rubik-MediumItalic.ttf') format('truetype'); | 33 | src: |
| 34 | local('Rubik Medium Italic'), | ||
| 35 | url('/fonts/Rubik/Rubik-MediumItalic.ttf') format('truetype'); | ||
| 28 | } | 36 | } |
| 29 | @font-face { | 37 | @font-face { |
| 30 | font-family: 'Rubik'; | 38 | font-family: 'Rubik'; |
| 31 | font-style: normal; | 39 | font-style: normal; |
| 32 | font-weight: 600; | 40 | font-weight: 600; |
| 33 | src: local('Rubik SemiBold'), url('/fonts/Rubik/Rubik-SemiBold.ttf') format('truetype'); | 41 | src: |
| 42 | local('Rubik SemiBold'), | ||
| 43 | url('/fonts/Rubik/Rubik-SemiBold.ttf') format('truetype'); | ||
| 34 | } | 44 | } |
| 35 | @font-face { | 45 | @font-face { |
| 36 | font-family: 'Rubik'; | 46 | font-family: 'Rubik'; |
| 37 | font-style: italic; | 47 | font-style: italic; |
| 38 | font-weight: 600; | 48 | font-weight: 600; |
| 39 | src: local('Rubik SemiBold Italic'), url('/fonts/Rubik/Rubik-SemiBoldItalic.ttf') format('truetype'); | 49 | src: |
| 50 | local('Rubik SemiBold Italic'), | ||
| 51 | url('/fonts/Rubik/Rubik-SemiBoldItalic.ttf') format('truetype'); | ||
| 40 | } | 52 | } |
| 41 | 53 | ||
| 42 | /* Libre Franklin Font Faces */ | 54 | /* Libre Franklin Font Faces */ |
| 43 | @font-face { | 55 | @font-face { |
| 44 | font-family: 'Libre Franklin'; | 56 | font-family: 'Libre Franklin'; |
| 45 | font-style: normal; | 57 | font-style: normal; |
| 46 | font-weight: 500; | 58 | font-weight: 500; |
| 47 | src: local('Libre Franklin Bold'), url('/fonts/Libre_Franklin/LibreFranklin-Bold.ttf') format('truetype'); | 59 | src: |
| 60 | local('Libre Franklin Bold'), | ||
| 61 | url('/fonts/Libre_Franklin/LibreFranklin-Bold.ttf') format('truetype'); | ||
| 48 | } | 62 | } |
| 49 | 63 | ||
| 50 | /* Lekton Font Faces */ | 64 | /* Lekton Font Faces */ |
| 51 | @font-face { | 65 | @font-face { |
| 52 | font-family: 'Lekton'; | 66 | font-family: 'Lekton'; |
| 53 | font-style: normal; | 67 | font-style: normal; |
| 54 | font-weight: 700; | 68 | font-weight: 700; |
| 55 | src: local('Lekton Bold'), url('/fonts/Lekton/Lekton-Bold.ttf') format('truetype'); | 69 | src: |
| 70 | local('Lekton Bold'), | ||
| 71 | url('/fonts/Lekton/Lekton-Bold.ttf') format('truetype'); | ||
| 56 | } | 72 | } |
| 57 | 73 | ||
| 58 | html { | 74 | html { |
| 59 | font-family: system-ui, sans-serif; | 75 | font-family: system-ui, sans-serif; |
| 60 | } | 76 | } |
| 61 | 77 | ||
| 62 | code { | 78 | code { |
| 63 | font-family: | 79 | font-family: |
| 64 | Menlo, | 80 | Menlo, |
| 65 | Monaco, | 81 | Monaco, |
| 66 | Lucida Console, | 82 | Lucida Console, |
| 67 | Liberation Mono, | 83 | Liberation Mono, |
| 68 | DejaVu Sans Mono, | 84 | DejaVu Sans Mono, |
| 69 | Bitstream Vera Sans Mono, | 85 | Bitstream Vera Sans Mono, |
| 70 | Courier New, | 86 | Courier New, |
| 71 | monospace; | 87 | monospace; |
| 72 | } | 88 | } |
| 73 | 89 | ||
| 74 | .heading, h1 { | 90 | .heading, |
| 75 | font-family: "Libre Franklin", sans-serif; | 91 | h1 { |
| 76 | font-optical-sizing: auto; | 92 | font-family: 'Libre Franklin', sans-serif; |
| 77 | font-weight: 800; | 93 | font-optical-sizing: auto; |
| 78 | font-style: normal; | 94 | font-weight: 800; |
| 95 | font-style: normal; | ||
| 79 | } | 96 | } |
| 80 | 97 | ||
| 81 | .subtitle, h2, h3, h4, h5, h6 { | 98 | .subtitle, |
| 82 | font-family: "Lekton", sans-serif; | 99 | h2, |
| 83 | font-weight: 700; | 100 | h3, |
| 84 | font-style: normal; | 101 | h4, |
| 102 | h5, | ||
| 103 | h6 { | ||
| 104 | font-family: 'Lekton', sans-serif; | ||
| 105 | font-weight: 700; | ||
| 106 | font-style: normal; | ||
| 85 | } | 107 | } |
| 86 | 108 | ||
| 87 | html, body, p, a, ul, ol, li, blockquote, pre, strong, i { | 109 | html, |
| 88 | font-family: "Rubik", sans-serif; | 110 | body, |
| 111 | p, | ||
| 112 | a, | ||
| 113 | ul, | ||
| 114 | ol, | ||
| 115 | li, | ||
| 116 | blockquote, | ||
| 117 | pre, | ||
| 118 | strong, | ||
| 119 | i { | ||
| 120 | font-family: 'Rubik', sans-serif; | ||
| 89 | } | 121 | } |
| 90 | 122 | ||
| 91 | a { | 123 | a { |
| 92 | color: var(--accent); | 124 | color: var(--accent); |
| 93 | } | 125 | } |
web/src/styles/values.css +49 −51
| @@ -1,53 +1,51 @@ | |||
| 1 | html { | ||
| 2 | --accent: #f45397; | ||
| 3 | --accent-fg: #1e1f21; | ||
| 1 | 4 | ||
| 2 | html { | 5 | --accent-2: #ffdf60; |
| 3 | --accent: #f45397; | 6 | --accent-3: #5f53f4; |
| 4 | --accent-fg: #1e1f21; | 7 | --accent-4: #28dffd; |
| 5 | 8 | ||
| 6 | --accent-2: #ffdf60; | 9 | --foreground: #fff; |
| 7 | --accent-3: #5f53f4; | 10 | |
| 8 | --accent-4: #28dffd; | 11 | --curve-sm: 4px; |
| 9 | 12 | --curve-md: 6px; | |
| 10 | --foreground: #fff; | 13 | --curve-lg: 12px; |
| 11 | 14 | ||
| 12 | --curve-sm: 4px; | 15 | --danger: #ff0048; |
| 13 | --curve-md: 6px; | 16 | --success: #00ff64; |
| 14 | --curve-lg: 12px; | 17 | |
| 15 | 18 | --transparent-accent: #5f53f482; | |
| 16 | --danger: #ff0048; | 19 | |
| 17 | --success: #00ff64; | 20 | --background: #151517; |
| 18 | 21 | --bg-gradient-comp-1: #151517; | |
| 19 | --transparent-accent: #5f53f482; | 22 | --bg-gradient-comp-2: #151517; |
| 20 | 23 | --background-form: #19191c; | |
| 21 | --background: #151517; | 24 | |
| 22 | --bg-gradient-comp-1: #151517; | 25 | --box-outline: #000; |
| 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 | } | ||
| 53 | 26 | ||
| 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 | |||
| 3 | export interface ShortService { | 1 | export interface ShortService { |
| 4 | name: string; | 2 | name: string; |
| 5 | description: string; | 3 | description: string; |
| @@ -42,7 +40,6 @@ export interface Category { | |||
| 42 | sections: Section[]; | 40 | sections: Section[]; |
| 43 | } | 41 | } |
| 44 | 42 | ||
| 45 | |||
| 46 | export interface AwesomePrivacy { | 43 | export interface AwesomePrivacy { |
| 47 | categories: Array<{ | 44 | categories: Array<{ |
| 48 | name: string; | 45 | name: string; |
web/src/utils/config.ts +7 −5
| @@ -1,11 +1,13 @@ | |||
| 1 | |||
| 2 | function cleanUrl(inputString: string) { | 1 | function cleanUrl(inputString: string) { |
| 3 | return inputString.replace(/['";]+/g, '').trim(); | 2 | return inputString.replace(/['";]+/g, '').trim(); |
| 4 | } | 3 | } |
| 5 | 4 | ||
| 5 | export const site = cleanUrl( | ||
| 6 | import.meta.env.SITE_URL || 'https://awesome-privacy.xyz', | ||
| 7 | ); | ||
| 6 | 8 | ||
| 7 | export const site = cleanUrl(import.meta.env.SITE_URL || 'https://awesome-privacy.xyz'); | 9 | export const title = |
| 8 | 10 | 'Awesome Privacy | Compare privacy-respecting alternatives to popular software & services'; | |
| 9 | export const title = 'Awesome Privacy | Compare privacy-respecting alternatives to popular software & services'; | ||
| 10 | 11 | ||
| 11 | export const description = 'Your guide to escaping big tech, protecting your privacy, and reclaiming your digital life.'; | 12 | export 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 @@ | |||
| 1 | import { slugify } from '@utils/fetch-data'; | 1 | import { slugify } from '@utils/fetch-data'; |
| 2 | 2 | ||
| 3 | export const makeRemovalRequest = (categoryName: string, sectionName: string, serviceName: string, yaml?: string) => { | 3 | export const makeRemovalRequest = ( |
| 4 | categoryName: string, | ||
| 5 | sectionName: string, | ||
| 6 | serviceName: string, | ||
| 7 | yaml?: string, | ||
| 8 | ) => { | ||
| 4 | const title = `[REMOVAL] ${serviceName}`; | 9 | const title = `[REMOVAL] ${serviceName}`; |
| 5 | const under = `**${serviceName}** (source: [${categoryName} ➜ ${sectionName} ➜ ${serviceName}` | 10 | const under = |
| 6 | + `](https://github.com/Lissy93/awesome-privacy/tree/main#${slugify(sectionName)}))`; | 11 | `**${serviceName}** (source: [${categoryName} ➜ ${sectionName} ➜ ${serviceName}` + |
| 7 | const removalData = `&title=${encodeURIComponent(title)}&removal-data=` | 12 | `](https://github.com/Lissy93/awesome-privacy/tree/main#${slugify(sectionName)}))`; |
| 8 | + `${encodeURIComponent(yaml || '')}&service-title=${encodeURIComponent(under)}`; | 13 | const removalData = |
| 9 | const issueCreate = 'https://github.com/Lissy93/awesome-privacy/issues/new' | 14 | `&title=${encodeURIComponent(title)}&removal-data=` + |
| 10 | const baseOptions = '?assignees=lissy93&labels=Suggested+Removal%2CAwaiting+' | 15 | `${encodeURIComponent(yaml || '')}&service-title=${encodeURIComponent(under)}`; |
| 11 | + 'Review&projects=&template=removal.yml' | 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'; | ||
| 12 | return `${issueCreate}${baseOptions}${removalData}`; | 20 | return `${issueCreate}${baseOptions}${removalData}`; |
| 13 | }; | 21 | }; |
| 14 | 22 | ||
| 15 | export const makeEditRequest = (categoryName: string, sectionName: string, serviceName: string, yaml?: string) => { | 23 | export const makeEditRequest = ( |
| 24 | categoryName: string, | ||
| 25 | sectionName: string, | ||
| 26 | serviceName: string, | ||
| 27 | yaml?: string, | ||
| 28 | ) => { | ||
| 16 | const title = `[AMENDMENT] ${serviceName}`; | 29 | const title = `[AMENDMENT] ${serviceName}`; |
| 17 | const under = `**${serviceName}** (source: [${categoryName} ➜ ${sectionName} ➜ ${serviceName}` | 30 | const under = |
| 18 | + `](https://github.com/Lissy93/awesome-privacy/tree/main#${slugify(sectionName)}))`; | 31 | `**${serviceName}** (source: [${categoryName} ➜ ${sectionName} ➜ ${serviceName}` + |
| 19 | const removalData = `&title=${encodeURIComponent(title)}&amendment-data=` | 32 | `](https://github.com/Lissy93/awesome-privacy/tree/main#${slugify(sectionName)}))`; |
| 20 | + `${encodeURIComponent(yaml || '')}&service-title=${encodeURIComponent(under)}`; | 33 | const removalData = |
| 21 | const issueCreate = 'https://github.com/Lissy93/awesome-privacy/issues/new' | 34 | `&title=${encodeURIComponent(title)}&amendment-data=` + |
| 22 | const baseOptions = '?assignees=lissy93&labels=Suggested+Removal%2CAwaiting+' | 35 | `${encodeURIComponent(yaml || '')}&service-title=${encodeURIComponent(under)}`; |
| 23 | + 'Review&projects=&template=amendment.yml' | 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'; | ||
| 24 | return `${issueCreate}${baseOptions}${removalData}`; | 40 | return `${issueCreate}${baseOptions}${removalData}`; |
| 25 | }; | 41 | }; |
| 26 | 42 | ||
| 27 | export const makeAdditionRequest = (formData: { | 43 | export const makeAdditionRequest = ( |
| 28 | listingCategory: string; | 44 | formData: { |
| 29 | serviceName: string; | 45 | listingCategory: string; |
| 30 | serviceUrl: string; | 46 | serviceName: string; |
| 31 | serviceIcon: string; | 47 | serviceUrl: string; |
| 32 | serviceDescription: string; | 48 | serviceIcon: string; |
| 33 | serviceGithub: string; | 49 | serviceDescription: string; |
| 34 | serviceTosdrId: string; | 50 | serviceGithub: string; |
| 35 | serviceIosApp: string, | 51 | serviceTosdrId: string; |
| 36 | serviceAndroidApp: string, | 52 | serviceIosApp: string; |
| 37 | serviceDiscordInvite: string, | 53 | serviceAndroidApp: string; |
| 38 | serviceSubreddit: string, | 54 | serviceDiscordInvite: string; |
| 39 | serviceOpenSource: boolean; | 55 | serviceSubreddit: string; |
| 40 | serviceSecurityAudited: boolean; | 56 | serviceOpenSource: boolean; |
| 41 | serviceCrypto: boolean; | 57 | serviceSecurityAudited: boolean; |
| 42 | additionalInfo: string; | 58 | serviceCrypto: boolean; |
| 43 | }, yamlText?: string) => { | 59 | additionalInfo: string; |
| 44 | 60 | }, | |
| 45 | const userInfo = formData.additionalInfo.split('\n').map(line => `> ${line}`).join('\n'); | 61 | yamlText?: string, |
| 46 | const additionalInfoText: string = `\n${userInfo}` | 62 | ) => { |
| 47 | + `\n\n**YAML Content for Addition**\n\n\`\`\`yaml\n${yamlText || '# nothing yet'}\n\`\`\`\n` | 63 | const userInfo = formData.additionalInfo |
| 48 | + `\n\n<sup>This ticket was submitted via ` | 64 | .split('\n') |
| 49 | + `<a href="https://awesome-privacy.xyz/submit">awesome-privacy.xyz/submit</a></sup>`; | 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>`; | ||
| 50 | 72 | ||
| 51 | const issueTitle = `[ADDITION] ${formData.serviceName} (Complete)`; | 73 | const issueTitle = `[ADDITION] ${formData.serviceName} (Complete)`; |
| 52 | const queryParams = new URLSearchParams({ | 74 | const queryParams = new URLSearchParams({ |
| 53 | 'assignees': 'lissy93,liss-bot', | 75 | assignees: 'lissy93,liss-bot', |
| 54 | 'labels': '', | 76 | labels: '', |
| 55 | 'projects': '', | 77 | projects: '', |
| 56 | 'template': 'complete-addition.yml', | 78 | template: 'complete-addition.yml', |
| 57 | 'title': issueTitle, | 79 | title: issueTitle, |
| 58 | 'listing-category': formData.listingCategory, | 80 | 'listing-category': formData.listingCategory, |
| 59 | 'service-name': formData.serviceName, | 81 | 'service-name': formData.serviceName, |
| 60 | 'service-url': formData.serviceUrl, | 82 | 'service-url': formData.serviceUrl, |
| @@ -63,38 +85,59 @@ export const makeAdditionRequest = (formData: { | |||
| 63 | 'service-github': formData.serviceGithub, | 85 | 'service-github': formData.serviceGithub, |
| 64 | 'service-tosdr-id': formData.serviceTosdrId, | 86 | 'service-tosdr-id': formData.serviceTosdrId, |
| 65 | 'service-opensource': formData.serviceOpenSource ? 'true' : 'false', | 87 | 'service-opensource': formData.serviceOpenSource ? 'true' : 'false', |
| 66 | 'service-security-audited': formData.serviceSecurityAudited ? 'true' : 'false', | 88 | 'service-security-audited': formData.serviceSecurityAudited |
| 89 | ? 'true' | ||
| 90 | : 'false', | ||
| 67 | 'service-crypto': formData.serviceCrypto ? 'true' : 'false', | 91 | 'service-crypto': formData.serviceCrypto ? 'true' : 'false', |
| 68 | 'additional-info': additionalInfoText, | 92 | 'additional-info': additionalInfoText, |
| 69 | }); | 93 | }); |
| 70 | const issueCreateUrl = 'https://github.com/Lissy93/awesome-privacy/issues/new'; | 94 | const issueCreateUrl = |
| 95 | 'https://github.com/Lissy93/awesome-privacy/issues/new'; | ||
| 71 | return `${issueCreateUrl}?${queryParams.toString()}`; | 96 | return `${issueCreateUrl}?${queryParams.toString()}`; |
| 72 | }; | 97 | }; |
| 73 | 98 | ||
| 74 | 99 | export const makeSourceYamlLink = async ( | |
| 75 | export const makeSourceYamlLink = async (categoryName: string, sectionName: string, serviceName: string) => { | 100 | categoryName: string, |
| 101 | sectionName: string, | ||
| 102 | serviceName: string, | ||
| 103 | ) => { | ||
| 76 | const sourceData = await fetchSrcData(categoryName, sectionName, serviceName); | 104 | const sourceData = await fetchSrcData(categoryName, sectionName, serviceName); |
| 77 | const lineNumbers = sourceData.lineNumbers || null; | 105 | const lineNumbers = sourceData.lineNumbers || null; |
| 78 | const numberRange = lineNumbers ? `L${lineNumbers.start}-L${lineNumbers.end}` : ''; | 106 | const numberRange = lineNumbers |
| 79 | const yamlLink = 'https://github.com/lissy93/awesome-privacy/blob/main/awesome-privacy.yml'; | 107 | ? `L${lineNumbers.start}-L${lineNumbers.end}` |
| 108 | : ''; | ||
| 109 | const yamlLink = | ||
| 110 | 'https://github.com/lissy93/awesome-privacy/blob/main/awesome-privacy.yml'; | ||
| 80 | return `${yamlLink}${numberRange}`; | 111 | return `${yamlLink}${numberRange}`; |
| 81 | }; | 112 | }; |
| 82 | 113 | ||
| 83 | export const fetchSrcData = async (categoryName: string, sectionName: string, serviceName: string) => { | 114 | export const fetchSrcData = async ( |
| 84 | const lineNumberData = await fetch('/api/line-numbers.json') | 115 | categoryName: string, |
| 85 | .then((res) => res.json()); | 116 | sectionName: string, |
| 117 | serviceName: string, | ||
| 118 | ) => { | ||
| 119 | const lineNumberData = await fetch('/api/line-numbers.json').then((res) => | ||
| 120 | res.json(), | ||
| 121 | ); | ||
| 86 | 122 | ||
| 87 | if ( lineNumberData | 123 | if ( |
| 88 | && lineNumberData[categoryName] | 124 | lineNumberData && |
| 89 | && lineNumberData[categoryName][sectionName] | 125 | lineNumberData[categoryName] && |
| 90 | && lineNumberData[categoryName][sectionName][serviceName] | 126 | lineNumberData[categoryName][sectionName] && |
| 127 | lineNumberData[categoryName][sectionName][serviceName] | ||
| 91 | ) { | 128 | ) { |
| 92 | return { | 129 | return { |
| 93 | lineNumbers: lineNumberData[categoryName][sectionName][serviceName].lineNumbers, | 130 | lineNumbers: |
| 131 | lineNumberData[categoryName][sectionName][serviceName].lineNumbers, | ||
| 94 | yamlContent: lineNumberData[categoryName][sectionName][serviceName].yaml, | 132 | yamlContent: lineNumberData[categoryName][sectionName][serviceName].yaml, |
| 95 | }; | 133 | }; |
| 96 | } else { | 134 | } 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 | ); | ||
| 98 | return { lineNumbers: [], yamlContent: '' }; | 141 | return { lineNumbers: [], yamlContent: '' }; |
| 99 | } | 142 | } |
| 100 | }; | 143 | }; |
web/src/utils/dates-n-stuff.test.ts added +32
| @@ -0,0 +1,32 @@ | |||
| 1 | import { describe, it, expect } from 'vitest'; | ||
| 2 | import { formatDate, timestampToDate } from './dates-n-stuff'; | ||
| 3 | |||
| 4 | describe('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 | |||
| 21 | describe('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 => { | |||
| 2 | return new Date(date).toLocaleDateString('en-GB', { | 2 | return new Date(date).toLocaleDateString('en-GB', { |
| 3 | day: '2-digit', | 3 | day: '2-digit', |
| 4 | month: 'short', | 4 | month: 'short', |
| 5 | year: '2-digit' | 5 | year: '2-digit', |
| 6 | }); | 6 | }); |
| 7 | } | 7 | }; |
| 8 | 8 | ||
| 9 | export const timestampToDate = (timestamp: number): string => { | 9 | export const timestampToDate = (timestamp: number): string => { |
| 10 | return new Date(timestamp).toLocaleDateString('en-GB', { | 10 | return new Date(timestamp).toLocaleDateString('en-GB', { |
| 11 | day: '2-digit', | 11 | day: '2-digit', |
| 12 | month: 'short', | 12 | month: 'short', |
| 13 | year: '2-digit' | 13 | year: '2-digit', |
| 14 | }); | 14 | }); |
| 15 | 15 | }; | |
| 16 | } | ||
| 17 | 16 | ||
| 18 | export const timeAgo = (dateStr: string): string => { | 17 | export 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 | ); | ||
| 20 | const intervals = { | 21 | const intervals = { |
| 21 | year: 31536000, | 22 | year: 31536000, |
| 22 | month: 2592000, | 23 | month: 2592000, |
web/src/utils/do-searchy-searchy.test.ts added +105
| @@ -0,0 +1,105 @@ | |||
| 1 | import { describe, it, expect } from 'vitest'; | ||
| 2 | import { prepareSearchItems } from './do-searchy-searchy'; | ||
| 3 | import type { Category } from '../types/Service'; | ||
| 4 | |||
| 5 | const makeCategory = (overrides: Partial<Category> = {}): Category => | ||
| 6 | ({ | ||
| 7 | name: 'Test Category', | ||
| 8 | sections: [], | ||
| 9 | ...overrides, | ||
| 10 | }) as Category; | ||
| 11 | |||
| 12 | describe('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'; | |||
| 3 | export const prepareSearchItems = (categories: Category[]) => { | 3 | export const prepareSearchItems = (categories: Category[]) => { |
| 4 | const items: any = []; | 4 | const items: any = []; |
| 5 | // Add each category | 5 | // Add each category |
| 6 | categories.forEach(category => { | 6 | categories.forEach((category) => { |
| 7 | items.push({ | 7 | items.push({ |
| 8 | type: 'Category', | 8 | type: 'Category', |
| 9 | category: category.name, | 9 | category: category.name, |
| 10 | itemCount: (category.sections || []).reduce((acc, section) => { | 10 | itemCount: (category.sections || []).reduce((acc, section) => { |
| 11 | return acc + (section.services || []).length; | 11 | return acc + (section.services || []).length; |
| 12 | }, 0), | 12 | }, 0), |
| 13 | }); | 13 | }); |
| 14 | 14 | ||
| 15 | // Add section with category context | 15 | // Add section with category context |
| 16 | category.sections.forEach(section => { | 16 | category.sections.forEach((section) => { |
| 17 | items.push({ | 17 | items.push({ |
| 18 | type: 'Section', | 18 | type: 'Section', |
| 19 | sectionName: section.name, | 19 | sectionName: section.name, |
| @@ -21,9 +21,9 @@ export const prepareSearchItems = (categories: Category[]) => { | |||
| 21 | category: category.name, | 21 | category: category.name, |
| 22 | itemCount: (section.services || []).length, | 22 | itemCount: (section.services || []).length, |
| 23 | }); | 23 | }); |
| 24 | 24 | ||
| 25 | // Add service with section and category context | 25 | // Add service with section and category context |
| 26 | (section.services || []).forEach(service => { | 26 | (section.services || []).forEach((service) => { |
| 27 | items.push({ | 27 | items.push({ |
| 28 | type: 'Service', | 28 | type: 'Service', |
| 29 | name: service.name, | 29 | name: service.name, |
| @@ -53,6 +53,6 @@ export const searchOptions = { | |||
| 53 | { name: 'description', weight: 0.1 }, | 53 | { name: 'description', weight: 0.1 }, |
| 54 | { name: 'intro', weight: 0.1 }, | 54 | { name: 'intro', weight: 0.1 }, |
| 55 | { name: 'furtherInfo', weight: 0.1 }, | 55 | { name: 'furtherInfo', weight: 0.1 }, |
| 56 | { name: 'wordOfWarning', weight: 0.1 }, | 56 | { name: 'wordOfWarning', weight: 0.1 }, |
| 57 | ], | 57 | ], |
| 58 | }; | 58 | }; |
web/src/utils/fetch-android-info.ts +4 −5
| @@ -1,9 +1,10 @@ | |||
| 1 | |||
| 2 | const doubleCheckPackageName = (packageStr: string) => { | 1 | const doubleCheckPackageName = (packageStr: string) => { |
| 3 | return packageStr.includes('id=') ? packageStr.split('id=')[1] : packageStr; | 2 | return packageStr.includes('id=') ? packageStr.split('id=')[1] : packageStr; |
| 4 | } | 3 | }; |
| 5 | 4 | ||
| 6 | export const fetchAndroidInfo = async (androidPackage: string): Promise<AndroidInfo | null> => { | 5 | export const fetchAndroidInfo = async ( |
| 6 | androidPackage: string, | ||
| 7 | ): Promise<AndroidInfo | null> => { | ||
| 7 | const endpoint = `https://android-app-privacy.as93.net/${doubleCheckPackageName(androidPackage)}`; | 8 | const endpoint = `https://android-app-privacy.as93.net/${doubleCheckPackageName(androidPackage)}`; |
| 8 | try { | 9 | try { |
| 9 | return await fetch(endpoint).then((res) => res.json()); | 10 | return await fetch(endpoint).then((res) => res.json()); |
| @@ -43,5 +44,3 @@ export interface AndroidInfo { | |||
| 43 | trackers: Tracker[]; | 44 | trackers: Tracker[]; |
| 44 | permissions: string[]; | 45 | permissions: string[]; |
| 45 | } | 46 | } |
| 46 | |||
| 47 | |||
web/src/utils/fetch-data.test.ts added +37
| @@ -0,0 +1,37 @@ | |||
| 1 | import { describe, it, expect } from 'vitest'; | ||
| 2 | import { slugify } from './fetch-data'; | ||
| 3 | |||
| 4 | describe('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 | |||
| 2 | import yaml from 'js-yaml'; | 1 | import yaml from 'js-yaml'; |
| 3 | 2 | ||
| 4 | import type { AwesomePrivacy } from '../types/Service'; | 3 | import type { AwesomePrivacy } from '../types/Service'; |
| 5 | 4 | ||
| 6 | const awesomePrivacyData = 'https://raw.githubusercontent.com/Lissy93/awesome-privacy/main/awesome-privacy.yml'; | 5 | const awesomePrivacyData = |
| 6 | 'https://raw.githubusercontent.com/Lissy93/awesome-privacy/main/awesome-privacy.yml'; | ||
| 7 | 7 | ||
| 8 | export const fetchData = async (): Promise<AwesomePrivacy> => { | 8 | export const fetchData = async (): Promise<AwesomePrivacy> => { |
| 9 | return await fetch(awesomePrivacyData) | 9 | return (await fetch(awesomePrivacyData) |
| 10 | .then((res) => res.text()) | 10 | .then((res) => res.text()) |
| 11 | .then((data) => yaml.load(data)) | 11 | .then((data) => yaml.load(data)) |
| 12 | .catch((err) => console.error('ah crap', err)) as AwesomePrivacy; | 12 | .catch((err) => console.error('ah crap', err))) as AwesomePrivacy; |
| 13 | } | 13 | }; |
| 14 | 14 | ||
| 15 | export const slugify = (title: string) => { | 15 | export const slugify = (title: string) => { |
| 16 | return (title || '').toLowerCase().replace(/\s/g, '-').replace(/\+|&/g, 'and').replaceAll('?', ''); | 16 | return (title || '') |
| 17 | }; | 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 | 1 | export const fetchDiscordInfo = async ( | |
| 2 | export const fetchDiscordInfo = async (discordInvite: string): Promise<DiscordInfo | null> => { | 2 | discordInvite: string, |
| 3 | ): Promise<DiscordInfo | null> => { | ||
| 3 | const endpoint = `https://discord-invite-info.as93.net/${discordInvite}`; | 4 | const endpoint = `https://discord-invite-info.as93.net/${discordInvite}`; |
| 4 | try { | 5 | try { |
| 5 | return await fetch(endpoint).then((res) => res.json()); | 6 | return await fetch(endpoint).then((res) => res.json()); |
web/src/utils/fetch-docker-instructions.ts +3 −3
| @@ -1,6 +1,6 @@ | |||
| 1 | 1 | export const fetchDockerData = async ( | |
| 2 | 2 | serviceName: string, | |
| 3 | export const fetchDockerData = async (serviceName: string): Promise<TemplateResponse | null> => { | 3 | ): Promise<TemplateResponse | null> => { |
| 4 | const endpoint = `https://docker-info.as93.workers.dev/${serviceName}`; | 4 | const endpoint = `https://docker-info.as93.workers.dev/${serviceName}`; |
| 5 | try { | 5 | try { |
| 6 | return await fetch(endpoint).then((res) => res.json()); | 6 | return await fetch(endpoint).then((res) => res.json()); |
web/src/utils/fetch-ios-info.ts +3 −2
| @@ -1,5 +1,6 @@ | |||
| 1 | 1 | export const fetchIosInfo = async ( | |
| 2 | export const fetchIosInfo = async (iosUrl: string): Promise<IoSApiResponse | null> => { | 2 | iosUrl: string, |
| 3 | ): Promise<IoSApiResponse | null> => { | ||
| 3 | const endpoint = `https://ios-app-info.as93.net?appStoreUrl=${iosUrl}`; | 4 | const endpoint = `https://ios-app-info.as93.net?appStoreUrl=${iosUrl}`; |
| 4 | try { | 5 | try { |
| 5 | return await fetch(endpoint).then((res) => res.json()); | 6 | return await fetch(endpoint).then((res) => res.json()); |
web/src/utils/fetch-privacy-policy.ts +3 −2
| @@ -1,5 +1,6 @@ | |||
| 1 | 1 | export const fetchTosdrPrivacy = async ( | |
| 2 | export const fetchTosdrPrivacy = async (serviceId: string): Promise<PrivacyPolicyResponse | null> => { | 2 | serviceId: string, |
| 3 | ): Promise<PrivacyPolicyResponse | null> => { | ||
| 3 | const endpoint = `https://privacy-policies.as93.workers.dev/${serviceId}`; | 4 | const endpoint = `https://privacy-policies.as93.workers.dev/${serviceId}`; |
| 4 | try { | 5 | try { |
| 5 | return await fetch(endpoint).then((res) => res.json()); | 6 | return await fetch(endpoint).then((res) => res.json()); |
web/src/utils/fetch-reddit-info.ts +3 −2
| @@ -1,5 +1,6 @@ | |||
| 1 | 1 | export const fetchRedditInfo = async ( | |
| 2 | export const fetchRedditInfo = async (subreddit: string): Promise<RedditData | null> => { | 2 | subreddit: string, |
| 3 | ): Promise<RedditData | null> => { | ||
| 3 | const endpoint = `https://subreddit-info.as93.net/${subreddit}`; | 4 | const endpoint = `https://subreddit-info.as93.net/${subreddit}`; |
| 4 | try { | 5 | try { |
| 5 | return await fetch(endpoint).then((res) => res.json()); | 6 | return await fetch(endpoint).then((res) => res.json()); |
web/src/utils/fetch-repo-info.ts +3 −4
| @@ -1,7 +1,6 @@ | |||
| 1 | 1 | export const fetchGitHubStats = async ( | |
| 2 | 2 | github: string, | |
| 3 | 3 | ): Promise<GitHubStatsResponse | null> => { | |
| 4 | export const fetchGitHubStats = async (github: string): Promise<GitHubStatsResponse | null> => { | ||
| 5 | const endpoint = `https://repo-info.as93.workers.dev/${github}`; | 4 | const endpoint = `https://repo-info.as93.workers.dev/${github}`; |
| 6 | try { | 5 | try { |
| 7 | return await fetch(endpoint).then((res) => res.json()); | 6 | return await fetch(endpoint).then((res) => res.json()); |
web/src/utils/fetch-website-info.ts +5 −4
| @@ -1,5 +1,6 @@ | |||
| 1 | 1 | export const fetchWebsiteInfo = async ( | |
| 2 | export const fetchWebsiteInfo = async (url: string): Promise<WebsiteData | null> => { | 2 | url: string, |
| 3 | ): Promise<WebsiteData | null> => { | ||
| 3 | const endpoint = `https://site-info-fetch.as93.workers.dev/?url=${url}`; | 4 | const endpoint = `https://site-info-fetch.as93.workers.dev/?url=${url}`; |
| 4 | try { | 5 | try { |
| 5 | return await fetch(endpoint).then((res) => res.json()); | 6 | return await fetch(endpoint).then((res) => res.json()); |
| @@ -19,10 +20,10 @@ interface DNSRecord { | |||
| 19 | 20 | ||
| 20 | interface DNSRecords { | 21 | interface DNSRecords { |
| 21 | ns: { | 22 | ns: { |
| 22 | records: DNSRecord[]; | 23 | records: DNSRecord[]; |
| 23 | }; | 24 | }; |
| 24 | mx: { | 25 | mx: { |
| 25 | records: DNSRecord[]; | 26 | records: DNSRecord[]; |
| 26 | }; | 27 | }; |
| 27 | } | 28 | } |
| 28 | 29 | ||
web/src/utils/parse-markdown.test.ts added +43
| @@ -0,0 +1,43 @@ | |||
| 1 | import { describe, it, expect } from 'vitest'; | ||
| 2 | import { formatLink } from './parse-markdown'; | ||
| 3 | |||
| 4 | describe('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 => { | |||
| 23 | 23 | ||
| 24 | // Sanitize the input to remove <script> tags | 24 | // Sanitize the input to remove <script> tags |
| 25 | const sanitizeHtml = (html: string): string => { | 25 | 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 | ); | ||
| 27 | }; | 30 | }; |
| 28 | 31 | ||
| 29 | // Configure marked with the custom renderer | 32 | // Configure marked with the custom renderer |
| 30 | marked.use({ renderer }); | 33 | marked.use({ renderer }); |
| 31 | 34 | ||
| 32 | // Parse the markdown, then sanitize the HTML to remove <script> tags | 35 | // 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; |
| 34 | const sanitizedHtml = sanitizeHtml(rawHtml); | 37 | const sanitizedHtml = sanitizeHtml(rawHtml); |
| 35 | 38 | ||
| 36 | return sanitizedHtml; | 39 | return sanitizedHtml; |
| 37 | }; | 40 | }; |
| 38 | 41 | ||
| 39 | export const formatLink = (link: string) => { | 42 | export const formatLink = (link: string) => { |
| 40 | return (link || '').replace(/^(https?:\/\/)?(www\.)?/, '').replace(/\/+$/, ''); | 43 | return (link || '') |
| 44 | .replace(/^(https?:\/\/)?(www\.)?/, '') | ||
| 45 | .replace(/\/+$/, ''); | ||
| 41 | }; | 46 | }; |
web/src/utils/security-check-mappings.test.ts added +68
| @@ -0,0 +1,68 @@ | |||
| 1 | import { describe, it, expect } from 'vitest'; | ||
| 2 | import { analyzeSecurityChecks } from './security-check-mappings'; | ||
| 3 | |||
| 4 | describe('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 | 1 | const securityCheckMapping: { [key: string]: string } = { | |
| 2 | const securityCheckMapping: {[key: string]: string} = { | ||
| 3 | is_host_an_ipv4: 'Host is an IPv4 Address', | 2 | is_host_an_ipv4: 'Host is an IPv4 Address', |
| 4 | is_uncommon_host_length: 'Uncommon Host Length', | 3 | is_uncommon_host_length: 'Uncommon Host Length', |
| 5 | is_uncommon_dash_char_count: 'Uncommon Number of Dashes in Host', | 4 | is_uncommon_dash_char_count: 'Uncommon Number of Dashes in Host', |
| @@ -51,7 +50,8 @@ const securityCheckMapping: {[key: string]: string} = { | |||
| 51 | is_masked_linux_elf_file: 'Masked Linux ELF File Detected', | 50 | is_masked_linux_elf_file: 'Masked Linux ELF File Detected', |
| 52 | is_masked_windows_exe_file: 'Masked Windows Executable Detected', | 51 | is_masked_windows_exe_file: 'Masked Windows Executable Detected', |
| 53 | is_ms_office_file: 'Microsoft Office File Detected', | 52 | 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', | ||
| 55 | is_windows_exe_file_on_free_hosting: 'Windows Executable on Free Hosting', | 55 | is_windows_exe_file_on_free_hosting: 'Windows Executable on Free Hosting', |
| 56 | is_windows_exe_file_on_ipv4: 'Windows Executable on IPv4 Address', | 56 | is_windows_exe_file_on_ipv4: 'Windows Executable on IPv4 Address', |
| 57 | is_windows_exe_file: 'Windows Executable Detected', | 57 | is_windows_exe_file: 'Windows Executable Detected', |
| @@ -65,91 +65,98 @@ const securityCheckMapping: {[key: string]: string} = { | |||
| 65 | is_domain_very_recent: 'Domain Very Recently Created', | 65 | is_domain_very_recent: 'Domain Very Recently Created', |
| 66 | is_credit_card_field: 'Credit Card Field Present', | 66 | is_credit_card_field: 'Credit Card Field Present', |
| 67 | is_password_field: 'Password Field Present', | 67 | is_password_field: 'Password Field Present', |
| 68 | is_valid_https: 'Valid HTTPS Connection' | 68 | is_valid_https: 'Valid HTTPS Connection', |
| 69 | }; | 69 | }; |
| 70 | const passFailLogic: {[key: string]: boolean | string} = { | 70 | const passFailLogic: { [key: string]: boolean | string } = { |
| 71 | // True means the check needs to be true to pass | 71 | // True means the check needs to be true to pass |
| 72 | is_valid_https: true, | 72 | is_valid_https: true, |
| 73 | is_host_an_ipv4: false, | 73 | is_host_an_ipv4: false, |
| 74 | is_uncommon_host_length: false, | 74 | is_uncommon_host_length: false, |
| 75 | is_uncommon_dash_char_count: false, | 75 | is_uncommon_dash_char_count: false, |
| 76 | is_uncommon_dot_char_count: false, | 76 | is_uncommon_dot_char_count: false, |
| 77 | is_uncommon_host_name: false, | 77 | is_uncommon_host_name: false, |
| 78 | is_suspicious_url_pattern: false, | 78 | is_suspicious_url_pattern: false, |
| 79 | is_suspicious_file_extension: false, | 79 | is_suspicious_file_extension: false, |
| 80 | is_robots_noindex: false, | 80 | is_robots_noindex: false, |
| 81 | is_suspended_page: false, | 81 | is_suspended_page: false, |
| 82 | is_most_abused_tld: false, | 82 | is_most_abused_tld: false, |
| 83 | is_uncommon_clickable_url: false, | 83 | is_uncommon_clickable_url: false, |
| 84 | is_phishing_heuristic: false, | 84 | is_phishing_heuristic: false, |
| 85 | is_possible_emotet: false, | 85 | is_possible_emotet: false, |
| 86 | is_redirect_to_search_engine: false, | 86 | is_redirect_to_search_engine: false, |
| 87 | is_redirect_to_wikipedia: false, | 87 | is_redirect_to_wikipedia: false, |
| 88 | is_http_status_error: false, | 88 | is_http_status_error: false, |
| 89 | is_http_server_error: false, | 89 | is_http_server_error: false, |
| 90 | is_http_client_error: false, | 90 | is_http_client_error: false, |
| 91 | is_suspicious_content: false, | 91 | is_suspicious_content: false, |
| 92 | is_url_accessible: true, | 92 | is_url_accessible: true, |
| 93 | is_empty_page_title: false, | 93 | is_empty_page_title: false, |
| 94 | is_empty_page_content: false, | 94 | is_empty_page_content: false, |
| 95 | is_domain_ipv4_assigned: true, | 95 | is_domain_ipv4_assigned: true, |
| 96 | is_domain_ipv4_private: false, | 96 | is_domain_ipv4_private: false, |
| 97 | is_domain_ipv4_loopback: false, | 97 | is_domain_ipv4_loopback: false, |
| 98 | is_domain_ipv4_reserved: false, | 98 | is_domain_ipv4_reserved: false, |
| 99 | is_domain_ipv4_valid: true, | 99 | is_domain_ipv4_valid: true, |
| 100 | is_domain_blacklisted: false, | 100 | is_domain_blacklisted: false, |
| 101 | is_suspicious_domain: false, | 101 | is_suspicious_domain: false, |
| 102 | is_sinkholed_domain: false, | 102 | is_sinkholed_domain: false, |
| 103 | is_defaced_heuristic: false, | 103 | is_defaced_heuristic: false, |
| 104 | is_masked_file: false, | 104 | is_masked_file: false, |
| 105 | is_risky_geo_location: false, | 105 | is_risky_geo_location: false, |
| 106 | is_china_country: false, | 106 | is_china_country: false, |
| 107 | is_nigeria_country: false, | 107 | is_nigeria_country: false, |
| 108 | is_non_standard_port: false, | 108 | is_non_standard_port: false, |
| 109 | is_email_address_on_url_query: false, | 109 | is_email_address_on_url_query: false, |
| 110 | is_directory_listing: false, | 110 | is_directory_listing: false, |
| 111 | is_exe_on_directory_listing: false, | 111 | is_exe_on_directory_listing: false, |
| 112 | is_zip_on_directory_listing: false, | 112 | is_zip_on_directory_listing: false, |
| 113 | is_php_on_directory_listing: false, | 113 | is_php_on_directory_listing: false, |
| 114 | is_doc_on_directory_listing: false, | 114 | is_doc_on_directory_listing: false, |
| 115 | is_pdf_on_directory_listing: false, | 115 | is_pdf_on_directory_listing: false, |
| 116 | is_apk_on_directory_listing: false, | 116 | is_apk_on_directory_listing: false, |
| 117 | is_linux_elf_file: false, | 117 | is_linux_elf_file: false, |
| 118 | is_linux_elf_file_on_free_dynamic_dns: false, | 118 | is_linux_elf_file_on_free_dynamic_dns: false, |
| 119 | is_linux_elf_file_on_free_hosting: false, | 119 | is_linux_elf_file_on_free_hosting: false, |
| 120 | is_linux_elf_file_on_ipv4: false, | 120 | is_linux_elf_file_on_ipv4: false, |
| 121 | is_masked_linux_elf_file: false, | 121 | is_masked_linux_elf_file: false, |
| 122 | is_masked_windows_exe_file: false, | 122 | is_masked_windows_exe_file: false, |
| 123 | is_ms_office_file: false, | 123 | is_ms_office_file: false, |
| 124 | is_windows_exe_file_on_free_dynamic_dns: false, | 124 | is_windows_exe_file_on_free_dynamic_dns: false, |
| 125 | is_windows_exe_file_on_free_hosting: false, | 125 | is_windows_exe_file_on_free_hosting: false, |
| 126 | is_windows_exe_file_on_ipv4: false, | 126 | is_windows_exe_file_on_ipv4: false, |
| 127 | is_windows_exe_file: false, | 127 | is_windows_exe_file: false, |
| 128 | is_android_apk_file_on_free_dynamic_dns: false, | 128 | is_android_apk_file_on_free_dynamic_dns: false, |
| 129 | is_android_apk_file_on_free_hosting: false, | 129 | is_android_apk_file_on_free_hosting: false, |
| 130 | is_android_apk_file_on_ipv4: false, | 130 | is_android_apk_file_on_ipv4: false, |
| 131 | is_android_apk_file: false, | 131 | is_android_apk_file: false, |
| 132 | is_external_redirect: false, | 132 | is_external_redirect: false, |
| 133 | is_risky_category: false, | 133 | is_risky_category: false, |
| 134 | is_domain_recent: "no", | 134 | is_domain_recent: 'no', |
| 135 | is_domain_very_recent: "no", | 135 | is_domain_very_recent: 'no', |
| 136 | is_credit_card_field: false, | 136 | is_credit_card_field: false, |
| 137 | is_password_field: false, | 137 | is_password_field: false, |
| 138 | }; | 138 | }; |
| 139 | 139 | ||
| 140 | export const analyzeSecurityChecks = (checks: { [key: string]: boolean | string }) => { | 140 | export const analyzeSecurityChecks = (checks: { |
| 141 | 141 | [key: string]: boolean | string; | |
| 142 | let passedChecks = []; | 142 | }) => { |
| 143 | let failedChecks = []; | 143 | const passedChecks = []; |
| 144 | const failedChecks = []; | ||
| 144 | for (const [check, value] of Object.entries(checks)) { | 145 | for (const [check, value] of Object.entries(checks)) { |
| 145 | let shouldPass = passFailLogic.hasOwnProperty(check) ? passFailLogic[check] : false; | 146 | const shouldPass = Object.prototype.hasOwnProperty.call( |
| 146 | let actualPass = (value === shouldPass) || (shouldPass === true && value !== "no"); | 147 | passFailLogic, |
| 148 | check, | ||
| 149 | ) | ||
| 150 | ? passFailLogic[check] | ||
| 151 | : false; | ||
| 152 | const actualPass = | ||
| 153 | value === shouldPass || (shouldPass === true && value !== 'no'); | ||
| 147 | 154 | ||
| 148 | if (actualPass) { | 155 | if (actualPass) { |
| 149 | passedChecks.push(securityCheckMapping[check]); | 156 | passedChecks.push(securityCheckMapping[check]); |
| 150 | } else { | 157 | } else { |
| 151 | failedChecks.push(securityCheckMapping[check]); | 158 | failedChecks.push(securityCheckMapping[check]); |
| 152 | } | 159 | } |
| 153 | } | 160 | } |
| 154 | return { passedChecks, failedChecks }; | 161 | return { passedChecks, failedChecks }; |
| 155 | } | 162 | }; |