const form = document.getElementById('urlForm'); const input = document.getElementById('urlInput'); const result = document.getElementById('result'); const fullScreenLoader = document.getElementById('fullScreenLoader'); form.addEventListener('submit', async (e) => { e.preventDefault(); const url = input.value; fullScreenLoader.classList.add('active'); result.style.opacity = '0'; result.innerHTML = ''; try { const response = await fetch('https://shrink-dazzler.adaptable.app/process-link', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ htmlUrl: url }) }); const data = await response.json(); if (data.data) { const processedUrl = data.data; result.innerHTML = `
Bypassed URL:
`; } else { result.textContent = 'Error: Unable to bypass the URL.'; } } catch (error) { result.textContent = 'Error processing URL. Please try again.'; } finally { fullScreenLoader.classList.remove('active'); result.style.opacity = '1'; } });