// Save scroll position
window.onbeforeunload = function() {
localStorage.setItem('scrollPosition', window.scrollY);
};
// Restore scroll position
window.onload = function() {
var scrollPosition = localStorage.getItem('scrollPosition');
if (scrollPosition) {
window.scrollTo(0, scrollPosition);
localStorage.removeItem('scrollPosition'); // Clear saved position after use
}
};