Spaces:
Running
Running
теперь есть проблема с генерацией наказаний формы для /offban. Выводит /offban 24X7 3 3 дня | Оскорбление проекта/администрации[Жалобы на нефракционных игроков 543197] | По просьбе Dmytriy Flatcher, а должно быть /offban 24X7 3 Оскорбление проекта/администрация [Жалобы на нефракционных игроков 543197] | По просьбе Dmytriy Flatcher - Follow Up Deployment
89d1c76 verified Download index.html from flatcher/radmir-admin-config: direct link, hf CLI and curl.
- Browser
- Download file 33.4 kB
-
https://huggingface.co/spaces/flatcher/radmir-admin-config/resolve/main/index.html
- Command line
-
hf download hf://spaces/flatcher/radmir-admin-config/index.html
-
curl -L -o index.html https://huggingface.co/spaces/flatcher/radmir-admin-config/resolve/main/index.html
33.4 kB
| <html lang="ru"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Генератор наказаний RADMIR RP</title> | |
| <script src="https://cdn.tailwindcss.com"></script> | |
| <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"> | |
| <style> | |
| .fade-in { | |
| animation: fadeIn 0.3s ease-in-out; | |
| } | |
| @keyframes fadeIn { | |
| from { opacity: 0; transform: translateY(10px); } | |
| to { opacity: 1; transform: translateY(0); } | |
| } | |
| .select-arrow { | |
| background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e"); | |
| background-position: right 0.5rem center; | |
| background-repeat: no-repeat; | |
| background-size: 1.5em 1.5em; | |
| padding-right: 2.5rem; | |
| -webkit-print-color-adjust: exact; | |
| print-color-adjust: exact; | |
| } | |
| .copy-btn { | |
| transition: all 0.2s ease; | |
| } | |
| .copy-btn:hover { | |
| transform: scale(1.05); | |
| } | |
| .copy-btn:active { | |
| transform: scale(0.95); | |
| } | |
| .tooltip { | |
| position: relative; | |
| display: inline-block; | |
| } | |
| .tooltip .tooltiptext { | |
| visibility: hidden; | |
| width: 200px; | |
| background-color: #333; | |
| color: #fff; | |
| text-align: center; | |
| border-radius: 6px; | |
| padding: 5px; | |
| position: absolute; | |
| z-index: 1; | |
| bottom: 125%; | |
| left: 50%; | |
| margin-left: -100px; | |
| opacity: 0; | |
| transition: opacity 0.3s; | |
| } | |
| .tooltip:hover .tooltiptext { | |
| visibility: visible; | |
| opacity: 1; | |
| } | |
| </style> | |
| </head> | |
| <body class="bg-gray-100 min-h-screen"> | |
| <div class="container mx-auto px-4 py-8"> | |
| <div class="max-w-4xl mx-auto bg-white rounded-lg shadow-lg overflow-hidden"> | |
| <!-- Header --> | |
| <div class="bg-blue-600 text-white px-6 py-4"> | |
| <div class="flex items-center justify-between"> | |
| <div> | |
| <h1 class="text-2xl font-bold">Генератор наказаний RADMIR RP</h1> | |
| <p class="text-blue-100">Создавайте формы наказаний для игроков</p> | |
| </div> | |
| <div class="flex items-center space-x-2"> | |
| <img src="https://radmir-rp.ru/templates/Default/images/logo.png" alt="RADMIR RP" class="h-12"> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Main Content --> | |
| <div class="p-6"> | |
| <div id="form-container"> | |
| <div class="text-center mb-8"> | |
| <button id="create-form-btn" class="bg-blue-600 hover:bg-blue-700 text-white font-bold py-3 px-6 rounded-lg transition duration-200 transform hover:scale-105"> | |
| <i class="fas fa-plus-circle mr-2"></i> Создать форму наказания | |
| </button> | |
| </div> | |
| </div> | |
| <!-- Generated Command --> | |
| <div id="result-container" class="hidden mt-8 bg-gray-50 p-4 rounded-lg border border-gray-200"> | |
| <div class="flex items-center justify-between mb-2"> | |
| <h3 class="font-bold text-lg text-gray-800">Сгенерированная команда:</h3> | |
| <button id="copy-btn" class="copy-btn bg-blue-600 hover:bg-blue-700 text-white px-3 py-1 rounded text-sm"> | |
| <i class="fas fa-copy mr-1"></i> Копировать | |
| </button> | |
| </div> | |
| <div id="generated-command" class="bg-white p-3 rounded border border-gray-300 font-mono text-gray-800 overflow-x-auto"></div> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Footer --> | |
| <div class="mt-8 text-center text-gray-500 text-sm"> | |
| <p>RADMIR RP Punishment Generator © 2023 | Для администраторов сервера</p> | |
| </div> | |
| </div> | |
| <script> | |
| document.addEventListener('DOMContentLoaded', function() { | |
| const formContainer = document.getElementById('form-container'); | |
| const createFormBtn = document.getElementById('create-form-btn'); | |
| const resultContainer = document.getElementById('result-container'); | |
| const generatedCommand = document.getElementById('generated-command'); | |
| const copyBtn = document.getElementById('copy-btn'); | |
| // Punishment types and their options | |
| const punishmentTypes = { | |
| '/offajail': { name: 'Деморган', durationField: false }, | |
| '/offwarn': { name: 'Варн', durationField: false }, | |
| '/offmuteic': { name: 'Мут IC чата', durationField: false }, | |
| '/offmuteooc': { name: 'Мут OOC чата', durationField: false }, | |
| '/offban': { name: 'Бан аккаунта', durationField: false } | |
| }; | |
| // Punishment reasons with automatic durations | |
| const punishmentReasons = { | |
| '/offajail': { | |
| 'DM': { duration: 180, text: 'DM (Deathmatch)' }, | |
| 'PG': { duration: 80, text: 'PG (Player Game)' }, | |
| 'Skip Gun': { duration: 40, text: 'Скип оружия перед смертью' }, | |
| 'Таран': { duration: 40, text: 'Таран' }, | |
| 'Массовый таран': { duration: 80, text: 'Массовый таран' }, | |
| 'Стрельба с крупного калибра': { duration: 40, text: 'Стрельба с крупного калибра на вод.месте' }, | |
| 'Провокация гос. служащих': { duration: 40, text: 'Провокация гос. служащих' }, | |
| 'NonRP поведение': { duration: 50, text: 'NonRP поведение (другие случаи не описанные выше)' }, | |
| 'NonRP Drive': { duration: 40, text: 'NonRP Drive' }, | |
| 'Проникновение на ФЗ': { duration: 90, text: 'Проникновение на ФЗ на автомобиле' }, | |
| 'Багоюз': { duration: 60, text: 'Багоюз' }, | |
| 'ДМ/ДБ на слёте': { duration: 180, text: 'ДМ/ДБ на слёте дома/бизнеса' }, | |
| 'Нарушение NLR': { duration: 60, text: 'Нарушение NLR (правила новой жизни)' }, | |
| 'Обман в /do': { duration: 120, text: 'Обман в /do' }, | |
| 'Хилл в бою': { duration: 60, text: 'Хилл в бою' }, | |
| 'Добивание игрока': { duration: 60, text: 'Добивание игрока в нокнутом состояние' }, | |
| 'Байт на ДМ': { duration: 60, text: 'Байт на ДМ' }, | |
| 'Нарушение правила ограбления': { duration: 60, text: 'Нарушение правила Oграбление/Похищение' }, | |
| 'Нарушение правил поставки': { duration: 75, text: 'Нарушение правил поставки' }, | |
| 'Нарушение правил красной зоны': { duration: 60, text: 'Нарушение правил красной зоны' }, | |
| 'ПГ респы': { duration: 80, text: 'ПГ респы (Любые криминальные действия на респе чужой мафии)' } | |
| }, | |
| '/offwarn': { | |
| 'SK': { duration: 90, text: 'SK (Suicide Kill)', warnDuration: 12 }, | |
| 'TK': { duration: 90, text: 'TK (Team Kill)', warnDuration: 7 }, | |
| 'RevengeKill': { duration: 180, text: 'RevengeKill (Убийства с целью мести)', warnDuration: 7 }, | |
| 'RepeatKill': { duration: 180, text: 'RepeatKill (Повторное убийство)', warnDuration: 7 }, | |
| 'RK на ящике': { duration: 180, text: 'RK на ящике', warnDuration: 7 }, | |
| 'DM в ZZ': { duration: 180, text: 'DM в ZZ (Зона охоты, сбор ресурсов)', warnDuration: 7 }, | |
| 'ДМ сотрудников LSMC/SSMC': { duration: 180, text: 'ДМ сотрудников LSMC/SSMC без веской IC причины', warnDuration: 7 }, | |
| 'Массовый ДМ': { duration: 180, text: 'Массовый ДМ (Намеренное убийство невинных игроков)', warnDuration: 14 }, | |
| 'NonRP обыск': { duration: 120, text: 'NonRP обыск', warnDuration: 7 }, | |
| 'Ограбление/похищении в ZZ': { duration: 60, text: 'Ограбление/похищении в ZZ', warnDuration: 7 }, | |
| 'Похищение по nonRP информации': { duration: 60, text: 'Похищение по nonRP информации', warnDuration: 7 }, | |
| 'Грубое nonRP Поведение Гос': { duration: 120, text: 'Грубое nonRP Поведение Гос. служащих', warnDuration: 7 }, | |
| 'NonRP Cop': { duration: 120, text: 'NonRP Cop', warnDuration: 7 }, | |
| 'Нарушение правил КЗ (Гос)': { duration: 180, text: 'Нарушение правил КЗ (Гос)', warnDuration: 10.5 }, | |
| 'Уход от РП': { duration: 180, text: 'Уход от РП', warnDuration: 5 }, | |
| 'В гос. и в крайм одновременно': { duration: 60, text: 'В гос. и в крайм одновременно', warnDuration: 7 }, | |
| 'Слив карет': { duration: 60, text: 'Слив карет', warnDuration: 7 }, | |
| 'Веский багоюз': { duration: 90, text: 'Веский багоюз', warnDuration: 7 } | |
| }, | |
| '/offmuteic': { | |
| 'Разговор в агониях': { duration: 30, text: 'Разговор в агониях' }, | |
| 'Бред в /me /do /try /todo': { duration: 30, text: 'Бред в /me | /do | /try | /todo' }, | |
| 'Транслит в IC чат': { duration: 30, text: 'Транслит в IC чат' }, | |
| 'MG в голосовом чате/IC чат': { duration: 20, text: 'MG в голосовом чате/IC чат' }, | |
| 'НПП 3.1': { duration: 4320, text: 'НПП 3.1 | Общение в РП ситуации на другом языке' } | |
| }, | |
| '/offmuteooc': { | |
| 'Offtop/Мат/Капс/Оск в репорт или ask': { duration: 30, text: 'Offtop/Мат/Капс/Оск в репорт или ask' }, | |
| 'Оскорбление в ООС чат': { duration: 90, text: 'Оскорбление в ООС чат' }, | |
| 'Угрозы в ООС чат': { duration: 300, text: 'Угрозы в ООС чат' }, | |
| 'Мат в ООС чат': { duration: 30, text: 'Мат в ООС чат (Неадекватство, многократный мат в ООС)' }, | |
| 'Флуд': { duration: 30, text: 'Флуд' }, | |
| 'Caps в OОС/IC чат': { duration: 20, text: 'Caps в OОС/IC чат' }, | |
| 'Offtop in /db': { duration: 90, text: 'Offtop in /db' }, | |
| 'Неуважительное общение с Администрацией': { duration: 180, text: 'Неуважительное общение с Администрацией' } | |
| }, | |
| '/offban': { | |
| 'Оскорбление проекта/администрации': { duration: 3, text: 'Оскорбление проекта/администрации' }, | |
| 'Оскорбление национальности/по расовым признакам': { duration: 7, text: 'Оскорбление национальности/по расовым признакам/розжиг меж. национальности' }, | |
| 'Уход от наказания': { duration: 10, text: 'Уход от наказания' }, | |
| 'Сексуальные действия без согласия': { duration: 7, text: 'Сексуальные действия без согласия второй стороны' }, | |
| 'Продажа виртов': { duration: 36500, text: 'Продажа виртов' }, | |
| 'Покупка виртов': { duration: 365, text: 'Покупка виртов' }, | |
| 'Попытка покупки виртов': { duration: 22, text: 'Попытка покупки виртов' }, | |
| 'Слив фракции/слив склада': { duration: 30, text: 'Слив фракции/слив склада' }, | |
| 'Обман администрации/игроков': { duration: 18.5, text: 'Обман администрации/игроков на игровое имущество/валюту' }, | |
| 'Оскорбление родных': { duration: 5, text: 'Оскорбление родных или их упоминание в оскорбительном ключе' }, | |
| 'Реклама сторонних ресурсов': { duration: 30, text: 'Реклама сторонних ресурсов' }, | |
| 'Распространение/Использование читов': { duration: 190, text: 'Распространение/Использование любых доп. софтов' }, | |
| 'Просьбы, вымогательства чужих паролей': { duration: 36500, text: 'Просьбы, вымогательства чужих паролей' }, | |
| 'Реклама продавцов виртов': { duration: 36500, text: 'Любая реклама продавцов виртов и их групп' }, | |
| 'Обход системы': { duration: 30, text: 'Обход системы (передача валюты путем продажи/покупки авто)' }, | |
| 'Покупка/продажа/передача аккаунтов': { duration: 36500, text: 'Запрещена покупка/продажа/передача аккаунтов' }, | |
| 'Огромное кол-во наказаний': { duration: 5, text: 'Огромное кол-во наказаний за неделю' }, | |
| 'Обмен валютой/имуществом между серверами': { duration: 30, text: 'Обмен валютой/имуществом между серверами' }, | |
| 'Оскорбительные ники': { duration: 7, text: 'Оскорбительные ники' }, | |
| 'Выталкивание а/м из GZ': { duration: 5, text: 'Выталкивание а/м из GZ с целью взлома' }, | |
| 'Взлом а/м в ZZ/GZ': { duration: 7.5, text: 'Взлом а/м в ZZ/GZ' }, | |
| 'BanWord': { duration: 5, text: 'BanWord — За дискриминацию' }, | |
| 'Гуру казино': { duration: 30, text: 'Гуру казино' }, | |
| 'Удаление доказательств с форума': { duration: 5, text: 'Удаление доказательств с форума' }, | |
| 'Угрозы докса': { duration: 90, text: 'Угрозы докса, провокация игрока информацией из личной жизни' }, | |
| 'Докс игрока/Администратора': { duration: 36500, text: 'Докс игрока/Администратора' } | |
| } | |
| }; | |
| // Create form elements | |
| createFormBtn.addEventListener('click', function() { | |
| formContainer.innerHTML = ''; | |
| // Create punishment type select | |
| const typeDiv = document.createElement('div'); | |
| typeDiv.className = 'mb-6 fade-in'; | |
| typeDiv.innerHTML = ` | |
| <label for="punishment-type" class="block text-gray-700 font-bold mb-2">Тип наказания:</label> | |
| <select id="punishment-type" class="select-arrow w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500"> | |
| ${Object.entries(punishmentTypes).map(([value, {name}]) => | |
| `<option value="${value}">${value} - ${name}</option>` | |
| ).join('')} | |
| </select> | |
| `; | |
| formContainer.appendChild(typeDiv); | |
| // Create CID input | |
| const cidDiv = document.createElement('div'); | |
| cidDiv.className = 'mb-6 fade-in'; | |
| cidDiv.innerHTML = ` | |
| <label for="player-cid" class="block text-gray-700 font-bold mb-2">CID игрока:</label> | |
| <input type="text" id="player-cid" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500" placeholder="Введите CID игрока"> | |
| `; | |
| formContainer.appendChild(cidDiv); | |
| // Create reason select (will be populated based on punishment type) | |
| const reasonDiv = document.createElement('div'); | |
| reasonDiv.className = 'mb-6 fade-in'; | |
| reasonDiv.innerHTML = ` | |
| <label for="punishment-reason" class="block text-gray-700 font-bold mb-2">Причина наказания:</label> | |
| <select id="punishment-reason" class="select-arrow w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500"> | |
| <option value="">Выберите причину...</option> | |
| </select> | |
| `; | |
| formContainer.appendChild(reasonDiv); | |
| // Create custom duration input (hidden by default) | |
| const durationDiv = document.createElement('div'); | |
| durationDiv.className = 'mb-6 fade-in hidden'; | |
| durationDiv.id = 'custom-duration-container'; | |
| durationDiv.innerHTML = ` | |
| <label for="custom-duration" class="block text-gray-700 font-bold mb-2">Длительность наказания (минуты/дни):</label> | |
| <input type="number" id="custom-duration" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500" placeholder="Введите длительность"> | |
| `; | |
| formContainer.appendChild(durationDiv); | |
| // Create source type radio buttons | |
| const sourceDiv = document.createElement('div'); | |
| sourceDiv.className = 'mb-6 fade-in'; | |
| sourceDiv.innerHTML = ` | |
| <label class="block text-gray-700 font-bold mb-2">Источник наказания:</label> | |
| <div class="flex items-center space-x-6"> | |
| <label class="inline-flex items-center"> | |
| <input type="radio" name="source-type" value="forum" class="form-radio text-blue-600" checked> | |
| <span class="ml-2">По форуму</span> | |
| </label> | |
| <label class="inline-flex items-center"> | |
| <input type="radio" name="source-type" value="request" class="form-radio text-blue-600"> | |
| <span class="ml-2">По просьбе</span> | |
| </label> | |
| <label class="inline-flex items-center"> | |
| <input type="radio" name="source-type" value="both" class="form-radio text-blue-600"> | |
| <span class="ml-2">Оба варианта</span> | |
| </label> | |
| </div> | |
| `; | |
| formContainer.appendChild(sourceDiv); | |
| // Create forum ID input (shown when forum or both is selected) | |
| const forumIdDiv = document.createElement('div'); | |
| forumIdDiv.className = 'mb-6 fade-in'; | |
| forumIdDiv.id = 'forum-id-container'; | |
| forumIdDiv.innerHTML = ` | |
| <label for="forum-id" class="block text-gray-700 font-bold mb-2">ID жалобы на форуме:</label> | |
| <input type="text" id="forum-id" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500" placeholder="Введите ID жалобы"> | |
| `; | |
| formContainer.appendChild(forumIdDiv); | |
| // Create admin name input | |
| const adminDiv = document.createElement('div'); | |
| adminDiv.className = 'mb-6 fade-in'; | |
| adminDiv.innerHTML = ` | |
| <label for="admin-name" class="block text-gray-700 font-bold mb-2">Ваш ник (опционально):</label> | |
| <input type="text" id="admin-name" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500" placeholder="Введите ваш ник"> | |
| `; | |
| formContainer.appendChild(adminDiv); | |
| // Create generate button | |
| const generateDiv = document.createElement('div'); | |
| generateDiv.className = 'text-center fade-in'; | |
| generateDiv.innerHTML = ` | |
| <button id="generate-btn" class="bg-green-600 hover:bg-green-700 text-white font-bold py-3 px-6 rounded-lg transition duration-200 transform hover:scale-105"> | |
| <i class="fas fa-magic mr-2"></i> Сгенерировать команду | |
| </button> | |
| `; | |
| formContainer.appendChild(generateDiv); | |
| // Add event listeners | |
| const punishmentTypeSelect = document.getElementById('punishment-type'); | |
| const punishmentReasonSelect = document.getElementById('punishment-reason'); | |
| const sourceTypeRadios = document.querySelectorAll('input[name="source-type"]'); | |
| // Update reasons when punishment type changes | |
| punishmentTypeSelect.addEventListener('change', function() { | |
| updateReasons(); | |
| // Show/hide custom duration field | |
| const customDurationContainer = document.getElementById('custom-duration-container'); | |
| if (punishmentTypes[this.value].durationField) { | |
| customDurationContainer.classList.remove('hidden'); | |
| } else { | |
| customDurationContainer.classList.add('hidden'); | |
| } | |
| }); | |
| // Update forum ID field visibility based on source type | |
| sourceTypeRadios.forEach(radio => { | |
| radio.addEventListener('change', function() { | |
| const forumIdContainer = document.getElementById('forum-id-container'); | |
| if (this.value === 'forum' || this.value === 'both') { | |
| forumIdContainer.classList.remove('hidden'); | |
| } else { | |
| forumIdContainer.classList.add('hidden'); | |
| } | |
| }); | |
| }); | |
| // Generate command button | |
| document.getElementById('generate-btn').addEventListener('click', generateCommand); | |
| // Initial setup | |
| updateReasons(); | |
| }); | |
| // Update reasons dropdown based on selected punishment type | |
| function updateReasons() { | |
| const punishmentType = document.getElementById('punishment-type').value; | |
| const punishmentReasonSelect = document.getElementById('punishment-reason'); | |
| // Clear existing options | |
| punishmentReasonSelect.innerHTML = '<option value="">Выберите причину...</option>'; | |
| // Add new options | |
| if (punishmentReasons[punishmentType]) { | |
| Object.entries(punishmentReasons[punishmentType]).forEach(([reason, {text}]) => { | |
| const option = document.createElement('option'); | |
| option.value = reason; | |
| option.textContent = text; | |
| punishmentReasonSelect.appendChild(option); | |
| }); | |
| } | |
| } | |
| // Generate the command | |
| function generateCommand() { | |
| const punishmentType = document.getElementById('punishment-type').value; | |
| const playerCID = document.getElementById('player-cid').value; | |
| const punishmentReason = document.getElementById('punishment-reason').value; | |
| const sourceType = document.querySelector('input[name="source-type"]:checked').value; | |
| const forumId = document.getElementById('forum-id').value; | |
| const adminName = document.getElementById('admin-name').value; | |
| // Validate inputs | |
| if (!playerCID) { | |
| alert('Пожалуйста, введите CID игрока'); | |
| return; | |
| } | |
| if (!punishmentReason) { | |
| alert('Пожалуйста, выберите причину наказания'); | |
| return; | |
| } | |
| if ((sourceType === 'forum' || sourceType === 'both') && !forumId) { | |
| alert('Пожалуйста, введите ID жалобы на форуме'); | |
| return; | |
| } | |
| // Get punishment details | |
| const reasonDetails = punishmentReasons[punishmentType][punishmentReason]; | |
| let duration = reasonDetails.duration; | |
| let warnDuration = reasonDetails.warnDuration || 0; | |
| // For bans, convert days to minutes (for display) | |
| let displayDuration = duration; | |
| if (punishmentType === '/offban') { | |
| displayDuration = `${duration} ${getDayWord(duration)}`; | |
| } else { | |
| displayDuration = `${duration} ${getMinuteWord(duration)}`; | |
| } | |
| // Build command parts | |
| let commandParts = [punishmentType, playerCID]; | |
| // Add duration if needed | |
| if (punishmentType === '/offwarn') { | |
| commandParts.push(warnDuration); | |
| commandParts.push('DM'); | |
| commandParts.push('ZZ'); | |
| } else if (punishmentType === '/offban') { | |
| commandParts.push(duration); | |
| } else if (!['/offban', '/offwarn'].includes(punishmentType)) { | |
| commandParts.push(duration); | |
| } | |
| // Add reason text (just the term) | |
| let reasonText = punishmentReason; | |
| if (punishmentType === '/offwarn') { | |
| reasonText = ''; // For /offwarn, we don't need to add the reason text again | |
| } | |
| // Add source information | |
| let sourceText = ''; | |
| if (sourceType === 'forum') { | |
| sourceText = `[Жалобы на нефракционных игроков ${forumId}]`; | |
| } else if (sourceType === 'request') { | |
| sourceText = `| По просьбе ${adminName || 'Dmytriy Flatcher'}`; | |
| } else if (sourceType === 'both') { | |
| sourceText = `[Жалобы на нефракционных игроков ${forumId}] | По просьбе ${adminName || 'Dmytriy Flatcher'}`; | |
| } | |
| // Combine everything | |
| let fullCommand; | |
| if (punishmentType === '/offban') { | |
| fullCommand = `${commandParts.join(' ')} ${reasonText} ${sourceText}`; | |
| } else { | |
| fullCommand = `${commandParts.join(' ')} ${reasonText}${sourceText}`; | |
| } | |
| // Add admin name at the end if provided and not already in sourceText | |
| if (adminName && !sourceText.includes(adminName)) { | |
| fullCommand += ` | ${adminName}`; | |
| } | |
| // Display result | |
| generatedCommand.textContent = fullCommand; | |
| resultContainer.classList.remove('hidden'); | |
| // Scroll to result | |
| resultContainer.scrollIntoView({ behavior: 'smooth' }); | |
| } | |
| // Copy command to clipboard | |
| copyBtn.addEventListener('click', function() { | |
| const commandText = generatedCommand.textContent; | |
| navigator.clipboard.writeText(commandText).then(() => { | |
| // Show tooltip | |
| const tooltip = document.createElement('div'); | |
| tooltip.className = 'fixed bottom-4 right-4 bg-green-500 text-white px-4 py-2 rounded-lg shadow-lg'; | |
| tooltip.textContent = 'Команда скопирована!'; | |
| document.body.appendChild(tooltip); | |
| // Remove tooltip after 2 seconds | |
| setTimeout(() => { | |
| tooltip.remove(); | |
| }, 2000); | |
| }).catch(err => { | |
| console.error('Failed to copy: ', err); | |
| }); | |
| }); | |
| // Helper functions for plural forms | |
| function getMinuteWord(minutes) { | |
| const lastDigit = minutes % 10; | |
| const lastTwoDigits = minutes % 100; | |
| if (lastTwoDigits >= 11 && lastTwoDigits <= 19) { | |
| return 'минут'; | |
| } else if (lastDigit === 1) { | |
| return 'минута'; | |
| } else if (lastDigit >= 2 && lastDigit <= 4) { | |
| return 'минуты'; | |
| } else { | |
| return 'минут'; | |
| } | |
| } | |
| function getDayWord(days) { | |
| const lastDigit = days % 10; | |
| const lastTwoDigits = days % 100; | |
| if (lastTwoDigits >= 11 && lastTwoDigits <= 19) { | |
| return 'дней'; | |
| } else if (lastDigit === 1) { | |
| return 'день'; | |
| } else if (lastDigit >= 2 && lastDigit <= 4) { | |
| return 'дня'; | |
| } else { | |
| return 'дней'; | |
| } | |
| } | |
| }); | |
| </script> | |
| <p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=flatcher/radmir-admin-config" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body> | |
| </html> |