diff --git a/modules/settings/index.js b/modules/settings/index.js index 345146a..fc0f568 100644 --- a/modules/settings/index.js +++ b/modules/settings/index.js @@ -9,7 +9,14 @@ const DEFAULT_SETTINGS = { review_ip_cooldown_minutes: '5', hotel_phone_primary: '89409270080', hotel_phone_additional: '', - hotel_max_link: 'kalugin66' + hotel_whatsapp_num: '89409270080', + hotel_whatsapp_active: 'true', + hotel_telegram_id: '+89409270080', + hotel_telegram_active: 'true', + hotel_max_link: 'kalugin66', + hotel_max_active: 'true', + hotel_instagram_id: '', + hotel_instagram_active: 'true' }; function init(database) { @@ -211,20 +218,34 @@ function setupRoutes(app, authenticateToken, requireAdmin) { res.json({ primary: settings.hotel_phone_primary || '', additional: settings.hotel_phone_additional || '', - maxLink: settings.hotel_max_link || '' + whatsappNum: settings.hotel_whatsapp_num || '', + whatsappActive: settings.hotel_whatsapp_active || 'true', + telegramId: settings.hotel_telegram_id || '', + telegramActive: settings.hotel_telegram_active || 'true', + maxLink: settings.hotel_max_link || '', + maxActive: settings.hotel_max_active || 'true', + instagramId: settings.hotel_instagram_id || '', + instagramActive: settings.hotel_instagram_active || 'true' }); }); }); app.put('/api/admin/settings/phones', authenticateToken, requireAdmin, (req, res) => { - const { primary, additional, maxLink } = req.body; + const { primary, additional, whatsappNum, whatsappActive, telegramId, telegramActive, maxLink, maxActive, instagramId, instagramActive } = req.body; if (!primary || primary.length < 5) { return res.status(400).json({ error: 'Основной номер должен содержать минимум 5 цифр' }); } const updates = []; updates.push(['hotel_phone_primary', primary]); updates.push(['hotel_phone_additional', additional || '']); + updates.push(['hotel_whatsapp_num', whatsappNum || '']); + updates.push(['hotel_whatsapp_active', whatsappActive || 'true']); + updates.push(['hotel_telegram_id', telegramId || '']); + updates.push(['hotel_telegram_active', telegramActive || 'true']); updates.push(['hotel_max_link', maxLink || '']); + updates.push(['hotel_max_active', maxActive || 'true']); + updates.push(['hotel_instagram_id', instagramId || '']); + updates.push(['hotel_instagram_active', instagramActive || 'true']); let processed = 0; updates.forEach(([key, value]) => { set(key, value, (err) => { @@ -243,7 +264,14 @@ function setupRoutes(app, authenticateToken, requireAdmin) { res.json({ phone_primary: settings.hotel_phone_primary || '89409270080', phone_additional: settings.hotel_phone_additional || '', - max_link: settings.hotel_max_link || 'kalugin66' + whatsapp_num: settings.hotel_whatsapp_num || '89409270080', + whatsapp_active: settings.hotel_whatsapp_active || 'true', + telegram_id: settings.hotel_telegram_id || '+89409270080', + telegram_active: settings.hotel_telegram_active || 'true', + max_link: settings.hotel_max_link || 'kalugin66', + max_active: settings.hotel_max_active || 'true', + instagram_id: settings.hotel_instagram_id || '', + instagram_active: settings.hotel_instagram_active || 'true' }); }); }); diff --git a/public/admin.html b/public/admin.html index ed6b1e6..fec4d54 100644 --- a/public/admin.html +++ b/public/admin.html @@ -477,20 +477,60 @@ tr.row-checkout-today { background: #fef2f2 !important; border-left: 4px solid #

- Основной номер используется для звонков, WhatsApp и Telegram. Дополнительный отображается через запятую рядом с основным. + Основной номер используется для звонков. Дополнительный отображается через запятую. Для мессенджеров можно указать отдельные номера или username.

-
+
-
+
+
+
- - + +
+ +
+ + +
+
+
+
+ +
+ +
+ + +
+
+
+
+ +
+ +
+ + +
+
+
+
+
+
+ +
+ +
+ + +
+
@@ -2505,7 +2545,14 @@ async function loadPhoneSettings() { const data = await api('/api/admin/settings/phones'); document.getElementById('phonePrimary').value = data.primary || ''; document.getElementById('phoneAdditional').value = data.additional || ''; + document.getElementById('phoneWhatsappNum').value = data.whatsappNum || ''; + document.getElementById('phoneWhatsappActive').checked = data.whatsappActive === 'true'; + document.getElementById('phoneTelegramId').value = data.telegramId || ''; + document.getElementById('phoneTelegramActive').checked = data.telegramActive === 'true'; document.getElementById('phoneMaxLink').value = data.maxLink || ''; + document.getElementById('phoneMaxActive').checked = data.maxActive === 'true'; + document.getElementById('phoneInstagramId').value = data.instagramId || ''; + document.getElementById('phoneInstagramActive').checked = data.instagramActive === 'true'; } catch(e) {} } @@ -2513,7 +2560,14 @@ async function savePhoneSettings() { const data = { primary: document.getElementById('phonePrimary').value.trim(), additional: document.getElementById('phoneAdditional').value.trim(), - maxLink: document.getElementById('phoneMaxLink').value.trim() + whatsappNum: document.getElementById('phoneWhatsappNum').value.trim(), + whatsappActive: document.getElementById('phoneWhatsappActive').checked ? 'true' : 'false', + telegramId: document.getElementById('phoneTelegramId').value.trim(), + telegramActive: document.getElementById('phoneTelegramActive').checked ? 'true' : 'false', + maxLink: document.getElementById('phoneMaxLink').value.trim(), + maxActive: document.getElementById('phoneMaxActive').checked ? 'true' : 'false', + instagramId: document.getElementById('phoneInstagramId').value.trim(), + instagramActive: document.getElementById('phoneInstagramActive').checked ? 'true' : 'false' }; if (!data.primary) { showToast('Основной номер обязателен', 'error'); diff --git a/public/css/style.css b/public/css/style.css index 9ab3fa6..f4a34cc 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -302,63 +302,92 @@ h1, h2, h3, h4 { background: #25D366; color: #fff; border: none; - padding: clamp(10px, 2vw, 15px) clamp(20px, 4vw, 40px); - border-radius: 50px; + width: 44px; + height: 44px; + border-radius: 50%; font-weight: 700; - font-size: clamp(0.85rem, 1.2vw, 1rem); - letter-spacing: 0.5px; + font-size: 0.85rem; transition: all 0.3s ease; text-decoration: none; display: inline-flex; align-items: center; - gap: 8px; + justify-content: center; + gap: 4px; + padding: 0; } .btn-whatsapp:hover { background: #1ebe57; transform: translateY(-3px); - box-shadow: 0 10px 30px rgba(37,211,102,0.4); + box-shadow: 0 8px 20px rgba(37,211,102,0.4); color: #fff; } .btn-telegram { background: #0088cc; color: #fff; border: none; - padding: clamp(10px, 2vw, 15px) clamp(20px, 4vw, 40px); - border-radius: 50px; + width: 44px; + height: 44px; + border-radius: 50%; font-weight: 700; - font-size: clamp(0.85rem, 1.2vw, 1rem); - letter-spacing: 0.5px; + font-size: 0.85rem; transition: all 0.3s ease; text-decoration: none; display: inline-flex; align-items: center; - gap: 8px; + justify-content: center; + gap: 4px; + padding: 0; } .btn-telegram:hover { background: #0077b5; transform: translateY(-3px); - box-shadow: 0 10px 30px rgba(0,136,204,0.4); + box-shadow: 0 8px 20px rgba(0,136,204,0.4); color: #fff; } .btn-max { background: #471AFF; color: #fff; border: none; - padding: clamp(10px, 2vw, 15px) clamp(20px, 4vw, 40px); - border-radius: 50px; + width: 44px; + height: 44px; + border-radius: 50%; font-weight: 700; - font-size: clamp(0.85rem, 1.2vw, 1rem); - letter-spacing: 0.5px; + font-size: 0.85rem; transition: all 0.3s ease; text-decoration: none; display: inline-flex; align-items: center; - gap: 8px; + justify-content: center; + gap: 4px; + padding: 0; } .btn-max:hover { background: #3b15d9; transform: translateY(-3px); - box-shadow: 0 10px 30px rgba(71,26,255,0.4); + box-shadow: 0 8px 20px rgba(71,26,255,0.4); + color: #fff; +} +.btn-instagram { + background: #E4405F; + color: #fff; + border: none; + width: 44px; + height: 44px; + border-radius: 50%; + font-weight: 700; + font-size: 0.85rem; + transition: all 0.3s ease; + text-decoration: none; + display: inline-flex; + align-items: center; + justify-content: center; + gap: 4px; + padding: 0; +} +.btn-instagram:hover { + background: #d12e4e; + transform: translateY(-3px); + box-shadow: 0 8px 20px rgba(228,64,95,0.4); color: #fff; } .max-icon-circle { @@ -375,6 +404,25 @@ h1, h2, h3, h4 { line-height: 1; flex-shrink: 0; } +.max-icon-circle-footer { + display: inline-flex; + align-items: center; + justify-content: center; + width: 1.2em; + height: 1.2em; + border-radius: 50%; + background: rgba(255,255,255,0.15); + color: rgba(255,255,255,0.6); + font-weight: 800; + font-size: 0.7em; + line-height: 1; + flex-shrink: 0; + transition: all 0.3s ease; +} +.footer-social a:hover .max-icon-circle-footer { + background: #471AFF; + color: #fff; +} .hero-stats { position: absolute; bottom: clamp(20px, 5vw, 60px); @@ -1533,10 +1581,16 @@ h1, h2, h3, h4 { font-size: 0.65rem; padding: 5px 12px; } - .btn-gold, .btn-outline-white, .btn-whatsapp, .btn-telegram, .btn-max { + .btn-gold, .btn-outline-white { padding: 10px 18px; font-size: 0.8rem; } + .btn-whatsapp, .btn-telegram, .btn-max, .btn-instagram { + width: 38px; + height: 38px; + font-size: 0.75rem; + padding: 0; + } .float-phone { width: 45px; height: 45px; diff --git a/public/index.html b/public/index.html index 7ba8540..24e3978 100644 --- a/public/index.html +++ b/public/index.html @@ -61,9 +61,10 @@
@@ -680,9 +681,10 @@
@@ -857,18 +859,34 @@ .then(function(cfg) { var primary = cfg.phone_primary || '89409270080'; var additional = cfg.phone_additional || ''; + var whatsappNum = cfg.whatsapp_num || primary; + var whatsappActive = cfg.whatsapp_active || 'true'; + var telegramId = cfg.telegram_id || ('+' + primary); + var telegramActive = cfg.telegram_active || 'true'; var maxLink = cfg.max_link || 'kalugin66'; + var maxActive = cfg.max_active || 'true'; + var instagramId = cfg.instagram_id || ''; + var instagramActive = cfg.instagram_active || 'true'; var displayText = formatPhone(primary); if (additional) displayText += ', ' + formatPhone(additional); document.querySelectorAll('[data-phone]').forEach(function(el) { var type = el.getAttribute('data-phone'); var href = '#'; + var active = true; if (type === 'tel') href = 'tel:' + primary; - else if (type === 'wa') href = 'https://wa.me/' + primary; - else if (type === 'tg') href = 'https://t.me/+' + primary; - else if (type === 'max') href = 'https://max.ru/' + maxLink; + else if (type === 'wa') { href = 'https://wa.me/' + whatsappNum; active = whatsappActive === 'true'; } + else if (type === 'tg') { + href = 'https://t.me/' + telegramId; + active = telegramActive === 'true'; + } + else if (type === 'max') { href = 'https://max.ru/' + maxLink; active = maxActive === 'true'; } + else if (type === 'ig') { + if (instagramId) href = 'https://instagram.com/' + instagramId; + active = instagramActive === 'true'; + } el.setAttribute('href', href); + if (!active) el.style.display = 'none'; }); document.querySelectorAll('[data-phone-text]').forEach(function(el) {