mirror of
https://github.com/pheralb/svgl.git
synced 2025-02-05 22:48:17 +08:00
commit
1884b2cd6b
16
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
16
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
## 📝 About your SVG:
|
||||||
|
|
||||||
|
- **Title**:
|
||||||
|
- **Category**:
|
||||||
|
- **Website URL**:
|
||||||
|
- **Description**:
|
||||||
|
|
||||||
|
## 📷 Screenshots:
|
||||||
|
|
||||||
|
✨ Add screenshots of the logo.
|
||||||
|
|
||||||
|
## ✅ Checklist
|
||||||
|
|
||||||
|
- [ ] I have permission to use this logo.
|
||||||
|
- [ ] The .svg URL I have provided is optimized for web use.
|
||||||
|
- [ ] The .svg size is less than **20kb**.
|
15
README.md
15
README.md
@ -10,7 +10,7 @@
|
|||||||
Discover
|
Discover
|
||||||
</a>
|
</a>
|
||||||
<span> ✦ </span>
|
<span> ✦ </span>
|
||||||
<a href="https://github.com/pheralb/svgl/issues/new?assignees=pheralb&labels=request&projects=&template=request-svg-.md&title=%5BRequest%5D%3A">
|
<a href="https://github.com/pheralb/svgl/issues/new?assignees=&labels=request&projects=&template=request-svg.yml&title=%5B%F0%9F%94%94+Request+SVG%5D%3A+">
|
||||||
Request logo
|
Request logo
|
||||||
</a>
|
</a>
|
||||||
<span> ✦ </span>
|
<span> ✦ </span>
|
||||||
@ -138,6 +138,19 @@ pnpm install
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
- **Add brand guidelines**:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"title": "Title",
|
||||||
|
"category": "Category",
|
||||||
|
"route": "/library/your_logo.svg",
|
||||||
|
"wordmark": "/library/your_logo_wordmark.svg",
|
||||||
|
"brandUrl": "https://assets.website.com/brand-guidelines",
|
||||||
|
"url": "Website"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
> [!NOTE]
|
> [!NOTE]
|
||||||
>
|
>
|
||||||
> - 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.
|
> - 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.
|
||||||
|
@ -72,3 +72,12 @@
|
|||||||
src: url('/fonts/GeistMonoVariableVF.woff2') format('woff2');
|
src: url('/fonts/GeistMonoVariableVF.woff2') format('woff2');
|
||||||
font-display: swap;
|
font-display: swap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
html.dark .shiki,
|
||||||
|
html.dark .shiki span {
|
||||||
|
color: var(--shiki-dark) !important;
|
||||||
|
background-color: transparent !important;
|
||||||
|
font-style: var(--shiki-dark-font-style) !important;
|
||||||
|
font-weight: var(--shiki-dark-font-weight) !important;
|
||||||
|
text-decoration: var(--shiki-dark-text-decoration) !important;
|
||||||
|
}
|
||||||
|
@ -309,5 +309,13 @@
|
|||||||
</section>
|
</section>
|
||||||
</Tabs.Content>
|
</Tabs.Content>
|
||||||
</Tabs.Root>
|
</Tabs.Root>
|
||||||
|
<div
|
||||||
|
class="mt-1 flex w-full items-center text-center text-[12px] text-neutral-600 dark:text-neutral-400"
|
||||||
|
>
|
||||||
|
<p>
|
||||||
|
Remember to request permission from the creators for the use of the SVG. Modification is not
|
||||||
|
allowed.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
</Popover.Content>
|
</Popover.Content>
|
||||||
</Popover.Root>
|
</Popover.Root>
|
||||||
|
@ -13,7 +13,8 @@
|
|||||||
Sparkles,
|
Sparkles,
|
||||||
EllipsisIcon,
|
EllipsisIcon,
|
||||||
TagIcon,
|
TagIcon,
|
||||||
XIcon
|
XIcon,
|
||||||
|
PaletteIcon
|
||||||
} from 'lucide-svelte';
|
} from 'lucide-svelte';
|
||||||
|
|
||||||
// Components & styles:
|
// Components & styles:
|
||||||
@ -57,8 +58,10 @@
|
|||||||
let maxVisibleCategories = 1;
|
let maxVisibleCategories = 1;
|
||||||
let moreTagsOptions = false;
|
let moreTagsOptions = false;
|
||||||
|
|
||||||
// Global Images Styles:
|
// Global Styles:
|
||||||
const globalImageStyles = 'mb-4 mt-2 h-10 select-none pointer-events-none';
|
const globalImageStyles = 'mb-4 mt-2 h-10 select-none pointer-events-none';
|
||||||
|
const btnStyles =
|
||||||
|
'flex items-center space-x-2 rounded-md p-2 duration-100 hover:bg-neutral-200 dark:hover:bg-neutral-700/40';
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
@ -175,7 +178,7 @@
|
|||||||
: svgInfo.route
|
: svgInfo.route
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
class="flex items-center space-x-2 rounded-md p-2 duration-100 hover:bg-neutral-200 dark:hover:bg-neutral-700/40"
|
class={btnStyles}
|
||||||
>
|
>
|
||||||
<ChevronsRight size={iconSize} strokeWidth={iconStroke} />
|
<ChevronsRight size={iconSize} strokeWidth={iconStroke} />
|
||||||
</button>
|
</button>
|
||||||
@ -200,7 +203,7 @@
|
|||||||
title="Website"
|
title="Website"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noopener noreferrer"
|
rel="noopener noreferrer"
|
||||||
class="flex items-center space-x-2 rounded-md p-2 duration-100 hover:bg-neutral-200 dark:hover:bg-neutral-700/40"
|
class={btnStyles}
|
||||||
>
|
>
|
||||||
<LinkIcon size={iconSize} strokeWidth={iconStroke} />
|
<LinkIcon size={iconSize} strokeWidth={iconStroke} />
|
||||||
</a>
|
</a>
|
||||||
@ -210,7 +213,7 @@
|
|||||||
on:click={() => {
|
on:click={() => {
|
||||||
wordmarkSvg = !wordmarkSvg;
|
wordmarkSvg = !wordmarkSvg;
|
||||||
}}
|
}}
|
||||||
class="flex items-center space-x-2 rounded-md p-2 duration-100 hover:bg-neutral-200 dark:hover:bg-neutral-700/40"
|
class={btnStyles}
|
||||||
>
|
>
|
||||||
{#if wordmarkSvg}
|
{#if wordmarkSvg}
|
||||||
<Sparkles size={iconSize} strokeWidth={iconStroke} />
|
<Sparkles size={iconSize} strokeWidth={iconStroke} />
|
||||||
@ -219,5 +222,16 @@
|
|||||||
{/if}
|
{/if}
|
||||||
</button>
|
</button>
|
||||||
{/if}
|
{/if}
|
||||||
|
{#if svgInfo.brandUrl !== undefined}
|
||||||
|
<a
|
||||||
|
href={svgInfo.brandUrl}
|
||||||
|
title="Brand Assets"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
class={btnStyles}
|
||||||
|
>
|
||||||
|
<PaletteIcon size={iconSize} strokeWidth={iconStroke} />
|
||||||
|
</a>
|
||||||
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -5,28 +5,28 @@
|
|||||||
import { cn } from '@/utils/cn';
|
import { cn } from '@/utils/cn';
|
||||||
|
|
||||||
let warning = false;
|
let warning = false;
|
||||||
let warningName = 'svgl_warning_message';
|
let warningName = 'svgl_warn_message';
|
||||||
const initialValue = browser ? window.localStorage.getItem(warningName) : true;
|
const initialValue = browser ? window.localStorage.getItem(warningName) : true;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if !warning && !initialValue}
|
{#if !warning && !initialValue}
|
||||||
<div
|
<div
|
||||||
class="flex items-center w-full justify-between md:flex-row flex-col md:space-x-2 space-x-0 space-y-2 md:space-y-0 py-2 px-3 bg-neutral-100/60 dark:bg-neutral-800/40 text-neutral-700 dark:text-neutral-300 border-b border-neutral-200 dark:border-neutral-800"
|
class="flex w-full flex-col items-center justify-between space-x-0 space-y-2 border-b border-neutral-200 bg-neutral-100/60 px-3 py-2 text-neutral-700 dark:border-neutral-800 dark:bg-neutral-800/40 dark:text-neutral-300 md:flex-row md:space-x-2 md:space-y-0"
|
||||||
>
|
>
|
||||||
<div class="flex items-center space-x-2">
|
<div class="flex items-center space-x-2">
|
||||||
<AlertTriangleIcon
|
<AlertTriangleIcon
|
||||||
size={18}
|
size={18}
|
||||||
strokeWidth={2}
|
strokeWidth={2}
|
||||||
class="mr-1 flex-shrink-0 text-yellow-600 dark:text-yellow-500 animate-pulse"
|
class="mr-1 flex-shrink-0 animate-pulse text-yellow-600 dark:text-yellow-500"
|
||||||
/>
|
/>
|
||||||
<p>
|
<p>
|
||||||
All SVGs include links to the respective products or companies that own them. <strong
|
All SVGs include links to the respective products or companies that own them. <strong
|
||||||
>Please contact the owner directly if you intend to use their logo.</strong
|
>Please contact the owner directly if you need to use their logo.</strong
|
||||||
>
|
>
|
||||||
If you are the owner of an SVG and prefer it not to be displayed here,
|
If you are the owner of an SVG and would like it removed,
|
||||||
<a
|
<a
|
||||||
target="_blank"
|
target="_blank"
|
||||||
class="underline underline-offset-4 decoration-dotted decoration-neutral-500"
|
class="underline decoration-neutral-500 decoration-dotted underline-offset-4"
|
||||||
href="https://github.com/pheralb/svgl/issues/new">create an issue</a
|
href="https://github.com/pheralb/svgl/issues/new">create an issue</a
|
||||||
> on GitHub.
|
> on GitHub.
|
||||||
</p>
|
</p>
|
||||||
|
@ -2667,6 +2667,7 @@ export const svgs: iSVG[] = [
|
|||||||
light: '/library/vercel_wordmark.svg',
|
light: '/library/vercel_wordmark.svg',
|
||||||
dark: '/library/vercel_wordmark_dark.svg'
|
dark: '/library/vercel_wordmark_dark.svg'
|
||||||
},
|
},
|
||||||
|
brandUrl: 'https://vercel.com/geist/brands',
|
||||||
url: 'https://vercel.com/'
|
url: 'https://vercel.com/'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -39,17 +39,18 @@ export interface Category {
|
|||||||
- For SVGs:
|
- For SVGs:
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
type ThemeOptions = {
|
export type ThemeOptions = {
|
||||||
light: string;
|
|
||||||
dark: string;
|
dark: string;
|
||||||
|
light: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface iSVG {
|
export interface iSVG {
|
||||||
id: number;
|
id?: number;
|
||||||
title: string;
|
title: string;
|
||||||
category: string | string[];
|
category: tCategory | tCategory[];
|
||||||
route: string | ThemeOptions;
|
route: string | ThemeOptions;
|
||||||
wordmark?: string | ThemeOptions;
|
wordmark?: string | ThemeOptions;
|
||||||
|
brandUrl?: string;
|
||||||
url: string;
|
url: string;
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
@ -42,7 +42,7 @@
|
|||||||
'prose dark:prose-invert',
|
'prose dark:prose-invert',
|
||||||
'mx-auto max-w-3xl px-4 py-10',
|
'mx-auto max-w-3xl px-4 py-10',
|
||||||
'prose-h2:font-medium prose-h2:tracking-tight prose-h2:underline prose-h2:decoration-neutral-300 prose-h2:underline-offset-[6px] prose-h2:transition-opacity hover:prose-h2:opacity-70 dark:prose-h2:decoration-neutral-700/65',
|
'prose-h2:font-medium prose-h2:tracking-tight prose-h2:underline prose-h2:decoration-neutral-300 prose-h2:underline-offset-[6px] prose-h2:transition-opacity hover:prose-h2:opacity-70 dark:prose-h2:decoration-neutral-700/65',
|
||||||
'prose-pre:m-0 prose-pre:border-neutral-200 dark:prose-pre:border dark:prose-pre:border-neutral-800/65'
|
'prose-pre:m-0 prose-pre:border prose-pre:border-neutral-200 dark:prose-pre:border dark:prose-pre:border-neutral-800/65'
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<svelte:component this={data.content} />
|
<svelte:component this={data.content} />
|
||||||
|
@ -11,5 +11,6 @@ export interface iSVG {
|
|||||||
category: tCategory | tCategory[];
|
category: tCategory | tCategory[];
|
||||||
route: string | ThemeOptions;
|
route: string | ThemeOptions;
|
||||||
wordmark?: string | ThemeOptions;
|
wordmark?: string | ThemeOptions;
|
||||||
|
brandUrl?: string;
|
||||||
url: string;
|
url: string;
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
{sideOffset}
|
{sideOffset}
|
||||||
{...$$restProps}
|
{...$$restProps}
|
||||||
class={cn(
|
class={cn(
|
||||||
'z-50 w-auto rounded-md border border-neutral-200 bg-white p-3 shadow-md outline-none dark:border-neutral-800 dark:bg-neutral-900',
|
'z-50 w-auto max-w-96 rounded-md border border-neutral-200 bg-white p-3 shadow-md outline-none dark:border-neutral-800 dark:bg-neutral-900',
|
||||||
className
|
className
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
|
@ -36,11 +36,19 @@ const mdsvexOptions = {
|
|||||||
highlight: {
|
highlight: {
|
||||||
highlighter: async (code, lang = 'text') => {
|
highlighter: async (code, lang = 'text') => {
|
||||||
const highlighter = await getHighlighter({
|
const highlighter = await getHighlighter({
|
||||||
themes: ['vesper'],
|
themes: ['github-light', 'github-dark'],
|
||||||
langs: ['javascript', 'typescript', 'bash', 'json']
|
langs: ['javascript', 'typescript', 'bash', 'json']
|
||||||
});
|
});
|
||||||
await highlighter.loadLanguage('javascript', 'typescript', 'bash');
|
await highlighter.loadLanguage('javascript', 'typescript', 'bash');
|
||||||
const html = escapeSvelte(highlighter.codeToHtml(code, { lang, theme: 'vesper' }));
|
const html = escapeSvelte(
|
||||||
|
highlighter.codeToHtml(code, {
|
||||||
|
lang,
|
||||||
|
themes: {
|
||||||
|
light: 'github-light',
|
||||||
|
dark: 'github-dark'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
);
|
||||||
return `{@html \`${html}\` }`;
|
return `{@html \`${html}\` }`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user