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.
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
<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>
|
||||
@@ -11,6 +11,10 @@
|
||||
'assets/css/chess.css'
|
||||
]) ?>
|
||||
|
||||
<?= js([
|
||||
'assets/js/pgn4web.js'
|
||||
]) ?>
|
||||
|
||||
<link rel="shortcut icon" type="image/x-icon"
|
||||
href="<?= url('assets/favicon.ico') ?>">
|
||||
</head>
|
||||
|
||||
Reference in New Issue
Block a user