Spaces:
Running
Running
File size: 25,091 Bytes
90670f0 | 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 451 452 453 454 455 456 457 458 459 460 461 462 463 | <!DOCTYPE html>
<html lang="ar" dir="rtl">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>تقنية بومودورو لإدارة الوقت</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=Tajawal:wght@400;500;700;900&display=swap');
body {
font-family: 'Tajawal', sans-serif;
background-color: #f8fafc;
}
.progress-ring__circle {
transition: stroke-dashoffset 0.35s;
transform: rotate(-90deg);
transform-origin: 50% 50%;
}
.flip-animation {
animation: flip 0.5s ease;
}
@keyframes flip {
0% { transform: rotateX(0deg); }
50% { transform: rotateX(90deg); }
100% { transform: rotateX(0deg); }
}
.pulse-animation {
animation: pulse 1.5s infinite;
}
@keyframes pulse {
0% { transform: scale(1); }
50% { transform: scale(1.05); }
100% { transform: scale(1); }
}
</style>
</head>
<body class="min-h-screen bg-gray-50">
<div class="container mx-auto px-4 py-8">
<header class="text-center mb-12">
<h1 class="text-4xl font-bold text-indigo-800 mb-2">تقنية بومودورو</h1>
<p class="text-lg text-gray-600">طريقة فعالة لزيادة الإنتاجية وإدارة الوقت</p>
</header>
<div class="max-w-3xl mx-auto bg-white rounded-xl shadow-lg overflow-hidden">
<!-- Timer Section -->
<div class="p-8 bg-gradient-to-r from-indigo-500 to-purple-600 text-white">
<div class="flex justify-between items-center mb-6">
<h2 class="text-2xl font-semibold">عداد بومودورو</h2>
<div id="session-count" class="bg-white text-indigo-600 px-3 py-1 rounded-full text-sm font-bold">
جلسة: 0
</div>
</div>
<div class="flex flex-col items-center">
<!-- Timer Circle -->
<div class="relative w-64 h-64 mb-8">
<svg class="w-full h-full" viewBox="0 0 100 100">
<circle cx="50" cy="50" r="45" fill="none" stroke="#ffffff20" stroke-width="8"/>
<circle id="progress-circle" cx="50" cy="50" r="45" fill="none" stroke="#ffffff" stroke-width="8" stroke-dasharray="283" stroke-dashoffset="0" class="progress-ring__circle"/>
</svg>
<div class="absolute inset-0 flex flex-col items-center justify-center">
<div id="timer-display" class="text-5xl font-bold mb-2">25:00</div>
<div id="timer-state" class="text-lg">جاهز للبدء</div>
</div>
</div>
<!-- Timer Controls -->
<div class="flex space-x-4 space-x-reverse">
<button id="start-btn" class="bg-white text-indigo-600 px-6 py-2 rounded-full font-bold hover:bg-gray-100 transition">
<i class="fas fa-play mr-2"></i> بدء
</button>
<button id="pause-btn" class="bg-white text-indigo-600 px-6 py-2 rounded-full font-bold hover:bg-gray-100 transition hidden">
<i class="fas fa-pause mr-2"></i> إيقاف مؤقت
</button>
<button id="reset-btn" class="bg-indigo-800 text-white px-6 py-2 rounded-full font-bold hover:bg-indigo-900 transition">
<i class="fas fa-redo mr-2"></i> إعادة تعيين
</button>
</div>
</div>
</div>
<!-- Settings Section -->
<div class="p-8">
<h2 class="text-2xl font-semibold text-gray-800 mb-6">إعدادات التوقيت</h2>
<div class="grid grid-cols-1 md:grid-cols-2 gap-6 mb-8">
<div class="bg-gray-50 p-4 rounded-lg">
<label for="work-duration" class="block text-gray-700 font-medium mb-2">مدة العمل (دقائق)</label>
<div class="flex items-center">
<button id="work-decrement" class="bg-gray-200 text-gray-700 px-3 py-1 rounded-r-lg hover:bg-gray-300">
<i class="fas fa-minus"></i>
</button>
<input type="number" id="work-duration" min="1" max="60" value="25" class="w-full text-center bg-white border-t border-b border-gray-200 py-1 px-2">
<button id="work-increment" class="bg-gray-200 text-gray-700 px-3 py-1 rounded-l-lg hover:bg-gray-300">
<i class="fas fa-plus"></i>
</button>
</div>
</div>
<div class="bg-gray-50 p-4 rounded-lg">
<label for="break-duration" class="block text-gray-700 font-medium mb-2">مدة الراحة (دقائق)</label>
<div class="flex items-center">
<button id="break-decrement" class="bg-gray-200 text-gray-700 px-3 py-1 rounded-r-lg hover:bg-gray-300">
<i class="fas fa-minus"></i>
</button>
<input type="number" id="break-duration" min="1" max="30" value="5" class="w-full text-center bg-white border-t border-b border-gray-200 py-1 px-2">
<button id="break-increment" class="bg-gray-200 text-gray-700 px-3 py-1 rounded-l-lg hover:bg-gray-300">
<i class="fas fa-plus"></i>
</button>
</div>
</div>
<div class="bg-gray-50 p-4 rounded-lg">
<label for="long-break-duration" class="block text-gray-700 font-medium mb-2">مدة الراحة الطويلة (دقائق)</label>
<div class="flex items-center">
<button id="long-break-decrement" class="bg-gray-200 text-gray-700 px-3 py-1 rounded-r-lg hover:bg-gray-300">
<i class="fas fa-minus"></i>
</button>
<input type="number" id="long-break-duration" min="1" max="60" value="15" class="w-full text-center bg-white border-t border-b border-gray-200 py-1 px-2">
<button id="long-break-increment" class="bg-gray-200 text-gray-700 px-3 py-1 rounded-l-lg hover:bg-gray-300">
<i class="fas fa-plus"></i>
</button>
</div>
</div>
<div class="bg-gray-50 p-4 rounded-lg">
<label for="sessions-before-long-break" class="block text-gray-700 font-medium mb-2">عدد الجلسات قبل الراحة الطويلة</label>
<div class="flex items-center">
<button id="sessions-decrement" class="bg-gray-200 text-gray-700 px-3 py-1 rounded-r-lg hover:bg-gray-300">
<i class="fas fa-minus"></i>
</button>
<input type="number" id="sessions-before-long-break" min="1" max="10" value="4" class="w-full text-center bg-white border-t border-b border-gray-200 py-1 px-2">
<button id="sessions-increment" class="bg-gray-200 text-gray-700 px-3 py-1 rounded-l-lg hover:bg-gray-300">
<i class="fas fa-plus"></i>
</button>
</div>
</div>
</div>
<div class="flex justify-center">
<button id="save-settings" class="bg-indigo-600 text-white px-6 py-2 rounded-full font-bold hover:bg-indigo-700 transition">
<i class="fas fa-save mr-2"></i> حفظ الإعدادات
</button>
</div>
</div>
<!-- Task List Section -->
<div class="p-8 border-t border-gray-200">
<h2 class="text-2xl font-semibold text-gray-800 mb-6">قائمة المهام</h2>
<div class="mb-6 flex">
<input type="text" id="task-input" placeholder="أضف مهمة جديدة..." class="flex-1 border border-gray-300 rounded-r-lg px-4 py-2 focus:outline-none focus:ring-2 focus:ring-indigo-500">
<button id="add-task" class="bg-indigo-600 text-white px-4 py-2 rounded-l-lg hover:bg-indigo-700 transition">
<i class="fas fa-plus"></i>
</button>
</div>
<ul id="task-list" class="divide-y divide-gray-200">
<!-- Tasks will be added here dynamically -->
</ul>
</div>
</div>
<!-- Info Section -->
<div class="max-w-3xl mx-auto mt-12 bg-white rounded-xl shadow-lg overflow-hidden p-8">
<h2 class="text-2xl font-semibold text-gray-800 mb-4">ما هي تقنية بومودورو؟</h2>
<p class="text-gray-600 mb-4">
تقنية بومودورو هي طريقة لإدارة الوقت طورها فرانشيسكو سيريلو في أواخر الثمانينيات. تعتمد هذه التقنية على تقسيم العمل إلى فترات زمنية مدتها 25 دقيقة (تسمى "بومودورو") تفصل بينها فترات راحة قصيرة.
</p>
<h3 class="text-xl font-semibold text-gray-800 mb-2">كيف تعمل:</h3>
<ol class="list-decimal list-inside text-gray-600 space-y-2">
<li>اختر المهمة التي تريد إنجازها</li>
<li>اضبط المؤقت على 25 دقيقة</li>
<li>اعمل على المهمة حتى يرن المؤقت</li>
<li>خذ استراحة قصيرة (5 دقائق)</li>
<li>بعد كل 4 جلسات عمل، خذ استراحة أطول (15-30 دقيقة)</li>
</ol>
</div>
</div>
<!-- Audio for alerts -->
<audio id="timer-end-sound" src="https://assets.mixkit.co/sfx/preview/mixkit-alarm-digital-clock-beep-989.mp3"></audio>
<audio id="break-end-sound" src="https://assets.mixkit.co/sfx/preview/mixkit-positive-interface-beep-221.mp3"></audio>
<script>
document.addEventListener('DOMContentLoaded', function() {
// DOM Elements
const timerDisplay = document.getElementById('timer-display');
const timerState = document.getElementById('timer-state');
const sessionCount = document.getElementById('session-count');
const progressCircle = document.getElementById('progress-circle');
const startBtn = document.getElementById('start-btn');
const pauseBtn = document.getElementById('pause-btn');
const resetBtn = document.getElementById('reset-btn');
// Timer Settings Elements
const workDurationInput = document.getElementById('work-duration');
const breakDurationInput = document.getElementById('break-duration');
const longBreakDurationInput = document.getElementById('long-break-duration');
const sessionsBeforeLongBreakInput = document.getElementById('sessions-before-long-break');
// Task List Elements
const taskInput = document.getElementById('task-input');
const addTaskBtn = document.getElementById('add-task');
const taskList = document.getElementById('task-list');
// Audio Elements
const timerEndSound = document.getElementById('timer-end-sound');
const breakEndSound = document.getElementById('break-end-sound');
// Timer Variables
let timer;
let timeLeft = 25 * 60; // 25 minutes in seconds
let isRunning = false;
let isWorkTime = true;
let sessionsCompleted = 0;
let totalSeconds;
let circumference = 2 * Math.PI * 45;
// Initialize timer display
updateTimerDisplay();
// Event Listeners
startBtn.addEventListener('click', startTimer);
pauseBtn.addEventListener('click', pauseTimer);
resetBtn.addEventListener('click', resetTimer);
// Settings increment/decrement buttons
document.getElementById('work-increment').addEventListener('click', () => adjustValue(workDurationInput, 1));
document.getElementById('work-decrement').addEventListener('click', () => adjustValue(workDurationInput, -1));
document.getElementById('break-increment').addEventListener('click', () => adjustValue(breakDurationInput, 1));
document.getElementById('break-decrement').addEventListener('click', () => adjustValue(breakDurationInput, -1));
document.getElementById('long-break-increment').addEventListener('click', () => adjustValue(longBreakDurationInput, 1));
document.getElementById('long-break-decrement').addEventListener('click', () => adjustValue(longBreakDurationInput, -1));
document.getElementById('sessions-increment').addEventListener('click', () => adjustValue(sessionsBeforeLongBreakInput, 1));
document.getElementById('sessions-decrement').addEventListener('click', () => adjustValue(sessionsBeforeLongBreakInput, -1));
// Save settings
document.getElementById('save-settings').addEventListener('click', saveSettings);
// Task list functionality
addTaskBtn.addEventListener('click', addTask);
taskInput.addEventListener('keypress', function(e) {
if (e.key === 'Enter') {
addTask();
}
});
// Functions
function startTimer() {
if (!isRunning) {
isRunning = true;
startBtn.classList.add('hidden');
pauseBtn.classList.remove('hidden');
if (timeLeft === totalSeconds || timeLeft === 0) {
// Starting fresh
timeLeft = isWorkTime ? parseInt(workDurationInput.value) * 60 :
(sessionsCompleted % parseInt(sessionsBeforeLongBreakInput.value) === 0 ?
parseInt(longBreakDurationInput.value) * 60 :
parseInt(breakDurationInput.value) * 60);
totalSeconds = timeLeft;
updateProgressCircle();
}
timer = setInterval(() => {
timeLeft--;
updateTimerDisplay();
updateProgressCircle();
if (timeLeft <= 0) {
clearInterval(timer);
timerComplete();
}
}, 1000);
}
}
function pauseTimer() {
if (isRunning) {
clearInterval(timer);
isRunning = false;
startBtn.classList.remove('hidden');
pauseBtn.classList.add('hidden');
}
}
function resetTimer() {
clearInterval(timer);
isRunning = false;
startBtn.classList.remove('hidden');
pauseBtn.classList.add('hidden');
isWorkTime = true;
timeLeft = parseInt(workDurationInput.value) * 60;
totalSeconds = timeLeft;
updateTimerDisplay();
updateProgressCircle();
timerState.textContent = 'جاهز للبدء';
// Reset session count if it's a fresh start
if (timeLeft === parseInt(workDurationInput.value) * 60) {
sessionsCompleted = 0;
updateSessionCount();
}
}
function timerComplete() {
if (isWorkTime) {
// Work session completed
timerEndSound.play();
sessionsCompleted++;
updateSessionCount();
isWorkTime = false;
// Determine break type
const isLongBreak = sessionsCompleted % parseInt(sessionsBeforeLongBreakInput.value) === 0;
timeLeft = isLongBreak ? parseInt(longBreakDurationInput.value) * 60 : parseInt(breakDurationInput.value) * 60;
totalSeconds = timeLeft;
timerState.textContent = isLongBreak ? 'وقت الراحة الطويلة!' : 'وقت الراحة!';
timerState.classList.add('text-green-500', 'flip-animation');
setTimeout(() => timerState.classList.remove('flip-animation'), 500);
} else {
// Break completed
breakEndSound.play();
isWorkTime = true;
timeLeft = parseInt(workDurationInput.value) * 60;
totalSeconds = timeLeft;
timerState.textContent = 'وقت العمل!';
timerState.classList.add('text-indigo-500', 'flip-animation');
setTimeout(() => timerState.classList.remove('flip-animation'), 500);
}
updateTimerDisplay();
updateProgressCircle();
// Auto-start next session if enabled
startTimer();
}
function updateTimerDisplay() {
const minutes = Math.floor(timeLeft / 60);
const seconds = timeLeft % 60;
timerDisplay.textContent = `${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}`;
// Add pulse animation when time is running low
if (timeLeft <= 10 && isRunning) {
timerDisplay.classList.add('pulse-animation', 'text-red-500');
} else {
timerDisplay.classList.remove('pulse-animation', 'text-red-500');
}
}
function updateProgressCircle() {
const offset = circumference - (timeLeft / totalSeconds) * circumference;
progressCircle.style.strokeDashoffset = offset;
}
function updateSessionCount() {
sessionCount.textContent = `جلسة: ${sessionsCompleted}`;
sessionCount.classList.add('flip-animation');
setTimeout(() => sessionCount.classList.remove('flip-animation'), 500);
}
function adjustValue(input, change) {
let value = parseInt(input.value) + change;
const min = parseInt(input.min);
const max = parseInt(input.max);
if (value < min) value = min;
if (value > max) value = max;
input.value = value;
}
function saveSettings() {
// Just update the timer if it's not running
if (!isRunning) {
if (isWorkTime) {
timeLeft = parseInt(workDurationInput.value) * 60;
totalSeconds = timeLeft;
} else {
timeLeft = (sessionsCompleted % parseInt(sessionsBeforeLongBreakInput.value) === 0 ?
parseInt(longBreakDurationInput.value) * 60 :
parseInt(breakDurationInput.value) * 60);
totalSeconds = timeLeft;
}
updateTimerDisplay();
updateProgressCircle();
}
// Show confirmation
const saveBtn = document.getElementById('save-settings');
saveBtn.innerHTML = '<i class="fas fa-check mr-2"></i> تم الحفظ!';
saveBtn.classList.remove('bg-indigo-600', 'hover:bg-indigo-700');
saveBtn.classList.add('bg-green-500', 'hover:bg-green-600');
setTimeout(() => {
saveBtn.innerHTML = '<i class="fas fa-save mr-2"></i> حفظ الإعدادات';
saveBtn.classList.remove('bg-green-500', 'hover:bg-green-600');
saveBtn.classList.add('bg-indigo-600', 'hover:bg-indigo-700');
}, 2000);
}
function addTask() {
const taskText = taskInput.value.trim();
if (taskText) {
const taskItem = document.createElement('li');
taskItem.className = 'py-3 flex items-center justify-between';
taskItem.innerHTML = `
<div class="flex items-center">
<input type="checkbox" class="mr-3 h-5 w-5 text-indigo-600 rounded focus:ring-indigo-500">
<span class="text-gray-800">${taskText}</span>
</div>
<button class="text-red-500 hover:text-red-700">
<i class="fas fa-trash"></i>
</button>
`;
// Add event listeners for the new task
const checkbox = taskItem.querySelector('input[type="checkbox"]');
const deleteBtn = taskItem.querySelector('button');
checkbox.addEventListener('change', function() {
const taskTextElement = this.nextElementSibling;
if (this.checked) {
taskTextElement.classList.add('line-through', 'text-gray-400');
} else {
taskTextElement.classList.remove('line-through', 'text-gray-400');
}
});
deleteBtn.addEventListener('click', function() {
taskItem.remove();
});
taskList.appendChild(taskItem);
taskInput.value = '';
// Add animation
taskItem.classList.add('animate-fade-in');
}
}
// Initialize with work duration
timeLeft = parseInt(workDurationInput.value) * 60;
totalSeconds = timeLeft;
updateTimerDisplay();
updateProgressCircle();
});
</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=TheLoop404/pomo" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html> |