Skip to content

Pin the backdrop to the viewport and give the blocks depth - #5

Merged
abappi19 merged 1 commit into
mainfrom
feat/falling-blocks-backdrop
Sep 14, 2026
Merged

abappi19 merged 1 commit into
mainfrom
feat/falling-blocks-backdrop

Conversation

@abappi19

Copy link
Copy Markdown
Member

Follow-up to #4, all in src/app/global.css.

Not scrollable. All three layers get background-attachment: fixed, so the field stays a backdrop instead of scrolling off with the page. Verified with screenshots at scrollY=0 and scrollY=900: the block pattern is in the identical position while the content has moved 900px. iOS Safari has historically ignored this and fallen back to scrolling, which is a soft landing here since the pattern tiles either way.

One size gradient per screen. The tile is redrawn at 300x900 and the layers sit at 900/1140/1380px, at or above a typical viewport. Before this the tiles repeated two or three times per screen, so the taper cycled big/small/big/small instead of reading as one gradient. Each layer still travels exactly its own height per cycle, so the loop stays seamless and the three speeds stay different.

Depth. The 29 blocks are split into five <g fill-opacity> bands, .045 down to .009 in light and .06 down to .012 in dark. Opacity mostly follows size, since a nearer block is both bigger and more solid, but a few sit off that curve on purpose: a strict size-to-opacity correlation reads as a fade down the page rather than as blocks at different distances.

Two things in the rect list look like untidiness and are not, and the comment says so: sizes are mixed at every height rather than sorted, because clustering one size in one area reads as banding; and heights are capped near 85 tile units, since the largest layer scales by about 1.5 and anything taller stops being a block and becomes a streak down a third of the screen.

🤖 Generated with Claude Code

The field no longer scrolls away with the page: all three layers are
background-attachment: fixed, so it stays a backdrop. iOS Safari has
historically ignored that and fallen back to scrolling, which is a fine
degradation since the pattern tiles either way.

The tile is redrawn at 300x900, taller than most viewports, so a layer
shows about one pass of the size gradient instead of cycling it two or
three times down the screen. Blocks are grouped into five opacity bands
to give the field depth, mostly following size since a nearer block is
both bigger and more solid, with a few off that curve so it does not
read as one flat fade.

Sizes are mixed at every height rather than sorted, because clustering
one size in one area reads as banding, and heights are capped near 85
tile units, since the largest layer scales by about 1.5 and anything
taller became a streak down a third of the screen.
@abappi19
abappi19 merged commit 3f32ae6 into main Sep 14, 2026
2 checks passed
@abappi19
abappi19 deleted the feat/falling-blocks-backdrop branch September 14, 2026 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant