Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions blocks/bus/bus.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
.bus {
overflow-x: auto;
margin: 1.5rem 0;
}

.bus table {
width: 100%;
border-collapse: collapse;
font-size: 0.875rem;
}

.bus th,
.bus td {
padding: 0.625rem 0.875rem;
text-align: left;
border: 1px solid var(--border-color, rgb(255 255 255 / 12%));
vertical-align: top;
}

.bus thead th {
background: var(--light-color, rgb(255 255 255 / 8%));
font-weight: 600;
white-space: nowrap;
}

.bus td:first-child {
font-weight: 600;
}

.bus tbody tr:hover td {
background: rgb(255 255 255 / 3%);
}
24 changes: 24 additions & 0 deletions blocks/bus/bus.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
const COLUMNS = ['Bus', 'Latency', 'Mechanism', 'Triggered By', 'Consistency Model', 'Inspect With'];

export default function decorate(block) {
const table = document.createElement('table');

const thead = table.createTHead();
const headerRow = thead.insertRow();
COLUMNS.forEach((col) => {
const th = document.createElement('th');
th.textContent = col;
headerRow.append(th);
});

const tbody = table.createTBody();
[...block.children].forEach((row) => {
const tr = tbody.insertRow();
[...row.children].forEach((cell) => {
const td = tr.insertCell();
td.innerHTML = cell.innerHTML;
});
});

block.replaceChildren(table);
}
3 changes: 3 additions & 0 deletions blocks/metadata/metadata.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function decorate(block) {
(block.closest('.metadata-wrapper') || block.parentElement).hidden = true;
}
3 changes: 2 additions & 1 deletion blocks/video-hero/video-hero.css
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
width: 100%;
margin: 0 auto;
padding: 48px 56px;

/* Dark halo behind text — keeps video vivid around edges, text readable at center */
background: radial-gradient(ellipse 100% 100% at 50% 50%, rgb(7 13 26 / 72%) 15%, transparent 80%);
border-radius: 12px;
Expand Down Expand Up @@ -85,7 +86,7 @@
}

.video-hero p {
color: #ddeeff;
color: #def;
font-size: var(--body-font-size-m);
max-width: 600px;
margin: 0 auto 0.6em;
Expand Down
7 changes: 4 additions & 3 deletions blocks/video-hero/video-hero.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ export default function decorate(block) {

// Pull video src from any anchor pointing at a video file
let videoSrc = null;
for (const row of rows) {
rows.some((row) => {
const a = row.querySelector('a[href]');
if (a && /\.(mp4|webm|ogg)(\?|#|$)/i.test(a.href)) {
videoSrc = a.href;
row.remove();
break;
return true;
}
}
return false;
});

// Flatten remaining rows into the content overlay div
const content = document.createElement('div');
Expand Down
29 changes: 28 additions & 1 deletion scripts/delayed.js
Original file line number Diff line number Diff line change
@@ -1 +1,28 @@
// add delayed functionality here
import { loadScript } from './aem.js';

const MERMAID_KEYWORDS = [
'flowchart', 'sequenceDiagram', 'graph ', 'gantt', 'classDiagram',
'stateDiagram', 'erDiagram', 'journey', 'gitGraph', 'mindmap', 'timeline',
];

const mermaidEls = [...document.querySelectorAll('pre > code')]
.filter((code) => {
const text = code.textContent.trimStart();
return MERMAID_KEYWORDS.some((kw) => text.startsWith(kw));
})
.map((code) => {
const pre = document.createElement('pre');
pre.className = 'mermaid';
// Normalize Unicode dashes that mermaid's lexer rejects inside edge labels
pre.textContent = code.textContent
.replaceAll('—', '-')
.replaceAll('–', '-');
code.parentElement.replaceWith(pre);
return pre;
});

if (mermaidEls.length > 0) {
await loadScript('https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.min.js');
window.mermaid.initialize({ startOnLoad: false, theme: 'dark' });
await window.mermaid.run({ nodes: mermaidEls });
}
17 changes: 17 additions & 0 deletions styles/lazy-styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,20 @@ main blockquote {
background-color: rgb(0 212 200 / 20%);
color: #fff;
}

/* Mermaid diagrams */
pre.mermaid {
background: transparent;
border: none;
text-align: center;
padding: 1rem 0;
}

pre.mermaid::before {
display: none;
}

pre.mermaid svg {
max-width: 100%;
height: auto;
}