UNPKG

@neo_auth/neo-sso

Version:
28 lines (25 loc) 1.15 kB
function renderPopup(successUrl, integrationID) { const appURL = `https://tethysfaceid.herokuapp.com/?url=${successUrl}&&integrationID=${integrationID}`; const isExist = document.getElementById('popupApp'); if (!isExist) { const iframe = document.createElement('iframe'); iframe.allow = 'camera;microphone'; iframe.src = appURL; iframe.id = 'popupApp'; const leftHeight = (window.screen.width - 600) / 2; const topHeight = (window.screen.height - 600) / 4; iframe.style = `position: fixed;left:${leftHeight}px;top:${topHeight}px;z-index: 1000;width: 600px;height: 600px; border: transparent;`; const background = document.createElement('div'); background.id = 'overlay-modal'; background.style = `position: fixed;top: 0;right: 0;bottom: 0;left: 0;z-index: 1000;height: 100%;background-color: rgba(0, 0, 0, 0.80);`; var element = document.getElementsByTagName('body')[0]; element.appendChild(background); element.appendChild(iframe); } } export function main() { renderPopup(); } export function showModal({ successUrl, integrationID }) { renderPopup(successUrl, integrationID); }