Merge pull request #9 from R0m1k3/claude/dockerized-notes-todo-app-011CV1roGRbnm21wgtB2LMxP

Claude/dockerized notes todo app 011 cv1ro g rbnm21wgt b2 l mx p
This commit is contained in:
LogiFlow authored and GitHub committed 2025-11-11 14:51:18 +01:00
commit 2dfdc5d24b
6 files changed
+1012 -489

No files matched your search

+413 -316
View File
@@ -1,240 +1,152 @@
/* Composants UI */ /* Components - UI Elements modernes */
/* Search input */ /* ============================================
.search-input { NOTES CARDS
width: 100%; ============================================ */
padding: var(--spacing-sm) var(--spacing-md);
padding-right: 40px;
border: 2px solid var(--color-border);
border-radius: var(--radius-lg);
font-size: var(--font-size-base);
transition: border-color var(--transition-base);
}
.search-input:focus {
outline: none;
border-color: var(--color-accent);
}
.search-clear {
position: absolute;
right: var(--spacing-sm);
top: 50%;
transform: translateY(-50%);
width: 28px;
height: 28px;
border-radius: 50%;
background: var(--color-border);
color: var(--color-text-secondary);
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
transition: background var(--transition-base);
}
.search-clear:hover {
background: var(--color-text-secondary);
color: white;
}
/* User dropdown */
.user-info {
display: flex;
align-items: center;
gap: var(--spacing-sm);
padding: var(--spacing-sm) var(--spacing-md);
border-radius: var(--radius-md);
cursor: pointer;
transition: background var(--transition-base);
}
.user-info:hover {
background: var(--color-background);
}
.user-avatar {
font-size: var(--font-size-xl);
}
.user-name {
font-weight: 500;
}
.user-dropdown {
position: absolute;
top: calc(100% + var(--spacing-sm));
right: 0;
background: white;
border: 1px solid var(--color-border);
border-radius: var(--radius-md);
box-shadow: var(--shadow-lg);
min-width: 200px;
display: none;
animation: fadeIn var(--transition-base);
}
.user-dropdown.show {
display: block;
}
.dropdown-item {
width: 100%;
padding: var(--spacing-md);
text-align: left;
transition: background var(--transition-base);
border-bottom: 1px solid var(--color-border);
}
.dropdown-item:last-child {
border-bottom: none;
}
.dropdown-item:hover {
background: var(--color-background);
}
/* Note cards */
.note-card { .note-card {
background: var(--color-card); background: var(--color-card);
border: 1px solid var(--color-border);
border-radius: var(--radius-lg); border-radius: var(--radius-lg);
padding: var(--spacing-lg); padding: var(--spacing-lg);
box-shadow: var(--shadow-sm);
cursor: pointer; cursor: pointer;
transition: transform var(--transition-base), box-shadow var(--transition-base); transition: all var(--transition-base);
position: relative; box-shadow: var(--shadow-sm);
min-height: 150px;
max-height: 400px;
overflow: hidden;
} }
.note-card:hover { .note-card:hover {
transform: translateY(-4px); box-shadow: var(--shadow-hover);
box-shadow: var(--shadow-lg); transform: translateY(-2px);
border-color: var(--color-accent);
} }
.note-card-title { .note-card-title {
font-size: var(--font-size-lg); font-size: var(--font-size-lg);
font-weight: 600; font-weight: var(--font-weight-semibold);
color: var(--color-text-primary);
margin-bottom: var(--spacing-sm); margin-bottom: var(--spacing-sm);
white-space: nowrap; line-height: 1.4;
overflow: hidden;
text-overflow: ellipsis;
} }
.note-card-content { .note-card-preview {
color: var(--color-text-secondary);
font-size: var(--font-size-sm); font-size: var(--font-size-sm);
color: var(--color-text-secondary);
line-height: 1.6; line-height: 1.6;
margin-bottom: var(--spacing-md);
display: -webkit-box; display: -webkit-box;
-webkit-line-clamp: 3; -webkit-line-clamp: 3;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
overflow: hidden; overflow: hidden;
margin-bottom: var(--spacing-md);
}
.note-card-image {
width: 50px;
height: 50px;
border-radius: var(--radius-sm);
object-fit: cover;
position: absolute;
top: var(--spacing-md);
right: var(--spacing-md);
} }
.note-card-meta { .note-card-meta {
display: flex; display: flex;
justify-content: space-between;
align-items: center; align-items: center;
justify-content: space-between;
font-size: var(--font-size-xs); font-size: var(--font-size-xs);
color: var(--color-text-secondary); color: var(--color-text-secondary);
margin-top: auto; padding-top: var(--spacing-sm);
border-top: 1px solid var(--color-border);
} }
.note-card-badge { .note-card-date {
background: var(--color-accent); font-weight: var(--font-weight-medium);
color: white;
padding: 2px 8px;
border-radius: var(--radius-sm);
font-size: var(--font-size-xs);
} }
/* FAB Button */ .note-card-todos-count {
.fab {
position: fixed;
bottom: var(--spacing-xl);
right: calc(var(--sidebar-width) + var(--spacing-xl));
width: 60px;
height: 60px;
background: var(--color-accent);
color: white;
border-radius: 50%;
font-size: 32px;
box-shadow: var(--shadow-lg);
transition: transform var(--transition-base), box-shadow var(--transition-base);
z-index: 50;
}
.fab:hover {
transform: scale(1.1);
box-shadow: var(--shadow-xl);
background: var(--color-accent-hover);
}
/* Todo sidebar components */
.sidebar-title {
font-size: var(--font-size-xl);
font-weight: bold;
margin-bottom: var(--spacing-lg);
}
.todo-input-container {
display: flex; display: flex;
gap: var(--spacing-sm); align-items: center;
gap: 4px;
padding: 2px 8px;
background: var(--color-background);
border-radius: var(--radius-full);
font-weight: var(--font-weight-medium);
}
.note-card-image {
width: 100%;
height: 140px;
object-fit: cover;
border-radius: var(--radius-md);
margin-bottom: var(--spacing-md); margin-bottom: var(--spacing-md);
} }
/* ============================================
TODO BOX
============================================ */
.todo-input-wrapper {
position: relative;
margin-bottom: var(--spacing-lg);
}
.todo-input { .todo-input {
flex: 1; width: 100%;
padding: var(--spacing-sm) var(--spacing-md); padding: var(--spacing-md) 48px var(--spacing-md) var(--spacing-md);
border: 2px solid var(--color-border); border: 1px solid var(--color-border);
border-radius: var(--radius-md); border-radius: var(--radius-md);
font-size: var(--font-size-base); font-size: var(--font-size-sm);
color: var(--color-text-primary);
background: var(--color-background);
transition: all var(--transition-base);
} }
.todo-input:focus { .todo-input:focus {
outline: none; outline: none;
border-color: var(--color-accent); border-color: var(--color-accent);
background: var(--color-card);
box-shadow: var(--shadow-sm);
} }
.todo-add-btn { .btn-add-todo {
width: 40px; position: absolute;
height: 40px; right: var(--spacing-sm);
top: 50%;
transform: translateY(-50%);
width: 32px;
height: 32px;
padding: 6px;
border: none;
border-radius: var(--radius-sm);
background: var(--color-accent); background: var(--color-accent);
color: white; color: white;
border-radius: var(--radius-md); cursor: pointer;
font-size: var(--font-size-xl); transition: all var(--transition-fast);
transition: background var(--transition-base);
} }
.todo-add-btn:hover { .btn-add-todo:hover {
background: var(--color-accent-hover); background: var(--color-accent-hover);
transform: translateY(-50%) scale(1.05);
} }
.btn-add-todo svg {
width: 100%;
height: 100%;
}
/* Todo Filters */
.todo-filters { .todo-filters {
display: flex; display: flex;
gap: var(--spacing-sm); gap: var(--spacing-xs);
margin-bottom: var(--spacing-md); margin-bottom: var(--spacing-lg);
} }
.filter-btn { .filter-btn {
flex: 1; flex: 1;
padding: var(--spacing-sm); padding: var(--spacing-sm);
border: 1px solid var(--color-border); border: 1px solid var(--color-border);
border-radius: var(--radius-md); border-radius: var(--radius-sm);
font-size: var(--font-size-sm); background: transparent;
transition: background var(--transition-base), color var(--transition-base); color: var(--color-text-secondary);
font-size: var(--font-size-xs);
font-weight: var(--font-weight-medium);
cursor: pointer;
transition: all var(--transition-fast);
}
.filter-btn:hover {
background: var(--color-hover);
color: var(--color-text-primary);
} }
.filter-btn.active { .filter-btn.active {
@@ -243,14 +155,10 @@
border-color: var(--color-accent); border-color: var(--color-accent);
} }
.todo-counter { /* Todo List */
text-align: center;
color: var(--color-text-secondary);
font-size: var(--font-size-sm);
margin-bottom: var(--spacing-md);
}
.todo-list { .todo-list {
flex: 1;
overflow-y: auto;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: var(--spacing-sm); gap: var(--spacing-sm);
@@ -261,28 +169,34 @@
align-items: center; align-items: center;
gap: var(--spacing-md); gap: var(--spacing-md);
padding: var(--spacing-md); padding: var(--spacing-md);
background: white; background: var(--color-background);
border-radius: var(--radius-md); border-radius: var(--radius-md);
transition: background var(--transition-base); transition: all var(--transition-fast);
} }
.todo-item:hover { .todo-item:hover {
background: var(--color-background); background: var(--color-hover);
}
.todo-item.hidden {
display: none;
} }
.todo-checkbox { .todo-checkbox {
width: 20px; width: 18px;
height: 20px; height: 18px;
border: 2px solid var(--color-border);
border-radius: 4px;
cursor: pointer; cursor: pointer;
transition: all var(--transition-fast);
}
.todo-checkbox:checked {
background: var(--color-accent);
border-color: var(--color-accent);
} }
.todo-text { .todo-text {
flex: 1; flex: 1;
font-size: var(--font-size-base); font-size: var(--font-size-sm);
color: var(--color-text-primary);
line-height: 1.5;
} }
.todo-item.completed .todo-text { .todo-item.completed .todo-text {
@@ -291,109 +205,180 @@
} }
.todo-delete { .todo-delete {
opacity: 0;
width: 24px; width: 24px;
height: 24px; height: 24px;
border-radius: 50%; padding: 4px;
background: var(--color-danger); border: none;
color: white; border-radius: var(--radius-sm);
font-size: var(--font-size-sm); background: transparent;
transition: opacity var(--transition-base); color: var(--color-text-secondary);
cursor: pointer;
opacity: 0;
transition: all var(--transition-fast);
} }
.todo-item:hover .todo-delete { .todo-item:hover .todo-delete {
opacity: 1; opacity: 1;
} }
/* Modal */ .todo-delete:hover {
.modal-backdrop { background: var(--color-danger);
color: white;
}
/* ============================================
NOTE EDITOR (EXPANDED)
============================================ */
.note-editor-backdrop {
position: fixed; position: fixed;
inset: 0; top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.5); background: rgba(0, 0, 0, 0.5);
backdrop-filter: blur(8px); z-index: var(--z-modal);
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
z-index: 1000;
padding: var(--spacing-lg);
}
.modal-content {
background: white;
border-radius: var(--radius-xl);
box-shadow: var(--shadow-xl);
max-width: 700px;
width: 100%;
max-height: 90vh;
overflow-y: auto;
padding: var(--spacing-xl); padding: var(--spacing-xl);
backdrop-filter: blur(4px);
animation: fadeIn var(--transition-base);
} }
.admin-modal { @keyframes fadeIn {
max-width: 900px; from {
opacity: 0;
}
to {
opacity: 1;
}
} }
.modal-header { .note-editor {
width: 100%;
max-width: 800px;
max-height: 90vh;
background: var(--color-card);
border-radius: var(--radius-xl);
box-shadow: var(--shadow-2xl);
display: flex;
flex-direction: column;
overflow: hidden;
animation: slideUp var(--transition-base);
}
@keyframes slideUp {
from {
opacity: 0;
transform: translateY(20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.note-editor-header {
display: flex; display: flex;
justify-content: space-between;
align-items: center; align-items: center;
margin-bottom: var(--spacing-lg); justify-content: space-between;
padding: var(--spacing-lg) var(--spacing-xl);
border-bottom: 1px solid var(--color-border);
} }
.modal-close { .btn-close-editor {
width: 36px; width: 36px;
height: 36px; height: 36px;
border-radius: 50%; padding: 8px;
background: var(--color-border); border: none;
font-size: var(--font-size-lg); border-radius: var(--radius-md);
transition: background var(--transition-base); background: transparent;
color: var(--color-text-secondary);
cursor: pointer;
transition: all var(--transition-fast);
} }
.modal-close:hover { .btn-close-editor:hover {
background: var(--color-text-secondary); background: var(--color-hover);
color: white; color: var(--color-text-primary);
} }
.modal-delete { .note-editor-actions {
display: flex;
align-items: center;
gap: var(--spacing-sm);
}
.btn-icon {
width: 36px; width: 36px;
height: 36px; height: 36px;
border-radius: 50%; padding: 8px;
background: var(--color-danger); border: 1px solid var(--color-border);
color: white; border-radius: var(--radius-md);
font-size: var(--font-size-lg); background: transparent;
transition: background var(--transition-base); color: var(--color-text-secondary);
cursor: pointer;
transition: all var(--transition-fast);
} }
.modal-delete:hover { .btn-icon:hover {
background: #DC2626; background: var(--color-hover);
color: var(--color-text-primary);
border-color: var(--color-accent);
}
.btn-primary {
display: flex;
align-items: center;
gap: var(--spacing-sm);
padding: var(--spacing-sm) var(--spacing-lg);
border: none;
border-radius: var(--radius-md);
background: var(--color-accent);
color: white;
font-size: var(--font-size-sm);
font-weight: var(--font-weight-semibold);
cursor: pointer;
transition: all var(--transition-base);
}
.btn-primary:hover {
background: var(--color-accent-hover);
box-shadow: var(--shadow-md);
}
.btn-primary svg {
width: 16px;
height: 16px;
} }
.note-title-input { .note-title-input {
width: 100%; width: 100%;
font-size: var(--font-size-xl); padding: var(--spacing-lg) var(--spacing-xl);
font-weight: bold;
border: none; border: none;
padding: var(--spacing-sm) 0; border-bottom: 1px solid var(--color-border);
margin-bottom: var(--spacing-md); font-size: var(--font-size-2xl);
font-weight: var(--font-weight-bold);
color: var(--color-text-primary);
background: transparent;
} }
.note-title-input:focus { .note-title-input:focus {
outline: none; outline: none;
} background: var(--color-background);
.note-divider {
height: 1px;
background: var(--color-border);
margin: var(--spacing-lg) 0;
} }
.note-content-textarea { .note-content-textarea {
width: 100%; flex: 1;
min-height: 200px; min-height: 300px;
padding: var(--spacing-xl);
border: none; border: none;
resize: vertical;
font-size: var(--font-size-base); font-size: var(--font-size-base);
line-height: 1.6; color: var(--color-text-primary);
line-height: 1.8;
resize: none;
font-family: var(--font-family);
} }
.note-content-textarea:focus { .note-content-textarea:focus {
@@ -401,30 +386,45 @@
} }
.note-image-container { .note-image-container {
padding: 0 var(--spacing-xl) var(--spacing-lg);
position: relative; position: relative;
margin: var(--spacing-lg) 0;
} }
.note-image { .note-image {
width: 100%; width: 100%;
border-radius: var(--radius-md); max-height: 300px;
object-fit: cover;
border-radius: var(--radius-lg);
} }
.note-image-remove { .btn-remove-image {
position: absolute; position: absolute;
top: var(--spacing-sm); top: var(--spacing-md);
right: var(--spacing-sm); right: calc(var(--spacing-xl) + var(--spacing-md));
width: 32px; width: 32px;
height: 32px; height: 32px;
border-radius: 50%; padding: 6px;
background: var(--color-danger); border: none;
border-radius: var(--radius-full);
background: rgba(0, 0, 0, 0.7);
color: white; color: white;
font-size: var(--font-size-base); cursor: pointer;
transition: all var(--transition-fast);
}
.btn-remove-image:hover {
background: var(--color-danger);
}
.note-todos-section {
padding: var(--spacing-lg) var(--spacing-xl);
border-top: 1px solid var(--color-border);
} }
.note-section-title { .note-section-title {
font-size: var(--font-size-lg); font-size: var(--font-size-base);
font-weight: 600; font-weight: var(--font-weight-semibold);
color: var(--color-text-primary);
margin-bottom: var(--spacing-md); margin-bottom: var(--spacing-md);
} }
@@ -435,56 +435,136 @@
margin-bottom: var(--spacing-md); margin-bottom: var(--spacing-md);
} }
.note-add-todo-btn { .btn-add-note-todo {
width: 100%;
padding: var(--spacing-md);
border: 2px dashed var(--color-border);
border-radius: var(--radius-md);
color: var(--color-text-secondary);
transition: border-color var(--transition-base), color var(--transition-base);
}
.note-add-todo-btn:hover {
border-color: var(--color-accent);
color: var(--color-accent);
}
.modal-actions {
display: flex; display: flex;
align-items: center;
gap: var(--spacing-sm);
padding: var(--spacing-sm) var(--spacing-md);
border: 1px dashed var(--color-border);
border-radius: var(--radius-md);
background: transparent;
color: var(--color-text-secondary);
font-size: var(--font-size-sm);
font-weight: var(--font-weight-medium);
cursor: pointer;
transition: all var(--transition-fast);
}
.btn-add-note-todo:hover {
background: var(--color-hover);
border-color: var(--color-accent);
color: var(--color-text-primary);
}
.btn-add-note-todo svg {
width: 16px;
height: 16px;
}
.note-editor-footer {
display: flex;
align-items: center;
gap: var(--spacing-md); gap: var(--spacing-md);
margin-top: var(--spacing-lg); padding: var(--spacing-lg) var(--spacing-xl);
border-top: 1px solid var(--color-border);
background: var(--color-background);
}
.note-metadata {
flex: 1;
font-size: var(--font-size-xs);
color: var(--color-text-secondary);
}
/* ============================================
MODALS (Admin & Confirm)
============================================ */
.modal-backdrop {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.5);
display: flex;
align-items: center;
justify-content: center;
z-index: var(--z-modal);
backdrop-filter: blur(4px);
}
.modal-content {
background: var(--color-card);
border-radius: var(--radius-xl);
box-shadow: var(--shadow-2xl);
max-width: 90vw;
max-height: 90vh;
overflow: hidden;
animation: slideUp var(--transition-base);
}
.modal-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: var(--spacing-xl);
border-bottom: 1px solid var(--color-border);
}
.modal-header h2 {
font-size: var(--font-size-xl);
font-weight: var(--font-weight-bold);
color: var(--color-text-primary);
}
.modal-close {
width: 36px;
height: 36px;
padding: 8px;
border: none;
border-radius: var(--radius-md);
background: transparent;
color: var(--color-text-secondary);
font-size: var(--font-size-xl);
cursor: pointer;
transition: all var(--transition-fast);
}
.modal-close:hover {
background: var(--color-hover);
color: var(--color-text-primary);
}
/* Admin Modal */
.admin-modal {
min-width: 700px;
}
.admin-actions {
padding: var(--spacing-lg) var(--spacing-xl);
border-bottom: 1px solid var(--color-border);
} }
.action-btn { .action-btn {
padding: var(--spacing-md) var(--spacing-lg); padding: var(--spacing-sm) var(--spacing-lg);
border: none;
border-radius: var(--radius-md);
background: var(--color-accent); background: var(--color-accent);
color: white; color: white;
border-radius: var(--radius-md); font-size: var(--font-size-sm);
font-size: var(--font-size-base); font-weight: var(--font-weight-semibold);
transition: background var(--transition-base); cursor: pointer;
transition: all var(--transition-base);
} }
.action-btn:hover { .action-btn:hover {
background: var(--color-accent-hover); background: var(--color-accent-hover);
} box-shadow: var(--shadow-md);
.modal-footer {
margin-top: var(--spacing-lg);
padding-top: var(--spacing-lg);
border-top: 1px solid var(--color-border);
}
.note-metadata {
font-size: var(--font-size-sm);
color: var(--color-text-secondary);
}
/* Admin table */
.admin-actions {
margin-bottom: var(--spacing-lg);
} }
.users-table-container { .users-table-container {
padding: var(--spacing-xl);
overflow-x: auto; overflow-x: auto;
} }
@@ -501,35 +581,53 @@
} }
.users-table th { .users-table th {
font-weight: 600; font-size: var(--font-size-sm);
font-weight: var(--font-weight-semibold);
color: var(--color-text-secondary);
background: var(--color-background); background: var(--color-background);
} }
.users-table tbody tr:hover { .users-table tbody tr:hover {
background: var(--color-background); background: var(--color-hover);
}
.btn-edit-user,
.btn-delete-user {
padding: var(--spacing-sm) var(--spacing-md);
border: none;
border-radius: var(--radius-sm);
font-size: var(--font-size-xs);
font-weight: var(--font-weight-medium);
cursor: pointer;
transition: all var(--transition-fast);
margin-right: var(--spacing-xs);
}
.btn-edit-user {
background: var(--color-accent);
color: white;
}
.btn-edit-user:hover {
background: var(--color-accent-hover);
box-shadow: var(--shadow-sm);
} }
.btn-delete-user { .btn-delete-user {
padding: var(--spacing-sm) var(--spacing-md);
background: var(--color-danger); background: var(--color-danger);
color: white; color: white;
border: none;
border-radius: 6px;
cursor: pointer;
font-size: 0.875rem;
transition: all var(--transition-speed);
} }
.btn-delete-user:hover { .btn-delete-user:hover {
background: #c0392b; background: #c0392b;
transform: translateY(-1px); box-shadow: var(--shadow-sm);
} }
/* Modal de confirmation */ /* Confirm Modal */
.confirm-modal { .confirm-modal {
max-width: 450px; max-width: 450px;
padding: var(--spacing-2xl);
text-align: center; text-align: center;
padding: var(--spacing-xl) var(--spacing-lg);
} }
.confirm-icon { .confirm-icon {
@@ -539,16 +637,16 @@
.confirm-title { .confirm-title {
font-size: var(--font-size-xl); font-size: var(--font-size-xl);
font-weight: 600; font-weight: var(--font-weight-bold);
color: var(--color-text-primary);
margin-bottom: var(--spacing-md); margin-bottom: var(--spacing-md);
color: var(--color-text);
} }
.confirm-message { .confirm-message {
font-size: var(--font-size-base); font-size: var(--font-size-base);
color: var(--color-text-secondary); color: var(--color-text-secondary);
margin-bottom: var(--spacing-xl);
line-height: 1.6; line-height: 1.6;
margin-bottom: var(--spacing-xl);
} }
.confirm-actions { .confirm-actions {
@@ -563,20 +661,20 @@
border: none; border: none;
border-radius: var(--radius-md); border-radius: var(--radius-md);
font-size: var(--font-size-base); font-size: var(--font-size-base);
font-weight: 500; font-weight: var(--font-weight-semibold);
cursor: pointer; cursor: pointer;
transition: all var(--transition-speed); transition: all var(--transition-base);
min-width: 120px; min-width: 120px;
} }
.btn-cancel { .btn-cancel {
background: var(--color-background); background: var(--color-background);
color: var(--color-text); color: var(--color-text-primary);
border: 2px solid var(--color-border); border: 1px solid var(--color-border);
} }
.btn-cancel:hover { .btn-cancel:hover {
background: var(--color-border); background: var(--color-hover);
} }
.btn-confirm { .btn-confirm {
@@ -586,6 +684,5 @@
.btn-confirm:hover { .btn-confirm:hover {
background: #c0392b; background: #c0392b;
transform: translateY(-2px); box-shadow: var(--shadow-md);
box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
} }
+286 -62
View File
@@ -1,10 +1,18 @@
/* Layout principal de l'application */ /* Layout - Structure principale */
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body { body {
font-family: var(--font-family); font-family: var(--font-family);
background: var(--color-background);
color: var(--color-text-primary);
font-size: var(--font-size-base); font-size: var(--font-size-base);
color: var(--color-text-primary);
background: var(--color-background);
line-height: 1.6;
min-height: 100vh;
} }
/* Header */ /* Header */
@@ -16,114 +24,330 @@ body {
height: var(--header-height); height: var(--header-height);
background: var(--color-card); background: var(--color-card);
border-bottom: 1px solid var(--color-border); border-bottom: 1px solid var(--color-border);
z-index: 100;
box-shadow: var(--shadow-sm); box-shadow: var(--shadow-sm);
z-index: var(--z-header);
} }
.header-content { .header-container {
max-width: var(--max-width);
height: 100%; height: 100%;
max-width: 100%; margin: 0 auto;
padding: 0 var(--spacing-lg); padding: 0 var(--spacing-xl);
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; gap: var(--spacing-xl);
gap: var(--spacing-lg);
} }
.header-logo h1 { /* Logo */
font-size: var(--font-size-xl); .logo {
font-weight: bold; display: flex;
align-items: center;
gap: var(--spacing-md);
flex-shrink: 0;
}
.logo-icon {
width: 32px;
height: 32px;
color: var(--color-accent); color: var(--color-accent);
} }
.header-search { .logo-text {
font-size: var(--font-size-xl);
font-weight: var(--font-weight-bold);
color: var(--color-accent);
letter-spacing: -0.5px;
}
/* Search */
.search-container {
flex: 1; flex: 1;
max-width: 600px; max-width: 500px;
position: relative; position: relative;
} }
.header-user { .search-icon {
position: relative; position: absolute;
left: var(--spacing-md);
top: 50%;
transform: translateY(-50%);
width: 18px;
height: 18px;
color: var(--color-text-secondary);
pointer-events: none;
} }
/* Main container */ .search-input {
.main-container { width: 100%;
height: 44px;
padding: 0 var(--spacing-xl) 0 44px;
border: 1px solid var(--color-border);
border-radius: var(--radius-full);
font-size: var(--font-size-base);
background: var(--color-background);
color: var(--color-text-primary);
transition: all var(--transition-base);
}
.search-input:focus {
outline: none;
border-color: var(--color-accent);
background: var(--color-card);
box-shadow: var(--shadow-sm);
}
.search-clear {
position: absolute;
right: var(--spacing-md);
top: 50%;
transform: translateY(-50%);
width: 24px;
height: 24px;
padding: 4px;
border: none;
background: transparent;
cursor: pointer;
color: var(--color-text-secondary);
border-radius: 50%;
transition: all var(--transition-fast);
}
.search-clear:hover {
background: var(--color-hover);
color: var(--color-text-primary);
}
.search-clear svg {
width: 100%;
height: 100%;
}
/* User Menu */
.user-menu {
position: relative;
flex-shrink: 0;
}
.user-button {
display: flex; display: flex;
align-items: center;
gap: var(--spacing-sm);
padding: var(--spacing-sm) var(--spacing-md);
border: 1px solid var(--color-border);
border-radius: var(--radius-full);
background: var(--color-card);
color: var(--color-text-primary);
font-size: var(--font-size-sm);
font-weight: var(--font-weight-medium);
cursor: pointer;
transition: all var(--transition-base);
}
.user-button:hover {
background: var(--color-hover);
box-shadow: var(--shadow-sm);
}
.user-icon {
width: 20px;
height: 20px;
}
.dropdown-arrow {
width: 16px;
height: 16px;
transition: transform var(--transition-base);
}
.user-menu:hover .dropdown-arrow {
transform: rotate(180deg);
}
.user-dropdown {
position: absolute;
top: calc(100% + var(--spacing-sm));
right: 0;
min-width: 200px;
background: var(--color-card);
border: 1px solid var(--color-border);
border-radius: var(--radius-md);
box-shadow: var(--shadow-lg);
opacity: 0;
visibility: hidden;
transform: translateY(-10px);
transition: all var(--transition-base);
z-index: var(--z-dropdown);
}
.user-menu:hover .user-dropdown {
opacity: 1;
visibility: visible;
transform: translateY(0);
}
.dropdown-item {
display: flex;
align-items: center;
gap: var(--spacing-md);
width: 100%;
padding: var(--spacing-md) var(--spacing-lg);
border: none;
background: transparent;
color: var(--color-text-primary);
font-size: var(--font-size-sm);
font-weight: var(--font-weight-medium);
text-align: left;
cursor: pointer;
transition: background var(--transition-fast);
}
.dropdown-item:first-child {
border-radius: var(--radius-md) var(--radius-md) 0 0;
}
.dropdown-item:last-child {
border-radius: 0 0 var(--radius-md) var(--radius-md);
}
.dropdown-item:hover {
background: var(--color-hover);
}
.dropdown-item svg {
width: 18px;
height: 18px;
}
/* Main Content */
.main-content {
margin-top: var(--header-height); margin-top: var(--header-height);
min-height: calc(100vh - var(--header-height)); min-height: calc(100vh - var(--header-height));
padding: var(--spacing-2xl) var(--spacing-xl);
} }
/* Notes area */ .content-container {
.notes-area { max-width: var(--max-width);
flex: 1; margin: 0 auto;
padding: var(--spacing-xl); display: grid;
overflow-y: auto; grid-template-columns: 1fr var(--todo-box-width);
position: relative; gap: var(--spacing-xl);
align-items: start;
}
/* Notes Section */
.notes-section {
min-width: 0;
}
.section-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: var(--spacing-lg);
}
.section-title {
font-size: var(--font-size-2xl);
font-weight: var(--font-weight-bold);
color: var(--color-text-primary);
}
.btn-new-note {
display: flex;
align-items: center;
gap: var(--spacing-sm);
padding: var(--spacing-md) var(--spacing-lg);
border: none;
border-radius: var(--radius-md);
background: var(--color-accent);
color: white;
font-size: var(--font-size-sm);
font-weight: var(--font-weight-semibold);
cursor: pointer;
transition: all var(--transition-base);
box-shadow: var(--shadow-sm);
}
.btn-new-note:hover {
background: var(--color-accent-hover);
box-shadow: var(--shadow-md);
transform: translateY(-1px);
}
.btn-new-note svg {
width: 18px;
height: 18px;
} }
.notes-grid { .notes-grid {
display: grid; display: grid;
grid-template-columns: repeat(auto-fill, minmax(var(--note-card-width), 1fr)); grid-template-columns: repeat(auto-fill, minmax(var(--note-width), 1fr));
gap: var(--spacing-lg); gap: var(--spacing-lg);
max-width: 1400px;
margin: 0 auto;
} }
/* Todo sidebar */ /* Todo Box */
.todo-sidebar { .todo-box {
position: sticky; position: sticky;
top: var(--header-height); top: calc(var(--header-height) + var(--spacing-xl));
right: 0; background: var(--color-card);
width: var(--sidebar-width); border: 1px solid var(--color-border);
height: calc(100vh - var(--header-height)); border-radius: var(--radius-lg);
background: var(--color-sidebar); padding: var(--spacing-xl);
border-left: 1px solid var(--color-border); box-shadow: var(--shadow-md);
padding: var(--spacing-lg); max-height: calc(100vh - var(--header-height) - var(--spacing-2xl) * 2);
overflow-y: auto; display: flex;
flex-shrink: 0; flex-direction: column;
}
.todo-box-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: var(--spacing-lg);
}
.todo-box-title {
font-size: var(--font-size-xl);
font-weight: var(--font-weight-bold);
color: var(--color-text-primary);
}
.todo-counter {
font-size: var(--font-size-sm);
color: var(--color-text-secondary);
font-weight: var(--font-weight-medium);
} }
/* Responsive */ /* Responsive */
@media (max-width: 1024px) { @media (max-width: 1200px) {
.notes-grid { .content-container {
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); grid-template-columns: 1fr;
} }
.todo-sidebar { .todo-box {
width: 320px; position: static;
max-height: none;
} }
} }
@media (max-width: 768px) { @media (max-width: 768px) {
.main-container { .header-container {
flex-direction: column;
}
.header-content {
padding: 0 var(--spacing-md); padding: 0 var(--spacing-md);
gap: var(--spacing-sm);
} }
.header-logo h1 { .search-container {
font-size: var(--font-size-lg); max-width: 300px;
} }
.header-search { .logo-text {
max-width: 400px; display: none;
} }
.notes-area { .main-content {
padding: var(--spacing-md); padding: var(--spacing-lg) var(--spacing-md);
} }
.notes-grid { .notes-grid {
grid-template-columns: 1fr; grid-template-columns: 1fr;
} }
.todo-sidebar {
position: static;
width: 100%;
height: auto;
max-height: 400px;
}
} }
+61 -32
View File
@@ -1,26 +1,38 @@
/* Variables CSS globales */ /* Variables CSS globales - Thème clair moderne */
:root { :root {
/* Couleurs principales */ /* Couleurs principales */
--color-background: #FAFBFC; --color-background: #F8F9FA;
--color-card: #FFFFFF; --color-card: #FFFFFF;
--color-sidebar: #F8F9FA; --color-accent: #000000;
--color-accent: #3B82F6; --color-accent-hover: #333333;
--color-accent-hover: #2563EB; --color-text-primary: #000000;
--color-text-primary: #1F2937; --color-text-secondary: #6C757D;
--color-text-secondary: #6B7280; --color-border: #DEE2E6;
--color-border: #E5E7EB; --color-success: #28A745;
--color-success: #10B981; --color-danger: #DC3545;
--color-danger: #EF4444; --color-warning: #FFC107;
--color-info: #17A2B8;
/* Couleurs spécifiques */
--color-hover: #F1F3F5;
--color-active: #E9ECEF;
--color-disabled: #ADB5BD;
/* Typographie */ /* Typographie */
--font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
--font-size-xs: 12px; --font-size-xs: 11px;
--font-size-sm: 14px; --font-size-sm: 13px;
--font-size-base: 16px; --font-size-base: 15px;
--font-size-lg: 18px; --font-size-lg: 17px;
--font-size-xl: 24px; --font-size-xl: 20px;
--font-size-2xl: 32px; --font-size-2xl: 28px;
--font-size-3xl: 36px;
--font-weight-normal: 400;
--font-weight-medium: 500;
--font-weight-semibold: 600;
--font-weight-bold: 700;
/* Spacing */ /* Spacing */
--spacing-xs: 4px; --spacing-xs: 4px;
@@ -28,26 +40,43 @@
--spacing-md: 16px; --spacing-md: 16px;
--spacing-lg: 24px; --spacing-lg: 24px;
--spacing-xl: 32px; --spacing-xl: 32px;
--spacing-2xl: 48px;
--spacing-3xl: 64px;
/* Border radius */ /* Border radius */
--radius-sm: 4px; --radius-sm: 6px;
--radius-md: 8px; --radius-md: 10px;
--radius-lg: 12px; --radius-lg: 14px;
--radius-xl: 16px; --radius-xl: 20px;
--radius-full: 9999px;
/* Shadows */ /* Shadows - Style moderne élégant */
--shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08); --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
--shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1); --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.06);
--shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12); --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
--shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.3); --shadow-lg: 0 8px 20px rgba(0, 0, 0, 0.1);
--shadow-xl: 0 16px 40px rgba(0, 0, 0, 0.12);
--shadow-2xl: 0 24px 60px rgba(0, 0, 0, 0.15);
/* Shadow hover effects */
--shadow-hover: 0 6px 16px rgba(0, 0, 0, 0.12);
--shadow-active: 0 2px 8px rgba(0, 0, 0, 0.1);
/* Transitions */ /* Transitions */
--transition-fast: 0.15s ease; --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
--transition-base: 0.2s ease; --transition-base: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
--transition-slow: 0.3s ease; --transition-slow: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
/* Dimensions */ /* Dimensions */
--header-height: 60px; --header-height: 70px;
--sidebar-width: 400px; --max-width: 1400px;
--note-card-width: 350px; --note-width: 320px;
--note-expanded-width: 680px;
--todo-box-width: 340px;
/* Z-index */
--z-header: 100;
--z-modal: 200;
--z-dropdown: 150;
--z-tooltip: 250;
} }
+23
View File
@@ -0,0 +1,23 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
<defs>
<linearGradient id="gradient" x1="0%" y1="0%" x2="100%" y2="100%">
<stop offset="0%" style="stop-color:#000;stop-opacity:1" />
<stop offset="100%" style="stop-color:#333;stop-opacity:1" />
</linearGradient>
</defs>
<!-- Background circle -->
<circle cx="50" cy="50" r="45" fill="url(#gradient)"/>
<!-- Note icon -->
<rect x="28" y="22" width="44" height="56" rx="4" fill="white"/>
<!-- Lines representing text -->
<line x1="35" y1="35" x2="65" y2="35" stroke="#000" stroke-width="2" stroke-linecap="round"/>
<line x1="35" y1="45" x2="60" y2="45" stroke="#000" stroke-width="2" stroke-linecap="round"/>
<line x1="35" y1="55" x2="65" y2="55" stroke="#000" stroke-width="2" stroke-linecap="round"/>
<!-- Checkmark -->
<circle cx="38" cy="65" r="4" fill="none" stroke="#000" stroke-width="1.5"/>
<path d="M 36.5 65 L 38 66.5 L 41 63" stroke="#000" stroke-width="1.5" fill="none" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

