b29a21780f
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.
33 lines
649 B
PHP
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() ?>
|