Codechief commited on
Commit
612fc5c
·
verified ·
1 Parent(s): 61c1d30

now remove everything and then Build a IoT Dashboard with the same color theme for regular and dark theme, and the keep the multillinguage selection.

Browse files
Files changed (1) hide show
  1. index.html +243 -83
index.html CHANGED
@@ -3,10 +3,11 @@
3
  <head>
4
  <meta charset="UTF-8">
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>Login | AuthPortal Pro</title>
7
  <script src="https://cdn.tailwindcss.com"></script>
8
  <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
9
  <script src="https://unpkg.com/feather-icons"></script>
 
10
  <script>
11
  tailwind.config = {
12
  darkMode: 'class',
@@ -31,29 +32,28 @@
31
  html {
32
  font-family: 'Inter', sans-serif;
33
  }
34
- .login-container {
35
- box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
36
  }
37
- .dark .login-container {
38
- box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
39
  }
40
- .input-field:focus {
41
- border-color: #3B82F6;
42
- box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
43
  }
44
- .dark .input-field:focus {
45
- box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.4);
46
  }
47
  </style>
48
  </head>
49
  <body class="bg-gray-50 dark:bg-gray-900 transition-colors duration-200 min-h-screen flex flex-col">
50
  <!-- Navigation Bar -->
51
  <nav class="bg-white dark:bg-gray-800 shadow-sm py-4 px-6">
52
- <div class="max-w-6xl mx-auto flex justify-between items-center">
53
  <div class="flex items-center space-x-4">
54
  <div class="flex items-center">
55
- <i data-feather="lock" class="text-primary-500 dark:text-primary-400 w-6 h-6"></i>
56
- <span class="ml-2 font-semibold text-gray-800 dark:text-white">AuthPortal Pro</span>
57
  </div>
58
  </div>
59
  <div class="flex items-center space-x-4">
@@ -65,13 +65,13 @@
65
  <option value="fr" class="dark:bg-gray-700 dark:text-gray-100">Français</option>
66
  <option value="de" class="dark:bg-gray-700 dark:text-gray-100">Deutsch</option>
67
  <option value="ja" class="dark:bg-gray-700 dark:text-gray-100">日本語</option>
68
- </select>
69
  <div class="absolute inset-y-0 right-0 flex items-center pr-2 pointer-events-none">
70
  <i data-feather="globe" class="h-4 w-4 text-gray-400 dark:text-gray-300"></i>
71
- </div>
72
  </div>
73
  <!-- Dark Mode Toggle -->
74
- <button id="theme-toggle" class="text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 focus:outline-none rounded-lg text-sm p-2">
75
  <i id="theme-icon" data-feather="moon" class="w-5 h-5"></i>
76
  </button>
77
  </div>
@@ -79,70 +79,178 @@
79
  </nav>
80
 
81
  <!-- Main Content -->
82
- <main class="flex-grow flex items-center justify-center px-4 py-12 sm:px-6 lg:px-8">
83
- <div class="max-w-md w-full space-y-8">
84
- <div class="text-center">
85
- <!-- Logo Placeholder -->
86
- <div class="mx-auto flex items-center justify-center h-32 w-32 rounded-full bg-primary-100 dark:bg-primary-900/30 p-4">
87
- <i data-feather="shield" class="h-20 w-20 text-primary-500 dark:text-primary-400"></i>
 
 
 
 
 
 
 
 
 
88
  </div>
89
- <h2 class="mt-6 text-center text-3xl font-extrabold text-gray-900 dark:text-white" data-i18n="sign_in_title">
90
- <span data-i18n="sign_in_button">Sign in</span>
91
- to your account
92
- </h2>
93
- </div>
94
 
95
- <form class="mt-8 space-y-6 login-container bg-white dark:bg-gray-800 p-8 rounded-lg" action="#" method="POST">
96
- <input type="hidden" name="remember" value="true">
97
- <div class="rounded-md shadow-sm space-y-4">
98
- <div>
99
- <label for="username" class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1" data-i18n="username_label">Username or Email</label>
100
- <div class="relative">
101
- <div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
102
- <i data-feather="user" class="h-5 w-5 text-gray-400 dark:text-gray-500"></i>
103
- </div>
104
- <input id="username" name="username" type="text" required class="input-field pl-10 block w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md shadow-sm placeholder-gray-400 dark:placeholder-gray-500 focus:outline-none focus:ring-primary-500 focus:border-primary-500 dark:bg-gray-700 dark:text-white" placeholder="username@example.com">
105
  </div>
106
  </div>
