gtkh commited on
Commit
83e14b4
·
verified ·
1 Parent(s): 585aaad

Je veux que le tableau soit un plus moderne

Browse files
Files changed (3) hide show
  1. index.html +3 -4
  2. script.js +24 -8
  3. style.css +132 -21
index.html CHANGED
@@ -32,11 +32,10 @@
32
  <i data-feather="plus"></i> Nouveau Projet
33
  </button>
34
  </div>
35
-
36
- <div class="bg-white rounded-xl shadow-md overflow-hidden mb-8">
37
  <div class="overflow-x-auto">
38
- <table class="w-full">
39
- <thead class="bg-primary text-white">
40
  <tr>
41
  <th class="px-6 py-4 text-left">PS</th>
42
  <th class="px-6 py-4 text-left">Numéro d'affaire</th>
 
32
  <i data-feather="plus"></i> Nouveau Projet
33
  </button>
34
  </div>
35
+ <div class="bg-white rounded-xl shadow-sm overflow-hidden mb-8 border border-gray-100">
 
36
  <div class="overflow-x-auto">
37
+ <table class="w-full min-w-max">
38
+ <thead class="bg-primary text-white">
39
  <tr>
40
  <th class="px-6 py-4 text-left">PS</th>
41
  <th class="px-6 py-4 text-left">Numéro d'affaire</th>
script.js CHANGED
@@ -23,25 +23,41 @@ document.addEventListener('DOMContentLoaded', function() {
23
  }
24
  }
25
  });
26
-
27
- // Add hover effects and click events for rows
28
  document.querySelectorAll('tbody tr').forEach(row => {
29
  row.style.cursor = 'pointer';
30
 
 
 
 
 
 
 
 
 
 
 
31
  row.addEventListener('click', function() {
32
  const projectId = this.querySelector('td:first-child').textContent;
33
- // Here you would typically navigate to a project detail page
34
  console.log('Navigating to project detail:', projectId);
35
 
36
- // Temporary visual feedback
37
- this.style.boxShadow = '0 0 0 2px #3b82f6';
 
38
  setTimeout(() => {
39
- this.style.boxShadow = 'none';
40
- }, 300);
 
41
  });
42
  });
43
 
44
- // Initialize Feather icons
 
 
 
 
 
 
45
  if (feather) {
46
  feather.replace();
47
  }
 
23
  }
24
  }
25
  });
26
+ // Modern hover effects and click events for rows
 
27
  document.querySelectorAll('tbody tr').forEach(row => {
28
  row.style.cursor = 'pointer';
29
 
30
+ row.addEventListener('mouseenter', function() {
31
+ this.style.transform = 'translateY(-2px)';
32
+ this.style.boxShadow = '0 4px 12px rgba(59, 130, 246, 0.1)';
33
+ });
34
+
35
+ row.addEventListener('mouseleave', function() {
36
+ this.style.transform = '';
37
+ this.style.boxShadow = '';
38
+ });
39
+
40
  row.addEventListener('click', function() {
41
  const projectId = this.querySelector('td:first-child').textContent;
 
42
  console.log('Navigating to project detail:', projectId);
43
 
44
+ // Modern visual feedback
45
+ this.style.transform = 'scale(0.99)';
46
+ this.style.boxShadow = '0 0 0 2px rgba(59, 130, 246, 0.3)';
47
  setTimeout(() => {
48
+ this.style.transform = '';
49
+ this.style.boxShadow = '';
50
+ }, 200);
51
  });
52
  });
53
 
54
+ // Add subtle animation to table headers
55
+ document.querySelectorAll('thead th').forEach((th, index) => {
56
+ th.style.opacity = '0';
57
+ th.style.transform = 'translateY(-10px)';
58
+ th.style.animation = `fadeInUp 0.4s ease-out ${index * 0.05}s forwards`;
59
+ });
60
+ // Initialize Feather icons
61
  if (feather) {
62
  feather.replace();
63
  }
