Skip to content

About

Turn your GitHub contribution graph into animated SVG art: circuit boards, candlestick stock charts, neon, constellations and more. Zero-dependency GitHub Action.

Topics

Resources

Stars

6 stars

Watchers

0 watching

Forks

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

Latest commit

 

History

19 Commits

Folders and files

Repository files navigation

contribution-fx

Your contribution graph, but alive.

Turn your GitHub contribution graph into animated SVG art for your profile README.
Many effects · five palettes · light & dark · one GitHub Action · zero dependencies.

▶ Try it with your username · Quick start · Themes · Options · 中文



contribution-fx fx2 theme

CI License: MIT Dependencies: 0 Stars

Themes

All examples below are real output of this action (rendered from demo data), shown in light unless noted. Every theme loops forever, respects prefers-reduced-motion, and falls back to your normal graph when animations are off.

fx1

Your graph bends into a candlestick chart, one candle per week, and trades under your username. Then the market crashes off the screen and every day flies back home.

fx1

fx2 shown with mode=dark

Each week's busy days stack into a candle, so active weeks rally and quiet ones slide. Then the chart tumbles off and every day flies back home.

fx2

circuit

Your graph becomes a circuit board: copper traces etch between the days and signals light them up like LEDs.

circuit

neon

Your graph becomes a neon sign that stutters to life block by block, hums, buzzes and cuts out.

neon

life

Your graph seeds Conway's Game of Life. Watch a year of commits evolve, generation by generation.

life

replay

Your year replays as a time-lapse: every day pops in behind a playhead while the counter ticks up to your total.

replay

constellation

Your year as a night sky: busy days twinkle as stars and draw themselves into constellations.

constellation

railgun

A railgun charges up and fires across your graph, its shockwave blasting the days aside.

railgun

ripple shown with palette=ocean

Your busiest days hit the graph like raindrops on water and send shockwaves across the year.

ripple

sort

Every day travels to its sorted position until the year becomes a perfect gradient — then everything flies home.

sort

splitflap

Your graph becomes an airport departure board, every day clattering through its flaps.

splitflap

fireworks shown with palette=sunset

Your best days launch fireworks. Because shipping deserves a celebration.

fireworks

naiwa easter egg

Naiwa (奶蛙), a Chinese internet meme, hops across your graph, faceplants, then laughs so hard that every busy day starts laughing too.

naiwa

Quick start

It takes about two minutes. You need a profile repository (a public repo named exactly like your username).

1. Add a workflow to your profile repo as .github/workflows/contribution-fx.yml:

name: contribution-fx

on:
  schedule:
    - cron: "0 0 * * *" # refresh daily
  workflow_dispatch:

permissions:
  contents: write

jobs:
  generate:
    runs-on: ubuntu-latest
    steps:
      - uses: Sur1ive/contribution-fx@v1
        with:
          github_user_name: ${{ github.repository_owner }}
          outputs: |
            dist/contribution-fx.svg?theme=circuit
            dist/contribution-fx-dark.svg?theme=circuit&mode=dark

      - uses: crazy-max/ghaction-github-pages@v5
        with:
          target_branch: output
          build_dir: dist
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

2. Run it once from the Actions tab (contribution-fx → Run workflow). It creates an output branch with your SVGs.

3. Paste this into your README.md (replace USERNAME):

<a href="https://github.com/Sur1ive/contribution-fx">
  <picture>
    <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/USERNAME/USERNAME/output/contribution-fx-dark.svg" />
    <img alt="contribution-fx" src="https://raw.githubusercontent.com/USERNAME/USERNAME/output/contribution-fx.svg" />
  </picture>
</a>

Done. The workflow refreshes your art every day.

Tip

Not sure which theme to pick? The playground previews every theme and palette with your graph and generates both snippets for you.

Options

Each line of outputs is a file path followed by options in query-string form. Generate as many files as you like in one run:

outputs: |
  dist/life.svg?theme=life&palette=ocean
  dist/life-dark.svg?theme=life&palette=ocean&mode=dark
  dist/party.svg?theme=fireworks&palette=sunset&mode=dark&speed=1.5&label=true
Option Values Default
theme fx1 fx2 circuit neon life replay constellation railgun ripple sort splitflap fireworks naiwa equalizer warp gravity gravity
palette github ocean sunset purple halloween github
mode light dark light
speed any positive number (2 = twice as fast) 1
background any CSS color, e.g. #0d1117 transparent
label true adds “@you · N contributions in the last year” false

Action inputs:

Input Description Default
github_user_name Whose graph to render the repository owner
github_token Token for the GraphQL API (the built-in one is enough) ${{ github.token }}
outputs Files to generate, one per line (see above) dist/contribution-fx.svg

CLI & library

No install needed — Node 20+ is enough:

git clone https://github.com/Sur1ive/contribution-fx && cd contribution-fx
node bin/cli.js --user torvalds --theme life --mode dark -o life.svg
node bin/cli.js --demo --theme fireworks -o fireworks.svg   # offline, demo data
node bin/cli.js --help

Without GITHUB_TOKEN the CLI uses the token-free github-contributions-api.

The renderer is plain ESM with no Node APIs, so it runs in the browser too (that is how the playground works):

import { render, fetchPublic } from './src/index.js';

const calendar = await fetchPublic('octocat');
const svg = render(calendar, { theme: 'ripple', palette: 'purple', mode: 'dark' });

How it works

  1. The action reads your contribution calendar from the GitHub GraphQL API.
  2. A theme turns the 53 × 7 grid into SVG plus pure CSS @keyframes — no JavaScript, so it plays inside GitHub's image proxy.
  3. Output is deterministic: same graph, same bytes, so the daily job only commits when your graph changed.

Add your own theme

A theme is a single file in src/themes/ exporting render(ctx) → { style, body }. gravity.js is about 70 lines and a good template. Run npm test and npm run examples, open examples/preview.html, and send a PR — new effects are very welcome!

Ideas looking for an author: snake, tetris, matrix rain, starfield, pixel-art text, seasons.

FAQ

The image does not update / shows an old version.

GitHub caches images through its camo proxy for a few minutes. Also check the workflow run succeeded and that the output branch exists.

Are private contributions included?

The graph matches what your public profile shows. Enable Include private contributions on my profile in your GitHub profile settings to include private activity counts (no repository details are exposed).

The animation does not play.

Your OS or browser may have reduce motion enabled; in that case the SVG intentionally shows your normal, static graph.

Credits

Inspired by Platane/snk, the snake that started it all. Playground data via grubersjoe/github-contributions-api.

If contribution-fx made your profile a little more alive, a ⭐ helps others find it!

License

MIT

About

Turn your GitHub contribution graph into animated SVG art: circuit boards, candlestick stock charts, neon, constellations and more. Zero-dependency GitHub Action.

Topics

Resources

Stars

6 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages