Employment Contract Generator

Employment Contract Generator

Enter Company & Employee Details

Company Details

Employee Details

Define Job Role and Compensation

Generated Employment Contract

IN WITNESS WHEREOF, the parties have executed this Agreement as of the Effective Date.

EMPLOYER:

By: _________________________

Name: _______________________

Title: ________________________

EMPLOYEE:

By: _________________________

Name: ${d.employeeName}

`; }, renderContractPreview() { this.dom.contractPreviewContent.innerHTML = this.generateContractHtml(); }, // --- NAVIGATION --- changeTab(tabIndex) { if (tabIndex > this.currentTab) { this.updateContractData(); if (this.currentTab === 0 && (!this.contractData.companyName || !this.contractData.employeeName)) { alert("Please fill in the names for both parties."); return; } if (this.currentTab === 1 && (!this.contractData.jobTitle || !this.contractData.salary)) { alert("Please fill in the job title and salary."); return; } } if (tabIndex === 2) this.renderContractPreview(); this.dom.tabButtons[this.currentTab].classList.remove('active'); this.dom.tabContents[this.currentTab].classList.remove('active'); this.currentTab = tabIndex; this.dom.tabButtons[this.currentTab].classList.add('active'); this.dom.tabContents[this.currentTab].classList.add('active'); this.updateNavButtons(); }, navigateTabs(direction) { const newTab = direction === 'next' ? this.currentTab + 1 : this.currentTab - 1; if (newTab >= 0 && newTab < this.dom.tabButtons.length) { this.changeTab(newTab); } }, updateNavButtons() { this.dom.prevBtn.style.visibility = this.currentTab === 0 ? 'hidden' : 'visible'; this.dom.nextBtn.textContent = this.currentTab === this.dom.tabButtons.length - 2 ? 'Generate Contract' : 'Next'; this.dom.nextBtn.style.visibility = this.currentTab === this.dom.tabButtons.length - 1 ? 'hidden' : 'visible'; }, // --- PDF GENERATION --- generatePdf() { const { jsPDF } = window.jspdf; const pdf = new jsPDF({ unit: 'pt', format: 'a4' }); const content = this.dom.contractPreviewContent; pdf.html(content, { callback: function(doc) { doc.save('Employment-Contract.pdf'); }, x: 40, y: 40, width: 515, // A4 width in points is 595, leaving margins windowWidth: content.scrollWidth, autoPaging: 'text' }); }, }; window.app = { changeTab: app.changeTab.bind(app), navigateTabs: app.navigateTabs.bind(app), }; app.init(); });
Scroll to Top