diff --git a/public/css/style.css b/public/css/style.css index 5a0c498..6b08434 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -219,8 +219,17 @@ body.dark-mode .project-item:hover { background: rgba(255,255,255,0.03); } .note-editor-toolbar { display: flex; flex-wrap: wrap; gap: 0.25rem; margin-bottom: 0.5rem; padding: 0.35rem; background: var(--bg); border-radius: 0.5rem; border: 1px solid var(--border); } .note-toolbar-btn { background: none; border: none; cursor: pointer; padding: 4px 7px; border-radius: 4px; color: var(--text-light); font-size: 0.85rem; transition: background 0.15s, color 0.15s; } .note-toolbar-btn:hover { background: rgba(var(--primary-rgb),0.1); color: var(--primary); } -.note-content-area { min-height: 160px; border: 1px solid var(--border); border-radius: 0.5rem; padding: 0.75rem; outline: none; font-size: 0.9rem; line-height: 1.6; background: var(--input-bg); color: var(--text); resize: vertical; } +.note-content-area { width: 100%; min-height: 160px; border: 1px solid var(--border); border-radius: 0.5rem; padding: 0.75rem; outline: none; font-size: 0.9rem; line-height: 1.6; background: var(--input-bg); color: var(--text); resize: vertical; } .note-content-area:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(var(--primary-rgb),0.1); } +.note-modal-compact { padding: 1rem 1.1rem; } +.note-modal-compact .form-group { margin-bottom: 0.75rem; } +.note-modal-compact .note-editor-toolbar { margin-bottom: 0.45rem; padding: 0.28rem; } +.note-modal-compact .note-toolbar-btn { padding: 3px 6px; font-size: 0.82rem; } +.note-modal-compact .form-control { padding: 0.55rem 0.68rem; font-size: 0.88rem; } +.note-modal-compact .note-content-area { min-height: 200px; } +@media (max-width: 760px) { + .note-modal-top-fields { grid-template-columns: 1fr !important; } +} /* Note color palette */ .note-color-palette { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.5rem; } diff --git a/views/login.php b/views/login.php index 3ae1770..60032df 100644 --- a/views/login.php +++ b/views/login.php @@ -10,7 +10,7 @@
-

Welcome Back

+

Login

