Backup database and code changes - 2025-06-08 20:51:14
This commit is contained in:
@@ -651,7 +651,7 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
return;
|
||||
}
|
||||
|
||||
function renderPage(page) {
|
||||
function renderPage(page, shouldScroll = false) {
|
||||
// Hide all articles
|
||||
allArticles.forEach(article => {
|
||||
article.style.display = 'none';
|
||||
@@ -682,11 +682,13 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
}
|
||||
window.history.replaceState({}, '', newUrl);
|
||||
|
||||
// Scroll to articles section
|
||||
articlesGrid.scrollIntoView({
|
||||
behavior: 'smooth',
|
||||
block: 'start'
|
||||
});
|
||||
// Only scroll to articles section when navigating between pages
|
||||
if (shouldScroll) {
|
||||
articlesGrid.scrollIntoView({
|
||||
behavior: 'smooth',
|
||||
block: 'start'
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Event listeners
|
||||
@@ -694,7 +696,7 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
e.preventDefault();
|
||||
if (currentPage > 1) {
|
||||
currentPage--;
|
||||
renderPage(currentPage);
|
||||
renderPage(currentPage, true);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -702,12 +704,12 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
e.preventDefault();
|
||||
if (currentPage < totalPages) {
|
||||
currentPage++;
|
||||
renderPage(currentPage);
|
||||
renderPage(currentPage, true);
|
||||
}
|
||||
});
|
||||
|
||||
// Initialize first page
|
||||
renderPage(currentPage);
|
||||
// Initialize first page (don't scroll on initial load)
|
||||
renderPage(currentPage, false);
|
||||
|
||||
// Add CSS animation for article transitions
|
||||
const style = document.createElement('style');
|
||||
|
||||
Reference in New Issue
Block a user