Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/animation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export function renderCommitManGif(
throw new Error("At least one contribution day is required.");
}

const cellSize = options.cellSize ?? 10;
const cellSize = options.cellSize ?? 12;
const gap = options.gap ?? 3;
const padding = options.padding ?? 16;
const frameDelayMs = options.frameDelayMs ?? DEFAULT_FRAME_DELAY_MS;
Expand Down
15 changes: 13 additions & 2 deletions tests/animation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,23 @@ test("renders a valid, looping GIF with the expected dimensions", () => {

const width = gif[6]! | (gif[7]! << 8);
const height = gif[8]! | (gif[9]! << 8);
assert.equal(width, 42);
assert.equal(height, 120);
assert.equal(width, 44);
assert.equal(height, 134);
assert.ok(gif.byteLength > 100);
assert.equal(gif[gif.length - 1], 0x3b);
});

test("defaults to the same 12px cell size and 3px gap as Snake", () => {
const defaultGif = renderCommitManGif(sampleDays);
const snakeSizedGif = renderCommitManGif(sampleDays, {
cellSize: 12,
gap: 3,
padding: 16,
});

assert.deepEqual(defaultGif, snakeSizedGif);
});

test("uses a slower default frame delay of 70ms", () => {
const defaultTiming = renderCommitManGif(sampleDays);
const explicitTiming = renderCommitManGif(sampleDays, { frameDelayMs: 70 });
Expand Down
Loading