-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.html
More file actions
43 lines (40 loc) · 1.56 KB
/
example.html
File metadata and controls
43 lines (40 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<script src=fenSet.js></script>
<style>
.fen{
font-family: "OpenChessFont"; /*font-family and line-height are essential*/
line-height: 1em;
font-size: 24pt;
break-inside: avoid;
page-break-inside: avoid;
width: fit-content;
}
.darkmode{
background-color: black;
color: white;
}
</style>
</head>
<body>
<h1>fenSet.js example document</h1>
<h3>Make sure you have <a href="https://github.com/joshwalters/open-chess-font/">OpenChessFont.otf</a> installed!</h2>
<p>Using fenSet.js, FEN strings are converted to diagrams for use with chess symbol fonts on page load.</p>
<p>Simply put your positions in divs with class "fen" and use CSS to style them.</p>
<div class="fen">
rnbqkbnr/pp1ppppp/8/2p5/4P3/5N2/PPPP1PPP/RNBQKB1R b KQkq - 1 2
</div>
<p>To make a diagram from black's perspective, also put "flipped" in the div's class.</p>
<div class="fen flipped">
rnbqkbnr/pp1ppppp/8/2p5/4P3/5N2/PPPP1PPP/RNBQKB1R b KQkq - 1 2
</div>
<p>For white characters on black backgrounds, use the "darkmode" class</p>
<div class="fen darkmode">
rnbqkbnr/pp1ppppp/8/2p5/4P3/5N2/PPPP1PPP/RNBQKB1R b KQkq - 1 2
</div>
<p>If your chess font uses different letters for each glyph, change fenSet.symbolMap accrordingly.</p>
<p>fenSet.js also works with <a href = "https://vivliostyle.org">Vivliostyle</a>.</p>
</body>
</html>