feat: a red thread through the homepage, in words and as a line
The rail and the "next, you are wondering" links are gone (owner: flat, and the question stood twice in a row). The page now reads from top to bottom: Every chapter opens with one sentence, and the sentences follow each other as the way of a project: you need someone who builds it, first we find out what you need, sometimes it is less work by hand, sometimes a meeting, then it always runs the same way, in the end something runs, a few questions remain, and it starts with an email. One line runs down the whole page and draws itself as the visitor scrolls. Under each sentence it crosses the page, stands a figure on the line (diamond, hexagon, screen, circle, square, triangle) and continues down the other side; a glowing dot travels at its head and comes to rest in front of the last sentence. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { deepestSoFar, lengthAtDepth } from "./thread";
|
||||
|
||||
describe("deepestSoFar", () => {
|
||||
it("keeps the lowest point the line has reached at each sample", () => {
|
||||
// The line goes down, loops back up, and goes down again.
|
||||
expect(deepestSoFar([10, 5, 20, 15, 30])).toEqual([10, 10, 20, 20, 30]);
|
||||
});
|
||||
|
||||
it("is empty for an empty line", () => {
|
||||
expect(deepestSoFar([])).toEqual([]);
|
||||
});
|
||||
|
||||
it("works above the top of the page", () => {
|
||||
expect(deepestSoFar([-20, -30, -10])).toEqual([-20, -20, -10]);
|
||||
});
|
||||
});
|
||||
|
||||
describe("lengthAtDepth", () => {
|
||||
const depths = [10, 10, 20, 20, 30];
|
||||
|
||||
it("draws nothing above the start of the line", () => {
|
||||
expect(lengthAtDepth(depths, 8, 9)).toBe(0);
|
||||
});
|
||||
|
||||
it("draws everything the line needed to reach that depth, loops included", () => {
|
||||
expect(lengthAtDepth(depths, 8, 10)).toBe(16);
|
||||
expect(lengthAtDepth(depths, 8, 19)).toBe(16);
|
||||
expect(lengthAtDepth(depths, 8, 20)).toBe(32);
|
||||
});
|
||||
|
||||
it("draws the whole line below its end", () => {
|
||||
expect(lengthAtDepth(depths, 8, 1000)).toBe(40);
|
||||
});
|
||||
|
||||
it("draws nothing of an empty line", () => {
|
||||
expect(lengthAtDepth([], 8, 1000)).toBe(0);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user