styles.css

13.65 KB
20/10/2025 09:05
CSS
styles.css
:root {
  --primary-color: #4a6fa5;
  --secondary-color: #f8f9fa;
  --text-color: #212529;
  --text-light: #6c757d;
  --border-color: #dee2e6;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 5px 15px rgba(0, 0, 0, 0.15);
  --transition: all 0.2s ease;
  --border-radius: 8px;
  --note-width: 250px;
  --note-height: 250px;
  --note-colors: #fff9a8, #ffebcc, #d4f0f0, #ffd6d6, #e6ccff, #ccffcc;
  --z-index-base: 10;
  --background: linear-gradient(rgba(0, 0, 0, 0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(0, 0, 0, 0.05) 1px, transparent 1px);
}
[data-theme="dark"] {
  --text-color: #f8f9fa;
  --primary-color: #6b9bd1;
  --secondary-color: #2d3748;
  --text-light: #a0aec0;
  --border-color: #4a5568;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 5px 15px rgba(0, 0, 0, 0.4);
  --background: linear-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--secondary-color);
  color: var(--text-color);
  line-height: 1.5;
  overflow-x: hidden;
  min-height: 100vh;
  background-image: var(--background);
  background-size: 20px 20px;
}
body .material-symbols-outlined {
  font-variation-settings: 'wght' 400;
  font-size: 20px;
}
.app-header {
  background-color: var(--primary-color);
  color: white;
  padding: 1rem;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}
.btn {
  background-color: rgba(255, 255, 255, 0.2);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  padding: 0.5rem 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
  font-size: 0.9rem;
}
.btn:hover {
  background-color: rgba(255, 255, 255, 0.3);
}
.btn-primary {
  background-color: var(--primary-color);
  color: #FFF;
}
.btn-primary:hover {
  background-color: #FFF;
  color: var(--primary-color);
}
.btn-danger {
  background-color: #dc3545;
  color: white;
}
.btn-danger:hover {
  background-color: #c82333;
}
.search-container {
  flex-grow: 1;
  max-width: 300px;
}
.search-container input {
  width: 100%;
  padding: 0.5rem;
  border: none;
  border-radius: var(--border-radius);
  background-color: rgba(255, 255, 255, 0.9);
  color: var(--text-color);
}
.app-board {
  position: relative;
  min-height: calc(100vh - 80px);
  padding: 1rem;
}
.drag-handle {
  display: flex;
}
.note {
  position: absolute;
  width: var(--note-width);
  height: var(--note-height);
  background-color: #fff9a8;
  color: #212529;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.note:hover {
  box-shadow: var(--shadow-hover);
}
.note.pinned {
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
  z-index: 1000 !important;
}
.note-header {
  background-color: rgba(0, 0, 0, 0.05);
  padding: 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: move;
  user-select: none;
}
.note-actions {
  display: flex;
  gap: 0.25rem;
}
.note-action {
  background: none;
  border: none;
  cursor: pointer;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: var(--transition);
}
.note-action:hover {
  background-color: rgba(0, 0, 0, 0.1);
}
.pin-btn.active {
  background-color: rgba(255, 235, 59, 0.15);
  transform: rotate(-15deg);
}
.pin-btn.active .material-symbols-outlined {
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.1));
}
.note-content {
  flex-grow: 1;
  padding: 0.75rem;
  overflow-y: auto;
  background-color: transparent;
  border: none;
  outline: none;
  resize: none;
  font-family: inherit;
  font-size: 0.9rem;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.note-footer {
  padding: 0.25rem 0.5rem;
  font-size: 0.7rem;
  color: var(--text-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.note-tags {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}
.tag {
  background-color: rgba(0, 0, 0, 0.1);
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  font-size: 0.7rem;
}
.resize-handle {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 15px;
  height: 15px;
  cursor: nwse-resize;
  background: linear-gradient(135deg, transparent 50%, rgba(0, 0, 0, 0.1) 50%);
}
.color-picker {
  position: absolute;
  top: 100%;
  right: 0;
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  z-index: 1001;
  width: 96px;
}
.color-option {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid rgba(0, 0, 0, 0.1);
}
.color-option:hover {
  transform: scale(1.1);
}
.note-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background-color: #FFF;
  color: #212529;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: 0.25rem;
  z-index: 1001;
  width: 120px;
}
.menu-item {
  padding: 0.5rem;
  cursor: pointer;
  border-radius: 4px;
  transition: var(--transition);
}
.menu-item:hover {
  background-color: rgba(0, 0, 0, 0.05);
}
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}
.modal.active {
  opacity: 1;
  visibility: visible;
}
.modal-content {
  background-color: var(--secondary-color);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-hover);
  color: var(--text-color);
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.modal-header {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-body {
  padding: 1rem;
  overflow-y: auto;
  flex-grow: 1;
}
.modal-body ul {
  padding-left: 35px;
}
.modal-footer {
  padding: 1rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
}
.close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-light);
}
.recycle-bin-content {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}
.deleted-note {
  background-color: var(--secondary-color);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 0.5rem;
  position: relative;
}
.deleted-note-content {
  max-height: 100px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}
