mirror of
https://github.com/priyanshujain/sanderling.git
synced 2026-10-05 04:27:09 +00:00
feat(docs): click-to-fullscreen for all article images
This commit is contained in:
1 parent
86e42c468d
commit
a8fd4de1af
2 files changed
+11
No files matched your search
@@ -132,6 +132,7 @@ main article img {
|
|||||||
display: block;
|
display: block;
|
||||||
margin: 1.25rem 0;
|
margin: 1.25rem 0;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
|
cursor: zoom-in;
|
||||||
}
|
}
|
||||||
|
|
||||||
a { color: var(--accent); }
|
a { color: var(--accent); }
|
||||||
|
|||||||
Vendored
+10
@@ -84,6 +84,16 @@ for (const diagram of document.querySelectorAll('.mermaid')) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (const img of document.querySelectorAll('article img')) {
|
||||||
|
img.addEventListener('click', () => {
|
||||||
|
overlay.innerHTML = '';
|
||||||
|
const clone = img.cloneNode();
|
||||||
|
clone.style.cssText = 'max-width:95vw;max-height:95vh;width:auto;height:auto;border-radius:6px;';
|
||||||
|
overlay.appendChild(clone);
|
||||||
|
overlay.classList.add('open');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
document.getElementById('theme-toggle').addEventListener('click', () => {
|
document.getElementById('theme-toggle').addEventListener('click', () => {
|
||||||
const next = document.documentElement.dataset.theme === 'dark' ? 'light' : 'dark';
|
const next = document.documentElement.dataset.theme === 'dark' ? 'light' : 'dark';
|
||||||
document.documentElement.dataset.theme = next;
|
document.documentElement.dataset.theme = next;
|
||||||
|
|||||||
Reference in new issue
Block a user