| @@ -12,6 +12,8 @@ import { fetchGitHubStats } from '@utils/fetch-repo-info'; |
| 12 | 12 | import { fetchTosdrPrivacy } from '@utils/fetch-privacy-policy'; |
| 13 | 13 | import { fetchWebsiteInfo } from '@utils/fetch-website-info'; |
| 14 | 14 | import { parseMarkdown, formatLink } from '@utils/parse-markdown'; |
| 15 | import FontAwesome from '@components/form/FontAwesome.svelte'; |
| 16 | import Button from '@components/form/Button.astro'; |
| 15 | 17 | |
| 16 | 18 | interface Props extends Service { |
| 17 | 19 | slug: string; |
| @@ -27,9 +29,9 @@ const { |
| 27 | 29 | tosdrId, |
| 28 | 30 | icon, |
| 29 | 31 | followWith, |
| 30 | | // securityAudited, |
| 31 | | // openSource, |
| 32 | | // acceptsCrypto, |
| 32 | securityAudited, |
| 33 | openSource, |
| 34 | acceptsCrypto, |
| 33 | 35 | parentSection, |
| 34 | 36 | categoryName, |
| 35 | 37 | } = Astro.props; |
| @@ -103,14 +105,15 @@ export async function getStaticPaths() { |
| 103 | 105 | }); |
| 104 | 106 | } |
| 105 | 107 | |
| 106 | | // const makePaginationLinks = () => { |
| 107 | | // const index = otherSections.findIndex(section => section.name === title); |
| 108 | | // const previousSection = index > 0 ? otherSections[index - 1].name : null; |
| 109 | | // const nextSection = index < otherSections.length - 1 ? otherSections[index + 1].name : null; |
| 110 | | // return { previous: previousSection, next: nextSection }; |
| 111 | | // }; |
| 108 | const makePaginationLinks = () => { |
| 109 | const allServices = parentSection.services || []; |
| 110 | const index = allServices.findIndex(item => item.name === name); |
| 111 | const previousItem = index > 0 ? allServices[index - 1].name : null; |
| 112 | const nextItem = index < allServices.length - 1 ? allServices[index + 1].name : null; |
| 113 | return { previous: previousItem, next: nextItem }; |
| 114 | }; |
| 112 | 115 | |
| 113 | | // const { previous, next } = makePaginationLinks(); |
| 116 | const { previous, next } = makePaginationLinks(); |
| 114 | 117 | |
| 115 | 118 | |
| 116 | 119 | const ignoredSites = ['github.gom', 'wikipedia.']; |
| @@ -151,7 +154,63 @@ const websiteData = (url && !ignoredSites.some(ignoredSite => url.includes(ignor |
| 151 | 154 | data-service-url={formatLink(url)} |
| 152 | 155 | src={icon || `https://icon.horse/icon/${formatLink(url)}`} |
| 153 | 156 | /> |
| 157 | <div> |
| 154 | 158 | <p class="description" set:html={parseMarkdown(description)}></p> |
| 159 | <ul> |
| 160 | { url && ( |
| 161 | <li> |
| 162 | <b>Homepage:</b> |
| 163 | <a href={url}>{formatLink(url)}</a> |
| 164 | </li> |
| 165 | )} |
| 166 | { github && ( |
| 167 | <li> |
| 168 | <b>GitHub:</b> |
| 169 | <a href={`https://github.com/${github}`}>github.com/{github}</a> |
| 170 | </li> |
| 171 | )} |
| 172 | { tosdrId && ( |
| 173 | <li> |
| 174 | <b>ToS;DR:</b> |
| 175 | <a href={`https://tosdr.org/en/service/${tosdrId}`}>{`tosdr.org/en/service/${tosdrId}`}</a> |
| 176 | </li> |
| 177 | )} |
| 178 | { url && ( |
| 179 | <li> |
| 180 | <b>Web info:</b> |
| 181 | <a href={`https://web-check.xyz/results/${formatLink(url)}`}>{`web-check.xyz/results/${formatLink(url)}`}</a> |
| 182 | </li> |
| 183 | )} |
| 184 | </ul> |
| 185 | </div> |
| 186 | </div> |
| 187 | <div class="highlights"> |
| 188 | { securityAudited && ( |
| 189 | <span class="meta-item great" title={`${name} has been security audited by an accredited auditor, with results published publicly`}> |
| 190 | <FontAwesome iconName="securityAudited" /> Security Audited |
| 191 | </span> |
| 192 | )} |
| 193 | { acceptsCrypto && ( |
| 194 | <span class="meta-item great" title={`${name} accepts anonymous payment methods`}> |
| 195 | <FontAwesome iconName="cryptoAccepted" /> Crypto Payments Accepted |
| 196 | </span> |
| 197 | )} |
| 198 | { securityAudited === false && ( |
| 199 | <span class="meta-item warning" title={`${name} has not been audited`}> |
| 200 | <FontAwesome iconName="notSecurityAudited" /> No Security Audit |
| 201 | </span> |
| 202 | )} |
| 203 | { (openSource === false) && ( |
| 204 | <span class="warning"> |
| 205 | <FontAwesome iconName="closedSource" /> |
| 206 | Not Open Source |
| 207 | </span> |
| 208 | )} |
| 209 | { openSource || (github && openSource !== false) ? ( |
| 210 | <span class="meta-item great" title={`${name} is open source`}> |
| 211 | <FontAwesome iconName="openSource" /> Open Source |
| 212 | </span> |
| 213 | ) : null } |
| 155 | 214 | </div> |
| 156 | 215 | </section> |
| 157 | 216 | { privacyData && ( |
| @@ -188,6 +247,24 @@ const websiteData = (url && !ignoredSites.some(ignoredSite => url.includes(ignor |
| 188 | 247 | sectionName={parentSection.name} |
| 189 | 248 | /> |
| 190 | 249 | </section> |
| 250 | |
| 251 | <div class="pagination-navigation"> |
| 252 | { previous ? ( |
| 253 | <Button url={`/${slugify(categoryName)}/${slugify(parentSection.name)}/${slugify(previous)}`}> |
| 254 | <span>← Previous</span> |
| 255 | <p>{previous}</p> |
| 256 | </Button> |
| 257 | ) : <p class="nothing"></p>} |
| 258 | <a href={`/${slugify(categoryName)}/${slugify(parentSection.name)}`} class="go-to-category"> |
| 259 | View {parentSection.name} ({(parentSection.services || []).length}) |
| 260 | </a> |
| 261 | { next && ( |
| 262 | <Button url={`/${slugify(categoryName)}/${slugify(parentSection.name)}/${slugify(next)}`}> |
| 263 | <span>Next →</span> |
| 264 | <p>{next}</p> |
| 265 | </Button> |
| 266 | )} |
| 267 | </div> |
| 191 | 268 | </main> |
| 192 | 269 | </Layout> |
| 193 | 270 | |
| @@ -261,10 +338,29 @@ h3 { |
| 261 | 338 | .intro { |
| 262 | 339 | font-size: 1.2rem; |
| 263 | 340 | font-style: italic; |
| 264 | | opacity: 0.7; |
| 341 | opacity: 0.9; |
| 265 | 342 | display: flex; |
| 266 | | align-items: center; |
| 267 | 343 | gap: 0.5rem; |
| 344 | .service-icon { |
| 345 | border-radius: var(--curve-md); |
| 346 | margin-top: 1rem; |
| 347 | } |
| 348 | h4 { |
| 349 | margin-bottom: 0; |
| 350 | } |
| 351 | ul { |
| 352 | padding-left: 1rem; |
| 353 | list-style: circle; |
| 354 | font-style: normal; |
| 355 | font-size: 1rem; |
| 356 | margin-top: 0; |
| 357 | b { |
| 358 | font-size: 1rem; |
| 359 | font-weight: 400; |
| 360 | min-width: 85px; |
| 361 | display: inline-block; |
| 362 | } |
| 363 | } |
| 268 | 364 | } |
| 269 | 365 | |
| 270 | 366 | .pagination-navigation { |
| @@ -343,4 +439,51 @@ h3 { |
| 343 | 439 | } |
| 344 | 440 | } |
| 345 | 441 | |
| 442 | .highlights { |
| 443 | display: flex; |
| 444 | gap: 1rem; |
| 445 | flex-wrap: wrap; |
| 446 | align-items: center; |
| 447 | justify-content: end; |
| 448 | |
| 449 | .meta-item, .warning { |
| 450 | display: flex; |
| 451 | align-items: center; |
| 452 | // justify-content: center; |
| 453 | gap: 0.25rem; |
| 454 | opacity: 0.6; |
| 455 | font-size: 0.9rem; |
| 456 | padding: 0.5rem 0; |
| 457 | :global(svg) { |
| 458 | color: var(--foreground); |
| 459 | width: 1.2rem; |
| 460 | height: 1.2rem; |
| 461 | } |
| 462 | a { |
| 463 | text-decoration: none; |
| 464 | color: var(--foreground); |
| 465 | display: flex; |
| 466 | gap: 0.25rem; |
| 467 | &:hover { |
| 468 | color: var(--accent-3); |
| 469 | :global(svg) { |
| 470 | color: var(--accent-3); |
| 471 | } |
| 472 | } |
| 473 | } |
| 474 | } |
| 475 | .warning { |
| 476 | color: var(--danger); |
| 477 | :global(svg) { |
| 478 | color: var(--danger); |
| 479 | } |
| 480 | } |
| 481 | .great { |
| 482 | color: #007930; // var(--success); |
| 483 | :global(svg) { |
| 484 | color: #007930; // var(--success); |
| 485 | } |
| 486 | } |
| 487 | } |
| 488 | |
| 346 | 489 | </style> |