One line through the whole page
The home page has one line that runs from the first sentence to the contact block and draws itself as you scroll. How it finds its way without me fixing a single coordinate.
The line isn't an image laid over the page. The layout holds invisible anchor points, each with a direction: down, left or right. On load the page measures where those points are and lays a path through them. When the window changes width, it measures again.
Between two points sits a Bézier bend. Each handle reaches along its own direction, but never further than the next point lies in that direction. That turns a bend into a quarter circle, and the line never swings past its target.
const k = a.dir === b.dir ? 0.5 : 0.8;
const ra = Math.max(24, Math.abs(dx * va[0] + dy * va[1])) * k;
const rb = Math.max(24, Math.abs(dx * vb[0] + dy * vb[1])) * k;For the drawing I take a sample along the path every sixteen pixels: how long is the line here, and how far down the page is it. While you scroll I look up in that table how much line belongs to the scroll position, and the tip follows that value with a little weight. Anyone who asks for less motion gets the line fully drawn straight away.