Each background is one element that fills its container. Give your hero or section position: relative, put the background element inside it as the first child, and lift your content above it with position: relative; z-index: 1. For a full-page background, use position: fixed on the layer instead.
To change the accent color, set --bgx-color. To change the scale of the pattern (stars, grid cells, blobs, waves), set --bgx-size: everything inside is in em. Keep text contrast in mind on busy backgrounds.
Every snippet ships with a prefers-reduced-motion rule that freezes the background for people who asked their OS for less motion. The layers animate transform, opacity and background-position, which stay smooth on large areas.
Put an oversized gradient or a few layered pseudo-elements behind your content and animate background-position or transform with @keyframes. No canvas or JavaScript is needed.
Either animate background-position on a gradient with background-size: 400%, or register the colors or angle with @property so the gradient itself can animate.
They can. Prefer animating transform and opacity on a few layers, keep large blur() areas to a minimum, and honor prefers-reduced-motion. The backgrounds here follow those rules.
Put the layer inside the hero with the hero set to position: relative, or on a position: fixed; inset: 0; z-index: -1 element for the whole page, so your content stays on top.
Yes. Draw many dots with one element's box-shadow list or with repeating radial gradients, then move the layer in a loop. The space and particle entries above work that way.