tech4biz/blog/assets/js/main.js
2024-10-25 17:11:31 +05:30

44 lines
1.4 KiB
JavaScript

// const body = document.body;
// const siteContainer = document.querySelector('.ss-inner');
// const contentContainer = document.querySelector('.content-container');
// let state = {
// scroll: {
// height: 0,
// offset: 0,
// speed: 0.095,
// }
// }
// function adjustSiteContainer(container, maxWidth) {
// if (window.innerWidth < maxWidth) {
// return;
// }
// let difference = window.innerWidth - maxWidth;
// container.style.marginLeft = `${difference / 2}px`;
// container.style.width = `${maxWidth}px`;
// }
// document.addEventListener('DOMContentLoaded', function () {
// adjustSiteContainer(siteContainer, "100%");
// state.scroll.height = contentContainer.getBoundingClientRect().height;
// body.style.height = `${Math.floor(state.scroll.height / 2)}px`;
// });
// function renderLoop() {
// state.scroll.offset += Math.floor((window.pageYOffset - state.scroll.offset) * state.scroll.speed);
// contentContainer.style.transform = `translateY(-${state.scroll.offset}px)`;
// requestAnimationFrame(renderLoop);
// }
// renderLoop();
// window.addEventListener('resize', function () {
// state.scroll.height = contentContainer.getBoundingClientRect().height;
// body.style.height = Math.floor(state.scroll.height) / 2 + "px";
// adjustSiteContainer(siteContainer, "100%");
// });