Обновление стилей и функционала главной страницы, добавление новых изображений и замена логотипа на SVG
This commit is contained in:
@@ -196,7 +196,7 @@ function initNavbarScroll() {
|
||||
const header = document.querySelector('.header');
|
||||
let lastScrollY = window.scrollY;
|
||||
|
||||
window.addEventListener('scroll', () => {
|
||||
const handleScroll = throttle(() => {
|
||||
const currentScrollY = window.scrollY;
|
||||
|
||||
if (currentScrollY > 100) {
|
||||
@@ -215,7 +215,9 @@ function initNavbarScroll() {
|
||||
}
|
||||
|
||||
lastScrollY = currentScrollY;
|
||||
});
|
||||
}, 16); // ~60fps
|
||||
|
||||
window.addEventListener('scroll', handleScroll, { passive: true });
|
||||
}
|
||||
|
||||
// Initialize Yandex Map
|
||||
@@ -315,7 +317,7 @@ function initActiveNavigation() {
|
||||
});
|
||||
}, 100);
|
||||
|
||||
window.addEventListener('scroll', highlightNavigation);
|
||||
window.addEventListener('scroll', highlightNavigation, { passive: true });
|
||||
}
|
||||
|
||||
// Initialize active navigation
|
||||
@@ -388,34 +390,6 @@ document.addEventListener('DOMContentLoaded', initImageLoading);
|
||||
|
||||
// Accessibility improvements
|
||||
function initAccessibility() {
|
||||
// Skip to main content link
|
||||
const skipLink = document.createElement('a');
|
||||
skipLink.href = '#main';
|
||||
skipLink.textContent = 'Перейти к основному содержанию';
|
||||
skipLink.className = 'skip-link';
|
||||
skipLink.style.cssText = `
|
||||
position: absolute;
|
||||
top: -40px;
|
||||
left: 6px;
|
||||
background: #218F36;
|
||||
color: white;
|
||||
padding: 8px;
|
||||
text-decoration: none;
|
||||
border-radius: 4px;
|
||||
z-index: 1001;
|
||||
transition: top 0.3s;
|
||||
`;
|
||||
|
||||
skipLink.addEventListener('focus', function() {
|
||||
this.style.top = '6px';
|
||||
});
|
||||
|
||||
skipLink.addEventListener('blur', function() {
|
||||
this.style.top = '-40px';
|
||||
});
|
||||
|
||||
document.body.insertBefore(skipLink, document.body.firstChild);
|
||||
|
||||
// Add main id to main element
|
||||
const main = document.querySelector('main');
|
||||
if (main && !main.id) {
|
||||
|
||||
Reference in New Issue
Block a user