style.css CHANGED
@@ -23,41 +23,79 @@ body {
23
  ::-webkit-scrollbar-thumb:hover {
24
  background: #555;
25
  }
26
- /* Table styles */
27
  table {
28
  border-collapse: separate;
29
  border-spacing: 0;
30
- margin-top: 0.5rem;
 
 
 
 
 
31
  }
32
- thead th {
 
33
  position: sticky;
34
  top: 0;
35
- background-color: #1e40af !important;
 
 
 
 
36
  color: white;
37
- font-weight: 600;
38
- padding: 8px 12px;
39
- border-bottom: 1px solid #93c5fd;
40
  font-size: 0.875rem;
 
 
 
 
 
 
41
  }
 
 
 
 
 
42
  tbody tr {
43
  animation: fadeIn 0.3s ease-out forwards;
44
- transition: all 0.2s ease;
 
 
 
 
 
 
 
 
 
45
  }
46
 
47
  tbody tr:hover {
48
- background-color: #f0f9ff !important;
49
- transform: translateX(2px);
50
  }
 
51
  tbody td {
52
- padding: 8px 12px;
53
- border-bottom: 1px solid #e5e7eb;
54
- border-right: 1px solid #e5e7eb;
55
  font-size: 0.875rem;
56
- }
57
- tbody td:last-child {
58
- border-right: none;
59
  }
60
 
 
 
 
 
 
 
 
 
 
 
61
  /* Status badges */
62
  .status-badge {
63
  display: inline-block;
@@ -127,11 +165,84 @@ tbody tr:nth-child(3) { animation-delay: 0.3s; }
127
  color: #dc2626;
128
  font-weight: 600;
129
  }
130
-
131
- /* Zebra striping */
132
- tbody tr:nth-child(odd) {
133
- background-color: #f9fafb;
134
  }
 
135
  tbody tr {
136
- height: 40px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
137
  }
 
23
  ::-webkit-scrollbar-thumb:hover {
24
  background: #555;
25
  }
26
+ /* Modern table styles */
27
  table {
28
  border-collapse: separate;
29
  border-spacing: 0;
30
+ margin-top: 1rem;
31
+ width: 100%;
32
+ --table-radius: 12px;
33
+ --table-padding: 16px;
34
+ --table-border: 1px solid rgba(0, 0, 0, 0.05);
35
+ --hover-bg: rgba(59, 130, 246, 0.05);
36
  }
37
+
38
+ thead {
39
  position: sticky;
40
  top: 0;
41
+ z-index: 10;
42
+ }
43
+
44
+ thead th {
45
+ background-color: #3B82F6;
46
  color: white;
47
+ font-weight: 500;
48
+ padding: var(--table-padding);
 
49
  font-size: 0.875rem;
50
+ position: relative;
51
+ white-space: nowrap;
52
+ }
53
+
54
+ thead th:first-child {
55
+ border-top-left-radius: var(--table-radius);
56
  }
57
+
58
+ thead th:last-child {
59
+ border-top-right-radius: var(--table-radius);
60
+ }
61
+
62
  tbody tr {
63
  animation: fadeIn 0.3s ease-out forwards;
64
+ transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
65
+ position: relative;
66
+ }
67
+
68
+ tbody tr:last-child td:first-child {
69
+ border-bottom-left-radius: var(--table-radius);
70
+ }
71
+
72
+ tbody tr:last-child td:last-child {
73
+ border-bottom-right-radius: var(--table-radius);
74
  }
75
 
76
  tbody tr:hover {
77
+ background-color: var(--hover-bg) !important;
78
+ box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
79
  }
80
+
81
  tbody td {
82
+ padding: var(--table-padding);
83
+ border-bottom: var(--table-border);
 
84
  font-size: 0.875rem;
85
+ transition: all 0.2s ease;
86
+ position: relative;
 
87
  }
88
 
89
+ tbody tr:not(:last-child) td::after {
90
+ content: '';
91
+ position: absolute;
92
+ bottom: 0;
93
+ left: 50%;
94
+ transform: translateX(-50%);
95
+ width: calc(100% - 32px);
96
+ height: 1px;
97
+ background-color: rgba(0, 0, 0, 0.05);
98
+ }
99
  /* Status badges */
100
  .status-badge {
101
  display: inline-block;
 
165
  color: #dc2626;
166
  font-weight: 600;
167
  }
168
+ /* Modern zebra striping */
169
+ tbody tr:nth-child(even) {
170
+ background-color: rgba(243, 244, 246, 0.3);
 
171
  }
172
+
173
  tbody tr {
174
+ height: 56px;
175
+ }
176
+
177
+ /* Modern progress bars */
178
+ .progress-container {
179
+ width: 100%;
180
+ height: 6px;
181
+ background-color: rgba(0, 0, 0, 0.05);
182
+ border-radius: 3px;
183
+ overflow: hidden;
184
+ }
185
+
186
+ .progress-bar {
187
+ height: 100%;
188
+ border-radius: 3px;
189
+ background: linear-gradient(90deg, #3B82F6, #60A5FA);
190
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
191
+ transition: width 0.6s ease;
192
+ }
193
+
194
+ /* Modern status badges */
195
+ .status-badge {
196
+ display: inline-flex;
197
+ align-items: center;
198
+ padding: 4px 12px;
199
+ border-radius: 16px;
200
+ font-size: 0.75rem;
201
+ font-weight: 500;
202
+ letter-spacing: 0.5px;
203
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
204
+ }
205
+
206
+ .status-badge::before {
207
+ content: '';
208
+ display: inline-block;
209
+ width: 6px;
210
+ height: 6px;
211
+ border-radius: 50%;
212
+ margin-right: 6px;
213
+ background: currentColor;
214
+ }
215
+
216
+ .status-en-cours {
217
+ background-color: rgba(59, 130, 246, 0.1);
218
+ color: #3B82F6;
219
+ }
220
+
221
+ .status-planifie {
222
+ background-color: rgba(16, 185, 129, 0.1);
223
+ color: #10B981;
224
+ }
225
+
226
+ .status-termine {
227
+ background-color: rgba(5, 150, 105, 0.1);
228
+ color: #059669;
229
+ }
230
+
231
+ /* Modern cell colors */
232
+ .cell-positive {
233
+ background-color: rgba(16, 185, 129, 0.1) !important;
234
+ color: #10B981;
235
+ font-weight: 500;
236
+ }
237
+
238
+ .cell-warning {
239
+ background-color: rgba(245, 158, 11, 0.1) !important;
240
+ color: #F59E0B;
241
+ font-weight: 500;
242
+ }
243
+
244
+ .cell-danger {
245
+ background-color: rgba(239, 68, 68, 0.1) !important;
246
+ color: #EF4444;
247
+ font-weight: 500;
248
  }