generate a snake game from a github user's contributions graph. hard fork of platane/snk.
the project remains largely untouched and backwards compatible, but has added the following features:
- the
color_progressoptions
additionally, this fork is open to contributions, so feel free to open issues or pull requests.
pull a github user's contribution graph and turn it into a snake game. the snake eats cells in order, showing your activity.
generate a gif or svg image. colors can be customized.
available as a github action. it can automatically generate a new image each day, perfect for your github profile readme.
- uses: isitreallyalive/snkgen@v3
with:
# github user name to read the contribution graph from (**required**)
# using action context var `github.repository_owner` or specified user
github_user_name: ${{ github.repository_owner }}
# list of files to generate.
# one file per line. each output can be customized with options as query string.
# supported options:
# - palette: a preset of color, one of [github, github-dark, github-light]
# - color_snake: color of the snake
# - color_dots: comma separated list of dots color.
# the first one is 0 contribution, then it goes from the low contribution to the highest.
# exactly 5 colors are expected.
# - color_progress: color of the progress bar.
outputs: |
dist/github-snake.svg
dist/github-snake-dark.svg?palette=github-dark
dist/ocean.gif?color_snake=orange&color_dots=#bfd6f6,#8dbdff,#64a1f4,#4b91f1,#3c7dd9if you only want to generate an svg (not a gif), use the faster action: isitreallyalive/snkgen/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" />
<img alt="github-snake" src="github-snake.svg" />
</picture>
isitreallyalive.github.io/snkgen
npm install
npm run dev:demo
