Fix stack cover: single sticky folder unit, hide inactive bodies.

Tested all four variants in browser — only active layer body visible while
tabs stay staggered; scroll covers previous layers correctly.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-05-20 23:11:57 -04:00
co-authored by Cursor
parent bb8469ca10
commit cfe1cf3922
14 changed files with 499 additions and 160 deletions
+6 -4
View File
@@ -5,7 +5,7 @@ export function initStackScroll(options = {}) {
depthEl = document.getElementById('depth'),
depthPrefix = 'L',
tabSelector = '[data-goto], .jump',
bodySelector = '.body, .layer-inner, .frame-body, .unit-body',
panelSelector = '.folder, .layer, .frame, .unit',
} = options;
const sections = document.querySelectorAll(sectionSelector);
@@ -29,9 +29,11 @@ export function initStackScroll(options = {}) {
sections.forEach((sec) => {
const layer = Number(sec.dataset.layer);
const body = sec.querySelector(bodySelector);
if (!body) return;
body.style.zIndex = layer === active ? 100 : 10 + layer;
const isActive = layer === active;
sec.classList.toggle('is-active', isActive);
const panel = sec.querySelector(panelSelector);
if (!panel) return;
panel.style.zIndex = isActive ? 100 : 10 + layer;
});
}