Ваш браузер не поддерживает тег video.
Ваш браузер не поддерживает тег video.
Текущий сервер: Phoenix
Chronicle: High Five, Rates: x50
Гость
Авторизация
Регистрация
Восстановление пароля
Управление аккаунтами (0 / 30)
Аккаунт
Пароль
Скрыть пароль
Создать аккаунт
Новых аккаунтов нет. Вы можете зарегистрировать первый!
(() => { // ======================================================================== // Транслитерация // ======================================================================== const ruToEnLayoutMap = { 'ё': '`', 'й': 'q', 'ц': 'w', 'у': 'e', 'к': 'r', 'е': 't', 'н': 'y', 'г': 'u', 'ш': 'i', 'щ': 'o', 'з': 'p', 'х': '[', 'ъ': ']', 'ф': 'a', 'ы': 's', 'в': 'd', 'а': 'f', 'п': 'g', 'р': 'h', 'о': 'j', 'л': 'k', 'д': 'l', 'ж': ';', 'э': "'", 'я': 'z', 'ч': 'x', 'с': 'c', 'м': 'v', 'и': 'b', 'т': 'n', 'ь': 'm', 'б': ',', 'ю': '.', '.': '/', 'Ё': '~', 'Й': 'Q', 'Ц': 'W', 'У': 'E', 'К': 'R', 'Е': 'T', 'Н': 'Y', 'Г': 'U', 'Ш': 'I', 'Щ': 'O', 'З': 'P', 'Х': '{', 'Ъ': '}', 'Ф': 'A', 'Ы': 'S', 'В': 'D', 'А': 'F', 'П': 'G', 'Р': 'H', 'О': 'J', 'Л': 'K', 'Д': 'L', 'Ж': ':', 'Э': '"', 'Я': 'Z', 'Ч': 'X', 'С': 'C', 'М': 'V', 'И': 'B', 'Т': 'N', 'Ь': 'M', 'Б': '<', 'Ю': '>', ',': '?' }; function transliterate(str) { return Array.from(str).map(char => ruToEnLayoutMap[char] || char).join(''); } function handleTranslitInput(event) { const input = event.target; requestAnimationFrame(() => { const originalValue = input.value; const transliteratedValue = transliterate(originalValue); if (originalValue !== transliteratedValue) { const start = input.selectionStart; const end = input.selectionEnd; input.value = transliteratedValue; input.setSelectionRange(start, end); } }); } document.querySelectorAll('.translit-input').forEach(input => { input.addEventListener('input', handleTranslitInput); }); // ======================================================================== // Генерация логинов и паролей // ======================================================================== function generateSimplePassword() { const digits = '0123456789'; const letters = 'abcdefghijklmnopqrstuvwxyz'; let arr = []; for (let i = 0; i < 4; i++) arr.push(digits[Math.floor(Math.random() * digits.length)]); for (let i = 0; i < 4; i++) arr.push(letters[Math.floor(Math.random() * letters.length)]); for (let i = arr.length - 1; i > 0; i--) { const j = Math.floor(Math.random() * (i + 1)); [arr[i], arr[j]] = [arr[j], arr[i]]; } return arr.join(''); } function generateSimpleLogin() { const chars = 'abcdefghijklmnopqrstuvwxyz0123456789'; let login = ''; for (let i = 0; i < 8; i++) login += chars[Math.floor(Math.random() * chars.length)]; return login; } // ======================================================================== // Единый обработчик кликов для всей страницы (делегирование) // ======================================================================== document.body.addEventListener('click', function (event) { // --- 1. Показать/скрыть пароль --- const showPassBtn = event.target.closest('.input-show-btn'); if (showPassBtn) { const group = showPassBtn.closest('.input-group'); if (group) { const input = group.querySelector('input'); const icon = showPassBtn.querySelector('i'); if (input && icon) { if (input.type === 'password') { input.type = 'text'; icon.classList.remove('fa-eye'); icon.classList.add('fa-eye-slash'); } else { input.type = 'password'; icon.classList.remove('fa-eye-slash'); icon.classList.add('fa-eye'); } } } return; } // --- 2. Генерация логина/пароля --- const genBtn = event.target.closest('.input-generate-btn'); if (genBtn) { const group = genBtn.closest('.input-group'); if (group) { const input = group.querySelector('input'); if (input) { if (input.name === 'login') { input.value = generateSimpleLogin(); } else { input.value = generateSimplePassword(); input.type = 'text'; const showBtnIcon = group.querySelector('.input-show-btn i'); if (showBtnIcon) { showBtnIcon.classList.remove('fa-eye'); showBtnIcon.classList.add('fa-eye-slash'); } } input.dispatchEvent(new Event('input', { bubbles: true })); } } return; } // --- 3. Переключение табов --- const tabButton = event.target.closest('.account-tab-btn'); if (tabButton) { if (tabButton.classList.contains('active')) return; const panelContent = tabButton.closest('.account-details-panel__content'); if (!panelContent) return; panelContent.querySelectorAll('.account-tab-btn').forEach(btn => btn.classList.remove('active')); panelContent.querySelectorAll('.account-tab-content').forEach(content => content.style.display = 'none'); tabButton.classList.add('active'); const activeContent = panelContent.querySelector(`.account-tab-content-${tabButton.dataset.tab}`); if (activeContent) { activeContent.style.display = 'block'; const detailsPanel = panelContent.closest('.account-details-panel'); if (detailsPanel && detailsPanel.style.maxHeight !== '0px' && detailsPanel.style.maxHeight !== '') { requestAnimationFrame(() => { detailsPanel.style.maxHeight = detailsPanel.scrollHeight + 'px'; }); } } return; } // --- 4. Аккордеон аккаунтов --- const accordionHeader = event.target.closest('.account-list__item[role="button"]'); if (accordionHeader) { const wrapper = accordionHeader.closest('.account-list__item-wrapper'); const panel = wrapper.querySelector('.account-details-panel'); const isActive = wrapper.classList.contains('active'); document.querySelectorAll('.account-list__item-wrapper.active').forEach(activeWrapper => { if (activeWrapper !== wrapper) { activeWrapper.classList.remove('active'); activeWrapper.querySelector('.account-details-panel').style.maxHeight = null; } }); if (isActive) { wrapper.classList.remove('active'); panel.style.maxHeight = null; } else { wrapper.classList.add('active'); requestAnimationFrame(() => { panel.style.maxHeight = panel.scrollHeight + 'px'; }); } } }); })();