Spaces:
Running
Running
its broken - please debug the complete project - Follow Up Deployment
Browse files- index.html +104 -6
- prompts.txt +26 -1
index.html
CHANGED
|
@@ -19,6 +19,28 @@
|
|
| 19 |
}
|
| 20 |
.time-display {
|
| 21 |
font-family: 'SF Mono', monospace;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
}
|
| 23 |
.sheet-row {
|
| 24 |
border-bottom: 1px solid #e5e7eb;
|
|
@@ -72,9 +94,14 @@
|
|
| 72 |
<section>
|
| 73 |
<div class="flex justify-between items-center mb-4">
|
| 74 |
<h2 class="text-xl font-medium text-gray-800">Time Sheet</h2>
|
| 75 |
-
<
|
| 76 |
-
<
|
| 77 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 78 |
</div>
|
| 79 |
<div class="bg-white rounded-xl shadow-sm overflow-hidden">
|
| 80 |
<div class="grid grid-cols-12 bg-gray-50 p-4 border-b border-gray-200">
|
|
@@ -145,8 +172,11 @@
|
|
| 145 |
// Clear form
|
| 146 |
timerForm.reset();
|
| 147 |
});
|
|
|
|
|
|
|
| 148 |
|
| 149 |
clearSheetBtn.addEventListener('click', function() {
|
|
|
|
| 150 |
if (confirm('Are you sure you want to clear all time entries?')) {
|
| 151 |
timeEntries = [];
|
| 152 |
localStorage.setItem('timeEntries', JSON.stringify(timeEntries));
|
|
@@ -169,8 +199,25 @@
|
|
| 169 |
timerTitle.textContent = `${timer.client} / ${timer.project} / ${timer.task}`;
|
| 170 |
|
| 171 |
const timerTime = document.createElement('div');
|
| 172 |
-
timerTime.className = 'time-display text-
|
| 173 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 174 |
|
| 175 |
timerInfo.appendChild(timerTitle);
|
| 176 |
timerInfo.appendChild(timerTime);
|
|
@@ -223,7 +270,11 @@
|
|
| 223 |
timer.elapsed += 1;
|
| 224 |
const timerElement = document.querySelector(`[data-timer-id="${timerId}"]`);
|
| 225 |
if (timerElement) {
|
| 226 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 227 |
}
|
| 228 |
}, 1000);
|
| 229 |
|
|
@@ -268,6 +319,53 @@
|
|
| 268 |
renderTimeSheet();
|
| 269 |
}
|
| 270 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 271 |
function renderTimeSheet() {
|
| 272 |
timeSheetContainer.innerHTML = '';
|
| 273 |
|
|
|
|
| 19 |
}
|
| 20 |
.time-display {
|
| 21 |
font-family: 'SF Mono', monospace;
|
| 22 |
+
font-size: 3rem;
|
| 23 |
+
font-weight: 300;
|
| 24 |
+
display: flex;
|
| 25 |
+
gap: 0.25rem;
|
| 26 |
+
}
|
| 27 |
+
.time-segment {
|
| 28 |
+
background: #f3f4f6;
|
| 29 |
+
border-radius: 0.5rem;
|
| 30 |
+
padding: 0.5rem 0.75rem;
|
| 31 |
+
box-shadow: 0 2px 4px rgba(0,0,0,0.05);
|
| 32 |
+
position: relative;
|
| 33 |
+
overflow: hidden;
|
| 34 |
+
}
|
| 35 |
+
.time-segment::before {
|
| 36 |
+
content: '';
|
| 37 |
+
position: absolute;
|
| 38 |
+
top: 0;
|
| 39 |
+
left: 0;
|
| 40 |
+
right: 0;
|
| 41 |
+
height: 50%;
|
| 42 |
+
background: rgba(255,255,255,0.2);
|
| 43 |
+
border-bottom: 1px solid rgba(0,0,0,0.05);
|
| 44 |
}
|
| 45 |
.sheet-row {
|
| 46 |
border-bottom: 1px solid #e5e7eb;
|
|
|
|
| 94 |
<section>
|
| 95 |
<div class="flex justify-between items-center mb-4">
|
| 96 |
<h2 class="text-xl font-medium text-gray-800">Time Sheet</h2>
|
| 97 |
+
<div class="flex space-x-2">
|
| 98 |
+
<button id="clear-sheet" class="text-sm text-gray-500 hover:text-gray-700 flex items-center">
|
| 99 |
+
<i data-feather="trash-2" class="w-4 h-4 mr-1"></i> Clear All
|
| 100 |
+
</button>
|
| 101 |
+
<button id="daily-close" class="text-sm text-red-500 hover:text-red-700 flex items-center">
|
| 102 |
+
<i data-feather="file-text" class="w-4 h-4 mr-1"></i> Daily Closing
|
| 103 |
+
</button>
|
| 104 |
+
</div>
|
| 105 |
</div>
|
| 106 |
<div class="bg-white rounded-xl shadow-sm overflow-hidden">
|
| 107 |
<div class="grid grid-cols-12 bg-gray-50 p-4 border-b border-gray-200">
|
|
|
|
| 172 |
// Clear form
|
| 173 |
timerForm.reset();
|
| 174 |
});
|
| 175 |
+
|
| 176 |
+
document.getElementById('daily-close').addEventListener('click', generateDailyReport);
|
| 177 |
|
| 178 |
clearSheetBtn.addEventListener('click', function() {
|
| 179 |
+
if (timeEntries.length === 0) return;
|
| 180 |
if (confirm('Are you sure you want to clear all time entries?')) {
|
| 181 |
timeEntries = [];
|
| 182 |
localStorage.setItem('timeEntries', JSON.stringify(timeEntries));
|
|
|
|
| 199 |
timerTitle.textContent = `${timer.client} / ${timer.project} / ${timer.task}`;
|
| 200 |
|
| 201 |
const timerTime = document.createElement('div');
|
| 202 |
+
timerTime.className = 'time-display text-gray-700 mt-2';
|
| 203 |
+
|
| 204 |
+
const formattedTime = formatTime(timer.elapsed).split(':');
|
| 205 |
+
['hours', 'minutes', 'seconds'].forEach((unit, index) => {
|
| 206 |
+
const segment = document.createElement('div');
|
| 207 |
+
segment.className = 'flex flex-col items-center';
|
| 208 |
+
|
| 209 |
+
const label = document.createElement('div');
|
| 210 |
+
label.className = 'text-xs text-gray-500 uppercase mt-1';
|
| 211 |
+
label.textContent = unit;
|
| 212 |
+
|
| 213 |
+
const value = document.createElement('div');
|
| 214 |
+
value.className = 'time-segment';
|
| 215 |
+
value.textContent = formattedTime[index];
|
| 216 |
+
|
| 217 |
+
segment.appendChild(value);
|
| 218 |
+
segment.appendChild(label);
|
| 219 |
+
timerTime.appendChild(segment);
|
| 220 |
+
});
|
| 221 |
|
| 222 |
timerInfo.appendChild(timerTitle);
|
| 223 |
timerInfo.appendChild(timerTime);
|
|
|
|
| 270 |
timer.elapsed += 1;
|
| 271 |
const timerElement = document.querySelector(`[data-timer-id="${timerId}"]`);
|
| 272 |
if (timerElement) {
|
| 273 |
+
const formattedTime = formatTime(timer.elapsed).split(':');
|
| 274 |
+
const segments = timerElement.parentElement.querySelectorAll('.time-segment');
|
| 275 |
+
segments.forEach((segment, index) => {
|
| 276 |
+
segment.textContent = formattedTime[index];
|
| 277 |
+
});
|
| 278 |
}
|
| 279 |
}, 1000);
|
| 280 |
|
|
|
|
| 319 |
renderTimeSheet();
|
| 320 |
}
|
| 321 |
|
| 322 |
+
function generateDailyReport() {
|
| 323 |
+
if (timeEntries.length === 0) {
|
| 324 |
+
alert('No time entries to generate report');
|
| 325 |
+
return;
|
| 326 |
+
}
|
| 327 |
+
|
| 328 |
+
// Group by client
|
| 329 |
+
const clients = {};
|
| 330 |
+
timeEntries.forEach(entry => {
|
| 331 |
+
const clientKey = entry.client.substring(0, 3).toUpperCase();
|
| 332 |
+
if (!clients[clientKey]) {
|
| 333 |
+
clients[clientKey] = [];
|
| 334 |
+
}
|
| 335 |
+
clients[clientKey].push(entry);
|
| 336 |
+
});
|
| 337 |
+
|
| 338 |
+
// Generate report text
|
| 339 |
+
let reportText = '';
|
| 340 |
+
let grandTotalSeconds = 0;
|
| 341 |
+
|
| 342 |
+
Object.entries(clients).forEach(([clientKey, entries]) => {
|
| 343 |
+
reportText += `${clientKey}\n-----\n`;
|
| 344 |
+
|
| 345 |
+
let clientTotalSeconds = 0;
|
| 346 |
+
entries.forEach(entry => {
|
| 347 |
+
reportText += `${entry.client} / ${entry.project} / ${entry.task} / ${formatTime(entry.duration)} / ${entry.date}\n`;
|
| 348 |
+
clientTotalSeconds += entry.duration;
|
| 349 |
+
});
|
| 350 |
+
|
| 351 |
+
grandTotalSeconds += clientTotalSeconds;
|
| 352 |
+
reportText += `_____\nTotal Time: ${formatTime(clientTotalSeconds)}\n-----\n`;
|
| 353 |
+
});
|
| 354 |
+
|
| 355 |
+
reportText += `\nGRAND TOTAL: ${formatTime(grandTotalSeconds)}`;
|
| 356 |
+
|
| 357 |
+
// Create download
|
| 358 |
+
const blob = new Blob([reportText], { type: 'text/plain' });
|
| 359 |
+
const url = URL.createObjectURL(blob);
|
| 360 |
+
const a = document.createElement('a');
|
| 361 |
+
a.href = url;
|
| 362 |
+
a.download = `time_report_${new Date().toISOString().split('T')[0]}.txt`;
|
| 363 |
+
document.body.appendChild(a);
|
| 364 |
+
a.click();
|
| 365 |
+
document.body.removeChild(a);
|
| 366 |
+
URL.revokeObjectURL(url);
|
| 367 |
+
}
|
| 368 |
+
|
| 369 |
function renderTimeSheet() {
|
| 370 |
timeSheetContainer.innerHTML = '';
|
| 371 |
|
prompts.txt
CHANGED
|
@@ -1 +1,26 @@
|
|
| 1 |
-
create a web app that has multiple timers to start pause and stop time for different projects - it should be designed very minimal well like a apple homepage design - i should be able to create instantly new timers on that page by creating new tasks by entering / Client / Project / Work / and the counted time should be stored in a sheet with date / time / once i stop the timer
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
create a web app that has multiple timers to start pause and stop time for different projects - it should be designed very minimal well like a apple homepage design - i should be able to create instantly new timers on that page by creating new tasks by entering / Client / Project / Work / and the counted time should be stored in a sheet with date / time / once i stop the timer
|
| 2 |
+
can you change the style of the counter to an Analog counter like a flip clock and also make the numbers much bigger
|
| 3 |
+
create an "DAILY CLOSING" micro-button in red next to the clear all bin in the time sheet
|
| 4 |
+
this button should safe the time sheet data and calculate the sum of each client project tracked during the session and store the result in an TXT Document like this:
|
| 5 |
+
CLI (first 3 Letters of Client Name)
|
| 6 |
+
-----
|
| 7 |
+
Client Name / Project / TASK / DURATION / DATE TOTAL TIME
|
| 8 |
+
Client Name / Project / TASK / DURATION / DATE TOTAL TIME
|
| 9 |
+
Client Name / Project / TASK / DURATION / DATE TOTAL TIME
|
| 10 |
+
_____
|
| 11 |
+
Total Time:
|
| 12 |
+
-----
|
| 13 |
+
CLI (first 3 Letters of Client Name)
|
| 14 |
+
-----
|
| 15 |
+
Client Name / Project / TASK / DURATION / DATE TOTAL TIME
|
| 16 |
+
Client Name / Project / TASK / DURATION / DATE TOTAL TIME
|
| 17 |
+
Client Name / Project / TASK / DURATION / DATE TOTAL TIME
|
| 18 |
+
_____
|
| 19 |
+
Total Time:
|
| 20 |
+
-----
|
| 21 |
+
and so on
|
| 22 |
+
the file will be downloaded automaticly after the process
|
| 23 |
+
can you add a possibility to edit the values in the time sheet?
|
| 24 |
+
cant find it. please add another task next to Clear all that should let you "edit" the time table to change values before closing the day - use a edit icon
|
| 25 |
+
the timer is now not working anymore
|
| 26 |
+
its broken - please debug the complete project
|