🎨 Improve download button styles and add brand assets link in SVG card

This commit is contained in:
pheralb
2025-08-29 00:15:25 +01:00
parent 6ac5318436
commit c1f1b123e8
2 changed files with 42 additions and 18 deletions
+8 -1
View File
@@ -85,6 +85,7 @@
title="Download Light & Dark variants" title="Download Light & Dark variants"
variant="ghost" variant="ghost"
size="icon" size="icon"
class="hover:bg-neutral-200"
onclick={() => { onclick={() => {
if (typeof svgInfo.route === "string") { if (typeof svgInfo.route === "string") {
handleDownloadSvg(svgInfo.route); handleDownloadSvg(svgInfo.route);
@@ -98,7 +99,13 @@
<Dialog.Root> <Dialog.Root>
<Dialog.Trigger <Dialog.Trigger
title="Download SVG" title="Download SVG"
class={cn(buttonVariants({ variant: "ghost", size: "icon" }))} class={cn(
buttonVariants({
size: "icon",
variant: "ghost",
class: "hover:bg-neutral-200",
}),
)}
> >
<DownloadIcon size={iconSize} strokeWidth={iconStroke} /> <DownloadIcon size={iconSize} strokeWidth={iconStroke} />
</Dialog.Trigger> </Dialog.Trigger>
+34 -17
View File
@@ -49,7 +49,21 @@
)} )}
> >
<!-- Image Options --> <!-- Image Options -->
<div class="flex w-full items-center justify-end space-x-0.5"> <div class="flex w-full items-center justify-end space-x-3">
{#if svgInfo.brandUrl !== undefined}
<a
href={svgInfo.brandUrl}
title="Brand Assets"
target="_blank"
rel="noopener noreferrer"
class={cn(
"cursor-pointer transition-colors",
"text-neutral-500 hover:text-black dark:text-neutral-400 dark:hover:text-white",
)}
>
<PaletteIcon size={iconSize} strokeWidth={iconStroke} />
</a>
{/if}
<AddToFavorite svg={svgInfo} /> <AddToFavorite svg={svgInfo} />
</div> </div>
<!-- Image --> <!-- Image -->
@@ -104,7 +118,10 @@
{#each svgInfo.category.slice(0, maxVisibleCategories) as c, index} {#each svgInfo.category.slice(0, maxVisibleCategories) as c, index}
<a <a
href={`/directory/${c.toLowerCase()}`} href={`/directory/${c.toLowerCase()}`}
class={badgeVariants({ variant: "outline", class: "font-mono" })} class={badgeVariants({
variant: "outline",
class: "cursor-pointer font-mono",
})}
title={`This icon is part of the ${svgInfo.category} category`} title={`This icon is part of the ${svgInfo.category} category`}
> >
{c} {c}
@@ -117,7 +134,10 @@
onOpenChange={(isOpen) => (moreTagsOptions = isOpen)} onOpenChange={(isOpen) => (moreTagsOptions = isOpen)}
> >
<Popover.Trigger <Popover.Trigger
class={badgeVariants({ variant: "outline", class: "font-mono" })} class={badgeVariants({
variant: "outline",
class: "cursor-pointer font-mono",
})}
title="More Tags" title="More Tags"
> >
{#if moreTagsOptions} {#if moreTagsOptions}
@@ -126,7 +146,7 @@
<EllipsisIcon size={15} strokeWidth={1.5} /> <EllipsisIcon size={15} strokeWidth={1.5} />
{/if} {/if}
</Popover.Trigger> </Popover.Trigger>
<Popover.Content class="flex flex-col space-y-2"> <Popover.Content class="flex w-auto flex-col space-y-2">
<p class="font-medium">More tags:</p> <p class="font-medium">More tags:</p>
{#each svgInfo.category.slice(maxVisibleCategories) as c} {#each svgInfo.category.slice(maxVisibleCategories) as c}
<a <a
@@ -143,7 +163,10 @@
{:else} {:else}
<a <a
href={`/directory/${svgInfo.category.toLowerCase()}`} href={`/directory/${svgInfo.category.toLowerCase()}`}
class={badgeVariants({ variant: "outline", class: "font-mono" })} class={badgeVariants({
variant: "outline",
class: "cursor-pointer font-mono",
})}
> >
{svgInfo.category} {svgInfo.category}
</a> </a>
@@ -183,7 +206,11 @@
title="Website" title="Website"
target="_blank" target="_blank"
rel="noopener noreferrer" rel="noopener noreferrer"
class={buttonVariants({ variant: "ghost" })} class={buttonVariants({
size: "icon",
variant: "ghost",
class: "hover:bg-neutral-200",
})}
> >
<LinkIcon size={iconSize} strokeWidth={iconStroke} /> <LinkIcon size={iconSize} strokeWidth={iconStroke} />
</a> </a>
@@ -195,6 +222,7 @@
}} }}
variant="ghost" variant="ghost"
size="icon" size="icon"
class="hover:bg-neutral-200"
> >
{#if wordmarkSvg} {#if wordmarkSvg}
<SparklesIcon size={iconSize} strokeWidth={iconStroke} /> <SparklesIcon size={iconSize} strokeWidth={iconStroke} />
@@ -203,16 +231,5 @@
{/if} {/if}
</Button> </Button>
{/if} {/if}
{#if svgInfo.brandUrl !== undefined}
<a
href={svgInfo.brandUrl}
title="Brand Assets"
target="_blank"
rel="noopener noreferrer"
class={buttonVariants({ variant: "ghost" })}
>
<PaletteIcon size={iconSize} strokeWidth={iconStroke} />
</a>
{/if}
</div> </div>
</div> </div>