Skip to content

Commit f19a2ae

Browse files
committed
✨ Prepare Loftlyy integration + add README section
1 parent d28c670 commit f19a2ae

File tree

4 files changed

+68
-12
lines changed

4 files changed

+68
-12
lines changed

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,21 @@ pnpm install
204204
}
205205
```
206206

207+
- **Add Loftlyy brand URL**:
208+
209+
[Loftlyy](https://www.loftlyy.com) is a brand identity reference site — discover and explore brand colors, typography, logos, and design systems. Created by [preetsuthar17](https://x.com/preetsuthar17).
210+
211+
```ts
212+
{
213+
title: 'Title',
214+
category: 'Category',
215+
route: '/library/your_logo.svg',
216+
wordmark: '/library/your_logo_wordmark.svg',
217+
loftlyyUrl: 'https://www.loftlyy.com/en/brand-name',
218+
url: 'Website'
219+
}
220+
```
221+
207222
> [!NOTE]
208223
>
209224
> - The list of categories is here: [`src/types/categories.ts`](https://github.com/pheralb/svgl/blob/main/src/types/categories.ts). You can add a new category if you need it.

src/components/svgs/svgCard.svelte

Lines changed: 51 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@
1313
import SparklesIcon from "@lucide/svelte/icons/sparkles";
1414
import BaselineIcon from "@lucide/svelte/icons/baseline";
1515
import EllipsisIcon from "@lucide/svelte/icons/ellipsis";
16+
import SwatchBookIcon from "@lucide/svelte/icons/swatch-book";
1617
1718
// UI Components:
1819
import * as Popover from "@/components/ui/popover";
20+
import * as DropdownMenu from "@/components/ui/dropdown-menu";
1921
import { badgeVariants } from "@/components/ui/badge";
2022
import { Button, buttonVariants } from "@/components/ui/button";
2123
import InternalLink from "@/components/ui/links/internal-link.svelte";
@@ -25,6 +27,8 @@
2527
import CopySvg from "@/components/svgs/copySvg.svelte";
2628
import DownloadSvg from "@/components/svgs/downloadSvg.svelte";
2729
import AddToFavorite from "@/components/svgs/addToFavorite.svelte";
30+
import ArrowUpRight from "@lucide/svelte/icons/arrow-up-right";
31+
import Flower from "@lucide/svelte/icons/flower";
2832
2933
// Props:
3034
interface Props {
@@ -36,6 +40,7 @@
3640
// States:
3741
let wordmarkSvg = $state<boolean>(false);
3842
let moreTagsOptions = $state<boolean>(false);
43+
let brandResourcesOpen = $state<boolean>(false);
3944
4045
// Icon Stroke & Size:
4146
let iconStroke = 1.8;
@@ -55,19 +60,53 @@
5560
>
5661
<!-- Image Options -->
5762
<div class="flex w-full items-center justify-end space-x-3 pb-0.5">
58-
{#if svgInfo.brandUrl !== undefined}
59-
<a
60-
href={svgInfo.brandUrl}
61-
title="Brand Assets"
62-
target="_blank"
63-
rel="noopener noreferrer"
64-
class={cn(
65-
"cursor-pointer transition-colors",
66-
"text-neutral-500 hover:text-black dark:text-neutral-400 dark:hover:text-white",
67-
)}
63+
{#if svgInfo.brandUrl !== undefined || svgInfo.loftlyyUrl !== undefined}
64+
<DropdownMenu.Root
65+
open={brandResourcesOpen}
66+
onOpenChange={(isOpen) => (brandResourcesOpen = isOpen)}
6867
>
69-
<PaletteIcon size={iconSize} strokeWidth={iconStroke} />
70-
</a>
68+
<DropdownMenu.Trigger
69+
title="Brand Resources"
70+
class={cn(
71+
"cursor-pointer transition-colors",
72+
"text-neutral-500 hover:text-black dark:text-neutral-400 dark:hover:text-white",
73+
)}
74+
>
75+
{#if brandResourcesOpen}
76+
<XIcon size={iconSize} strokeWidth={iconStroke} />
77+
{:else}
78+
<SwatchBookIcon size={iconSize} strokeWidth={iconStroke} />
79+
{/if}
80+
</DropdownMenu.Trigger>
81+
<DropdownMenu.Content align="start">
82+
{#if svgInfo.brandUrl !== undefined}
83+
<DropdownMenu.Item>
84+
<ExternalLink
85+
href={svgInfo.brandUrl}
86+
title="Brand Assets"
87+
className="flex w-full items-center gap-2"
88+
>
89+
<PaletteIcon size={14} strokeWidth={iconStroke} />
90+
<span>Brand Assets</span>
91+
<ArrowUpRight size={12} class="ml-auto opacity-50" />
92+
</ExternalLink>
93+
</DropdownMenu.Item>
94+
{/if}
95+
{#if svgInfo.loftlyyUrl !== undefined}
96+
<DropdownMenu.Item>
97+
<ExternalLink
98+
href={svgInfo.loftlyyUrl}
99+
title="Loftlyy"
100+
className="flex w-full items-center gap-2"
101+
>
102+
<Flower size={14} strokeWidth={iconStroke} />
103+
<span>Loftlyy</span>
104+
<ArrowUpRight size={12} class="ml-auto opacity-50" />
105+
</ExternalLink>
106+
</DropdownMenu.Item>
107+
{/if}
108+
</DropdownMenu.Content>
109+
</DropdownMenu.Root>
71110
{/if}
72111
<AddToFavorite svg={svgInfo} />
73112
</div>

src/data/svgs.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4204,6 +4204,7 @@ export const svgs: iSVG[] = [
42044204
title: "Cursor",
42054205
category: ["Software"],
42064206
brandUrl: "https://cursor.com/brand",
4207+
loftlyyUrl: "https://www.loftlyy.com/en/cursor",
42074208
route: {
42084209
light: "/library/cursor_light.svg",
42094210
dark: "/library/cursor_dark.svg",

src/types/svg.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export interface iSVG {
1212
route: string | ThemeOptions;
1313
wordmark?: string | ThemeOptions;
1414
brandUrl?: string;
15+
loftlyyUrl?: string;
1516
shadcnCommand?: string;
1617
url: string;
1718
}

0 commit comments

Comments
 (0)