Skip to content

a customizable badge api with the ability to fetch third-party data

License

Notifications You must be signed in to change notification settings

LukenSkyne/Badges

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Badges Logo

Badges

a customizable badge api with the ability to fetch third-party data


Custom Badge

About

This project aims to bring some customization options and dynamic into the beauty of Devin's Badges.
Mostly for personal use in my other repositories, so expect some hiccups here and there. Feel free to report any issues!

Example Gallery

The following badges are presets, which are also listed in presets.json.

GitHub GitLab
PayPal Google Play
Fabric Forge
CurseForge Modrinth

The CurseForge and Modrinth badges can also show the download count of your project by appending /<projectId> to the URL.

CurseForge Modrinth

How to use

The api currently has a single endpoint which is used to retrieve badges: https://luken.cc/badges/<preset>
A basic preset to start with your own customizations is custom, but you can simply override any of them.

The following query parameters can be set:

  • bg adjusts the background
    • supply a single color with rgb
    • add gradient colors by dividing with |, such as rgb|rgb|rgb
    • rotate the gradient by adding /angle, such as rgb|rgb/45
  • fill sets the default icon and text colors (only supports single color)
  • icon specifies an icon by name (found in the icons folder) or url encoded svg data
  • desc changes the description text and allows for data fetching
    • limited API support, currently only CurseForge & Modrinth for project information
    • syntax: {api.json_path|formatter}[Alternate Text] more text
      • api can be one of curseforge, modrinth
      • alternate text is shown when the /<id> parameter is not used
      • formatter is optionally used for numbers, can be num or omitted
  • name overrides the highlighted name on the right
    • can have multiple segments of differently colored text
    • syntax: [rgb|rgb/45]Text1[rgb]Text2

Note: color definitions are in hex without #, such as fb4 or ffb347.

Acknowledgements

  • Devin for their awesome badge design

About

a customizable badge api with the ability to fetch third-party data

Topics

Resources

License

Stars

Watchers

Forks