Merge contact and ops into L4 surface; static footer; narrower cards and smaller offsets. Co-authored-by: Cursor <cursoragent@cursor.com>
25 lines
655 B
JavaScript
25 lines
655 B
JavaScript
const layers = document.querySelectorAll('.layer');
|
|
const depthEl = document.getElementById('depth');
|
|
const rulerSpans = document.querySelectorAll('.stack-ruler span');
|
|
|
|
function updateDepth() {
|
|
const mid = window.innerHeight * 0.45;
|
|
let active = 0;
|
|
|
|
layers.forEach((layer) => {
|
|
const rect = layer.getBoundingClientRect();
|
|
if (rect.top <= mid && rect.bottom > mid) {
|
|
active = Number(layer.dataset.layer);
|
|
}
|
|
});
|
|
|
|
depthEl.textContent = `L${active}`;
|
|
|
|
rulerSpans.forEach((span, i) => {
|
|
span.classList.toggle('active', i === active);
|
|
});
|
|
}
|
|
|
|
window.addEventListener('scroll', updateDepth, { passive: true });
|
|
updateDepth();
|