Merge pull request 'WEB-2: FEN-Block erstellen' (#2) from develop into main

Reviewed-on: https://git.feigel.it/SFBadSteben/schachfreunde-badsteben/pulls/2
This commit is contained in:
2025-06-29 16:22:06 +02:00
30 changed files with 246 additions and 38 deletions
+5
View File
@@ -0,0 +1,5 @@
@font-face {
font-family: 'Case';
src: url('../fonts/CASEFONT.TTF');
font-weight: normal;
}
Binary file not shown.
@@ -24,3 +24,8 @@
font-weight: bold; font-weight: bold;
} }
@font-face {
font-family: 'Case';
src: url('CASEFONT.TTF');
font-weight: normal;
}
+1 -1
View File
@@ -1474,7 +1474,7 @@ var InitialHalfMoveClock = 0;
var PieceImg = new Array(new Array(6), new Array(6)); var PieceImg = new Array(new Array(6), new Array(6));
var ClearImg; var ClearImg;
var ImagePath = 'images'; var ImagePath = '/images';
var ImagePathOld = null; var ImagePathOld = null;
var imageType = 'png'; var imageType = 'png';
var defaultImagesSize = 40; var defaultImagesSize = 40;
+3 -1
View File
@@ -1,3 +1,5 @@
Title: News Title: News
---- ----
Uuid: qtyyzjcbmgvhwzod
+5
View File
@@ -0,0 +1,5 @@
Title: Spielbetrieb
----
Uuid: 5s5p2bqdwq6qch1j
@@ -0,0 +1,5 @@
Title: Mitgliedschaft
----
Uuid: rlflifjcp5qi27ib
@@ -1,3 +0,0 @@
Title: Mitgliedschaft
----
+5
View File
@@ -0,0 +1,5 @@
Title: Vorstand
----
Uuid: zl70xxrrqevgvku0
-3
View File
@@ -1,3 +0,0 @@
Title: Vorstand
----
+17
View File
@@ -0,0 +1,17 @@
Title: DWZ-Liste
----
Herotext: Hier finden Sie die aktuelle DWZ-Liste unseres Vereins.
----
Herobutton: DWZ beim DSB
----
Buttonlink: https://www.schachbund.de/verein/25318.html
----
Uuid: ryyutobtiiyatw7j
-15
View File
@@ -1,15 +0,0 @@
Title: DWZ-Liste
----
HeroText: Hier finden Sie die aktuelle DWZ-Liste unseres Vereins.
----
HeroButton: DWZ beim DSB
----
ButtonLink: https://www.schachbund.de/verein/25318.html
----
-3
View File
@@ -1,3 +0,0 @@
Title: Chronik
----
+5
View File
@@ -0,0 +1,5 @@
Title: Chronik
----
Uuid: 0ut1fn7p6tlqgfhq
+37
View File
@@ -0,0 +1,37 @@
Title: In Memoriam
----
Blocks:
[
{
"content": {
"level": "h2",
"text": "Dies ist ein Test!"
},
"id": "eb2cb2e3-19f6-4c17-a786-723cdbc8f811",
"isHidden": false,
"type": "heading"
},
{
"content": {
"fen": "rnbqkbnr/p1pp1ppp/1p2p3/8/3P1B2/5N2/PPP1PPPP/RN1QKB1R b KQkq - 1 3"
},
"id": "067a448c-31e5-411c-b342-f69519284394",
"isHidden": false,
"type": "fen"
},
{
"content": {
"fen": "8/8/8/2k5/4K3/8/8/8"
},
"id": "970b3cad-3f89-4f19-8be0-c702c522caf4",
"isHidden": false,
"type": "fen"
}
]
----
Uuid: ko01ys2cbv2pafa8
-3
View File
@@ -1,3 +0,0 @@
Title: In Memoriam
----
+5
View File
@@ -0,0 +1,5 @@
Title: Verein
----
Uuid: yeiiv0ebkrobjp8k
+3 -1
View File
@@ -2,6 +2,8 @@ Title: Termine
---- ----
HeroText: Wir möchten Sie gerne über die bevorstehenden Termine in unserem Verein informieren. Halten Sie sich bereit für spannende Ereignisse und Veranstaltungen, die bald anstehen. Details zu den Terminen und Veranstaltungen finden Sie auf unserer Homepage. Herotext: Wir möchten Sie gerne über die bevorstehenden Termine in unserem Verein informieren. Halten Sie sich bereit für spannende Ereignisse und Veranstaltungen, die bald anstehen. Details zu den Terminen und Veranstaltungen finden Sie auf unserer Homepage.
---- ----
Uuid: 05jzuqnmxpgkbo8i
+3 -1
View File
@@ -1,3 +1,5 @@
Title: Kontakt Title: Kontakt
---- ----
Uuid: usx96dfncvtmlu4y
+3 -1
View File
@@ -1,3 +1,5 @@
Title: Archiv Title: Archiv
---- ----
Uuid: dbfwxxauqvvrrnty
+3 -1
View File
@@ -1,3 +1,5 @@
Title: Datenschutz Title: Datenschutz
---- ----
Uuid: l2q8zjmzmyp7zlin
+2
View File
@@ -1,3 +1,5 @@
Title: Impressum Title: Impressum
---- ----
Uuid: oxsovh9ibr2lyjyj
+3 -1
View File
@@ -1,3 +1,5 @@
Title: Satzung Title: Satzung
---- ----
Uuid: hjr3lpfsxvroto1e
+1 -1
View File
@@ -10,4 +10,4 @@
"watch": "npx @tailwindcss/cli -i ./src/css/input.css -o ./assets/css/styles.css --content './site/**/*.php' --watch", "watch": "npx @tailwindcss/cli -i ./src/css/input.css -o ./assets/css/styles.css --content './site/**/*.php' --watch",
"build": "npx @tailwindcss/cli -i ./src/css/input.css -o ./assets/css/styles.css --content './site/**/*.php'" "build": "npx @tailwindcss/cli -i ./src/css/input.css -o ./assets/css/styles.css --content './site/**/*.php'"
} }
} }
+18
View File
@@ -0,0 +1,18 @@
title: Block Page
fields:
blocks:
type: blocks
pretty: true
fieldsets:
- heading
- text
- image
- type: fen
label: FEN-Diagramm
preview: fields
wysiwyg: true
fields:
fen:
type: text
label: FEN-Position
+20
View File
@@ -0,0 +1,20 @@
title: Verein
columns:
main:
width: 2/3
sections:
fields:
type: fields
fields:
text:
type: textarea
size: huge
sidebar:
width: 1/3
sections:
pages:
type: pages
files:
type: files
+61
View File
@@ -0,0 +1,61 @@
<?php
// Beispiel-FEN (kann ersetzt werden)
$fen = $block->fen();
// Unicode-Mapping
$pieceUnicode = [
'K' => 'k', 'Q' => 'q', 'R' => 'r', 'B' => 'b', 'N' => 'n', 'P' => 'p',
'k' => 'l', 'q' => 'w', 'r' => 't', 'b' => 'v', 'n' => 'm', 'p' => 'o',
];
$board = fenToBoard($fen);
?>
<style>
.chessboard {
border: 3px solid #333;
border-radius: 2px;
display: inline-block;
}
.chessboard-row {
display: flex;
}
.chessboard-square {
width: 50px;
height: 50px;
display: flex;
align-items: center;
justify-content: center;
font-family: 'Case';
font-size: 3rem;
}
.chessboard-light {
background: #ededed;
}
.chessboard-dark {
background: #7e91c5;
}
</style>
<div class="flex justify-center py-8">
<div class="chessboard">
<?php for ($i = 0; $i < 8; $i++): ?>
<div class="chessboard-row">
<?php for ($j = 0; $j < 8; $j++):
$isLight = ($i + $j) % 2 == 1;
$piece = $board[$i][$j] ?? '';
$symbol = $pieceUnicode[$piece] ?? '';
?>
<div class="chessboard-square chessboard-<?= $isLight ? 'light' : 'dark' ?>">
<?php echo $symbol; ?>
</div>
<?php endfor; ?>
</div>
<?php endfor; ?>
</div>
</div>
+4 -2
View File
@@ -8,7 +8,7 @@
<?= css([ <?= css([
'assets/css/styles.css', 'assets/css/styles.css',
'assets/css/png4web.css', 'assets/css/chess.css'
]) ?> ]) ?>
<link rel="shortcut icon" type="image/x-icon" <link rel="shortcut icon" type="image/x-icon"
@@ -40,6 +40,8 @@
<footer class="bg-sf_grau-400 w-full" id="footer"> <footer class="bg-sf_grau-400 w-full" id="footer">
<?php snippet('footer') ?> <?php snippet('footer') ?>
</footer> </footer>
<?= js('assets/js/navbar.js') ?> <?= js([
'assets/js/navbar.js'
]) ?>
</body> </body>
</html> </html>
+32
View File
@@ -0,0 +1,32 @@
<?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() ?>
-1
View File
@@ -1,6 +1,5 @@
<?php snippet('layout', slots: true) ?> <?php snippet('layout', slots: true) ?>
<?php snippet('titel') ?>
<?php snippet('termine') ?> <?php snippet('termine') ?>
<?php endsnippet() ?> <?php endsnippet() ?>