Делаю плавную прокрутку страницы, консоль выдает ошибку Uncaught TypeError: Cannot read properties of undefined (reading 'getBoundingClientRect'). Подскажите в чем проблема? Спасибо
const body = document.body,
jsScroll = document.getElementsByClassName('.page')[0],
height = jsScroll.getBoundingClientRect().height - 1,
speed = 0.05
var offset = 0
body.style.height = Math.floor(height) + "px"
function smoothScroll() {
offset += (window.scrollY - offset) * speed
var scroll = "translateY(-" + offset + "px) translateZ(0)"
jsScroll.style.transform = scroll
raf = requestAnimationFrame(smoothScroll)
}
smoothScroll()