.deleted-note-actions {
  display: flex;
  justify-content: space-between;
}
.notification {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  background-color: var(--primary-color);
  color: white;
  padding: 0.75rem 1rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  transform: translateY(100px);
  opacity: 0;
  transition: var(--transition);
  z-index: 1001;
  max-width: 300px;
}
.notification.show {
  transform: translateY(0);
  opacity: 1;
}
.notification.error {
  background-color: #dc3545;
}
.notification.success {
  background-color: #28a745;
}
.empty-state {
  text-align: center;
  padding: 2rem;
  color: var(--text-light);
}
.empty-state.show {
  display: block;
  grid-column-start: 1;
  grid-column-end: 3;
}
.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}
/* Category select */
.category-select {
  padding: 0.5rem;
  border: none;
  border-radius: var(--border-radius);
  background-color: rgba(255, 255, 255, 0.9);
  color: #212529;
  cursor: pointer;
  font-size: 0.9rem;
}
/* Template modal */
.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
}
.template-card {
  background-color: var(--secondary-color);
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}
.template-card:hover {
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.template-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 0.5rem;
}
.template-card h3 {
  font-size: 1rem;
  margin-bottom: 0.25rem;
}
.template-card p {
  font-size: 0.8rem;
  color: var(--text-light);
}
/* Rich text toolbar */
.rich-text-toolbar {
  display: flex;
  gap: 0.25rem;
  padding: 0.25rem;
  background-color: rgba(0, 0, 0, 0.05);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  flex-wrap: wrap;
}
.toolbar-btn {
  background: none;
  border: none;
  cursor: pointer;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: var(--transition);
  font-size: 0.85rem;
  font-weight: 600;
}
.toolbar-btn:hover {
  background-color: rgba(0, 0, 0, 0.1);
}
.toolbar-btn.active {
  background-color: rgba(0, 0, 0, 0.15);
}
/* Markdown rendering */
.note-content.markdown-mode {
  white-space: pre-wrap;
}
.note-content.preview-mode {
  overflow-y: auto;
  user-select: text;
}
.note-content.preview-mode h1,
.note-content.preview-mode h2,
.note-content.preview-mode h3 {
  margin-top: 0.5rem;
  margin-bottom: 0.25rem;
  line-height: 1;
}
.note-content.preview-mode ul,
.note-content.preview-mode ol {
  margin-left: 1.5rem;
  margin-bottom: 0.5rem;
  line-height: 1;
}
.note-content.preview-mode code {
  background-color: rgba(0, 0, 0, 0.1);
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  font-family: monospace;
  font-size: 0.85em;
}
.note-content.preview-mode pre {
  background-color: rgba(0, 0, 0, 0.1);
  padding: 0.5rem;
  border-radius: 4px;
  overflow-x: auto;
  margin: 0.5rem 0;
}
.note-content.preview-mode a {
  color: var(--primary-color);
  text-decoration: underline;
}
.note-content.preview-mode blockquote {
  border-left: 3px solid rgba(0, 0, 0, 0.2);
  padding-left: 0.75rem;
  margin: 0.5rem 0;
  color: var(--text-light);
}
/* Reminder indicator */
.reminder-indicator {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background-color: #ff6b6b;
  color: white;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  gap: 0.2rem;
  z-index: 10;
}
.reminder-indicator .material-symbols-outlined {
  font-size: 14px;
}
/* Category badge */
.category-badge {
  background-color: var(--primary-color);
  color: white;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  font-size: 0.7rem;
  margin-right: 0.25rem;
}
/* Kanban Board */
.kanban-board {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  min-height: calc(100vh - 80px);
  overflow-x: auto;
}
.kanban-column {
  flex: 1;
  min-width: 300px;
  background-color: var(--secondary-color);
  border-radius: var(--border-radius);
  padding: 1rem;
  display: flex;
  flex-direction: column;
}
.kanban-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border-color);
}
.kanban-header h3 {
  font-size: 1.1rem;
  margin: 0;
}
.kanban-count {
  background-color: var(--primary-color);
  color: white;
  padding: 0.2rem 0.5rem;
  border-radius: 12px;
  font-size: 0.8rem;
}
.kanban-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  overflow-y: auto;
}
.kanban-card {
  background-color: white;
  border-radius: var(--border-radius);
  padding: 0.75rem;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: var(--transition);
  border-left: 4px solid transparent;
}
.kanban-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}
.kanban-card.dragging {
  opacity: 0.5;
}
.kanban-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}
.kanban-card-content {
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  max-height: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kanban-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.7rem;
  color: var(--text-light);
}
/* View toggle */
.sticky-view {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.kanban-view {
  display: flex;
}
/* Touch improvements for mobile */
@media (hover: none) and (pointer: coarse) {
  .note {
    touch-action: none;
  }
  .note-action {
    width: 32px;
    height: 32px;
  }
  .btn {
    padding: 0.6rem 1.2rem;
    min-height: 44px;
  }
  .toolbar-btn {
    width: 36px;
    height: 36px;
  }
}
@media (max-width: 768px) {
  .toolbar {
    justify-content: center;
  }
  .search-container {
    order: 3;
    max-width: 100%;
    width: 100%;
    margin-top: 0.5rem;
  }
  .category-select {
    order: 4;
    width: 100%;
    margin-top: 0.5rem;
  }
  .note {
    width: calc(100% - 2rem);
    position: relative !important;
    margin-bottom: 1rem;
    height: auto;
    min-height: 200px;
  }
  .note-header {
    cursor: default;
  }
  .kanban-board {
    flex-direction: column;
  }
  .kanban-column {
    min-width: 100%;
  }
  .template-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
}
/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  padding: 20px;
}
.empty-icon {
  font-size: 4rem;
  margin-bottom: 20px;
  opacity: 0.5;
}
.empty-state h2 {
  margin-bottom: 10px;
  font-weight: 500;
}