diff --git a/templates/index.html b/templates/index.html
index 2aa0d49..cb3f864 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -333,6 +333,9 @@
const toggle = document.getElementById('lengthToggle');
const paper = document.querySelector('.cv-paper');
+ // Save current scroll position
+ const currentScrollY = window.scrollY || window.pageYOffset;
+
if (toggle.checked) {
paper.classList.add('cv-long');
paper.classList.remove('cv-short');
@@ -340,6 +343,11 @@
paper.classList.add('cv-short');
paper.classList.remove('cv-long');
}
+
+ // Restore scroll position after DOM updates
+ requestAnimationFrame(() => {
+ window.scrollTo(0, currentScrollY);
+ });
}
function toggleLogos() {