diff --git a/assets/css/custom.css b/assets/css/custom.css new file mode 100644 index 0000000..80f54d2 --- /dev/null +++ b/assets/css/custom.css @@ -0,0 +1,112 @@ +/* General Body Styles */ +body { + font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; + transition: background-color 0.3s ease, color 0.3s ease; +} + +/* Light Mode Palette */ +body[data-bs-theme="light"] { + background-color: #F8F9FA; + color: #212529; +} + +/* Dark Mode Palette */ +body[data-bs-theme="dark"] { + background-color: #121212; + color: #E0E0E0; +} + +body[data-bs-theme="dark"] .navbar { + background-color: #1E1E1E !important; + border-bottom: 1px solid #333; +} + +body[data-bs-theme="dark"] .note-card { + background-color: #1E1E1E; + border-color: #333; +} + +body[data-bs-theme="dark"] .note-card .card-title { + color: #FFF; +} + +body[data-bs-theme="dark"] .note-card .card-text { + color: #AEAEAE; +} + +body[data-bs-theme="dark"] .badge { + border: 1px solid #555; +} + + +/* Navbar */ +.navbar-brand { + font-weight: 700; + font-size: 1.5rem; +} + +/* Theme Switcher */ +.theme-switch { + cursor: pointer; + font-size: 1.2rem; +} + +/* Note Grid */ +.notes-grid { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); + gap: 1.5rem; +} + +/* Note Card */ +.note-card { + border-radius: 0.75rem; + border: 1px solid #E0E0E0; + box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05); + transition: transform 0.2s ease, box-shadow 0.2s ease; + position: relative; + overflow: hidden; + padding-bottom: 2.5rem; /* Space for footer */ +} + +.note-card:hover { + transform: translateY(-5px); + box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1); +} + +.note-card .card-body { + padding: 1.5rem; +} + +.note-card .card-title { + font-weight: 600; +} + +.note-card .card-text { + color: #6c757d; + font-size: 0.95rem; +} + +.note-card .card-footer { + position: absolute; + bottom: 0; + left: 0; + right: 0; + padding: 0.75rem 1.5rem; + background: transparent; + border-top: none; +} + +.note-card .badge { + font-size: 0.75rem; + padding: 0.4em 0.6em; + font-weight: 500; +} + +.color-label { + position: absolute; + top: 0; + left: 0; + width: 5px; + height: 100%; +} diff --git a/assets/js/main.js b/assets/js/main.js new file mode 100644 index 0000000..926e5f2 --- /dev/null +++ b/assets/js/main.js @@ -0,0 +1,26 @@ +document.addEventListener('DOMContentLoaded', () => { + const themeSwitch = document.getElementById('theme-switch'); + const currentTheme = localStorage.getItem('theme') ? localStorage.getItem('theme') : 'light'; + + if (currentTheme) { + document.body.setAttribute('data-bs-theme', currentTheme); + if (themeSwitch) { + themeSwitch.innerHTML = currentTheme === 'dark' ? '' : ''; + } + } + + if(themeSwitch) { + themeSwitch.addEventListener('click', () => { + let theme = document.body.getAttribute('data-bs-theme'); + if (theme === 'dark') { + document.body.setAttribute('data-bs-theme', 'light'); + localStorage.setItem('theme', 'light'); + themeSwitch.innerHTML = ''; + } else { + document.body.setAttribute('data-bs-theme', 'dark'); + localStorage.setItem('theme', 'dark'); + themeSwitch.innerHTML = ''; + } + }); + } +}); diff --git a/create_note.php b/create_note.php new file mode 100644 index 0000000..5d2f718 --- /dev/null +++ b/create_note.php @@ -0,0 +1,75 @@ + +prepare('INSERT INTO notes (user_id, title, content, color, tags) VALUES (?, ?, ?, ?, ?)'); + $stmt->execute([$user_id, $title, $content, $color, $tags]); + header('Location: index.php?note_created=1'); + exit; + } catch (PDOException $e) { + $error = 'Database error: ' . $e->getMessage(); + } + } +} +?> + + + +