File size: 13,999 Bytes
265f955
 
 
 
 
9306985
265f955
 
 
9306985
 
 
265f955
9306985
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
265f955
 
9306985
 
 
 
 
 
 
 
 
 
 
 
265f955
9306985
f4cc507
9306985
 
 
 
f4cc507
9306985
 
17cf838
9306985
 
17cf838
9306985
 
 
 
 
17cf838
9306985
 
 
17cf838
9306985
 
17cf838
9306985
 
 
 
17cf838
9306985
 
17cf838
265f955
 
9306985
 
 
 
 
 
 
 
f4cc507
 
9306985
 
 
 
 
6b8a065
9306985
 
 
 
 
 
 
 
 
 
 
f4cc507
265f955
 
 
6b8a065
9306985
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
265f955
6b8a065
9306985
 
f4cc507
9306985
 
 
 
 
265f955
9306985
265f955
9306985
 
 
 
265f955
 
9306985
265f955
 
6b8a065
9306985
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6b8a065
265f955
 
6b8a065
265f955
 
9306985
 
 
 
 
 
 
 
 
 
 
 
 
6b8a065
9306985
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4f876bd
265f955
9306985
 
 
 
 
 
 
 
 
 
 
 
 
 
f4cc507
9306985
 
6b8a065
9306985
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f4cc507
9306985
 
 
 
 
 
 
265f955
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Tech PC Maintenance Center</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        @keyframes fadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }
        @keyframes slideUp {
            from { transform: translateY(20px); opacity: 0; }
            to { transform: translateY(0); opacity: 1; }
        }
        .fade-in {
            animation: fadeIn 0.5s ease-in-out;
        }
        .slide-up {
            animation: slideUp 0.4s ease-out;
        }
        .gradient-bg {
            background: linear-gradient(135deg, #6e8efb, #a777e3);
        }
        .card-shadow {
            box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
        }
        .smooth-transition {
            transition: all 0.3s ease;
        }
        .progress-bar {
            height: 8px;
            border-radius: 4px;
            background-color: #e2e8f0;
            overflow: hidden;
        }
        .progress-fill {
            height: 100%;
            background: linear-gradient(90deg, #6e8efb, #a777e3);
            transition: width 0.5s ease;
        }
        .tool-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
        }
        .log-entry {
            border-left: 3px solid #6e8efb;
            padding-left: 10px;
            margin-bottom: 8px;
        }
        .log-entry.error {
            border-left-color: #ef4444;
        }
        .log-entry.warning {
            border-left-color: #f59e0b;
        }
        .log-entry.success {
            border-left-color: #10b981;
        }
        .log-entry.info {
            border-left-color: #3b82f6;
        }
        .log-timestamp {
            font-size: 0.75rem;
            color: #6b7280;
        }
        .log-message {
            font-size: 0.875rem;
        }
        .debug-section {
            max-height: 0;
            overflow: hidden;
            transition: max-height 0.5s ease;
        }
        .debug-section.expanded {
            max-height: 500px;
        }
    </style>
</head>
<body class="font-sans bg-gray-50 dark:bg-gray-900 dark:text-gray-100">
    <!-- Navigation -->
    <nav class="gradient-bg text-white shadow-md dark:bg-gray-800">
        <div class="container mx-auto px-4 py-3">
            <div class="flex justify-between items-center">
                <div class="flex items-center">
                    <i class="fas fa-tools text-2xl mr-2"></i>
                    <span class="text-xl font-bold">Tech PC Maintenance</span>
                </div>
                
                <div class="flex items-center space-x-4">
                    <!-- Dark Mode Toggle -->
                    <button id="dark-mode-toggle" class="p-2 rounded-full hover:bg-white hover:bg-opacity-20">
                        <i class="fas fa-moon hidden dark:block"></i>
                        <i class="fas fa-sun block dark:hidden"></i>
                    </button>
                    
                    <!-- Desktop Menu -->
                    <div class="hidden md:flex space-x-6">
                        <a href="#" onclick="showPage('home')" class="hover:text-indigo-200">Home</a>
                        <a href="#" onclick="showPage('login')" class="hover:text-indigo-200">Login</a>
                        <a href="#" onclick="showPage('signup')" class="hover:text-indigo-200">Sign Up</a>
                    </div>
                    
                    <!-- Mobile Menu Button -->
                    <button id="mobile-menu-button" class="md:hidden focus:outline-none">
                        <i class="fas fa-bars text-2xl"></i>
                    </button>
                </div>
            </div>
        </div>
        
        <!-- Mobile Menu -->
        <div id="mobile-menu" class="hidden md:hidden bg-indigo-700 dark:bg-gray-700">
            <div class="px-2 pt-2 pb-3 space-y-1 sm:px-3">
                <a href="#" onclick="showPage('home')" class="block px-3 py-2 rounded-md text-base font-medium text-white hover:bg-indigo-600 dark:hover:bg-gray-600">Home</a>
                <a href="#" onclick="showPage('login')" class="block px-3 py-2 rounded-md text-base font-medium text-white hover:bg-indigo-600 dark:hover:bg-gray-600">Login</a>
                <a href="#" onclick="showPage('signup')" class="block px-3 py-2 rounded-md text-base font-medium text-white hover:bg-indigo-600 dark:hover:bg-gray-600">Sign Up</a>
            </div>
        </div>
    </nav>

    <!-- Main Content Container -->
    <div class="container mx-auto px-4 py-8">
        <!-- Home Page -->
        <div id="home-page" class="fade-in">
            <div class="text-center mb-10">
                <h1 class="text-4xl font-bold text-gray-800 dark:text-white mb-4">PC Maintenance Tools</h1>
                <p class="text-xl text-gray-600 dark:text-gray-300">Keep your computer running smoothly with our maintenance tools</p>
            </div>
            
            <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
                <!-- Existing tool cards... -->
                
                <!-- New Update Drivers Card -->
                <div class="bg-white dark:bg-gray-800 rounded-lg p-6 card-shadow tool-card smooth-transition">
                    <div class="flex items-center mb-4">
                        <div class="bg-indigo-100 dark:bg-indigo-900 p-3 rounded-full mr-4">
                            <i class="fas fa-sync-alt text-indigo-600 dark:text-indigo-300 text-xl"></i>
                        </div>
                        <h3 class="text-xl font-semibold dark:text-white">Update Drivers</h3>
                    </div>
                    <p class="text-gray-600 dark:text-gray-300 mb-4">Check for and install the latest driver updates for your hardware.</p>
                    <button onclick="runTool('updateDrivers')" class="w-full gradient-bg text-white py-2 rounded-lg hover:opacity-90 smooth-transition">
                        Check for Updates
                    </button>
                </div>
                
                <!-- Other existing tool cards... -->
            </div>
        </div>
        
        <!-- Other pages (login, signup, dashboard, etc.) remain unchanged... -->
    </div>

    <!-- Confirmation Modal -->
    <div id="confirmation-modal" class="hidden fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50">
        <div class="bg-white dark:bg-gray-800 rounded-lg p-6 w-full max-w-md mx-4 card-shadow slide-up">
            <div class="flex justify-between items-center mb-4">
                <h3 class="text-xl font-bold text-gray-800 dark:text-white">Confirm Logout</h3>
                <button onclick="closeConfirmation()" class="text-gray-500 hover:text-gray-700 dark:text-gray-300 dark:hover:text-gray-100">
                    <i class="fas fa-times"></i>
                </button>
            </div>
            
            <div class="py-4">
                <p class="text-gray-700 dark:text-gray-300">Are you sure you want to logout?</p>
            </div>
            
            <div class="mt-4 flex justify-end space-x-3">
                <button onclick="closeConfirmation()" class="px-4 py-2 bg-gray-200 text-gray-800 rounded-lg hover:bg-gray-300 dark:bg-gray-700 dark:text-white dark:hover:bg-gray-600 smooth-transition">
                    Cancel
                </button>
                <button onclick="confirmLogout()" class="px-4 py-2 bg-red-600 text-white rounded-lg hover:bg-red-700 smooth-transition">
                    Logout
                </button>
            </div>
        </div>
    </div>

    <script>
        // ========== DARK MODE TOGGLE ==========
        const darkModeToggle = document.getElementById('dark-mode-toggle');
        const htmlElement = document.documentElement;
        
        // Check for saved user preference or use system preference
        if (localStorage.getItem('darkMode') === 'true' || 
            (!localStorage.getItem('darkMode') && window.matchMedia('(prefers-color-scheme: dark)').matches)) {
            htmlElement.classList.add('dark');
        }
        
        darkModeToggle.addEventListener('click', () => {
            htmlElement.classList.toggle('dark');
            localStorage.setItem('darkMode', htmlElement.classList.contains('dark'));
        });
        
        // ========== CONFIRMATION MODAL ==========
        function showConfirmation() {
            document.getElementById('confirmation-modal').classList.remove('hidden');
        }
        
        function closeConfirmation() {
            document.getElementById('confirmation-modal').classList.add('hidden');
        }
        
        function confirmLogout() {
            logout();
            closeConfirmation();
        }
        
        // ========== USER MANAGEMENT ==========
        // Check if user is logged in on page load
        document.addEventListener('DOMContentLoaded', function() {
            const token = localStorage.getItem('token');
            if (token) {
                showPage('dashboard');
            } else {
                showPage('home');
            }
        });
        
        // Modified logout function with confirmation
        function logout() {
            localStorage.removeItem('token');
            localStorage.removeItem('user_id');
            localStorage.removeItem('user_name');
            showPage('home');
        }
        
        // ========== TOOL FUNCTIONS ==========
        // Add updateDrivers case to showToolResults function
        function showToolResults(tool) {
            const resultsContent = document.getElementById('results-content');
            let resultHtml = '';
            
            switch(tool) {
                // Existing cases...
                
                case 'updateDrivers':
                    const driversUpdated = generateRandomNumber(1, 5);
                    const driversAvailable = generateRandomNumber(0, 3);
                    
                    resultHtml = `
                        <div class="p-4 bg-blue-50 dark:bg-blue-900 dark:bg-opacity-20 rounded-lg mb-4">
                            <div class="flex items-center text-blue-600 dark:text-blue-300 mb-2">
                                <i class="fas fa-sync-alt mr-2"></i>
                                <h4 class="font-semibold">Driver Update Results</h4>
                            </div>
                            <p class="text-sm text-gray-700 dark:text-gray-300">
                                ${driversUpdated} drivers were updated successfully.
                                ${driversAvailable > 0 ? `There are ${driversAvailable} additional updates available.` : 'Your drivers are all up to date.'}
                            </p>
                        </div>
                        
                        <div class="grid grid-cols-2 gap-4 mt-4">
                            <div class="bg-green-50 dark:bg-green-900 dark:bg-opacity-20 p-3 rounded-lg">
                                <div class="text-green-600 dark:text-green-300 text-sm font-medium">Updated</div>
                                <div class="text-xl font-bold">${driversUpdated}</div>
                            </div>
                            <div class="bg-yellow-50 dark:bg-yellow-900 dark:bg-opacity-20 p-3 rounded-lg">
                                <div class="text-yellow-600 dark:text-yellow-300 text-sm font-medium">Available</div>
                                <div class="text-xl font-bold">${driversAvailable}</div>
                            </div>
                        </div>
                        
                        <div class="mt-4 p-4 bg-indigo-50 dark:bg-indigo-900 dark:bg-opacity-20 rounded-lg">
                            <h4 class="font-semibold text-indigo-600 dark:text-indigo-300 mb-2">Recommendations</h4>
                            <ul class="text-sm space-y-2 dark:text-gray-300">
                                ${driversAvailable > 0 
                                    ? '<li class="flex items-start"><i class="fas fa-exclamation-circle text-yellow-500 mt-1 mr-2 text-xs"></i><span>Consider updating available drivers for optimal performance</span></li>'
                                    : '<li class="flex items-start"><i class="fas fa-check-circle text-green-500 mt-1 mr-2 text-xs"></i><span>All drivers are up to date</span></li>'}
                                <li class="flex items-start"><i class="fas fa-info-circle text-blue-500 mt-1 mr-2 text-xs"></i><span>Restart your computer to complete driver installations</span></li>
                            </ul>
                        </div>
                    `;
                    break;
                    
                // Other existing cases...
            }
            
            resultsContent.innerHTML = resultHtml;
        }
        
        // Rest of your existing JavaScript remains unchanged...
    </script>
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=mitznjay/tech-maintenance" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html>