This project uses a Python script and GitHub Actions to fetch your real-time commit history via the GitHub GraphQL API. It then mathematically calculates a parkour path for Mario to jump across your commits, collect coins, and finish the level in style.
| Feature | Description |
|---|---|
| 🏃♂️ Parkour Physics | Mario doesn't just run; he jumps! The script calculates the "peak" of your contributions and paths Mario to hop on top of them. |
| 🪙 Coin Collection | Your busiest days (Level 4) spawn spinning coins. Mario "collects" them with pixel-perfect timing as he runs by. |
| 🚩 Interactive Finish | Mario rises from a Warp Pipe, parkours across your year, slides down the Flagpole, and enters a Castle to trigger a "LEVEL CLEAR!" |
| ☁️ Parallax World | Includes a sky-blue background with drifting clouds and ground bushes for a true 8-bit aesthetic. |
| 🛡️ Zero-Asset SVG | 100% Pure SVG code. No external images are used, bypassing all GitHub security proxies (Camo) for instant loading. |
Follow these steps to add this animation to your own GitHub profile in minutes.
In your repository, create a file named generate_mario.py and paste the Python code found in this repo.
Create a file at .github/workflows/mario-graph.yml and paste the following:
name: Generate Mario Contribution Graph
on:
schedule:
- cron: "0 0 * * *" # Runs daily at midnight
workflow_dispatch: # Allows manual trigger
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Generate Mario SVG
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_ACTOR: ${{ github.repository_owner }}
run: python generate_mario.py
- name: Push SVG
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add mario_contribution.svg
git commit -m "Update Mario graph" || echo "No changes"
git push- Go to Settings > Actions > General.
- Scroll to Workflow permissions.
- Select Read and write permissions and click Save.
Go to the Actions tab, select the workflow, and click Run workflow. Once finished, the mario_contribution.svg file will appear in your repo.
To add the animation to your personal profile README.md, use the following code (replace YOUR_USERNAME and YOUR_REPO):
<div align="center">
<a href="https://github.com/YOUR_USERNAME/YOUR_REPO">
<img src="https://raw.githubusercontent.com/YOUR_USERNAME/YOUR_REPO/main/mario_contribution.svg?v=1" width="100%" />
</a>
</div>Want to tweak the game? Open generate_mario.py to adjust:
- Speed: Change
animation_duration(Default is 20s). - Character: Edit the
mario_pixelsarray to draw Luigi or your own custom character! - Theme: Modify the CSS in the
svg_elementslist to change the sky or ground colors.
If you love this project, please consider giving it a ⭐ Star!
For technical details on the pathfinding math or sprite generation, check out the Project Wiki.