function calculateRevenue(){
const leads=parseInt(document.getElementById('leads').value);
const contracts=parseInt(document.getElementById('contracts').value);
const conversion=parseInt(document.getElementById('conversion').value) / 100;
const deal=parseInt(document.getElementById('deal').value);
const projectedRevenue=leads * conversion * deal;
const actualRevenue=contracts * deal;
document.getElementById('result').innerHTML=`Die prognostizierte Einnahme beträgt ${projectedRevenue} Euro. <br> Die tatsächliche Einnahme bei ${contracts} gewonnenen Verträgen beträgt ${actualRevenue} Euro.`;
};
const copyEmbedCodeButton=document.getElementById('copy-embed-code');
const embedCodeInput=document.getElementById('embed-code');
const pageTitle=document.getElementById('page-title').textContent;
const pageURL=window.location.href;
const linkTitle=document.querySelector('h1').textContent||pageTitle;
const linkText=encodeURIComponent(linkTitle);
embedCodeInput.value=`<a href="${pageURL}">${linkTitle}${pageTitle}</a>`;
copyEmbedCodeButton.addEventListener('click', ()=> {
embedCodeInput.select();
document.execCommand ('copy');
alert('Einbettungscode wurde in die Zwischenablage kopiert!');
});
document.addEventListener('DOMContentLoaded', ()=> {
document.title=pageTitle;
document.getElementById('page-title').textContent=pageTitle;
});