You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit dd7b4ea
Browse filesBrowse the repository at this point in the historyBrowse files
A custom GitHub contribution snake animation built from scratch with **TypeScript + SVG**.
3
+
A custom GitHub contribution snake animation built from scratch with **TypeScript + SVG**, then encoded to an animated GIF for profile embedding.
4
4
5
5
This project is intentionally independent from the original profile-repository snake and does **not** use Platane/snk.
6
6
7
-
## Current architecture
7
+
## How it works
8
8
9
9
```text
10
-
Contribution data
10
+
GitHub GraphQL
11
11
↓
12
-
Domain model
12
+
Contribution calendar
13
13
↓
14
-
Snake engine
14
+
Deterministic grid
15
15
↓
16
-
SVG renderer
16
+
Custom snake path
17
17
↓
18
-
snake.svg
18
+
Growth + contribution colors
19
+
↓
20
+
Animation timeline
21
+
↓
22
+
SVG frame renderer
23
+
↓
24
+
Animated GIF
25
+
↓
26
+
output/snake.gif
19
27
```
20
28
21
-
The core engine is GitHub-agnostic. GitHub API access and GitHub Actions publishing will be added separately.
29
+
## Visual rules
22
30
23
-
## Contribution colors
31
+
The snake grows by one segment when it consumes a non-empty contribution cell.
24
32
25
-
Non-empty contribution levels use four green shades:
33
+
Each new segment keeps the contribution intensity it consumed:
26
34
27
35
- Level 1 → light green
28
36
- Level 2 → medium green
29
37
- Level 3 → dark green
30
38
- Level 4 → deepest green
31
39
32
-
Empty cells use a dark GitHub-style background.
40
+
The background follows GitHub's dark visual style.
41
+
42
+
## Quality guards
43
+
44
+
The generator rejects:
45
+
46
+
- empty animation timelines
47
+
- runaway frame counts above 500
48
+
- invalid GIF headers
49
+
- missing/empty artifacts
50
+
- GIFs larger than 1.5 MB
51
+
- unreasonable output dimensions
33
52
34
53
## Local development
35
54
@@ -39,21 +58,26 @@ npm test
39
58
npm run build
40
59
```
41
60
42
-
## Design principles
61
+
To generate against real GitHub data locally:
62
+
63
+
```bash
64
+
CONTRIBUTION_TOKEN=... npm run generate
65
+
```
66
+
67
+
Keep the token in your shell environment or a secret manager. Never commit it.
68
+
69
+
## GitHub Action
70
+
71
+
The workflow supports manual dispatch, weekly regeneration and regeneration after changes land on `main`.
43
72
44
-
- TypeScript with strict compiler settings.
45
-
- Deterministic animation state.
46
-
- SVG output rather than a browser-only animation.
47
-
- No GitHub token in source code.
48
-
- No dependency on the old profile repository.
49
-
- Small, testable core before adding GitHub data and automation.
73
+
The contribution calendar is read with `CONTRIBUTION_TOKEN`. The workflow's built-in `GITHUB_TOKEN` is used only for publishing the generated artifact.
50
74
51
75
## Profile output
52
76
53
-
The generated animation is published to the `output` branch by GitHub Actions.
77
+
The generated public artifact is published to the `output` branch:
0 commit comments