Spaces:
Running
Running
Create scripts.js
Browse files- scripts.js +20 -0
scripts.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// Плавная прокрутка к разделу "Контакты"
|
| 2 |
+
function scrollToContact() {
|
| 3 |
+
document.querySelector('#contact').scrollIntoView({ behavior: 'smooth' });
|
| 4 |
+
}
|
| 5 |
+
|
| 6 |
+
// Микроанимация для кнопки при загрузке страницы
|
| 7 |
+
document.addEventListener('DOMContentLoaded', () => {
|
| 8 |
+
const button = document.querySelector('.cta-button');
|
| 9 |
+
button.style.transform = 'scale(0.95)';
|
| 10 |
+
setTimeout(() => {
|
| 11 |
+
button.style.transition = 'transform 0.5s ease';
|
| 12 |
+
button.style.transform = 'scale(1)';
|
| 13 |
+
}, 100);
|
| 14 |
+
});
|
| 15 |
+
|
| 16 |
+
// Предотвращение отправки формы (демо)
|
| 17 |
+
document.querySelector('form').addEventListener('submit', (e) => {
|
| 18 |
+
e.preventDefault();
|
| 19 |
+
alert('Спасибо за заявку! Мы свяжемся с вами скоро.');
|
| 20 |
+
});
|