Landing page

This commit is contained in:
Tejas Panchal
2025-07-24 19:41:17 +05:30
parent 1c0e1cfe14
commit d502d2dbc5
161 changed files with 14116 additions and 12747 deletions

View File

@@ -0,0 +1,32 @@
export function toggleScrollbar(isOpen) {
const getScrollbarWidth = () => {
return window.innerWidth - document.documentElement.clientWidth;
};
const body = document.body;
if (isOpen) {
const scrollbarWidth = getScrollbarWidth();
body.style.paddingRight = `${scrollbarWidth}px`;
body.classList.add("overflow-y-hidden");
const style = document.createElement("style");
style.id = "hide-scrollbar";
style.innerHTML = `::-webkit-scrollbar { display: none; }`;
document.head.appendChild(style);
} else {
body.style.paddingRight = "0";
body.classList.remove("overflow-y-hidden");
const styleElement = document.getElementById("hide-scrollbar");
if (styleElement) {
styleElement.remove();
}
}
}
export function cleanupScrollbar() {
const body = document.body;
body.style.paddingRight = "0";
body.classList.remove("overflow-y-hidden");
const styleElement = document.getElementById("hide-scrollbar");
if (styleElement) {
styleElement.remove();
}
}