kissshout`; const lineHtml = lineText ? `
`:''; const wechatId = `kissshout`; const wechatHtml = wechatId ? ` `:''; const phoneNumber = `0909999065`; const phoneHtml = phoneNumber ? ` `:''; dialog.innerHTML = ` `; const isDisplay = () => { return overlay.getAttribute('data-active') === 'true'; }; const setDisplay = () => { document.body.style.overflow = 'hidden'; overlay.setAttribute('data-active',true); dialog.setAttribute('data-active',true); }; const setHide = () => { document.body.style.overflow = ''; overlay.removeAttribute('data-active'); dialog.removeAttribute('data-active'); }; overlay.addEventListener('click', () => { setHide() }); const btnWechat = dialog.querySelector('.inn-edge-contact__item__link_wechat'); btnWechat.addEventListener('click', (e) => { e.preventDefault(); if(btnWechat.getAttribute('data-active')){ btnWechat.removeAttribute('data-active'); return; } const input = document.createElement('input'); input.value = 'kissshout'; document.body.appendChild(input); input.select(); document.execCommand('copy'); document.body.removeChild(input); btnWechat.setAttribute('data-active',true); }); const close = dialog.querySelector('.inn-edge-contact__dialog__close'); close.addEventListener('click', (e) => { e.preventDefault(); setHide() }); const btn = document.createElement('div'); btn.className = 'inn-edge-contact__btn'; btn.innerHTML = ` `; btn.addEventListener('click', () => { if(isDisplay()){ setHide(); return; } setDisplay(); }); ready(()=>{ document.body.appendChild(overlay); document.body.appendChild(btn); document.body.appendChild(dialog); }); })(); -->