Gait Analysis & Walking Posture Checker

Gait Analysis & Walking Posture Checker

Simulate a posture analysis to gain insights into your walking form.

Simulate Your Gait Analysis

Click the button below to simulate the analysis of a walking video. This tool uses a representative model and does not process actual video files.

${scores.posture}/100

Symmetry Score

${scores.symmetry}/100

Cadence (Steps/Min)

${scores.cadence}

Recommendations

${recommendations.map(r => `

${r.title}

${r.text}

`).join('')}
`; analysisData.recommendations = recommendations; // Save for PDF }; const prepareReportTab = () => { if (analysisData) { reportPlaceholder.classList.add('hidden'); reportReady.classList.remove('hidden'); } }; const generatePdf = async () => { if (!analysisData) { showMessage("No analysis data to generate a report.", true); return; } // --- Populate PDF --- document.getElementById('pdf-analysis-date').textContent = analysisData.date; // Scores const { scores, recommendations } = analysisData; document.getElementById('pdf-scores').innerHTML = `

Posture Score: ${scores.posture} / 100

Symmetry Score: ${scores.symmetry} / 100

Cadence: ${scores.cadence} steps/min

`; // Recommendations document.getElementById('pdf-recommendations').innerHTML = recommendations.map(r => `

${r.title}

${r.text}

`).join(''); // Figure Image const figureImgEl = document.getElementById('pdf-figure-image'); try { const canvas = await html2canvas(analysisFigureRenderArea, { scale: 2, backgroundColor: null }); figureImgEl.src = canvas.toDataURL('image/png'); } catch (error) { console.error("Error generating figure image:", error); showMessage("Could not generate the figure for the PDF.", true); return; } // --- Generate PDF --- document.body.classList.add('pdf-generating'); await new Promise(resolve => setTimeout(resolve, 100)); // Wait for image to paint const { jsPDF } = window.jspdf; const pdf = new jsPDF({ orientation: 'p', unit: 'mm', format: 'a4' }); html2canvas(document.getElementById('pdf-report'), { scale: 2, useCORS: true, backgroundColor: '#ffffff' }) .then(canvas => { const imgData = canvas.toDataURL('image/png'); const pdfWidth = pdf.internal.pageSize.getWidth(); const pdfHeight = (canvas.height * pdfWidth) / canvas.width; pdf.addImage(imgData, 'PNG', 0, 0, pdfWidth, pdfHeight); pdf.save('Gait-Analysis-Report.pdf'); }).catch(err => { console.error("PDF Generation Error:", err); }).finally(() => { document.body.classList.remove('pdf-generating'); }); }; // --- Event Listeners --- tabs.forEach(tab => tab.addEventListener('click', () => switchTab(parseInt(tab.dataset.tab)))); prevBtn.addEventListener('click', () => { if (currentTab > 1) switchTab(currentTab - 1); }); nextBtn.addEventListener('click', () => { if (currentTab < 3) switchTab(currentTab + 1); }); analyzeBtn.addEventListener('click', runAnalysis); downloadPdfBtn.addEventListener('click', generatePdf); // --- Initialization --- switchTab(1); });
Scroll to Top