Online Productivity-Based Work Shifts Optimizer

Productivity-Based Work Shift Optimizer

Organize your workday around your natural energy levels.

Your Optimized Work Schedule

Configure your profile and tasks in the next tabs, then click the button below to generate your ideal schedule.

Your schedule will appear here once generated.

Define Your Daily Productivity Curve

Rate your typical energy and focus levels for each block of time. This helps the optimizer assign the right tasks to the right time.

Manage Your Task List

Add all the tasks you need to complete. Be sure to estimate the time required and the mental energy (cognitive load) each one demands.

Add a New Task

Current Task List

Task Name Duration Cognitive Load Actions

These tasks could not fit into the schedule. Consider breaking them down or extending work hours.

    ${unscheduled.map(task => `
  • ${task.name} ${task.duration} min
  • `).join('')}
`; } scheduleOutput.innerHTML = html; } // --- EVENT LISTENERS --- function addEventListeners() { tabButtons.forEach(button => { button.addEventListener('click', () => { currentTab = button.dataset.tab; switchTab(); }); }); addTaskForm.addEventListener('submit', addTask); taskListBody.addEventListener('click', (e) => { if (e.target.classList.contains('delete-btn')) { const taskId = parseInt(e.target.dataset.id); deleteTask(taskId); } }); generateScheduleBtn.addEventListener('click', () => { generateSchedule(); currentTab = 'dashboard'; switchTab(); }); downloadPdfBtn.addEventListener('click', generatePdf); } // --- UI & NAVIGATION --- function switchTab() { tabButtons.forEach(button => button.classList.toggle('active', button.dataset.tab === currentTab)); tabContents.forEach(content => content.classList.toggle('active', content.id.startsWith(currentTab))); } // --- PDF GENERATION --- function generatePdf() { const { jsPDF } = window.jspdf; const pdfContent = document.getElementById('pdf-content'); if (!pdfContent || downloadPdfBtn.disabled) return; html2canvas(pdfContent, { scale: 2, useCORS: true, logging: false }) .then(canvas => { const imgData = canvas.toDataURL('image/png'); const pdf = new jsPDF({ orientation: 'p', unit: 'mm', format: 'a4' }); const pdfWidth = pdf.internal.pageSize.getWidth(); const imgProps = pdf.getImageProperties(imgData); const imgHeight = (imgProps.height * pdfWidth) / imgProps.width; let heightLeft = imgHeight; let position = 0; pdf.addImage(imgData, 'PNG', 0, position, pdfWidth, imgHeight); heightLeft -= pdf.internal.pageSize.getHeight(); while (heightLeft > 0) { position = heightLeft - imgHeight; pdf.addPage(); pdf.addImage(imgData, 'PNG', 0, position, pdfWidth, imgHeight); heightLeft -= pdf.internal.pageSize.getHeight(); } pdf.save('Optimized-Work-Shift.pdf'); }) .catch(error => { console.error("Error generating PDF:", error); alert("Sorry, there was an error generating the PDF."); }); } // --- START THE APP --- initialize(); });
Scroll to Top