- site/blueprints/blocks/jeu.yml : champ URL pour l'iframe - site/snippets/blocks/jeu.php : rendu HTML statique (container + overlay + bouton désactivation) - Article.svelte : $effect pour attacher les handlers clic sur .iframe-game-container et onMount pour écouter postMessage GameReleaseFocus depuis impact.games Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
19 lines
593 B
PHP
19 lines
593 B
PHP
<?php if ($block->url()->isNotEmpty()): ?>
|
|
<div class="iframe-game-container">
|
|
<iframe
|
|
loading="eager"
|
|
importance="high"
|
|
width="400"
|
|
height="650"
|
|
style="float: right; border: medium; overflow: hidden; margin: 10px; pointer-events: none;"
|
|
src="<?= $block->url()->html() ?>"
|
|
></iframe>
|
|
<div class="iframe-click-overlay">
|
|
<div class="overlay-content">
|
|
<div class="play-icon">▶</div>
|
|
<p>Cliquez pour jouer</p>
|
|
</div>
|
|
</div>
|
|
<button class="iframe-deactivate-btn" title="Deactivate game (restore scrolling)">✕</button>
|
|
</div>
|
|
<?php endif ?>
|