107
- <div>
108
- <label for="password" class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1" data-i18n="password_label">Password</label>
109
- <div class="relative">
110
- <div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
111
- <i data-feather="lock" class="h-5 w-5 text-gray-400 dark:text-gray-500"></i>
112
- </div>
113
- <input id="password" name="password" type="password" autocomplete="current-password" required class="input-field pl-10 block w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md shadow-sm placeholder-gray-400 dark:placeholder-gray-500 focus:outline-none focus:ring-primary-500 focus:border-primary-500 dark:bg-gray-700 dark:text-white" placeholder="••••••••">
114
- <div class="absolute inset-y-0 right-0 pr-3 flex items-center cursor-pointer" onclick="togglePasswordVisibility()">
115
- <i id="eye-icon" data-feather="eye" class="h-5 w-5 text-gray-400 dark:text-gray-500 hover:text-gray-500 dark:hover:text-gray-400"></i>
116
- </div>
 
117
  </div>
118
  </div>
119
  </div>
120
 
121
- <div class="flex items-center justify-between">
 
122
  <div class="flex items-center">
123
- <input id="remember-me" name="remember-me" type="checkbox" class="h-4 w-4 text-primary-500 focus:ring-primary-400 border-gray-300 dark:border-gray-600 rounded dark:bg-gray-700">
124
- <label for="remember-me" class="ml-2 block text-sm text-gray-700 dark:text-gray-300" data-i18n="remember_me">
125
- Remember me
126
- </label>
127
- </div>
 
 
 
 
 
128
 
129
- <div class="text-sm">
130
- <a href="#" class="font-medium text-primary-500 dark:text-primary-400 hover:text-primary-600 dark:hover:text-primary-300">
131
- <span data-i18n="forgot_password">Forgot your password?</span>
132
- </a>
 
 
 
 
 
 
 
133
  </div>
 
134
  </div>
135
 
136
- <div>
137
- <button type="submit" class="group relative w-full flex justify-center py-2 px-4 border border-transparent text-sm font-medium rounded-md text-white bg-primary-500 hover:bg-primary-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500 dark:focus:ring-offset-gray-800">
138
- <span class="absolute left-0 inset-y-0 flex items-center pl-3">
139
- <i data-feather="log-in" class="h-5 w-5 text-primary-100 group-hover:text-primary-200"></i>
140
- </span>
141
- Sign in
 
 
 
 
 
 
 
 
 
 
 
 
 
 
142
  </button>
143
  </div>
144
- </form>
145
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
146
  </main>
147
 
148
  <script>
@@ -171,30 +279,82 @@ to your account
171
  }
172
  feather.replace();
173
  });
