Some checks failed
continuous-integration/drone/push Build is failing
- Удалена старая система портфолио (PortfolioCategory, PortfolioItem) - Расширена модель Project: slug, categories (M2M), thumbnail, media files, meta fields - Объединены категории: ProjectCategory удалена, используется общая Category - Автоматический ресайз thumbnail до 600x400px с умным кропом по центру - Создан /projects/ - страница списка проектов с фильтрацией по категориям - Создан /project/<pk>/ - детальная страница проекта с галереей Swiper - Адаптивный дизайн: 3 карточки в ряд (десктоп), 2 (планшет), 1 (мобильный) - Параллакс-эффект на изображениях при наведении - Lazy loading для оптимизации загрузки - Фильтры категорий в виде пилюль как на странице услуг - Компактные карточки с фиксированной шириной - Кликабельные проекты в service_detail с отображением всех медиа
70 lines
2.5 KiB
JavaScript
70 lines
2.5 KiB
JavaScript
// Modern Scripts for SmartSolTech Website
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
console.log('SmartSolTech: DOM loaded, initializing...');
|
|
|
|
// Hide loading screen
|
|
const loadingScreen = document.getElementById('loading-screen');
|
|
if (loadingScreen) {
|
|
console.log('SmartSolTech: Loading screen found, hiding...');
|
|
setTimeout(() => {
|
|
loadingScreen.style.opacity = '0';
|
|
loadingScreen.style.pointerEvents = 'none';
|
|
setTimeout(() => {
|
|
// Полностью удаляем элемент из DOM
|
|
if (loadingScreen.parentNode) {
|
|
loadingScreen.parentNode.removeChild(loadingScreen);
|
|
console.log('SmartSolTech: Loading screen completely removed from DOM');
|
|
}
|
|
}, 300);
|
|
}, 200); // Уменьшили время ожидания до 200ms
|
|
} else {
|
|
console.log('SmartSolTech: Loading screen not found');
|
|
}
|
|
|
|
// Navbar scroll behavior
|
|
const navbar = document.querySelector('.navbar-modern');
|
|
if (navbar) {
|
|
window.addEventListener('scroll', function() {
|
|
if (window.scrollY > 50) {
|
|
navbar.classList.add('scrolled');
|
|
} else {
|
|
navbar.classList.remove('scrolled');
|
|
}
|
|
});
|
|
}
|
|
|
|
// Smooth scrolling for anchor links
|
|
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
|
|
anchor.addEventListener('click', function (e) {
|
|
const target = document.querySelector(this.getAttribute('href'));
|
|
if (target) {
|
|
e.preventDefault();
|
|
target.scrollIntoView({
|
|
behavior: 'smooth'
|
|
});
|
|
}
|
|
});
|
|
});
|
|
|
|
// Intersection Observer for animations
|
|
const observerOptions = {
|
|
threshold: 0.1,
|
|
rootMargin: '0px 0px -50px 0px'
|
|
};
|
|
|
|
const observer = new IntersectionObserver((entries) => {
|
|
entries.forEach(entry => {
|
|
if (entry.isIntersecting) {
|
|
entry.target.style.opacity = '1';
|
|
entry.target.style.transform = 'translateY(0)';
|
|
}
|
|
});
|
|
}, observerOptions);
|
|
|
|
// Observe cards and service items
|
|
document.querySelectorAll('.card-modern, .service-card, .step-card').forEach(card => {
|
|
observer.observe(card);
|
|
});
|
|
|
|
console.log('SmartSolTech: All scripts loaded successfully');
|
|
}); |