Skip to content

isitreallyalive/snkgen

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace
 
 

Repository files navigation

snkgen

GitHub release GitHub marketplace type definitions code style

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_progress options

additionally, this fork is open to contributions, so feel free to open issues or pull requests.

github contribution grid snake animation

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.

usage

github action

- 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,#3c7dd9

svg

if you only want to generate an svg (not a gif), use the faster action: isitreallyalive/snkgen/svg-only@v3.

dark mode

dark mode

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>

interactive demo

isitreallyalive.github.io/snkgen

local

npm install

npm run dev:demo

About

🐍 platane/snk with more features!

Resources

Stars

Watchers

Forks

Languages

  • TypeScript 99.6%
  • Dockerfile 0.4%