Already have an account? Sign in

(function() { var options = { instagram: '', whatsapp: '+923081344538', telegram: '', call: '', call_to_action: 'Message us', button_color: '#FF6550', position: 'right', order: 'whatsapp,instagram,telegram,call' }; var activeButtons = []; if (options.whatsapp) { activeButtons.push({ platform: 'whatsapp', link: `https://wa.me/${options.whatsapp}`, iconSVG: ` `, bgColor: 'rgb(77, 194, 71)' }); } if (options.instagram) { activeButtons.push({ platform: 'instagram', link: `https://instagram.com/${options.instagram}`, iconSVG: ``, bgColor: options.button_color }); } if (options.telegram) { activeButtons.push({ platform: 'telegram', link: `https://t.me/${options.telegram}`, iconSVG: ``, bgColor: 'rgb(0, 135, 203)' }); } if (options.call) { activeButtons.push({ platform: 'call', link: `tel:${options.call}`, iconSVG: ``, bgColor: 'rgb(236, 89, 35)' }); } if (activeButtons.length === 1) { var singleButton = document.createElement('a'); singleButton.href = activeButtons[0].link; singleButton.target = '_blank'; singleButton.style.cssText = ` position: fixed; ${options.position}: 20px; bottom: 20px; display: flex; align-items: center; justify-content: center; width: 60px; height: 60px; background-color: ${activeButtons[0].bgColor}; color: #fff; border-radius: 50%; text-decoration: none; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); `; singleButton.innerHTML = activeButtons[0].iconSVG; document.body.appendChild(singleButton); } else if (activeButtons.length > 1) { var container = document.createElement('div'); container.className = `floating-container ${options.position}`; var mainButton = document.createElement('div'); mainButton.className = 'floating-button main-button'; mainButton.innerHTML = ''; mainButton.onclick = function() { container.classList.toggle('active'); }; container.appendChild(mainButton); activeButtons.forEach(function(btn) { var button = document.createElement('a'); button.href = btn.link; button.target = '_blank'; button.className = `floating-button ${btn.platform}`; button.style.backgroundColor = btn.bgColor; button.innerHTML = btn.iconSVG; container.insertBefore(button, mainButton); }); document.body.appendChild(container); var style = document.createElement('style'); style.innerHTML = ` .floating-container { position: fixed; ${options.position}: 20px; bottom: 20px; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; } .floating-button { display: flex; align-items: center; justify-content: center; width: 50px; height: 50px; color: #fff; font-size: 24px; border-radius: 50%; text-decoration: none; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); opacity: 0; visibility: hidden; transform: scale(0.5); transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease; } .main-button { background-color: ${options.button_color}; opacity: 1 !important; visibility: visible !important; transform: scale(1) !important; } .floating-container.active .floating-button { opacity: 1; visibility: visible; transform: scale(1); } `; document.head.appendChild(style); } })();