Iframe Viewer Widget Maker

${shareIconHtml}
`; break; case 'fullscreen': generatedCode = `
${shareIconHtml}
`; break; case 'webpage': generatedCode = `
${shareIconHtml}
`; break; } codeOutput.textContent = generatedCode; outputCode.classList.remove('hidden'); }); // Copy generated code copyBtn.addEventListener('click', () => { navigator.clipboard.writeText(codeOutput.textContent) .then(() => { copyBtn.textContent = 'Copied!'; setTimeout(() => { copyBtn.textContent = 'Copy Code'; }, 2000); }); }); // Feedback button feedbackBtn.addEventListener('click', () => { window.open('https://landsurveysunited.com/contact', '_blank'); }); // Mobile Preview Panel controls const mobilePreviewBtn = document.getElementById('mobilePreviewBtn'); const mobilePreviewPanel = document.getElementById('mobilePreviewPanel'); const closeMobilePreview = document.getElementById('closeMobilePreview'); const mobilePreviewFrame = document.getElementById('mobilePreviewFrame'); const advancedControlsBtn = document.getElementById('advancedControlsBtn'); const advancedControlsPanel = document.getElementById('advancedControlsPanel'); const closeAdvancedControls = document.getElementById('closeAdvancedControls'); if(mobilePreviewBtn) { mobilePreviewBtn.addEventListener('click', () => { mobilePreviewPanel.classList.remove('hidden'); mobilePreviewPanel.classList.remove('translate-x-full'); if(mobilePreviewFrame && iframeUrl.value) { mobilePreviewFrame.src = iframeUrl.value; } }); } if(closeMobilePreview) { closeMobilePreview.addEventListener('click', () => { mobilePreviewPanel.classList.add('hidden'); mobilePreviewPanel.classList.add('translate-x-full'); }); } // Advanced Controls Panel if(advancedControlsBtn) { advancedControlsBtn.addEventListener('click', () => { advancedControlsPanel.classList.remove('hidden'); advancedControlsPanel.classList.remove('translate-y-full'); }); } if(closeAdvancedControls) { closeAdvancedControls.addEventListener('click', () => { advancedControlsPanel.classList.add('hidden'); advancedControlsPanel.classList.add('translate-y-full'); }); } // Share Panel const sharePanel = document.getElementById('sharePanel'); const closeShare = document.getElementById('closeShare'); function openSharePanel() { sharePanel.classList.remove('hidden'); setTimeout(() => { sharePanel.querySelector('.transform').classList.remove('-translate-y-full'); }, 10); } if(closeShare) { closeShare.addEventListener('click', () => { sharePanel.querySelector('.transform').classList.add('-translate-y-full'); setTimeout(() => { sharePanel.classList.add('hidden'); }, 300); }); } // Social Share Functions window.shareToFacebook = function() { const url = encodeURIComponent(window.location.href); window.open(`https://www.facebook.com/sharer/sharer.php?u=${url}`, '_blank'); } window.shareToTwitter = function() { const url = encodeURIComponent(window.location.href); const text = encodeURIComponent('Check out this embedded content!'); window.open(`https://twitter.com/intent/tweet?url=${url}&text=${text}`, '_blank'); } window.shareToLinkedIn = function() { const url = encodeURIComponent(window.location.href); window.open(`https://www.linkedin.com/sharing/share-offsite/?url=${url}`, '_blank'); } window.copyShareEmbedCode = function() { const embedCode = document.getElementById('shareEmbedCode'); navigator.clipboard.writeText(embedCode.textContent) .then(() => { const btn = document.querySelector('button[onclick="copyShareEmbedCode()"]'); btn.textContent = 'Copied!'; setTimeout(() => { btn.textContent = 'Copy Embed Code'; }, 2000); }); } // Make openSharePanel globally available for the embedded icon window.openSharePanel = openSharePanel; }); -->