Remote Work Productivity Meter

Remote Work Productivity Meter

Session Details

Work Plan & Execution

Productivity Factors

Notes & Reflections (Optional)

Log your work day on the first tab, then click "Calculate Productivity".

Planned Hours: ${hoursPlanned} | Actual Hours: ${hoursActual}

Tasks Planned: ${tasksPlanned} | Tasks Completed: ${tasksCompleted}

Focus Level: ${focusLevel}/10 | Distractions: ${distractions} | Accomplishment: ${accomplishment}/5

`; html += `

Assistant Insights & Tips:

    `; insights.forEach(insight => html += `
  • ${insight}
  • `); html += `
`; if(winsNotes || challengesNotes){ html += `

Your Notes:

` if(winsNotes) html += `

Key Wins/Achievements:
${winsNotes.replace(/\n/g, '
')}

`; if(challengesNotes) html += `

Challenges Faced:
${challengesNotes.replace(/\n/g, '
')}

`; html += `
`; } reportDisplayEl.innerHTML = html; rwpmOpenTab(null, 'rwpm-meter'); } // PDF Download function rwpmDownloadPDF() { if (!rwpmSessionLog.date) { // Check if session data exists alert("Please calculate productivity first to generate a report."); return; } let pdfHTML = `

Remote Work Productivity Report

`; pdfHTML += `

Date: ${new Date(rwpmSessionLog.date+"T00:00:00").toLocaleDateString()}

`; pdfHTML += `

Productivity Meter

`; pdfHTML += `
${rwpmSessionLog.score.toFixed(0)}/100
${rwpmSessionLog.levelText}
`; pdfHTML += `

Summary of Your Day:

`; pdfHTML += `

Planned Hours: ${rwpmSessionLog.hoursPlanned} | Actual Hours: ${rwpmSessionLog.hoursActual}

Tasks Planned: ${rwpmSessionLog.tasksPlanned} | Tasks Completed: ${rwpmSessionLog.tasksCompleted}

Focus Level: ${rwpmSessionLog.focusLevel}/10 | Distractions: ${rwpmSessionLog.distractions} | Accomplishment: ${rwpmSessionLog.accomplishment}/5

`; pdfHTML += `

Assistant Insights & Tips:

    `; rwpmSessionLog.insights.forEach(insight => pdfHTML += `
  • ${insight}
  • `); pdfHTML += `
`; if(rwpmSessionLog.winsNotes || rwpmSessionLog.challengesNotes){ pdfHTML += `

Your Notes:

` if(rwpmSessionLog.winsNotes) pdfHTML += `

Key Wins/Achievements:
${rwpmSessionLog.winsNotes.replace(/\n/g, '
')}

`; if(rwpmSessionLog.challengesNotes) pdfHTML += `

Challenges Faced:
${rwpmSessionLog.challengesNotes.replace(/\n/g, '
')}

`; } const pdfContainer = document.getElementById('rwpm-report-content-for-pdf'); pdfContainer.innerHTML = pdfHTML; // Ensure meter colors are applied for PDF const meterFillPdf = pdfContainer.querySelector('.rwpm-meter-bar-fill'); if(meterFillPdf){ if(rwpmSessionLog.score >= 75) meterFillPdf.style.backgroundColor = getComputedStyle(document.documentElement).getPropertyValue('--success-color'); else if (rwpmSessionLog.score >= 50) meterFillPdf.style.backgroundColor = getComputedStyle(document.documentElement).getPropertyValue('--warning-color'); else meterFillPdf.style.backgroundColor = getComputedStyle(document.documentElement).getPropertyValue('--danger-color'); } const opt = { margin: [0.6, 0.5, 0.6, 0.5], filename: `RemoteWork_Productivity_Report_${rwpmSessionLog.date}.pdf`, image: { type: 'jpeg', quality: 0.98 }, html2canvas: { scale: 2, useCORS: true, logging: false }, jsPDF: { unit: 'in', format: 'letter', orientation: 'portrait' }, pagebreak: { mode: ['avoid-all', 'css', 'legacy'] } }; html2pdf().from(pdfContainer).set(opt).save().then(() => { pdfContainer.innerHTML = ''; }).catch(err => { console.error("Error generating PDF:", err); pdfContainer.innerHTML = ''; alert("An error occurred while generating the PDF. Check console for details."); }); }
Scroll to Top