Difference between revisions of "Widget:Ppplanner05"
Line 1: | Line 1: | ||
− | <div id="container" style="position: relative; cursor: pointer; border: 1px solid #ccc; | + | <div id="container" style="position: relative; cursor: pointer; width: 790px; margin: 0 auto; border: 1px solid #ccc; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);"> |
− | <img id="runImage" src="https://docs.analytica.com/images/d/d2/Ppplanner03.png" style="width: | + | <img id="runImage" src="https://docs.analytica.com/images/d/d2/Ppplanner03.png" style="width: 100%; height: auto; display: block;"> |
</div> | </div> | ||
Line 10: | Line 10: | ||
function showIframe() { | function showIframe() { | ||
− | |||
runImage.style.display = 'none'; | runImage.style.display = 'none'; | ||
if (interactButton) { | if (interactButton) { | ||
Line 17: | Line 16: | ||
if (!iframeAdded) { | if (!iframeAdded) { | ||
− | |||
const iframe = document.createElement('iframe'); | const iframe = document.createElement('iframe'); | ||
iframe.src = 'https://acp.analytica.com/view0?invite=4711&code=3885603542485212689'; | iframe.src = 'https://acp.analytica.com/view0?invite=4711&code=3885603542485212689'; | ||
− | iframe.style.width = ' | + | iframe.style.width = '100%'; |
− | iframe.style.height = ' | + | iframe.style.height = '400px'; // Match the height proportionally for 790px width |
iframe.style.border = 'none'; | iframe.style.border = 'none'; | ||
− | |||
container.appendChild(iframe); | container.appendChild(iframe); | ||
iframeAdded = true; | iframeAdded = true; | ||
− | |||
const maximizeButton = document.createElement('button'); | const maximizeButton = document.createElement('button'); | ||
maximizeButton.style.position = 'absolute'; | maximizeButton.style.position = 'absolute'; | ||
Line 43: | Line 39: | ||
maximizeButton.title = 'Click to use full screen'; | maximizeButton.title = 'Click to use full screen'; | ||
− | + | maximizeButton.addEventListener('click', function () { | |
− | maximizeButton.addEventListener(' | + | if (container.requestFullscreen) { |
− | + | container.requestFullscreen(); | |
− | + | } else if (container.webkitRequestFullscreen) { container.webkitRequestFullscreen(); } | |
− | + | else if (container.msRequestFullscreen) { container.msRequestFullscreen(); } | |
− | + | ||
− | maximizeButton.style. | + | iframe.style.width = '100%'; |
− | + | iframe.style.height = '100%'; | |
+ | maximizeButton.style.display = 'none'; | ||
+ | minimizeButton.style.display = 'inline-block'; | ||
}); | }); | ||
− | |||
const minimizeButton = document.createElement('button'); | const minimizeButton = document.createElement('button'); | ||
minimizeButton.style.position = 'absolute'; | minimizeButton.style.position = 'absolute'; | ||
Line 69: | Line 66: | ||
minimizeButton.style.display = 'none'; | minimizeButton.style.display = 'none'; | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
minimizeButton.addEventListener('click', function () { | minimizeButton.addEventListener('click', function () { | ||
if (document.exitFullscreen) { | if (document.exitFullscreen) { | ||
document.exitFullscreen(); | document.exitFullscreen(); | ||
− | } else if (document.webkitExitFullscreen) { | + | } else if (document.webkitExitFullscreen) { document.webkitExitFullscreen(); } |
− | + | else if (document.msExitFullscreen) { document.msExitFullscreen(); } | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
+ | iframe.style.width = '100%'; | ||
+ | iframe.style.height = '400px'; | ||
minimizeButton.style.display = 'none'; | minimizeButton.style.display = 'none'; | ||
maximizeButton.style.display = 'inline-block'; | maximizeButton.style.display = 'inline-block'; | ||
}); | }); | ||
− | |||
container.appendChild(maximizeButton); | container.appendChild(maximizeButton); | ||
container.appendChild(minimizeButton); | container.appendChild(minimizeButton); | ||
Line 121: | Line 83: | ||
} | } | ||
− | |||
const interactButton = document.createElement('button'); | const interactButton = document.createElement('button'); | ||
interactButton.textContent = "Click to interact with the model in Analytica Cloud Platform"; | interactButton.textContent = "Click to interact with the model in Analytica Cloud Platform"; | ||
interactButton.style.position = 'absolute'; | interactButton.style.position = 'absolute'; | ||
− | interactButton.style.bottom = ' | + | interactButton.style.bottom = '10px'; |
− | interactButton.style.right = ' | + | interactButton.style.right = '10px'; |
− | interactButton.style.padding = ' | + | interactButton.style.padding = '10px 20px'; |
− | interactButton.style.fontSize = ' | + | interactButton.style.fontSize = '14px'; |
− | interactButton.style.fontWeight = 'bold'; | + | interactButton.style.fontWeight = 'bold'; |
− | interactButton.style.backgroundColor = '#d3d3d3'; | + | interactButton.style.backgroundColor = '#d3d3d3'; |
− | interactButton.style.color = 'black'; | + | interactButton.style.color = 'black'; |
interactButton.style.border = 'none'; | interactButton.style.border = 'none'; | ||
interactButton.style.borderRadius = '5px'; | interactButton.style.borderRadius = '5px'; | ||
Line 137: | Line 98: | ||
interactButton.style.opacity = '0.9'; | interactButton.style.opacity = '0.9'; | ||
− | |||
interactButton.addEventListener('click', function (event) { | interactButton.addEventListener('click', function (event) { | ||
− | event.stopPropagation(); | + | event.stopPropagation(); |
showIframe(); | showIframe(); | ||
}); | }); | ||
− | |||
container.appendChild(interactButton); | container.appendChild(interactButton); | ||
− | |||
− | |||
container.addEventListener('click', showIframe); | container.addEventListener('click', showIframe); | ||
}); | }); | ||
</script> | </script> |
Revision as of 05:23, 10 November 2024
<img id="runImage" src="https://docs.analytica.com/images/d/d2/Ppplanner03.png" style="width: 100%; height: auto; display: block;">
<script> document.addEventListener('DOMContentLoaded', function () {
let iframeAdded = false; const container = document.getElementById('container'); const runImage = document.getElementById('runImage');
function showIframe() { runImage.style.display = 'none'; if (interactButton) { interactButton.style.display = 'none'; }
if (!iframeAdded) { const iframe = document.createElement('iframe'); iframe.src = 'https://acp.analytica.com/view0?invite=4711&code=3885603542485212689'; iframe.style.width = '100%'; iframe.style.height = '400px'; // Match the height proportionally for 790px width iframe.style.border = 'none';
container.appendChild(iframe); iframeAdded = true;
const maximizeButton = document.createElement('button'); maximizeButton.style.position = 'absolute'; maximizeButton.style.bottom = '10px'; maximizeButton.style.right = '100px'; maximizeButton.style.width = '30px'; maximizeButton.style.height = '30px'; maximizeButton.style.backgroundImage = 'url("https://docs.analytica.com/images/9/9c/Arrows-maximize.png")'; maximizeButton.style.backgroundSize = 'contain'; maximizeButton.style.backgroundRepeat = 'no-repeat'; maximizeButton.style.backgroundColor = 'transparent'; maximizeButton.style.border = 'none'; maximizeButton.style.cursor = 'pointer'; maximizeButton.title = 'Click to use full screen';
maximizeButton.addEventListener('click', function () { if (container.requestFullscreen) { container.requestFullscreen(); } else if (container.webkitRequestFullscreen) { container.webkitRequestFullscreen(); } else if (container.msRequestFullscreen) { container.msRequestFullscreen(); }
iframe.style.width = '100%'; iframe.style.height = '100%'; maximizeButton.style.display = 'none'; minimizeButton.style.display = 'inline-block'; });
const minimizeButton = document.createElement('button'); minimizeButton.style.position = 'absolute'; minimizeButton.style.bottom = '8px'; minimizeButton.style.right = '120px'; minimizeButton.style.width = '30px'; minimizeButton.style.height = '30px'; minimizeButton.style.backgroundImage = 'url("https://docs.analytica.com/images/8/82/Arrows-minimize.png")'; minimizeButton.style.backgroundSize = 'contain'; minimizeButton.style.backgroundRepeat = 'no-repeat'; minimizeButton.style.backgroundColor = 'transparent'; minimizeButton.style.border = 'none'; minimizeButton.style.cursor = 'pointer'; minimizeButton.title = 'Exit full screen'; minimizeButton.style.display = 'none';
minimizeButton.addEventListener('click', function () { if (document.exitFullscreen) { document.exitFullscreen(); } else if (document.webkitExitFullscreen) { document.webkitExitFullscreen(); } else if (document.msExitFullscreen) { document.msExitFullscreen(); }
iframe.style.width = '100%'; iframe.style.height = '400px'; minimizeButton.style.display = 'none'; maximizeButton.style.display = 'inline-block'; });
container.appendChild(maximizeButton); container.appendChild(minimizeButton); } }
const interactButton = document.createElement('button'); interactButton.textContent = "Click to interact with the model in Analytica Cloud Platform"; interactButton.style.position = 'absolute'; interactButton.style.bottom = '10px'; interactButton.style.right = '10px'; interactButton.style.padding = '10px 20px'; interactButton.style.fontSize = '14px'; interactButton.style.fontWeight = 'bold'; interactButton.style.backgroundColor = '#d3d3d3'; interactButton.style.color = 'black'; interactButton.style.border = 'none'; interactButton.style.borderRadius = '5px'; interactButton.style.cursor = 'pointer'; interactButton.style.opacity = '0.9';
interactButton.addEventListener('click', function (event) { event.stopPropagation(); showIframe(); });
container.appendChild(interactButton); container.addEventListener('click', showIframe);
}); </script>