[dyad] wrote 1 file(s)

This commit is contained in:
Michael committed 2025-11-06 15:20:51 +01:00
1 parent bd9832daa2
commit 93b2d8af24
1 file changed
+213 -284
+213 -284
View File
@@ -9,7 +9,7 @@
:root {
/* Colors */
--bg-gradient: linear-gradient(to bottom right, #ffffff, #f8fafc);
--bg-gradient: linear-gradient(to bottom right, #f8fafc, #f1f5f9);
--primary: #0ea5e9;
--primary-light: #e0f2fe;
--primary-dark: #0369a1;
@@ -42,87 +42,98 @@
-webkit-font-smoothing: antialiased;
}
/* Top Navigation */
.top-nav {
background: var(--surface);
border-bottom: 1px solid var(--border);
padding: 0.75rem 1.5rem;
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 50;
display: flex;
justify-content: space-between;
align-items: center;
box-shadow: var(--shadow-sm);
}
.nav-brand {
font-size: 1.25rem;
font-weight: 600;
color: var(--text);
text-decoration: none;
display: flex;
align-items: center;
gap: 0.5rem;
}
.nav-brand svg {
width: 24px;
height: 24px;
color: var(--primary);
}
.user-menu {
display: flex;
align-items: center;
gap: 1rem;
}
.user-info {
display: flex;
align-items: center;
gap: 0.5rem;
padding: 0.5rem 1rem;
background: var(--primary-light);
border-radius: 8px;
color: var(--primary-dark);
font-weight: 500;
}
.user-info svg {
width: 18px;
height: 18px;
}
/* Layout */
.app {
display: grid;
grid-template-columns: 320px 1fr;
gap: 1rem;
height: 100vh;
padding: 1rem;
padding-top: 4rem; /* Space for top nav */
}
/* Sidebar */
.sidebar {
background: var(--surface);
border-radius: 24px;
border-radius: 16px;
padding: 1.5rem;
display: flex;
flex-direction: column;
gap: 1.5rem;
box-shadow: var(--shadow);
height: calc(100vh - 2rem);
position: relative;
overflow: hidden;
}
.sidebar::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
height: 80px;
background: linear-gradient(to bottom, var(--surface) 60%, transparent);
z-index: 2;
pointer-events: none;
}
.sidebar::after {
content: '';
position: absolute;
bottom: 0;
left: 0;
right: 0;
height: 80px;
background: linear-gradient(to top, var(--surface) 60%, transparent);
z-index: 2;
pointer-events: none;
height: calc(100vh - 5rem);
margin: 0.5rem;
border: 1px solid var(--border);
}
/* Main Content */
.main-content {
background: var(--surface);
border-radius: 24px;
border-radius: 16px;
padding: 2rem;
box-shadow: var(--shadow);
height: calc(100vh - 2rem);
height: calc(100vh - 5rem);
margin: 0.5rem;
border: 1px solid var(--border);
overflow-y: auto;
position: relative;
}
/* Header */
.header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 2rem;
position: relative;
z-index: 3;
}
.app-title {
font-size: 1.5rem;
font-weight: 600;
background: linear-gradient(135deg, var(--primary), var(--primary-dark));
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
position: relative;
}
/* Search */
.search-container {
position: relative;
z-index: 3;
}
.search-input {
@@ -131,7 +142,7 @@
border: 1px solid var(--border);
border-radius: 12px;
font-size: 0.9375rem;
background: #f8fafc;
background: var(--bg-gradient);
transition: all 0.2s ease;
}
@@ -142,47 +153,28 @@
background: var(--surface);
}
.search-icon {
position: absolute;
left: 1rem;
top: 50%;
transform: translateY(-50%);
color: var(--text-light);
pointer-events: none;
transition: all 0.2s ease;
}
.search-input:focus + .search-icon {
color: var(--primary);
}
/* Notes List */
.notes-list {
margin-top: 1rem;
display: flex;
flex-direction: column;
gap: 0.75rem;
padding: 0.5rem;
overflow-y: auto;
max-height: calc(100% - 140px);
position: relative;
z-index: 1;
padding: 0.5rem;
}
.note-item {
padding: 1rem;
background: #f8fafc;
background: var(--bg-gradient);
border: 1px solid var(--border);
border-radius: 12px;
cursor: pointer;
transition: all 0.2s ease;
border: 1px solid transparent;
}
.note-item:hover {
transform: translateY(-2px);
background: var(--surface);
border-color: var(--border);
box-shadow: var(--shadow-sm);
border-color: var(--primary);
box-shadow: var(--shadow);
}
.note-item.active {
@@ -190,58 +182,85 @@
border-color: var(--primary);
}
.note-title {
font-weight: 600;
color: var(--text);
margin-bottom: 0.25rem;
}
.note-preview {
font-size: 0.875rem;
color: var(--text-light);
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
}
/* Editor */
.editor {
background: var(--surface);
border-radius: 16px;
height: 100%;
border-radius: 12px;
border: 1px solid var(--border);
box-shadow: var(--shadow);
}
.editor-title {
width: 100%;
padding: 1rem;
padding: 1.5rem;
font-size: 1.5rem;
font-weight: 600;
border: none;
border-bottom: 1px solid var(--border);
background: transparent;
transition: all 0.2s ease;
}
.editor-title:focus {
outline: none;
border-color: var(--primary);
}
.editor-content {
padding: 1rem;
padding: 1.5rem;
min-height: 300px;
outline: none;
}
/* Admin Panel */
.admin-panel {
position: fixed;
inset: 0;
background: rgba(0, 0, 0, 0.5);
display: flex;
align-items: center;
justify-content: center;
z-index: 100;
}
.admin-content {
background: var(--surface);
border-radius: 16px;
padding: 2rem;
width: 600px;
max-width: 90vw;
max-height: 90vh;
overflow-y: auto;
box-shadow: var(--shadow-lg);
border: 1px solid var(--border);
}
.admin-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 2rem;
padding-bottom: 1rem;
border-bottom: 1px solid var(--border);
}
.user-list {
display: flex;
flex-direction: column;
gap: 1rem;
}
.user-card {
background: var(--bg-gradient);
border: 1px solid var(--border);
border-radius: 12px;
padding: 1rem;
display: flex;
justify-content: space-between;
align-items: center;
}
/* Buttons */
.btn {
padding: 0.75rem 1.5rem;
border-radius: 12px;
border-radius: 8px;
font-weight: 500;
font-size: 0.9375rem;
transition: all 0.2s ease;
border: none;
border: 1px solid transparent;
cursor: pointer;
display: inline-flex;
align-items: center;
@@ -251,151 +270,39 @@
.btn-primary {
background: var(--primary);
color: white;
border-color: var(--primary-dark);
}
.btn-primary:hover {
background: var(--primary-dark);
transform: translateY(-1px);
box-shadow: var(--shadow-sm);
box-shadow: var(--shadow);
}
.btn-secondary {
background: var(--surface);
color: var(--text);
border-color: var(--border);
}
.btn-secondary:hover {
background: var(--bg-gradient);
border-color: var(--primary);
}
.btn-icon {
padding: 0.5rem;
border-radius: 10px;
border-radius: 8px;
color: var(--text-light);
background: transparent;
border: 1px solid var(--border);
background: var(--surface);
transition: all 0.2s ease;
}
.btn-icon:hover {
background: var(--primary-light);
color: var(--primary);
transform: translateY(-1px);
}
/* Todo Items */
.todo-item {
display: flex;
align-items: center;
padding: 0.75rem;
background: #f8fafc;
border-radius: 10px;
margin-bottom: 0.5rem;
transition: all 0.2s ease;
}
.todo-item:hover {
background: var(--surface);
box-shadow: var(--shadow-sm);
}
.todo-checkbox {
appearance: none;
width: 20px;
height: 20px;
border: 2px solid var(--border);
border-radius: 6px;
margin-right: 0.75rem;
cursor: pointer;
transition: all 0.2s ease;
position: relative;
}
.todo-checkbox:checked {
background: var(--success);
border-color: var(--success);
}
.todo-checkbox:checked::after {
content: '✓';
position: absolute;
color: white;
font-size: 12px;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.todo-text {
flex: 1;
transition: all 0.2s ease;
}
.todo-item.completed .todo-text {
color: var(--text-light);
text-decoration: line-through;
}
/* Images Grid */
.images-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
gap: 1rem;
padding: 1rem;
}
.image-item {
position: relative;
border-radius: 12px;
overflow: hidden;
aspect-ratio: 1;
transition: all 0.2s ease;
}
.image-item:hover {
transform: scale(1.05);
box-shadow: var(--shadow);
}
.image-item img {
width: 100%;
height: 100%;
object-fit: cover;
}
.image-delete {
position: absolute;
top: 0.5rem;
right: 0.5rem;
padding: 0.25rem;
background: rgba(0, 0, 0, 0.5);
border-radius: 6px;
color: white;
opacity: 0;
transition: all 0.2s ease;
}
.image-item:hover .image-delete {
opacity: 1;
}
/* Scrollbar */
::-webkit-scrollbar {
width: 8px;
height: 8px;
}
::-webkit-scrollbar-track {
background: transparent;
}
::-webkit-scrollbar-thumb {
background: var(--border);
border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
background: var(--text-light);
}
/* Animations */
@keyframes fadeIn {
from { opacity: 0; transform: translateY(10px); }
to { opacity: 1; transform: translateY(0); }
}
.fade-in {
animation: fadeIn 0.3s ease forwards;
border-color: var(--primary);
}
/* Responsive */
@@ -409,32 +316,59 @@
}
.main-content {
margin-left: 0;
margin: 0.5rem;
}
}
</style>
</head>
<body>
<!-- Top Navigation -->
<nav class="top-nav">
<a href="/" class="nav-brand">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5"></path>
</svg>
Notes App
</a>
<div class="user-menu">
<div class="user-info">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"></path>
<circle cx="12" cy="7" r="4"></circle>
</svg>
<span id="user-info">Utilisateur</span>
</div>
<button class="btn btn-secondary admin-btn" id="admin-btn">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M12 2a10 10 0 0 0-7.743 16.33l-1.964 1.963A12 12 0 1 1 14.243 3.71L12 6"></path>
<path d="M12 8v4l3 3"></path>
</svg>
Admin
</button>
<button class="btn btn-secondary" id="logout-btn">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<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>
</nav>
<!-- Main App -->
<div class="app">
<aside class="sidebar">
<div class="header">
<h1 class="app-title">Notes</h1>
<button class="btn-icon" id="new-note-btn">
<svg width="24" height="24" 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>
</button>
</div>
<div class="search-container">
<input type="text" class="search-input" placeholder="Rechercher...">
<svg class="search-icon" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<circle cx="11" cy="11" r="8"></circle>
<line x1="21" y1="21" x2="16.65" y2="16.65"></line>
</svg>
<input type="text" class="search-input" placeholder="Rechercher une note...">
</div>
<button class="btn btn-primary" id="new-note-btn">
<svg xmlns="http://www.w3.org/2000/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>
Nouvelle Note
</button>
<div class="notes-list" id="notes-list">
<!-- Notes will be dynamically inserted here -->
</div>
@@ -444,42 +378,37 @@
<div class="editor">
<input type="text" class="editor-title" placeholder="Titre de la note" id="note-title">
<div class="editor-content" contenteditable="true" id="note-content"></div>
<div class="todos-section">
<div class="header">
<h2>Tâches</h2>
<button class="btn-icon" id="add-todo-btn">
<svg width="20" height="20" 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>
</button>
</div>
<div id="todos-list">
<!-- Todos will be dynamically inserted here -->
</div>
</div>
<div class="images-section">
<div class="header">
<h2>Images</h2>
<label class="btn-icon" for="image-upload">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<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>
</label>
<input type="file" id="image-upload" hidden accept="image/*">
</div>
<div class="images-grid" id="images-list">
<!-- Images will be dynamically inserted here -->
</div>
</div>
</div>
</main>
</div>
<!-- Admin Panel -->
<div id="admin-panel" class="admin-panel hidden">
<div class="admin-content">
<div class="admin-header">
<h2>Administration</h2>
<button class="btn-icon" id="close-admin-btn">
<svg xmlns="http://www.w3.org/2000/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>
<button class="btn btn-primary" id="add-user-btn">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M16 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"></path>
<circle cx="8.5" cy="7" r="4"></circle>
<line x1="20" y1="8" x2="20" y2="14"></line>
<line x1="23" y1="11" x2="17" y2="11"></line>
</svg>
Ajouter un utilisateur
</button>
<div class="user-list" id="users-list">
<!-- Users will be dynamically inserted here -->
</div>
</div>
</div>
<script src="/js/auth.js"></script>
<script src="/js/notes.js"></script>
<script src="/js/admin.js"></script>