dependabot/npm_and_yarn/eslint-plugin-astro-1.5.0
dependabot/npm_and_yarn/eslint-9.39.1
dependabot/npm_and_yarn/eslint-plugin-astro-1.5.0
dependabot/npm_and_yarn/eslint/js-9.39.1
dependabot/npm_and_yarn/katex-0.16.25
dependabot/npm_and_yarn/sharp-0.34.5
dependabot/npm_and_yarn/tailwindcss/vite-4.1.17
dependabot/npm_and_yarn/tsx-4.20.6
dependabot/npm_and_yarn/typescript-eslint-8.46.4
dependabot/npm_and_yarn/typescript-eslint/eslint-plugin-8.36.0
dependabot/npm_and_yarn/typescript-eslint/parser-8.46.4
main
| 1 | <script> |
| 2 | function bindFootnoteEvents() { |
| 3 | const footnoteLinks = document.querySelectorAll('[data-footnote-ref], [data-footnote-backref]') |
| 4 | |
| 5 | footnoteLinks.forEach((link) => { |
| 6 | link.addEventListener('click', (e) => { |
| 7 | e.preventDefault() |
| 8 | const href = link.getAttribute('href') |
| 9 | if (!href) return |
| 10 | |
| 11 | const target = document.querySelector(href) |
| 12 | if (!target) return |
| 13 | |
| 14 | // Use fixed offset of 128px |
| 15 | const offset = 128 |
| 16 | |
| 17 | const targetPosition = target.getBoundingClientRect().top + window.scrollY - offset |
| 18 | |
| 19 | window.scrollTo({ |
| 20 | top: targetPosition |
| 21 | }) |
| 22 | }) |
| 23 | }) |
| 24 | } |
| 25 | |
| 26 | document.addEventListener('astro:page-load', () => { |
| 27 | bindFootnoteEvents() |
| 28 | }) |
| 29 | |
| 30 | document.addEventListener('DOMContentLoaded', () => { |
| 31 | bindFootnoteEvents() |
| 32 | }) |
| 33 | </script> |