variant-layout-math-stays-in-the-variant
Installation
SKILL.md
Fit-one-screen maths belongs to each look
The block is small and looks shareable: measure the header, the hero frame and the info column, then
gap = (screenHeight − header − hero − info − minimum) / 2, floored at minimum, drawn above and
below the hero so it lands optically centred with the rest just reaching the fold.
// adapted
LaunchedEffect(headerDp, heroDp, infoDp, screenInfo, minimumDp) {
if (headerDp > 0 && heroDp > 0 && infoDp > 0 && screenInfo.hDP > 0) {
val result = (screenInfo.hDP - headerDp - heroDp - infoDp - minimumDp) / 2
gapDp = if (result > minimumDp) result else minimumDp
}
}