feat: auto-load poll results
This commit is contained in:
@@ -49,6 +49,16 @@ export function isInViewport(el: HTMLElement) {
|
||||
)
|
||||
}
|
||||
|
||||
export function isPartiallyInViewport(el: HTMLElement) {
|
||||
const rect = el.getBoundingClientRect()
|
||||
return (
|
||||
rect.top < (window.innerHeight || document.documentElement.clientHeight) &&
|
||||
rect.bottom > 0 &&
|
||||
rect.left < (window.innerWidth || document.documentElement.clientWidth) &&
|
||||
rect.right > 0
|
||||
)
|
||||
}
|
||||
|
||||
export function isEmail(email: string) {
|
||||
return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user