1import { Controller } from "@hotwired/stimulus"; 2 3/* stimulusFetch: 'lazy' */ 4export default class extends Controller { 5 static values = { 6 threshold: { type: Number, default: 200 }, 7 }; 8 9 connect() { 10 this.toggleVisibility(); 11 } 12 13 toggleVisibility() { 14 if (window.scrollY > this.thresholdValue) { 15 this.show(); 16 } else { 17 this.hide(); 18 } 19 } 20 21 show() { 22 this.element.classList.add("visible"); 23 } 24 25 hide() { 26 this.element.classList.remove("visible"); 27 } 28 29 scrollToTop() { 30 window.scrollTo({ 31 top: 0, 32 behavior: "smooth", 33 }); 34 } 35}
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.