MediaWiki:Common.js: відмінності між версіями
Wiki (обговорення | внесок) Немає опису редагування |
Wiki (обговорення | внесок) Немає опису редагування |
||
| Рядок 121: | Рядок 121: | ||
}); | }); | ||
// | // Автоматичне визначення тачскріна | ||
function initKioskFeatures() { | |||
const isTouchDevice = 'ontouchstart' in window || navigator.maxTouchPoints > 0; | |||
// | if (isTouchDevice) { | ||
// Додаємо стиль для тачскріна | |||
const style = document.createElement('style'); | |||
style.textContent = ` | |||
.touch-friendly { min-height: 44px; font-size: 18px; } | |||
a { min-height: 44px; display: flex; align-items: center; } | |||
`; | |||
document.head.appendChild(style); | |||
// Додаємо перемикач режиму в футер | |||
const footer = document.querySelector('#footer') || document.body; | |||
const modeSwitcher = document.createElement('div'); | |||
modeSwitcher.innerHTML = ` | |||
<div style="position:fixed; bottom:10px; right:10px; background:#333; color:white; padding:10px; border-radius:5px;"> | |||
📱 Кіосковий режим | | |||
<a href="?kiosk=0" style="color:white;">Звичайний режим</a> | |||
</div> | |||
`; | |||
footer.appendChild(modeSwitcher); | |||
} | } | ||
} | } | ||
// Запускаємо при завантаженні | |||
$(document).ready(initKioskFeatures); | |||