Spaces:
Running
Running
Create script.js
Browse files
script.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// Плавный скролл для навигации
|
| 2 |
+
document.querySelectorAll('.nav a').forEach(anchor => {
|
| 3 |
+
anchor.addEventListener('click', function(e) {
|
| 4 |
+
e.preventDefault();
|
| 5 |
+
const section = document.querySelector(this.getAttribute('href'));
|
| 6 |
+
section.scrollIntoView({ behavior: 'smooth' });
|
| 7 |
+
});
|
| 8 |
+
});
|
| 9 |
+
|
| 10 |
+
// Анимация появления карточек при прокрутке
|
| 11 |
+
const cards = document.querySelectorAll('.service-card');
|
| 12 |
+
const observer = new IntersectionObserver((entries) => {
|
| 13 |
+
entries.forEach(entry => {
|
| 14 |
+
if (entry.isIntersecting) {
|
| 15 |
+
entry.target.style.opacity = '1';
|
| 16 |
+
entry.target.style.transform = 'translateY(0)';
|
| 17 |
+
}
|
| 18 |
+
});
|
| 19 |
+
}, { threshold: 0.5 });
|
| 20 |
+
|
| 21 |
+
cards.forEach(card => {
|
| 22 |
+
card.style.opacity = '0';
|
| 23 |
+
card.style.transform = 'translateY(50px)';
|
| 24 |
+
card.style.transition = 'all 0.5s ease-in-out';
|
| 25 |
+
observer.observe(card);
|
| 26 |
+
});
|
| 27 |
+
|
| 28 |
+
// Кнопка CTA с эффектом
|
| 29 |
+
document.querySelector('.cta-btn').addEventListener('click', () => {
|
| 30 |
+
alert('Спасибо за интерес! Свяжитесь с нами для обсуждения проекта.');
|
| 31 |
+
});
|