PageSourceSearch

https://www.kleer.la/js/utils.js

js kleer.la collected 2026-09-25 18:40:48 UTC 1,047 bytes, 36 lines download raw bytes

1const anchors = document.querySelectorAll('a[href^="#"]')
2
3anchors.forEach(anchor => {
4    anchor.addEventListener('click', function (e) {
5        e.preventDefault();
6
7        const targetId = this.getAttribute('href').substr(1);
8        const navbarHeight = 160
9        const targetElement = document.getElementById(targetId);
10
11        if (targetElement) {
12            const offset = targetElement.getBoundingClientRect().top - navbarHeight;
13
14            window.scrollBy({
15                top: offset,
16                behavior: 'smooth'
17            });
18        }
19    })
20})
21
22document.addEventListener('DOMContentLoaded', function () {
23    if (window.location.hash) {
24        const fragment = window.location.hash;
25        window.location.hash = '';
26        const targetElement = document.querySelector(fragment);
27        if (targetElement){
28            const offset = targetElement.getBoundingClientRect().top - 160;
29
30            window.scrollBy({
31                top: offset,
32                behavior: 'smooth'
33            })
34        }
35    }
36});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.