Sid Gifari From Gifari Industries - BD Cyber Security Team
Home
/
home
/
millwino
/
777games.com.pk
/
wp-content
/
plugins
/
easy-table-of-contents
/
assets
/
js
/
✏️
Editing: ez-toc-widget-sticky.min.js
if(window.ezTocWidgetStickyInitialized);else{function ready(t){"loading"!==document.readyState?t():document.addEventListener("DOMContentLoaded",t)}window.ezTocWidgetStickyInitialized=!0,ready((()=>{let t,e=null,n=!1,o=!1,i=!1;const c=document.querySelector(".ez-toc-widget-sticky nav"),s=document.querySelector(".ez-toc-widget-sticky-container");if(!c||!s)return;function r(){const t=["article",".post-content",".entry-content",".content-area",".main-content",".post-body",".article-content",".single-post",".single-page",".post",".page",'[role="main"]',"main"];for(const e of t){const t=document.querySelector(e);if(t){const e=t.getBoundingClientRect();if(e.width>0&&e.height>0)return t}else console.log("EZ TOC Widget Sticky: No element found for selector:",e)}return document.body}function l(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||window.innerWidth<=768}function d(){if(o||!l())return;const t=document.createElement("div");t.className="ez-toc-mobile-toggle-btn",t.innerHTML='\n <span class="ez-toc-mobile-toggle-icon">☰</span>\n <span class="ez-toc-mobile-toggle-text">TOC</span>\n ';const e=document.createElement("style");e.textContent="\n .ez-toc-mobile-toggle-btn {\n position: fixed;\n top: 50%;\n right: 0;\n transform: translateY(-50%);\n background: #007cba;\n color: white;\n padding: 12px 8px;\n border-radius: 8px 0 0 8px;\n cursor: pointer;\n z-index: 10000;\n box-shadow: -2px 2px 8px rgba(0,0,0,0.2);\n transition: all 0.3s ease;\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 4px;\n font-size: 12px;\n font-weight: bold;\n }\n \n .ez-toc-mobile-toggle-btn:hover {\n background: #005a87;\n transform: translateY(-50%) translateX(-2px);\n }\n \n .ez-toc-mobile-toggle-icon {\n font-size: 16px;\n line-height: 1;\n }\n \n .ez-toc-mobile-toggle-text {\n font-size: 10px;\n line-height: 1;\n }\n \n .ez-toc-widget-sticky-container.mobile-overlay {\n position: fixed !important;\n top: 0 !important;\n left: 0 !important;\n right: 0 !important;\n bottom: 0 !important;\n width: 100% !important;\n max-width: 100% !important;\n height: 100vh !important;\n z-index: 10001 !important;\n background: rgba(0,0,0,0.8) !important;\n display: flex !important;\n align-items: center !important;\n justify-content: center !important;\n padding: 20px !important;\n box-sizing: border-box !important;\n border: none !important;\n border-radius: 0 !important;\n box-shadow: none !important;\n }\n \n .ez-toc-widget-sticky-container.mobile-overlay .ez-toc-widget-sticky-content {\n background: white;\n border-radius: 12px;\n max-width: 90%;\n max-height: 80vh;\n width: 100%;\n overflow: hidden;\n display: flex;\n flex-direction: column;\n box-shadow: 0 10px 30px rgba(0,0,0,0.3);\n }\n \n .ez-toc-widget-sticky-container.mobile-overlay .ez-toc-widget-sticky-title {\n padding: 15px 20px !important;\n border-bottom: 1px solid #eee !important;\n margin: 0 !important;\n background: #f9f9f9 !important;\n border-radius: 12px 12px 0 0 !important;\n font-size: 18px !important;\n font-weight: bold !important;\n }\n \n .ez-toc-widget-sticky-container.mobile-overlay nav {\n padding: 20px !important;\n max-height: 60vh !important;\n overflow-y: auto !important;\n flex: 1;\n }\n \n .ez-toc-widget-sticky-container.mobile-overlay .ez-toc-mobile-close-btn {\n position: absolute;\n top: 15px;\n right: 15px;\n background: none;\n border: none;\n font-size: 24px;\n cursor: pointer;\n color: #666;\n padding: 0;\n width: 30px;\n height: 30px;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 50%;\n transition: background-color 0.2s ease;\n }\n \n .ez-toc-widget-sticky-container.mobile-overlay .ez-toc-mobile-close-btn:hover {\n background-color: #f0f0f0;\n }\n \n .ez-toc-widget-sticky-container.mobile-overlay {\n opacity: 0;\n visibility: hidden;\n transition: opacity 0.3s ease, visibility 0.3s ease;\n }\n \n .ez-toc-widget-sticky-container.mobile-overlay.show {\n opacity: 1;\n visibility: visible;\n }\n \n @media (max-width: 768px) {\n .ez-toc-widget-sticky-container:not(.mobile-overlay) {\n display: none !important;\n }\n }\n ",document.head.appendChild(e),document.body.appendChild(t);const n=s.innerHTML;s.innerHTML=`\n <div class="ez-toc-widget-sticky-content">\n <button class="ez-toc-mobile-close-btn" aria-label="Close Table of Contents">×</button>\n ${n}\n </div>\n `,t.addEventListener("click",(function(){s.classList.add("mobile-overlay","show"),document.body.style.overflow="hidden"}));const i=s.querySelector(".ez-toc-mobile-close-btn");function c(){s.classList.remove("show"),setTimeout((()=>{s.classList.remove("mobile-overlay"),document.body.style.overflow=""}),200)}i&&i.addEventListener("click",(function(){c()})),s.addEventListener("click",(function(t){t.target===s&&c()})),document.addEventListener("keydown",(function(t){"Escape"===t.key&&s.classList.contains("mobile-overlay")&&c()})),s.addEventListener("click",(function(t){t.target.closest("a")&&l()&&(s.classList.remove("show"),s.classList.remove("mobile-overlay"),document.body.style.overflow="")})),o=!0}function a(){if(n||!s)return;if(l())return;const t=r();if("undefined"!=typeof jQuery&&jQuery.fn.stick_in_parent){const o=jQuery;try{const i="undefined"!=typeof ezTocWidgetSticky&&ezTocWidgetSticky.fixed_top_position?parseInt(ezTocWidgetSticky.fixed_top_position):30;o(s).stick_in_parent({inner_scrolling:!1,offset_top:i,sticky_class:"is_stuck",parent:"body"}),n=!0;let c=!1;s.offsetTop,s.style.position;function e(){if(!c)return;const e=window.pageYOffset||document.documentElement.scrollTop,n=t.offsetTop+t.offsetHeight,o=s.offsetHeight;s.offsetTop;if(e+o+i>n){const t=n-o-i;s.style.top=Math.max(i,t)+"px"}else s.style.top=i+"px"}o(window).on("resize",(function(){l()?o(s).hasClass("is_stuck")&&o(s).trigger("sticky_kit:recalc"):o(s).hasClass("is_stuck")&&(o(s).trigger("sticky_kit:recalc"),e())})),o(window).on("scroll",(function(){o(s).hasClass("is_stuck")&&e()}))}catch(d){console.error("EZ TOC Widget Sticky: Error initializing sticky functionality:",d)}}else console.warn("EZ TOC Widget Sticky: jQuery or sticky-kit not available")}l()?d():a();let u=l();function f(t,e){const n=e.getBoundingClientRect(),o=t.getBoundingClientRect();return o.top>=n.top&&o.bottom<=n.bottom}window.addEventListener("resize",(function(){const t=l();if(t!==u)if(u=t,t){if(n){if("undefined"!=typeof jQuery&&jQuery.fn.stick_in_parent){jQuery(s).trigger("sticky_kit:detach")}n=!1}d()}else{if(o){const t=document.querySelector(".ez-toc-mobile-toggle-btn");t&&t.remove(),o=!1}a()}})),n||l()||setTimeout((()=>{a()}),1e3),setTimeout((()=>{n||l()||a()}),3e3),window.addEventListener("load",(()=>{n||l()||a(),!o&&l()&&d()})),setTimeout((()=>{n||l()||function(){if(!n&&s&&!l())try{const e=r(),o="undefined"!=typeof ezTocWidgetSticky&&ezTocWidgetSticky.fixed_top_position?parseInt(ezTocWidgetSticky.fixed_top_position):30;let i=!1;const c=s.offsetTop,d=s.style.position;function t(){if(l())return;const t=window.pageYOffset||document.documentElement.scrollTop,n=e.offsetTop+e.offsetHeight,r=s.offsetHeight;t>c-o&&!i?(s.style.position="fixed",s.style.top=o+"px",s.style.zIndex="9999",s.classList.add("is_stuck"),i=!0):t+r+o>n&&i?(s.style.position="absolute",s.style.top=n-r-o+"px",s.style.zIndex="9999",s.classList.add("is_stuck")):t<=c-o&&i&&(s.style.position=d,s.style.top="",s.style.zIndex="",s.classList.remove("is_stuck"),i=!1)}e.getBoundingClientRect(),window.addEventListener("scroll",t),window.addEventListener("resize",t),n=!0}catch(a){console.error("EZ TOC Widget Sticky: Error initializing fallback sticky:",a)}}()}),5e3);let p=0,g="down";function m(){t=new IntersectionObserver((t=>{if(i)return;!function(){const t=window.pageYOffset||document.documentElement.scrollTop;g=t>p?"down":"up",p=t}();const n=function(){const t=document.querySelectorAll(".ez-toc-widget-sticky nav li a"),e=new Map,n=[];t.forEach((t=>{const o=t.getAttribute("href");if(o&&o.startsWith("#")){const i=o.substring(1),c=document.getElementById(i);if(c){const o=c.getBoundingClientRect(),s=o.top+window.pageYOffset,r=o.bottom+window.pageYOffset,l=s+o.height/2;e.set(i,t),n.push({id:i,link:t,top:s,bottom:r,center:l,element:c})}}})),n.sort(((t,e)=>t.top-e.top));const o=window.pageYOffset+50;let i=null;if("down"===g){const t=document.querySelector(".ez-toc-widget-sticky nav li.active");if(t){const e=t.querySelector("a");if(e){const t=e.getAttribute("href");if(t&&t.startsWith("#")){const e=t.substring(1),c=n.find((t=>t.id===e));if(c)if(o>=c.bottom+100){const t=n.findIndex((t=>t.id===e));i=t<n.length-1?n[t+1]:c}else i=c}}}}if(!i){for(let t=0;t<n.length;t++){const e=n[t];if(e.top>=o){i=e;break}}if(!i&&n.length>0&&(i=n[n.length-1]),"up"===g&&i){const t=n.findIndex((t=>t.id===i.id));if(t>0){const e=n[t],c=n[t-1];e.top>o&&(i=c)}}}return i}();if(!n)return;const o=document.querySelectorAll(".ez-toc-widget-sticky nav li a"),s=new Map;o.forEach((t=>{const e=t.getAttribute("href");if(e&&e.startsWith("#")){const n=e.substring(1);s.set(n,t)}}));let r=n.id,l=s.get(n.id);if(l){const t=l.closest("li");if(t){const e=t.querySelectorAll("ul li a"),o=[];if(e.forEach((t=>{const e=t.getAttribute("href");if(e&&e.startsWith("#")){const t=e.substring(1),n=document.getElementById(t);if(n){const e=n.getBoundingClientRect();e.top<window.innerHeight&&e.bottom>0&&o.push(t)}}})),o.length>0){let t=null;const e=window.pageYOffset+50;for(let n=0;n<o.length;n++){const i=o[n],c=document.getElementById(i);if(c){if(c.getBoundingClientRect().top+window.pageYOffset>=e){t=i;break}}}t&&n.top<e&&(r=t,l=s.get(t))}}}const d=document.querySelectorAll(".ez-toc-widget-sticky nav li.active");if(l){d.length>0&&d.forEach((t=>{t.classList.remove("active")}));const t=l.closest("li");t&&(t.classList.add("active"),e=t,f(t,c)||t.scrollIntoView({behavior:"smooth",block:"center"}))}}),{threshold:[0,.1,.2,.3,.4,.5,.6,.7,.8,.9,1],rootMargin:"0px 0px -80% 0px"})}m();const y=[".ez-toc-section","[id] h1, [id] h2, [id] h3, [id] h4, [id] h5, [id] h6","h1[id], h2[id], h3[id], h4[id], h5[id], h6[id]",".ez-toc-heading","[id]"];y.push("[id] H1, [id] H2, [id] H3, [id] H4, [id] H5, [id] H6","H1[id], H2[id], H3[id], H4[id], H5[id], H6[id]");let h=!1;for(const e of y){const n=document.querySelectorAll(e);if(n.length>0){n.forEach((e=>{e.getAttribute("id")&&t.observe(e)})),h=!0;break}}h||console.warn("EZ TOC Widget Sticky: No heading sections found to observe"),c.addEventListener("click",(n=>{const o=n.target.closest("a");if(o){const n=o.getAttribute("href");if(n&&n.startsWith("#")){!function(t){const n=document.querySelectorAll(".ez-toc-widget-sticky nav li a"),o=document.querySelectorAll(".ez-toc-widget-sticky nav li.active");o.length>0&&o.forEach((t=>{t.classList.remove("active")}));let i=null;if(n.forEach((e=>{const n=e.getAttribute("href");n&&n.startsWith("#")&&n.substring(1)===t&&(i=e)})),i){const t=i.closest("li");t&&(t.classList.add("active"),e=t,f(t,c)||t.scrollIntoView({behavior:"smooth",block:"center"}))}}(n.substring(1))}l()&&s.classList.contains("mobile-overlay")&&(s.classList.remove("show"),s.classList.remove("mobile-overlay"),document.body.style.overflow=""),i=!0,t.disconnect(),setTimeout((()=>{i=!1,m();const e=[".ez-toc-section","[id] h1, [id] h2, [id] h3, [id] h4, [id] h5, [id] h6","h1[id], h2[id], h3[id], h4[id], h5[id], h6[id]",".ez-toc-heading","[id]"];e.push("[id] H1, [id] H2, [id] H3, [id] H4, [id] H5, [id] H6","H1[id], H2[id], H3[id], H4[id], H5[id], H6[id]");for(const n of e){const e=document.querySelectorAll(n);if(e.length>0){e.forEach((e=>{e.getAttribute("id")&&t.observe(e)}));break}}}),3e3)}})),document.addEventListener("click",(t=>{const e=t.target.closest("a");if(e&&l()&&s.classList.contains("mobile-overlay")){e.closest(".ez-toc-widget-sticky-container")&&(s.classList.remove("show"),s.classList.remove("mobile-overlay"),document.body.style.overflow="")}})),s.addEventListener("click",(t=>{t.target.closest("a")&&l()&&s.classList.contains("mobile-overlay")&&(s.classList.remove("show"),s.classList.remove("mobile-overlay"),document.body.style.overflow="")}))}))}document.addEventListener("DOMContentLoaded",(function(){const t=document.querySelector(".ez-toc-widget-sticky-container");let e=document.querySelector("article");function n(){if(!t||!e)return;const n=t.getBoundingClientRect(),o=e.getBoundingClientRect();n.top>=o.top&&n.bottom<=o.bottom?(t.style.opacity="1",t.style.pointerEvents="auto"):(t.style.opacity="0",t.style.pointerEvents="none")}document.querySelector("article")?e=document.querySelector("article"):document.querySelector(".post-content")?e=document.querySelector(".post-content"):document.querySelector(".entry-content")?e=document.querySelector(".entry-content"):document.querySelector(".single-post-content")?e=document.querySelector(".single-post-content"):document.querySelector(".content-area")&&(e=document.querySelector(".content-area")),n(),document.addEventListener("scroll",n),window.addEventListener("resize",n)}));
💾 Save
❌ Cancel