A custom GitHub contribution snake animation built from scratch with TypeScript + SVG, then encoded to an animated GIF for profile embedding.
This project is intentionally independent from the original profile-repository snake and does not use Platane/snk.
GitHub GraphQL
β
Contribution calendar
β
Deterministic grid
β
Custom snake path
β
Growth + snake color cycle
β
Animation timeline
β
SVG frame renderer
β
Animated GIF
β
output/snake.gif
The snake grows by one segment when it consumes a non-empty contribution cell.
Each growth advances the snake through a fixed, deterministic color cycle:
- Initial state β blue
- 1st growth β soft pink
- 2nd growth β turquoise
- 3rd growth β yellow
- 4th growth β green
- 5th growth β blue
- Then the cycle repeats.
The contribution level still belongs to the consumed cell; it does not control the snake color.
The background follows GitHub's dark visual style.
The generator rejects:
- empty animation timelines
- runaway frame counts above 500
- invalid GIF headers
- missing/empty artifacts
- GIFs larger than 1.5 MB
- unreasonable output dimensions
npm install
npm test
npm run buildTo generate against real GitHub data locally:
CONTRIBUTION_TOKEN=... npm run generateKeep the token in your shell environment or a secret manager. Never commit it.
The workflow supports manual dispatch, weekly regeneration and regeneration after changes land on main.
The contribution calendar is read with CONTRIBUTION_TOKEN. The workflow's built-in GITHUB_TOKEN is used only for publishing the generated artifact.
The generated public artifact is published to the output branch:
<img src="https://raw.githubusercontent.com/codelovingcat/github-snake-remix/output/snake.gif" alt="GitHub contribution snake" />Set the repository secret CONTRIBUTION_TOKEN before the first generation run.