Petits ajustements
This commit is contained in:
parent
f49310ff5f
commit
72f1a72b7c
3 changed files with 46 additions and 5 deletions
30
embed/embed.html
Normal file
30
embed/embed.html
Normal file
|
@ -0,0 +1,30 @@
|
|||
<style>
|
||||
.responsive-iframe-container {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
width: 100%;
|
||||
padding-top: 125%; /* Aspect ratio: 540:675 (height/width = 1.25) */
|
||||
}
|
||||
.responsive-iframe-container iframe {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border: 0;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="responsive-iframe-container">
|
||||
<iframe src="https://deconstruit-breakout.coolify.jevalide.ca/game" style="overflow: hidden;"></iframe>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
window.addEventListener('message', function(e) {
|
||||
if (e.data.type === 'setHeight') {
|
||||
var container = document.querySelector('.responsive-iframe-container');
|
||||
var aspectRatio = e.data.height / e.data.width;
|
||||
container.style.paddingTop = (aspectRatio * 100) + '%';
|
||||
}
|
||||
}, false);
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue