diff options
| author | LynithDev <61880709+LynithDev@users.noreply.github.com> | 2023-12-26 20:29:16 +0100 |
|---|---|---|
| committer | LynithDev <61880709+LynithDev@users.noreply.github.com> | 2023-12-26 20:29:16 +0100 |
| commit | 530634fea254c344684d42fe7a1d5b4020f6a3ab (patch) | |
| tree | beff3954c244bb2c89245a63d984fdea7c338659 /apps/website/src/components/icons | |
| parent | 542fb33102902fd7461bee0c0ca8ab4d9ef58de0 (diff) | |
| download | Nexus-530634fea254c344684d42fe7a1d5b4020f6a3ab.tar.gz Nexus-530634fea254c344684d42fe7a1d5b4020f6a3ab.tar.bz2 Nexus-530634fea254c344684d42fe7a1d5b4020f6a3ab.zip | |
Footer + small tweaks
Diffstat (limited to 'apps/website/src/components/icons')
4 files changed, 24 insertions, 4 deletions
diff --git a/apps/website/src/components/icons/Icon.astro b/apps/website/src/components/icons/Icon.astro index b9a9b34..858b605 100644 --- a/apps/website/src/components/icons/Icon.astro +++ b/apps/website/src/components/icons/Icon.astro @@ -1,6 +1,7 @@ --- import type { HTMLAttributes } from 'astro/types'; import { parse } from 'node-html-parser'; +import Test from "./impl/book-open.svg"; type _ModIcons = | 'chatting' @@ -12,21 +13,32 @@ type _ModIcons = | 'polyweather' | 'keystrokes'; export type ModIcons = _ModIcons; // bypass for Astro compiler issue https://github.com/withastro/compiler/issues/554#issuecomment-1741702411 + +type _External = + | 'discord' + | 'github' + | 'youtube' + | 'twitter'; + +export type External = _External; + type _Icons = | 'chevron-down' | 'download' | 'book-open' | 'link-external' + | External | ModIcons; export type Icons = _Icons; // bypass for Astro compiler issue https://github.com/withastro/compiler/issues/554#issuecomment-1741702411 interface Props extends HTMLAttributes<'svg'> { - icon: Icons + icon: Icons, + path?: string, size?: number | [number, number] } -async function getSVG(name: string) { - const file = await import(/* @vite-ignore */ `./impl/${name}.svg?raw`); +async function getSVG(name: string, path = 'impl') { + const file = await import(`./${path}/${name}.svg?raw`); if (!file) throw new Error(`${name} not found`); @@ -49,6 +61,7 @@ async function getSVG(name: string) { const { icon, size, + path = 'impl', ...attributes } = Astro.props as Props; @@ -73,7 +86,7 @@ try { }; }; - const { attributes: baseAttributes, innerHTML } = await getSVG(icon); + const { attributes: baseAttributes, innerHTML } = await getSVG(icon, path); svgAttributes = { ...baseAttributes, ...attributes, diff --git a/apps/website/src/components/icons/impl/discord.svg b/apps/website/src/components/icons/impl/discord.svg new file mode 100644 index 0000000..7fcddad --- /dev/null +++ b/apps/website/src/components/icons/impl/discord.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 127.14 96.36"><path fill="currentColor" d="M107.7,8.07A105.15,105.15,0,0,0,81.47,0a72.06,72.06,0,0,0-3.36,6.83A97.68,97.68,0,0,0,49,6.83,72.37,72.37,0,0,0,45.64,0,105.89,105.89,0,0,0,19.39,8.09C2.79,32.65-1.71,56.6.54,80.21h0A105.73,105.73,0,0,0,32.71,96.36,77.7,77.7,0,0,0,39.6,85.25a68.42,68.42,0,0,1-10.85-5.18c.91-.66,1.8-1.34,2.66-2a75.57,75.57,0,0,0,64.32,0c.87.71,1.76,1.39,2.66,2a68.68,68.68,0,0,1-10.87,5.19,77,77,0,0,0,6.89,11.1A105.25,105.25,0,0,0,126.6,80.22h0C129.24,52.84,122.09,29.11,107.7,8.07ZM42.45,65.69C36.18,65.69,31,60,31,53s5-12.74,11.43-12.74S54,46,53.89,53,48.84,65.69,42.45,65.69Zm42.24,0C78.41,65.69,73.25,60,73.25,53s5-12.74,11.44-12.74S96.23,46,96.12,53,91.08,65.69,84.69,65.69Z"/></svg> diff --git a/apps/website/src/components/icons/impl/github.svg b/apps/website/src/components/icons/impl/github.svg new file mode 100644 index 0000000..cb3681d --- /dev/null +++ b/apps/website/src/components/icons/impl/github.svg @@ -0,0 +1,3 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" viewBox="0 0 16 16"> + <path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.012 8.012 0 0 0 16 8c0-4.42-3.58-8-8-8"/> + </svg> diff --git a/apps/website/src/components/icons/impl/youtube.svg b/apps/website/src/components/icons/impl/youtube.svg new file mode 100644 index 0000000..827dc58 --- /dev/null +++ b/apps/website/src/components/icons/impl/youtube.svg @@ -0,0 +1,3 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" viewBox="0 0 16 16"> + <path d="M8.051 1.999h.089c.822.003 4.987.033 6.11.335a2.01 2.01 0 0 1 1.415 1.42c.101.38.172.883.22 1.402l.01.104.022.26.008.104c.065.914.073 1.77.074 1.957v.075c-.001.194-.01 1.108-.082 2.06l-.008.105-.009.104c-.05.572-.124 1.14-.235 1.558a2.007 2.007 0 0 1-1.415 1.42c-1.16.312-5.569.334-6.18.335h-.142c-.309 0-1.587-.006-2.927-.052l-.17-.006-.087-.004-.171-.007-.171-.007c-1.11-.049-2.167-.128-2.654-.26a2.007 2.007 0 0 1-1.415-1.419c-.111-.417-.185-.986-.235-1.558L.09 9.82l-.008-.104A31.4 31.4 0 0 1 0 7.68v-.123c.002-.215.01-.958.064-1.778l.007-.103.003-.052.008-.104.022-.26.01-.104c.048-.519.119-1.023.22-1.402a2.007 2.007 0 0 1 1.415-1.42c.487-.13 1.544-.21 2.654-.26l.17-.007.172-.006.086-.003.171-.007A99.788 99.788 0 0 1 7.858 2h.193zM6.4 5.209v4.818l4.157-2.408z"/> + </svg> |
