if (typeof badgeCompanyParams == "undefined" || !(badgeCompanyParams instanceof Array)) { var badgeCompanyParams = []; } badgeCompanyParams['6RPd2NrWb97o0xv'] = { src: 'https://compero.org/widgets/company-badge/6RPd2NrWb97o0xv/11/img', alt: 'My Home Service', url_profile: 'https://partner.compero.ch/my-home-service-6RPd2NrWb97o0xv', url_project: 'https://www.compero.ch/service/umzug/' }; var badgeLayerHtml = `
`; if (typeof cpfBadgeInited === 'undefined') { var css = ` .cpf-badge-lds-ring { width: 80px; height: 80px; align-items: center; justify-content: center; margin:auto; position:absolute; } .cpf-badge-lds-ring div { box-sizing: border-box; display: block; position: absolute; width: 64px; height: 64px; margin: 8px; border: 8px solid #95c23d; border-radius: 50%; animation: cpf-badge-lds-ring 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite; border-color: #95c23d transparent transparent transparent; } .cpf-badge-lds-ring div:nth-child(1) { animation-delay: -0.45s; } .cpf-badge-lds-ring div:nth-child(2) { animation-delay: -0.3s; } .cpf-badge-lds-ring div:nth-child(3) { animation-delay: -0.15s; } @keyframes cpf-badge-lds-ring { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } .cpf-badge-parent {display: flex;padding:5px;} .cpf-badge-child {position:relative; display: flex; min-height: 186px; margin: auto; box-shadow: 0 10px 32px hsla(0, 0%, 0%, .2); border-radius: 6px;align-items: center; justify-content: center;} .cpf-badge-parent a { display: block;position: absolute;top: 0%; width: 50%; height: 100%; } justify-content: center;} .cpf-badge-child img { display: block; max-width: 100%; width: 100%; width: 100%;} `; head = document.head || document.getElementsByTagName('head')[0], style = document.createElement('style'); head.appendChild(style); style.type = 'text/css'; if (style.styleSheet){ style.styleSheet.cssText = css; } else { style.appendChild(document.createTextNode(css)); } function removeLoader(id) { var badge = document.getElementById('compero_badge_'+id).querySelector('.cpf-badge-lds-ring').remove(); } var cpfBadgeInited = true; } (function() { var scripts = document.querySelectorAll('script[data-name="compero-company-badge"'); [].forEach.call(scripts, function(script){ var newBadge = document.createElement('div'); var badgeCid = script.getAttribute('data-cid'); console.log('test', windowvar); try { var windowvar = badgeCompanyParams[badgeCid]; console.log(windowvar.src) newBadge.innerHTML = badgeLayerHtml .replace(/__ID__/g, btoa(Math.random()).substr(10, 5)) .replace(/__src__/g, windowvar.src) .replace(/__alt__/g, windowvar.alt) .replace(/__url_profile__/g, windowvar.url_profile) .replace(/__url_project__/g, windowvar.url_project); script.replaceWith(newBadge); } catch(e) { } }); })();