174
- // Password visibility toggle
175
- function togglePasswordVisibility() {
176
- const passwordInput = document.getElementById('password');
177
- const eyeIcon = document.getElementById('eye-icon');
178
-
179
- if (passwordInput.type === 'password') {
180
- passwordInput.type = 'text';
181
- eyeIcon.setAttribute('data-feather', 'eye-off');
182
- } else {
183
- passwordInput.type = 'password';
184
- eyeIcon.setAttribute('data-feather', 'eye');
185
- }
186
- feather.replace();
187
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
188
  // Language change handler
189
  document.querySelector('select').addEventListener('change', function() {
190
  const lang = this.value;
191
- // In a real app, you would load translations here
192
- // For demo purposes, we'll just show the selected language
193
  console.log('Language changed to:', lang);
194
  });
195
 
196
  // Initialize feather icons
197
  feather.replace();
198
- </script>
199
  </body>
200
- </html>
 
3
  <head>
4
  <meta charset="UTF-8">
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>IoT Dashboard</title>
7
  <script src="https://cdn.tailwindcss.com"></script>
8
  <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
9
  <script src="https://unpkg.com/feather-icons"></script>
10
+ <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
11
  <script>
12
  tailwind.config = {
13
  darkMode: 'class',
 
32
  html {
33
  font-family: 'Inter', sans-serif;
34
  }
35
+ .dashboard-card {
36
+ box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
37
  }
38
+ .dark .dashboard-card {
39
+ box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
40
  }
41
+ .device-card {
42
+ transition: all 0.3s ease;
 
43
  }
44
+ .device-card:hover {
45
+ transform: translateY(-2px);
46
  }
47
  </style>
48
  </head>
49
  <body class="bg-gray-50 dark:bg-gray-900 transition-colors duration-200 min-h-screen flex flex-col">
50
  <!-- Navigation Bar -->
51
  <nav class="bg-white dark:bg-gray-800 shadow-sm py-4 px-6">
52
+ <div class="max-w-7xl mx-auto flex justify-between items-center">
53
  <div class="flex items-center space-x-4">
54
  <div class="flex items-center">
55
+ <i data-feather="cpu" class="text-primary-500 dark:text-primary-400 w-6 h-6"></i>
56
+ <span class="ml-2 font-semibold text-gray-800 dark:text-white">IoT Dashboard</span>
57
  </div>
58
  </div>
59
  <div class="flex items-center space-x-4">
 
65
  <option value="fr" class="dark:bg-gray-700 dark:text-gray-100">Français</option>
66
  <option value="de" class="dark:bg-gray-700 dark:text-gray-100">Deutsch</option>
67
  <option value="ja" class="dark:bg-gray-700 dark:text-gray-100">日本語</option>
68
+ </select>
69
  <div class="absolute inset-y-0 right-0 flex items-center pr-2 pointer-events-none">
70
  <i data-feather="globe" class="h-4 w-4 text-gray-400 dark:text-gray-300"></i>
71
+ </div>
72
  </div>
73
  <!-- Dark Mode Toggle -->
74
+ <button id="theme-toggle" class="text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 focus:outline-none rounded-lg text-sm p-2">
75
  <i id="theme-icon" data-feather="moon" class="w-5 h-5"></i>
76
  </button>
77
  </div>
 
79
  </nav>
80
 
81
  <!-- Main Content -->
82
+ <main class="flex-grow px-4 py-6 sm:px-6 lg:px-8">
83
+ <div class="max-w-7xl mx-auto">
84
+ <!-- Overview Cards -->
85
+ <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8">
86
+ <!-- Total Devices -->
87
+ <div class="dashboard-card bg-white dark:bg-gray-800 rounded-lg p-6">
88
+ <div class="flex items-center">
89
+ <div class="p-3 rounded-full bg-primary-100 dark:bg-primary-900/20 mr-4">
90
+ <i data-feather="database" class="text-primary-500 dark:text-primary-400 w-6 h-6"></i>
91
+ </div>
92
+ <div>
93
+ <p class="text-sm font-medium text-gray-500 dark:text-gray-400">Total Devices</p>
94
+ <h3 class="text-2xl font-bold text-gray-900 dark:text-white" id="total-devices">12</h3>
95
+ </div>
96
+ </div>
97
  </div>
 
 
 
 
 
98
 
99
+ <!-- Active Devices -->
100
+ <div class="dashboard-card bg-white dark:bg-gray-800 rounded-lg p-6">
101
+ <div class="flex items-center">
102
+ <div class="p-3 rounded-full bg-green-100 dark:bg-green-900/20 mr-4">
103
+ <i data-feather="activity" class="text-green-500 dark:text-green-400 w-6 h-6"></i>
104
+ </div>
105
+ <div>
106
+ <p class="text-sm font-medium text-gray-500 dark:text-gray-400">Active Devices</p>
107
+ <h3 class="text-2xl font-bold text-gray-900 dark:text-white" id="active-devices">8</h3>
 
108
  </div>
109
  </div>
110
+ </div>
111
+
112
+ <!-- Average Temperature -->
113
+ <div class="dashboard-card bg-white dark:bg-gray-800 rounded-lg p-6">
114
+ <div class="flex items-center">
115
+ <div class="p-3 rounded-full bg-yellow-100 dark:bg-yellow-900/20 mr-4">
116
+ <i data-feather="thermometer" class="text-yellow-500 dark:text-yellow-400 w-6 h-6"></i>
117
+ </div>
118
+ <div>
119
+ <p class="text-sm font-medium text-gray-500 dark:text-gray-400">Avg Temperature</p>
120
+ <h3 class="text-2xl font-bold text-gray-900 dark:text-white" id="avg-temp">24.5°C</h3>
121
  </div>
122
  </div>
123
  </div>
124
 
125
+ <!-- Power Consumption -->
126
+ <div class="dashboard-card bg-white dark:bg-gray-800 rounded-lg p-6">
127
  <div class="flex items-center">
128
+ <div class="p-3 rounded-full bg-red-100 dark:bg-red-900/20 mr-4">
129
+ <i data-feather="zap" class="text-red-500 dark:text-red-400 w-6 h-6"></i>
130
+ </div>
131
+ <div>
132
+ <p class="text-sm font-medium text-gray-500 dark:text-gray-400">Power Usage</p>
133
+ <h3 class="text-2xl font-bold text-gray-900 dark:text-white" id="power-usage">1.8 kW</h3>
134
+ </div>
135
+ </div>
136
+ </div>
137
+ </div>
138
 
139
+ <!-- Charts Section -->
140
+ <div class="grid grid-cols-1 lg:grid-cols-2 gap-6 mb-8">
141
+ <!-- Temperature Chart -->
142
+ <div class="dashboard-card bg-white dark:bg-gray-800 rounded-lg p-6">
143
+ <div class="flex justify-between items-center mb-4">
144
+ <h3 class="text-lg font-medium text-gray-900 dark:text-white">Temperature Trend</h3>
145
+ <div class="flex space-x-2">
146
+ <button class="text-xs px-2 py-1 rounded bg-gray-100 dark:bg-gray-700 text-gray-800 dark:text-gray-200">24h</button>
147
+ <button class="text-xs px-2 py-1 rounded bg-primary-500 text-white">7d</button>
148
+ <button class="text-xs px-2 py-1 rounded bg-gray-100 dark:bg-gray-700 text-gray-800 dark:text-gray-200">30d</button>
149
+ </div>
150
  </div>
151
+ <canvas id="temperatureChart" height="250"></canvas>
152
  </div>
153
 
154
+ <!-- Humidity Chart -->
155
+ <div class="dashboard-card bg-white dark:bg-gray-800 rounded-lg p-6">
156
+ <div class="flex justify-between items-center mb-4">
157
+ <h3 class="text-lg font-medium text-gray-900 dark:text-white">Humidity Trend</h3>
158
+ <div class="flex space-x-2">
159
+ <button class="text-xs px-2 py-1 rounded bg-gray-100 dark:bg-gray-700 text-gray-800 dark:text-gray-200">24h</button>
160
+ <button class="text-xs px-2 py-1 rounded bg-primary-500 text-white">7d</button>
161
+ <button class="text-xs px-2 py-1 rounded bg-gray-100 dark:bg-gray-700 text-gray-800 dark:text-gray-200">30d</button>
162
+ </div>
163
+ </div>
164
+ <canvas id="humidityChart" height="250"></canvas>
165
+ </div>
166
+ </div>
167
+
168
+ <!-- Devices List -->
169
+ <div class="dashboard-card bg-white dark:bg-gray-800 rounded-lg p-6">
170
+ <div class="flex justify-between items-center mb-4">
171
+ <h3 class="text-lg font-medium text-gray-900 dark:text-white">Connected Devices</h3>
172
+ <button class="text-sm px-3 py-1 rounded bg-primary-500 hover:bg-primary-600 text-white flex items-center">
173
+ <i data-feather="plus" class="w-4 h-4 mr-1"></i> Add Device
174
  </button>
175
  </div>
176
+ <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
177
+ <!-- Device Card 1 -->
178
+ <div class="device-card bg-gray-50 dark:bg-gray-700 rounded-lg p-4 border border-gray-200 dark:border-gray-600">
179
+ <div class="flex justify-between items-start">
180
+ <div>
181
+ <h4 class="font-medium text-gray-900 dark:text-white">Living Room Thermostat</h4>
182
+ <p class="text-sm text-gray-500 dark:text-gray-400">ID: TH-001</p>
183
+ </div>
184
+ <div class="w-3 h-3 rounded-full bg-green-500"></div>
185
+ </div>
186
+ <div class="mt-4 flex justify-between">
187
+ <div>
188
+ <p class="text-xs text-gray-500 dark:text-gray-400">Temperature</p>
189
+ <p class="text-lg font-medium text-gray-900 dark:text-white">22.5°C</p>
190
+ </div>
191
+ <div>
192
+ <p class="text-xs text-gray-500 dark:text-gray-400">Humidity</p>
193
+ <p class="text-lg font-medium text-gray-900 dark:text-white">45%</p>
194
+ </div>
195
+ <div>
196
+ <p class="text-xs text-gray-500 dark:text-gray-400">Status</p>
197
+ <p class="text-lg font-medium text-green-500">Online</p>
198
+ </div>
199
+ </div>
200
+ </div>
201
+
202
+ <!-- Device Card 2 -->
203
+ <div class="device-card bg-gray-50 dark:bg-gray-700 rounded-lg p-4 border border-gray-200 dark:border-gray-600">
204
+ <div class="flex justify-between items-start">
205
+ <div>
206
+ <h4 class="font-medium text-gray-900 dark:text-white">Kitchen Camera</h4>
207
+ <p class="text-sm text-gray-500 dark:text-gray-400">ID: CAM-002</p>
208
+ </div>
209
+ <div class="w-3 h-3 rounded-full bg-green-500"></div>
210
+ </div>
211
+ <div class="mt-4 flex justify-between">
212
+ <div>
213
+ <p class="text-xs text-gray-500 dark:text-gray-400">Last Motion</p>
214
+ <p class="text-lg font-medium text-gray-900 dark:text-white">12 min ago</p>
215
+ </div>
216
+ <div>
217
+ <p class="text-xs text-gray-500 dark:text-gray-400">Storage</p>
218
+ <p class="text-lg font-medium text-gray-900 dark:text-white">78%</p>
219
+ </div>
220
+ <div>
221
+ <p class="text-xs text-gray-500 dark:text-gray-400">Status</p>
222
+ <p class="text-lg font-medium text-green-500">Online</p>
223
+ </div>
224
+ </div>
225
+ </div>
226
+
227
+ <!-- Device Card 3 -->
228
+ <div class="device-card bg-gray-50 dark:bg-gray-700 rounded-lg p-4 border border-gray-200 dark:border-gray-600">
229
+ <div class="flex justify-between items-start">
230
+ <div>
231
+ <h4 class="font-medium text-gray-900 dark:text-white">Bedroom Light</h4>
232
+ <p class="text-sm text-gray-500 dark:text-gray-400">ID: LGT-003</p>
233
+ </div>
234
+ <div class="w-3 h-3 rounded-full bg-yellow-500"></div>
235
+ </div>
236
+ <div class="mt-4 flex justify-between">
237
+ <div>
238
+ <p class="text-xs text-gray-500 dark:text-gray-400">Brightness</p>
239
+ <p class="text-lg font-medium text-gray-900 dark:text-white">75%</p>
240
+ </div>
241
+ <div>
242
+ <p class="text-xs text-gray-500 dark:text-gray-400">Power</p>
243
+ <p class="text-lg font-medium text-gray-900 dark:text-white">15W</p>
244
+ </div>
245
+ <div>
246
+ <p class="text-xs text-gray-500 dark:text-gray-400">Status</p>
247
+ <p class="text-lg font-medium text-yellow-500">Idle</p>
248
+ </div>
249
+ </div>
250
+ </div>
251
+ </div>
252
+ </div>
253
+ </div>
254
  </main>
255
 
256
  <script>
 
279
  }
280
  feather.replace();
281
  });
