Skip to content

Commit d723b6f

Browse files
committed
ChessConnect docs
1 parent 5063dfa commit d723b6f

4 files changed

Lines changed: 100 additions & 8 deletions

File tree

docs/content.json

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
"title": "Build Your Own",
66
"titleAccent": "Smart Chess Board",
77
"description": "A complete step-by-step guide to building an ESP32-powered chess board, 100% DIY, with LED move indicators, hall-effect piece detection, Stockfish AI, and Lichess online play.",
8-
"image": "video.gif"
8+
"image": "video.gif",
9+
"videoEmbed": "<iframe width=\"560\" height=\"315\" src=\"https://www.youtube.com/embed/bYm5_dK6EnQ?start=29\" title=\"YouTube video player\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen></iframe>"
910
},
1011
"materials": {
1112
"navLabel": "Materials",
@@ -709,6 +710,8 @@
709710
{
710711
"title": "Demo Video",
711712
"centerContent": true,
713+
"videoEmbed": "<iframe width=\"560\" height=\"315\" src=\"https://www.youtube.com/embed/bYm5_dK6EnQ?start=29\" title=\"YouTube video player\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen></iframe>",
714+
"videoMaxWidth": "600px",
712715
"images": [
713716
{
714717
"file": "video.gif",
@@ -726,7 +729,7 @@
726729
"title": "Software Setup",
727730
"intro": "With the hardware built, flash the firmware to bring your chess board to life.",
728731
"webInstaller": {
729-
"text": "<h3><strong>⚡ Quick Flash</strong></h3>Don't want to build firmware from sources? Use the <a href=\"flash.html\">Web Installer</a> to flash your ESP32 directly from the browser (Chrome/Edge only)</br>",
732+
"text": "<h3><strong>⚡ Quick Flash</strong></h3>Use the <a href=\"flash.html\">Web Installer</a> to flash your ESP32 directly from the browser (Chrome/Edge only)</br>",
730733
"buttonText": "Open Web Installer",
731734
"buttonUrl": "flash.html"
732735
},
@@ -742,11 +745,12 @@
742745
]
743746
},
744747
{
745-
"title": "2. Flash",
748+
"title": "2. Compile & Flash",
746749
"items": [
747750
"Connect the ESP32 via USB",
748751
"Hold the <strong>BOOT</strong> button on the ESP32",
749-
"Click <strong>Upload</strong> (<kbd>Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>U</kbd>) in Visual Studio Code"
752+
"Click <strong>Upload</strong> (<kbd>Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>U</kbd>) in Visual Studio Code",
753+
"⚠️ Compiling from sources <span style=\"color: var(--red);\">won't include</span> <strong>ChessConnect</strong> (use the Web Installer for that feature)"
750754
]
751755
},
752756
{
@@ -769,7 +773,8 @@
769773
"title": "5. Play!",
770774
"items": [
771775
"Power on the board - LEDs light up in the center for game selection",
772-
"Place a piece on a lit square:<ul><li><strong style=\"color: #2196F3;\">Blue</strong> - Human vs Human</li><li><strong style=\"color: #4CAF50;\">Green</strong> - Human vs Stockfish</li><li><strong style=\"color: #FFEB3B;\">Yellow</strong> - Online (Lichess)</li><li><strong style=\"color: #F44336;\">Red</strong> - Sensor Test</li></ul>"
776+
"Place a piece on a lit square:<ul><li><strong style=\"color: #2196F3;\">Blue</strong> - Human vs Human</li><li><strong style=\"color: #4CAF50;\">Green</strong> - Human vs Stockfish</li><li><strong style=\"color: #FFEB3B;\">Yellow</strong> - Online (Lichess)</li><li><strong style=\"color: #F44336;\">Red</strong> - Sensor Test</li></ul>",
777+
"<strong>ChessConnect</strong><ul><li>Download the <a href=\"https://chessconnect.de\" target=\"_blank\">ChessConnect</a> app or extension</li><li>In the OpenChess WebUI, choose a board to emulate and start the BLE server</li><li>In ChessConnect, select the emulated board and connect</li><li>Start a game right from ChessConnect</li><li>Watch the <a href=\"https://youtu.be/bYm5_dK6EnQ\" target=\"_blank\">video guide</a></li></ul>"
773778
]
774779
}
775780
],

docs/flash.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,9 @@ <h2><span class="step-number">3</span> After Flashing</h2>
276276
Calibration data is saved and only needs to be done once
277277
</li>
278278
<li>
279-
Start a game from the web interface or by placing a piece on the physical board
279+
Start a game from the WebUI,
280+
<a href="https://youtu.be/bYm5_dK6EnQ" target="_blank">ChessConnect</a>
281+
, or by placing a piece on the physical board
280282
</li>
281283
</ul>
282284
</div>

docs/script.js

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,19 +42,30 @@
4242

4343
function buildSingleImage(imgData) {
4444
const container = el('div', { className: 'image-container' });
45+
if (imgData.maxWidth) {
46+
container.classList.add('media-bounded');
47+
container.style.maxWidth = imgData.maxWidth;
48+
}
49+
if (imgData.noZoom) container.classList.add('image-static');
4550
const attrs = {
4651
src: IMG + encodeURI(imgData.file),
4752
alt: imgData.alt || ''
4853
};
4954
if (!imgData.noZoom) attrs.className = 'zoomable';
50-
if (imgData.maxWidth) attrs.style = { maxWidth: imgData.maxWidth };
5155
container.append(el('img', attrs));
5256
if (imgData.caption) {
5357
container.append(el('span', { className: 'image-caption' }, imgData.caption));
5458
}
5559
return container;
5660
}
5761

62+
function buildVideoEmbed(embedHtml, maxWidth) {
63+
const container = el('div', { className: 'video-embed' });
64+
if (maxWidth) container.style.maxWidth = maxWidth;
65+
container.innerHTML = embedHtml;
66+
return container;
67+
}
68+
5869
// ---------- Add nav link ----------
5970
function addNavLink(href, label, isFirst) {
6071
const li = el('li');
@@ -77,7 +88,17 @@
7788
);
7889

7990
const imgDiv = el('div', { className: 'hero-image' });
80-
imgDiv.append(el('img', { src: IMG + hero.image, alt: 'OpenChess demo' }));
91+
if (hero.image && hero.videoEmbed) {
92+
imgDiv.classList.add('hero-media-pair');
93+
imgDiv.append(
94+
el('img', { src: IMG + hero.image, alt: 'OpenChess demo' }),
95+
buildVideoEmbed(hero.videoEmbed)
96+
);
97+
} else if (hero.videoEmbed) {
98+
imgDiv.append(buildVideoEmbed(hero.videoEmbed));
99+
} else {
100+
imgDiv.append(el('img', { src: IMG + hero.image, alt: 'OpenChess demo' }));
101+
}
81102

82103
section.append(textDiv, imgDiv);
83104
contentEl.append(section);
@@ -123,6 +144,10 @@
123144
if (step.items && step.items.length)
124145
step.items.forEach(item => card.insertAdjacentHTML('beforeend', item));
125146

147+
if (step.videoEmbed) {
148+
card.append(buildVideoEmbed(step.videoEmbed, step.videoMaxWidth));
149+
}
150+
126151
if (step.images && step.images.length) {
127152
// Demo gallery: split into rows of 2
128153
if (sec.id === 'demo' && step.images.length > 2 && !step.centerContent) {

docs/style.css

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,12 +217,51 @@ kbd {
217217
max-width: 480px;
218218
}
219219

220+
.hero-image.hero-media-pair {
221+
flex: 1.4;
222+
display: grid;
223+
grid-template-columns: repeat(2, minmax(0, 1fr));
224+
gap: 1rem;
225+
align-items: center;
226+
max-width: 820px;
227+
}
228+
229+
.video-embed {
230+
width: 100%;
231+
margin: 0 auto;
232+
aspect-ratio: 16 / 9;
233+
overflow: hidden;
234+
border-radius: var(--radius);
235+
border: 1px solid var(--border);
236+
background: var(--bg-secondary);
237+
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
238+
}
239+
240+
.video-embed iframe {
241+
display: block;
242+
width: 100%;
243+
height: 100%;
244+
border: 0;
245+
}
246+
247+
.video-embed+.image-container,
248+
.video-embed+.image-row {
249+
margin-top: 1.5rem;
250+
}
251+
220252
.hero-image img {
253+
width: 100%;
221254
border-radius: var(--radius);
222255
border: 1px solid var(--border);
223256
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
224257
}
225258

259+
.hero-media-pair>img {
260+
aspect-ratio: 16 / 9;
261+
object-fit: contain;
262+
background: var(--bg-secondary);
263+
}
264+
226265
.btn-primary,
227266
.btn-secondary {
228267
display: inline-block;
@@ -310,6 +349,11 @@ kbd {
310349
background: var(--bg-secondary);
311350
}
312351

352+
.image-container.media-bounded {
353+
margin-left: auto;
354+
margin-right: auto;
355+
}
356+
313357
.image-container img {
314358
width: 100%;
315359
max-height: 60vh;
@@ -322,6 +366,14 @@ kbd {
322366
transform: scale(1.02);
323367
}
324368

369+
.image-container.image-static img {
370+
cursor: default;
371+
}
372+
373+
.image-container.image-static img:hover {
374+
transform: none;
375+
}
376+
325377
.image-caption {
326378
display: block;
327379
text-align: center;
@@ -579,6 +631,10 @@ footer {
579631
max-width: 360px;
580632
}
581633

634+
.hero-image.hero-media-pair {
635+
max-width: min(100%, 760px);
636+
}
637+
582638
.section {
583639
padding: 3rem 2rem;
584640
}
@@ -615,6 +671,10 @@ footer {
615671
padding: 2rem 1.25rem;
616672
}
617673

674+
.hero-image.hero-media-pair {
675+
grid-template-columns: 1fr;
676+
}
677+
618678
.section {
619679
padding: 2rem 1.25rem;
620680
}

0 commit comments

Comments
 (0)