Alikhan/indexh.html

232 lines
8.9 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>NexGen CyberDefence | Услуги информационной безопасности</title>
<style>
body { margin: 0; font-family: Arial, sans-serif; background: #f9f9f9; color: #333; }
header { background: #1A1A40; padding: 20px; text-align: center; }
header h1 { margin: 0; color: #00BFFF; font-size: 2em; }
nav { margin-top: 10px; }
nav a { color: #FFFFFF; margin: 0 10px; text-decoration: none; font-weight: bold; }
nav a:hover { color: #00BFFF; }
.services { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; margin-top: 40px; padding: 0 20px; }
.card { background: #FFFFFF; border-radius: 10px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); padding: 30px; text-align: center; border-top: 4px solid #0057B7; cursor: pointer; }
.card h3 { margin-top: 10px; color: #0057B7; }
.card p { color: #555; }
footer { background: #1A1A40; color: #AAAAAA; text-align: center; padding: 20px; font-size: 0.9em; margin-top: 40px; }
.modal { display:none; position:fixed; top:0; left:0; width:100%; height:100%; background:rgba(0,0,0,0.7); justify-content:center; align-items:center; }
.modal-content { background: #fff; padding: 30px; border-radius: 10px; text-align: center; width: 90%; max-width: 400px; }
.modal-content input { width: 100%; padding: 10px; margin: 10px 0; border-radius: 5px; border: 1px solid #ccc; }
.modal-content button { background: #0057B7; color: #fff; border: none; padding: 10px 20px; border-radius: 5px; cursor: pointer; }
.modal-content button:hover { background: #00BFFF; }
</style>
<script>
const API = 'https://ngcd.center/api';
let currentUser = null;
async function request(url, method, data) {
const options = {
method,
headers: { 'Content-Type': 'application/json' }
};
if (data) options.body = JSON.stringify(data);
const res = await fetch(`${API}${url}`, options);
return res.json();
}
function openDdosModal() {
if (!currentUser) {
document.getElementById('auth-modal').style.display = 'flex';
} else {
document.getElementById('add-ddos-modal').style.display = 'flex';
}
}
function closeModal(id) {
document.getElementById(id).style.display = 'none';
}
async function submitAddDdosForm() {
const site = document.getElementById('add-ddos-site').value.trim();
if (!site || !currentUser) return;
try {
const res = await request('/add-service', 'POST', { userId: currentUser.id, type: 'DDoS Protection', target: site });
if (res.success) {
alert('Услуга добавлена');
closeModal('add-ddos-modal');
updateAccount();
} else {
alert(res.error || 'Ошибка добавления');
}
} catch (e) {
alert('Ошибка сети');
}
}
async function payCart(method) {
if (!currentUser) return;
try {
const res = await request('/pay', 'POST', { userId: currentUser.id });
if (res.success) {
alert(`Оплата прошла через: ${method}`);
closeModal('cart-modal');
updateAccount();
} else {
alert(res.error || 'Ошибка оплаты');
}
} catch (e) {
alert('Ошибка сети');
}
}
async function authUser(mode) {
const email = document.getElementById('auth-email').value.trim();
const pass = document.getElementById('auth-pass').value.trim();
if (!email || !pass) return;
try {
const data = { email, password: pass };
const res = await request(mode === 'login' ? '/login' : '/register', 'POST', data);
if (res.success) {
currentUser = { id: res.userId, email };
closeModal('auth-modal');
updateAccount();
} else {
if (mode === 'login' && res.error === 'Неверный email или пароль') {
const shouldRegister = confirm('Пользователь не найден. Зарегистрироваться с этим email?');
if (shouldRegister) {
authUser('register');
}
} else {
alert(res.error || 'Ошибка');
}
}
} catch (e) {
alert('Ошибка сети');
}
};
const res = await request(mode === 'login' ? '/login' : '/register', 'POST', data);
if (res.success) {
currentUser = { id: res.userId, email };
closeModal('auth-modal');
updateAccount();
} else {
alert(res.error || 'Ошибка');
}
} catch (e) {
alert('Ошибка сети');
}
}
function logoutUser() {
currentUser = null;
updateAccount();
}
async function updateAccount() {
const account = document.getElementById('account');
if (!currentUser) {
account.innerHTML = `<button onclick="document.getElementById('auth-modal').style.display='flex'">Войти / Регистрация</button>`;
return;
}
try {
const res = await fetch(`${API}/services/${currentUser.id}`);
const services = await res.json();
account.innerHTML = `
<h3>Личный кабинет (${currentUser.email})</h3>
<button onclick="logoutUser()">Выйти</button><br><br>
<button onclick="document.getElementById('add-ddos-modal').style.display='flex'">Добавить DDoS защиту</button><br><br>
<button onclick="payCart('Kaspi')">Оплатить корзину</button>
<h4>Купленные услуги:</h4>
<ul>${services.map(s => `<li>${s.type}: ${s.target}</li>`).join('') || '<li>Нет услуг</li>'}</ul>
`;
} catch (e) {
account.innerHTML = '<p>Ошибка загрузки данных</p>';
}
}
</script>
</head>
<body>
<header>
<h1>NexGen CyberDefence</h1>
<nav>
<a href="#services">Услуги</a>
<a href="#account">Кабинет</a>
<a href="#contact">Контакты</a>
</nav>
</header>
<section id="services">
<h2 style="text-align:center">Наши услуги</h2>
<div class="services">
<div class="card">
<h3>Аудит информационной безопасности</h3>
<p>Комплексная проверка защиты ваших систем и рекомендации по её улучшению.</p>
</div>
<div class="card">
<h3>Тестирование на проникновение (Pentest)</h3>
<p>Имитация атак для выявления уязвимостей до реальных угроз.</p>
</div>
<div class="card">
<h3>Реагирование на инциденты</h3>
<p>Быстрая поддержка и расследование киберинцидентов для минимизации ущерба.</p>
</div>
<div class="card">
<h3>Консалтинг и внедрение стандартов</h3>
<p>Поддержка при внедрении стандартов ISO 27001, 27017, 27018 и других.</p>
</div>
<div class="card" onclick="openDdosModal()">
<h3>Защита от DDoS атак</h3>
<p>Защитите ваш сайт или сервер от распределённых атак.</p>
</div>
</div>
</section>
<section id="account" style="text-align:center; padding:40px 20px;"></section>
<section id="contact" style="padding:40px 20px; text-align:center">
<h2>Контакты</h2>
<p>Email: <a href="mailto:office@ngcd.tech">office@ngcd.tech</a></p>
<p>Телефон: +7-702-798-99-57</p>
<p>Адрес: Казахстан, г. Астана, ул. Әлихан Бөкейхан, 25А, кв. 517</p>
</section>
<footer>
&copy; 2025 NexGen CyberDefence. Все права защищены.
</footer>
<div id="auth-modal" class="modal">
<div class="modal-content">
<h3>Вход / Регистрация</h3>
<input type="email" id="auth-email" placeholder="Email">
<input type="password" id="auth-pass" placeholder="Пароль">
<button onclick="authUser('login')">Войти</button>
<button onclick="authUser('register')">Регистрация</button><br><br>
<button onclick="closeModal('auth-modal')">Отмена</button>
</div>
</div>
<div id="add-ddos-modal" class="modal">
<div class="modal-content">
<h3>Добавить DDoS защиту</h3>
<input type="text" id="add-ddos-site" placeholder="example.com или IP">
<button onclick="submitAddDdosForm()">Добавить</button><br><br>
<button onclick="closeModal('add-ddos-modal')">Отмена</button>
</div>
</div>
<div id="cart-modal" class="modal">
<div class="modal-content">
<h3>Корзина</h3>
<div id="cart-list">(Корзина больше не используется — всё через сервер)</div><br>
<button onclick="payCart('Kaspi')">Оплатить через Kaspi</button>
<button onclick="payCart('ПШЭП')">Оплатить через ПШЭП</button><br><br>
<button onclick="closeModal('cart-modal')">Закрыть</button>
</div>
</div>
</body>
</html>