@@ -23,7 +23,9 @@
+
diff --git a/views/notes.php b/views/notes.php index a630f45..a7bac17 100644 --- a/views/notes.php +++ b/views/notes.php @@ -3,6 +3,7 @@ try { $pdo->exec("ALTER TABLE notes ADD COLUMN color TEXT DEFAULT NULL"); } catch(Exception $e) {} try { $pdo->exec("ALTER TABLE notes ADD COLUMN image_path TEXT DEFAULT NULL"); } catch(Exception $e) {} try { $pdo->exec("ALTER TABLE notes ADD COLUMN updated_at DATETIME DEFAULT NULL"); } catch(Exception $e) {} +try { $pdo->exec("ALTER TABLE notes ADD COLUMN label_name TEXT DEFAULT NULL"); } catch(Exception $e) {} try { $pdo->exec("CREATE TABLE IF NOT EXISTS notes ( id INTEGER PRIMARY KEY AUTOINCREMENT, @@ -40,8 +41,8 @@ if($_SERVER['REQUEST_METHOD'] === 'POST') { if(move_uploaded_file($_FILES['note_image']['tmp_name'], $dest)) $image_path = $dest; } } - $stmt = $pdo->prepare("INSERT INTO notes (title, content, owner_id, color, image_path) VALUES (?, ?, ?, ?, ?)"); - $stmt->execute([$_POST['title'] ?? 'Untitled', $_POST['content'], $user_id, $_POST['color'] ?? null, $image_path]); + $stmt = $pdo->prepare("INSERT INTO notes (title, content, owner_id, color, image_path, label_name) VALUES (?, ?, ?, ?, ?, ?)"); + $stmt->execute([$_POST['title'] ?? 'Untitled', $_POST['content'], $user_id, $_POST['color'] ?? null, $image_path, trim($_POST['label_name'] ?? '') ?: null]); } if(isset($_POST['update_note'])) { @@ -64,8 +65,8 @@ if($_SERVER['REQUEST_METHOD'] === 'POST') { if($image_path && file_exists($image_path)) @unlink($image_path); $image_path = null; } - $stmt = $pdo->prepare("UPDATE notes SET title=?, content=?, color=?, image_path=?, updated_at=CURRENT_TIMESTAMP WHERE id=? AND owner_id=?"); - $stmt->execute([$_POST['title'] ?? 'Untitled', $_POST['content'], $_POST['color'] ?? null, $image_path, $_POST['note_id'], $user_id]); + $stmt = $pdo->prepare("UPDATE notes SET title=?, content=?, color=?, image_path=?, label_name=?, updated_at=CURRENT_TIMESTAMP WHERE id=? AND owner_id=?"); + $stmt->execute([$_POST['title'] ?? 'Untitled', $_POST['content'], $_POST['color'] ?? null, $image_path, trim($_POST['label_name'] ?? '') ?: null, $_POST['note_id'], $user_id]); } } @@ -111,6 +112,12 @@ $notes = $stmt->fetchAll(); $all_users = query("SELECT id, username FROM users WHERE id != ?", [$user_id])->fetchAll(); $all_groups = query("SELECT * FROM groups")->fetchAll(); +$label_names = []; +foreach($notes as $n) { + $lbl = trim((string)($n['label_name'] ?? '')); + if($lbl !== '') $label_names[strtolower($lbl)] = $lbl; +} +natcasesort($label_names); // Define note colors — Google Keep inspired $note_colors = [ @@ -122,31 +129,53 @@ $note_colors = [ '#b3e5fc' => ['bg'=>'#b3e5fc', 'label'=>'Sky', 'hex'=>'#b3e5fc'], '#cce5ff' => ['bg'=>'#cce5ff', 'label'=>'Blue', 'hex'=>'#cce5ff'], '#e2d9f3' => ['bg'=>'#e2d9f3', 'label'=>'Lavender', 'hex'=>'#e2d9f3'], + '#f3e5f5' => ['bg'=>'#f3e5f5', 'label'=>'Orchid', 'hex'=>'#f3e5f5'], '#f8d7da' => ['bg'=>'#f8d7da', 'label'=>'Rose', 'hex'=>'#f8d7da'], '#ef9a9a' => ['bg'=>'#ef9a9a', 'label'=>'Red', 'hex'=>'#ef9a9a'], '#ffcc80' => ['bg'=>'#ffcc80', 'label'=>'Peach', 'hex'=>'#ffcc80'], '#fde8d8' => ['bg'=>'#fde8d8', 'label'=>'Orange', 'hex'=>'#fde8d8'], '#d7ccc8' => ['bg'=>'#d7ccc8', 'label'=>'Sand', 'hex'=>'#d7ccc8'], + '#f5f5f5' => ['bg'=>'#f5f5f5', 'label'=>'Stone', 'hex'=>'#f5f5f5'], + '#e8f5e9' => ['bg'=>'#e8f5e9', 'label'=>'Mint', 'hex'=>'#e8f5e9'], + '#fff3e0' => ['bg'=>'#fff3e0', 'label'=>'Apricot', 'hex'=>'#fff3e0'], + '#fce4ec' => ['bg'=>'#fce4ec', 'label'=>'Pink', 'hex'=>'#fce4ec'], + '#ede7f6' => ['bg'=>'#ede7f6', 'label'=>'Violet', 'hex'=>'#ede7f6'], + '#e0f7fa' => ['bg'=>'#e0f7fa', 'label'=>'Cyan', 'hex'=>'#e0f7fa'], + '#fffde7' => ['bg'=>'#fffde7', 'label'=>'Butter', 'hex'=>'#fffde7'], ]; ?> -
+
+
+ + +