File size: 16,540 Bytes
1f513c3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Photoshop Task Timer</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>
        @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
        
        body {
            font-family: 'Inter', sans-serif;
            background-color: #1a1a2e;
        }
        
        .photoshop-gradient {
            background: linear-gradient(135deg, #31a8ff 0%, #1473e6 50%, #0d4599 100%);
        }
        
        .task-card {
            transition: all 0.3s ease;
            border-left: 4px solid #31a8ff;
        }
        
        .task-card:hover {
            transform: translateY(-2px);
            box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
        }
        
        .timer-display {
            font-family: 'Courier New', monospace;
            letter-spacing: 2px;
        }
        
        .blink {
            animation: blink 1s infinite;
        }
        
        @keyframes blink {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.5; }
        }
        
        input[type="time"]::-webkit-calendar-picker-indicator {
            filter: invert(1);
            cursor: pointer;
        }
    </style>
</head>
<body class="min-h-screen text-white">
    <div class="container mx-auto px-4 py-8 max-w-4xl">
        <header class="flex items-center justify-between mb-10">
            <div class="flex items-center">
                <i class="fas fa-stopwatch text-3xl mr-3 text-blue-400"></i>
                <h1 class="text-3xl font-bold">Photoshop Task Timer</h1>
            </div>
            <div class="flex items-center space-x-2">
                <span id="current-date" class="text-gray-300"></span>
                <span id="current-time" class="font-mono bg-gray-800 px-3 py-1 rounded-lg"></span>
            </div>
        </header>
        
        <div class="grid grid-cols-1 md:grid-cols-3 gap-6 mb-8">
            <!-- Timer Controls -->
            <div class="photoshop-gradient p-6 rounded-xl shadow-lg col-span-1">
                <h2 class="text-xl font-semibold mb-4">Set Timer</h2>
                <div class="space-y-4">
                    <div>
                        <label for="task-name" class="block text-sm font-medium mb-1">Task Name</label>
                        <input type="text" id="task-name" placeholder="e.g. Photo Retouching" 
                               class="w-full bg-gray-800 bg-opacity-50 border border-gray-700 rounded-lg px-4 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400">
                    </div>
                    <div>
                        <label for="duration" class="block text-sm font-medium mb-1">Duration</label>
                        <input type="time" id="duration" value="00:30" step="60" 
                               class="w-full bg-gray-800 bg-opacity-50 border border-gray-700 rounded-lg px-4 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400">
                    </div>
                    <button id="start-timer" class="w-full bg-white text-blue-600 font-bold py-2 px-4 rounded-lg hover:bg-gray-100 transition">
                        <i class="fas fa-play mr-2"></i> Start Task
                    </button>
                </div>
            </div>
            
            <!-- Active Timer Display -->
            <div class="bg-gray-800 p-6 rounded-xl shadow-lg col-span-2">
                <h2 class="text-xl font-semibold mb-4">Current Task</h2>
                <div id="active-timer-display" class="text-center py-8">
                    <div id="no-active-timer" class="text-gray-400">
                        <i class="fas fa-clock text-4xl mb-3"></i>
                        <p>No active timer</p>
                    </div>
                    <div id="timer-running" class="hidden">
                        <h3 id="current-task-name" class="text-xl font-medium mb-2"></h3>
                        <div class="timer-display text-5xl font-bold mb-6" id="countdown">00:30:00</div>
                        <div class="flex justify-center space-x-3">
                            <button id="pause-timer" class="bg-yellow-500 text-white py-2 px-6 rounded-lg hover:bg-yellow-600 transition">
                                <i class="fas fa-pause mr-2"></i> Pause
                            </button>
                            <button id="stop-timer" class="bg-red-500 text-white py-2 px-6 rounded-lg hover:bg-red-600 transition">
                                <i class="fas fa-stop mr-2"></i> Stop
                            </button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        
        <!-- Task History -->
        <div class="bg-gray-800 p-6 rounded-xl shadow-lg">
            <div class="flex justify-between items-center mb-4">
                <h2 class="text-xl font-semibold">Task History</h2>
                <button id="clear-history" class="text-sm text-gray-400 hover:text-white transition">
                    <i class="fas fa-trash-alt mr-1"></i> Clear All
                </button>
            </div>
            <div id="task-history" class="space-y-3">
                <div class="text-center text-gray-500 py-4">
                    <i class="fas fa-history text-2xl mb-2"></i>
                    <p>No tasks completed yet</p>
                </div>
            </div>
        </div>
    </div>

    <script>
        document.addEventListener('DOMContentLoaded', function() {
            // Update current date and time
            function updateDateTime() {
                const now = new Date();
                document.getElementById('current-date').textContent = now.toLocaleDateString('en-US', { 
                    weekday: 'long', 
                    month: 'short', 
                    day: 'numeric' 
                });
                document.getElementById('current-time').textContent = now.toLocaleTimeString('en-US', { 
                    hour: '2-digit', 
                    minute: '2-digit' 
                });
            }
            updateDateTime();
            setInterval(updateDateTime, 1000);
            
            // Timer functionality
            let timerInterval;
            let remainingTime = 0;
            let isPaused = false;
            let currentTask = null;
            let taskHistory = JSON.parse(localStorage.getItem('photoshopTaskHistory')) || [];
            
            // Display task history if exists
            if (taskHistory.length > 0) {
                renderTaskHistory();
            }
            
            // Start timer
            document.getElementById('start-timer').addEventListener('click', function() {
                const taskName = document.getElementById('task-name').value.trim() || 'Unnamed Task';
                const durationInput = document.getElementById('duration').value;
                const [hours, minutes] = durationInput.split(':').map(Number);
                
                remainingTime = (hours * 3600) + (minutes * 60);
                
                if (remainingTime <= 0) {
                    alert('Please set a valid duration');
                    return;
                }
                
                currentTask = {
                    name: taskName,
                    duration: remainingTime,
                    startTime: new Date()
                };
                
                document.getElementById('task-name').value = '';
                document.getElementById('no-active-timer').classList.add('hidden');
                document.getElementById('timer-running').classList.remove('hidden');
                document.getElementById('current-task-name').textContent = taskName;
                
                updateTimerDisplay();
                
                if (!isPaused) {
                    timerInterval = setInterval(updateTimer, 1000);
                }
                
                isPaused = false;
            });
            
            // Pause timer
            document.getElementById('pause-timer').addEventListener('click', function() {
                if (isPaused) {
                    timerInterval = setInterval(updateTimer, 1000);
                    this.innerHTML = '<i class="fas fa-pause mr-2"></i> Pause';
                } else {
                    clearInterval(timerInterval);
                    this.innerHTML = '<i class="fas fa-play mr-2"></i> Resume';
                }
                isPaused = !isPaused;
            });
            
            // Stop timer
            document.getElementById('stop-timer').addEventListener('click', function() {
                clearInterval(timerInterval);
                
                if (currentTask) {
                    const endTime = new Date();
                    const timeSpent = currentTask.duration - remainingTime;
                    
                    // Add to history
                    taskHistory.unshift({
                        name: currentTask.name,
                        duration: currentTask.duration,
                        timeSpent: timeSpent,
                        startTime: currentTask.startTime,
                        endTime: endTime,
                        completed: remainingTime <= 0
                    });
                    
                    // Keep only last 10 tasks
                    if (taskHistory.length > 10) {
                        taskHistory = taskHistory.slice(0, 10);
                    }
                    
                    localStorage.setItem('photoshopTaskHistory', JSON.stringify(taskHistory));
                    renderTaskHistory();
                }
                
                resetTimer();
            });
            
            // Clear history
            document.getElementById('clear-history').addEventListener('click', function() {
                if (confirm('Are you sure you want to clear all task history?')) {
                    taskHistory = [];
                    localStorage.removeItem('photoshopTaskHistory');
                    document.getElementById('task-history').innerHTML = `
                        <div class="text-center text-gray-500 py-4">
                            <i class="fas fa-history text-2xl mb-2"></i>
                            <p>No tasks completed yet</p>
                        </div>
                    `;
                }
            });
            
            // Timer functions
            function updateTimer() {
                if (remainingTime > 0) {
                    remainingTime--;
                    updateTimerDisplay();
                    
                    // Flash when 1 minute remaining
                    if (remainingTime === 60) {
                        const display = document.getElementById('countdown');
                        display.classList.add('text-red-400', 'blink');
                    }
                } else {
                    clearInterval(timerInterval);
                    document.getElementById('countdown').textContent = "00:00:00";
                    document.getElementById('countdown').classList.add('text-red-500');
                    
                    // Play completion sound
                    const audio = new Audio('https://assets.mixkit.co/sfx/preview/mixkit-alarm-digital-clock-beep-989.mp3');
                    audio.play();
                    
                    // Show notification
                    if (Notification.permission === 'granted') {
                        new Notification('Photoshop Task Complete', {
                            body: `"${currentTask.name}" timer has finished!`,
                            icon: 'https://upload.wikimedia.org/wikipedia/commons/a/af/Adobe_Photoshop_CC_icon.svg'
                        });
                    }
                }
            }
            
            function updateTimerDisplay() {
                const hours = Math.floor(remainingTime / 3600);
                const minutes = Math.floor((remainingTime % 3600) / 60);
                const seconds = remainingTime % 60;
                
                document.getElementById('countdown').textContent = 
                    `${hours.toString().padStart(2, '0')}:${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}`;
            }
            
            function resetTimer() {
                clearInterval(timerInterval);
                remainingTime = 0;
                currentTask = null;
                isPaused = false;
                
                document.getElementById('no-active-timer').classList.remove('hidden');
                document.getElementById('timer-running').classList.add('hidden');
                document.getElementById('countdown').classList.remove('text-red-400', 'text-red-500', 'blink');
            }
            
            function renderTaskHistory() {
                const historyContainer = document.getElementById('task-history');
                
                if (taskHistory.length === 0) {
                    historyContainer.innerHTML = `
                        <div class="text-center text-gray-500 py-4">
                            <i class="fas fa-history text-2xl mb-2"></i>
                            <p>No tasks completed yet</p>
                        </div>
                    `;
                    return;
                }
                
                historyContainer.innerHTML = taskHistory.map(task => `
                    <div class="task-card bg-gray-700 p-4 rounded-lg hover:bg-gray-600 transition cursor-pointer">
                        <div class="flex justify-between items-center">
                            <div>
                                <h3 class="font-medium">${task.name}</h3>
                                <p class="text-sm text-gray-400">
                                    ${task.startTime.toLocaleString()} - 
                                    ${task.endTime.toLocaleTimeString([], {hour: '2-digit', minute:'2-digit'})}
                                </p>
                            </div>
                            <div class="text-right">
                                <p class="font-mono ${task.completed ? 'text-green-400' : 'text-yellow-400'}">
                                    ${formatTime(task.timeSpent)} / ${formatTime(task.duration)}
                                </p>
                                <p class="text-xs ${task.completed ? 'text-green-300' : 'text-yellow-300'}">
                                    ${task.completed ? 'Completed' : 'Stopped early'}
                                </p>
                            </div>
                        </div>
                    </div>
                `).join('');
            }
            
            function formatTime(seconds) {
                const hours = Math.floor(seconds / 3600);
                const minutes = Math.floor((seconds % 3600) / 60);
                const secs = seconds % 60;
                
                if (hours > 0) {
                    return `${hours}h ${minutes}m`;
                } else if (minutes > 0) {
                    return `${minutes}m ${secs}s`;
                } else {
                    return `${secs}s`;
                }
            }
            
            // Request notification permission
            if (Notification.permission !== 'granted' && Notification.permission !== 'denied') {
                Notification.requestPermission();
            }
        });
    </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=Denito86/tasktime" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html>