Files
schachfreunde-badsteben/site/templates/blockpage.php
T
tfeigel b29a21780f feat: add FEN block support and related assets
Introduced a new FEN block feature, including a PHP snippet to render FEN diagrams, a new CSS file for chessboard styling, font integration, and blueprint updates. Adjusted asset paths and file references for consistency.
2025-06-29 16:08:31 +02:00

33 lines
649 B
PHP

<?php
// FEN in Array umwandeln
function fenToBoard($fen) {
$rows = explode('/', explode(' ', $fen)[0]);
$board = [];
foreach ($rows as $row) {
$boardRow = [];
$chars = str_split($row);
foreach ($chars as $char) {
if (is_numeric($char)) {
for ($i = 0; $i < intval($char); $i++) {
$boardRow[] = '';
}
} else {
$boardRow[] = $char;
}
}
$board[] = $boardRow;
}
return $board;
} ?>
<?php
snippet('layout', slots: true) ?>
<?= $page->blocks()->toBlocks() ?>
<?php
endsnippet() ?>