Download index.html from halmouss/prudpro: direct link, hf CLI and curl.
- Browser
- Download file 52.6 kB
-
https://huggingface.co/spaces/halmouss/prudpro/resolve/main/index.html
- Command line
-
hf download hf://spaces/halmouss/prudpro/index.html
-
curl -L -o index.html https://huggingface.co/spaces/halmouss/prudpro/resolve/main/index.html
52.6 kB
<!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">
<link href="https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700&display=swap" rel="stylesheet">
<style>
:root {
--primary: #4f46e5;
--primary-light: #6366f1;
--primary-dark: #4338ca;
--secondary: #f59e0b;
--dark: #1e293b;
--light: #f8fafc;
--gray: #94a3b8;
--success: #10b981;
--danger: #ef4444;
}
body {
font-family: 'Tajawal', sans-serif;
background-color: #f1f5f9;
color: var(--dark);
}
.app-container {
max-width: 480px;
margin: 0 auto;
background-color: white;
min-height: 100vh;
box-shadow: 0 0 20px rgba(0,0,0,0.1);
position: relative;
overflow-x: hidden;
}
.nav-item.active {
color: var(--primary);
border-bottom: 2px solid var(--primary);
}
.priority-high {
border-right: 4px solid var(--danger);
}
.priority-medium {
border-right: 4px solid var(--secondary);
}
.priority-low {
border-right: 4px solid var(--success);
}
.task-completed {
opacity: 0.7;
text-decoration: line-through;
}
.progress-bar {
height: 8px;
border-radius: 4px;
background-color: #e2e8f0;
}
.progress-fill {
height: 100%;
border-radius: 4px;
background-color: var(--primary);
transition: width 0.3s ease;
}
.journal-entry {
border-right: 4px solid var(--primary);
}
.slide-in {
animation: slideIn 0.3s forwards;
}
.slide-out {
animation: slideOut 0.3s forwards;
}
@keyframes slideIn {
from { transform: translateX(100%); }
to { transform: translateX(0); }
}
@keyframes slideOut {
from { transform: translateX(0); }
to { transform: translateX(100%); }
}
.fade-in {
animation: fadeIn 0.3s ease-in;
}
@keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}
.custom-scrollbar::-webkit-scrollbar {
width: 6px;
}
.custom-scrollbar::-webkit-scrollbar-track {
background: #f1f1f1;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
background: #cbd5e1;
border-radius: 3px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
background: #94a3b8;
}
/* RTL Adjustments */
[dir="rtl"] .rotate-180 {
transform: rotate(180deg);
}
</style>
</head>
<body>
<div class="app-container">
<!-- Header -->
<header class="bg-white p-4 shadow-sm">
<div class="flex justify-between items-center">
<h1 class="text-2xl font-bold text-indigo-600">برودكتيفيتي برو</h1>
<div class="flex space-x-3">
<button id="searchBtn" class="text-gray-500 hover:text-indigo-600">
<i class="fas fa-search"></i>
</button>
<button id="settingsBtn" class="text-gray-500 hover:text-indigo-600">
<i class="fas fa-cog"></i>
</button>
</div>
</div>
</header>
<!-- Navigation -->
<nav class="flex border-b border-gray-200">
<button data-tab="tasks" class="nav-item flex-1 py-3 text-center font-medium active">
<i class="fas fa-tasks ml-1"></i> المهام
</button>
<button data-tab="journal" class="nav-item flex-1 py-3 text-center font-medium text-gray-500">
<i class="fas fa-book ml-1"></i> اليوميات
</button>
<button data-tab="progress" class="nav-item flex-1 py-3 text-center font-medium text-gray-500">
<i class="fas fa-chart-line ml-1"></i> التقدم
</button>
</nav>
<!-- Main Content -->
<main class="p-4 relative overflow-hidden">
<!-- Tasks Tab -->
<div id="tasksTab" class="tab-content">
<div class="flex justify-between items-center mb-4">
<h2 class="text-xl font-semibold">مهامي</h2>
<button id="addTaskBtn" class="bg-indigo-600 text-white p-2 rounded-full hover:bg-indigo-700 transition">
<i class="fas fa-plus"></i>
</button>
</div>
<div class="mb-4 flex space-x-2 overflow-x-auto pb-2">
<button data-filter="all" class="filter-btn px-3 py-1 bg-indigo-100 text-indigo-700 rounded-full text-sm font-medium active">الكل</button>
<button data-filter="today" class="filter-btn px-3 py-1 bg-gray-100 text-gray-700 rounded-full text-sm font-medium">اليوم</button>
<button data-filter="high" class="filter-btn px-3 py-1 bg-red-100 text-red-700 rounded-full text-sm font-medium">عالي</button>
<button data-filter="medium" class="filter-btn px-3 py-1 bg-amber-100 text-amber-700 rounded-full text-sm font-medium">متوسط</button>
<button data-filter="low" class="filter-btn px-3 py-1 bg-emerald-100 text-emerald-700 rounded-full text-sm font-medium">منخفض</button>
<button data-filter="completed" class="filter-btn px-3 py-1 bg-gray-100 text-gray-700 rounded-full text-sm font-medium">مكتمل</button>
</div>
<div id="taskList" class="space-y-3 max-h-[calc(100vh-220px)] overflow-y-auto custom-scrollbar">
<!-- Tasks will be dynamically added here -->
</div>
</div>
<!-- Journal Tab -->
<div id="journalTab" class="tab-content hidden">
<div class="flex justify-between items-center mb-4">
<h2 class="text-xl font-semibold">يومياتي</h2>
<button id="addEntryBtn" class="bg-indigo-600 text-white p-2 rounded-full hover:bg-indigo-700 transition">
<i class="fas fa-plus"></i>
</button>
</div>
<div id="journalEntries" class="space-y-4 max-h-[calc(100vh-180px)] overflow-y-auto custom-scrollbar">
<!-- Journal entries will be dynamically added here -->
</div>
</div>
<!-- Progress Tab -->
<div id="progressTab" class="tab-content hidden">
<div class="flex justify-between items-center mb-4">
<h2 class="text-xl font-semibold">تقدمي</h2>
<button id="addGoalBtn" class="bg-indigo-600 text-white p-2 rounded-full hover:bg-indigo-700 transition">
<i class="fas fa-plus"></i>
</button>
</div>
<div id="goalsList" class="space-y-4 max-h-[calc(100vh-180px)] overflow-y-auto custom-scrollbar">
<!-- Goals will be dynamically added here -->
</div>
</div>
<!-- Add Task Form (Slide-in) -->
<div id="taskForm" class="absolute top-0 right-0 w-full h-full bg-white p-4 hidden slide-in">
<div class="flex justify-between items-center mb-4">
<h2 class="text-xl font-semibold">إضافة مهمة جديدة</h2>
<button id="closeTaskForm" class="text-gray-500 hover:text-gray-700">
<i class="fas fa-times"></i>
</button>
</div>
<form id="taskFormContent" class="space-y-4">
<div>
<label for="taskTitle" class="block text-sm font-medium text-gray-700 mb-1">العنوان</label>
<input type="text" id="taskTitle" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-indigo-500" required>
</div>
<div>
<label for="taskDescription" class="block text-sm font-medium text-gray-700 mb-1">الوصف (اختياري)</label>
<textarea id="taskDescription" rows="3" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-indigo-500"></textarea>
</div>
<div>
<label for="taskDueDate" class="block text-sm font-medium text-gray-700 mb-1">تاريخ الاستحقاق</label>
<input type="datetime-local" id="taskDueDate" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-indigo-500">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">الأولوية</label>
<div class="flex space-x-4">
<label class="inline-flex items-center">
<input type="radio" name="taskPriority" value="high" class="form-radio text-red-500">
<span class="ml-2">عالي</span>
</label>
<label class="inline-flex items-center">
<input type="radio" name="taskPriority" value="medium" checked class="form-radio text-amber-500">
<span class="ml-2">متوسط</span>
</label>
<label class="inline-flex items-center">
<input type="radio" name="taskPriority" value="low" class="form-radio text-emerald-500">
<span class="ml-2">منخفض</span>
</label>
</div>
</div>
<div class="flex space-x-3 pt-4">
<button type="submit" class="flex-1 bg-indigo-600 text-white py-2 px-4 rounded-md hover:bg-indigo-700 transition">إضافة المهمة</button>
<button type="button" id="cancelTaskForm" class="flex-1 bg-gray-200 text-gray-700 py-2 px-4 rounded-md hover:bg-gray-300 transition">إلغاء</button>
</div>
</form>
</div>
<!-- Add Journal Entry Form (Slide-in) -->
<div id="journalForm" class="absolute top-0 right-0 w-full h-full bg-white p-4 hidden slide-in">
<div class="flex justify-between items-center mb-4">
<h2 class="text-xl font-semibold">يومية جديدة</h2>
<button id="closeJournalForm" class="text-gray-500 hover:text-gray-700">
<i class="fas fa-times"></i>
</button>
</div>
<form id="journalFormContent" class="space-y-4 h-[calc(100%-100px)] flex flex-col">
<div>
<label for="entryTitle" class="block text-sm font-medium text-gray-700 mb-1">العنوان (اختياري)</label>
<input type="text" id="entryTitle" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-indigo-500">
</div>
<div class="flex-grow">
<label for="entryContent" class="block text-sm font-medium text-gray-700 mb-1">المحتوى</label>
<textarea id="entryContent" rows="10" class="w-full h-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-indigo-500" required></textarea>
</div>
<div class="flex space-x-3 pt-4">
<button type="submit" class="flex-1 bg-indigo-600 text-white py-2 px-4 rounded-md hover:bg-indigo-700 transition">حفظ اليومية</button>
<button type="button" id="cancelJournalForm" class="flex-1 bg-gray-200 text-gray-700 py-2 px-4 rounded-md hover:bg-gray-300 transition">إلغاء</button>
</div>
</form>
</div>
<!-- Add Goal Form (Slide-in) -->
<div id="goalForm" class="absolute top-0 right-0 w-full h-full bg-white p-4 hidden slide-in">
<div class="flex justify-between items-center mb-4">
<h2 class="text-xl font-semibold">هدف جديد</h2>
<button id="closeGoalForm" class="text-gray-500 hover:text-gray-700">
<i class="fas fa-times"></i>
</button>
</div>
<form id="goalFormContent" class="space-y-4">
<div>
<label for="goalTitle" class="block text-sm font-medium text-gray-700 mb-1">عنوان الهدف</label>
<input type="text" id="goalTitle" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-indigo-500" required>
</div>
<div>
<label for="goalDescription" class="block text-sm font-medium text-gray-700 mb-1">الوصف</label>
<textarea id="goalDescription" rows="3" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-indigo-500"></textarea>
</div>
<div>
<label for="goalTargetDate" class="block text-sm font-medium text-gray-700 mb-1">تاريخ الهدف</label>
<input type="date" id="goalTargetDate" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-indigo-500">
</div>
<div>
<label for="goalProgress" class="block text-sm font-medium text-gray-700 mb-1">التقدم الحالي (%)</label>
<input type="range" id="goalProgress" min="0" max="100" value="0" class="w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer">
<div class="flex justify-between text-xs text-gray-500 mt-1">
<span>0%</span>
<span id="progressValue">0%</span>
<span>100%</span>
</div>
</div>
<div class="flex space-x-3 pt-4">
<button type="submit" class="flex-1 bg-indigo-600 text-white py-2 px-4 rounded-md hover:bg-indigo-700 transition">حفظ الهدف</button>
<button type="button" id="cancelGoalForm" class="flex-1 bg-gray-200 text-gray-700 py-2 px-4 rounded-md hover:bg-gray-300 transition">إلغاء</button>
</div>
</form>
</div>
<!-- Task Details Modal -->
<div id="taskDetailsModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden">
<div class="bg-white rounded-lg w-full max-w-md mx-4 max-h-[80vh] overflow-y-auto">
<div class="p-4">
<div class="flex justify-between items-center mb-4">
<h3 class="text-xl font-semibold" id="taskDetailTitle"></h3>
<button id="closeTaskDetails" class="text-gray-500 hover:text-gray-700">
<i class="fas fa-times"></i>
</button>
</div>
<div class="space-y-4">
<div>
<h4 class="font-medium text-gray-700">الوصف</h4>
<p id="taskDetailDescription" class="text-gray-600 mt-1"></p>
</div>
<div>
<h4 class="font-medium text-gray-700">تاريخ الاستحقاق</h4>
<p id="taskDetailDueDate" class="text-gray-600 mt-1"></p>
</div>
<div>
<h4 class="font-medium text-gray-700">الأولوية</h4>
<p id="taskDetailPriority" class="text-gray-600 mt-1"></p>
</div>
<div class="flex space-x-3 pt-4">
<button id="completeTaskBtn" class="flex-1 bg-indigo-600 text-white py-2 px-4 rounded-md hover:bg-indigo-700 transition">تم الإنجاز</button>
<button id="deleteTaskBtn" class="flex-1 bg-red-600 text-white py-2 px-4 rounded-md hover:bg-red-700 transition">حذف</button>
</div>
</div>
</div>
</div>
</div>
<!-- Journal Entry Details Modal -->
<div id="journalDetailsModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden">
<div class="bg-white rounded-lg w-full max-w-md mx-4 max-h-[80vh] overflow-y-auto">
<div class="p-4">
<div class="flex justify-between items-center mb-4">
<h3 class="text-xl font-semibold" id="journalDetailTitle"></h3>
<button id="closeJournalDetails" class="text-gray-500 hover:text-gray-700">
<i class="fas fa-times"></i>
</button>
</div>
<div class="space-y-4">
<div>
<h4 class="font-medium text-gray-700">التاريخ</h4>
<p id="journalDetailDate" class="text-gray-600 mt-1"></p>
</div>
<div>
<h4 class="font-medium text-gray-700">المحتوى</h4>
<p id="journalDetailContent" class="text-gray-600 mt-1 whitespace-pre-line"></p>
</div>
<div class="flex space-x-3 pt-4">
<button id="deleteJournalBtn" class="flex-1 bg-red-600 text-white py-2 px-4 rounded-md hover:bg-red-700 transition">حذف</button>
</div>
</div>
</div>
</div>
</div>
<!-- Goal Details Modal -->
<div id="goalDetailsModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden">
<div class="bg-white rounded-lg w-full max-w-md mx-4 max-h-[80vh] overflow-y-auto">
<div class="p-4">
<div class="flex justify-between items-center mb-4">
<h3 class="text-xl font-semibold" id="goalDetailTitle"></h3>
<button id="closeGoalDetails" class="text-gray-500 hover:text-gray-700">
<i class="fas fa-times"></i>
</button>
</div>
<div class="space-y-4">
<div>
<h4 class="font-medium text-gray-700">الوصف</h4>
<p id="goalDetailDescription" class="text-gray-600 mt-1"></p>
</div>
<div>
<h4 class="font-medium text-gray-700">تاريخ الهدف</h4>
<p id="goalDetailTargetDate" class="text-gray-600 mt-1"></p>
</div>
<div>
<h4 class="font-medium text-gray-700">التقدم</h4>
<div class="progress-bar mt-2">
<div id="goalDetailProgressBar" class="progress-fill" style="width: 0%"></div>
</div>
<p id="goalDetailProgressText" class="text-gray-600 mt-1 text-right"></p>
</div>
<div class="flex space-x-3 pt-4">
<button id="updateGoalProgressBtn" class="flex-1 bg-indigo-600 text-white py-2 px-4 rounded-md hover:bg-indigo-700 transition">تحديث التقدم</button>
<button id="deleteGoalBtn" class="flex-1 bg-red-600 text-white py-2 px-4 rounded-md hover:bg-red-700 transition">حذف</button>
</div>
</div>
</div>
</div>
</div>
<!-- Update Progress Modal -->
<div id="progressUpdateModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden">
<div class="bg-white rounded-lg w-full max-w-md mx-4">
<div class="p-4">
<div class="flex justify-between items-center mb-4">
<h3 class="text-xl font-semibold">تحديث التقدم</h3>
<button id="closeProgressUpdate" class="text-gray-500 hover:text-gray-700">
<i class="fas fa-times"></i>
</button>
</div>
<div class="space-y-4">
<div>
<label for="updatedProgress" class="block text-sm font-medium text-gray-700 mb-1">التقدم الجديد (%)</label>
<input type="range" id="updatedProgress" min="0" max="100" value="0" class="w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer">
<div class="flex justify-between text-xs text-gray-500 mt-1">
<span>0%</span>
<span id="updatedProgressValue">0%</span>
<span>100%</span>
</div>
</div>
<div class="flex space-x-3 pt-4">
<button id="saveProgressUpdate" class="flex-1 bg-indigo-600 text-white py-2 px-4 rounded-md hover:bg-indigo-700 transition">حفظ</button>
<button id="cancelProgressUpdate" class="flex-1 bg-gray-200 text-gray-700 py-2 px-4 rounded-md hover:bg-gray-300 transition">إلغاء</button>
</div>
</div>
</div>
</div>
</div>
</main>
<!-- Stats Overview -->
<div class="bg-white border-t border-gray-200 p-4">
<div class="grid grid-cols-3 gap-4 text-center">
<div>
<div class="text-2xl font-bold text-indigo-600" id="tasksCount">0</div>
<div class="text-sm text-gray-500">المهام</div>
</div>
<div>
<div class="text-2xl font-bold text-indigo-600" id="entriesCount">0</div>
<div class="text-sm text-gray-500">اليوميات</div>
</div>
<div>
<div class="text-2xl font-bold text-indigo-600" id="goalsCount">0</div>
<div class="text-sm text-gray-500">الأهداف</div>
</div>
</div>
</div>
</div>
<script>
// DOM Elements
const navItems = document.querySelectorAll('.nav-item');
const tabContents = document.querySelectorAll('.tab-content');
const filterBtns = document.querySelectorAll('.filter-btn');
// Form elements
const addTaskBtn = document.getElementById('addTaskBtn');
const taskForm = document.getElementById('taskForm');
const closeTaskForm = document.getElementById('closeTaskForm');
const cancelTaskForm = document.getElementById('cancelTaskForm');
const taskFormContent = document.getElementById('taskFormContent');
const addEntryBtn = document.getElementById('addEntryBtn');
const journalForm = document.getElementById('journalForm');
const closeJournalForm = document.getElementById('closeJournalForm');
const cancelJournalForm = document.getElementById('cancelJournalForm');
const journalFormContent = document.getElementById('journalFormContent');
const addGoalBtn = document.getElementById('addGoalBtn');
const goalForm = document.getElementById('goalForm');
const closeGoalForm = document.getElementById('closeGoalForm');
const cancelGoalForm = document.getElementById('cancelGoalForm');
const goalFormContent = document.getElementById('goalFormContent');
const goalProgress = document.getElementById('goalProgress');
const progressValue = document.getElementById('progressValue');
// Modal elements
const taskDetailsModal = document.getElementById('taskDetailsModal');
const closeTaskDetails = document.getElementById('closeTaskDetails');
const completeTaskBtn = document.getElementById('completeTaskBtn');
const deleteTaskBtn = document.getElementById('deleteTaskBtn');
const journalDetailsModal = document.getElementById('journalDetailsModal');
const closeJournalDetails = document.getElementById('closeJournalDetails');
const deleteJournalBtn = document.getElementById('deleteJournalBtn');
const goalDetailsModal = document.getElementById('goalDetailsModal');
const closeGoalDetails = document.getElementById('closeGoalDetails');
const updateGoalProgressBtn = document.getElementById('updateGoalProgressBtn');
const deleteGoalBtn = document.getElementById('deleteGoalBtn');
const progressUpdateModal = document.getElementById('progressUpdateModal');
const closeProgressUpdate = document.getElementById('closeProgressUpdate');
const updatedProgress = document.getElementById('updatedProgress');
const updatedProgressValue = document.getElementById('updatedProgressValue');
const saveProgressUpdate = document.getElementById('saveProgressUpdate');
const cancelProgressUpdate = document.getElementById('cancelProgressUpdate');
// Stats elements
const tasksCount = document.getElementById('tasksCount');
const entriesCount = document.getElementById('entriesCount');
const goalsCount = document.getElementById('goalsCount');
// Data storage
let tasks = JSON.parse(localStorage.getItem('tasks')) || [];
let journalEntries = JSON.parse(localStorage.getItem('journalEntries')) || [];
let goals = JSON.parse(localStorage.getItem('goals')) || [];
// Current selected items for details/modals
let currentTaskId = null;
let currentEntryId = null;
let currentGoalId = null;
// Initialize the app
document.addEventListener('DOMContentLoaded', () => {
renderTasks();
renderJournalEntries();
renderGoals();
updateStats();
// Set up event listeners for navigation
navItems.forEach(item => {
item.addEventListener('click', () => {
// Remove active class from all nav items
navItems.forEach(navItem => {
navItem.classList.remove('active');
navItem.classList.add('text-gray-500');
});
// Add active class to clicked nav item
item.classList.add('active');
item.classList.remove('text-gray-500');
// Hide all tab contents
tabContents.forEach(content => {
content.classList.add('hidden');
});
// Show the selected tab content
const tabId = item.getAttribute('data-tab') + 'Tab';
document.getElementById(tabId).classList.remove('hidden');
});
});
// Set up event listeners for task filters
filterBtns.forEach(btn => {
btn.addEventListener('click', () => {
filterBtns.forEach(b => b.classList.remove('bg-indigo-100', 'text-indigo-700'));
filterBtns.forEach(b => b.classList.add('bg-gray-100', 'text-gray-700'));
btn.classList.remove('bg-gray-100', 'text-gray-700');
btn.classList.add('bg-indigo-100', 'text-indigo-700');
renderTasks(btn.getAttribute('data-filter'));
});
});
// Task form events
addTaskBtn.addEventListener('click', () => {
taskForm.classList.remove('hidden');
taskForm.classList.add('slide-in');
taskForm.classList.remove('slide-out');
});
closeTaskForm.addEventListener('click', () => {
taskForm.classList.add('slide-out');
setTimeout(() => {
taskForm.classList.add('hidden');
}, 300);
});
cancelTaskForm.addEventListener('click', () => {
taskForm.classList.add('slide-out');
setTimeout(() => {
taskForm.classList.add('hidden');
}, 300);
});
taskFormContent.addEventListener('submit', (e) => {
e.preventDefault();
const title = document.getElementById('taskTitle').value;
const description = document.getElementById('taskDescription').value;
const dueDate = document.getElementById('taskDueDate').value;
const priority = document.querySelector('input[name="taskPriority"]:checked').value;
const newTask = {
id: Date.now().toString(),
title,
description,
dueDate,
priority,
completed: false,
createdAt: new Date().toISOString()
};
tasks.push(newTask);
saveTasks();
renderTasks();
updateStats();
// Reset form
taskFormContent.reset();
// Close form
taskForm.classList.add('slide-out');
setTimeout(() => {
taskForm.classList.add('hidden');
}, 300);
});
// Journal form events
addEntryBtn.addEventListener('click', () => {
journalForm.classList.remove('hidden');
journalForm.classList.add('slide-in');
journalForm.classList.remove('slide-out');
});
closeJournalForm.addEventListener('click', () => {
journalForm.classList.add('slide-out');
setTimeout(() => {
journalForm.classList.add('hidden');
}, 300);
});
cancelJournalForm.addEventListener('click', () => {
journalForm.classList.add('slide-out');
setTimeout(() => {
journalForm.classList.add('hidden');
}, 300);
});
journalFormContent.addEventListener('submit', (e) => {
e.preventDefault();
const title = document.getElementById('entryTitle').value;
const content = document.getElementById('entryContent').value;
const newEntry = {
id: Date.now().toString(),
title,
content,
createdAt: new Date().toISOString()
};
journalEntries.push(newEntry);
saveJournalEntries();
renderJournalEntries();
updateStats();
// Reset form
journalFormContent.reset();
// Close form
journalForm.classList.add('slide-out');
setTimeout(() => {
journalForm.classList.add('hidden');
}, 300);
});
// Goal form events
addGoalBtn.addEventListener('click', () => {
goalForm.classList.remove('hidden');
goalForm.classList.add('slide-in');
goalForm.classList.remove('slide-out');
});
closeGoalForm.addEventListener('click', () => {
goalForm.classList.add('slide-out');
setTimeout(() => {
goalForm.classList.add('hidden');
}, 300);
});
cancelGoalForm.addEventListener('click', () => {
goalForm.classList.add('slide-out');
setTimeout(() => {
goalForm.classList.add('hidden');
}, 300);
});
goalFormContent.addEventListener('submit', (e) => {
e.preventDefault();
const title = document.getElementById('goalTitle').value;
const description = document.getElementById('goalDescription').value;
const targetDate = document.getElementById('goalTargetDate').value;
const progress = parseInt(document.getElementById('goalProgress').value);
const newGoal = {
id: Date.now().toString(),
title,
description,
targetDate,
progress,
createdAt: new Date().toISOString()
};
goals.push(newGoal);
saveGoals();
renderGoals();
updateStats();
// Reset form
goalFormContent.reset();
document.getElementById('goalProgress').value = 0;
progressValue.textContent = '0%';
// Close form
goalForm.classList.add('slide-out');
setTimeout(() => {
goalForm.classList.add('hidden');
}, 300);
});
// Goal progress slider
goalProgress.addEventListener('input', () => {
progressValue.textContent = `${goalProgress.value}%`;
});
// Updated progress slider
updatedProgress.addEventListener('input', () => {
updatedProgressValue.textContent = `${updatedProgress.value}%`;
});
});
// Render functions
function renderTasks(filter = 'all') {
const taskList = document.getElementById('taskList');
taskList.innerHTML = '';
let filteredTasks = [...tasks];
if (filter === 'today') {
const today = new Date().toISOString().split('T')[0];
filteredTasks = tasks.filter(task => {
if (!task.dueDate) return false;
return task.dueDate.split('T')[0] === today;
});
} else if (filter === 'high') {
filteredTasks = tasks.filter(task => task.priority === 'high' && !task.completed);
} else if (filter === 'medium') {
filteredTasks = tasks.filter(task => task.priority === 'medium' && !task.completed);
} else if (filter === 'low') {
filteredTasks = tasks.filter(task => task.priority === 'low' && !task.completed);
} else if (filter === 'completed') {
filteredTasks = tasks.filter(task => task.completed);
} else {
// Default: show all incomplete tasks
filteredTasks = tasks.filter(task => !task.completed);
}
if (filteredTasks.length === 0) {
taskList.innerHTML = `
<div class="text-center py-8 text-gray-500">
<i class="fas fa-tasks text-4xl mb-2"></i>
<p>لا توجد مهام</p>
</div>
`;
return;
}
filteredTasks.forEach(task => {
const taskElement = document.createElement('div');
taskElement.className = `bg-white p-4 rounded-lg shadow-sm cursor-pointer transition hover:shadow-md ${task.completed ? 'task-completed' : ''} priority-${task.priority}`;
taskElement.innerHTML = `
<div class="flex justify-between items-start">
<div>
<h3 class="font-medium ${task.completed ? 'text-gray-500' : 'text-gray-800'}">${task.title}</h3>
${task.dueDate ? `<p class="text-sm ${task.completed ? 'text-gray-400' : 'text-gray-500'} mt-1">تاريخ الاستحقاق: ${formatDate(task.dueDate)}</p>` : ''}
</div>
<div class="flex space-x-2">
${task.priority === 'high' ? '<span class="px-2 py-1 bg-red-100 text-red-800 text-xs rounded-full">عالي</span>' : ''}
${task.priority === 'medium' ? '<span class="px-2 py-1 bg-amber-100 text-amber-800 text-xs rounded-full">متوسط</span>' : ''}
${task.priority === 'low' ? '<span class="px-2 py-1 bg-emerald-100 text-emerald-800 text-xs rounded-full">منخفض</span>' : ''}
</div>
</div>
`;
taskElement.addEventListener('click', () => {
showTaskDetails(task.id);
});
taskList.appendChild(taskElement);
});
}
function renderJournalEntries() {
const journalEntriesContainer = document.getElementById('journalEntries');
journalEntriesContainer.innerHTML = '';
if (journalEntries.length === 0) {
journalEntriesContainer.innerHTML = `
<div class="text-center py-8 text-gray-500">
<i class="fas fa-book text-4xl mb-2"></i>
<p>لا توجد يوميات بعد</p>
</div>
`;
return;
}
// Sort by date (newest first)
const sortedEntries = [...journalEntries].sort((a, b) => new Date(b.createdAt) - new Date(a.createdAt));
sortedEntries.forEach(entry => {
const entryElement = document.createElement('div');
entryElement.className = 'journal-entry bg-white p-4 rounded-lg shadow-sm cursor-pointer transition hover:shadow-md';
entryElement.innerHTML = `
<div>
<h3 class="font-medium text-gray-800">${entry.title || 'يومية بدون عنوان'}</h3>
<p class="text-sm text-gray-500 mt-1">${formatDate(entry.createdAt)}</p>
<p class="text-gray-600 mt-2 line-clamp-2">${entry.content}</p>
</div>
`;
entryElement.addEventListener('click', () => {
showJournalDetails(entry.id);
});
journalEntriesContainer.appendChild(entryElement);
});
}
function renderGoals() {
const goalsList = document.getElementById('goalsList');
goalsList.innerHTML = '';
if (goals.length === 0) {
goalsList.innerHTML = `
<div class="text-center py-8 text-gray-500">
<i class="fas fa-bullseye text-4xl mb-2"></i>
<p>لا توجد أهداف بعد</p>
</div>
`;
return;
}
goals.forEach(goal => {
const goalElement = document.createElement('div');
goalElement.className = 'bg-white p-4 rounded-lg shadow-sm cursor-pointer transition hover:shadow-md';
goalElement.innerHTML = `
<div>
<h3 class="font-medium text-gray-800">${goal.title}</h3>
${goal.targetDate ? `<p class="text-sm text-gray-500 mt-1">الهدف: ${formatDate(goal.targetDate)}</p>` : ''}
</div>
<div class="mt-3">
<div class="progress-bar">
<div class="progress-fill" style="width: ${goal.progress}%"></div>
</div>
<p class="text-sm text-gray-600 mt-1 text-right">تم إنجاز ${goal.progress}%</p>
</div>
`;
goalElement.addEventListener('click', () => {
showGoalDetails(goal.id);
});
goalsList.appendChild(goalElement);
});
}
// Show details functions
function showTaskDetails(taskId) {
const task = tasks.find(t => t.id === taskId);
if (!task) return;
currentTaskId = taskId;
document.getElementById('taskDetailTitle').textContent = task.title;
document.getElementById('taskDetailDescription').textContent = task.description || 'لا يوجد وصف';
document.getElementById('taskDetailDueDate').textContent = task.dueDate ? formatDateTime(task.dueDate) : 'لا يوجد تاريخ استحقاق';
let priorityText = '';
if (task.priority === 'high') priorityText = 'أولوية عالية';
if (task.priority === 'medium') priorityText = 'أولوية متوسطة';
if (task.priority === 'low') priorityText = 'أولوية منخفضة';
document.getElementById('taskDetailPriority').textContent = priorityText;
if (task.completed) {
completeTaskBtn.textContent = 'إلغاء الإنجاز';
completeTaskBtn.classList.remove('bg-indigo-600', 'hover:bg-indigo-700');
completeTaskBtn.classList.add('bg-gray-600', 'hover:bg-gray-700');
} else {
completeTaskBtn.textContent = 'تم الإنجاز';
completeTaskBtn.classList.remove('bg-gray-600', 'hover:bg-gray-700');
completeTaskBtn.classList.add('bg-indigo-600', 'hover:bg-indigo-700');
}
taskDetailsModal.classList.remove('hidden');
}
function showJournalDetails(entryId) {
const entry = journalEntries.find(e => e.id === entryId);
if (!entry) return;
currentEntryId = entryId;
document.getElementById('journalDetailTitle').textContent = entry.title || 'يومية بدون عنوان';
document.getElementById('journalDetailDate').textContent = formatDateTime(entry.createdAt);
document.getElementById('journalDetailContent').textContent = entry.content;
journalDetailsModal.classList.remove('hidden');
}
function showGoalDetails(goalId) {
const goal = goals.find(g => g.id === goalId);
if (!goal) return;
currentGoalId = goalId;
document.getElementById('goalDetailTitle').textContent = goal.title;
document.getElementById('goalDetailDescription').textContent = goal.description || 'لا يوجد وصف';
document.getElementById('goalDetailTargetDate').textContent = goal.targetDate ? formatDate(goal.targetDate) : 'لا يوجد تاريخ هدف';
document.getElementById('goalDetailProgressBar').style.width = `${goal.progress}%`;
document.getElementById('goalDetailProgressText').textContent = `تم إنجاز ${goal.progress}%`;
goalDetailsModal.classList.remove('hidden');
}
// Event listeners for modals
closeTaskDetails.addEventListener('click', () => {
taskDetailsModal.classList.add('hidden');
});
completeTaskBtn.addEventListener('click', () => {
const taskIndex = tasks.findIndex(t => t.id === currentTaskId);
if (taskIndex !== -1) {
tasks[taskIndex].completed = !tasks[taskIndex].completed;
saveTasks();
renderTasks();
updateStats();
taskDetailsModal.classList.add('hidden');
}
});
deleteTaskBtn.addEventListener('click', () => {
tasks = tasks.filter(t => t.id !== currentTaskId);
saveTasks();
renderTasks();
updateStats();
taskDetailsModal.classList.add('hidden');
});
closeJournalDetails.addEventListener('click', () => {
journalDetailsModal.classList.add('hidden');
});
deleteJournalBtn.addEventListener('click', () => {
journalEntries = journalEntries.filter(e => e.id !== currentEntryId);
saveJournalEntries();
renderJournalEntries();
updateStats();
journalDetailsModal.classList.add('hidden');
});
closeGoalDetails.addEventListener('click', () => {
goalDetailsModal.classList.add('hidden');
});
updateGoalProgressBtn.addEventListener('click', () => {
const goal = goals.find(g => g.id === currentGoalId);
if (!goal) return;
updatedProgress.value = goal.progress;
updatedProgressValue.textContent = `${goal.progress}%`;
progressUpdateModal.classList.remove('hidden');
goalDetailsModal.classList.add('hidden');
});
deleteGoalBtn.addEventListener('click', () => {
goals = goals.filter(g => g.id !== currentGoalId);
saveGoals();
renderGoals();
updateStats();
goalDetailsModal.classList.add('hidden');
});
closeProgressUpdate.addEventListener('click', () => {
progressUpdateModal.classList.add('hidden');
goalDetailsModal.classList.remove('hidden');
});
cancelProgressUpdate.addEventListener('click', () => {
progressUpdateModal.classList.add('hidden');
goalDetailsModal.classList.remove('hidden');
});
saveProgressUpdate.addEventListener('click', () => {
const goalIndex = goals.findIndex(g => g.id === currentGoalId);
if (goalIndex !== -1) {
goals[goalIndex].progress = parseInt(updatedProgress.value);
saveGoals();
renderGoals();
updateStats();
progressUpdateModal.classList.add('hidden');
goalDetailsModal.classList.remove('hidden');
showGoalDetails(currentGoalId);
}
});
// Helper functions
function formatDate(dateString) {
if (!dateString) return '';
const date = new Date(dateString);
return date.toLocaleDateString('ar-SA', {
year: 'numeric',
month: 'long',
day: 'numeric'
});
}
function formatDateTime(dateString) {
if (!dateString) return '';
const date = new Date(dateString);
return date.toLocaleString('ar-SA', {
year: 'numeric',
month: 'long',
day: 'numeric',
hour: '2-digit',
minute: '2-digit'
});
}
function saveTasks() {
localStorage.setItem('tasks', JSON.stringify(tasks));
}
function saveJournalEntries() {
localStorage.setItem('journalEntries', JSON.stringify(journalEntries));
}
function saveGoals() {
localStorage.setItem('goals', JSON.stringify(goals));
}
function updateStats() {
tasksCount.textContent = tasks.filter(t => !t.completed).length;
entriesCount.textContent = journalEntries.length;
goalsCount.textContent = goals.length;
}
</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=halmouss/prudpro" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</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">
<link href="https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700&display=swap" rel="stylesheet">
<style>
:root {
--primary: #4f46e5;
--primary-light: #6366f1;
--primary-dark: #4338ca;
--secondary: #f59e0b;
--dark: #1e293b;
--light: #f8fafc;
--gray: #94a3b8;
--success: #10b981;
--danger: #ef4444;
}
body {
font-family: 'Tajawal', sans-serif;
background-color: #f1f5f9;
color: var(--dark);
}
.app-container {
max-width: 480px;
margin: 0 auto;
background-color: white;
min-height: 100vh;
box-shadow: 0 0 20px rgba(0,0,0,0.1);
position: relative;
overflow-x: hidden;
}
.nav-item.active {
color: var(--primary);
border-bottom: 2px solid var(--primary);
}
.priority-high {
border-right: 4px solid var(--danger);
}
.priority-medium {
border-right: 4px solid var(--secondary);
}
.priority-low {
border-right: 4px solid var(--success);
}
.task-completed {
opacity: 0.7;
text-decoration: line-through;
}
.progress-bar {
height: 8px;
border-radius: 4px;
background-color: #e2e8f0;
}
.progress-fill {
height: 100%;
border-radius: 4px;
background-color: var(--primary);
transition: width 0.3s ease;
}
.journal-entry {
border-right: 4px solid var(--primary);
}
.slide-in {
animation: slideIn 0.3s forwards;
}
.slide-out {
animation: slideOut 0.3s forwards;
}
@keyframes slideIn {
from { transform: translateX(100%); }
to { transform: translateX(0); }
}
@keyframes slideOut {
from { transform: translateX(0); }
to { transform: translateX(100%); }
}
.fade-in {
animation: fadeIn 0.3s ease-in;
}
@keyframes fadeIn {