Small Business Data Privacy Law Guide

Small Business Data Privacy Law Guide

Get a simplified overview of U.S. data privacy laws and generate a basic compliance checklist.

Tell Us About Your Business

Select your business context in Tab 1 to see relevant law summaries here.

`; return; } lawSummaryContainer.innerHTML = activeLaws.map(law => `

${law.name}

${law.summary}

Applicability Threshold: ${law.threshold}

`).join(''); }; const renderChecklist = () => { updateActiveLaws(); if (activeLaws.length === 0) { checklistContainer.innerHTML = `

Select your business context in Tab 1 to generate a checklist.

`; downloadBtnContainer.classList.add('hidden'); return; } let allObligations = new Set(); activeLaws.forEach(law => { law.obligations.forEach(ob => allObligations.add(ob)); }); const checklistHtml = `
${[...allObligations].map((item, index) => ` `).join('')}
# Compliance Action Item
${index + 1} ${item}
`; checklistContainer.innerHTML = checklistHtml; downloadBtnContainer.classList.remove('hidden'); }; // --- UI & NAVIGATION --- const updateNavButtons = () => { prevBtn.disabled = currentTab === '1'; nextBtn.disabled = currentTab === '3'; prevBtn.classList.toggle('opacity-50', prevBtn.disabled); nextBtn.classList.toggle('opacity-50', nextBtn.disabled); }; window.switchTab = (tabId) => { currentTab = tabId; if (currentTab === '2') { renderLawSummaries(); } if (currentTab === '3') { renderChecklist(); } tabs.forEach(id => { document.getElementById(`tab-content-${id}`).classList.toggle('hidden', id !== currentTab); document.getElementById(`tab-btn-${id}`).classList.toggle('tab-active', id === currentTab); document.getElementById(`tab-btn-${id}`).classList.toggle('tab-inactive', id !== currentTab); }); updateNavButtons(); }; const navigateTabs = (direction) => { const currentIndex = tabs.indexOf(currentTab); let nextIndex = currentIndex + direction; if (nextIndex >= 0 && nextIndex < tabs.length) { switchTab(tabs[nextIndex]); } }; // --- PDF GENERATION --- downloadPdfBtn.addEventListener('click', () => { if (activeLaws.length === 0) return; const { jsPDF } = window.jspdf; const doc = new jsPDF(); doc.setFontSize(18); doc.text("Small Business Data Privacy Guide", 14, 22); doc.setFontSize(11); doc.setTextColor(100); doc.text(`Generated on: ${new Date().toLocaleDateString()}`, 14, 30); let yPos = 40; // Law Summaries doc.setFontSize(14); doc.setTextColor(0); doc.text("Applicable Law Summaries", 14, yPos); yPos += 8; activeLaws.forEach(law => { doc.setFontSize(12); doc.setFont(undefined, 'bold'); doc.text(law.name, 14, yPos); yPos += 6; doc.setFontSize(10); doc.setFont(undefined, 'normal'); const summaryLines = doc.splitTextToSize(law.summary, 180); doc.text(summaryLines, 14, yPos); yPos += (summaryLines.length * 4) + 4; }); // Checklist yPos += 10; let allObligations = new Set(); activeLaws.forEach(law => law.obligations.forEach(ob => allObligations.add(ob))); const checklistBody = [...allObligations].map((item, index) => [index + 1, item]); doc.autoTable({ head: [['#', 'Compliance Action Item']], body: checklistBody, startY: yPos, theme: 'grid', headStyles: { fillColor: [45, 102, 193] }, }); doc.save('Data_Privacy_Guide.pdf'); }); // --- INITIALIZATION --- updateNavButtons(); lucide.createIcons(); prevBtn.addEventListener('click', () => navigateTabs(-1)); nextBtn.addEventListener('click', () => navigateTabs(1)); });
Scroll to Top