This commit is contained in:
2026-05-11 22:08:50 +03:00
commit 9f4bf13276
11 changed files with 618 additions and 0 deletions

164
frontend/css/styles.css Normal file
View File

@@ -0,0 +1,164 @@
/* frontend/css/styles.css */
/* Premium darkmode + glassmorphism design */
:root {
--font-family: 'Inter', sans-serif;
--color-bg: hsl(220, 10%, 10%);
--color-surface: hsla(220, 10%, 15%, 0.8);
--color-primary: hsl(210, 80%, 55%);
--color-primary-hover: hsl(210, 80%, 45%);
--color-success: hsl(140, 60%, 45%);
--color-error: hsl(0, 70%, 50%);
--color-text: hsl(0, 0%, 90%);
--radius: 0.75rem;
--shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}
*,
*::before,
*::after {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
font-family: var(--font-family);
background: var(--color-bg);
color: var(--color-text);
line-height: 1.6;
min-height: 100vh;
display: flex;
flex-direction: column;
}
.header {
text-align: center;
padding: 2rem 1rem;
background: linear-gradient(135deg, hsla(210, 70%, 55%, 0.6), hsla(210, 70%, 35%, 0.6));
backdrop-filter: blur(12px);
box-shadow: var(--shadow);
}
.header h1 {
font-size: 2.2rem;
margin-bottom: 0.5rem;
color: var(--color-primary);
}
.container {
flex: 1;
padding: 1.5rem;
max-width: 1200px;
margin: 0 auto;
}
.section {
margin-bottom: 2rem;
}
h2 {
margin-bottom: 1rem;
font-weight: 600;
color: var(--color-primary);
}
.controls {
display: flex;
flex-wrap: wrap;
gap: 0.5rem;
margin-bottom: 1rem;
}
.controls input,
.controls select {
padding: 0.5rem 0.75rem;
border: 1px solid hsla(0, 0%, 100%, 0.1);
border-radius: var(--radius);
background: var(--color-surface);
color: var(--color-text);
}
.btn-primary {
background: var(--color-primary);
border: none;
color: #fff;
padding: 0.5rem 1rem;
border-radius: var(--radius);
cursor: pointer;
transition: background 0.2s;
}
.btn-primary:hover {
background: var(--color-primary-hover);
}
.btn-secondary {
background: hsla(0, 0%, 100%, 0.1);
border: none;
color: var(--color-text);
padding: 0.5rem 1rem;
border-radius: var(--radius);
cursor: pointer;
transition: background 0.2s;
}
.btn-secondary:hover {
background: hsla(0, 0%, 100%, 0.2);
}
.table {
width: 100%;
border-collapse: collapse;
backdrop-filter: blur(6px);
background: var(--color-surface);
border-radius: var(--radius);
overflow: hidden;
box-shadow: var(--shadow);
}
.table th,
.table td {
padding: 0.75rem 1rem;
text-align: left;
border-bottom: 1px solid hsla(0, 0%, 100%, 0.05);
}
.table th {
background: hsla(0, 0%, 100%, 0.05);
color: var(--color-primary);
}
.hidden { display: none; }
label {
display: block;
margin-bottom: 0.75rem;
color: var(--color-text);
}
label input,
label textarea {
width: 100%;
padding: 0.5rem;
margin-top: 0.25rem;
border: 1px solid hsla(0,0%,100%,0.1);
border-radius: var(--radius);
background: var(--color-surface);
color: var(--color-text);
}
.preview {
display: flex;
flex-wrap: wrap;
gap: 0.5rem;
margin-top: 0.5rem;
}
.preview img {
max-width: 120px;
max-height: 120px;
object-fit: cover;
border-radius: var(--radius);
box-shadow: var(--shadow);
}

89
frontend/index.html Normal file
View File

@@ -0,0 +1,89 @@
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>OzonGuard подготовка жалоб</title>
<link rel="stylesheet" href="css/styles.css" />
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap" rel="stylesheet" />
</head>
<body>
<header class="header">
<h1>OzonGuard</h1>
<p>Быстро создавайте и отправляйте жалобы в поддержку Ozon</p>
</header>
<main class="container">
<!-- Cases list -->
<section id="cases-section" class="section">
<h2>Список кейсов</h2>
<div class="controls">
<input type="text" id="search-input" placeholder="Поиск по артикулу или ссылке..." />
<select id="status-filter">
<option value="">Все статусы</option>
<option value="new">Новый</option>
<option value="prepared">Подготовлен</option>
<option value="sent">Отправлен</option>
<option value="closed">Закрыт</option>
</select>
<button id="new-case-btn" class="btn-primary">+ Новый кейс</button>
</div>
<table id="cases-table" class="table">
<thead>
<tr>
<th>ID</th>
<th>Артикул</th>
<th>Статус</th>
<th>Создан</th>
<th>Действия</th>
</tr>
</thead>
<tbody></tbody>
</table>
</section>
<!-- Case form (hidden by default) -->
<section id="case-form-section" class="section hidden">
<h2 id="form-title">Новый кейс</h2>
<form id="case-form">
<label>
Ссылка на карточку нарушителя
<input type="url" name="violator_url" required />
</label>
<label>
Артикул нарушителя
<input type="text" name="violator_article" required />
</label>
<label>
Мой артикул (опц.)
<input type="text" name="my_article" />
</label>
<label>
Комментарий / описание
<textarea name="comment" rows="3"></textarea>
</label>
<label>
Прикрепить доказательства
<input type="file" id="file-input" multiple accept="image/*,application/pdf" />
<div id="file-preview" class="preview"></div>
</label>
<div class="form-actions">
<button type="submit" class="btn-primary">Сохранить</button>
<button type="button" id="cancel-btn" class="btn-secondary">Отмена</button>
</div>
</form>
</section>
<!-- Case detail (hidden) -->
<section id="case-detail-section" class="section hidden">
<h2>Детали кейса</h2>
<div id="case-detail"></div>
<button id="back-to-list" class="btn-secondary">← Назад к списку</button>
</section>
</main>
<script src="js/api.js"></script>
<script src="js/ui.js"></script>
<script src="js/app.js"></script>
</body>
</html>

54
frontend/js/api.js Normal file
View File

@@ -0,0 +1,54 @@
// frontend/js/api.js
// Base URL for backend API (adjust if using different host/port)
const API_BASE = "http://localhost:5000/api";
export async function fetchCases(params = {}) {
const query = new URLSearchParams(params).toString();
const res = await fetch(`${API_BASE}/cases${query ? `?${query}` : ''}`);
return await res.json();
}
export async function createCase(data) {
const res = await fetch(`${API_BASE}/cases`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(data),
});
return await res.json();
}
export async function getCase(id) {
const res = await fetch(`${API_BASE}/cases/${id}`);
return await res.json();
}
export async function updateCase(id, data) {
const res = await fetch(`${API_BASE}/cases/${id}`, {
method: "PUT",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(data),
});
return await res.json();
}
export async function deleteCase(id) {
const res = await fetch(`${API_BASE}/cases/${id}`, { method: "DELETE" });
return await res.json();
}
export async function uploadFiles(caseId, fileList) {
const form = new FormData();
for (const f of fileList) {
form.append("files", f);
}
const res = await fetch(`${API_BASE}/cases/${caseId}/files`, {
method: "POST",
body: form,
});
return await res.json();
}
export async function listFiles(caseId) {
const res = await fetch(`${API_BASE}/cases/${caseId}/files`);
return await res.json();
}