Make your repositories and READMEs more beautiful!
This API generate an image dynamically with your parameters! It's simple to use, customized's and with ready presets!
Navigation
About
About the project
The API it's made with Express and TypeScript.
The idea of the project is make the API stay in continuous progression with new presets and features, then: Pull Requests and ideas are welcome! Read how it works? for more information about the project structure.
This is my first open-source project, so let's share learning! :)
Inspired in Capsule Render project.
Basic usage
[!] API uses a default preset if you don't specify.
In HTML, link the URL in src
<img src="https://dynamic-image-renderer.vercel.app/api?title=myTitle&subtitle=mySubtitle">
In Markdown, you can uses HTML way or the markdown method.
![Image Description](https://dynamic-image-renderer.vercel.app/api?title=myTitle&subtitle=mySubtitle)
Parameters
Size
Parameter | Default |
---|---|
height |
300 |
Title
Parameter | Default | Description |
---|---|---|
title |
dynamic! |
Title content |
titleColor |
#111111 |
Title color (CSS color: rgb, hex, etc) |
titlePositionX |
50 (0..100) |
Title position in X axis (This position is calculated in percentage) |
titlePositionY |
50 (0..100) |
Title position in Y axias |
titleFontSize |
65 (px) |
Title Font size in pixels |
titleBgOpacity |
100 (0..100) |
Title background opacity |
titleBgColor |
#fff |
Title background color (CSS color) |
titleShadow |
false |
If you want title shadow (true, false) |
Subtitle
Parameter | Default |
---|---|
subtitle |
dynamic image renderer. |
subtitleColor |
#EEE |
subtitlePositionX |
60 (0..100) |
subtitlePositionY |
67 (0..100) |
subtitleFontSize |
20 (px) |
subtitleBgOpacity |
0 (0..100) |
subtitleBgColor |
#fff |
subtitleShadow |
true |
Effects
Parameter | Default | Description |
---|---|---|
glowColor |
none |
Color used in animations like "flicker" or "pulse", for example. |
textAnimation |
fadein |
Check available animations here |
See more of animations here.
Background
Parameter | Default |
---|---|
backgroundColor |
gradient |
Animations
Pop-up (popup)
[!] Played when is loaded.
<img src="https://dynamic-image-renderer.vercel.app/api?textAnimation=popup">
Fade-in (fadein)
[!] Played when is loaded.
<img src="https://dynamic-image-renderer.vercel.app/api?textAnimation=fadein">
Pulse (pulse)
Note: Pulse and Flicker needs a glowColor parameter, because it's "none" by default.
<img src="https://dynamic-image-renderer.vercel.app/api?textAnimation=pulse&glowColor=white">
Flicker (flicker)
Note: Pulse and Flicker needs a glowColor parameter, because it's "none" by default.
<img src="https://dynamic-image-renderer.vercel.app/api?textAnimation=flicker&glowColor=white">
Presets
See each preset configuration in files
Default
<img src="https://dynamic-image-renderer.vercel.app/api">
Minimalist
<img src="https://dynamic-image-renderer.vercel.app/api?preset=minimalist">
Dracula
<img src="https://dynamic-image-renderer.vercel.app/api?preset=dracula">
Hub
Note: You will probably need to change positions of title and subtitle.
<img src="https://dynamic-image-renderer.vercel.app/api?preset=hub">
Monokai
<img src="https://dynamic-image-renderer.vercel.app/api?preset=monokai">
Using presets and animations
Minimalist preset with pulse animation
<img src="https://dynamic-image-renderer.vercel.app/api?preset=minimalist&textAnimation=pulse&glowColor=green&titleBgOpacity=0&title=myTitle&subtitle=my%20subtitle">
Dracula preset with flicker animation
<img src="https://dynamic-image-renderer.vercel.app/api?preset=dracula&title=myTitle&subtitle=my%20subtitle&textAnimation=flicker&glowColor=gray">
How it works?
Basically, this API get the parameters and render as a SVG, in browser, the SVG is shown as an image.
The SVG is rendered as a EJS template, the file is here.
How to make a preset
You can find the presets in presets folder, to add a preset, create a preset with name.ts
, and, please, follow the preset struct:
import imageSettings from "../types/imageSettings"
import defaultPreset from "./defaultPreset"
function preset(): imageSettings {
return {
// this preset will be a base, all parameters initialize with this preset
...defaultPreset(),
... {
// here, your modifications.
title: "title"
}
}
}
export default preset
Modify the index file with new preset.
How to make a animation
You can find all animations in animations.ts, this object contains all animations, follow the animations struct:
// ...
animationName: {
style: "this style will be appliqued in title and subtitle",
keyframes: `
this string is reserved to create a animation keyframes
`
}
How to add a gradient
You can find the gradients in gradients.ts, just add colors for the gradient.