Files
schachfreunde-badsteben/site/snippets/blocks/pgn4web.php
T
tfeigel 6fe47279b0 feat: add PGN4Web block support and integrate chess game replay features
Implemented a new PGN4Web block with a PHP snippet for game replay functionality. Updated blueprints with PGN-specific fields, modified layout and blockpage templates, and included necessary JavaScript and assets for interactive chess game rendering. Enhanced memorial page with replayable game content.
2025-07-06 13:36:43 +02:00

36 lines
1.1 KiB
PHP

<script>
SetPgnUrl("<?= $block->pgn()->toFile()->url() ?>");
SetImagePath("/assets/pgnviewer/images");
SetImageType("png");
SetHighlightOption(true);
SetGameSelectorOptions(null, false, 0, 0, 0, 15, 15, 0, 10);
SetCommentsIntoMoveText(false);
SetCommentsOnSeparateLines(false);
SetAutoplayDelay(1000);
SetAutostartAutoplay(false);
SetAutoplayNextGame(false);
SetInitialGame(1);
SetInitialVariation(0);
SetInitialHalfmove(0, false);
SetShortcutKeysEnabled(false);
SetLiveBroadcast(1, false, false, false, false);
</script>
<div class="gap-2 grid grid-cols-1 lg:grid lg:grid-cols-2 lg:px-8 max-w-7xl mx-auto px-4 py-8 sm:px-6 text-black">
<div>
<div class="w-full" id="GameBoard"></div>
<div class="hover:cursor-pointer" id="GameButtons"></div>
</div>
<div>
<div>
<div id="GameEvent" class="text-2xl py-2"></div>
<div id="GameWhite" class="text-xl pt-2"></div>
<div id="GameBlack" class="text-xl"></div>
<div id="GameResult" class="text-xl"></div>
</div>
<div id="GameText" class="py-2"></div>
</div>
</div>