The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
export function isElementInViewport(element: HTMLElement) {
const { top, left, width, height } = element.getBoundingClientRect()
const { innerWidth, innerHeight } = window
return (
((top >= 0 && top < innerHeight) || (top < 0 && top + height > 0)) &&
((left >= 0 && left < innerWidth) || (left < 0 && left + width > 0))
)
}