svgl/README.md

181 lines
7.7 KiB
Markdown
Raw Normal View History

2023-03-20 18:43:25 +08:00
<div align="center">
2023-12-18 03:02:44 +08:00
<a href="https://svgl.app">
<img src="static/images/readme.png">
2023-03-15 20:11:21 +08:00
</a>
<p></p>
2023-03-20 18:43:25 +08:00
</div>
2022-03-04 21:34:58 +08:00
2023-03-15 20:11:21 +08:00
<div align="center">
2023-12-17 04:09:20 +08:00
<a href="https://svgl.app" target="_blank">
2023-03-15 20:11:21 +08:00
Discover
</a>
2023-12-17 04:09:20 +08:00
<span>&nbsp;&nbsp;</span>
2024-01-24 19:00:42 +08:00
<a href="https://github.com/pheralb/svgl/issues/new?assignees=pheralb&labels=request&projects=&template=request-svg-.md&title=%5BRequest%5D%3A">
Request logo
</a>
<span>&nbsp;&nbsp;</span>
2023-03-15 20:11:21 +08:00
<a href="#-getting-started">
Submit logo
</a>
2023-12-17 04:09:20 +08:00
<span>&nbsp;&nbsp;</span>
2023-12-28 19:35:45 +08:00
<a href="#-extensions">
Extensions
2023-03-15 20:11:21 +08:00
</a>
<span>&nbsp;&nbsp;</span>
2023-12-28 19:35:45 +08:00
<a href="https://svgl.app/api">
API
2023-03-15 20:11:21 +08:00
</a>
2023-12-17 04:09:20 +08:00
<span>&nbsp;&nbsp;</span>
2023-03-20 18:51:52 +08:00
<a href="#%EF%B8%8F-contributing">
Contributing
</a>
2023-03-15 20:11:21 +08:00
</div>
2022-06-20 22:27:28 +08:00
2023-03-15 20:11:21 +08:00
</p>
2022-01-16 22:40:15 +08:00
2023-03-15 20:11:21 +08:00
<div align="center">
2022-01-16 22:40:15 +08:00
2023-11-14 18:50:52 +08:00
![Svelte Badge](https://img.shields.io/badge/Svelte-FF3E00?logo=svelte&logoColor=fff&style=flat)
2023-03-20 19:28:52 +08:00
[![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fpheralb%2Fsvgl%2Fbadge%3Fref%3Dmain&style=flat)](https://actions-badge.atrox.dev/pheralb/svgl/goto?ref=main)
2023-03-15 20:11:21 +08:00
![GitHub stars](https://img.shields.io/github/stars/pheralb/svgl)
![GitHub issues](https://img.shields.io/github/issues/pheralb/svgl)
![GitHub forks](https://img.shields.io/github/forks/pheralb/svgl)
2023-03-20 19:13:05 +08:00
![GitHub PRs](https://img.shields.io/github/issues-pr/pheralb/svgl)
2023-11-14 18:50:52 +08:00
![Tailwind CSS Badge](https://img.shields.io/badge/Tailwind%20CSS-06B6D4?logo=tailwindcss&logoColor=fff&style=flat)
2023-03-15 20:11:21 +08:00
</div>
## 🛠️ Stack
2023-03-15 21:54:31 +08:00
- [**Sveltekit**](https://kit.svelte.dev/) - Web development, streamlined.
- [**Typescript**](https://www.typescriptlang.org/) - JavaScript with syntax for types.
2023-12-17 09:05:25 +08:00
- [**mdsvex**](https://mdsvex.com/) - Markdown for Svelte apps.
- [**Shiki**](https://github.com/shikijs/shiki) - A beautiful Syntax Highlighter.
2023-03-15 21:54:31 +08:00
- [**Tailwindcss**](https://tailwindcss.com/) - A utility-first CSS framework for rapidly building custom designs.
2023-12-18 05:27:57 +08:00
- [**bits-ui**](https://www.bits-ui.com) - A collection of headless components for Svelte.
2023-12-17 09:05:25 +08:00
- [**clsx**](https://github.com/lukeed/clsx) + [**tailwind-merge**](https://github.com/dcastil/tailwind-merge) inspired by [shadcn/ui](https://ui.shadcn.com) - A tiny utility for constructing `className` strings conditionally.
2023-03-15 21:54:31 +08:00
- [**Prettier**](https://prettier.io/) + [prettier-plugin-tailwindcss](https://github.com/tailwindlabs/prettier-plugin-tailwindcss) - An opinionated code formatter.
2023-12-17 04:09:20 +08:00
- [**Lucide Icons**](https://lucide.dev/) + [**phosphor-svelte**](https://github.com/haruaki07/phosphor-svelte) - A clean and friendly icons libraries.
2023-11-14 18:50:52 +08:00
- [**svelte-sonner**](https://github.com/wobsoriano/svelte-sonner) - An opinionated toast component for Svelte.
2024-04-10 07:58:36 +08:00
- [**@svgr/core**](https://react-svgr.com/) - Node.js utility to transform SVGs into React components.
2023-12-17 21:37:35 +08:00
- [**@upstash/redis** + **@upstash/ratelimit**](https://upstash.com/) - Serverless Redis for developers.
2023-03-15 21:54:31 +08:00
- [**Vitest**](https://vitest.dev/) - Blazing Fast Unit Test Framework.
2023-03-15 20:11:21 +08:00
## 🚀 Getting Started
2023-12-18 09:55:20 +08:00
> [!IMPORTANT]
> Before submitting the SVG, **make sure that you have permission** or that the license of the SVG allows you to add it to svgl. If you are not sure, please contact the company or author.
2023-03-15 20:11:21 +08:00
You will need:
- [Node.js 16+ (recommended 18 LTS)](https://nodejs.org/en/).
- [Git](https://git-scm.com/).
2022-06-27 01:43:23 +08:00
2023-12-17 22:53:11 +08:00
1. [Fork](https://github.com/pheralb/svgl/fork) this repository and clone it locally:
2022-06-27 01:43:23 +08:00
2023-03-15 20:11:21 +08:00
```bash
2023-12-17 22:53:11 +08:00
git clone git@github.com:your_username/svgl.git
2023-03-15 20:11:21 +08:00
```
2023-12-17 04:09:20 +08:00
2. Install dependencies:
2022-06-27 01:43:23 +08:00
```bash
2023-12-17 22:53:11 +08:00
# Install pnpm globally if you don't have it:
npm install -g pnpm
2022-06-27 01:43:23 +08:00
2023-12-17 22:53:11 +08:00
# and install dependencies:
pnpm install
2022-06-27 01:43:23 +08:00
```
2023-12-17 04:09:20 +08:00
3. Go to the [**`static/library`**](https://github.com/pheralb/svgl/blob/main/static/library) folder and add your `.svg` logo.
2022-01-16 22:40:15 +08:00
2023-12-17 02:57:33 +08:00
> [!WARNING]
2023-12-17 09:05:25 +08:00
>
2023-12-17 05:26:26 +08:00
> - Remember to optimize SVG for web, you can use [SVGOMG](https://jakearchibald.github.io/svgomg/).
2023-12-28 01:00:41 +08:00
> - When you optimize the SVG, make sure that the `viewBox` is not removed.
2024-01-02 17:47:30 +08:00
> - The size limit for each .svg is **20kb**.
2023-12-17 02:57:33 +08:00
2023-03-20 08:58:33 +08:00
4. Go to the [**`src/data/svgs.ts`**](https://github.com/pheralb/svgl/blob/main/src/data/svgs.ts) and add the information about your logo, following the structure:
2024-01-24 00:57:34 +08:00
- If the logo is a solid color:
2023-03-15 20:11:21 +08:00
```json
{
"title": "Title",
"category": "Category",
"route": "/library/your_logo.svg",
"url": "Website"
2024-01-24 19:48:25 +08:00
}
```
2024-01-24 00:57:34 +08:00
- If the logo has logo + wordmark version:
```json
{
"title": "Title",
"category": "Category",
"route": "/library/your_logo.svg",
"wordmark": "/library/your_logo_wordmark.svg",
"url": "Website"
2024-01-24 19:48:25 +08:00
}
2024-01-24 19:00:42 +08:00
```
2024-01-24 00:57:34 +08:00
2024-01-24 19:48:25 +08:00
- If the logo/wordmark has light and dark mode:
2024-01-24 19:00:42 +08:00
```json
2024-01-24 00:57:34 +08:00
{
"title": "Title",
"category": "Category",
2024-01-24 19:48:25 +08:00
"route": {
"light": "/library/your_logo_light.svg",
"dark": "/library/your_logo_dark.svg"
},
2024-01-24 00:57:34 +08:00
"wordmark": {
2024-01-24 19:48:25 +08:00
"light": "/library/your_wordmark-logo_light.svg",
"dark": "/library/your_wordmark-logo_dark.svg"
2024-01-24 00:57:34 +08:00
},
"url": "Website"
2024-01-24 19:00:42 +08:00
}
2024-01-24 00:57:34 +08:00
```
2023-12-17 04:09:20 +08:00
> [!NOTE]
2024-01-24 19:48:25 +08:00
>
> - 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.
> - You can add multiple categories to the same logo, for example: `"category": ["Social", "Design"]` (max 3 categories per logo).
2023-12-17 04:09:20 +08:00
2023-03-15 20:11:21 +08:00
And create a pull request with your logo 🚀.
2023-12-28 19:35:45 +08:00
5. (Optional) If you want to run the [API](https://svgl.app/api) locally, you will need to create a `.env` file in the root of the project with the following variables:
2023-12-17 22:53:11 +08:00
- [Create a Upstash account](https://console.upstash.com/).
2023-12-28 19:35:45 +08:00
- [Create a Upstash Redis Database](https://upstash.com/docs/redis/overall/getstarted).
2023-12-17 22:53:11 +08:00
```bash
SVGL_API_REQUESTS = 1
UPSTASH_REDIS_URL = ""
UPSTASH_REDIS_TOKEN = ""
```
2023-12-28 19:35:45 +08:00
## 📦 Extensions
2023-12-17 21:37:35 +08:00
2023-12-28 19:35:45 +08:00
A list of extensions that use the [svgl API](https://svgl.app/api), created by the community:
2024-04-13 21:21:50 +08:00
| | Extension | Description | Created by | Link |
| ---------------------------------------------------------------------------------------------- | ---------------- | -------------------------------------------------- | ------------------------------------------ | ------------------------------------------------------------------------------------------- |
| <img src="https://github.com/pheralb/svgl/blob/main/static/library/svgl.svg" height="25" /> | svgls | A CLI for easily adding SVG icons to your project. | [sujjeee](https://twitter.com/sujjeeee) | [Github Repository](https://github.com/sujjeee/svgls) |
| <img src="https://github.com/pheralb/svgl/blob/main/static/library/figma.svg" height="25" /> | SVGL for Figma | Add svgs from svgl to your Figma project. | [quilljou](https://twitter.com/quillzhou) | [Figma Plugin](https://www.figma.com/community/plugin/1320306989350693206/svgl) |
| <img src="https://github.com/pheralb/svgl/blob/main/static/library/raycast.svg" height="25" /> | SVGL for Raycast | Search SVG logos via svgl. | [1weiho](https://twitter.com/1weiho) | [Raycast Store](https://www.raycast.com/1weiho/svgl) |
| <img src="https://github.com/pheralb/svgl/blob/main/static/library/vscode.svg" height="25" /> | SVGL for VSCode | SVGL directly in your VSCode. | [girlazote](https://twitter.com/girlazote) | [VSCode Marketplace](https://marketplace.visualstudio.com/items?itemName=EsteveSegura.svgl) |
2023-12-17 21:37:35 +08:00
2023-03-20 08:58:33 +08:00
## ✌️ Contributing
<a href="https://github.com/pheralb/svgl/graphs/contributors">
<img src="https://contrib.rocks/image?repo=pheralb/svgl" />
</a>
<p></p>
## 🔑 License
2022-01-16 22:40:15 +08:00
2023-03-15 20:11:21 +08:00
- [MIT](https://github.com/pheralb/svgl/blob/main/LICENSE).