(function() { 'use strict'; var CHAT_URL = 'https://liberdadewebchat.apps.havan.com.br/embed'; var isOpen = false; var iframe = null; var button = null; var overlay = null; var defaultConfig = { position: 'bottom-right', primaryColor: '#0046FF', buttonSize: 60, zIndex: 9999 }; var config = {}; function createStyles() { var style = document.createElement('style'); style.textContent = ` .havan-chat-button { position: fixed; bottom: 24px; width: ${config.buttonSize}px; height: ${config.buttonSize}px; border-radius: 50%; background: ${config.primaryColor}; border: none; cursor: pointer; box-shadow: 0 4px 20px -4px rgba(0, 70, 255, 0.5), 0 2px 8px -2px rgba(0, 70, 255, 0.3); z-index: ${config.zIndex}; display: flex; align-items: center; justify-content: center; transition: transform 0.3s ease, box-shadow 0.3s ease; animation: havan-pulse 2s ease-in-out infinite; } .havan-chat-button:hover { transform: scale(1.1); } .havan-chat-button:active { transform: scale(0.95); } .havan-chat-button.open { animation: none; } .havan-chat-button svg { width: 28px; height: 28px; fill: white; transition: transform 0.3s ease; } .havan-chat-button.open svg { transform: rotate(90deg); } .havan-chat-overlay { position: fixed; bottom: 100px; width: 400px; height: 520px; z-index: ${config.zIndex - 1}; border-radius: 16px; overflow: hidden; box-shadow: 0 8px 32px -8px rgba(0, 0, 0, 0.25), 0 4px 16px -4px rgba(0, 0, 0, 0.15); opacity: 0; transform: translateY(20px) scale(0.95); transition: opacity 0.3s ease, transform 0.3s ease; pointer-events: none; } .havan-chat-overlay.visible { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; } .havan-chat-overlay iframe { width: 100%; height: 100%; border: none; } @keyframes havan-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } } @media (max-width: 480px) { .havan-chat-overlay { width: calc(100vw - 32px); height: calc(100vh - 140px); bottom: 90px; left: 16px !important; right: 16px !important; } } `; if (config.position === 'bottom-right') { style.textContent += ` .havan-chat-button { right: 24px; } .havan-chat-overlay { right: 24px; } `; } else { style.textContent += ` .havan-chat-button { left: 24px; } .havan-chat-overlay { left: 24px; } `; } document.head.appendChild(style); } function createButton() { button = document.createElement('button'); button.className = 'havan-chat-button'; button.setAttribute('aria-label', 'Abrir chat'); button.innerHTML = ` `; button.addEventListener('click', toggleChat); document.body.appendChild(button); } function createOverlay() { overlay = document.createElement('div'); overlay.className = 'havan-chat-overlay'; iframe = document.createElement('iframe'); iframe.src = CHAT_URL; iframe.setAttribute('allow', 'clipboard-write'); overlay.appendChild(iframe); document.body.appendChild(overlay); } function toggleChat() { isOpen = !isOpen; if (isOpen) { button.classList.add('open'); button.innerHTML = ` `; button.setAttribute('aria-label', 'Fechar chat'); overlay.classList.add('visible'); } else { closeChat(); } } function closeChat() { isOpen = false; button.classList.remove('open'); button.innerHTML = ` `; button.setAttribute('aria-label', 'Abrir chat'); overlay.classList.remove('visible'); } function handleMessage(event) { if (event.data && event.data.type === 'HAVAN_CHAT_CLOSE') { closeChat(); } } function init(userConfig) { config = Object.assign({}, defaultConfig, userConfig || {}); if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', function() { createStyles(); createButton(); createOverlay(); }); } else { createStyles(); createButton(); createOverlay(); } window.addEventListener('message', handleMessage); } // Expose API window.HavanChat = { init: init, open: function() { if (!isOpen) toggleChat(); }, close: closeChat, toggle: toggleChat }; })(); HavanChat.init({ position: 'bottom-right', // ou 'bottom-left' primaryColor: '#0046FF' // cor do botão (opcional) });

Esta é uma loja de demonstração. Por favor, acesse https://www.havan.com.br

Livro 365 Histórias Narradas Com Carinho Ciranda Cultural - 9786555009644

Código:
366939-1
R$ 24,99
ou 5x de R$ 4,99 sem juros
Sobre o produto
Loading

Forma de entrega

Calcule frete, prazo de entrega e retirada

O prazo de entrega começa a contar a partir da confirmação do pagamento.

Outras opções: