Live
Upcoming Events
.gallery-tabs-nav {
border-bottom: 2px solid #dee2e6;
margin-bottom: 20px;
}
.gallery-tabs-nav .nav-link {
border: none;
color: #6c757d;
font-weight: 500;
padding: 10px 20px;
cursor: pointer;
}
.gallery-tabs-nav .nav-link.active {
color: #495057;
background-color: #fff;
border-bottom: 3px solid #007bff;
margin-bottom: -2px;
}
.gallery-tabs-nav .nav-link i {
margin-right: 5px;
}
.gallery-section {
display: none;
}
.gallery-section.active {
display: block;
}
@media (max-width: 768px) {
.gallery-tabs-nav .nav-link {
padding: 8px 12px;
font-size: 14px;
}
}
/* Оптимизация рендеринга изображений */
.gallery-section img {
content-visibility: auto;
}
(function() {
function initTabs() {
var tabs = document.querySelectorAll(".gallery-tab");
tabs.forEach(function(tab) {
tab.addEventListener("click", function(e) {
e.preventDefault();
var targetId = this.getAttribute("href").substring(1);
var sectionName = this.dataset.section;
// Скрываем все разделы
document.querySelectorAll(".gallery-section").forEach(function(s) {
s.classList.remove("active");
s.style.display = "none";
});
// Показываем выбранный
var target = document.getElementById(targetId);
if (target) {
target.classList.add("active");
target.style.display = "block";
}
// Обновляем активный таб
document.querySelectorAll(".gallery-tab").forEach(function(t) {
t.classList.remove("active");
});
this.classList.add("active");
// localStorage
try {
localStorage.setItem("activeGalleryTab", "#" + targetId);
} catch(e) {}
return false;
});
});
// Восстановление из localStorage
try {
var saved = localStorage.getItem("activeGalleryTab");
if (saved && document.querySelector(saved)) {
document.querySelectorAll(".gallery-section").forEach(function(s) {
s.classList.remove("active");
s.style.display = "none";
});
var savedSection = document.querySelector(saved);
if (savedSection) {
savedSection.classList.add("active");
savedSection.style.display = "block";
}
document.querySelectorAll(".gallery-tab").forEach(function(t) {
t.classList.remove("active");
});
var savedTab = document.querySelector("a[href='" + saved + "']");
if (savedTab) {
savedTab.classList.add("active");
}
}
} catch(e) {}
}
if (document.readyState === "loading") {
document.addEventListener("DOMContentLoaded", initTabs);
} else {
initTabs();
}
})();