Skip to content

Commit d1c5da8

Browse files
authored
Merge pull request #15 from pphatdev/feat/icons
Contributing to Add or Update Icons
2 parents a0097c2 + e6e7465 commit d1c5da8

File tree

2 files changed

+90
-19
lines changed

2 files changed

+90
-19
lines changed

CONTRIBUTING.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,49 @@ To add a new theme:
4242
2. Test the theme with `?theme=yourtheme`
4343
3. Submit a PR with a screenshot
4444

45+
### Adding or Updating Icons
46+
47+
To add a new icon or update an existing one in `public/assets/icons/`:
48+
49+
1. **Format Requirements**:
50+
- SVG format only
51+
- Width and height: `48x48`
52+
- Use consistent margins via viewBox (typically 8-12px)
53+
- Example: `viewBox="-10 -10 44 44"` for 10px margin
54+
55+
2. **Animation**:
56+
Add the popup animation style:
57+
```xml
58+
<style>
59+
@keyframes popup {
60+
0% {
61+
opacity: 0;
62+
transform: scale(0);
63+
}
64+
100% {
65+
opacity: 1;
66+
transform: scale(1);
67+
}
68+
}
69+
#iconname-logo {
70+
animation: popup 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
71+
}
72+
</style>
73+
```
74+
75+
3. **Structure**:
76+
- Wrap paths in a `<g>` element with unique id: `<g id="iconname-logo">`
77+
- Use `fill="currentColor"` for main paths to support theming
78+
- Include optional `<title>` tag for accessibility
79+
80+
4. **File Naming**:
81+
- Use lowercase with hyphens: `icon-name.svg`
82+
- Match the technology/framework name
83+
84+
5. **Testing**:
85+
- Verify the icon displays correctly in the icons gallery
86+
- Test with different themes to ensure colors work properly
87+
4588
## Development Setup
4689

