feat(jeu): bloc Kirby iframe + logique click-to-play dans Article.svelte
- 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>
This commit is contained in:
parent
ef992708fc
commit
5b9b190b35
3 changed files with 87 additions and 0 deletions
19
site/snippets/blocks/jeu.php
Normal file
19
site/snippets/blocks/jeu.php
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
<?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 ?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue