summaryrefslogtreecommitdiff
path: root/layouts/_partials/scripts
diff options
context:
space:
mode:
authorEltrac <eltrac@vmi3030963.contaboserver.net>2026-02-10 16:03:25 +0800
committerEltrac <eltrac@vmi3030963.contaboserver.net>2026-02-10 16:03:25 +0800
commit229e3ac00a9361aa59f6add3a87fb9e1ff539f6c (patch)
treec537037db370156c149be7d007539c7d6575a5ca /layouts/_partials/scripts
parent783e1f1f8acd635f67e002d047450fa98dc56290 (diff)
parent9a0f7b785ed13f0506b2c7ab8c7da6b0ca398450 (diff)
Merge branch 'master' of https://src.eltr.ac/eltrac/geedeapro
Diffstat (limited to 'layouts/_partials/scripts')
-rw-r--r--layouts/_partials/scripts/libra-js.html6
-rw-r--r--layouts/_partials/scripts/toc-js.html41
2 files changed, 0 insertions, 47 deletions
diff --git a/layouts/_partials/scripts/libra-js.html b/layouts/_partials/scripts/libra-js.html
deleted file mode 100644
index 95e121ed..00000000
--- a/layouts/_partials/scripts/libra-js.html
+++ /dev/null
@@ -1,6 +0,0 @@
-<script type="module">
-document.addEventListener('DOMContentLoaded', async () => {
- const { default: LightBox } = await import('/js/libra.min.js');
- const lightbox = new LightBox({ offset: { x: -8, y: -80 } });
-});
-</script>
diff --git a/layouts/_partials/scripts/toc-js.html b/layouts/_partials/scripts/toc-js.html
deleted file mode 100644
index 110f2357..00000000
--- a/layouts/_partials/scripts/toc-js.html
+++ /dev/null
@@ -1,41 +0,0 @@
-{{ if .Params.toc }}
-<script>
-document.addEventListener('DOMContentLoaded', () => {
- const toc = document.getElementById('toc');
- if (!toc) return;
-
- const headings = document.querySelectorAll('h2, h3');
- const observer = new IntersectionObserver(entries => {
- entries.forEach(entry => {
- if (!entry.isIntersecting) return;
-
- const id = entry.target.id;
- const tocLink = toc.querySelector(`a[href="#${id}"]`);
- if (!tocLink) return;
-
- const listItem = tocLink.parentElement;
- const isH2 = entry.target.tagName === 'H2';
-
- // Clear all active states when a new H2 is encountered
- if (isH2) {
- toc.querySelectorAll('li.active').forEach(el => el.classList.remove('active'));
- }
-
- // Set current item as active
- listItem.classList.add('active');
-
- // If this is an H3, find and activate its parent H2
- if (!isH2) {
- const parentH2Item = listItem.closest('ul').previousElementSibling?.closest('li');
- if (parentH2Item) parentH2Item.classList.add('active');
- }
- });
- }, {
- rootMargin: '0px 0px -50% 0px',
- threshold: 0.5
- });
-
- headings.forEach(heading => observer.observe(heading));
-});
-</script>
-{{ end }}