Sjokode commited on
Commit
dbcc683
·
verified ·
1 Parent(s): b2aee98

change the connexion form to a profil menu (the icon should appear but bigger) 2 option my info,deconnexion

Browse files
Files changed (2) hide show
  1. components/navbar.js +72 -297
  2. index.html +37 -4
components/navbar.js CHANGED
@@ -1,305 +1,80 @@
1
-
2
- class CustomNavbar extends HTMLElement {
3
- connectedCallback() {
4
- this.attachShadow({ mode: 'open' });
5
- this.shadowRoot.innerHTML = `
6
- <style>
7
- nav {
8
- background: white;
9
- box-shadow: 0 1px 3px rgba(0,0,0,0.1);
10
- border-bottom: 1px solid #f1f5f9;
11
- position: sticky;
12
- top: 0;
13
- z-index: 50;
14
- }
15
-
16
- .nav-container {
17
- max-width: 7xl;
18
- margin: 0 auto;
19
- padding: 0 1rem;
20
- height: 4rem;
21
- display: flex;
22
- justify-content: space-between;
23
- align-items: center;
24
- }
25
-
26
- .logo {
27
- font-size: 1.5rem;
28
- font-weight: bold;
29
- background: linear-gradient(to right, #14b8a6, #0f766e);
30
- -webkit-background-clip: text;
31
- background-clip: text;
32
- color: transparent;
33
- }
34
-
35
- .nav-links {
36
- display: none;
37
- align-items: center;
38
- gap: 1rem;
39
- }
40
-
41
- @media (min-width: 768px) {
42
- .nav-links {
43
- display: flex;
44
- }
45
- }
46
-
47
- .nav-link {
48
- color: #374151;
49
- text-decoration: none;
50
- padding: 0.5rem 0.75rem;
51
- border-radius: 0.375rem;
52
- font-size: 0.875rem;
53
- font-weight: 500;
54
- transition: color 0.2s;
55
- }
56
-
57
- .nav-link:hover {
58
- color: #14b8a6;
59
- }
60
-
61
- .nav-link.active {
62
- color: #14b8a6;
63
- border-bottom: 2px solid #14b8a6;
64
- }
65
-
66
- .search-container {
67
- position: relative;
68
- display: none;
69
- }
70
-
71
- @media (min-width: 768px) {
72
- .search-container {
73
- display: block;
74
- }
75
- }
76
-
77
- .search-input {
78
- width: 16rem;
79
- padding-left: 2.5rem;
80
- padding-right: 1rem;
81
- padding-top: 0.5rem;
82
- padding-bottom: 0.5rem;
83
- border: 1px solid #d1d5db;
84
- border-radius: 9999px;
85
- font-size: 0.875rem;
86
- outline: none;
87
- }
88
-
89
- .search-input:focus {
90
- border-color: #14b8a6;
91
- box-shadow: 0 0 0 2px rgba(20, 184, 166, 0.2);
92
- }
93
-
94
- .search-icon {
95
- position: absolute;
96
- left: 0.75rem;
97
- top: 50%;
98
- transform: translateY(-50%);
99
- color: #9ca3af;
100
- width: 1.25rem;
101
- height: 1.25rem;
102
- }
103
-
104
- .nav-buttons {
105
- display: flex;
106
- align-items: center;
107
- gap: 1rem;
108
- }
109
-
110
- .post-button {
111
- background-color: #14b8a6;
112
- color: white;
113
- padding: 0.5rem 1rem;
114
- border-radius: 9999px;
115
- font-size: 0.875rem;
116
- font-weight: 500;
117
- transition: background-color 0.2s;
118
- }
119
-
120
- .post-button:hover {
121
- background-color: #0d9488;
122
- }
123
-
124
- .profile-container {
125
- position: relative;
126
- }
127
-
128
- .profile-img {
129
- width: 2rem;
130
- height: 2rem;
131
- border-radius: 50%;
132
- cursor: pointer;
133
- transition: transform 0.2s;
134
- }
135
-
136
- .profile-img:hover {
137
- transform: scale(1.1);
138
- }
139
-
140
- .dropdown {
141
- position: absolute;
142
- right: 0;
143
- top: 100%;
144
- margin-top: 0.5rem;
145
- width: 240px;
146
- background: white;
147
- border-radius: 0.5rem;
148
- box-shadow: 0 4px 12px rgba(0,0,0,0.1);
149
- padding: 1rem;
150
- opacity: 0;
151
- transform: translateY(-10px);
152
- transition: all 0.2s ease-out;
153
- visibility: hidden;
154
- z-index: 50;
155
- border: 1px solid #e5e7eb;
156
- }
157
-
158
- .dropdown.active {
159
- opacity: 1;
160
- transform: translateY(0);
161
- visibility: visible;
162
- }
163
-
164
- .dropdown-title {
165
- font-weight: 600;
166
- margin-bottom: 1rem;
167
- font-size: 1rem;
168
- }
169
-
170
- .menu-item {
171
- display: flex;
172
- align-items: center;
173
- padding: 0.5rem 0;
174
- cursor: pointer;
175
- color: #334155;
176
- font-size: 0.875rem;
177
- transition: color 0.2s;
178
- }
179
-
180
- .menu-item:hover {
181
- color: #14b8a6;
182
- }
183
-
184
- .menu-icon {
185
- margin-right: 0.5rem;
186
- width: 1rem;
187
- height: 1rem;
188
- }
189
-
190
- .artisan-item {
191
- color: #c2410c;
192
- font-weight: 500;
193
- }
194
-
195
- .artisan-item:hover {
196
- color: #9a3412;
197
- }
198
-
199
- .divider {
200
- height: 1px;
201
- background: #e5e7eb;
202
- margin: 0.5rem 0;
203
- }
204
- </style>
205
-
206
- <nav>
207
- <div class="nav-container">
208
- <div class="flex items-center">
209
- <h1 class="logo">MatinikTaff</h1>
210
- <div class="nav-links ml-10">
211
- <a href="index.html" class="nav-link">Accueil</a>
212
- <a href="feed.html" class="nav-link">Fil</a>
213
- <a href="messages.html" class="nav-link">Messages</a>
214
- <a href="search.html" class="nav-link">Services</a>
215
- </div>
216
- </div>
217
-
218
- <div class="nav-buttons">
219
- <div class="search-container">
220
- <input type="text" placeholder="Rechercher des services..." class="search-input">
221
- <svg class="search-icon" fill="none" stroke="currentColor" viewBox="0 0 24 24">
222
- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"></path>
223
- </svg>
224
- </div>
225
-
226
- <button class="post-button">Publier une Mission</button>
227
-
228
- <div class="profile-container">
229
- <img src="http://static.photos/people/200x200/1" alt="Profile" class="profile-img">
230
- <div class="dropdown">
231
- <div class="menu-item artisan-item">
232
- <svg class="menu-icon" fill="none" stroke="currentColor" viewBox="0 0 24 24">
233
- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4"></path>
234
- </svg>
235
- Mon espace artisan
236
- </div>
237
-
238
- <div class="divider"></div>
239
-
240
- <div class="menu-item">
241
- <svg class="menu-icon" fill="none" stroke="currentColor" viewBox="0 0 24 24">
242
- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"></path>
243
- </svg>
244
- Mes informations
245
- </div>
246
-
247
- <div class="menu-item">
248
- <svg class="menu-icon" fill="none" stroke="currentColor" viewBox="0 0 24 24">
249
- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10.325 4.317c.426-1.756 2.924-1.756 3.350 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"></path>
250
- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"></path>
251
- </svg>
252
- Paramètres du compte
253
  </div>
254
-
255
- <div class="menu-item">
256
- <svg class="menu-icon" fill="none" stroke="currentColor" viewBox="0 0 24 24">
257
- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1"></path>
258
- </svg>
259
- Se déconnecter
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
260
  </div>
261
- </div>
262
  </div>
263
- </div>
264
  </div>
265
- </nav>
266
- `;
267
-
268
- const profileImg = this.shadowRoot.querySelector('.profile-img');
269
- const dropdown = this.shadowRoot.querySelector('.dropdown');
270
- let isDropdownOpen = false;
271
-
272
- function toggleDropdown() {
273
- isDropdownOpen = !isDropdownOpen;
274
- if (isDropdownOpen) {
275
- dropdown.classList.add('active');
276
- } else {
277
- dropdown.classList.remove('active');
278
- }
279
- }
280
-
281
- function closeDropdown() {
282
- isDropdownOpen = false;
283
- dropdown.classList.remove('active');
284
- }
285
-
286
- profileImg.addEventListener('click', (e) => {
287
- e.stopPropagation();
288
- toggleDropdown();
289
- });
290
-
291
- document.addEventListener('click', () => {
292
- closeDropdown();
293
- });
294
-
295
- dropdown.addEventListener('click', (e) => {
296
- e.stopPropagation();
297
- });
298
- }
299
- }
300
 
