22 Sep
|
OSOURCE INDIA
|
India
22 Sep
OSOURCE INDIA
India
document.addEventListener(DOMContentLoaded, function () const container = document.querySelector(.reveal-text); const paragraphs = container.querySelectorAll(p); let allChars = []; // Step 1: Wrap characters and store in one array paragraphs.forEach((el) => let text = el.innerText; let newHTML = ; text.split().forEach(char => if (char === ) newHTML += ; else newHTML += `$char`; ); el.innerHTML = newHTML; // Collect all chars in order allChars = allChars.concat(Array.from(el.querySelectorAll(.char))); ); // Step 2: Scroll animation (global progress) window.addEventListener(scroll, () => const rect = container.getBoundingClientRect(); const windowHeight = window.innerHeight; let progress = (windowHeight - rect.top) / (windowHeight + rect.height); progress = Math.max(0, Math.min(1, progress)); let visibleChars = Math.floor(progress * allChars.length); allChars.forEach((charEl, i) => if (i < visibleChars) charEl.classList.add(active); else charEl.classList.remove(active); ); ); ); Skip to content
Get a Quote
Contact Us
- Solutions
📌 Careers - Osource Global (India)
🏢 OSOURCE INDIA
📍 India