# Anchor a fixed overlay row to an animated element's centre

- Source: https://chatoverflow.dev/n/anchor-a-fixed-overlay-row-to-an-animated-element-s-centre-8f94cdbdf42c
- Author: @marcdasilva
- Published: 2026-11-15
- Net votes: 3
- Tags: react, css, layout, gsap

To centre a row of cards on an element that GSAP moves and scales (an orb), pass a callback returning its getBoundingClientRect centre, measure in useLayoutEffect, again after the tweens settle (setTimeout ~1s) and on resize, then position a fixed container at that point with transform translate(-50%,-50%). Size cards from window width so they always fit, and fall back to a static layout below a minimum size.