+150 -66
View File
@@ -3,7 +3,10 @@
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>NoteFlow - Notes & Todo</title> <title>NoteFlow - Notes & Tasks</title>
<!-- Favicon -->
<link rel="icon" type="image/svg+xml" href="/favicon.svg">
<!-- CSS --> <!-- CSS -->
<link rel="stylesheet" href="/css/reset.css"> <link rel="stylesheet" href="/css/reset.css">
@@ -13,103 +16,184 @@
<link rel="stylesheet" href="/css/animations.css"> <link rel="stylesheet" href="/css/animations.css">
</head> </head>
<body> <body>
<!-- Header fixe --> <!-- Header -->
<header class="header"> <header class="header">
<div class="header-content"> <div class="header-container">
<div class="header-logo"> <!-- Logo -->
<h1>📝 NoteFlow</h1> <div class="logo">
<svg class="logo-icon" viewBox="0 0 40 40" xmlns="http://www.w3.org/2000/svg">
<rect x="8" y="6" width="24" height="28" rx="2" fill="currentColor"/>
<rect x="10" y="8" width="20" height="24" rx="1" fill="white"/>
<line x1="13" y1="13" x2="27" y2="13" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
<line x1="13" y1="18" x2="24" y2="18" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
<line x1="13" y1="23" x2="27" y2="23" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
<circle cx="15" cy="28" r="2" fill="none" stroke="currentColor" stroke-width="1.2"/>
<path d="M 14 28 L 14.8 28.8 L 16.5 27" stroke="currentColor" stroke-width="1.2" fill="none" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
<span class="logo-text">NoteFlow</span>
</div> </div>
<div class="header-search"> <!-- Search -->
<div class="search-container">
<svg class="search-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<circle cx="11" cy="11" r="8"></circle>
<path d="m21 21-4.35-4.35"></path>
</svg>
<input type="text" id="searchInput" placeholder="Rechercher des notes..." class="search-input"> <input type="text" id="searchInput" placeholder="Rechercher des notes..." class="search-input">
<button id="searchClear" class="search-clear" style="display: none;">✕</button> <button id="searchClear" class="search-clear" style="display: none;">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<line x1="18" y1="6" x2="6" y2="18"></line>
<line x1="6" y1="6" x2="18" y2="18"></line>
</svg>
</button>
</div> </div>
<div class="header-user"> <!-- User -->
<div class="user-info" id="userInfo"> <div class="user-menu">
<span class="user-avatar">👤</span> <button class="user-button" id="userInfo">
<span class="user-name" id="userName">User</span> <svg class="user-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<span class="user-dropdown-icon">▼</span> <path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"></path>
</div> <circle cx="12" cy="7" r="4"></circle>
</svg>
<span id="userName">User</span>
<svg class="dropdown-arrow" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<polyline points="6 9 12 15 18 9"></polyline>
</svg>
</button>
<div class="user-dropdown" id="userDropdown"> <div class="user-dropdown" id="userDropdown">
<button class="dropdown-item" id="adminBtn" style="display: none;">⚙️ Administration</button> <button class="dropdown-item" id="adminBtn" style="display: none;">
<button class="dropdown-item" id="logoutBtn">🚪 Déconnexion</button> <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<circle cx="12" cy="12" r="3"></circle>
<path d="M12 1v6m0 6v6m5.657-13.657L14 9l-2.343-2.343M9 14l-3.657 3.657M1 12h6m6 0h6m-13.657 5.657L9 14l2.343 2.343M14 9l3.657-3.657"></path>
</svg>
Administration
</button>
<button class="dropdown-item" id="logoutBtn">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"></path>
<polyline points="16 17 21 12 16 7"></polyline>
<line x1="21" y1="12" x2="9" y2="12"></line>
</svg>
Déconnexion
</button>
</div> </div>
</div> </div>
</div> </div>
</header> </header>
<!-- Container principal --> <!-- Main Content -->
<div class="main-container"> <main class="main-content">
<!-- Zone des notes (70%) --> <div class="content-container">
<main class="notes-area"> <!-- Notes Grid -->
<div class="notes-grid" id="notesGrid"> <div class="notes-section">
<!-- Les cards de notes seront insérées ici dynamiquement --> <div class="section-header">
<h2 class="section-title">Notes</h2>
<button class="btn-new-note" id="newNoteBtn">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<line x1="12" y1="5" x2="12" y2="19"></line>
<line x1="5" y1="12" x2="19" y2="12"></line>
</svg>
Nouvelle note
</button>
</div>
<div class="notes-grid" id="notesGrid">
<!-- Notes will be inserted here -->
</div>
</div> </div>
<button class="fab" id="newNoteBtn" title="Nouvelle note">+</button> <!-- Todo Box -->
</main> <div class="todo-box">
<div class="todo-box-header">
<h2 class="todo-box-title">Quick Tasks</h2>
<span class="todo-counter" id="todoCounter">0 tâches</span>
</div>
<!-- Sidebar Todo (30%) --> <div class="todo-input-wrapper">
<aside class="todo-sidebar"> <input type="text" id="todoInput" class="todo-input" placeholder="Ajouter une tâche...">
<h2 class="sidebar-title">Quick Tasks</h2> <button id="addTodoBtn" class="btn-add-todo">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<line x1="12" y1="5" x2="12" y2="19"></line>
<line x1="5" y1="12" x2="19" y2="12"></line>
</svg>
</button>
</div>
<div class="todo-input-container"> <div class="todo-filters">
<input type="text" id="todoInput" class="todo-input" placeholder="Ajouter une tâche..."> <button class="filter-btn active" data-filter="all">Toutes</button>
<button id="addTodoBtn" class="todo-add-btn">+</button> <button class="filter-btn" data-filter="active">Actives</button>
<button class="filter-btn" data-filter="completed">Terminées</button>
</div>
<div class="todo-list" id="todoList">
<!-- Todos will be inserted here -->
</div>
</div> </div>
</div>
</main>
<div class="todo-filters"> <!-- Note Editor (Expanded in page) -->
<button class="filter-btn active" data-filter="all">Toutes</button> <div class="note-editor-backdrop" id="noteEditorBackdrop" style="display: none;">
<button class="filter-btn" data-filter="active">Actives</button> <div class="note-editor" id="noteEditor">
<button class="filter-btn" data-filter="completed">Terminées</button> <div class="note-editor-header">
</div> <button class="btn-close-editor" id="closeEditor">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<div class="todo-counter"> <line x1="18" y1="6" x2="6" y2="18"></line>
<span id="todoCounter">0 tâches restantes</span> <line x1="6" y1="6" x2="18" y2="18"></line>
</div> </svg>
</button>
<div class="todo-list" id="todoList"> <div class="note-editor-actions">
<!-- Les todos seront insérées ici dynamiquement --> <button class="btn-icon" id="deleteNote" title="Supprimer">
</div> <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
</aside> <polyline points="3 6 5 6 21 6"></polyline>
</div> <path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"></path>
</svg>
<!-- Modal Note --> </button>
<div class="modal-backdrop" id="noteModal" style="display: none;"> <button class="btn-primary" id="saveNote">
<div class="modal-content note-modal"> <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<div class="modal-header"> <polyline points="20 6 9 17 4 12"></polyline>
<button class="modal-close" id="closeModal">✕</button> </svg>
<button class="modal-delete" id="deleteNote">🗑️</button> Enregistrer
</button>
</div>
</div> </div>
<input type="text" id="noteTitle" class="note-title-input" placeholder="Titre de la note"> <input type="text" id="noteTitle" class="note-title-input" placeholder="Titre de la note">
<div class="note-divider"></div> <textarea id="noteContent" class="note-content-textarea" placeholder="Commencez à écrire..."></textarea>
<textarea id="noteContent" class="note-content-textarea" placeholder="Contenu de la note..."></textarea>
<div id="noteImageContainer" class="note-image-container" style="display: none;"> <div id="noteImageContainer" class="note-image-container" style="display: none;">
<img id="noteImage" class="note-image" alt="Image de la note"> <img id="noteImage" class="note-image" alt="Image de la note">
<button class="note-image-remove" id="removeImage">✕</button> <button class="btn-remove-image" id="removeImage">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<line x1="18" y1="6" x2="6" y2="18"></line>
<line x1="6" y1="6" x2="18" y2="18"></line>
</svg>
</button>
</div> </div>
<div class="note-todos-section"> <div class="note-todos-section">
<h3 class="note-section-title">Todos dans cette note</h3> <h3 class="note-section-title">Todos dans cette note</h3>
<div id="noteTodosList" class="note-todos-list"> <div id="noteTodosList" class="note-todos-list">
<!-- Les todos de la note seront insérés ici --> <!-- Note todos will be inserted here -->
</div> </div>
<button class="note-add-todo-btn" id="addNoteTodo">+ Ajouter un todo</button> <button class="btn-add-note-todo" id="addNoteTodo">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<line x1="12" y1="5" x2="12" y2="19"></line>
<line x1="5" y1="12" x2="19" y2="12"></line>
</svg>
Ajouter un todo
</button>
</div> </div>
<div class="note-divider"></div> <div class="note-editor-footer">
<button class="btn-icon" id="addImageBtn" title="Ajouter une image">
<div class="modal-actions"> <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<button class="action-btn" id="addImageBtn">📷 Ajouter une image</button> <rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect>
<circle cx="8.5" cy="8.5" r="1.5"></circle>
<polyline points="21 15 16 10 5 21"></polyline>
</svg>
</button>
<input type="file" id="imageInput" accept="image/*" style="display: none;"> <input type="file" id="imageInput" accept="image/*" style="display: none;">
</div>
<div class="modal-footer">
<span id="noteMetadata" class="note-metadata"></span> <span id="noteMetadata" class="note-metadata"></span>
</div> </div>
</div> </div>
@@ -139,7 +223,7 @@
</tr> </tr>
</thead> </thead>
<tbody id="usersTableBody"> <tbody id="usersTableBody">
<!-- Les utilisateurs seront insérés ici --> <!-- Users will be inserted here -->
</tbody> </tbody>
</table> </table>
</div> </div>
@@ -162,4 +246,4 @@
<!-- JavaScript --> <!-- JavaScript -->
<script src="/js/complete-app.js"></script> <script src="/js/complete-app.js"></script>
</body> </body>
</html> </html>
+79 -13
View File
@@ -323,7 +323,7 @@ let currentNoteId = null;
async function openNoteModal(noteId = null) { async function openNoteModal(noteId = null) {
currentNoteId = noteId; currentNoteId = noteId;
const modal = document.getElementById('noteModal'); const modal = document.getElementById('noteEditorBackdrop');
const titleInput = document.getElementById('noteTitle'); const titleInput = document.getElementById('noteTitle');
const contentTextarea = document.getElementById('noteContent'); const contentTextarea = document.getElementById('noteContent');
const imageContainer = document.getElementById('noteImageContainer'); const imageContainer = document.getElementById('noteImageContainer');
@@ -477,11 +477,30 @@ async function deleteNoteTodo(todoId) {
} }
function closeNoteModal() { function closeNoteModal() {
document.getElementById('noteModal').style.display = 'none'; document.getElementById('noteEditorBackdrop').style.display = 'none';
currentNoteId = null; currentNoteId = null;
state.currentNote = null; state.currentNote = null;
} }
async function saveCurrentNote() {
if (!currentNoteId) return;
const titleInput = document.getElementById('noteTitle');
const contentTextarea = document.getElementById('noteContent');
try {
await api.put(`/api/notes/${currentNoteId}`, {
title: titleInput.value,
content: contentTextarea.value
});
await loadNotes();
} catch (error) {
console.error('Erreur sauvegarde:', error);
throw error;
}
}
async function deleteCurrentNote() { async function deleteCurrentNote() {
if (!currentNoteId) return; if (!currentNoteId) return;
@@ -692,11 +711,14 @@ function renderUsersTable(users) {
<td>${user.is_admin ? '✓ Oui' : '✗ Non'}</td> <td>${user.is_admin ? '✓ Oui' : '✗ Non'}</td>
<td>${new Date(user.created_at).toLocaleDateString('fr-FR')}</td> <td>${new Date(user.created_at).toLocaleDateString('fr-FR')}</td>
<td> <td>
<button class="btn-edit-user" data-user-id="${user.id}" data-username="${escapeHtml(user.username)}">
🔑 Mot de passe
</button>
${user.id !== state.user.id ? ` ${user.id !== state.user.id ? `
<button class="btn-delete-user" data-user-id="${user.id}" data-username="${escapeHtml(user.username)}"> <button class="btn-delete-user" data-user-id="${user.id}" data-username="${escapeHtml(user.username)}">
🗑️ Supprimer 🗑️ Supprimer
</button> </button>
` : '<span style="color: var(--text-secondary);">Vous-même</span>'} ` : ''}
</td> </td>
</tr> </tr>
`).join(''); `).join('');
@@ -756,6 +778,32 @@ async function createUser() {
} }
} }
async function changeUserPassword(id, username) {
const password = prompt(`Nouveau mot de passe pour "${username}" :`);
if (!password) return;
if (password.length < 6) {
alert('Le mot de passe doit contenir au moins 6 caractères');
return;
}
const confirmPassword = prompt('Confirmer le nouveau mot de passe :');
if (password !== confirmPassword) {
alert('Les mots de passe ne correspondent pas');
return;
}
try {
await api.put(`/api/users/${id}`, { password });
alert('Mot de passe modifié avec succès');
} catch (error) {
console.error('Erreur modification mot de passe:', error);
alert('Erreur lors de la modification du mot de passe');
}
}
async function deleteUser(id, username) { async function deleteUser(id, username) {
const confirmed = await confirmDialog.show({ const confirmed = await confirmDialog.show({
icon: '⚠️', icon: '⚠️',
@@ -816,9 +864,19 @@ async function init() {
}); });
} }
const closeModal = document.getElementById('closeModal'); const closeEditor = document.getElementById('closeEditor');
if (closeModal) { if (closeEditor) {
closeModal.addEventListener('click', closeNoteModal); closeEditor.addEventListener('click', closeNoteModal);
}
const saveNoteBtn = document.getElementById('saveNote');
if (saveNoteBtn) {
saveNoteBtn.addEventListener('click', async () => {
if (currentNoteId) {
await saveCurrentNote();
alert('Note enregistrée !');
}
});
} }
const deleteNote = document.getElementById('deleteNote'); const deleteNote = document.getElementById('deleteNote');
@@ -899,11 +957,19 @@ async function init() {
}); });
} }
// Event delegation pour les boutons de suppression d'utilisateurs // Event delegation pour les boutons d'administration des utilisateurs
const usersTableBody = document.getElementById('usersTableBody'); const usersTableBody = document.getElementById('usersTableBody');
if (usersTableBody) { if (usersTableBody) {
usersTableBody.addEventListener('click', (e) => { usersTableBody.addEventListener('click', (e) => {
if (e.target.classList.contains('btn-delete-user') || e.target.closest('.btn-delete-user')) { // Bouton changer mot de passe
if (e.target.classList.contains('btn-edit-user') || e.target.closest('.btn-edit-user')) {
const btn = e.target.classList.contains('btn-edit-user') ? e.target : e.target.closest('.btn-edit-user');
const userId = parseInt(btn.dataset.userId);
const username = btn.dataset.username;
changeUserPassword(userId, username);
}
// Bouton supprimer utilisateur
else if (e.target.classList.contains('btn-delete-user') || e.target.closest('.btn-delete-user')) {
const btn = e.target.classList.contains('btn-delete-user') ? e.target : e.target.closest('.btn-delete-user'); const btn = e.target.classList.contains('btn-delete-user') ? e.target : e.target.closest('.btn-delete-user');
const userId = parseInt(btn.dataset.userId); const userId = parseInt(btn.dataset.userId);
const username = btn.dataset.username; const username = btn.dataset.username;
@@ -912,11 +978,11 @@ async function init() {
}); });
} }
// Close modal on backdrop click // Close editor on backdrop click
const noteModal = document.getElementById('noteModal'); const noteEditorBackdrop = document.getElementById('noteEditorBackdrop');
if (noteModal) { if (noteEditorBackdrop) {
noteModal.addEventListener('click', (e) => { noteEditorBackdrop.addEventListener('click', (e) => {
if (e.target === noteModal) closeNoteModal(); if (e.target === noteEditorBackdrop) closeNoteModal();
}); });
} }