Update toc.js
This commit is contained in:
@@ -78,10 +78,6 @@ document.addEventListener('DOMContentLoaded', function () {
|
|||||||
document.documentElement.style.setProperty('--zeitfresser-toc-width', tocWidth + 'px');
|
document.documentElement.style.setProperty('--zeitfresser-toc-width', tocWidth + 'px');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* ✅ FINAL: Footer Collision ohne Layout-Bruch
|
|
||||||
* Nutzt nur transform statt top/position
|
|
||||||
*/
|
|
||||||
function handleFooterCollision() {
|
function handleFooterCollision() {
|
||||||
if (!isDesktop()) {
|
if (!isDesktop()) {
|
||||||
toc.style.transform = '';
|
toc.style.transform = '';
|
||||||
@@ -94,7 +90,7 @@ document.addEventListener('DOMContentLoaded', function () {
|
|||||||
var footerRect = footer.getBoundingClientRect();
|
var footerRect = footer.getBoundingClientRect();
|
||||||
var tocRect = toc.getBoundingClientRect();
|
var tocRect = toc.getBoundingClientRect();
|
||||||
|
|
||||||
var offset = 40; // finaler Abstand
|
var offset = 40;
|
||||||
var triggerOffset = Math.min(200, window.innerHeight * 0.2);
|
var triggerOffset = Math.min(200, window.innerHeight * 0.2);
|
||||||
|
|
||||||
var overlap = tocRect.bottom - (footerRect.top - triggerOffset);
|
var overlap = tocRect.bottom - (footerRect.top - triggerOffset);
|
||||||
@@ -165,7 +161,7 @@ document.addEventListener('DOMContentLoaded', function () {
|
|||||||
|
|
||||||
window.requestAnimationFrame(function () {
|
window.requestAnimationFrame(function () {
|
||||||
syncPosition();
|
syncPosition();
|
||||||
handleFooterCollision(); // 👈 stabil integriert
|
handleFooterCollision();
|
||||||
updateProgress();
|
updateProgress();
|
||||||
updateActiveHeading();
|
updateActiveHeading();
|
||||||
ticking = false;
|
ticking = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user