282
+
283
+ // Initialize charts
284
+ document.addEventListener('DOMContentLoaded', function() {
285
+ // Temperature Chart
286
+ const tempCtx = document.getElementById('temperatureChart').getContext('2d');
287
+ const tempChart = new Chart(tempCtx, {
288
+ type: 'line',
289
+ data: {
290
+ labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
291
+ datasets: [{
292
+ label: 'Temperature (°C)',
293
+ data: [22, 23, 24, 23.5, 24.5, 25, 24],
294
+ borderColor: '#3B82F6',
295
+ backgroundColor: 'rgba(59, 130, 246, 0.1)',
296
+ borderWidth: 2,
297
+ tension: 0.3,
298
+ fill: true
299
+ }]
300
+ },
301
+ options: {
302
+ responsive: true,
303
+ maintainAspectRatio: false,
304
+ plugins: {
305
+ legend: {
306
+ display: false
307
+ }
308
+ },
309
+ scales: {
310
+ y: {
311
+ beginAtZero: false
312
+ }
313
+ }
314
+ }
315
+ });
316
+
317
+ // Humidity Chart
318
+ const humidityCtx = document.getElementById('humidityChart').getContext('2d');
319
+ const humidityChart = new Chart(humidityCtx, {
320
+ type: 'line',
321
+ data: {
322
+ labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
323
+ datasets: [{
324
+ label: 'Humidity (%)',
325
+ data: [45, 47, 50, 48, 46, 44, 42],
326
+ borderColor: '#6366F1',
327
+ backgroundColor: 'rgba(99, 102, 241, 0.1)',
328
+ borderWidth: 2,
329
+ tension: 0.3,
330
+ fill: true
331
+ }]
332
+ },
333
+ options: {
334
+ responsive: true,
335
+ maintainAspectRatio: false,
336
+ plugins: {
337
+ legend: {
338
+ display: false
339
+ }
340
+ },
341
+ scales: {
342
+ y: {
343
+ beginAtZero: false
344
+ }
345
+ }
346
+ }
347
+ });
348
+ });
349
+
350
  // Language change handler
351
  document.querySelector('select').addEventListener('change', function() {
352
  const lang = this.value;
 
 
353
  console.log('Language changed to:', lang);
354
  });
355
 
356
  // Initialize feather icons
357
  feather.replace();
358
+ </script>
359
  </body>
360
+ </html>