GODRICH
#css-animation#button#loader#transition#scroll#dashboard#ui#design-trends

04Stacking order math — a painter's algorithm turning depth into z-index

Compute each block's z-index as the sum (col + row + height layer) ahead of time and the block behind is always drawn before the one in front. Drag a block to a new spot and the same formula reruns, so overlap sorts itself out.

Best forBuilder tools, diorama editors

z-indexCSS custom propertiescalc
Stacking order math — a painter's algorithm turning depth into z-index
Open in a new tab

04 Stacking order math — a painter's algorithm turning depth into z-index — Measured area 4.119% · moving frames 23/23Original by GODRICH · SCSS and React ship in the zip · Isometric CSS: 9 True-Projection 3D Dioramas

The post this demo lives in

Isometric CSS: 9 True-Projection 3D Dioramas - preview of all 9 demosIsometric CSS: 9 True-Projection 3D DioramasIsometric css done right: Each cube face shades by a light-angle calc, grid coords map to screen via the 2:1 isometric f See all demos in this post

If you like this effect - similar demos