Skip to content

Commit 8cf8638

Browse files
committed
feat: add instructional media for BEATBox assembly with GIFs and enhanced rendering
1 parent 197741d commit 8cf8638

4 files changed

Lines changed: 38 additions & 3 deletions

File tree

site/public/docs/beatbox-assembly-sop.html

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,20 @@
239239
font-size: .86rem;
240240
border-top: 1px solid var(--line);
241241
}
242+
.instruction-media.secondary {
243+
max-width: 520px;
244+
margin-top: 14px;
245+
margin-bottom: 0;
246+
}
247+
.instruction-media.secondary img {
248+
max-height: 260px;
249+
}
250+
.instruction-media figcaption a {
251+
color: var(--accent);
252+
font-weight: 650;
253+
text-decoration: none;
254+
}
255+
.instruction-media figcaption a:hover { text-decoration: underline; }
242256
.checklist { display: grid; gap: 8px; }
243257
.check-row {
244258
display: grid;
@@ -536,6 +550,12 @@ <h1 id="pageTitle"></h1>
536550
alt: 'Installing the BEATBox base foot assembly',
537551
caption: 'Base and foot assembly reference.'
538552
};
553+
basePrep.afterMedia = {
554+
src: '/videos/buidling_gifs/BEATBox_foot1-2-3.gif',
555+
alt: 'Secondary BEATBox foot assembly reference',
556+
caption: 'Secondary foot assembly reference for the following feet.',
557+
linkLabel: 'Open full GIF'
558+
};
539559
}
540560

541561
const pillars = findSubsection('stage_a', '4. Prepare the pillars');
@@ -549,6 +569,19 @@ <h1 id="pageTitle"></h1>
549569
});
550570

551571
const wallBuild = findSubsection('stage_b', '6. Build each plexiglass sandwich panel');
572+
if (wallBuild) {
573+
wallBuild.media = {
574+
src: '/videos/buidling_gifs/BEATBox_wall1.gif',
575+
alt: 'Building the first BEATBox wall panel',
576+
caption: 'First wall assembly reference.'
577+
};
578+
wallBuild.afterMedia = {
579+
src: '/videos/buidling_gifs/BEATBox_walls1-2-3.gif',
580+
alt: 'Secondary BEATBox wall assembly reference',
581+
caption: 'Secondary wall assembly reference for the remaining walls.',
582+
linkLabel: 'Open full GIF'
583+
};
584+
}
552585
addUnique(wallBuild?.items, {
553586
text: 'Resolve wall color for tracking before production: compare white, black, and gray for tracking contrast, reflections, lighting stability, and compatibility with the camera/IR setup.',
554587
level: 'todo',
@@ -607,10 +640,11 @@ <h1 id="pageTitle"></h1>
607640
level: 'critical'
608641
}, 2);
609642
}
610-
function renderMedia(media) {
643+
function renderMedia(media, variant = '') {
611644
if (!media?.src) return '';
612-
const caption = media.caption ? `<figcaption>${escapeHTML(media.caption)}</figcaption>` : '';
613-
return `<figure class="instruction-media"><img src="${escapeHTML(media.src)}" alt="${escapeHTML(media.alt || '')}" loading="lazy" />${caption}</figure>`;
645+
const link = media.linkLabel ? ` <a href="${escapeHTML(media.src)}" target="_blank" rel="noopener">${escapeHTML(media.linkLabel)}</a>` : '';
646+
const caption = media.caption || media.linkLabel ? `<figcaption>${escapeHTML(media.caption || '')}${link}</figcaption>` : '';
647+
return `<figure class="instruction-media ${escapeHTML(variant)}"><img src="${escapeHTML(media.src)}" alt="${escapeHTML(media.alt || '')}" loading="lazy" />${caption}</figure>`;
614648
}
615649
function renderItems(items, section, path='') {
616650
if (!items || !items.length) return '';
@@ -654,6 +688,7 @@ <h3>${escapeHTML(sub.title)}</h3>
654688
${sub.intro ? `<p class="intro">${escapeHTML(sub.intro)}</p>` : ''}
655689
${renderMedia(sub.media)}
656690
${renderItems(sub.items || [], section, sub.title)}
691+
${renderMedia(sub.afterMedia, 'secondary')}
657692
</div>`).join('');
658693
} else {
659694
body += renderItems(section.items || [], section, section.title);
25 MB
Loading
25.3 MB
Loading
22.1 MB
Loading

0 commit comments

Comments
 (0)