-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
450 lines (405 loc) · 29.4 KB
/
index.html
File metadata and controls
450 lines (405 loc) · 29.4 KB
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
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>GitHub Auto Commit Bot - Secure Edition</title>
<!-- Security Headers - Fixed CSP to allow D3.js -->
<meta http-equiv="Content-Security-Policy" content="
default-src 'self';
script-src 'self' 'unsafe-inline' https://cdn.tailwindcss.com https://cdn.jsdelivr.net https://cdnjs.cloudflare.com https://d3js.org;
style-src 'self' 'unsafe-inline' https://fonts.googleapis.com https://cdn.jsdelivr.net https://cdnjs.cloudflare.com;
font-src 'self' https://fonts.gstatic.com https://cdnjs.cloudflare.com;
connect-src 'self' https://api.github.com https://generativelanguage.googleapis.com https://cdn.jsdelivr.net https://d3js.org;
img-src 'self' https: data:;
">
<meta http-equiv="X-Content-Type-Options" content="nosniff">
<!-- Favicon & Branding -->
<link rel="icon" href="/favicon.ico" type="image/x-icon">
<link rel="apple-touch-icon" href="/icon-512.png">
<link rel="manifest" href="/manifest.json">
<meta name="theme-color" content="#2563eb" />
<!-- Tailwind CSS CDN -->
<script src="https://cdn.tailwindcss.com"></script>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
<style>
* { transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease; }
body { font-family: 'Inter', sans-serif; }
select[multiple] { min-height: 100px; }
.tab-button { transition: all 0.2s ease; }
.tab-button.active { @apply bg-blue-600 text-white shadow-md; }
.tab-button:hover:not(.active) { transform: translateY(-1px); }
.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
/* Mobile responsive improvements */
@media (max-width: 640px) {
.tab-button {
font-size: 0.75rem;
padding: 0.5rem 0.25rem;
}
button, input, select, textarea {
font-size: 16px; /* Prevents iOS zoom */
}
select[multiple] {
min-height: 120px; /* Better touch targets */
}
}
.dark body { background-color: #1a202c; color: #e2e8f0; }
.dark .bg-white { background-color: #2d3748; }
.dark .text-gray-800 { color: #e2e8f0; }
.dark .text-gray-600 { color: #cbd5e0; }
.dark .text-gray-700 { color: #cbd5e0; }
.dark .border-gray-200 { border-color: #4a5568; }
.dark .bg-gray-100 { background-color: #2d3748; }
.dark input, .dark textarea, .dark select {
background-color: #4a5568;
border-color: #616e7f;
color: #e2e8f0;
}
.dark .bg-gray-50 { background-color: #2d3748; }
.warning-banner {
background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
border-left: 4px solid #f59e0b;
}
/* Heatmap styles */
.heatmap-cell {
shape-rendering: crispEdges;
}
.heatmap-cell:hover {
stroke: #1b1f23;
stroke-width: 2px;
}
.dark .heatmap-cell:hover {
stroke: #fff;
}
</style>
<!-- D3.js for heatmap visualization -->
<script src="https://d3js.org/d3.v7.min.js"></script>
</head>
<body class="bg-gray-100 min-h-screen flex flex-col items-center justify-between p-4 transition-colors duration-300 ease-in-out">
<!-- Notification Toast -->
<div id="notification" style="display: none;" class="fixed top-4 right-4 p-4 rounded-md shadow-lg z-50 text-white transform transition-all duration-300"></div>
<!-- Ethical Use Warning Banner -->
<div class="w-full max-w-4xl mb-4 warning-banner p-4 rounded-lg shadow-md">
<div class="flex items-start">
<div class="flex-shrink-0">
<svg class="h-6 w-6 text-yellow-600" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" />
</svg>
</div>
<div class="ml-3 flex-1">
<h3 class="text-sm font-medium text-yellow-800">⚠️ Responsible Use Policy</h3>
<div class="mt-2 text-xs text-yellow-700">
<p>This tool is for: ✅ Testing automation • Learning CI/CD • Managing personal projects</p>
<p class="mt-1">NOT for: ❌ Fabricating history • Misleading employers • Gaming statistics • Spamming repos</p>
</div>
</div>
</div>
</div>
<div class="bg-white shadow-xl rounded-2xl p-8 max-w-xl w-full mb-4 dark:bg-gray-800 transition-colors duration-300 ease-in-out">
<div class="flex flex-col items-center mb-6">
<img src="/icon-512.png" alt="GitHub Bot Logo" class="h-16 w-auto mb-2" onerror="this.onerror=null; this.src='icon-512.png';">
<h1 class="text-3xl font-bold text-center text-gray-800 dark:text-white">GitHub Auto Commit Bot</h1>
<p class="text-sm text-gray-600 text-center dark:text-gray-400">Secure & Spam-Proof Edition</p>
<!-- Rate Limit Display -->
<div class="mt-3 flex space-x-4 text-xs">
<span class="bg-blue-100 text-blue-800 px-3 py-1 rounded-full dark:bg-blue-900 dark:text-blue-200">
Commits: <strong id="rateLimitCommits">60</strong>/hr
</span>
<span class="bg-green-100 text-green-800 px-3 py-1 rounded-full dark:bg-green-900 dark:text-green-200">
API: <strong id="rateLimitAPI">100</strong>/hr
</span>
</div>
<!-- Dark Mode Toggle -->
<div class="flex items-center mt-4">
<span class="text-gray-700 dark:text-gray-300 mr-2">☀️ Light</span>
<label for="darkModeToggle" class="relative inline-flex items-center cursor-pointer">
<input type="checkbox" id="darkModeToggle" class="sr-only peer">
<div class="w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-blue-300 dark:peer-focus:ring-blue-800 rounded-full peer dark:bg-gray-700 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-blue-600"></div>
</label>
<span class="text-gray-700 dark:text-gray-300 ml-2">🌙 Dark</span>
</div>
</div>
<!-- Tab Buttons -->
<div class="flex border-b border-gray-200 mb-6 dark:border-gray-700 overflow-x-auto">
<button class="tab-button flex-1 py-2 px-4 text-center text-gray-700 font-medium rounded-tl-lg hover:bg-gray-100 active dark:text-gray-300 dark:hover:bg-gray-700" data-tab="main-controls">Main</button>
<button class="tab-button flex-1 py-2 px-4 text-center text-gray-700 font-medium hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700" data-tab="historic-commits">Historic</button>
<button class="tab-button flex-1 py-2 px-4 text-center text-gray-700 font-medium hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700" data-tab="heatmaps">Heatmaps</button>
<button class="tab-button flex-1 py-2 px-4 text-center text-gray-700 font-medium hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700" data-tab="stats">Stats</button>
<button class="tab-button flex-1 py-2 px-4 text-center text-gray-700 font-medium rounded-tr-lg hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700" data-tab="about">About</button>
</div>
<!-- Tab Content -->
<div id="main-controls" class="tab-content active space-y-4">
<!-- GitHub Login Section -->
<div id="githubLoginSection" class="border-b border-gray-200 pb-4 mb-4 dark:border-gray-700 text-center">
<h3 class="text-lg font-semibold mb-2 text-gray-800 dark:text-white">GitHub Authentication</h3>
<div id="loggedInUser" class="hidden flex items-center justify-center space-x-2 mb-4">
<img id="userAvatar" src="" alt="User Avatar" class="w-10 h-10 rounded-full border border-gray-300 dark:border-gray-600">
<span id="userName" class="text-gray-700 font-medium dark:text-gray-300"></span>
<button id="githubLogout" class="bg-red-500 text-white px-3 py-1 rounded-md text-sm font-semibold hover:bg-red-600 transition duration-300 ease-in-out">Logout</button>
</div>
<button id="githubLogin" class="w-full bg-blue-600 text-white py-3 rounded-md font-semibold hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 transition duration-300 ease-in-out shadow-md">
🔐 Login with GitHub
</button>
<p class="text-xs text-gray-500 mt-2 dark:text-gray-400">
Secure OAuth authentication with automatic token management
</p>
</div>
<div>
<label for="token" class="block text-gray-700 text-sm font-medium mb-1 dark:text-gray-300">GitHub Personal Access Token (PAT):</label>
<input type="password" id="token" placeholder="ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
aria-label="GitHub Personal Access Token"
aria-describedby="token-help"
class="w-full p-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:text-white" />
<p id="token-help" class="text-xs text-gray-500 mt-1 dark:text-gray-400">
Required scopes: <code>repo</code> <code>read:user</code> | Optional if using OAuth
</p>
</div>
<div>
<label for="geminiApiKey" class="block text-gray-700 text-sm font-medium mb-1 dark:text-gray-300">Gemini API Key (Optional - for Smart Messages):</label>
<input type="password" id="geminiApiKey" placeholder="AIzaSyBxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
class="w-full p-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-purple-500 dark:bg-gray-700 dark:border-gray-600 dark:text-white" />
</div>
<div>
<label for="username" class="block text-gray-700 text-sm font-medium mb-1 dark:text-gray-300">GitHub Username:</label>
<input type="text" id="username" placeholder="Your GitHub Username"
class="w-full p-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:text-white" />
</div>
<div>
<div class="flex justify-between items-center mb-1">
<label for="repo" class="block text-gray-700 text-sm font-medium dark:text-gray-300">
Select Repositories
<span class="text-xs text-blue-600 dark:text-blue-400">(Hold Ctrl/Cmd to select multiple)</span>
<span id="selectedRepoCount" class="text-xs text-gray-500 dark:text-gray-400"></span>
</label>
<button onclick="selectAllRepos()" id="selectAllReposBtn" class="text-xs text-blue-600 hover:text-blue-800 dark:text-blue-400 dark:hover:text-blue-200 font-medium hidden">
Select All
</button>
</div>
<select id="repo" multiple
class="w-full p-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:text-white">
<option value="">Loading Repos...</option>
</select>
</div>
<div>
<label for="branch" class="block text-gray-700 text-sm font-medium mb-1 dark:text-gray-300">Select Branch:</label>
<select id="branch" class="w-full p-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:text-white">
<option value="">Select Repo First</option>
</select>
</div>
<div>
<label for="filepath" class="block text-gray-700 text-sm font-medium mb-1 dark:text-gray-300">File Path:</label>
<input type="text" id="filepath" placeholder="README.md"
class="w-full p-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:text-white" />
</div>
<div>
<label for="commitContext" class="block text-gray-700 text-sm font-medium mb-1 dark:text-gray-300">Context for Smart Message:</label>
<textarea id="commitContext" rows="2" placeholder="e.g., fixed login bug, updated docs..."
class="w-full p-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-purple-500 resize-y dark:bg-gray-700 dark:border-gray-600 dark:text-white"></textarea>
<button onclick="generateSmartCommitMessage()" id="generateMessageButton"
aria-label="Generate smart commit message using AI"
class="w-full bg-purple-500 text-white py-2 rounded-md font-semibold hover:bg-purple-600 focus:outline-none focus:ring-2 focus:ring-purple-500 focus:ring-offset-2 transition duration-300 ease-in-out shadow-md mt-2">
✨ Generate Smart Message
</button>
</div>
<div>
<label for="content" class="block text-gray-700 text-sm font-medium mb-1 dark:text-gray-300">Commit Message / Content:</label>
<textarea id="content" rows="6" placeholder="Leave blank for auto-generated content..."
class="w-full p-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 resize-y dark:bg-gray-700 dark:border-gray-600 dark:text-white"></textarea>
</div>
<button onclick="makeSingleCommit()" id="makeCommitButton"
class="w-full bg-blue-600 text-white py-3 rounded-md font-semibold hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 transition duration-300 ease-in-out shadow-md">
Make Single Commit
</button>
<div class="border-t border-gray-200 pt-4 mt-4 dark:border-gray-700">
<h3 class="text-lg font-semibold mb-3 text-gray-800 dark:text-white">Auto Commit Settings</h3>
<div class="flex space-x-2 mb-4">
<input type="number" id="intervalValue" value="24" min="1"
class="w-1/3 p-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500 dark:bg-gray-700 dark:border-gray-600 dark:text-white" />
<select id="intervalType"
class="w-2/3 p-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500 dark:bg-gray-700 dark:border-gray-600 dark:text-white">
<option value="hours">Hours</option>
<option value="minutes">Minutes</option>
<option value="days">Days</option>
</select>
</div>
<div class="mt-4">
<label class="inline-flex items-center space-x-2">
<input type="checkbox" id="smartRotation" class="h-5 w-5 text-blue-600 border-gray-300 rounded dark:border-gray-600"/>
<span class="text-sm font-medium text-gray-700 dark:text-gray-300">🔄 Smart Rotation (Round-Robin)</span>
</label>
</div>
<div class="mt-4">
<label class="inline-flex items-center space-x-2">
<input type="checkbox" id="safeMode" class="h-5 w-5 text-blue-600 border-gray-300 rounded dark:border-gray-600"/>
<span class="text-sm font-medium text-gray-700 dark:text-gray-300">🛡️ Safe Mode (Human-like)</span>
</label>
<p class="text-xs text-gray-500 mt-1 ml-7 dark:text-gray-400">
🕐 30min-3hr delays • 🌙 Quiet hours 11PM-7AM • 📊 Max 20/day • 🎲 Random skips
</p>
</div>
<div class="mt-4">
<label class="inline-flex items-center space-x-2">
<input type="checkbox" id="commitPreviewToggle" class="h-5 w-5 text-blue-600 border-gray-300 rounded dark:border-gray-600"/>
<span class="text-sm font-medium text-gray-700 dark:text-gray-300">👀 Commit Preview</span>
</label>
</div>
<button onclick="toggleAutoCommit()" id="toggleAutoCommitButton"
class="w-full bg-green-600 text-white py-3 rounded-md font-semibold hover:bg-green-700 focus:outline-none focus:ring-2 focus:ring-green-500 focus:ring-offset-2 transition duration-300 ease-in-out shadow-md mt-4">
Toggle Auto Commit
</button>
</div>
<div class="mt-6 border-t border-gray-200 pt-4 dark:border-gray-700">
<h3 class="text-lg font-semibold mb-2 text-gray-800 dark:text-white">Activity Log</h3>
<ul id="safeModeLog" class="bg-gray-50 p-3 rounded-md text-sm overflow-auto max-h-48 text-gray-700 space-y-1 dark:bg-gray-700 dark:text-gray-300">
<li class="text-gray-500 dark:text-gray-400">No activity yet.</li>
</ul>
</div>
</div>
<div id="historic-commits" class="tab-content space-y-4">
<h3 class="text-lg font-semibold mb-3 text-gray-800 dark:text-white">Simulated Historic Commits</h3>
<p class="text-sm text-gray-600 mb-2 dark:text-gray-400">
Generate commits with past dates. Note: GitHub timestamps are server-side, so dates appear in messages only.
</p>
<div class="space-y-3">
<div>
<label for="simulatedStartDate" class="block text-gray-700 text-sm font-medium mb-1 dark:text-gray-300">Start Date:</label>
<input type="date" id="simulatedStartDate"
class="w-full p-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-purple-500 dark:bg-gray-700 dark:border-gray-600 dark:text-white" />
</div>
<div>
<label for="simulatedEndDate" class="block text-gray-700 text-sm font-medium mb-1 dark:text-gray-300">End Date:</label>
<input type="date" id="simulatedEndDate"
class="w-full p-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-purple-500 dark:bg-gray-700 dark:border-gray-600 dark:text-white" />
</div>
<div>
<label for="streakPatternSelect" class="block text-gray-700 text-sm font-medium mb-1 dark:text-gray-300">Pattern:</label>
<select id="streakPatternSelect"
class="w-full p-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-indigo-500 dark:bg-gray-700 dark:border-gray-600 dark:text-white">
<option value="random">Random Distribution</option>
<option value="30-day-streak">30-Day Streak (Daily)</option>
<option value="checkerboard">Checkerboard (Every Other Day)</option>
<option value="year-grid">Full Year Grid (Daily)</option>
<option value="random-burst">Random Burst (5-10 commits)</option>
<option value="weekdays-only">Weekdays Only (Mon-Fri)</option>
</select>
</div>
<div id="numCommitsContainer">
<label for="numSimulatedCommits" class="block text-gray-700 text-sm font-medium mb-1 dark:text-gray-300">Number of commits (for Random/Burst):</label>
<input type="number" id="numSimulatedCommits" value="10" min="1" max="100"
class="w-full p-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-purple-500 dark:bg-gray-700 dark:border-gray-600 dark:text-white" />
</div>
</div>
<button onclick="generateSimulatedCommits()" id="generateSimulatedCommitsButton"
class="w-full bg-purple-600 text-white py-3 rounded-md font-semibold hover:bg-purple-700 focus:outline-none focus:ring-2 focus:ring-purple-500 focus:ring-offset-2 transition duration-300 ease-in-out shadow-md mt-4">
Generate Simulated Commits
</button>
</div>
<div id="heatmaps" class="tab-content space-y-4">
<div class="border-b border-gray-200 pb-4 mb-4 dark:border-gray-700">
<h3 class="text-lg font-semibold mb-3 text-gray-800 dark:text-white">Real GitHub Heatmap</h3>
<button onclick="loadRealContributionHeatmap()" id="loadRealHeatmapButton"
class="w-full bg-blue-500 text-white py-3 rounded-md font-semibold hover:bg-blue-600 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 transition duration-300 ease-in-out shadow-md">
Load Real Heatmap
</button>
<div id="realHeatmapContainer" class="mt-4 p-2 bg-gray-50 rounded-md border border-gray-200 overflow-x-auto dark:bg-gray-700 dark:border-gray-600" style="max-width: 100%;">
</div>
</div>
<div>
<h3 class="text-lg font-semibold mb-3 text-gray-800 dark:text-white">Simulated Heatmap</h3>
<button onclick="renderHeatmapFromSimulatedData()" id="previewHeatmapButton"
class="w-full bg-gray-500 text-white py-3 rounded-md font-semibold hover:bg-gray-600 focus:outline-none focus:ring-2 focus:ring-gray-500 focus:ring-offset-2 transition duration-300 ease-in-out shadow-md mt-2">
Refresh Simulated Heatmap
</button>
<div id="heatmapContainer" class="mt-4 p-2 bg-gray-50 rounded-md border border-gray-200 overflow-x-auto dark:bg-gray-700 dark:border-gray-600" style="max-width: 100%;">
</div>
</div>
</div>
<div id="stats" class="tab-content space-y-4">
<h3 class="text-lg font-semibold mb-3 text-gray-800 dark:text-white">📈 Usage Statistics</h3>
<ul class="text-sm space-y-2 text-gray-700 dark:text-gray-300">
<li>🔢 Total Commits: <strong id="statsTotalCommits">0</strong></li>
<li>🛡️ Safe Mode Commits: <strong id="statsSafeModeCommits">0 (0%)</strong></li>
<li>📅 First Commit: <strong id="statsFirstCommitDate">N/A</strong></li>
<li>⏱️ Average Interval: <strong id="statsAverageInterval">N/A</strong></li>
<li>📁 Top Repo: <strong id="statsTopUsedRepo">N/A</strong></li>
</ul>
<div id="suspiciousActivityWarning" class="hidden mt-4 p-3 bg-red-100 border-l-4 border-red-500 text-red-700 dark:bg-red-900 dark:text-red-200">
<p class="font-bold">⚠️ Suspicious Activity Detected</p>
<p class="text-sm mt-1" id="suspiciousActivityReason"></p>
<p class="text-sm mt-1" id="suspiciousActivityRecommendation"></p>
</div>
<button onclick="resetStats()" id="resetStatsButton"
class="w-full bg-red-500 text-white py-2 rounded-md font-semibold hover:bg-red-600 focus:outline-none focus:ring-2 focus:ring-red-500 focus:ring-offset-2 transition duration-300 ease-in-out shadow-md mt-4">
Reset Stats
</button>
</div>
<div id="about" class="tab-content space-y-4">
<h3 class="text-lg font-semibold mb-3 text-gray-800 dark:text-white">About This Project</h3>
<p class="text-gray-700 dark:text-gray-300">
Secure & Spam-Proof GitHub Auto Commit Bot by <a href="https://farmlabs.pages.dev" target="_blank" class="text-blue-600 hover:underline">Farmlabs</a>.
</p>
<p class="text-gray-700 dark:text-gray-300">
<strong>New Security Features:</strong>
</p>
<ul class="list-disc list-inside text-sm text-gray-700 dark:text-gray-300 space-y-1">
<li>🔒 Encrypted token storage</li>
<li>⏱️ Rate limiting (60/hr, 20/day)</li>
<li>🛡️ Enhanced Safe Mode with quiet hours</li>
<li>🎲 Random timing for organic patterns</li>
<li>📊 Activity pattern monitoring</li>
<li>🔐 Secure OAuth implementation</li>
<li>📈 D3.js heatmap visualization</li>
</ul>
<p class="text-gray-700 dark:text-gray-300 mt-4">
Source: <a href="https://github.com/CryptoExplor/GitHub-Contribution-Bot" target="_blank" class="text-blue-600 hover:underline">GitHub Repository</a>
</p>
</div>
<div class="mt-6">
<h3 class="text-lg font-semibold mb-2 text-gray-800 dark:text-white">Status</h3>
<pre id="status" class="bg-gray-50 p-3 rounded-md text-sm overflow-auto max-h-64 text-gray-700 dark:bg-gray-700 dark:text-gray-300"></pre>
</div>
<div id="loadingIndicator" class="mt-4 text-center hidden">
<div class="animate-spin rounded-full h-8 w-8 border-b-2 border-blue-500 mx-auto"></div>
<p class="text-gray-600 mt-2 dark:text-gray-400">Processing...</p>
</div>
</div>
<footer class="mt-8 text-center text-gray-600 text-sm w-full max-w-xl dark:text-gray-400">
<p>© 2025 Farmlabs. Secure Edition v3.1 with D3 Heatmap</p>
</footer>
<!-- Commit Preview Modal -->
<div id="commitPreviewModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden" role="dialog" aria-labelledby="modalTitle" aria-modal="true">
<div class="bg-white rounded-xl shadow-xl p-6 w-full max-w-md dark:bg-gray-800 dark:text-white">
<h2 id="modalTitle" class="text-xl font-bold mb-2">Preview Commit</h2>
<div class="mb-4 text-sm">
<p class="text-gray-600 dark:text-gray-400"><strong>Repository:</strong> <span id="previewRepo"></span></p>
<p class="text-gray-600 dark:text-gray-400"><strong>Branch:</strong> <span id="previewBranch"></span></p>
<p class="text-gray-600 dark:text-gray-400"><strong>File Path:</strong> <span id="previewFilePath"></span></p>
<p class="text-gray-600 dark:text-gray-400"><strong>Message:</strong></p>
<textarea id="previewCommitMessage"
class="w-full border border-gray-300 rounded p-2 mb-2 text-gray-800 dark:bg-gray-700 dark:border-gray-600 dark:text-white"
rows="3"
aria-label="Edit commit message"></textarea>
<p class="text-gray-600 dark:text-gray-400"><strong>Content Snippet:</strong></p>
<textarea id="previewContentSnippet"
class="w-full border border-gray-300 rounded p-2 text-gray-800 dark:bg-gray-700 dark:border-gray-600 dark:text-white"
rows="5"
readonly
aria-label="Preview of commit content"></textarea>
<p id="previewCountdown" class="text-center text-gray-500 mt-2 dark:text-gray-400" role="status" aria-live="polite"></p>
</div>
<div class="flex justify-end space-x-2">
<button onclick="cancelCommitPreview()"
aria-label="Cancel commit"
class="bg-gray-200 text-gray-800 px-4 py-2 rounded-md font-semibold hover:bg-gray-300 focus:outline-none focus:ring-2 focus:ring-gray-400 transition duration-300 ease-in-out dark:bg-gray-700 dark:text-gray-200 dark:hover:bg-gray-600">Cancel</button>
<button onclick="confirmCommitPreview()"
aria-label="Confirm and execute commit"
class="bg-blue-600 text-white px-4 py-2 rounded-md font-semibold hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 transition duration-300 ease-in-out shadow-md">Commit</button>
</div>
</div>
</div>
<script src="app.js"></script>
</body>
</html>