feat: add Night Shift layer (boot intro, ops strip, headlight, chapter numerals, film grain)

This commit is contained in:
2026-10-10 14:13:26 +03:00
parent 475e494675
commit d16ce88639
8 changed files with 389 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
import { describe, expect, it } from 'vitest';
import { bucharestClock, uptimeSince } from '@/lib/operations';
describe('uptimeSince', () => {
const start = new Date('2025-08-01T00:00:00Z');
it('is zero at the start', () => {
expect(uptimeSince(start, start)).toEqual({ months: 0, days: 0 });
});
it('counts whole months and remaining days', () => {
expect(uptimeSince(start, new Date('2026-10-10T00:00:00Z'))).toEqual({ months: 14, days: 9 });
});
it('clamps to zero before the start', () => {
expect(uptimeSince(start, new Date('2025-01-01T00:00:00Z'))).toEqual({ months: 0, days: 0 });
});
});
describe('bucharestClock', () => {
it('formats HH:MM in Europe/Bucharest', () => {
expect(bucharestClock(new Date('2026-01-15T10:05:00Z'))).toBe('12:05');
});
});