⬜ Generates a snake game from a github user contributions graph and output a screen capture as animated svg or gif
⬜ Generates a snake game from a github user contributions graph and output a screen capture as animated svg or gif
Generates a snake game from a github user contributions graph
Pull a github user's contribution graph. Make it a snake Game, generate a snake path where the cells get eaten in an orderly fashion.
Generate a gif or svg image. Colors can be customized.
Available as github action. It can automatically generate a new image each day. Which makes for great github profile readme
…If you are only interested in generating a svg (not a gif), consider using this faster action: uses: Platane/snk/svg-only@v3
For dark mode support on github, use this special syntax in your readme.
<picture>
<source media="(prefers-color-scheme: dark)" srcset="github-snake-dark.svg" />
<source media="(prefers-color-scheme: light)" srcset="github-snake.svg" />
</picture>import { generateSnakeAnimation } from "generate-snake-animation";
const outputs = [
{
format: "svg",
drawOptions: {
// ..
},
},
];
const results = await generateSnakeAnimation(
{
platform: "github", // supports github, gitlab and forgejo (codeberg)
username: "platane",
githubToken: process.env.GITHUB_TOKEN,
},
outputs,
);
fs.writeFileSync("snake.svg", results[0]);or with npx
npx generate-snake-animation@3 --forgejo_user codeberg.org/JasterV --output snake.svg?palette=codebergThis project does not accept pull request.
Reporting or fixing issues is appreciated, but change in the API or implementation should be discussed in issue first and is likely not going be greenlighted.
No open issues yet, or sync has not completed.