Files

137 lines
7.0 KiB
HTML

<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Заметки — Админ-панель</title>
<link rel="stylesheet" href="admin.css">
<link rel="stylesheet" href="/admin-dark.css" disabled id="themeCss">
<script src="js/theme.js"></script>
<style>
.notes-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 8px; align-items: stretch; }
@media (max-width: 1200px) { .notes-list { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px) { .notes-list { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .notes-list { grid-template-columns: 1fr; } }
.note-card {
position: relative;
background: var(--card);
border: 1px solid var(--border);
border-left: 4px solid;
border-radius: 12px;
padding: 14px 16px;
display: flex;
flex-direction: column;
gap: 8px;
min-width: 0;
transition: box-shadow .15s, transform .15s, opacity .15s;
}
.note-card:hover { box-shadow: 0 8px 20px rgba(0,0,0,.08); }
.note-card.dragging { opacity: .4; border-style: dashed; }
.note-drag {
display: inline-flex;
align-items: center;
justify-content: center;
width: 18px;
height: 18px;
flex: none;
color: var(--muted);
font-size: .85rem;
cursor: grab;
border-radius: 6px;
transition: color .15s, background .15s;
}
.note-drag:hover { color: var(--text); background: rgba(127,127,127,.15); }
.note-drag:active { cursor: grabbing; }
.note-card-title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.note-color-row { display: flex; align-items: center; gap: 10px; }
.note-color-swatch { width: 18px; height: 18px; border-radius: 6px; border: 1px solid var(--border); flex: none; cursor: pointer; transition: transform .15s; }
.note-color-swatch:hover { transform: scale(1.15); }
.note-card-head { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.note-card-title { font-weight: 600; font-size: .95rem; color: var(--ncolor); word-break: break-word; }
.note-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.note-tag { font-size: .72rem; padding: 2px 8px; border-radius: 999px; background: rgba(37,99,235,.1); color: #1d4ed8; border: 1px solid rgba(37,99,235,.2); }
.note-card-note { font-size: .88rem; color: var(--text); line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.note-empty-note { color: var(--muted); font-style: italic; font-size: .85rem; }
.note-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 10px; }
.note-card-time { font-size: .72rem; color: var(--muted); }
.note-card-actions { display: flex; gap: 6px; }
.note-card-actions button { font-size: .78rem; }
.notes-toolbar { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-top: 14px; }
.notes-toolbar > div > label[for="notesDeleted"] { font-size: .82rem; font-weight: 600; color: var(--muted); }
.note-card--deleted { opacity: .7; }
.note-card--deleted:hover { opacity: 1; }
.note-card--deleted .note-card-title { text-decoration: line-through; }
.note-del-badge { font-size: .72rem; padding: 2px 8px; border-radius: 999px; background: rgba(220,38,38,.1); color: #b91c1c; border: 1px solid rgba(220,38,38,.2); }
.note-empty { text-align: center; color: var(--muted); padding: 32px 16px; font-size: .9rem; border: 1px dashed var(--border); border-radius: 12px; }
.note-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.note-modal-head h3 { margin: 0; font-size: 1.05rem; }
.settings-field .hint { font-size: .78rem; color: var(--muted); line-height: 1.5; }
.settings-field label .hint { font-weight: 400; margin-left: 6px; }
</style>
</head>
<body data-page="notes">
<div class="layout">
<div class="sidebar" id="sidebar"></div>
<div class="main">
<div class="page-head">
<h2>Заметки</h2>
<p class="page-sub">Личные заметки для каждого пользователя</p>
<button type="button" class="btn-primary" id="notesNewBtn"><i data-lucide="plus"></i> Новая заметка</button>
</div>
<div class="notes-toolbar">
<div>
<label for="notesDeleted">Удалённые</label>
<label class="toggle" style="padding:4px 6px">
<input type="checkbox" id="notesDeleted">
<span class="toggle-track"><span class="toggle-thumb"></span></span>
<span class="toggle-text"><small>Показать корзину</small></span>
</label>
</div>
</div>
<div id="notesList" class="notes-list"></div>
</div>
</div>
<div class="modal-overlay" id="notesModal">
<div class="edit-modal" style="max-width:560px">
<div class="note-modal-head">
<h3 id="notesModalTitle">Новая заметка</h3>
<button type="button" class="icon-btn" id="notesModalClose"><i data-lucide="x"></i></button>
</div>
<div class="settings-field">
<label>Заголовок (необязательно)</label>
<input id="notesTitle" class="settings-input" maxlength="200" placeholder="Краткое название заметки">
</div>
<div class="settings-field">
<label>Заметка<span class="hint">ctrl+enter отправить</span></label>
<textarea id="notesNote" class="settings-input" rows="6" placeholder="Текст заметки"></textarea>
</div>
<div class="settings-field">
<label>Теги</label>
<input id="notesTags" class="settings-input" placeholder="через запятую: важно, учеба, запланировать">
<div class="hint">Теги разделяются запятой</div>
</div>
<div class="settings-field">
<label>Цвет</label>
<div class="note-color-row" id="notesColorRow">
<input id="notesColor" type="color" class="settings-input" value="#2563eb" style="width:56px;height:42px;padding:5px;border-radius:8px;cursor:pointer">
<span id="notesColorPreview" style="width:16px;height:16px;border-radius:6px;border:1px solid var(--border);flex:none;background:#2563eb"></span>
<div class="hint">Цвет заметки</div>
</div>
</div>
<div class="card-foot">
<button type="button" class="btn-primary ghost" id="notesCancel">Отмена</button>
<button type="button" class="btn-primary" id="notesSave">Сохранить</button>
</div>
</div>
</div>
<div class="toast" id="toast"></div>
<script src="vendor/lucide.min.js"></script>
<script src="js/datetime.js"></script>
<script src="admin.js"></script>
<script src="js/notes.js"></script>
</body>
</html>