Why One Line In A Contract Can Change Your Entire Life | The EduLaw Store
EduLaw EditorialDaily Legal UpdatesAn in-depth analysis of contract clauses under the Indian Contract Act, 1872. Understand how single lines regarding non-competes, force majeure, arbitration, exemption, and liquidated damages can alter your personal and professional destiny.
EDULAW LEARN · RESEARCH · EXCEL Store → ◐ Theme 6TH ANNIVERSARY · LIMITED TIME EduLaw Full Access — ₹9/- 30 days · all features · +18% GST CLAIM DEAL → Found this useful? 🔗 Copy Link 🟢 WhatsApp CONTRACT LAW · LEGAL AWARENESS · 22 MAY 2026 Why One Line In A Contract Can Change Your Entire Life From a non-compete that silenced a career to a force majeure clause that saved a business during a pandemic — India's courts have repeatedly shown that the most consequential word in any agreement is often the one you skipped reading. 22 May 2026 · Calculating... · By EduLaw Editorial · Contract Law ₹63,000 Cr+ Commercial disputes filed in Indian courts annually 3.5 Cr+ Pending civil cases in Indian district courts (2024) Section 27 Section of ICA voiding trade restraints Section 56 Section of ICA on doctrine of frustration 1872 Year Indian Contract Act enacted 70% Contracts with inadequate dispute resolution clauses (industry estimate) In This Article 1. Contract Architecture 2. The Non-Compete Trap 3. Force Majeure 4. Arbitration Clauses 5. Exemption & Indemnity 6. Liquidated Damages Interactive Quiz Frequently Asked FAQs The Architecture of a Promise: What Makes a Contract Clause? Anjali, an ambitious 22-year-old freelance designer in Bengaluru, signed a standard assignment letter with a digital media agency, thrilled to secure a steady income. Months later, when she designed a viral marketing template on her own personal computer during off-hours, she discovered a single, quietly tucked-away clause stating that "any intellectual IP developed by the designer during the term of this engagement shall belong exclusively to the client." Suddenly, her independent passion project was legally snatched away, exemplifying the alarming reality of how one sentence can redefine your entire creative and professional destiny. A contract is rarely a singular, monolithic promise. In reality, it is a complex, modular network of declarations, allocations of risk, and shifts in liability. Within this network, a single clause operates as a standalone micro-agreement that can completely modify, override, or extinguish the general understanding of the transaction. Under the Indian Contract Act 1872 (ICA), the validity of a contract relies heavily on the compliance of every individual clause with the law. While parties may believe they have reached a simple agreement, the courts look closely at the architecture of the terms to determine what actually binds them. Section 10 of the Indian Contract Act, 1872, establishes the fundamental essentials of a valid contract. It declares that all agreements are contracts if they are made by the free consent of parties competent to contract, for a lawful consideration , and with a lawful object , and are not otherwise expressly declared to be void. The structural integrity of a contract depends on these individual components. A clause that attempts to alter these core metrics is illegal. For instance, if a clause quietly slips in an unlawful object, the entire contract can be jeopardized. However, in modern transactions, the legal community uses a "severability clause" to protect the remaining terms. This allows the court to surgically excise an illegal clause while keeping the rest of the contract alive. ℹ️ Did You Know The Indian Contract Act 1872 is one of the world's oldest contract statutes still in force, predating the UK Sale of Goods Act by 18 years. In the legal hierarchy, there is a clear chain of command among terms: express terms always override implied terms and statutory terms, unless those express terms violate public policy under Section 23 of the Act. An express terms clause is a written, clear statement of what the parties intend. Implied terms, on the other hand, are read into contracts by courts to give "business efficacy" to the transaction. However, a single, explicitly drafted express clause can easily block any implied protections. This gives draftsmen immense power. By crafting a precise, custom clause, they can exclude standard legal remedies that a signer might otherwise expect to rely on. Supreme Court of India Trimex International FZE Ltd. v. Vedanta Aluminium Ltd. (2010) 3 SCC 1 Bench: Justice P. Sathasivam Principle: An arbitration clause within a contract is treated as a separate, self-contained agreement that survives even if the main contract is disputed or declared invalid. Why It Matters: This establishes that some clauses are so legally robust that they survive the death of the contract itself, keeping the dispute in a private forum. 📋 (2010) 3 SCC 1 Coram: P. Sathasivam ICA Section 10 The danger is that signers often focus exclusively on "the big picture" elements—such as the price, the deliverables, and the duration—while completely ignoring the boilerplates. It is in these boilerplate clauses where severe legal liability is allocated. A real-world example of this is the "at-will termination" clause commonly found in executive employment offers. An executive might negotiate a handsome salary, stock options, and bonuses, but if the contract contains a single line permitting termination "without cause at 15 days' notice," all those negotiated benefits can disappear at a moment's notice. The courts will enforce the express terms of the termination clause over any general promises of long-term employment, showing that a single line can instantly dismantle a career plan. "The literal rule of construction governs commercial contracts in India. Parties are bound by the precise language they choose, and the court will not rewrite a bad bargain to save a negligent signer from their own fine print." Judicial Axiom of Indian Contract Law The Non-Compete Trap: How One Clause Can Silence Your Career Vikram, a senior machine learning engineer in Hyderabad, resigned from a tech unicorn to launch his own startup in healthcare analytics. Weeks after his departure, he received a cease-and-desist letter from his former employer's legal department, pointing to an obscure non-compete clause that barred him from working in "any software, data, or technical field" across India for 24 months. Vikram faced a terrifying choice: abandon his entrepreneurial dreams and face costly litigation, or spend two years in professional isolation due to a single clause he had signed without a second thought. In the highly competitive Indian job market, post-termination non-compete clauses have become incredibly common. Employers use these terms to protect their client relationships and proprietary intellectual property. However, many of these clauses are completely illegal under Section 27 of the Indian Contract Act, 1872. This section explicitly states: "Every agreement by which any one is restrained from exercising a lawful profession, trade or business of any kind, is to that extent void." Unlike English law, which allows reasonable restraints, Indian law takes a very strict approach to protecting a person's freedom of trade. Indian courts have established a strict judicial boundary between restraints that apply during employment and those that apply post-termination . Restrictions that operate while an employee is actively employed are generally valid and enforceable to ensure loyalty and focused performance. However, any clause that seeks to restrict an individual's right to work after their employment has ended is considered a restraint of trade and is void. Under Section 27, even if the geographic or temporal limits appear highly "reasonable," the clause cannot be enforced against a former employee. Supreme Court of India Niranjan Shankar Golikari v. Century Spinning & Mfg. Co. Ltd. 1967 AIR 1098, SCR (2) 378 Bench: Justice J.M. Shelat, Justice K. Subba Rao Principle: A negative covenant operating during the period of employment, preventing the employee from working elsewhere, is valid and does not violate Section 27. Why It Matters: This case draws the absolute legal line: restraints during the contract are valid, but post-termination restraints are void. 📋 1967 AIR 1098 ICA Section 27 This principle was further solidified in the landmark case of Superintendence Company of India v. Krishan Murgai (1981) 2 SCC 246, where the Supreme Court ruled that post-termination non-compete clauses are void. The court clarified that the "rule of reason" from English common law does not apply to the plain words of Section 27. Additionally, in Gujarat Bottling Co. v. Coca-Cola (1995) 5 SCC 545, the court reaffirmed that the doctrine of restraint of trade is not limited to employment contracts but applies to all commercial transactions, subject to limited statutory exceptions such as the sale of goodwill. ⚠️ The Non-Compete Trap While post-termination non-competes are legally unenforceable in Indian courts, many employers still include them. They do this to leverage psychological fear, counting on employees to comply voluntarily due to the threat of a lawsuit. To bypass the strict limitations of Section 27, some employers use "garden leave" clauses. Under a garden leave clause, an employee is required to give a long notice period during which they are paid their full salary but are barred from coming to work or joining another company. While this is technically a restraint during employment, courts examine these clauses closely. If a garden leave period is excessively long or used solely to prevent an employee from taking a competitive job, the court may strike it down as an indirect restraint of trade. Employment Restraint During Term Legally valid. Employees must remain loyal and dedicated to their current employer during active service. Post-Term Restraint Post-Termination Void. Any restriction on finding new employment after leaving a job is struck down under Section 27. Trade Secrets Confidentiality Enforceable. Companies can protect genuine trade secrets and customer data, even after termination. Goodwill Sale Statutory Exception Valid. A buyer can restrain a seller from competing within local limits to protect purchased goodwill. 📚 FROM THE EDULAW STORE — Recommended for this topic The EduLaw Contract Law Notes + Landmark Judgements Bundle Master the Indian Contract Act 1872 with clear, simplified notes. This bundle includes in-depth explanations of Sections 10, 27, 56, 73, and 74, paired with comprehensive summaries of landmark Supreme Court judgements designed for exams and practical legal practice. Topic / Subject What's Included Target Exams Indian Contract Act 1872 Notes Clause-by-clause analysis, flowcharts, & simplified examples Judiciary, CLAT PG, LLM, LLB Landmark Judgement Case Briefs Facts, Issues, Ratio Decidendi, and Obiter Dicta of 100+ cases AIBE, Judiciary, Law Prep ₹249 Instant PDF delivery · Trusted by 10,000+ students · Browse all products → Get Now → Force Majeure: The Three Words That Saved — and Sank — Businesses in a Pandemic Rajesh ran a successful chain of boutique fitness centers in Mumbai under a long-term commercial lease agreement. When the government ordered mandatory nationwide lockdowns, his revenue dropped to zero overnight, but his landlord insisted on full rent, pointing out that the lease lacked a force majeure clause. This single missing provision pushed Rajesh's business into bankruptcy, highlighting how a few words—or their absence—can break an otherwise thriving enterprise during a global crisis. The term force majeure , which translates to "superior force," refers to a contractual provision that excuses a party from performing their obligations when extraordinary, unforeseen events occur. In India, force majeure is governed by a combination of statutory principles and contract terms. The law draws a clear distinction between contracts that contain an explicit force majeure clause (governed by Section 32 as a contingent contract) and those that do not, which must rely on the statutory doctrine of frustration under Section 56 of the Indian Contract Act, 1872. When a contract contains an explicit force majeure clause, the parties have pre-agreed on how to handle unexpected disasters. If an event occurs that matches the clause, the contract is governed by Section 32, meaning its performance is suspended or excused as agreed. However, if the contract is silent on extraordinary events, the parties must rely on the frustration of contract doctrine under Section 56 . Under Section 56, a contract becomes void if its performance becomes completely impossible or unlawful after it is signed. This is a very high legal standard; simple financial hardship or a drop in profitability is never enough to claim frustration. Supreme Court of India Satyabrata Ghose v. Mugneeram Bangur & Co. AIR 1954 SC 44 Bench: Justice B.K. Mukherjea Principle: The term 'impossible' under Section 56 does not mean absolute physical or literal impossibility. It includes cases where the very foundation of the contract is destroyed by an unforeseen event. Why It Matters: This is the foundational case on the doctrine of frustration in India, establishing that courts will not excuse performance just because a contract becomes more difficult or expensive to complete. 📋 AIR 1954 SC 44 ICA Section 56 The distinction between Section 32 and Section 56 was thoroughly analyzed by the Supreme Court in *Energy Watchdog v. CERC* (2017) 14 SCC 80. The court made it clear that if a contract contains a force majeure clause, the issue must be resolved within the terms of that clause under Section 32. Section 56 cannot be used to bypass what the parties have already agreed to. This means that if a force majeure clause exists but does not list a specific event—like a fuel shortage—the court will not step in to apply Section 56 and declare the contract frustrated. 1954 Satyabrata Ghose Standard Supreme Court establishes the foundation of Section 56, ruling that hardship or financial changes do not equal statutory impossibility. 2017 Energy Watchdog Guidelines The SC clarifies the divide between contract-based force majeure (Section 32) and statutory frustration (Section 56). 2020 The Pandemic Litigations High Courts reject force majeure claims for tenants and buyers unless their contracts specifically listed epidemics or pandemics as excusable events. The COVID-19 pandemic served as a major test for these clauses in India. In *Standard Retail Pvt. Ltd. v. M/s G.S. Global Corp*, the Bombay High Court rejected a force majeure claim by steel importers. The court ruled that lockdown restrictions did not prevent the importers from making payments, as banking services were functional. This highlighted a vital lesson: a force majeure clause must be drafted with absolute precision. A generic reference to "acts of God" is rarely enough to cover modern disruptions like regulatory shutdowns, public health crises, or trade embargoes. 🚨 COVID Reality Thousands of Indian businesses discovered their force majeure clause did not include 'pandemic' or 'epidemic' — a single missing word that cost crores in unavoidable liabilities. Every signature on a contract is a legal commitment — one line can define the outcome. Photo: Unsplash Arbitration Clauses: How Dispute Resolution Terms Quietly Determine Who Wins Karan, a freelance software developer in Pune, signed a service agreement with an international tech aggregator. When the aggregator withheld ₹8,00,000 in payments over a disputed software bug, Karan threatened legal action. The aggregator pointed to an arbitration clause requiring all disputes to be resolved by a single arbitrator in New Delhi under ad-hoc rules, with Karan paying a mandatory ₹2,00,000 deposit before filing. Realizing the cost of the dispute resolution process exceeded the money he was owed, Karan was forced to drop his claim entirely. An arbitration clause is a procedural term that completely changes how disputes are resolved. By signing an arbitration clause, the parties agree to bypass the public court system and resolve any future conflicts through private, binding arbitration. This process is governed by the Arbitration and Conciliation Act, 1996. While arbitration is often promoted as a faster, more efficient alternative to traditional litigation, a poorly drafted clause can turn into a procedural trap that favors the stronger party. Under the separability doctrine , an arbitration clause is treated as completely independent from the main contract. This means that even if a contract is challenged as void, unsigned, or procured by fraud, the arbitration clause remains valid. This ensures that any disputes over the validity of the contract are resolved by the arbitrator, rather than a civil court. However, this also means that once you sign a contract containing an arbitration clause, you are locked into that private forum, no matter what happens to the main agreement. Supreme Court of India Lombardi Engineering Ltd. v. State of Uttarakhand 2023 INSC 982 Bench: Justice D.Y. Chandrachud, Justice J.B. Pardiwala, Justice Manoj Misra Principle: An arbitration clause that requires a pre-deposit of a percentage of the claimed amount is unconstitutional if it restricts access to justice and violates Article 14. Why It Matters: This case protects smaller contractors and individuals, ensuring that dominant parties cannot use expensive pre-deposit requirements to block legitimate claims. 📋 2023 INSC 982 Arbitration Act 1996 Another major battleground in Indian arbitration is the "unilateral arbitrator appointment" clause. Historically, large corporations and government bodies drafted clauses that allowed them to appoint the sole arbitrator to hear any dispute. However, the Supreme Court has consistently struck down these terms, ruling that a person who has a financial interest in the outcome of a dispute cannot appoint the arbitrator. True neutrality is essential for arbitration to be fair, and courts will intervene to ensure both parties have an equal say in the appointment process. Pro-Litigation (Courts) Public Civil Courts Offers multiple levels of appeal and established rules of evidence. However, it can take years or even decades to resolve disputes due to court backlogs. Pro-Arbitration (Private) Private Tribunal Offers a much faster resolution, confidential hearings, and flexible procedures. However, it requires paying arbitrator fees and offers very limited grounds for appeal. 💡 Smart Drafting Tip Always check whether your arbitration clause names an institutional body (such as the DIAC, MCIA, or SIAC) rather than ad-hoc arbitration. Institutional arbitration provides pre-set rules, clear administrative fees, and less opportunity for procedural delays. Arbitration clauses determine whether your dispute goes to a private tribunal or a public court. Photo: Unsplash Exemption and Indemnity Clauses: The Small Print That Strips You of Rights Siddharth and Kavitha booked a premium banquet hall in Chennai for their wedding reception, paying a non-refundable ₹3,00,000 deposit. A week before the event, the venue canceled the booking due to an internal scheduling error. When Siddharth demanded a refund and compensation for their emergency alternate bookings, the venue pointed to an exemption clause: "The venue shall not be liable for any cancellation, and any refunds shall be at the sole discretion of the management." Siddharth was left facing a massive financial loss with virtually no immediate recourse. An exemption clause is a common tool used in standard-form contracts to limit or completely exclude a party's liability. These clauses are frequently found in everyday transactions, such as booking hotel rooms, using online services, or purchasing insurance. While businesses use them to manage risk, these terms can often create a massive power imbalance, leaving consumers with virtually no recourse if things go wrong. Under Section 23 of the Indian Contract Act, 1872, agreements that are contrary to public policy are void. While businesses are free to limit their liability for standard operational risks, they cannot use exemption clauses to escape liability for gross negligence, willful misconduct, or fraud. The Consumer Protection Act, 2019, introduced powerful protections against these one-sided agreements. It defined an unfair contract term as any term in a standard-form contract that causes a "significant imbalance" in the rights of the consumer, allowing State and National Commissions to declare such terms completely void. Calcutta High Court Indian Airlines v. Madhuri Chowdhuri AIR 1965 Cal 252 Bench: Justice H.K. Bose Principle: Exemption clauses in a passenger ticket are valid if they are reasonable and the passenger had reasonable notice of the terms. Why It Matters: This case shows that historically, courts have upheld exemption clauses if they were clearly presented, highlighting the importance of reading the fine print before agreeing. 📋 AIR 1965 Cal 252 ICA Section 23 Another closely related term is the indemnity clause. An indemnity clause is a promise by one party to pay for any losses or damages the other party suffers during the contract. In many service agreements, clients insert extremely broad indemnity clauses that require the vendor to pay for *all* losses, even those caused by the client's own staff. It is vital to negotiate these terms so that your liability is limited only to losses directly caused by your own negligence. Is My Exemption Clause Valid? Step 1 Does the clause attempt to exclude liability for fraud or gross negligence? (If yes, it is void). Step 2 Is the contract a standard-form consumer agreement with a major power imbalance? (If yes, it may be challenged as an unfair contract under the CPA 2019). Step 3 Did the signer have clear and reasonable notice of the clause *before* signing? (If no, courts are unlikely to enforce it). ⚠️ Consumer Alert Under the Consumer Protection Act 2019, any standard-form contract term that causes a 'significant imbalance' in rights can be declared void by a Consumer Commission. Penalty and Liquidated Damages: When a Single Number Becomes a Life Sentence Amit, an independent contractor, signed a contract to complete the interior fit-outs of a commercial office in Mumbai within 60 days. The agreement contained a liquidated damages clause requiring him to pay a massive ₹1,00,000 for every single day of delay, regardless of the cause. When a regional logistics strike delayed his material deliveries by just ten days, the client withheld ₹10,000,000 from Amit's final payment, threatening to bankrupt his small business over a minor delay. In commercial contracts, parties often include a clause that sets a specific amount of money to be paid if a breach occurs. These terms are governed by Section 73 and Section 74 of the Indian Contract Act, 1872. Section 73 provides the general rule for compensation: a party who suffers from a breach is entitled to receive compensation for any actual loss or damage that naturally arose from the breach. It does not allow for indirect or remote losses. Section 74 deals with contracts that specify a set amount of damages in advance. Under Indian law, the courts draw a sharp distinction between a genuine pre-estimate of loss (known as liquidated damages ) and a term designed to frighten the other party into performing (known as a penalty clause ). Even if a contract states that a specific sum must be paid "whether or not actual damage is proved," Indian courts will not enforce a punitive penalty. Instead, they will only award reasonable compensation, up to the maximum limit specified in the contract. Supreme Court of India Fateh Chand v. Balkishan Dass 1964 AIR 523, SCR (1) 515 Bench: Justice J.C. Shah Principle: Section 74 does not permit the forfeiture of earnest money or the enforcement of a penalty unless actual loss is proven. The court has the power to award only reasonable compensation. Why It Matters: This landmark ruling prevents parties from using unfair penalty clauses to enrich themselves, ensuring that damages are limited to compensating actual, proven losses. 📋 1964 AIR 523 ICA Section 74 The application of Section 74 was further refined in *ONGC v. Saw Pipes Ltd.* (2003) 5 SCC 705, where the Supreme Court held that if the agreed damages represent a genuine pre-estimate of loss, the court can award the full amount without requiring detailed proof of the actual loss. However, in *Kailash Nath Associates v. DDA* (2015) 4 SCC 136, the Supreme Court clarified that if the actual loss can be easily calculated, the claiming party *must* prove their actual loss to recover damages under Section 74. The court cannot award the full contract sum if the actual loss is far lower or non-existent. Section 73 Actual Loss Requires full proof of the actual financial damage suffered as a direct result of the breach. Section 74 Agreed Damages Sets a maximum limit on damages. Courts will only award a reasonable amount up to this limit. Penalty Punitive Terms Unenforceable. Courts will strike down any punitive terms designed solely to frighten the other party. Earnest Money Forfeiture Only allowed if the forfeiture amount is reasonable and represents a fair pre-estimate of loss. ℹ️ Key Principle Under Indian law, courts will never enforce a penalty as a punishment. Even if you signed an agreement promising to pay ₹10 lakh on a breach, the court will only award the actual, proven loss up to that limit. To mathematically illustrate the calculation of damages, consider the basic statutory formula applied under Sections 73 and 74. If the contract price is denoted as $$P_c$$ and the market price of performance at the time of the breach is $$P_m$$, the basic measure of compensatory damages ($$D$$) is generally expressed as: $$D = P_m - P_c$$ Under Section 74, if a liquidated damages amount ($$L_d$$) is specified, the court evaluates whether $$L_d$$ is a genuine pre-estimate. The court awards the reasonable compensation ($$C_r$$) subject to the strict upper limit: $$C_r \le L_d$$ This mathematical limit ensures that the agreed sum acts as a cap on liability, protecting signers from runaway financial demands that do not reflect actual commercial reality. Test Yourself — Contract Law Fundamentals Loading question... Question 1 of 5 Next Question READER POLL Have you ever signed a contract without reading it fully? Yes — I've signed many contracts without reading fully 0% Sometimes — I skim important parts 0% No — I always read contracts carefully 0% I've started reading carefully after a bad experience 0% Total votes: 749 Frequently Asked Questions Can I cross out a clause before signing a contract? + Yes. You can strike through any clause you disagree with and initial the deletion, provided the other party agrees. The amended contract is only valid if both parties sign or initial the changes. Always document agreed deletions in writing. Is a verbal agreement legally binding in India? + Yes, under Section 10 of ICA, oral contracts are generally valid unless the law specifically requires a written form (e.g., property transfers under Transfer of Property Act, hire purchase agreements). However, proving oral contracts in court is extremely difficult — always get it in writing. Can a company enforce a non-compete against me after I resign? + Generally no, under Section 27 of ICA. Post-termination non-competes are largely void in India. However, clauses protecting genuine trade secrets or confidential information may be enforceable under a separate confidentiality agreement even after termination. What happens if my contract has no dispute resolution clause? + The dispute will be heard by the civil court having jurisdiction based on where the contract was formed or where performance was to occur (CPC). This can mean years of litigation in overloaded courts — which is precisely why a well-drafted arbitration or mediation clause is valuable. Can I invoke force majeure for COVID-related delays even now in 2026? + For contracts entered before 2020 with FM clauses covering epidemics/pandemics, invocation for 2020 delays may still be subject to litigation. For post-2022 contracts, courts expect parties to have factored pandemic risk in. Always draft explicit FM clauses listing specific events. What is the maximum penalty a court can award under Section 74 of ICA? + Courts can award a maximum of the penalty sum stated in the contract, but only if the claimant proves actual loss. The court has discretion to award reasonable compensation even if the clause specifies a higher sum — it cannot exceed the agreed penalty but can be lower than it. Contract Law The Complete Guide to Indian Contract Act 1872 — Notes + Cases Buy Notes → Consumer Law Consumer Rights Against Businesses — Know Before You Sign Read Blog → Exam Prep Judiciary Exam MCQ Series — Contract Law Special Edition Buy MCQs → ₹9 · 30 DAYS · FULL ACCESS India's Most Affordable Legal Education Platform 46+ subjects Instant PDF delivery SC/HC daily updates AI legal tools VakilConnect ₹9 +18% GST = ₹10.62 Claim Deal — Store.TheEduLaw.in → Trusted by 10,000+ students · Instant activation · Cancel anytime Legal Disclaimer This article is designed for educational purposes only. It does not constitute legal advice. For specific contract reviews, please consult a qualified advocate. Need Help? Connect with expert legal academic advisors on our platform. Access over 50,000 pages of curated notes instantly on store.theedulaw.in. Share This Article WhatsApp Twitter/X LinkedIn Telegram Follow EduLaw for Daily Legal Updates YT IG TW TG ▲ THE EDULAW STORE India's #1 Legal Education Platform · 10,000+ Students · 46+ Subjects Store Subscribe Marketplace YouTube Instagram Twitter © 2026 EduLaw. All rights reserved. | store.theedulaw.in // [1] READING PROGRESS BAR window.addEventListener('scroll', () => { const progressBar = document.getElementById('progressBar'); const totalScroll = document.documentElement.scrollHeight - window.innerHeight; const scrolled = (window.scrollY / totalScroll) * 100; progressBar.style.width = scrolled + '%'; }); // [2] DARK MODE TOGGLE function toggleDark() { document.body.classList.toggle('dark'); const isDark = document.body.classList.contains('dark'); localStorage.setItem('el-dark', isDark ? '1' : '0'); } document.addEventListener('DOMContentLoaded', () => { const savedDark = localStorage.getItem('el-dark'); if (savedDark === '1') { document.body.classList.add('dark'); } }); // [3] SCROLL SPY (TOC) const observerOptions = { root: null, rootMargin: '0px 0px -60% 0px', threshold: 0 }; const observer = new IntersectionObserver((entries) => { entries.forEach(entry => { const id = entry.target.getAttribute('id'); const tocLink = document.getElementById(`link-${id}`); if (entry.isIntersecting) { document.querySelectorAll('.toc-link').forEach(link => link.classList.remove('active')); if (tocLink) tocLink.classList.add('active'); } }); }, observerOptions); document.querySelectorAll('section[id]').forEach(section => { observer.observe(section); }); // [4] GLOSSARY TOOLTIPS document.addEventListener('DOMContentLoaded', () => { document.querySelectorAll('.gloss').forEach(span => { const def = span.getAttribute('data-def'); const tip = document.createElement('span'); tip.className = 'gloss-tip'; tip.innerText = def; span.appendChild(tip); }); }); // [5] COPY-TO-CLIPBOARD CITATIONS function copyCitation(text) { navigator.clipboard.writeText(text).then(() => { const activeChip = event.currentTarget; const originalText = activeChip.innerText; activeChip.innerText = "✓ Copied"; setTimeout(() => { activeChip.innerText = originalText; }, 1500); }); } // [6] HIGHLIGHT-TO-SHARE (WHATSAPP) document.addEventListener('mouseup', (e) => { const selection = window.getSelection(); const text = selection.toString().trim(); if (text.length >= 20 && text.length { const encoded = encodeURIComponent(`"${text}" - Read more: ${window.location.href}`); window.open(`https://wa.me/?text=${encoded}`, '_blank'); pill.remove(); }; document.body.appendChild(pill); setTimeout(() => { if (pill) pill.remove(); }, 3500); } }); // [7] SECTION BOOKMARK LINKS document.addEventListener('DOMContentLoaded', () => { document.querySelectorAll('h2, h3').forEach(heading => { const parentSection = heading.closest('section'); if (parentSection && parentSection.id) { const anchor = document.createElement('a'); anchor.href = `#${parentSection.id}`; anchor.className = 'hash-anchor'; anchor.innerText = ' #'; anchor.onclick = (e) => { e.preventDefault(); const fullUrl = `${window.location.origin}${window.location.pathname}#${parentSection.id}`; navigator.clipboard.writeText(fullUrl).then(() => { anchor.innerText = ' ✓'; setTimeout(() => { anchor.innerText = ' #'; }, 1500); }); }; heading.appendChild(anchor); } }); }); // [8] BACK-TO-TOP BUTTON window.addEventListener('scroll', () => { const btn = document.getElementById('back-top'); if (window.scrollY > 400) { btn.classList.add('visible'); } else { btn.classList.remove('visible'); } }); function scrollToTop() { window.scrollTo({ top: 0, behavior: 'smooth' }); } // [9] WORD COUNT + READING TIME document.addEventListener('DOMContentLoaded', () => { const text = document.getElementById('articleBody').innerText; const words = text.trim().split(/\s+/).length; const minutes = Math.ceil(words / 200); document.querySelectorAll('.reading-time-auto').forEach(span => { span.innerText = `${minutes} min read (${words} words)`; }); }); // [10] MCQ QUIZ LOGIC const quizData = [ { q: "Under Section 27 of ICA, a post-termination non-compete clause is generally:", options: ["A) Valid if reasonable", "B) Void", "C) Voidable", "D) Enforceable with court permission"], correct: 1 }, { q: "In Satyabrata Ghose v. Mugneeram Bangur, the Supreme Court held that a contract is frustrated when:", options: ["A) Performance becomes commercially inconvenient", "B) The promisor changes his mind", "C) The very foundation of the contract is destroyed by an unforeseen event", "D) A force majeure clause is absent"], correct: 2 }, { q: "Section 74 of ICA deals with:", options: ["A) Void agreements", "B) Penalty and liquidated damages", "C) Frustration of contract", "D) Consideration"], correct: 1 }, { q: "Which case established the 'separability doctrine' for arbitration clauses in India?", options: ["A) ONGC v. Saw Pipes", "B) Niranjan Golikari v. Century Spinning", "C) Trimex International v. Vedanta Aluminium", "D) Fateh Chand v. Balkishan Dass"], correct: 2 }, { q: "Under the Consumer Protection Act 2019, a standard-form contract term that creates 'significant imbalance' in rights is called:", options: ["A) A void term", "B) An unfair contract term", "C) An illegal term", "D) A penalty term"], correct: 4 } ]; let currentQuizIndex = 0; let quizScore = 0; function renderQuizQuestion() { const qObj = quizData[currentQuizIndex]; document.getElementById('quiz-q-text').innerText = qObj.q; const optionsList = document.getElementById('quiz-options-list'); optionsList.innerHTML = ''; document.getElementById('quiz-feedback-text').innerText = ''; document.getElementById('quiz-next-btn').disabled = true; qObj.options.forEach((opt, idx) => { const li = document.createElement('li'); li.className = 'quiz-option'; li.innerText = opt; li.onclick = () => selectQuizOption(idx); optionsList.appendChild(li); }); document.getElementById('quiz-score-tracker').innerText = `Question ${currentQuizIndex + 1} of ${quizData.length}`; } function selectQuizOption(selectedIdx) { const qObj = quizData[currentQuizIndex]; const optionsList = document.getElementById('quiz-options-list').children; // Disable further clicks for (let i = 0; i = 3) msg = "👍 Good effort!"; container.innerHTML = ` ${msg} You scored ${quizScore} out of ${quizData.length} correctly. Try Again `; } function resetQuiz() { currentQuizIndex = 0; quizScore = 0; document.getElementById('quiz-container').innerHTML = ` Loading question... Question 1 of 5 Next Question `; renderQuizQuestion(); } document.addEventListener('DOMContentLoaded', renderQuizQuestion); // [11] POLL LOGIC let pollVotes = [312, 187, 94, 156]; let hasVoted = false; function submitVote(idx) { if (hasVoted) return; pollVotes[idx]++; hasVoted = true; const total = pollVotes.reduce((a, b) => a + b, 0); for (let i = 0; i { el.style.pointerEvents = 'none'; }); } // [12] ANIMATED ENTRY const entryObserver = new IntersectionObserver((entries) => { entries.forEach(entry => { if (entry.isIntersecting) { entry.target.classList.add('visible'); } }); }, { threshold: 0.1 }); document.addEventListener('DOMContentLoaded', () => { document.querySelectorAll('.fade-entry, .case-card, .store-promo-block, .callout').forEach(el => { el.classList.add('fade-entry'); entryObserver.observe(el); }); }); // SHARE UTILS function copyLink(btn) { navigator.clipboard.writeText(window.location.href).then(() => { btn.innerText = "✓ Copied"; setTimeout(() => { btn.innerText = "🔗 Copy Link"; }, 1500); }); } function shareWhatsApp() { const text = encodeURIComponent(`Why One Line In A Contract Can Change Your Entire Life - Read on The EduLaw Store: ${window.location.href}`); window.open(`https://wa.me/?text=${text}`, '_blank'); } // FAQ ACCORDION TOGGLE function toggleFaq(trigger) { const panel = trigger.nextElementSibling; const icon = trigger.querySelector('.faq-icon'); if (panel.style.maxHeight) { panel.style.maxHeight = null; icon.innerText = '+'; } else { panel.style.maxHeight = panel.scrollHeight + "px"; icon.innerText = '−'; } }