301
- customElements.define('custom-navbar', CustomNavbar);
302
- <!-- Header Section -->
303
  <div class="bg-gradient-to-r from-orange-50 to-amber-50 py-12">
304
  <div class="max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 text-center">
305
  <h1 class="text-4xl font-bold text-gray-900 mb-4">Promotions & Actualités</h1>
 
1
+ <!DOCTYPE html>
2
+ <html lang="fr">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Promotions & Actualités | MatinikTaff</title>
7
+ <link rel="icon" type="image/x-icon" href="/static/favicon.ico">
8
+ <script src="https://cdn.tailwindcss.com"></script>
9
+ <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
10
+ <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap" rel="stylesheet">
11
+ <style>
12
+ body { font-family: 'Poppins', sans-serif; }
13
+ .promo-card { border-left: 4px solid #c2410c; }
14
+ .news-card { border-left: 4px solid #64748b; }
15
+ .filter-btn.active { background-color: #c2410c; color: white; }
16
+ .filter-btn { transition: all 0.2s ease; }
17
+ .filter-btn:hover { transform: translateY(-1px); }
18
+ .card-hover { transition: all 0.3s ease; }
19
+ .card-hover:hover { transform: translateY(-2px); box-shadow: 0 10px 25px rgba(0,0,0,0.1); }
20
+ </style>
21
+ </head>
22
+ <body class="bg-stone-50">
23
+ <!-- Navigation -->
24
+ <nav class="bg-white shadow-sm border-b border-gray-100 sticky top-0 z-50">
25
+ <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
26
+ <div class="flex justify-between items-center h-16">
27
+ <div class="flex items-center">
28
+ <div class="flex-shrink-0">
29
+ <h1 class="text-2xl font-bold bg-gradient-to-r from-orange-600 to-orange-800 bg-clip-text text-transparent">MatinikTaff</h1>
30
+ </div>
31
+ <div class="hidden md:block ml-10">
32
+ <div class="flex items-center space-x-4">
33
+ <a href="index.html" class="text-gray-700 hover:text-orange-600 px-3 py-2 rounded-md text-sm font-medium">Accueil</a>
34
+ <a href="feed.html" class="text-orange-600 px-3 py-2 rounded-md text-sm font-medium border-b-2 border-orange-600">Fil</a>
35
+ <a href="#" class="text-gray-700 hover:text-orange-600 px-3 py-2 rounded-md text-sm font-medium">Messages</a>
36
+ <a href="search.html" class="text-gray-700 hover:text-orange-600 px-3 py-2 rounded-md text-sm font-medium">Services</a>
37
+ </div>
38
+ </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
39
  </div>
40
+ <div class="flex items-center space-x-4">
41
+ <div class="relative">
42
+ <input type="text" placeholder="Rechercher..." class="w-64 pl-10 pr-4 py-2 border border-gray-300 rounded-full text-sm focus:outline-none focus:ring-2 focus:ring-orange-500">
43
+ <i data-feather="search" class="absolute left-3 top-2.5 h-5 w-5 text-gray-400"></i>
44
+ </div>
45
+ <div class="relative">
46
+ <img src="http://static.photos/people/200x200/1" alt="Profile" class="h-8 w-8 rounded-full cursor-pointer hover:opacity-80" id="profile-icon">
47
+ <div id="profile-popup" class="absolute top-full right-0 mt-2 w-80 bg-white rounded-lg shadow-xl border border-gray-200 z-50 opacity-0 transform -translate-y-2 transition-all duration-300 pointer-events-none">
48
+ <div class="p-6">
49
+ <h3 class="text-lg font-semibold text-gray-900 mb-4">Connexion</h3>
50
+ <form class="space-y-4">
51
+ <div>
52
+ <label for="email" class="block text-sm font-medium text-gray-700 mb-1">Email</label>
53
+ <input type="email" id="email" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-orange-500" placeholder="votre@email.com">
54
+ </div>
55
+ <div>
56
+ <label for="password" class="block text-sm font-medium text-gray-700 mb-1">Mot de passe</label>
57
+ <input type="password" id="password" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-orange-500" placeholder="••••••••">
58
+ </div>
59
+ <button type="submit" class="w-full bg-orange-600 text-white py-2 rounded-md font-semibold hover:bg-orange-700 transition">
60
+ Se connecter
61
+ </button>
62
+ <div class="text-center mt-4">
63
+ <p class="text-sm text-gray-600">Pas de compte ?</p>
64
+ <button type="button" class="text-orange-600 hover:text-orange-700 font-medium text-sm">
65
+ Créer un compte
66
+ </button>
67
+ </div>
68
+ </form>
69
  </div>
 
70
  </div>
 
71
  </div>
72
+ </div>
73
+ </div>
74
+ </div>
75
+ </nav>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
76
 
77
+ <!-- Header Section -->
 
78
  <div class="bg-gradient-to-r from-orange-50 to-amber-50 py-12">
79
  <div class="max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 text-center">
80
  <h1 class="text-4xl font-bold text-gray-900 mb-4">Promotions & Actualités</h1>
index.html CHANGED
@@ -87,13 +87,30 @@
87
  <button class="bg-turquoise-500 text-white px-4 py-2 rounded-full text-sm font-medium hover:bg-turquoise-600 transition">
88
  Publier une Mission
89
  </button>
90
- <div class="relative">
91
- <img src="http://static.photos/people/200x200/1" alt="Profile" class="h-8 w-8 rounded-full">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
92
  </div>
93
  </div>
94
  </div>
95
  </div>
96
- </nav>
97
 
98
  <!-- Hero Section -->
99
  <section class="relative bg-gradient-to-br from-turquoise-50 to-navy-50 py-20">
@@ -423,10 +440,26 @@
423
  // Initialize Feather Icons
424
  feather.replace();
425
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
426
  // Smooth scroll animation
427
  const { animate } = anime;
428
 
429
- // Animate hero text
430
  animate('.hero-text', {
431
  opacity: [0, 1],
432
  translateY: [20, 0],
 
87
  <button class="bg-turquoise-500 text-white px-4 py-2 rounded-full text-sm font-medium hover:bg-turquoise-600 transition">
88
  Publier une Mission
89
  </button>
90
+ <div class="relative">
91
+ <img src="http://static.photos/people/200x200/1" alt="Profile" class="h-8 w-8 rounded-full cursor-pointer" id="profile-icon">
92
+ <div id="profile-dropdown" class="absolute right-0 mt-2 w-64 bg-white rounded-lg shadow-xl border border-gray-200 z-50 hidden">
93
+ <div class="p-4">
94
+ <div class="flex items-center mb-4">
95
+ <img src="http://static.photos/people/200x200/1" alt="Profile" class="h-10 w-10 rounded-full">
96
+ <div class="ml-3">
97
+ <p class="text-sm font-medium text-gray-900">John Doe</p>
98
+ <p class="text-xs text-gray-500">john@example.com</p>
99
+ </div>
100
+ </div>
101
+ <div class="border-t border-gray-100 pt-2">
102
+ <a href="#" class="block px-4 py-2 text-sm text-orange-600 font-medium bg-orange-50 rounded-md mb-1">My Artisan Page</a>
103
+ <a href="#" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 rounded-md">My info</a>
104
+ <a href="#" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 rounded-md">Settings</a>
105
+ <a href="#" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 rounded-md">Logout</a>
106
+ </div>
107
+ </div>
108
+ </div>
109
  </div>
110
  </div>
111
  </div>
112
  </div>
113
+ </nav>
114
 
115
  <!-- Hero Section -->
116
  <section class="relative bg-gradient-to-br from-turquoise-50 to-navy-50 py-20">
 
440
  // Initialize Feather Icons
441
  feather.replace();
442
 
443
+ // Profile dropdown functionality
444
+ const profileIcon = document.getElementById('profile-icon');
445
+ const profileDropdown = document.getElementById('profile-dropdown');
446
+
447
+ profileIcon.addEventListener('click', (e) => {
448
+ e.stopPropagation();
449
+ profileDropdown.classList.toggle('hidden');
450
+ });
451
+
452
+ // Close dropdown when clicking outside
453
+ document.addEventListener('click', (e) => {
454
+ if (!profileIcon.contains(e.target) && !profileDropdown.contains(e.target)) {
455
+ profileDropdown.classList.add('hidden');
456
+ }
457
+ });
458
+
459
  // Smooth scroll animation
460
  const { animate } = anime;
461
 
462
+ // Animate hero text
463
  animate('.hero-text', {
464
  opacity: [0, 1],
465
  translateY: [20, 0],