by mrandish · 9mo ago · 0 comments
It's somewhat ironic that a web page about performant terminal user interfaces uses gratuitously complex CSS mask compositing and cubic gradients which reduce smooth scrolling on my 1 year-old, high-end Dell XPS laptop (>$3k) to Commodore 64 level (on default 'Balanced' battery mode). While it's pretty, it's also just a very subtle, non-critical background animation effect. Not being a CSS guru myself, here's what Gemini says:
> "Specifically, this is a Scrim or Easing Gradient. Instead of a simple transition between two colors, it uses 16 color stops to mimic a "cubic-bezier" mathematical curve. This creates a smoother, more natural fade than a standard linear gradient, but it forces the browser to calculate high-precision color math across the entire surface during every scroll repaint."
My Firefox smooth scrolls like butter on thousands of pages, so you might want ask your web designer to test on non-Mac, iGPU laptops with hiDPI and consider the performance cost of web pages with always-running subtle background animations in a world of diverse hardware platforms. In case it helps, here's the animation with the gradient layers disabled so you can see all 6,400,000 pixels which are being recalculated every scroll line (https://i.imgur.com/He3RkEu.jpeg).
https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/...
If you check the source (not the DOM) the actual content is loaded in `<div hidden="" id="S:0"> ...` which is then moved/copied into the proper main content div in the DOM using a JS event it seems.
That’s unfair to C64 which can smooth scroll very well.
Shaking effects that did not require memory copy were even easier.
> here's what Gemini says
Surely, if people care to see LLM generated text, they can do it themselves.
The real issue is something was causing the container with the gradient to repaint on every scroll.
(
printf 'GET /blog/tuis-are-easy-now HTTP/1.0\r\n'
printf 'Host: hatchet.run\r\n\r\n'
)|busybox ssl_client hatchet.run \
|(echo "<meta charset=utf-8>";grep -o "<p.*</p>") > 1.htm
firefox ./1.htm