52 lines
2.0 KiB
JavaScript
52 lines
2.0 KiB
JavaScript
// Отладочная версия калькулятора
|
|
console.log('Debug calculator loaded');
|
|
|
|
document.addEventListener('DOMContentLoaded', () => {
|
|
console.log('DOM loaded');
|
|
|
|
// Проверим наличие элементов
|
|
const priceDisplay = document.getElementById('priceDisplay');
|
|
const mobilePriceDisplay = document.getElementById('mobilePriceDisplay');
|
|
|
|
console.log('priceDisplay:', priceDisplay);
|
|
console.log('mobilePriceDisplay:', mobilePriceDisplay);
|
|
|
|
if (priceDisplay) {
|
|
console.log('priceDisplay classes:', priceDisplay.className);
|
|
|
|
// Тестируем показ блока
|
|
setTimeout(() => {
|
|
console.log('Showing price display...');
|
|
priceDisplay.classList.remove('hidden');
|
|
|
|
// Обновляем цену
|
|
const currentPrice = document.getElementById('currentPrice');
|
|
if (currentPrice) {
|
|
currentPrice.textContent = '₩500,000';
|
|
}
|
|
}, 2000);
|
|
}
|
|
|
|
// Добавим обработчики для карточек сервисов
|
|
document.querySelectorAll('.service-card').forEach(card => {
|
|
card.addEventListener('click', () => {
|
|
console.log('Service card clicked:', card.dataset.service);
|
|
|
|
if (priceDisplay) {
|
|
priceDisplay.classList.remove('hidden');
|
|
const currentPrice = document.getElementById('currentPrice');
|
|
if (currentPrice) {
|
|
currentPrice.textContent = '₩750,000';
|
|
}
|
|
}
|
|
|
|
if (mobilePriceDisplay) {
|
|
mobilePriceDisplay.classList.remove('hidden');
|
|
const mobilePriceValue = document.getElementById('mobilePriceValue');
|
|
if (mobilePriceValue) {
|
|
mobilePriceValue.textContent = '₩750,000';
|
|
}
|
|
}
|
|
});
|
|
});
|
|
}); |