PageSourceSearch

https://huudinh.github.io/assets/js/lib.min.js

js huudinh.github.io collected 2026-10-03 09:19:11 UTC 7,927 bytes, 2 lines download raw bytes

1// @ts-nocheck
2document.addEventListener("DOMContentLoaded",(function(){var e=document.getElementsByClassName("accordions-title");for(t=0;t<e.length;t++)e[t].addEventListener("click",(function(){this.classList.toggle("active");var e=this.nextElementSibling;e.style.maxHeight?e.style.maxHeight=null:e.style.maxHeight=e.scrollHeight+"px"}));var t;e=document.getElementsByClassName("accordions_lv-title");for(t=0;t<e.length;t++)e[t].addEventListener("click",(function(){this.classList.toggle("active");var e=this.nextElementSibling;"block"===e.style.display?e.style.display="none":e.style.display="block"}));let l=document.querySelectorAll("ul.tabs li");document.querySelectorAll("ul.tabs li.tab-link");for(let e of l)e.addEventListener("click",(t=>{let l=e.getAttribute("data-tab"),n=e.parentElement.children;for(let e of n)e.classList.remove("current");let o=e.parentElement.parentElement.children;for(let e of o)e.classList.remove("current");let c=document.getElementById(l);e.classList.add("current"),c.classList.add("current")}));const n=document.querySelectorAll(".tabs .tab");for(let e of n)e.addEventListener("click",(t=>{let l=t.target.parentElement.children;for(let e of l)e.classList.remove("active");e.classList.add("active")}));const o=document.querySelectorAll(".tabs .tab img");for(let e of o)e.addEventListener("click",(t=>{let l=t.target.parentElement.parentElement.children;for(let e of l)e.classList.remove("active");e.classList.add("active")}));let c=document.getElementsByClassName("modal-btn"),a=document.getElementsByClassName("modal"),r=document.getElementsByClassName("modal-close"),i=document.getElementsByClassName("modal-closePic"),s=document.getElementsByClassName("modal-bg");for(let e=0;e<c.length;e++)for(let t=0;t<a.length;t++){let l=c[e].getAttribute("data-modal"),n=a[t].getAttribute("id"),o=function(){if(l==n)return!0};c[e].addEventListener("click",(()=>{o()&&(a[t].style.display="flex")}));let d=function(e){for(let l=0;l<e.length;l++)e[l].addEventListener("click",(()=>{o()&&(a[t].style.display="none")}))};d(r),d(s),d(i)}let d=document.getElementsByClassName("modal-clip");for(let e of d){let t=e.getAttribute("data-video");t=`//www.youtube-nocookie.com/embed/${t}?rel=0&controls=1&autoplay=1&nocookie=true&mute=true`,e.addEventListener("click",(()=>{document.getElementsByTagName("body")[0].insertAdjacentHTML("beforeEnd",`\n            <div class="modal modal-clipBox" id="modal-clip" style="display:flex">\n                <div class="modal-closePic" id="modal-closePic">&times;</div>\n                <div class="modal-box modal-box-video animate-zoom">\n                    <div class="modal-video">\n                        <iframe id="youtube" src="${t}" frameborder="0" allowfullscreen></iframe>\n                    </div>\n                </div>\n                <div class="modal-bg" id="modal-bg"></div>\n            </div>\n        `),document.getElementById("modal-closePic").addEventListener("click",(()=>{document.getElementById("modal-clip").remove()})),document.getElementById("modal-bg").addEventListener("click",(()=>{document.getElementById("modal-clip").remove()}))}))}const m=e=>`\n            <div class="modal" id="modal-pic" style="display:flex">\n                <div class="modal-closePic" id="modal-closePic">&times;</div>\n                <div class="modal-bg" id="modal-bg"></div>\n                <div class="modal-box modal-box-video animate-zoom">\n                    <div class="modal-pic" style="text-align:center">\n                        <img src="${e}" style="max-width:100%" alt="img">\n                    </div>\n                </div>\n            </div>\n        `;let u=document.getElementsByClassName("modal-image");for(let e of u){let t=e.getAttribute("data-image");null==t&&(t=e.querySelector("img").src),e.addEventListener("click",(()=>{document.getElementsByTagName("body")[0].insertAdjacentHTML("beforeEnd",m(t)),document.getElementById("modal-closePic").addEventListener("click",(()=>{document.getElementById("modal-pic").remove()})),document.getElementById("modal-bg").addEventListener("click",(()=>{document.getElementById("modal-pic").remove()}))}))}}));var Accordion=function(e){var t="string"==typeof e.element?document.getElementById(e.element):e.element,l=e.openTab,n=e.oneOpen||!1,o="accordion-title",c="accordion-content";function a(e){var l,c;-1!==e.target.className.indexOf(o)&&(n?(r(),[].forEach.call(t.querySelectorAll("."+o),(function(e){e.classList.remove("active")})),e.target.classList.add("active")):e.target.classList.toggle("active"),l=e.target.nextElementSibling,c=l.scrollHeight,"0px"===l.style.height||""===l.style.height?l.style.height=c+"px":l.style.height=0)}function r(){[].forEach.call(t.querySelectorAll("."+c),(function(e){e.style.height=0}))}function i(e){return t.querySelectorAll("."+c)[e-1]}function s(e){var t=i(e);t&&(n&&r(),t.style.height=t.scrollHeight+"px")}return[].forEach.call(t.querySelectorAll("button"),(function(e){e.classList.add(o),e.nextElementSibling.classList.add(c)})),t.addEventListener("click",a),r(),l&&s(l),{open:s,close:function(e){var t=i(e);t&&(t.style.height=0)},destroy:function(){t.removeEventListener("click",a)}}};function onScroll(e,t,l){if(screen.width>1180){const n=document.querySelectorAll(e);let o=document.documentElement.scrollTop,c=document.querySelectorAll(t),a=0,r="."+l;
2c.forEach((function(e){let t=e.offsetTop-70,c=document.querySelectorAll(r);t<=o&&(c[0].classList.remove(l),n[a].classList.add(l)),a<n.length-1&&a++}))}}function scrollClick(e){const t=document.querySelectorAll(e);for(const e of t)e.addEventListener("click",l);function l(e){e.preventDefault();const t=this.getAttribute("href");if("#"!=t){const e=document.querySelector(t).offsetTop;scroll({top:e-70,behavior:"smooth"})}}}function addClass(e,t,l){let n=document.querySelectorAll(e),o=document.querySelectorAll(t);for(let e=0;e<n.length;e++)n[e].addEventListener("click",(()=>{for(let e=0;e<o.length;e++)o[e].classList.add(l)}))}function removeClass(e,t,l){let n=document.querySelectorAll(e),o=document.querySelectorAll(t);for(let e=0;e<n.length;e++)n[e].addEventListener("click",(()=>{for(let e=0;e<o.length;e++)o[e].classList.remove(l)}))}function slider(e,t,l,n,o=null){const c=document.querySelector(e),a=document.querySelectorAll(`${e} .slider__item`),r=document.querySelector(`${t} .slider__next`),i=document.querySelector(`${t} .slider__prev`),s=n?document.querySelector(n):null;if(!c||!r||!i||0===a.length)return;const d={perPage:l,widthItemChild:100/a.length,transformLeft:0,currentPage:0,totalPage:0};let m=null,u=null;const g=e=>{d.currentPage=e,d.transformLeft=e*d.perPage*d.widthItemChild,c.style.transform=`translate3d(-${d.transformLeft}%, 0, 0)`,(()=>{if(!s)return;const e=s.querySelectorAll(".slider__dot");e.forEach((e=>e.classList.remove("active"))),e[d.currentPage]&&e[d.currentPage].classList.add("active")})()},f=()=>{const e=window.innerWidth;d.perPage=e<431?1:e<768?3:l;const t=100/d.perPage;c.style.width=t*a.length+"%",d.widthItemChild=100/a.length,d.totalPage=Math.ceil(a.length/d.perPage),d.currentPage=0,d.transformLeft=0,a.forEach((e=>{e.style.width=`${d.widthItemChild}%`})),(()=>{if(s){s.innerHTML="";for(let e=0;e<d.totalPage;e++){const t=document.createElement("button");t.className="slider__dot",0===e&&t.classList.add("active"),t.dataset.index=e,t.addEventListener("click",(()=>{g(e),h()})),s.appendChild(t)}}})(),c.style.transform="translate3d(0%, 0, 0)",o&&o>0&&(clearInterval(m),clearTimeout(u),y())},v=()=>{d.currentPage++,d.currentPage>=d.totalPage&&(d.currentPage=0),g(d.currentPage)},y=()=>{!o||o<=0||(clearInterval(m),m=setInterval((()=>{v()}),o))},h=()=>{!o||o<=0||(clearInterval(m),clearTimeout(u),u=setTimeout((()=>{y()}),5e3))};r.addEventListener("click",(()=>{v(),h()})),i.addEventListener("click",(()=>{d.currentPage--,d.currentPage<0&&(d.currentPage=d.totalPage-1),g(d.currentPage),h()})),f(),window.addEventListener("resize",f),o&&o>0&&y()}

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.