1jQuery(function ($) { 2 3 const normPath = (p) => (p || "").replace(/\/$/, ""); 4 5 const getStopOffset = () => { 6 const navH = $("#nav-fixed").outerHeight() || 0; 7 8 const isSP = window.matchMedia("(max-width: 768px)").matches; 9 10 // SP:8vh / PC:5vhï¼å ã³ã¼ãã®ã¾ã¾ï¼ 11 const vh = isSP 12 ? window.innerHeight * 0.08 13 : window.innerHeight * 0.05; 14 15 return navH + vh; 16 }; 17 18 // â å¾ããçæããããªã³ã¯ãæ¾ããããã«ãå§è²ã 19 $(document).on("click", "a[href*='#']", function (e) { 20 21 const targetId = this.hash; 22 if (!targetId || targetId === "#") return; 23 24 // åä¸ãã¼ã¸ã ãå¯¾è±¡ï¼æ«å°¾ã¹ã©ãã·ã¥å·®ãå¸åï¼ 25 if (normPath(window.location.pathname) !== normPath(this.pathname)) return; 26 27 const $target = $(targetId); 28 if (!$target.length) return; 29 30 // â ãã©ã¦ã¶æ¨æºã¸ã£ã³ããå ã«æ¢ãã 31 e.preventDefault(); 32 33 // â 飿ãªã©ã§ã¬ã¿ã¤ããªãããã«æ¢ãã 34 $("html, body").stop(true, false); 35 36 const position = $target.offset().top - getStopOffset(); 37 38 $("html, body").animate({ 39 scrollTop: position 40 }, 41 1000, 42 "swing", 43 function () { 44 // â URLã« # ãåæ ï¼æ¨æºã¸ã£ã³ãã¯èµ·ãããªãï¼ 45 if (history && history.pushState) { 46 history.pushState(null, "", targetId); 47 } 48 } 49 ); 50 }); 51 52});
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.