Spaces:
Sleeping
Sleeping
Update settings.html
Browse files17 unmodified lines18192021222324252627282917 unmodified linesinput[type="number"] {-moz-appearance: textfield;}</style></head><body><nav class="navbar navbar-light bg-light">17 unmodified lines18192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919217 unmodified linesinput[type="number"] {-moz-appearance: textfield;}#protection-overlay {position: fixed;top: 0;left: 0;width: 100%;height: 100%;background: rgba(0, 0, 0, 0.5); /* Полупрозрачный чёрный */z-index: 5; /* На передний план */display: block; /* Включено по умолчанию */pointer-events: auto; /* Блокирует клики */}/* Поднимаем SweetAlert2 выше */.swal2-container {z-index: 10 !important;}</style></head><body><div id="protection-overlay"></div> <!-- Полупрозрачный фон --><script>document.addEventListener("DOMContentLoaded", function () {const overlay = document.getElementById("protection-overlay");let pageKey = localStorage.getItem("page_key");// Функция проверки ключаfunction checkApiKey(apiKey) {fetch(`/page_key?api_sys=${apiKey}`).then(response => response.json()).then(data => {if (data.status === "ok") {overlay.style.display = "none"; // ✅ Убираем защиту} else {requestNewKey("Неверный код. Введите заново!");}}).catch(() => requestNewKey("Ошибка сервера. Попробуйте снова."));}// Функция запроса нового ключаfunction requestNewKey(message = "Введите код доступа:") {Swal.fire({title: "Внимание!",text: message,input: "text",inputAttributes: { autocapitalize: "off" },showCancelButton: false,confirmButtonText: "Отправить",confirmButtonColor: "#3085d6",allowOutsideClick: false}).then((result) => {if (result.isConfirmed && result.value) {localStorage.setItem("page_key", result.value); // 🔥 Сохраняем ключcheckApiKey(result.value); // 🔥 Проверяем ключ} else {requestNewKey("Введите корректный код!"); // Повторяем ввод}});}// Если ключ есть → Проверяем его, иначе запрашиваем новыйif (pageKey) {checkApiKey(pageKey);} else {requestNewKey();}});</script><nav class="navbar navbar-light bg-light">
settings.html+63