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:
@@ -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;
|
||||||
|
}
|
||||||
@@ -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;
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
Title: News
|
Title: News
|
||||||
|
|
||||||
----
|
----
|
||||||
|
|
||||||
|
Uuid: qtyyzjcbmgvhwzod
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
Title: Spielbetrieb
|
||||||
|
|
||||||
|
----
|
||||||
|
|
||||||
|
Uuid: 5s5p2bqdwq6qch1j
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
Title: Mitgliedschaft
|
||||||
|
|
||||||
|
----
|
||||||
|
|
||||||
|
Uuid: rlflifjcp5qi27ib
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
Title: Mitgliedschaft
|
|
||||||
|
|
||||||
----
|
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
Title: Vorstand
|
||||||
|
|
||||||
|
----
|
||||||
|
|
||||||
|
Uuid: zl70xxrrqevgvku0
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
Title: Vorstand
|
|
||||||
|
|
||||||
----
|
|
||||||
@@ -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
|
||||||
@@ -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
|
|
||||||
|
|
||||||
----
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
Title: Chronik
|
|
||||||
|
|
||||||
----
|
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
Title: Chronik
|
||||||
|
|
||||||
|
----
|
||||||
|
|
||||||
|
Uuid: 0ut1fn7p6tlqgfhq
|
||||||
@@ -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
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
Title: In Memoriam
|
|
||||||
|
|
||||||
----
|
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
Title: Verein
|
||||||
|
|
||||||
|
----
|
||||||
|
|
||||||
|
Uuid: yeiiv0ebkrobjp8k
|
||||||
@@ -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
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
Title: Kontakt
|
Title: Kontakt
|
||||||
|
|
||||||
----
|
----
|
||||||
|
|
||||||
|
Uuid: usx96dfncvtmlu4y
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
Title: Archiv
|
Title: Archiv
|
||||||
|
|
||||||
----
|
----
|
||||||
|
|
||||||
|
Uuid: dbfwxxauqvvrrnty
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
Title: Datenschutz
|
Title: Datenschutz
|
||||||
|
|
||||||
----
|
----
|
||||||
|
|
||||||
|
Uuid: l2q8zjmzmyp7zlin
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
Title: Impressum
|
Title: Impressum
|
||||||
|
|
||||||
----
|
----
|
||||||
|
|
||||||
|
Uuid: oxsovh9ibr2lyjyj
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
Title: Satzung
|
Title: Satzung
|
||||||
|
|
||||||
----
|
----
|
||||||
|
|
||||||
|
Uuid: hjr3lpfsxvroto1e
|
||||||
@@ -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
|
||||||
@@ -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
|
||||||
|
|
||||||
@@ -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>
|
||||||
@@ -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>
|
||||||
|
|||||||
@@ -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,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() ?>
|
||||||
Reference in New Issue
Block a user