Download script.js from M54/damdam: direct link, hf CLI and curl.
- Browser
- Download file 1.23 kB
-
https://huggingface.co/spaces/M54/damdam/resolve/main/script.js
- Command line
-
hf download hf://spaces/M54/damdam/script.js
-
curl -L -o script.js https://huggingface.co/spaces/M54/damdam/resolve/main/script.js
1.23 kB
| // Основные функции для сайта | |
| document.addEventListener('DOMContentLoaded', function() { | |
| // Инициализация галерей изображений | |
| initImageGalleries(); | |
| // Обработчики событий для мобильного меню | |
| setupMobileMenu(); | |
| }); | |
| function initImageGalleries() { | |
| document.querySelectorAll('.gallery-trigger').forEach(trigger => { | |
| trigger.addEventListener('click', function() { | |
| const galleryId = this.getAttribute('data-gallery'); | |
| const gallery = document.getElementById(galleryId); | |
| gallery.classList.toggle('hidden'); | |
| }); | |
| }); | |
| } | |
| function setupMobileMenu() { | |
| const mobileMenuButton = document.getElementById('mobile-menu-button'); | |
| const mobileMenu = document.getElementById('mobile-menu'); | |
| if (mobileMenuButton && mobileMenu) { | |
| mobileMenuButton.addEventListener('click', function() { | |
| mobileMenu.classList.toggle('hidden'); | |
| }); | |
| } | |
| } | |
| // Функция для форматирования телефона | |
| function formatPhoneNumber(phone) { | |
| return phone.replace(/(\d{1})(\d{3})(\d{3})(\d{2})(\d{2})/, '+$1 ($2) $3-$4-$5'); | |
| } |