aboutsummaryrefslogtreecommitdiff
path: root/apps/website/src/components/page
diff options
context:
space:
mode:
authorWyvest <wyvestbusiness@gmail.com>2024-01-20 11:29:57 -0500
committerGitHub <noreply@github.com>2024-01-20 11:29:57 -0500
commit0afab2cd1b1266034d35cd66f41c3bde90847f9e (patch)
tree54172a78823cf76761ab88e21d6d2c64d5b965c3 /apps/website/src/components/page
parent55b593c4e6b90137995aee9a55ba2a86423cc7bd (diff)
parent55548a94b61ce7d1ca0ca8da69db7566f937cfeb (diff)
downloadNexus-0afab2cd1b1266034d35cd66f41c3bde90847f9e.tar.gz
Nexus-0afab2cd1b1266034d35cd66f41c3bde90847f9e.tar.bz2
Nexus-0afab2cd1b1266034d35cd66f41c3bde90847f9e.zip
Merge pull request #4 from Polyfrost/website/icon-fix
Diffstat (limited to 'apps/website/src/components/page')
-rw-r--r--apps/website/src/components/page/branding/BrandingImage.astro33
1 files changed, 33 insertions, 0 deletions
diff --git a/apps/website/src/components/page/branding/BrandingImage.astro b/apps/website/src/components/page/branding/BrandingImage.astro
new file mode 100644
index 0000000..e112691
--- /dev/null
+++ b/apps/website/src/components/page/branding/BrandingImage.astro
@@ -0,0 +1,33 @@
+---
+interface Props {
+ type: 'badges' | 'logos' | 'mods'
+ name: string
+ nameFormatted?: string
+ altText?: string
+ extensions?: ('png' | 'svg')[]
+ maxWidth?: number
+ background?: string
+}
+
+const {
+ name,
+ type,
+ altText,
+ nameFormatted,
+ background = 'white',
+ maxWidth = 300,
+ extensions = ['png', 'svg'],
+} = Astro.props;
+
+const path = `/media/branding/${type}/${name}`;
+---
+
+<div class={`relative rounded-md bg-${background} border border-1 border-gray-400 flex flex-col justify-center items-center p-8`}>
+ <div class="absolute top-0 right-0 flex flex-row gap-x-2">
+ {extensions.map(ext => (
+ <a target="_blank" class="text-xs px-0.5 hover:underline" href={`${path}.${ext}`}>.{ext.toUpperCase()}</a>
+ ))}
+ </div>
+ <img style={`max-width: ${maxWidth}px;`} src={`${path}.svg`} alt={altText}>
+ {nameFormatted && <span class="absolute bottom-0 left-1/2 -translate-x-1/2 opacity-50 text-xxs">{nameFormatted}</span>}
+</div>