4790
```bash

docs/example/icons.md

Lines changed: 47 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,52 @@
11
# GET /icons and /icons/:name
22

3+
List available SVG icons or fetch a single icon.
34

4-
![icon-react](https://stats.pphat.top/icons/react?color=%230088CC&glow=true&glowColor=%2300FF)
5-
![icon-python](https://stats.pphat.top/icons/python?color=%234584B6&glow=true&glowColor=%2300FF)
6-
![icon-typescript](https://stats.pphat.top/icons/typescript?color=%230088CC&glow=true&glowColor=%2300FF)
7-
![icon-javascript](https://stats.pphat.top/icons/javascript?color=%23FFDE57&glow=true&glowColor=%2300FF)
8-
![icon-html](https://stats.pphat.top/icons/html?color=%23E34F26&glow=true&glowColor=%2300FF)
9-
![icon-css](https://stats.pphat.top/icons/css?color=%231572B6&glow=true&glowColor=%2300FF)
10-
![icon-nodedotjs](https://stats.pphat.top/icons/nodedotjs?color=%23339933&glow=true&glowColor=%2300FF)
11-
![icon-nextjs](https://stats.pphat.top/icons/nextjs?color=white&glow=true&glowColor=%2300FF)
12-
![icon-nuxt](https://stats.pphat.top/icons/nuxt?color=%2300C58E&glow=true&glowColor=%2300FF)
13-
![icon-postgresql](https://stats.pphat.top/icons/postgresql?color=%230088CC&glow=true&glowColor=%2300FF)
14-
![icon-mysql](https://stats.pphat.top/icons/mysql?color=%230088CC&glow=true&glowColor=%2300FF)
15-
![icon-tailwindcss](https://stats.pphat.top/icons/tailwindcss?color=%2338B2AC&glow=true&glowColor=%2300FF)
16-
![icon-markdown](https://stats.pphat.top/icons/markdown?color=orange&glow=true&glowColor=%2300FF)
17-
![icon-laravel](https://stats.pphat.top/icons/laravel?color=%23FF2D20&glow=true&glowColor=%2300FF)
18-
![icon-php](https://stats.pphat.top/icons/php?color=%23777BB4&glow=true&glowColor=%2300FF)
19-
![icon-cplusplus](https://stats.pphat.top/icons/cplusplus?color=%2300AACC&glow=true&glowColor=%2300FF)
20-
![icon-fastapi](https://stats.pphat.top/icons/fastapi?color=white&glow=true&glowColor=%2300FF)
21-
![icon-hugo](https://stats.pphat.top/icons/hugo?color=white&glow=true&glowColor=%2300FF)
5+
## Sample Icons
6+
7+
**Normal Icon**
8+
9+
![icon-react](https://stats.pphat.top/icons/react?color=%230088CC)
10+
![icon-python](https://stats.pphat.top/icons/python?color=%234584B6)
11+
![icon-typescript](https://stats.pphat.top/icons/typescript?color=%230088CC)
12+
![icon-javascript](https://stats.pphat.top/icons/javascript?color=%23FFDE57)
13+
![icon-html](https://stats.pphat.top/icons/html?color=%23E34F26)
14+
![icon-css](https://stats.pphat.top/icons/css?color=%231572B6)
15+
![icon-nodedotjs](https://stats.pphat.top/icons/nodedotjs?color=%23339933)
16+
![icon-nextjs](https://stats.pphat.top/icons/nextjs?color=white)
17+
![icon-nuxt](https://stats.pphat.top/icons/nuxt?color=%2300C58E)
18+
![icon-postgresql](https://stats.pphat.top/icons/postgresql?color=%230088CC)
19+
![icon-mysql](https://stats.pphat.top/icons/mysql?color=%230088CC)
20+
![icon-tailwindcss](https://stats.pphat.top/icons/tailwindcss?color=%2338B2AC)
21+
![icon-markdown](https://stats.pphat.top/icons/markdown?color=orange)
22+
![icon-laravel](https://stats.pphat.top/icons/laravel?color=%23FF2D20)
23+
![icon-php](https://stats.pphat.top/icons/php?color=%23777BB4)
24+
![icon-cplusplus](https://stats.pphat.top/icons/cplusplus?color=%2300AACC)
25+
![icon-csharp](https://stats.pphat.top/icons/csharp?color=%2300AACC)
26+
![icon-fastapi](https://stats.pphat.top/icons/fastapi?color=white)
27+
![icon-hugo](https://stats.pphat.top/icons/hugo?color=white)
28+
29+
**Glow Effect**
30+
31+
![icon-react](https://stats.pphat.top/icons/react?color=%230088CC&glow=true&glowColor=%230088CC)
32+
![icon-python](https://stats.pphat.top/icons/python?color=%234584B6&glow=true&glowColor=%234584B6)
33+
![icon-typescript](https://stats.pphat.top/icons/typescript?color=%230088CC&glow=true&glowColor=%230088CC)
34+
![icon-javascript](https://stats.pphat.top/icons/javascript?color=%23FFDE57&glow=true&glowColor=%23FFDE57)
35+
![icon-html](https://stats.pphat.top/icons/html?color=%23E34F26&glow=true&glowColor=%23E34F26)
36+
![icon-css](https://stats.pphat.top/icons/css?color=%231572B6&glow=true&glowColor=%231572B6)
37+
![icon-nodedotjs](https://stats.pphat.top/icons/nodedotjs?color=%23339933&glow=true&glowColor=%23339933)
38+
![icon-nextjs](https://stats.pphat.top/icons/nextjs?color=white&glow=true&glowColor=white)
39+
![icon-nuxt](https://stats.pphat.top/icons/nuxt?color=%2300C58E&glow=true&glowColor=%2300C58E)
40+
![icon-postgresql](https://stats.pphat.top/icons/postgresql?color=%230088CC&glow=true&glowColor=%230088CC)
41+
![icon-mysql](https://stats.pphat.top/icons/mysql?color=%230088CC&glow=true&glowColor=%230088CC)
42+
![icon-tailwindcss](https://stats.pphat.top/icons/tailwindcss?color=%2338B2AC&glow=true&glowColor=%2338B2AC)
43+
![icon-markdown](https://stats.pphat.top/icons/markdown?color=orange&glow=true&glowColor=orange)
44+
![icon-laravel](https://stats.pphat.top/icons/laravel?color=%23FF2D20&glow=true&glowColor=%23FF2D20)
45+
![icon-php](https://stats.pphat.top/icons/php?color=%23777BB4&glow=true&glowColor=%23777BB4)
46+
![icon-cplusplus](https://stats.pphat.top/icons/cplusplus?color=%2300AACC&glow=true&glowColor=%2300AACC)
47+
![icon-csharp](https://stats.pphat.top/icons/csharp?color=%2300AACC&glow=true&glowColor=%2300AACC)
48+
![icon-fastapi](https://stats.pphat.top/icons/fastapi?color=white&glow=true&glowColor=white)
49+
![icon-hugo](https://stats.pphat.top/icons/hugo?color=white&glow=true&glowColor=white)
2250

2351
List available SVG icons or fetch a single icon.
2452

@@ -78,7 +106,7 @@ Demo page:
78106

79107
![combined-react](https://stats.pphat.top/icons/react?color=%230088CC&foreground=%23FF0000)
80108
![combined-github](https://stats.pphat.top/icons/github?color=blue)
81-
![combined-glow](https://stats.pphat.top/icons/react?color=%230088CC&glow=true&glowColor=%2300FF00)
109+
![combined-glow](https://stats.pphat.top/icons/react?color=%230088CC00)
82110
![combined-typescript](https://stats.pphat.top/icons/typescript?glow=true&glowColor=%23FF0000)
83111

84112
## Error Examples

0 commit comments

Comments
 (0)